@metamask/ramps-controller 21.0.0 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -1
- package/dist/RampsController-method-action-types.d.ts +62 -1
- package/dist/RampsController-method-action-types.d.ts.map +1 -1
- package/dist/RampsController-method-action-types.js.map +1 -1
- package/dist/RampsController.d.ts +129 -7
- package/dist/RampsController.d.ts.map +1 -1
- package/dist/RampsController.js +392 -23
- package/dist/RampsController.js.map +1 -1
- package/dist/RampsService.d.ts +6 -0
- package/dist/RampsService.d.ts.map +1 -1
- package/dist/RampsService.js.map +1 -1
- package/dist/TransakService.d.ts +3 -1
- package/dist/TransakService.d.ts.map +1 -1
- package/dist/TransakService.js +10 -3
- package/dist/TransakService.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/order-syncing/constants.d.ts +23 -0
- package/dist/order-syncing/constants.d.ts.map +1 -0
- package/dist/order-syncing/constants.js +23 -0
- package/dist/order-syncing/constants.js.map +1 -0
- package/dist/order-syncing/controller-integration.d.ts +91 -0
- package/dist/order-syncing/controller-integration.d.ts.map +1 -0
- package/dist/order-syncing/controller-integration.js +364 -0
- package/dist/order-syncing/controller-integration.js.map +1 -0
- package/dist/order-syncing/index.d.ts +7 -0
- package/dist/order-syncing/index.d.ts.map +1 -0
- package/dist/order-syncing/index.js +5 -0
- package/dist/order-syncing/index.js.map +1 -0
- package/dist/order-syncing/sync-utils.d.ts +9 -0
- package/dist/order-syncing/sync-utils.d.ts.map +1 -0
- package/dist/order-syncing/sync-utils.js +27 -0
- package/dist/order-syncing/sync-utils.js.map +1 -0
- package/dist/order-syncing/types.d.ts +66 -0
- package/dist/order-syncing/types.d.ts.map +1 -0
- package/dist/order-syncing/types.js +2 -0
- package/dist/order-syncing/types.js.map +1 -0
- package/dist/order-syncing/utils.d.ts +83 -0
- package/dist/order-syncing/utils.d.ts.map +1 -0
- package/dist/order-syncing/utils.js +144 -0
- package/dist/order-syncing/utils.js.map +1 -0
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RampsController.d.ts","sourceRoot":"","sources":["../src/RampsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAI1G,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,KAAK,EACV,kCAAkC,EAClC,+BAA+B,EAC/B,2CAA2C,EAC3C,+CAA+C,EAC/C,4CAA4C,EAC7C,MAAM,yCAAyC,CAAC;AAgBjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EACV,+CAA+C,EAC/C,gCAAgC,EAChC,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC9B,mCAAmC,EACnC,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC1B,sCAAsC,EACvC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,EACR,KAAK,EACL,UAAU,EACV,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,KAAK,EAEL,UAAU,EAEV,UAAU,EACV,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,E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OAAO,CAAC,MAAM,CAAC,CAYjB;IAED;;;;;OAKG;IACG,+BAA+B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAUtE;IAED;;;;;OAKG;IACG,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;IAED;;;;;;OAMG;IACG,uBAAuB,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAWlB;IAED;;;;;;OAMG;IACG,qBAAqB,CACzB,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAW/B;IAED;;;;;OAKG;IACG,qBAAqB,CACzB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,uBAAuB,CAAC,CASlC;IAED;;;;;OAKG;IACG,uBAAuB,CAC3B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,oBAAoB,CAAC,CAU/B;IAED;;;;;OAKG;IACG,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU9D;IAED;;;;;OAKG;IACG,4BAA4B,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC,CAOrD;IAED;;;;OAIG;IACG,sBAAsB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAOtD;CACF"}
|
package/dist/RampsController.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BaseController } from '@metamask/base-controller';
|
|
2
2
|
import { BrokenCircuitError } from '@metamask/controller-utils';
|
|
3
|
+
import { BigNumber } from 'bignumber.js';
|
|
3
4
|
import { applyAutorampRemoteStatus, createAutorampAccount, markAutorampNotified, } from './autorampAccount.js';
|
|
4
5
|
import { getHeadlessProviderAllowlist, isHeadlessAllProvidersEnabled, normalizeHeadlessProviderId, } from './featureFlags.js';
|
|
6
|
+
import { areOrdersEqual, deleteOrderInUserStorage, syncOrdersWithUserStorage as syncOrdersWithUserStorageInternal, updateOrderInUserStorage, } from './order-syncing/index.js';
|
|
5
7
|
import { PENDING_ORDER_STATUSES, TERMINAL_ORDER_STATUSES, } from './orderStatus.js';
|
|
6
8
|
import { buildOwnershipMessage } from './ownership-message.js';
|
|
7
9
|
import { mergePaymentMethodsById, pickPaymentMethod, } from './paymentMethodMerge.js';
|
|
@@ -71,12 +73,17 @@ export const RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS = [
|
|
|
71
73
|
* `AuthenticationController:getSessionProfile` resolves the vendor customer
|
|
72
74
|
* identity from Profile Sync, and `KeyringController:signPersonalMessage` signs
|
|
73
75
|
* the EIP-191 ownership proof for Money Account self-hosted wallet
|
|
74
|
-
* registration; both are only exercised by the autoramp paths.
|
|
76
|
+
* registration; both are only exercised by the autoramp paths. User Storage
|
|
77
|
+
* and authentication actions support cross-client order syncing.
|
|
75
78
|
*/
|
|
76
79
|
export const RAMPS_CONTROLLER_REQUIRED_CONTROLLER_ACTIONS = [
|
|
77
80
|
'AuthenticationController:getSessionProfile',
|
|
81
|
+
'AuthenticationController:isSignedIn',
|
|
78
82
|
'KeyringController:signPersonalMessage',
|
|
79
83
|
'RemoteFeatureFlagController:getState',
|
|
84
|
+
'UserStorageController:getState',
|
|
85
|
+
'UserStorageController:performGetStorageAllFeatureEntries',
|
|
86
|
+
'UserStorageController:performBatchSetStorage',
|
|
80
87
|
];
|
|
81
88
|
/**
|
|
82
89
|
* Distinguishes an already-materialized {@link AutorampAccount} from the
|
|
@@ -369,15 +376,19 @@ function findRegionFromCode(regionCode, countries) {
|
|
|
369
376
|
*/
|
|
370
377
|
export function getInternalOrderCode(orderOrId) {
|
|
371
378
|
if (typeof orderOrId === 'string') {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
379
|
+
if (orderOrId.includes('/orders/')) {
|
|
380
|
+
return orderOrId.split('/orders/')[1]?.trim() || '';
|
|
381
|
+
}
|
|
382
|
+
return orderOrId.trim();
|
|
375
383
|
}
|
|
376
384
|
const { id, providerOrderId } = orderOrId;
|
|
377
385
|
if (id?.includes('/orders/')) {
|
|
378
|
-
|
|
386
|
+
const code = id.split('/orders/')[1]?.trim();
|
|
387
|
+
if (code) {
|
|
388
|
+
return code;
|
|
389
|
+
}
|
|
379
390
|
}
|
|
380
|
-
return providerOrderId;
|
|
391
|
+
return providerOrderId?.trim() ?? '';
|
|
381
392
|
}
|
|
382
393
|
// === ORDER POLLING CONSTANTS ===
|
|
383
394
|
const DEFAULT_POLLING_INTERVAL_MS = 30_000;
|
|
@@ -399,6 +410,7 @@ const MESSENGER_EXPOSED_METHODS = [
|
|
|
399
410
|
'getPaymentMethodsForContext',
|
|
400
411
|
'setSelectedPaymentMethod',
|
|
401
412
|
'getQuotes',
|
|
413
|
+
'getQuoteWithFees',
|
|
402
414
|
'addOrder',
|
|
403
415
|
'removeOrder',
|
|
404
416
|
'addAutoramp',
|
|
@@ -442,6 +454,7 @@ const MESSENGER_EXPOSED_METHODS = [
|
|
|
442
454
|
'transakCancelOrder',
|
|
443
455
|
'transakCancelAllActiveOrders',
|
|
444
456
|
'transakGetActiveOrders',
|
|
457
|
+
'syncOrdersWithUserStorage',
|
|
445
458
|
];
|
|
446
459
|
/**
|
|
447
460
|
* Whether controller state still describes the context a payment-method
|
|
@@ -463,6 +476,27 @@ function contextStillMatches(state, context) {
|
|
|
463
476
|
context.assetId &&
|
|
464
477
|
(state.providers.selected?.id.trim() ?? '') === context.providerId);
|
|
465
478
|
}
|
|
479
|
+
/**
|
|
480
|
+
* Provider codes that identify Transak's native (non-aggregator) integration,
|
|
481
|
+
* in the bare form produced by {@link normalizeHeadlessProviderId}.
|
|
482
|
+
*/
|
|
483
|
+
const NATIVE_TRANSAK_PROVIDER_CODES = [
|
|
484
|
+
'transak-native',
|
|
485
|
+
'transak-native-staging',
|
|
486
|
+
];
|
|
487
|
+
/**
|
|
488
|
+
* Coerces a quote fee value to a non-negative BigNumber, treating a missing or
|
|
489
|
+
* invalid value as zero.
|
|
490
|
+
*
|
|
491
|
+
* @param value - Raw fee value from a quote.
|
|
492
|
+
* @returns The fee as a non-negative BigNumber.
|
|
493
|
+
*/
|
|
494
|
+
function getSafeRampsFee(value) {
|
|
495
|
+
const fee = new BigNumber(value ?? 0);
|
|
496
|
+
return fee.isFinite() && fee.isGreaterThanOrEqualTo(0)
|
|
497
|
+
? fee
|
|
498
|
+
: new BigNumber(0);
|
|
499
|
+
}
|
|
466
500
|
export class RampsController extends BaseController {
|
|
467
501
|
/**
|
|
468
502
|
* Default TTL for cached requests.
|
|
@@ -472,6 +506,8 @@ export class RampsController extends BaseController {
|
|
|
472
506
|
* Maximum number of entries in the request cache.
|
|
473
507
|
*/
|
|
474
508
|
#requestCacheMaxSize;
|
|
509
|
+
#onOrderSyncErroneousSituation;
|
|
510
|
+
#trace;
|
|
475
511
|
/**
|
|
476
512
|
* Map of pending requests for deduplication.
|
|
477
513
|
* Key is the cache key, value is the pending request with abort controller.
|
|
@@ -491,6 +527,75 @@ export class RampsController extends BaseController {
|
|
|
491
527
|
#orderPollingTimer = null;
|
|
492
528
|
#isPolling = false;
|
|
493
529
|
#initPromise = null;
|
|
530
|
+
/**
|
|
531
|
+
* Semaphore that prevents sync feedback loops while applying remote order changes.
|
|
532
|
+
*/
|
|
533
|
+
#isOrderSyncingInProgress = false;
|
|
534
|
+
/**
|
|
535
|
+
* Whether the full sync is applying its own local state changes.
|
|
536
|
+
*/
|
|
537
|
+
#isApplyingOrderSyncChanges = false;
|
|
538
|
+
/**
|
|
539
|
+
* Orders deleted locally while a full sync held the semaphore.
|
|
540
|
+
*/
|
|
541
|
+
#pendingRemoteDeletes = new Map();
|
|
542
|
+
/**
|
|
543
|
+
* Coalesces overlapping `syncOrdersWithUserStorage` calls into a follow-up run.
|
|
544
|
+
*/
|
|
545
|
+
#orderSyncQueued = false;
|
|
546
|
+
#orderSyncPromise = null;
|
|
547
|
+
/**
|
|
548
|
+
* Whether a full order sync is currently applying remote changes.
|
|
549
|
+
*
|
|
550
|
+
* @returns Whether order sync is in progress.
|
|
551
|
+
*/
|
|
552
|
+
get isOrderSyncingInProgress() {
|
|
553
|
+
return this.#isOrderSyncingInProgress;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Sets the order-syncing-in-progress semaphore.
|
|
557
|
+
* Used by the order-syncing module; hosts should not call this.
|
|
558
|
+
*
|
|
559
|
+
* @param value - Whether sync is in progress.
|
|
560
|
+
* @internal
|
|
561
|
+
*/
|
|
562
|
+
setIsOrderSyncingInProgress(value) {
|
|
563
|
+
this.#isOrderSyncingInProgress = value;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Distinguishes full sync's own state changes from external mutations.
|
|
567
|
+
*
|
|
568
|
+
* @param value - Whether sync changes are being applied.
|
|
569
|
+
* @internal
|
|
570
|
+
*/
|
|
571
|
+
setIsApplyingOrderSyncChanges(value) {
|
|
572
|
+
this.#isApplyingOrderSyncChanges = value;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Returns orders deleted while a full sync was in progress.
|
|
576
|
+
* Used by the order-syncing module.
|
|
577
|
+
*
|
|
578
|
+
* @returns Pending deletes for remote tombstone upload.
|
|
579
|
+
* @internal
|
|
580
|
+
*/
|
|
581
|
+
getPendingRemoteDeletes() {
|
|
582
|
+
return [...this.#pendingRemoteDeletes.values()];
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Clears deletes whose tombstones were successfully persisted. A delete
|
|
586
|
+
* replaced while a write was in flight remains pending.
|
|
587
|
+
*
|
|
588
|
+
* @param orders - Deletes included in a successful remote write.
|
|
589
|
+
* @internal
|
|
590
|
+
*/
|
|
591
|
+
acknowledgePendingRemoteDeletes(orders) {
|
|
592
|
+
for (const order of orders) {
|
|
593
|
+
const key = getInternalOrderCode(order);
|
|
594
|
+
if (key && this.#pendingRemoteDeletes.get(key) === order) {
|
|
595
|
+
this.#pendingRemoteDeletes.delete(key);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
494
599
|
/**
|
|
495
600
|
* Clears the pending resource count map. Used only in tests to exercise the
|
|
496
601
|
* defensive path when get() returns undefined in the finally block.
|
|
@@ -526,8 +631,10 @@ export class RampsController extends BaseController {
|
|
|
526
631
|
* controller. Missing properties will be filled in with defaults.
|
|
527
632
|
* @param args.requestCacheTTL - Time to live for cached requests in milliseconds.
|
|
528
633
|
* @param args.requestCacheMaxSize - Maximum number of entries in the request cache.
|
|
634
|
+
* @param args.onOrderSyncErroneousSituation - Optional order-sync error reporter.
|
|
635
|
+
* @param args.trace - Optional performance tracing callback for order sync.
|
|
529
636
|
*/
|
|
530
|
-
constructor({ messenger, state = {}, requestCacheTTL = DEFAULT_REQUEST_CACHE_TTL, requestCacheMaxSize = DEFAULT_REQUEST_CACHE_MAX_SIZE, }) {
|
|
637
|
+
constructor({ messenger, state = {}, requestCacheTTL = DEFAULT_REQUEST_CACHE_TTL, requestCacheMaxSize = DEFAULT_REQUEST_CACHE_MAX_SIZE, onOrderSyncErroneousSituation, trace, }) {
|
|
531
638
|
super({
|
|
532
639
|
messenger,
|
|
533
640
|
metadata: rampsControllerMetadata,
|
|
@@ -541,6 +648,8 @@ export class RampsController extends BaseController {
|
|
|
541
648
|
});
|
|
542
649
|
this.#requestCacheTTL = requestCacheTTL;
|
|
543
650
|
this.#requestCacheMaxSize = requestCacheMaxSize;
|
|
651
|
+
this.#onOrderSyncErroneousSituation = onOrderSyncErroneousSituation;
|
|
652
|
+
this.#trace = trace;
|
|
544
653
|
this.messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);
|
|
545
654
|
}
|
|
546
655
|
/**
|
|
@@ -1580,6 +1689,120 @@ export class RampsController extends BaseController {
|
|
|
1580
1689
|
],
|
|
1581
1690
|
};
|
|
1582
1691
|
}
|
|
1692
|
+
/**
|
|
1693
|
+
* Fetches the best on-ramp quote for a request and, when the resolved
|
|
1694
|
+
* provider is Transak Native, reconciles its fees to match what Transak
|
|
1695
|
+
* Native actually charges.
|
|
1696
|
+
*
|
|
1697
|
+
* The aggregator `/quotes` estimate of Transak's fee does not match the
|
|
1698
|
+
* native integration. When the resolved provider is Transak Native this
|
|
1699
|
+
* fetches the native buy quote (an unauthenticated, API-key-only lookup, so
|
|
1700
|
+
* it is safe at estimate time) and rewrites the returned quote's fee fields
|
|
1701
|
+
* to its `totalFee`, keeping the aggregator's `networkFee` on the network
|
|
1702
|
+
* line and placing the remainder in the provider fee so the breakdown
|
|
1703
|
+
* survives and `providerFee + networkFee` still equals the native total. A
|
|
1704
|
+
* non-native provider, a failed lookup, or an unusable native fee returns the
|
|
1705
|
+
* aggregator quote unchanged.
|
|
1706
|
+
*
|
|
1707
|
+
* Consumers (e.g. `TransactionPayController`) call this instead of owning the
|
|
1708
|
+
* provider check, asset-id parsing, and second native quote themselves.
|
|
1709
|
+
*
|
|
1710
|
+
* @param options - Quote options; see {@link getQuotes}, plus the fee mode.
|
|
1711
|
+
* @param options.amount - Fiat amount for the quote.
|
|
1712
|
+
* @param options.assetId - CAIP-19 asset id being bought.
|
|
1713
|
+
* @param options.fiat - Optional fiat currency; defaults like {@link getQuotes}.
|
|
1714
|
+
* @param options.paymentMethods - Optional payment method ids.
|
|
1715
|
+
* @param options.walletAddress - Wallet address receiving the on-ramped asset.
|
|
1716
|
+
* @param options.isFeeExcludedFromFiat - Whether Transak adds its fee on top
|
|
1717
|
+
* of the fiat amount (`true`, fee-on-top) or carves it out (`false`). Must
|
|
1718
|
+
* mirror the eventual checkout mode so the estimate equals the charge.
|
|
1719
|
+
* Defaults to `true`.
|
|
1720
|
+
* @param options.providers - See {@link getQuotes}.
|
|
1721
|
+
* @param options.autoSelectProvider - See {@link getQuotes}.
|
|
1722
|
+
* @param options.restrictToKnownOrNativeProviders - See {@link getQuotes}.
|
|
1723
|
+
* @param options.preferredProviderIds - See {@link getQuotes}.
|
|
1724
|
+
* @param options.region - See {@link getQuotes}.
|
|
1725
|
+
* @param options.redirectUrl - See {@link getQuotes}.
|
|
1726
|
+
* @param options.action - See {@link getQuotes}.
|
|
1727
|
+
* @param options.forceRefresh - See {@link getQuotes}.
|
|
1728
|
+
* @param options.ttl - See {@link getQuotes}.
|
|
1729
|
+
* @returns The best quote with native-reconciled fees, or `undefined` when
|
|
1730
|
+
* no quote is available.
|
|
1731
|
+
*/
|
|
1732
|
+
async getQuoteWithFees(options) {
|
|
1733
|
+
const { isFeeExcludedFromFiat = true, ...quoteOptions } = options;
|
|
1734
|
+
const response = await this.getQuotes(quoteOptions);
|
|
1735
|
+
const quote = response.success?.[0];
|
|
1736
|
+
if (!quote) {
|
|
1737
|
+
return undefined;
|
|
1738
|
+
}
|
|
1739
|
+
return this.#reconcileNativeTransakFee(quote, {
|
|
1740
|
+
amount: options.amount,
|
|
1741
|
+
assetId: options.assetId,
|
|
1742
|
+
fiat: options.fiat,
|
|
1743
|
+
// Use the resolved quote's own payment method, not the request list: the
|
|
1744
|
+
// aggregator may price a method other than `paymentMethods[0]` (or the
|
|
1745
|
+
// caller may omit the list), and the native lookup must match the quote
|
|
1746
|
+
// being reconciled.
|
|
1747
|
+
paymentMethod: quote.quote.paymentMethod,
|
|
1748
|
+
isFeeExcludedFromFiat,
|
|
1749
|
+
});
|
|
1750
|
+
}
|
|
1751
|
+
/**
|
|
1752
|
+
* Rewrites a quote's fees to Transak Native's own total when the resolved
|
|
1753
|
+
* provider is Transak Native, so an estimate matches the native charge.
|
|
1754
|
+
* Returns the quote unchanged for a non-native provider, a failed native
|
|
1755
|
+
* lookup, or an unusable native fee.
|
|
1756
|
+
*
|
|
1757
|
+
* @param quote - The resolved aggregator quote.
|
|
1758
|
+
* @param context - Native lookup inputs.
|
|
1759
|
+
* @param context.amount - Fiat amount for the native quote.
|
|
1760
|
+
* @param context.assetId - CAIP-19 asset id being bought.
|
|
1761
|
+
* @param context.fiat - Fiat currency for the native quote.
|
|
1762
|
+
* @param context.paymentMethod - Payment method id for the native quote.
|
|
1763
|
+
* @param context.isFeeExcludedFromFiat - Fee mode for the native quote.
|
|
1764
|
+
* @returns The quote with reconciled fees, or the original quote.
|
|
1765
|
+
*/
|
|
1766
|
+
async #reconcileNativeTransakFee(quote, { amount, assetId, fiat, paymentMethod, isFeeExcludedFromFiat, }) {
|
|
1767
|
+
// `normalizeHeadlessProviderId` strips the `/providers/` prefix and
|
|
1768
|
+
// lowercases, so `/providers/transak-native` and `transak-native` both match
|
|
1769
|
+
// the native codes below (and the aggregator `transak` does not).
|
|
1770
|
+
const providerCode = normalizeHeadlessProviderId(quote.provider);
|
|
1771
|
+
if (!NATIVE_TRANSAK_PROVIDER_CODES.includes(providerCode)) {
|
|
1772
|
+
return quote;
|
|
1773
|
+
}
|
|
1774
|
+
const fiatCurrency = fiat ?? this.state.userRegion?.country?.currency;
|
|
1775
|
+
if (!fiatCurrency || !paymentMethod) {
|
|
1776
|
+
return quote;
|
|
1777
|
+
}
|
|
1778
|
+
try {
|
|
1779
|
+
const network = assetId.split('/')[0];
|
|
1780
|
+
const nativeQuote = await this.messenger.call('TransakService:getBuyQuote', fiatCurrency, assetId, network, paymentMethod, String(amount), isFeeExcludedFromFiat);
|
|
1781
|
+
const nativeTotalFee = new BigNumber(nativeQuote.totalFee ?? NaN);
|
|
1782
|
+
if (!nativeTotalFee.isFinite() || nativeTotalFee.isLessThan(0)) {
|
|
1783
|
+
return quote;
|
|
1784
|
+
}
|
|
1785
|
+
// Transak Native returns a single total fee, so keep the aggregator's
|
|
1786
|
+
// network fee on the network line (clamped to the native total) and put
|
|
1787
|
+
// the remainder in the provider fee. The breakdown survives and
|
|
1788
|
+
// `providerFee + networkFee` still equals the native total.
|
|
1789
|
+
const aggregatorNetworkFee = getSafeRampsFee(quote.quote.networkFee);
|
|
1790
|
+
const networkFee = BigNumber.min(aggregatorNetworkFee, nativeTotalFee);
|
|
1791
|
+
const providerFee = nativeTotalFee.minus(networkFee);
|
|
1792
|
+
return {
|
|
1793
|
+
...quote,
|
|
1794
|
+
quote: {
|
|
1795
|
+
...quote.quote,
|
|
1796
|
+
providerFee: providerFee.toString(10),
|
|
1797
|
+
networkFee: networkFee.toString(10),
|
|
1798
|
+
totalFees: nativeTotalFee.toString(10),
|
|
1799
|
+
},
|
|
1800
|
+
};
|
|
1801
|
+
}
|
|
1802
|
+
catch {
|
|
1803
|
+
return quote;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1583
1806
|
/**
|
|
1584
1807
|
* Selects the best quote from a widened multi-provider response.
|
|
1585
1808
|
*
|
|
@@ -1841,17 +2064,59 @@ export class RampsController extends BaseController {
|
|
|
1841
2064
|
* If an order with the same internal order code already exists, the incoming
|
|
1842
2065
|
* fields are merged on top of the existing order so that fields not present
|
|
1843
2066
|
* in the update (e.g. paymentDetails from the Transak API) are preserved.
|
|
2067
|
+
* Unchanged syncable payloads (including unchanged poll results) are ignored
|
|
2068
|
+
* so `lastUpdatedAt` is not bumped and User Storage is not rewritten.
|
|
1844
2069
|
*
|
|
1845
2070
|
* @param order - The RampsOrder to add or update.
|
|
1846
2071
|
*/
|
|
1847
2072
|
addOrder(order) {
|
|
1848
2073
|
const internalOrderCode = getInternalOrderCode(order);
|
|
2074
|
+
if (!internalOrderCode) {
|
|
2075
|
+
this.#onOrderSyncErroneousSituation?.('Unable to derive internal order code for addOrder', {});
|
|
2076
|
+
return;
|
|
2077
|
+
}
|
|
2078
|
+
const existing = this.state.orders.find((existingOrder) => getInternalOrderCode(existingOrder) === internalOrderCode);
|
|
2079
|
+
if (existing &&
|
|
2080
|
+
!this.#isApplyingOrderSyncChanges &&
|
|
2081
|
+
areOrdersEqual(existing, order)) {
|
|
2082
|
+
// Syncable payload unchanged; check if paymentDetails differ.
|
|
2083
|
+
// paymentDetails is local-only (never synced remotely), so if it's the
|
|
2084
|
+
// only change we merge it without bumping lastUpdatedAt or writing remotely.
|
|
2085
|
+
if (order.paymentDetails &&
|
|
2086
|
+
JSON.stringify(existing.paymentDetails) !==
|
|
2087
|
+
JSON.stringify(order.paymentDetails)) {
|
|
2088
|
+
this.update((state) => {
|
|
2089
|
+
const idx = state.orders.findIndex((stateOrder) => getInternalOrderCode(stateOrder) === internalOrderCode);
|
|
2090
|
+
if (idx !== -1) {
|
|
2091
|
+
state.orders[idx] = {
|
|
2092
|
+
...state.orders[idx],
|
|
2093
|
+
paymentDetails: order.paymentDetails,
|
|
2094
|
+
};
|
|
2095
|
+
}
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
return;
|
|
2099
|
+
}
|
|
2100
|
+
const incomingLastUpdatedAt = order.lastUpdatedAt;
|
|
2101
|
+
// Local edits always bump lastUpdatedAt so full-sync LWW can prefer them
|
|
2102
|
+
// over stale remote copies when an incremental push was skipped/failed.
|
|
2103
|
+
// This includes external edits mid-sync (e.g. polling via `getOrder`),
|
|
2104
|
+
// which the queued follow-up sync must not lose under LWW.
|
|
2105
|
+
// Only when sync applies its own imported orders do we preserve the remote
|
|
2106
|
+
// `lu` / `createdAt` (never invent "now" for missing `lu`, or stale remotes
|
|
2107
|
+
// win later LWW comparisons).
|
|
1849
2108
|
const healedOrder = {
|
|
1850
2109
|
...order,
|
|
1851
2110
|
providerOrderId: internalOrderCode,
|
|
2111
|
+
lastUpdatedAt: this.#isApplyingOrderSyncChanges
|
|
2112
|
+
? (incomingLastUpdatedAt ?? order.createdAt ?? 0)
|
|
2113
|
+
: Date.now(),
|
|
1852
2114
|
};
|
|
2115
|
+
if (!this.#isApplyingOrderSyncChanges) {
|
|
2116
|
+
this.#pendingRemoteDeletes.delete(internalOrderCode);
|
|
2117
|
+
}
|
|
1853
2118
|
this.update((state) => {
|
|
1854
|
-
const idx = state.orders.findIndex((
|
|
2119
|
+
const idx = state.orders.findIndex((stateOrder) => getInternalOrderCode(stateOrder) === internalOrderCode);
|
|
1855
2120
|
if (idx === -1) {
|
|
1856
2121
|
state.orders.push(healedOrder);
|
|
1857
2122
|
}
|
|
@@ -1862,6 +2127,22 @@ export class RampsController extends BaseController {
|
|
|
1862
2127
|
};
|
|
1863
2128
|
}
|
|
1864
2129
|
});
|
|
2130
|
+
if (this.#isOrderSyncingInProgress && !this.#isApplyingOrderSyncChanges) {
|
|
2131
|
+
// Incremental push is suppressed during full sync; queue another full
|
|
2132
|
+
// sync pass so mutations during the upload await are not dropped.
|
|
2133
|
+
this.#orderSyncQueued = true;
|
|
2134
|
+
}
|
|
2135
|
+
else if (!this.#isOrderSyncingInProgress) {
|
|
2136
|
+
updateOrderInUserStorage(healedOrder, {
|
|
2137
|
+
getRampsControllerInstance: () => this,
|
|
2138
|
+
getMessenger: () => this.messenger,
|
|
2139
|
+
}, {
|
|
2140
|
+
onOrderSyncErroneousSituation: this.#onOrderSyncErroneousSituation,
|
|
2141
|
+
}).catch((error) => {
|
|
2142
|
+
console.error('Error updating ramps order in remote storage:', error);
|
|
2143
|
+
this.#onOrderSyncErroneousSituation?.('Error updating ramps order in remote storage', { error });
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
1865
2146
|
}
|
|
1866
2147
|
/**
|
|
1867
2148
|
* Removes a V2 order from controller state by providerOrderId.
|
|
@@ -1869,10 +2150,101 @@ export class RampsController extends BaseController {
|
|
|
1869
2150
|
* @param providerOrderId - The provider order ID to remove.
|
|
1870
2151
|
*/
|
|
1871
2152
|
removeOrder(providerOrderId) {
|
|
2153
|
+
const orderToRemove = this.state.orders.find((order) => order.providerOrderId === providerOrderId ||
|
|
2154
|
+
getInternalOrderCode(order) === providerOrderId);
|
|
1872
2155
|
this.update((state) => {
|
|
1873
|
-
state.orders = state.orders.filter((order) => order.providerOrderId !== providerOrderId
|
|
2156
|
+
state.orders = state.orders.filter((order) => order.providerOrderId !== providerOrderId &&
|
|
2157
|
+
getInternalOrderCode(order) !== providerOrderId);
|
|
1874
2158
|
});
|
|
1875
2159
|
this.#orderPollingMeta.delete(providerOrderId);
|
|
2160
|
+
if (orderToRemove) {
|
|
2161
|
+
if (orderToRemove.providerOrderId) {
|
|
2162
|
+
this.#orderPollingMeta.delete(orderToRemove.providerOrderId);
|
|
2163
|
+
}
|
|
2164
|
+
const internalOrderCode = getInternalOrderCode(orderToRemove);
|
|
2165
|
+
this.#orderPollingMeta.delete(internalOrderCode);
|
|
2166
|
+
}
|
|
2167
|
+
if (orderToRemove) {
|
|
2168
|
+
const deleteKey = getInternalOrderCode(orderToRemove);
|
|
2169
|
+
const isLocalDeletion = !this.#isApplyingOrderSyncChanges;
|
|
2170
|
+
if (isLocalDeletion && deleteKey) {
|
|
2171
|
+
// Retain the delete until a full sync confirms its tombstone was
|
|
2172
|
+
// persisted. This prevents a failed incremental write from allowing
|
|
2173
|
+
// the still-active remote copy to be imported again.
|
|
2174
|
+
this.#pendingRemoteDeletes.set(deleteKey, orderToRemove);
|
|
2175
|
+
}
|
|
2176
|
+
if (this.#isOrderSyncingInProgress) {
|
|
2177
|
+
if (isLocalDeletion) {
|
|
2178
|
+
// Incremental remote deletes are gated off during full sync; queue a
|
|
2179
|
+
// tombstone write and another full sync pass so deletes during the
|
|
2180
|
+
// upload await are not dropped.
|
|
2181
|
+
this.#orderSyncQueued = true;
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
else if (isLocalDeletion) {
|
|
2185
|
+
deleteOrderInUserStorage(orderToRemove, {
|
|
2186
|
+
getRampsControllerInstance: () => this,
|
|
2187
|
+
getMessenger: () => this.messenger,
|
|
2188
|
+
}, {
|
|
2189
|
+
onOrderSyncErroneousSituation: this.#onOrderSyncErroneousSituation,
|
|
2190
|
+
}).catch((error) => {
|
|
2191
|
+
console.error('Error deleting ramps order from remote storage:', error);
|
|
2192
|
+
this.#onOrderSyncErroneousSituation?.('Error deleting ramps order from remote storage', { error });
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* Bidirectionally syncs V2 ramps orders with User Storage.
|
|
2199
|
+
* Hosts should call this on unlock / when ramps syncing is enabled.
|
|
2200
|
+
*
|
|
2201
|
+
* Overlapping calls are coalesced into the in-flight worker. After the worker
|
|
2202
|
+
* settles, this method loops when `#orderSyncQueued` is still set so a
|
|
2203
|
+
* request that arrived between the worker's last loop check and promise
|
|
2204
|
+
* resolution is not dropped.
|
|
2205
|
+
*/
|
|
2206
|
+
async syncOrdersWithUserStorage() {
|
|
2207
|
+
this.#orderSyncQueued = true;
|
|
2208
|
+
let syncError;
|
|
2209
|
+
while (this.#orderSyncQueued || this.#orderSyncPromise) {
|
|
2210
|
+
if (this.#orderSyncPromise) {
|
|
2211
|
+
try {
|
|
2212
|
+
await this.#orderSyncPromise;
|
|
2213
|
+
}
|
|
2214
|
+
catch (error) {
|
|
2215
|
+
syncError ??=
|
|
2216
|
+
error instanceof Error ? error : new Error(String(error));
|
|
2217
|
+
}
|
|
2218
|
+
continue;
|
|
2219
|
+
}
|
|
2220
|
+
this.#orderSyncPromise = (async () => {
|
|
2221
|
+
while (this.#orderSyncQueued) {
|
|
2222
|
+
this.#orderSyncQueued = false;
|
|
2223
|
+
await syncOrdersWithUserStorageInternal({
|
|
2224
|
+
onOrderSyncErroneousSituation: this.#onOrderSyncErroneousSituation,
|
|
2225
|
+
}, {
|
|
2226
|
+
getRampsControllerInstance: () => this,
|
|
2227
|
+
getMessenger: () => this.messenger,
|
|
2228
|
+
trace: this.#trace,
|
|
2229
|
+
});
|
|
2230
|
+
}
|
|
2231
|
+
// Yield so a caller can set `#orderSyncQueued` after the inner while
|
|
2232
|
+
// check and still be observed by the outer loop.
|
|
2233
|
+
await Promise.resolve();
|
|
2234
|
+
})();
|
|
2235
|
+
try {
|
|
2236
|
+
await this.#orderSyncPromise;
|
|
2237
|
+
}
|
|
2238
|
+
catch (error) {
|
|
2239
|
+
syncError ??= error instanceof Error ? error : new Error(String(error));
|
|
2240
|
+
}
|
|
2241
|
+
finally {
|
|
2242
|
+
this.#orderSyncPromise = null;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
if (syncError) {
|
|
2246
|
+
throw syncError;
|
|
2247
|
+
}
|
|
1876
2248
|
}
|
|
1877
2249
|
/**
|
|
1878
2250
|
* Adds or updates a local autoramp last-seen cursor (e.g. after create).
|
|
@@ -2393,6 +2765,7 @@ export class RampsController extends BaseController {
|
|
|
2393
2765
|
* @returns The unified order data.
|
|
2394
2766
|
*/
|
|
2395
2767
|
async getOrder(providerCode, orderCode, wallet) {
|
|
2768
|
+
const hadOrderAtRequestStart = this.state.orders.some((existingOrder) => getInternalOrderCode(existingOrder) === orderCode);
|
|
2396
2769
|
const order = await this.messenger.call('RampsService:getOrder', providerCode, orderCode, wallet);
|
|
2397
2770
|
const healedWalletAddress = order.walletAddress || wallet;
|
|
2398
2771
|
const internalOrderCode = getInternalOrderCode({
|
|
@@ -2404,18 +2777,12 @@ export class RampsController extends BaseController {
|
|
|
2404
2777
|
walletAddress: healedWalletAddress,
|
|
2405
2778
|
providerOrderId: internalOrderCode,
|
|
2406
2779
|
};
|
|
2407
|
-
this.
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
state.orders[idx] = {
|
|
2414
|
-
...state.orders[idx],
|
|
2415
|
-
...healedOrder,
|
|
2416
|
-
};
|
|
2417
|
-
}
|
|
2418
|
-
});
|
|
2780
|
+
const orderStillExists = this.state.orders.some((existingOrder) => getInternalOrderCode(existingOrder) === internalOrderCode);
|
|
2781
|
+
// A polling request can finish after removeOrder. Do not let that stale
|
|
2782
|
+
// response recreate the local order and overwrite its remote tombstone.
|
|
2783
|
+
if (!hadOrderAtRequestStart || orderStillExists) {
|
|
2784
|
+
this.addOrder(healedOrder);
|
|
2785
|
+
}
|
|
2419
2786
|
return healedOrder;
|
|
2420
2787
|
}
|
|
2421
2788
|
/**
|
|
@@ -2595,16 +2962,18 @@ export class RampsController extends BaseController {
|
|
|
2595
2962
|
* @param network - The blockchain network identifier.
|
|
2596
2963
|
* @param paymentMethod - The payment method identifier.
|
|
2597
2964
|
* @param fiatAmount - The fiat amount as a string.
|
|
2965
|
+
* @param isFeeExcludedFromFiat - Whether fees are added to the fiat amount.
|
|
2966
|
+
* Defaults to true to preserve Unified Buy's native Transak behavior.
|
|
2598
2967
|
* @returns The buy quote with pricing and fee details.
|
|
2599
2968
|
*/
|
|
2600
|
-
async transakGetBuyQuote(fiatCurrency, cryptoCurrency, network, paymentMethod, fiatAmount) {
|
|
2969
|
+
async transakGetBuyQuote(fiatCurrency, cryptoCurrency, network, paymentMethod, fiatAmount, isFeeExcludedFromFiat = true) {
|
|
2601
2970
|
this.update((state) => {
|
|
2602
2971
|
state.nativeProviders.transak.buyQuote.isLoading = true;
|
|
2603
2972
|
state.nativeProviders.transak.buyQuote.error = null;
|
|
2604
2973
|
delete state.nativeProviders.transak.buyQuote.errorKey;
|
|
2605
2974
|
});
|
|
2606
2975
|
try {
|
|
2607
|
-
const quote = await this.messenger.call('TransakService:getBuyQuote', fiatCurrency, cryptoCurrency, network, paymentMethod, fiatAmount);
|
|
2976
|
+
const quote = await this.messenger.call('TransakService:getBuyQuote', fiatCurrency, cryptoCurrency, network, paymentMethod, fiatAmount, isFeeExcludedFromFiat);
|
|
2608
2977
|
this.update((state) => {
|
|
2609
2978
|
state.nativeProviders.transak.buyQuote.data = quote;
|
|
2610
2979
|
state.nativeProviders.transak.buyQuote.isLoading = false;
|