MCPcopy Create free account
hub / github.com/cardstack/cardstack / getTokenInfo

Method getTokenInfo

packages/cardpay-sdk/sdk/assets.ts:27–34  ·  view source on GitHub ↗
(tokenAddress: string)

Source from the content-addressed store, hash-verified

25 }
26
27 async getTokenInfo(tokenAddress: string): Promise<{ decimals: number; name: string; symbol: string }> {
28 const tokenContract = new this.web3.eth.Contract(ERC20ABI as AbiItem[], tokenAddress);
29 return {
30 decimals: Number(await tokenContract.methods.decimals().call()),
31 name: await tokenContract.methods.name().call(),
32 symbol: await tokenContract.methods.symbol().call(),
33 };
34 }
35}

Callers

nothing calls this directly

Calls 2

symbolMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected