transfer
transfer
is a method on the ARIO
class that transfers ARIO tokens from the authenticated wallet to another specified wallet address.
transfer
requires authentication.
Parameters
← Swipe to see more →
Parameter | Type | Description | Optional |
---|---|---|---|
target | string - WalletAddress | The wallet address to transfer tokens to | false |
quantity | number | The amount of ARIO tokens to transfer (in smallest units) | false |
tags | array | An array of GQL tag objects to attach to the transfer AO message | true |
← Swipe to see more →
Examples
transfer
const fs = require('fs');
const { ARIO, ArweaveSigner } = require('@ar.io/sdk');
async function main() {
const jwk = JSON.parse(fs.readFileSync('KeyFile.json'));
const ario = ARIO.init({
signer: new ArweaveSigner(jwk),
});
const { id: txId } = await ario.transfer({
target: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3',
quantity: 1000000000 // 1000 ARIO tokens
});
console.log(txId);
}
main();
Output
{
id: 'Q44fpJLfq8wt-3RXA5a7ReiN7wmwkgxQA2jPYW51R-Q',
result: 'You transferred 1000000000 to nszYSUJvtlFXssccPaQWZaVpkXgJHcVM7XhcP5NEt7w'
}