Skip to main content
Glama

OKX-DEX-SDK MCP SSE Server

by 0xobedient
get_bridge_token_pairs.ts•1.01 kB
import { createOKXClient } from "./../../shared/common/okxClient"; import { BaseWallet } from "./../../shared/common/wallet"; import { ENV } from "./../../shared/env"; import { OKXDexClient } from "@okx-dex/okx-dex-sdk"; import { Connection, Keypair } from "@solana/web3.js"; import bs58 from "bs58"; export async function get_bridge_token_pairs(fromChainId: string) { try { const connection = new Connection(ENV.RPC_ENDPOINT_URI); const keypair = Keypair.fromSecretKey(bs58.decode(ENV.WALLET_PRIVATE_KEY)); const baseWallet = new BaseWallet(keypair, connection); const client: OKXDexClient = createOKXClient(baseWallet); const pairs = await client.bridge.getBridgeTokenPairs(fromChainId); return JSON.stringify({ status: "success", data: pairs, message: "OKX_BRIDGE_GET_BRIDGE_TOKEN_PAIRS_SUCCEEDED", }); } catch (error) { return JSON.stringify({ status: "error", error, message: "OKX_BRIDGE_GET_BRIDGE_TOKEN_PAIRS_ERROR", }); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xobedient/okx-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server