Make Token Transfers

The object antenna.iotx contains functions to create, sign, and send actions to the IoTeX blockchain.

import Antenna from "iotex-antenna";
import { toRau } from "iotex-antenna/lib/account/utils";

(async () => {
  const antenna = new Antenna("");
  const unlockedWallet = await antenna.iotx.accounts.privateKeyToAccount(
  const newWallet = antenna.iotx.accounts.create("any entropy");

  const actionHash = await antenna.iotx.sendTransfer({
    from: unlockedWallet.address,
    to: newWallet.address,
    value: toRau("1", "iotx"),
    gasLimit: "100000",
    gasPrice: toRau("1", "Qev")

To see the result of the transfer action, you can either go to the iotex explorer or query the blockchain using antenna sdk like:

const action = await antenna.iotx.getActions({
  byHash: {
    checkingPending: true

Last updated