When I called the sendTransaction() method, I found that the structure of SendTransaction does not have "value" field,which caused the calldata of transaction cannot be sent.
declare type SendTransaction = { chainId?: number; to: string; account?:0x${string}; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; nonce?: number; value?: bigint; confirmations?: number; };
the structure I wanted is below:
declare type SendTransaction = {
chainId?: number;
to: string;
account?: 0x${string};
gas?: bigint;
gasPrice?: bigint;
maxFeePerGas?: bigint;
maxPriorityFeePerGas?: bigint;
nonce?: number;
value?: bigint;
confirmations?: number;
// the data field is what I want
data: string;
}
Description
When I called the sendTransaction() method, I found that the structure of SendTransaction does not have "value" field,which caused the calldata of transaction cannot be sent.
The code is below:
const callData =
data:application/json,{"p":"ierc-20","op":"transfer","tick":"${inscriptionName}","nonce":"${timestamp}","to":[{"amt":"${amount.value}","recv":"${address.value}"}]}
my params is below:
const transaction = { to: constants.AddressZero, value: ethers.utils.parseEther("0"), data: stringToHex(callData) }
the structure of SendTransaction is below:
declare type SendTransaction = { chainId?: number; to: string; account?:
0x${string}; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; nonce?: number; value?: bigint; confirmations?: number; };
the structure I wanted is below:declare type SendTransaction = { chainId?: number; to: string; account?:
0x${string}
; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; nonce?: number; value?: bigint; confirmations?: number; // the data field is what I want data: string; }