一键导入
gdex-bridge
Cross-chain bridging — get estimates and execute native token transfers between EVM chains, Solana, and Sui via ChangeNow
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Cross-chain bridging — get estimates and execute native token transfers between EVM chains, Solana, and Sui via ChangeNow
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
HyperLiquid perpetual futures — open/close positions, set leverage, place market and limit orders with TP/SL, and manage open orders
CSS theming system for GDEX trading UIs — dark/light modes, trading colors, responsive breakpoints, and Tailwind CSS configuration
Troubleshoot GDEX SDK errors — error codes, encryption debugging, chain-specific quirks, HL gotchas, and copy trade pitfalls
Start here — GDEX overview, architecture, supported chains, available skills, and quickstart for cross-chain DeFi trading via managed-custody wallets
HyperLiquid HIP-3 outcome / event markets — list markets, place outcome orders, and manage outcome positions
Deposit and withdraw USDC to/from HyperLiquid for perpetual futures trading — constraints, amounts, and managed-custody flow
| name | gdex-bridge |
| description | Cross-chain bridging — get estimates and execute native token transfers between EVM chains, Solana, and Sui via ChangeNow |
Bridge native tokens between supported chains with quote previews and time estimates. Uses ChangeNow as the bridge provider (StarGate support exists but is currently disabled).
@gdexsdk/gdex-skill installed| Method | Path | Purpose |
|---|---|---|
GET | /v1/bridge/estimate_bridge | Get a bridge quote |
POST | /v1/bridge/request_bridge | Execute a bridge (encrypted) |
GET | /v1/bridge/bridge_orders | List bridge order history |
import { GdexSkill, GDEX_API_KEY_PRIMARY } from '@gdexsdk/gdex-skill';
const skill = new GdexSkill();
skill.loginWithApiKey(GDEX_API_KEY_PRIMARY);
const estimate = await skill.estimateBridge({
fromChainId: 1, // Ethereum
toChainId: 8453, // Base
amount: '1000000000000000000', // 1 ETH in wei
});
| Parameter | Type | Required | Description |
|---|---|---|---|
fromChainId | number | Yes | Source chain ID |
toChainId | number | Yes | Destination chain ID |
amount | string | Yes | Amount in raw token units (wei for EVM, lamports for Solana) |
interface BridgeEstimate {
tool: string; // "ChangeNow"
fromChainId: number;
fromAmount: string; // input amount (raw units)
toChainId: number;
estimateAmount: string; // estimated output (raw units)
minEstimateTime: number; // seconds
maxEstimateTime: number; // seconds
}
| Code | Meaning |
|---|---|
| 101 | Missing params / same chain / unsupported chain |
| 106 | ChangeNow API error |
| 107 | Unsupported chain (e.g., Fraxtal 252) or catch-all |
The bridge endpoint requires an AES-encrypted computedData payload containing ABI-encoded parameters and a secp256k1 signature — the same pattern as managed spot trades.
import {
GdexSkill,
GDEX_API_KEY_PRIMARY,
generateGdexSessionKeyPair,
buildGdexSignInMessage,
buildGdexSignInComputedData,
} from '@gdexsdk/gdex-skill';
import { ethers } from 'ethers';
// After sign-in (you have sessionPrivateKey from the auth flow):
const result = await skill.requestBridge({
fromChainId: 1, // Ethereum
toChainId: 8453, // Base
amount: '1000000000000000000', // 1 ETH in wei
userId: controlAddress,
sessionPrivateKey,
apiKey: GDEX_API_KEY_PRIMARY,
});
if (result.isSuccess) {
console.log('TX hash:', result.hash);
console.log(`ETA: ${result.minTime}-${result.maxTime}s`);
}
The SDK handles this automatically, but for reference:
['string', 'uint64', 'uint64', 'string'] → [amount, fromChainId, toChainId, nonce]"request_bridge-{userId.toLowerCase()}-{dataHex}" using secp256k1 session key{ userId, data, signature } → AES-256-CBC with key/IV derived from SHA256(apiKey){ computedData: "<hex>" }interface BridgeResult {
isSuccess: boolean;
hash: string | null; // source chain tx hash
message: string;
minTime?: number; // seconds
maxTime?: number; // seconds
error?: string; // on failure
}
| Code | Meaning |
|---|---|
| 101 | Missing params / same chain / unsupported chain |
| 102 | Invalid or reused nonce |
| 103 | User wallet not found on chain |
| 104 | Unauthorized (signature verification failed) |
| 105 | Below minimum bridge amount / insufficient balance |
import { buildGdexUserSessionData, GDEX_API_KEY_PRIMARY } from '@gdexsdk/gdex-skill';
const data = buildGdexUserSessionData(sessionKey, GDEX_API_KEY_PRIMARY);
const orders = await skill.getBridgeOrders({
userId: controlAddress,
data,
});
console.log(`${orders.count} bridge orders`);
orders.bridgeOrders.forEach(o => {
console.log(`${o.fromChainId} → ${o.toChainId}: ${o.fromAmount} (tx: ${o.txHash})`);
});
interface BridgeOrdersResponse {
count: number;
bridgeOrders: BridgeOrder[];
}
interface BridgeOrder {
userId: string;
fromChainId: number;
toChainId: number;
fromAmount: string;
estimateToAmount: string;
fromWallet: string;
toWallet: string;
txHash: string;
requestTime: number;
}
Controlled by backend config.bridgeSupportedChainIds. Known supported:
| Chain | ChainId |
|---|---|
| Ethereum | 1 |
| Optimism | 10 |
| BSC | 56 |
| Sonic | 146 |
| Base | 8453 |
| Arbitrum | 42161 |
| Berachain | 80094 |
| Solana | 622112261 |
| Sui | 1313131213 |
Fraxtal (252) is explicitly blocked by the backend and will return error code 107.
"1000000000000000000"), lamports for Solana (1 SOL = "1000000000").minBridge config (default 1 in native decimals). Below this triggers error 105.requestBridge call uses a unique nonce verified server-side. The SDK generates this automatically.estimateBridge works with API key only (E2E verified). No session key or full sign-in needed for quotes.requestBridge requires full managed-custody auth (session key + ABI encoding + AES encryption).GET /v1/bridge/estimate_bridge, POST /v1/bridge/request_bridge, GET /v1/bridge/bridge_orders. Do NOT use /v1/bridge/estimate or /v1/bridge/execute.estimateBridge to check feasibility before committing. If estimateAmount is too low (high fee), consider alternative routes.