TOKENS

A token registry for convenience.

export const TOKENS: Record<string, any> = {
  ABC: {
    name: 'ABC',
    code: 'kswap.abc',
    precision: 12
  },
  XYZ: {
    name: 'XYZ',
    code: 'kswap.xyz',
    precision: 12
  },
  KDA: {
    name: 'KDA',
    code: 'coin',
    precision: 12
  },
  FLUX: {
    name: 'FLUX',
    code: 'runonflux.flux',
    precision: 12
  },
  ...
};

You can define and work with your own tokens by creating a new config with your token's values in your own code.

const MYTOKEN = {
  name: 'MYTOKEN',
  code: 'my.token',
  precision: 12
};

await kaddex.swapExactIn({
  token0: {
    token: KDA,
    amount: 1.0
  },
  token1: {
    token: MYTOKEN,
    amount: 0.1
  },
  slippage: '0.01'
});

Last updated