Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ethereum Web3j类型转移的sendFunds方法未定义_Ethereum_Web3 Java - Fatal编程技术网

Ethereum Web3j类型转移的sendFunds方法未定义

Ethereum Web3j类型转移的sendFunds方法未定义,ethereum,web3-java,Ethereum,Web3 Java,我尝试使用Web3j将以太从一个帐户发送到另一个帐户,但在transfer.sendFunds()中似乎出现了问题。它将显示错误消息 “类型转账中未定义transfer.sendFunds()方法” 当我宣布转让时 public class Main { private final static String PRIVATE_KEY="8326a396188a31f2277a15cef4150ea9b07ec3c6241ba5991211fa11c49ba5d6";

我尝试使用Web3j将以太从一个帐户发送到另一个帐户,但在transfer.sendFunds()中似乎出现了问题。它将显示错误消息 “类型转账中未定义transfer.sendFunds()方法”

当我宣布转让时

public class Main {
    private final static String PRIVATE_KEY="8326a396188a31f2277a15cef4150ea9b07ec3c6241ba5991211fa11c49ba5d6";
    String password="passphrases";
    String source="Wallet/path";
    private final static BigInteger GAS_LIMIT=BigInteger.valueOf(6721975L);
    private final static BigInteger GAS_PRICE=BigInteger.valueOf(20000000000L);
    private final static String RECIPIENT="0x9f183cCb672070331616c02d149C69b149e6F897";
    public static void main(String[] args) {
        try {
            new Main();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    private Main() throws Exception {
        Web3j web3j=Web3j.build(new HttpService("http://localhost:7545"));
        TransactionManager transactionManager =new RawTransactionManager(
                web3j,
                getCredentialsFromPrivateKey()      
        );
        Transfer transfer =new Transfer(web3j, transactionManager);
        Credentials credentials = WalletUtils.loadCredentials(password, source);
        TransactionReceipt transactionReceipt =  transfer.sendFunds(
                        RECIPIENT,
                        BigDecimal.ONE,
                        Convert.Unit.ETHER,
                        GAS_PRICE,
                        GAS_LIMIT
                ).send();
    }
    private Credentials getCredentialsFromWallet() throws IOException, CipherException {
        return WalletUtils.loadCredentials(password,source);
    }
    private Credentials getCredentialsFromPrivateKey() {
        return Credentials.create(PRIVATE_KEY);
    }
}
Transfer transfer = new Transfer(web3j,TransactionManager);
它显示错误消息“无法实例化类型传输”
我不太清楚为什么我错了。

请编辑您的问题并以文本形式输入代码(您可以在编辑器中使用标记或
{}
符号),以便其他人可以轻松复制粘贴部分或整个代码,并更轻松地解决您的问题。感谢提醒