GDEX: Token Import
Register a user-defined custom token so it is recognised by the backend's
token-details, balances, and portfolio endpoints. Useful for long-tail tokens
that are not yet indexed.
When to Use
- A user wants to see a brand-new (or otherwise un-indexed) token in their
portfolio or token-search results
- Pre-registering a token before launch so trading UI can resolve metadata
Prerequisites
@gdexsdk/gdex-skill installed
- Authenticated via shared API key or wallet sign-in — see
gdex-authentication
- The token's on-chain address (contract address on EVM, mint address on
Solana, object id on Sui)
Backend Endpoints
| Method |
Path |
Purpose |
POST |
/v1/import_token |
Register a user-imported custom token |
SDK Usage
import { GdexSkill, buildImportTokenComputedData } from '@gdexsdk/gdex-skill';
const skill = new GdexSkill();
skill.loginWithApiKey(process.env.GDEX_API_KEY!);
// Structured shape — SDK builds computedData internally
await skill.importToken({
tokenAddress: '0xCustomToken',
chainId: 8453,
managed: {
apiKey: process.env.GDEX_API_KEY!,
walletAddress: '0xWallet',
sessionPrivateKey: '0x…',
userId: '0xWallet',
},
});
// Or raw shape — caller pre-built computedData
await skill.importToken({
computedData: buildImportTokenComputedData({
apiKey: process.env.GDEX_API_KEY!,
walletAddress: '0xWallet',
sessionPrivateKey: '0x…',
userId: '0xWallet',
tokenAddress: '0xCustomToken',
chainId: '8453',
}),
chainId: 8453,
});
Notes
import_token uses managed-custody encrypted computedData:
ABI ['import_token', [tokenAddress, chainId, nonce]],
sig message import_token-${userId}-${data}.
- The backend deduplicates imports per
(userId, chain, tokenAddress).
- After import, queries such as
getTokenDetails, getBalances, and
getPortfolio will start returning data for the token (subject to
indexer latency).
1---2name: gdex-token-import3description: Import user-defined custom tokens so they appear in token details, balances, and portfolio across the platform4---56# GDEX: Token Import78Register a user-defined custom token so it is recognised by the backend's9token-details, balances, and portfolio endpoints. Useful for long-tail tokens10that are not yet indexed.1112## When to Use1314- A user wants to see a brand-new (or otherwise un-indexed) token in their15 portfolio or token-search results16- Pre-registering a token before launch so trading UI can resolve metadata1718## Prerequisites1920- `@gdexsdk/gdex-skill` installed21- Authenticated via shared API key or wallet sign-in — see22 **gdex-authentication**23- The token's on-chain address (contract address on EVM, mint address on24 Solana, object id on Sui)2526## Backend Endpoints2728| Method | Path | Purpose |29|--------|------|---------|30| `POST` | `/v1/import_token` | Register a user-imported custom token |3132## SDK Usage3334```typescript35import { GdexSkill, buildImportTokenComputedData } from '@gdexsdk/gdex-skill';3637const skill = new GdexSkill();38skill.loginWithApiKey(process.env.GDEX_API_KEY!);3940// Structured shape — SDK builds computedData internally41await skill.importToken({42 tokenAddress: '0xCustomToken',43 chainId: 8453,44 managed: {45 apiKey: process.env.GDEX_API_KEY!,46 walletAddress: '0xWallet',47 sessionPrivateKey: '0x…',48 userId: '0xWallet',49 },50});5152// Or raw shape — caller pre-built computedData53await skill.importToken({54 computedData: buildImportTokenComputedData({55 apiKey: process.env.GDEX_API_KEY!,56 walletAddress: '0xWallet',57 sessionPrivateKey: '0x…',58 userId: '0xWallet',59 tokenAddress: '0xCustomToken',60 chainId: '8453',61 }),62 chainId: 8453,63});64```6566## Notes6768- `import_token` uses managed-custody **encrypted `computedData`**:69 ABI `['import_token', [tokenAddress, chainId, nonce]]`,70 sig message `import_token-${userId}-${data}`.71- The backend deduplicates imports per `(userId, chain, tokenAddress)`.72- After import, queries such as `getTokenDetails`, `getBalances`, and73 `getPortfolio` will start returning data for the token (subject to74 indexer latency).