This function transfers gas (ex. ETH / VTHO / GAS / โฆโ ) from one address to another. The destination can be any blockchain address, a wallet, or a smart contract, it can even be an email address.
๐ง In case the chain doesn't have a distinct gas token the native token will be used in the transfer.
1
signer.executeGasTransfer({
2
walletId:'6683c01d-2e10-4982-9b3a-c6ecd45896bb',
3
to:'AN2VD52SLntUGFwzZyjzsRqBBkUzjKpKpT',
4
value:18,
5
secretType:'NEO',
6
})
Copied!
๐ง You donโt have to take into account the number of decimals for different tokens, Venly handles that for you.
Example: If a token has 18 decimals and you want to transfer 1 token, provide the value 1. Venly will translate this to the correct non-decimal value (1 * 10e18).
Redirect options you want to pass. Only available when using a REDIRECT signerโ
Example
1
const signer = venlyConnect.createSigner();
2
โ
3
signer.executeGasTransfer({
4
walletId:'6683c01d-2e10-4982-9b3a-c6ecd45896bb',
5
to:'AN2VD52SLntUGFwzZyjzsRqBBkUzjKpKpT',
6
value:18,
7
secretType:'NEO',
8
}).then((signerResult)=>{
9
if(signerResult.success){
10
console.log(`Transaction ${signerResult.result.transactionHash} has been successfully executed!`);
11
}else{
12
console.warn(`Something went wrong while executing the transaction`);
13
}
14
}).catch((reason)=>{
15
console.log(error);
16
});
Copied!
๐ง Using the network parameter, the node to which the transaction is sent can be set manually. It allows you to submit a transaction to any mainnet or testnet node of your choosing, public or private. ( Ethereum only)