eckoDEX SDK

Initializing a eckoDEX SDK client

Initializing a eckoDEX SDK client is super simple and straightforward.

import { KaddexSdk } from 'kaddex-sdk';

const kaddex = new KaddexSdk({ account, secretKey:  );

await kaddex.swap({ ... });

You can also pass your account and/or secret key into the initializer to avoid the need to pass them into each function call.

import dotenv from 'dotenv';
import { KaddexSdk } from 'kaddex-sdk';

dotenv.config();

const PUBLIC_KEY = process.env.PUBLIC_KEY;
const SECRET_KEY = process.env.SECRET_KEY;

// if your account name is different from your PUBLIC_KEY, use the correct value here
const account = await retrieveVerifiedAccount({ accountName: PUBLIC_KEY });

const kaddex = new KaddexSdk({ account, secretKey: SECRET_KEY });

await kaddex.swap({ ... });

A client instance includes all the core methods you'll need for interacting with the swap.

pagecreatePairpageaddLiquiditypageremoveLiquiditypageswappageswapExactInpageswapExactOut

Last updated