🔑
New Bitcoin City Developers
  • Keys API
    • Get Top Key Holders
    • Search Key Holders
    • Track New Key Holders
    • Get Trade History Data
    • Get Trade History by Address
    • Get Chart Key by Address
    • Get Chart Token by Address
    • Get List Token Balance by Address
    • Get User Profile
    • Get Tweet Like Retweet
    • Get Number Tweet Post Comment
    • Get List Bull Bear (Mr Market)
    • Get Bull Bear Detail
    • Get List Raffle
    • Get Raffle Detail
    • Get List Spin Wheel
    • Get Spin Wheel Detail
  • Keys Contract Interaction
    • Get Keys Holding by User
    • Get Buying Price
    • Get Selling Price
    • Buy Key
    • Sell Key
    • Estimate Swap Key
    • Execute Swap Key
    • Multicall
    • Staking Open
    • Staking Close
    • Staking Order Create
    • Staking Order Close
  • PlaceHolder Chrome Extension
  • Prompts
  • Demo site
    • Demo
Powered by GitBook
On this page
  • Contract function
  • Contract address
  • Parameters
  • Sample code
  1. Keys Contract Interaction

Estimate Swap Key

Estimate the key amount you'll receive for a swap transaction.

Contract function

amountOutForSwapTokens

Contract address

0x9b727dcaC7b331f95786D3b01fA79191Ab527DA3

Parameters

tokenIn: key input address
tokenIn: key output address
amountIn: amount input

Sample code

const amountOutMin = await amountOutForSwapTokens({tokenIn: baseToken.address, 
tokenOut: quoteToken.address, amountIn: parseEther(baseAmount).toString()});
PreviousSell KeyNextExecute Swap Key

Last updated 1 year ago