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
@gemachdao/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 '@gemachdao/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 platform4metadata:5 source: https://skillmd.com/skills/jiayaoqijia/gdex-token-import6---78# GDEX: Token Import910Register a user-defined custom token so it is recognised by the backend's11token-details, balances, and portfolio endpoints. Useful for long-tail tokens12that are not yet indexed.1314## When to Use1516- A user wants to see a brand-new (or otherwise un-indexed) token in their17 portfolio or token-search results18- Pre-registering a token before launch so trading UI can resolve metadata1920## Prerequisites2122- `@gemachdao/gdex-skill` installed23- Authenticated via shared API key or wallet sign-in — see24 **gdex-authentication**25- The token's on-chain address (contract address on EVM, mint address on26 Solana, object id on Sui)2728## Backend Endpoints2930| Method | Path | Purpose |31|--------|------|---------|32| `POST` | `/v1/import_token` | Register a user-imported custom token |3334## SDK Usage3536```typescript37import { GdexSkill, buildImportTokenComputedData } from '@gemachdao/gdex-skill';3839const skill = new GdexSkill();40skill.loginWithApiKey(process.env.GDEX_API_KEY!);4142// Structured shape — SDK builds computedData internally43await skill.importToken({44 tokenAddress: '0xCustomToken',45 chainId: 8453,46 managed: {47 apiKey: process.env.GDEX_API_KEY!,48 walletAddress: '0xWallet',49 sessionPrivateKey: '0x…',50 userId: '0xWallet',51 },52});5354// Or raw shape — caller pre-built computedData55await skill.importToken({56 computedData: buildImportTokenComputedData({57 apiKey: process.env.GDEX_API_KEY!,58 walletAddress: '0xWallet',59 sessionPrivateKey: '0x…',60 userId: '0xWallet',61 tokenAddress: '0xCustomToken',62 chainId: '8453',63 }),64 chainId: 8453,65});66```6768## Notes6970- `import_token` uses managed-custody **encrypted `computedData`**:71 ABI `['import_token', [tokenAddress, chainId, nonce]]`,72 sig message `import_token-${userId}-${data}`.73- The backend deduplicates imports per `(userId, chain, tokenAddress)`.74- After import, queries such as `getTokenDetails`, `getBalances`, and75 `getPortfolio` will start returning data for the token (subject to76 indexer latency).