This function is used to retrieve the allowance for spending tokens on behalf of an owner.
import { L1XProvider, FTTokenGetAllowanceArg } from "@l1x/l1x-wallet-sdk";
let l1xProvider = new L1XProvider({
clusterType: "mainnet",
endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});
let params: FTTokenGetAllowanceArg = {
contract_address: "2e15a979ebc2de6ebafb373dae52e0c1809096c9",
owner_address: "346fb07c43e88b58c058e8d6c4bf2f5080a01999",
spender_address: "f060c5232a76cd8cfb931c1e199cfd5dc2e4ee07",
};
l1xProvider.tokens.FT.getAllowance(params)
.then((response) => console.log(response)) // log response
.catch((err) => console.error(err)); // log error
Allowance query parameters.
{
"contract_address": "2e15a979ebc2de6ebafb373dae52e0c1809096c9",
"owner_address": "346fb07c43e88b58c058e8d6c4bf2f5080a01999",
"spender_address": "f060c5232a76cd8cfb931c1e199cfd5dc2e4ee07"
}
{
"value": "34253522",
"decimals": 12,
"normalized_value": "253826612223"
}