sendTransaction method
Implementation
Future<String> sendTransaction(String currentAddress) async {
try {
print(currentAddress);
var sig = await ethereum!.request("eth_sendTransaction", [
{
'from': EthereumAddress.fromHex(
currentAddress), // The user's active address.
'to': EthereumAddress.fromHex(
'0xcef69697b4CE8e1393B6E50898c6F733A40AD9d8'), // Required except during contract publications.
'value':
'0x18dfb3c7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000000007e4bfe56a2a0278dec8e5db66aa0bbbf12cbb2cd0000000000000000000000007e4bfe56a2a0278dec8e5db66aa0bbbf12cbb2cd0000000000000000000000007e4bfe56a2a0278dec8e5db66aa0bbbf12cbb2cd000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000c4b61d27f60000000000000000000000007e4bfe56a2a0278dec8e5db66aa0bbbf12cbb2cd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024db7dd6b50000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c4b61d27f60000000000000000000000007e4bfe56a2a0278dec8e5db66aa0bbbf12cbb2cd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024c03c30030000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c4b61d27f60000000000000000000000007e4bfe56a2a0278dec8e5db66aa0bbbf12cbb2cd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024c03c300300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', // Only required to send ether to the recipient from the initiating external account.
// 'gasPrice':
// '0x09184e72a000', // Customizable by the user during MetaMask confirmation.
// 'gas':
// '0x2710', // Customizable by the user during MetaMask confirmation.
}
]);
print("seig");
print(sig);
return sig.toString();
} catch (e) {
print(e);
return "";
}
}