File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff 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 ( {
You can’t perform that action at this time.
0 commit comments