How to get fungible token attributes?

  • getAttribute

import { L1XProvider, FTTokenGetAttributeArg } from "@l1x/l1x-wallet-sdk";

let l1xProvider = new L1XProvider({
  clusterType: "mainnet",
  endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});

let params: FTTokenGetAttributeArg = {
  contract_address: "2e15a979ebc2de6ebafb373dae52e0c1809096c9",
};

l1xProvider.tokens.FT.getAttribute(params)
  .then((response) => console.log(response)) // log response
  .catch((err) => console.error(err)); // log error

Parameters:

Token attribute query parameters.

{
    "contract_address": "2e15a979ebc2de6ebafb373dae52e0c1809096c9"
}

Returns:

A promise that resolves with token attribute response.

{
    "name": "Exnox",
    "symbol": "EXN",
    "decimals": 18,
    "total_supply": "1000"
}

Last updated