SNIP20 (SCRT Tokens)

Learn how to send SNIP20 tokens with SecretJS.

Secret Network Client Setup

import { SecretNetworkClient, Wallet } from "secretjs";

const wallet = new Wallet("Your mnemonic words go here");

const secretjs = new SecretNetworkClient({
  chainId: "pulsar-3",
  url: "https://pulsar.lcd.secretnodes.com",
  wallet: wallet,
  walletAddress: wallet.address,
});

Transfer SNIP-20 tokens

const txExec = await secretjs.tx.snip20.transfer(
      {
        sender: secretjs.address,
        contract_address,
        msg: { transfer: { recipient: accounts[1].address, amount: "2" } },
      },
      {
        gasLimit: 5_000_000,
      },
    );

Send SNIP-20 Tokens

Set Viewing Key and Query Balance

Query Token Parameters

Get Transaction History

Last updated

Was this helpful?