LogoLogo
  • Welcome to FlowX Finance
    • ๐Ÿ”ฎProtocol Overview
    • ๐Ÿ•ถ๏ธOur Advantages
    • ๐ŸšฉGetting Started
    • ๐Ÿ—บ๏ธRoadmap
  • PROTOCOL
    • โš–๏ธSwap
    • ๐Ÿ›žDEX Aggregator
    • ๐ŸŽฐLucky Swap
    • โš—๏ธLiquidity Pools
    • ๐ŸŽš๏ธPosition Management
    • ๐ŸชฃFarming as a Service
    • ๐Ÿ’ฐEarning Protocol Fee
    • ๐ŸTrading Competition
    • ๐Ÿ’ฌReferral
  • Tokenomics
    • ๐Ÿš‡FLX Token
    • ๐ŸšŠxFLX Governance Token
  • CONTRACT
    • ๐Ÿ“„GenesiX Farming
    • ๐Ÿ“„Swap
  • ๐Ÿ”ฆGuide
    • How to add Liquidity V3
  • REFERENCES
    • ๐Ÿ›ก๏ธAudit
    • ๐Ÿ–ผ๏ธMedia Kit
    • ๐ŸคPartners
    • ๐ŸงฐSDK
    • ๐Ÿ–ฅ๏ธAggregator Widget
  • ARCHIVED
    • Claim Token
    • ๐ŸงชGenesiX Farming
  • Developer
    • Overview
    • FlowX SDK
      • Getting Started
      • Retrieve coin
      • Swap Aggregator
      • AMM Management
        • Pool Management
        • Position Management
      • CLMM Management
        • Pool Management
        • Position Management
      • Auto Invest
      • Limit Order
  • FlowX Widget
  • Privacy & Terms
    • Risk Disclaimer
    • Terms of Service
  • Social
    • Website
    • Twitter
    • Telegram Channel
    • Discord
Powered by GitBook
On this page
  • Example Code
  • Example Response

Was this helpful?

  1. Developer
  2. FlowX SDK

Retrieve coin

Example Code

const coins = await coinProvider.getCoins({
  coinTypes: ['0x2::sui::SUI'],
});

Example Response

It will return Coin[] instances, with Coinintance you can do a lot of thing not just JSON

Key Properties:

  1. coinType: Identifies the coin type.

  2. decimals: The number of decimal places (e.g., 18 decimals for Ether).

  3. symbol, name, description, iconUrl: Optional information about the coin, like its name, symbol, description, and an icon URL.

  4. derivedPriceInUSD, derivedSUI: Optional values for the coinโ€™s price in USD or SUI.

  5. isVerified: Marks if the coin is verified.

Main Methods:

  1. sortsBefore: Compares this coin with another to see which comes first in a sorted list.

  2. wrapped: Returns the coin itself (currently does nothing extra).

  3. equals: Checks if this coin is the same as another by comparing their coinType.

  4. fetchAllOwnedCoins: Retrieves all the coins owned by an address.

  5. take: Transfers a specified amount of coins to a transaction, making sure the balance is enough and handling the SUI-specific coins appropriately.

PreviousGetting StartedNextSwap Aggregator

Last updated 1 month ago

Was this helpful?