안녕하세요.
String input = contract.encodeABI("transfer", account, new BigInteger(convertAmount));
FeeDelegatedSmartContractExecution fdsce = new FeeDelegatedSmartContractExecution.Builder()
.setKlaytnCall(caver.rpc.klay)
.setFrom(senderKeyring.getAddress())
.setTo(toAddress)
.setGas(sendOption.getGas())
.setInput(input)
.setFeePayer(feePayerKeyring.getAddress())
.build();
caver.wallet.sign(senderKeyring.getAddress(), fdsce);
caver.wallet.signAsFeePayer(feePayerKeyring.getAddress(), fdsce);
String decoded = fdsce.getRLPEncoding();
Bytes32 txHash_executed = caver.rpc.klay.sendRawTransaction(decoded).send();
위 소스처럼 FeeDelegatedSmartContractExecution을 호출하려고 합니다.
Contract contract = KIP7.create(caver, token.getAbi(), tokenContractAddress);
caver.wallet.add(senderKeyring);
caver.wallet.add(feePayerKeyring);
contract.getDefaultSendOptions().setFrom(senderKeyring.getAddress());
contract.getDefaultSendOptions().setFeeDelegation(true);
contract.getDefaultSendOptions().setFeePayer(feePayerKeyring.getAddress());
contract.setWallet(caver.wallet);
SendOptions sendOptions = determineSendOptions(contract, contract.getDefaultSendOptions(), method, Arrays.asList(toAddress, amount));
AbstractTransaction signData = contract.getMethod(method).sign(Arrays.asList(toAddress, amount), sendOptions);
// AbstractTransaction feePayersignData = contract.getMethod(method).signAsFeePayer(Arrays.asList(toAddress, amount), sendOptions); // 이 방법도 해보았는데 동일하게 에러가 발생했습니다 ㅜㅜ
String decoded = signData.getRLPEncoding();
Bytes32 txHash_executed = caver.rpc.klay.sendRawTransaction(decoded).send();
위 방법으로 txHash값을 가져오고 싶은데
"{"jsonrpc":"2.0","id":7,"error":{"code":-32000,"message":"invalid fee payer"}}"
위와 같은 feepayer가 없다고 나오네요…
어느 부분이 잘못되었을까요?