transfer

transfer is a method on the ARIO class that transfers mARIO to the designated target recipient address.

transfer requires authentication.

Parameters

ParameterTypeDescriptionOptional
targetString - WalletAddressRecipient wallet address to send `mARIO` to.false
qtynumberThe number of `mARIO` tokens to transfer.false
tagsarrayAn array of GQL tag objects to attach to the transfer AO message.true

Examples

transfer

 const fs = require("fs");
 const { ARIO, ArweaveSigner, ARIOToken } = require("@ar.io/sdk");

 async function main() {
 const jwk = JSON.parse(fs.readFileSync("KeyFile.json"));
 const ario = ARIO.init({
     signer: new ArweaveSigner(jwk),
 });

 const result = await ario.transfer(
     {
     target: "nszYSUJvtlFXssccPaQWZaVpkXgJHcVM7XhcP5NEt7w",
     qty: new ARIOToken(1000).toMARIO(), //converts ARIO to mARIO
     },
     // Optional tags
     {
     tags: [{ name: "App-Name", value: "My-Awesome-App" }],
     }
 );
 console.log(result);
 }

 main();

Output

{
  id: 'Q44fpJLfq8wt-3RXA5a7ReiN7wmwkgxQA2jPYW51R-Q',
  result: 'You transferred 1000000000 to nszYSUJvtlFXssccPaQWZaVpkXgJHcVM7XhcP5NEt7w'
}