Overview
The WardenSwap SDK is a Javascript/Typescript library that provides developers the seamless way of integrating the most sophisticated best rate AI swap into your application or DeFi with ease.
Last updated
The WardenSwap SDK is a Javascript/Typescript library that provides developers the seamless way of integrating the most sophisticated best rate AI swap into your application or DeFi with ease.
Last updated
WardenSwap SDK will be your best way to equip the Best Rate AI power to bring your platform to the next level.
Ethereum (Mainnet)
Binance Smart Chain
Polygon
Avalanche
Optimism
Arbitrum
Let's say the user want to swap 1,000 BUSD to WAD on your dashboard in Binance Smart Chain
You can integrate WardenSwap SDK to help get the quote, then send the swap transaction with normal Web3.js or Ethers.js. So for now the key functionality of the SDK is to get you the best rate quote.
Connecting Wallet can be done with Ethers.js, Web3.js or related libraries.
Approve BUSD will required user to approve spending by sending the approve transaction to the BUSD contract to be spent by WardenSwap contract. In case the user already approved or swapping BNB, no need for approval.
Get Quote can be done with WardenSwap SDK, it will return you the amountOut
which is the full amount of the destination token to display to users. Note that the amountOut
is the estimated value.
Swap is when you request user to confirm the swap transaction built from quote response and send to WardenSwap contract with function swap
or swapSplit
.
Here is the minimal sample code for BNB Smart Chain integration to help you understand how to use it quickly.
Warden SDK is already available for public use. To participate in the profit sharing program, please submit the form here:
Warden Router Contract:
Warden Router Contract:
Warden Router Contract:
Warden Router Contract:
Warden Router Contract:
Warden Router Contract:
For testing without using actual tokens, see section.
In order to use your own implementation to perform swap, ABI of WardenSwap contract can be found at etherscan links in section.
Available functions can be found in Section