File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717- added: Quote ID display in gift card transaction details with card-level copy
1818- changed: Distinguish network vs service errors in gift card scenes
1919- changed: Lock network fee to high priority for gift card purchases
20+ - changed: Pad gift card purchase quantity by 0.00000002 to mitigate underpayments
2021- changed: Manage tokens scene saves changes on explicit save instead of live toggling
2122- changed: Unify split wallet scene titles and add chain-specific descriptions for EVM and UTXO splits
2223- changed: ramps: Infinite buy support enabled
Original file line number Diff line number Diff line change 11import { useQuery } from '@tanstack/react-query'
2- import { ceil , mul } from 'biggystring'
2+ import { add , ceil , mul } from 'biggystring'
33import type { EdgeTransaction , EdgeTxActionGiftCard } from 'edge-core-js'
44import * as React from 'react'
55import {
@@ -497,8 +497,13 @@ export const GiftCardPurchaseScene: React.FC<Props> = props => {
497497 ] ?. denominations [ 0 ] ?. multiplier ?? '1'
498498 : wallet . currencyInfo . denominations [ 0 ] ?. multiplier ?? '1'
499499
500- // quantity from API is in decimal units, convert to native
501- const quantity = orderResponse . quantity . toFixed ( DECIMAL_PRECISION )
500+ // Quantity from API is in decimal units, convert to native.
501+ // HACK: Pad by 0.00000002 to guarantee we never underpay due to either
502+ // unexplained drifts on our side or unreported drifts on their side.
503+ const quantity = add (
504+ orderResponse . quantity . toFixed ( DECIMAL_PRECISION ) ,
505+ '0.00000002'
506+ )
502507 const nativeAmount = String ( ceil ( mul ( quantity , multiplier ) , 0 ) )
503508
504509 // Calculate expiry time (quoteExpiry is Unix timestamp in milliseconds)
You can’t perform that action at this time.
0 commit comments