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.

venlyConnect.signer.executeGasTransfer({ walletId: '6683c01d-2e10-4982-9b3a-c6ecd45896bb', to: 'AN2VD52SLntUGFwzZyjzsRqBBkUzjKpKpT', value: 18, secretType: 'NEO', })

๐Ÿ“˜

๐Ÿง™ 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:

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

Returns:

Promise<SignerResult>

Parameters:

ParameterRequiredDescription
gasTransferRequestDtoTrueThe transfer request you want to execute. For more info on how this request should look like, see gasTransferRequestDto .
optionsFalseRedirect options you want to pass. Only available when using a REDIRECT signer

Example:

venlyConnect.signer.executeGasTransfer({ walletId: '6683c01d-2e10-4982-9b3a-c6ecd45896bb', to: 'AN2VD52SLntUGFwzZyjzsRqBBkUzjKpKpT', value: 18, secretType: 'NEO', }).then((signerResult) => { if (signerResult.success) { console.log(`Transaction ${signerResult.result.transactionHash} has been successfully executed!`); } else { console.warn(`Something went wrong while executing the transaction`); } }).catch((reason) => { console.log(error); });

๐Ÿ“˜

๐Ÿง™ 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

๐Ÿ“˜


Did this page help you?