UNPKG

@okx-dex/okx-dex-sdk

Version:
27 lines (26 loc) 867 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("../../index"); require("dotenv/config"); const client = new index_1.OKXDexClient({ apiKey: process.env.OKX_API_KEY, secretKey: process.env.OKX_SECRET_KEY, apiPassphrase: process.env.OKX_API_PASSPHRASE, projectId: process.env.OKX_PROJECT_ID }); async function main() { try { const quote = await client.dex.getQuote({ chainId: '195', // Tron Chain ID amount: '10000000000', fromTokenAddress: 'T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb', // TRON toTokenAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', // USDT slippage: '0.1', }); console.log('Swap Quote:', JSON.stringify(quote, null, 2)); } catch (error) { console.error('Error:', error); } } main();