Skip to main content
Version: 3.5.0

Transfer AVT

Transfer an amount of AVT from the sender account to the destination account.

await api.send.transferAvt(recipientAddress, amount);
important

This operation uses a relayer account that the sender authorizes to submit the transfer transaction. You can learn more about relayers HERE.

important

You can get the AVN_GATEWAY_URL and Relayer here.

const { AvnApi, SetupMode, SigningMode } = require("avn-api");
const AVN_GATEWAY_URL = "https://testnet.gateway.aventus.io";

const singleUserOptions = {
suri: "0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24", // this is from the generated example account
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};

const avnSdk = new AvnApi(AVN_GATEWAY_URL, singleUserOptions);
const RECIPIENT_ADDRESS = "replace with recipient's address"
const amount = "123400000"; // the integer wei value of the amount. Decimals (e.g. 2.4) are not supported.

async function main() {
await avnSdk.init();
const api = await avnSdk.apis();
const request_id = await api.send.transferAvt(RECIPIENT_ADDRESS, amount));
console.log(request_id)
}

(async () => {
await main();
})();


You have now successfully submitted a transaction to the AVN.

tip

You can query the state of your transaction here using the returned result.