executeGasTransfer
Transfer gas from one destination to another
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).

Signature

1
signer.executeGasTransfer(gasTransferRequestDto, options?): Promise<SignerResult>
Copied!

Returns

1
Promise<SignerResult>
Copied!

Parameters

Parameter
Required
Description
True
The transfer request you want to execute. For more info on how this request should look like, see gasTransferRequestDto .
​options​
False
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)

Object Types