other amount

This commit is contained in:
Adrian Brzeziński 2023-01-10 01:02:31 +01:00
parent ba5facc4e2
commit 0cf973f0c4
1 changed files with 3 additions and 0 deletions

View File

@ -56,6 +56,8 @@ const fetchMangoRoutes = async (
wallet = PublicKey.default.toBase58()
) => {
{
const defaultOtherAmount =
swapMode === 'ExactIn' ? 0 : Number.MAX_SAFE_INTEGER
const paramsString = new URLSearchParams({
inputMint: inputMint.toString(),
outputMint: outputMint.toString(),
@ -64,6 +66,7 @@ const fetchMangoRoutes = async (
feeBps: feeBps.toString(),
mode: swapMode,
wallet: wallet,
otherAmountThreshold: defaultOtherAmount.toString(),
}).toString()
const response = await fetch(`${MANGO_ROUTER_API_URL}/swap?${paramsString}`)