문의 내용은 제목과 같습니다.
조금 더 상세하게 문의를 드리면 아래 코드에서 수수료 대납 Transaction을 생성하여 Back-end로 전송해서 FeePayer가 signAsFeePayer()를 수행하고자 합니다.
const signedTransaction = await caver.rpc.klay.signTransaction({
type: 'FEE_DELEGATED_SMART_CONTRACT_EXECUTION',
from: from,
to: to,
data: caver.abi.encodeFunctionCall({
name: 'store',
type: 'function',
inputs: [{"internalType": "uint256", "name": "num", "type": "uint256"}],
}, [newValue.toString()]),
gas: '300000',
feePayer: feePayer,
});
caver-core\src\index.d.ts 파일 일부
export interface RLPEncodedTransaction {
raw: string
tx: {
typeInt: number
type: string
nonce: string
gasPrice: string
gas: string
to: string
value: string
from: string
signatures: SignatureForRPC[]
hash: string
}
}
위의 RLPEncodedTransaction 인스턴스를 아래 이미지와 같이 RLP Encoded String으로 변환해서 Back-end의 API를 통해 전송하고자 합니다만, 관련 함수가 지원되지 않는 듯 합니다.
* RLP Encoded String으로 발신하려는 의도는 물론 Body Class를 정의하지 않고,
* caver.transaction.feeDelegatedSmartContractExecution.decode( rlpEncoded ) 함수를 통해 FeeDelegatedSmartContractExecution 인스턴스를 생성한 다음
* caver.wallet.signAsFeePayer(keyring.address, instance) 로 대납자의 서명을 하기 위함입니다.
Tx sender 측은 caver-js@1.6.7
Back-end 측은 “com.klaytn.caver:core:1.6.3” (caver-java) 를 사용하고 있습니다.
제가 잘못 이해하고 있는 부분이 있다면 설명을 부탁 드리며,
다른 방안이 있다면 소개를 부탁 드립니다.