LogoLogo
eckoDAOeckoDEXeckoWalleteckoGOV
  • ๐Ÿ‘พWelcome
    • eckoDAO - Introduction
    • Product Suite
    • $KDX Tokenomics
      • $KDX Token Distribution
      • $KDX Liquidity Mining
    • Governance
  • ๐Ÿ”„eckoDEX
    • Introduction
    • eckoDEX Litepaper
      • Why eckoDEX?
        • Problems in DeFi
        • Solution: Long Term Scalability
        • Solution: Gas-free
        • Solution: Slippage Control
        • Solution: Decentralised Infrastructure
        • Solution: Secure Smart Contracts
      • Industry Outlook
        • DEX Market Potential
        • eckoDEX: The Next Generation of DEXes
      • Vision
    • Platform
    • How to Swap
      • X-Swap
      • The eckoDEX Wrapper
    • Migrate liquidity from eckoDEX Beta to Mainnet V1
    • How to Add Liquidity
      • Single-Sided Liquidity
      • Understanding Liquidity Provision and Impermanent Loss
    • Governance Mining
      • Understanding Governance Mining
  • ๐Ÿ’ฐeckoWALLET
    • Introduction
    • eckoWALLET API
    • Quicksign: KIP-0015
    • WalletConnect
    • FAQ
  • ๐Ÿ›๏ธeckoGOV
    • ๐Ÿ‘‹Welcome to eckoGOV
      • ๐Ÿ“šLitepaper Overview
    • ๐Ÿš€Getting Started
      • ๐Ÿ“‹Minimum Requirements
      • ๐Ÿ“ฅLogin
      • ๐ŸŒSpaces
        • ๐Ÿ’ฐSpaces Treasury
      • ๐Ÿ‘ฅMembers
        • ๐Ÿ” Edit Profile
    • ๐Ÿง‘โ€๐ŸซRole System
      • 1๏ธL1 - eckoMEMBER
      • 2๏ธL2 - eckoLEAD
      • 3๏ธL3 - eckoCORE
      • ๐ŸงฎVoting Power
      • ๐Ÿ™‹Applying for a eckoDAO Role
      • ๐Ÿ”ŽKYC
    • ๐ŸŒ€Proposal Epoch
      • ๐Ÿ—ƒ๏ธProposal Categories
      • ๐Ÿ“‘Creating Proposals
        • ๐ŸงพProposal Template
        • ๐Ÿ‘Proposal Example
      • ๐Ÿ“ŠVoting on Proposals
      • ๐Ÿ—ฃ๏ธDiscourse - Proposal Discussion
    • ๐Ÿ’ฐUsing the KDX Treasury
    • ๐Ÿ“„Smart Contracts
  • ๐Ÿ”’Security & Contracts
    • Bug Bounty
    • Audits
  • ๐ŸคMarketing
    • Social & Communities
    • eckoDAO Brand Assets
    • eckoWALLET Brand Assets
  • โšกSDK
    • Overview
    • Quickstart
    • Reference
      • eckoDEX SDK
        • createPair
        • addLiquidity
        • removeLiquidity
        • swap
        • swapExactIn
        • swapExactOut
      • retrieveVerifiedAccount
      • TOKENS
Powered by GitBook
On this page
  1. SDK
  2. Reference

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'
});
PreviousretrieveVerifiedAccount

Last updated 11 months ago

โšก