Utilities
Utilities
import { getTokenBalance, getTokenInfo, estimateGasCost, getAllowence } from '@storyhunt/wrapper-sdk';
const balance = await getTokenBalance();
console.log('Native token balance:', balance.value.toString());
const info = await getTokenInfo(ADDRESSES.TOKENS.FATE.id);
console.log(`FATE: ${info.symbol} (${info.name}), decimals: ${info.decimals}`);
const allowance = await getAllowence(ADDRESSES.TOKENS.USDC.id, ADDRESSES.V3_SWAP_ROUTER_CONTRACT_ADDRESS);
console.log('USDC allowance for V3 Router:', allowance.toString());
const gas = await estimateGasCost({
address: ADDRESSES.V3_SWAP_ROUTER_CONTRACT_ADDRESS,
abi: [], // Provide ABI for the function youβre calling
functionName: 'someFunction',
args: []
});
console.log('Estimated gas:', gas?.toString());