get_token_address
Retrieve the Aptos Mainnet address for supported tokens (USDC, USDT, WBTC, USDe, USD1) to enable gasless transaction integration using the SmoothSend SDK.
Instructions
Get the Aptos Mainnet fungible asset address for a supported token (USDC, USDT, WBTC, USDe, USD1). Required when using ScriptComposerClient.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | The token symbol to look up. |
Implementation Reference
- src/tools.ts:401-427 (handler)Handler function that retrieves token address and decimals from the TOKENS lookup table, validates the symbol, and returns formatted information with usage example for ScriptComposerClient.
export function handleGetTokenAddress(args: { symbol: string }): string { const token = TOKENS[args.symbol] if (!token) { return `Unknown token "${args.symbol}". Supported tokens: ${Object.keys(TOKENS).join(', ')}` } return [ `## ${args.symbol} on Aptos Mainnet`, ``, `**Asset Address:**`, `\`${token.address}\``, ``, `**Decimals:** ${token.decimals}`, ``, `**Usage in ScriptComposerClient:**`, `\`\`\`typescript`, `const build = await client.buildTransfer({`, ` sender: walletAddress,`, ` recipient: '0xRecipient',`, ` amount: '1${'0'.repeat(token.decimals)}', // 1 ${args.symbol} (${token.decimals} decimals)`, ` assetType: '${token.address}',`, ` decimals: ${token.decimals},`, ` symbol: '${args.symbol}',`, `});`, `\`\`\``, ].join('\n') } - src/tools.ts:274-289 (schema)Tool definition with name, description, and JSON Schema input validation specifying the symbol parameter must be one of the supported tokens (USDC, USDT, WBTC, USDe, USD1).
{ name: 'get_token_address', description: 'Get the Aptos Mainnet fungible asset address for a supported token (USDC, USDT, WBTC, USDe, USD1). Required when using ScriptComposerClient.', inputSchema: { type: 'object' as const, properties: { symbol: { type: 'string', enum: ['USDC', 'USDT', 'WBTC', 'USDe', 'USD1'], description: 'The token symbol to look up.', }, }, required: ['symbol'], }, }, - src/index.ts:60-62 (registration)Tool routing in the CallToolRequestSchema handler that maps 'get_token_address' tool calls to the handleGetTokenAddress function.
case 'get_token_address': text = handleGetTokenAddress(args as { symbol: string }) break - src/tools.ts:3-25 (helper)Data store containing token metadata (decimals and on-chain addresses) for USDC, USDT, WBTC, USDe, and USD1 on Aptos Mainnet, used by the handler for lookups.
// Token addresses on Aptos Mainnet const TOKENS: Record<string, { decimals: number; address: string }> = { USDC: { decimals: 6, address: '0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b', }, USDT: { decimals: 6, address: '0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b', }, WBTC: { decimals: 8, address: '0x68c2185f5e2023f2e4401ba56b66c8ae2cfcf8a27852e70eb78b03f59a652a3d', }, USDe: { decimals: 6, address: '0xf37a4a75f89b79985c1fcb42d0a87f4bde28cc2b46c4dd01d9a8428e7726e2e9', }, USD1: { decimals: 6, address: '0x05fa02d0fa44a90ad59fb90adb08e24c4efbc98eb9e9f2d0d9c0ad18d7fc9d2', }, }