Skip to content

Commit dcfc9fe

Browse files
committed
Fixed Reverse Quoting in pairInfo
1 parent 99c1f52 commit dcfc9fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/swap/central/easybit.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,19 @@ export function makeEasyBitPlugin(
200200
sendNetwork: string
201201
receiveNetwork: string
202202
amount: string
203+
isFromQuote: boolean
203204
}): Promise<PairInfoData> {
204-
const { request, amount } = params
205+
const { request, amount, isFromQuote } = params
205206
const queryParams = new URLSearchParams({
206207
send: params.send,
207208
receive: params.receive,
208209
sendNetwork: params.sendNetwork,
209210
receiveNetwork: params.receiveNetwork
210211
})
212+
if (!isFromQuote) {
213+
queryParams.set('amountType', 'receive') // Reverse Quoting
214+
}
215+
211216
const url = `${apiBase}/pairInfo?${queryParams.toString()}`
212217
const response = await fetchCors(url, { method: 'GET', headers })
213218
if (!response.ok) {
@@ -372,6 +377,7 @@ export function makeEasyBitPlugin(
372377
sendNetwork: codes.fromMainnetCode,
373378
receiveNetwork: codes.toMainnetCode,
374379
amount,
380+
isFromQuote: quoteFor === 'from'
375381
})
376382

377383
const rate = await getRate({

0 commit comments

Comments
 (0)