@metamask-previews/ramps-controller 30.1.0-preview-780f706 → 30.1.0-preview-19151e4de
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 +5 -0
- package/dist/autorampAccount.d.ts +25 -8
- package/dist/autorampAccount.d.ts.map +1 -1
- package/dist/autorampAccount.js +62 -9
- package/dist/autorampAccount.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
18
18
|
- Add `TransakAdditionalRequirementOption` type for structured option lists with `name` and `value` fields ([#11672](https://github.com/MetaMask/core/pull/11672))
|
|
19
19
|
- Add `SubmitMicaConsentRequest`, `SubmitMicaConsentResponse`, `SubmitSourceOfIncomeRequest`, `SubmitSourceOfIncomeResponse`, `SubmitAdditionalDetailsNationalityRequest`, and `SubmitAdditionalDetailsNationalityResponse` types for MiCA/EEA KYC submission payloads and responses ([#11672](https://github.com/MetaMask/core/pull/11672))
|
|
20
20
|
- Add `ADDITIONAL_DETAILS_NATIONALITY` form type to `TransakAdditionalRequirement`, with metadata containing `employmentStatusOptions` and `countryOfCitizenshipOptions` (both arrays of `TransakAdditionalRequirementOption`) ([#11672](https://github.com/MetaMask/core/pull/11672))
|
|
21
|
+
- Add `isTokenUnavailableInJurisdictionError`, which recognizes an autoramp create rejected because the destination token is not available in the customer's jurisdiction. It matches neobank-proxy's `token_unavailable_in_jurisdiction` code and MoonPay's own error text ([#11734](https://github.com/MetaMask/core/pull/11734))
|
|
21
22
|
|
|
22
23
|
### Changed
|
|
23
24
|
|
|
@@ -25,6 +26,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
25
26
|
- **BREAKING:** `TransakService.submitSourceOfIncome` signature changed from `(monthlyVolume, sourceOfFundsType, employmentStatus, countryOfCitizenship)` to `(monthlyVolume, sourceOfFundsType)`. Employment status and country of citizenship are now submitted via the new `submitAdditionalDetailsNationality` method. Returns `Promise<SubmitSourceOfIncomeResponse>` instead of `Promise<void>` ([#11672](https://github.com/MetaMask/core/pull/11672))
|
|
26
27
|
- **BREAKING:** `RampsController.transakSubmitSourceOfIncome` signature changed from `(monthlyVolume, sourceOfFundsType, employmentStatus, countryOfCitizenship)` to `(monthlyVolume, sourceOfFundsType)`. Employment status and country of citizenship are now submitted via the new `transakSubmitAdditionalDetailsNationality` method ([#11672](https://github.com/MetaMask/core/pull/11672))
|
|
27
28
|
- **BREAKING:** `TransakAdditionalRequirement.metadata.options` is now typed as `string[] | TransakAdditionalRequirementOption[]` instead of `string[]`. Existing forms (e.g. `id-proof`) still return `string[]`, while the `SOURCE_OF_INCOME` form returns `TransakAdditionalRequirementOption[]`, matching the structure of other MiCA/EEA option fields. Clients that handle `getAdditionalRequirements` responses must handle both shapes. All `metadata` fields are also now optional ([#11672](https://github.com/MetaMask/core/pull/11672))
|
|
29
|
+
- **BREAKING:** `getMusdAutorampDepositRailReadiness` now returns `unavailable` when the customer abilities `currencies` list has no mUSD on Monad with the `Onramp` flow ([#11734](https://github.com/MetaMask/core/pull/11734))
|
|
30
|
+
- MoonPay leaves mUSD out of `currencies` for customers in a KYC region where MoonPay cannot offer it (for example the EEA) and rejects any create for them with a 400, whatever the source fiat.
|
|
31
|
+
- The destination is checked only once the deposit rails would return `active`, so `pending` and `blocked` are unchanged and `unavailable` means a create would otherwise be sent. Do not send the create for this state; show a region error instead. It follows the customer's KYC region, so an immediate retry does not help. Nothing is stored, so a later check returns the rail readiness again once MoonPay offers mUSD to the customer.
|
|
32
|
+
- When `currencies` is missing from the response, the check falls back to the rail check as before.
|
|
28
33
|
- `TransakBuyQuote` now includes an optional `termsIds` field (array of strings) for MiCA/EEA disclaimer identifiers such as `MICA_EEA_BUY` and `MICA_EEA_SELL` ([#11672](https://github.com/MetaMask/core/pull/11672))
|
|
29
34
|
- `SOURCE_OF_INCOME` additional requirement metadata now contains only `options` (array of `TransakAdditionalRequirementOption`); employment status and citizenship options are in the separate `ADDITIONAL_DETAILS_NATIONALITY` form ([#11672](https://github.com/MetaMask/core/pull/11672))
|
|
30
35
|
|
|
@@ -80,22 +80,39 @@ export declare function buildMusdAutorampRequest(walletAddress: string, sourceCu
|
|
|
80
80
|
*/
|
|
81
81
|
export declare function buildBrazilMusdAutorampRequest(walletAddress: string): CreateAutorampRequest;
|
|
82
82
|
/**
|
|
83
|
-
* Whether
|
|
83
|
+
* Whether a failed create was rejected because the destination token is not
|
|
84
|
+
* available in the customer's jurisdiction. The response body is only carried
|
|
85
|
+
* in the error message, so this matches it there.
|
|
84
86
|
*
|
|
85
|
-
*
|
|
87
|
+
* @param error - Error thrown by `RampsController.createAutoramp`.
|
|
88
|
+
* @returns True when the error message carries the jurisdiction rejection.
|
|
89
|
+
*/
|
|
90
|
+
export declare function isTokenUnavailableInJurisdictionError(error: unknown): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Whether a fiat → mUSD autoramp can be created now.
|
|
93
|
+
*
|
|
94
|
+
* - `active`: every required rail is Active, or the fiat has none, and mUSD
|
|
95
|
+
* on Monad is available to the customer.
|
|
86
96
|
* - `pending`: a required rail is not Active yet (Pending, Maintenance or
|
|
87
97
|
* missing), so MoonPay would reject the create for now.
|
|
88
98
|
* - `blocked`: a required rail is Unavailable or Blocked.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*
|
|
93
|
-
* customer
|
|
99
|
+
* - `unavailable`: the rails are ready, but mUSD on Monad is not available to
|
|
100
|
+
* the customer's jurisdiction (missing from abilities `currencies`, or
|
|
101
|
+
* without `Onramp`), so MoonPay would reject the create. It follows the
|
|
102
|
+
* customer's KYC region, so an immediate retry does not help, but a later
|
|
103
|
+
* check passes once MoonPay offers the token to that customer.
|
|
104
|
+
*/
|
|
105
|
+
export type MusdAutorampDepositRailReadiness = 'active' | 'pending' | 'blocked' | 'unavailable';
|
|
106
|
+
/**
|
|
107
|
+
* Reads whether a fiat → mUSD autoramp can be created from the customer's
|
|
108
|
+
* abilities: the deposit rails first, then the destination token. The token
|
|
109
|
+
* is only checked once the rails are ready, so a customer whose rails are
|
|
110
|
+
* still settling keeps waiting instead of failing on a partial `currencies`.
|
|
94
111
|
*
|
|
95
112
|
* @param abilities - Customer abilities, e.g. `vbaCustomerAbilities`.
|
|
96
113
|
* @param sourceCurrencyCode - Fiat code passed to
|
|
97
114
|
* {@link buildMusdAutorampRequest}.
|
|
98
|
-
* @returns The
|
|
115
|
+
* @returns The autoramp readiness.
|
|
99
116
|
*/
|
|
100
117
|
export declare function getMusdAutorampDepositRailReadiness(abilities: NeoBankCustomerAbilities, sourceCurrencyCode: string): MusdAutorampDepositRailReadiness;
|
|
101
118
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autorampAccount.d.ts","sourceRoot":"","sources":["../src/autorampAccount.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,YAAY,EACV,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,mBAAmB,wBAAwB;IAC3C,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,cAAc;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,aAAa,EAAE,MAAM,CAAC;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AE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,eAAe,CAalB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,2BAA2B,GAAG,SAAS,EAC9C,MAAM,EAAE,2BAA2B,GAAG,SAAS,GAC9C,2BAA2B,GAAG,SAAS,CAYzC;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,eAAe,GAAG,IAAI,EAC7B,MAAM,EAAE,sBAAsB,GAC7B,+BAA+B,CAuDjC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,eAAe,GACvB,eAAe,CAKjB"}
|
package/dist/autorampAccount.js
CHANGED
|
@@ -17,6 +17,8 @@ export var AutorampStatus;
|
|
|
17
17
|
AutorampStatus["Rejected"] = "Rejected";
|
|
18
18
|
AutorampStatus["Cancelled"] = "Cancelled";
|
|
19
19
|
})(AutorampStatus || (AutorampStatus = {}));
|
|
20
|
+
/** Destination of every {@link buildMusdAutorampRequest} autoramp. */
|
|
21
|
+
const MUSD_DESTINATION = { token: 'mUSD', blockchain: 'Monad' };
|
|
20
22
|
/**
|
|
21
23
|
* Standing fiat → mUSD autoramp for a Money Account on Monad.
|
|
22
24
|
*
|
|
@@ -33,14 +35,10 @@ export var AutorampStatus;
|
|
|
33
35
|
export function buildMusdAutorampRequest(walletAddress, sourceCurrencyCode) {
|
|
34
36
|
return {
|
|
35
37
|
source_currencies: [{ type: 'Fiat', code: sourceCurrencyCode }],
|
|
36
|
-
destination_currency: {
|
|
37
|
-
type: 'Crypto',
|
|
38
|
-
token: 'mUSD',
|
|
39
|
-
blockchain: 'Monad',
|
|
40
|
-
},
|
|
38
|
+
destination_currency: { type: 'Crypto', ...MUSD_DESTINATION },
|
|
41
39
|
recipient_account: {
|
|
42
40
|
type: 'Crypto',
|
|
43
|
-
chain:
|
|
41
|
+
chain: MUSD_DESTINATION.blockchain,
|
|
44
42
|
address: walletAddress,
|
|
45
43
|
},
|
|
46
44
|
};
|
|
@@ -57,6 +55,44 @@ export function buildMusdAutorampRequest(walletAddress, sourceCurrencyCode) {
|
|
|
57
55
|
export function buildBrazilMusdAutorampRequest(walletAddress) {
|
|
58
56
|
return buildMusdAutorampRequest(walletAddress, 'BRL');
|
|
59
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Whether the customer may onramp into mUSD on Monad. MoonPay lists in
|
|
60
|
+
* `currencies` only what the customer's jurisdiction allows, and rejects a
|
|
61
|
+
* create for anything else. Fails open when `currencies` is missing.
|
|
62
|
+
*
|
|
63
|
+
* @param abilities - Customer abilities.
|
|
64
|
+
* @returns False only when `currencies` lacks mUSD on Monad with `Onramp`.
|
|
65
|
+
*/
|
|
66
|
+
function isMusdDestinationAvailable(abilities) {
|
|
67
|
+
const { currencies } = abilities;
|
|
68
|
+
if (!Array.isArray(currencies)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return currencies.some(({ currency, flows }) => currency?.type === 'Crypto' &&
|
|
72
|
+
currency.token?.toLowerCase() === MUSD_DESTINATION.token.toLowerCase() &&
|
|
73
|
+
currency.blockchain?.toLowerCase() ===
|
|
74
|
+
MUSD_DESTINATION.blockchain.toLowerCase() &&
|
|
75
|
+
Array.isArray(flows) &&
|
|
76
|
+
flows.includes('Onramp'));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A create rejected because the destination token is not available in the
|
|
80
|
+
* customer's jurisdiction: neobank-proxy's error code, or MoonPay's own text
|
|
81
|
+
* when the proxy forwards the body as is.
|
|
82
|
+
*/
|
|
83
|
+
const TOKEN_UNAVAILABLE_IN_JURISDICTION = /token_unavailable_in_jurisdiction|not available in the jurisdiction/iu;
|
|
84
|
+
/**
|
|
85
|
+
* Whether a failed create was rejected because the destination token is not
|
|
86
|
+
* available in the customer's jurisdiction. The response body is only carried
|
|
87
|
+
* in the error message, so this matches it there.
|
|
88
|
+
*
|
|
89
|
+
* @param error - Error thrown by `RampsController.createAutoramp`.
|
|
90
|
+
* @returns True when the error message carries the jurisdiction rejection.
|
|
91
|
+
*/
|
|
92
|
+
export function isTokenUnavailableInJurisdictionError(error) {
|
|
93
|
+
return (error instanceof Error &&
|
|
94
|
+
TOKEN_UNAVAILABLE_IN_JURISDICTION.test(error.message));
|
|
95
|
+
}
|
|
60
96
|
/**
|
|
61
97
|
* Deposit rails MoonPay needs Active before it accepts a
|
|
62
98
|
* {@link buildMusdAutorampRequest} create, keyed by fiat code. neobank-proxy
|
|
@@ -74,15 +110,32 @@ const BLOCKED_ABILITY_STATUSES = new Set([
|
|
|
74
110
|
'Blocked',
|
|
75
111
|
]);
|
|
76
112
|
/**
|
|
77
|
-
* Reads
|
|
78
|
-
*
|
|
113
|
+
* Reads whether a fiat → mUSD autoramp can be created from the customer's
|
|
114
|
+
* abilities: the deposit rails first, then the destination token. The token
|
|
115
|
+
* is only checked once the rails are ready, so a customer whose rails are
|
|
116
|
+
* still settling keeps waiting instead of failing on a partial `currencies`.
|
|
79
117
|
*
|
|
80
118
|
* @param abilities - Customer abilities, e.g. `vbaCustomerAbilities`.
|
|
81
119
|
* @param sourceCurrencyCode - Fiat code passed to
|
|
82
120
|
* {@link buildMusdAutorampRequest}.
|
|
83
|
-
* @returns The
|
|
121
|
+
* @returns The autoramp readiness.
|
|
84
122
|
*/
|
|
85
123
|
export function getMusdAutorampDepositRailReadiness(abilities, sourceCurrencyCode) {
|
|
124
|
+
const railReadiness = getDepositRailReadiness(abilities, sourceCurrencyCode);
|
|
125
|
+
if (railReadiness === 'active' && !isMusdDestinationAvailable(abilities)) {
|
|
126
|
+
return 'unavailable';
|
|
127
|
+
}
|
|
128
|
+
return railReadiness;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Reads the deposit rail readiness for a fiat → mUSD autoramp.
|
|
132
|
+
*
|
|
133
|
+
* @param abilities - Customer abilities.
|
|
134
|
+
* @param sourceCurrencyCode - Fiat code passed to
|
|
135
|
+
* {@link buildMusdAutorampRequest}.
|
|
136
|
+
* @returns The rail readiness.
|
|
137
|
+
*/
|
|
138
|
+
function getDepositRailReadiness(abilities, sourceCurrencyCode) {
|
|
86
139
|
const code = sourceCurrencyCode.toUpperCase();
|
|
87
140
|
const rails = MUSD_AUTORAMP_REQUIRED_DEPOSIT_RAILS[code];
|
|
88
141
|
if (!rails) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autorampAccount.js","sourceRoot":"","sources":["../src/autorampAccount.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,2CAAyB,CAAA;IACzB,6CAA2B,CAAA;IAC3B,6DAA2C,CAAA;IAC3C,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,yCAAuB,CAAA;AACzB,CAAC,EARW,cAAc,KAAd,cAAc,QAQzB;AAwCD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CACtC,aAAqB,EACrB,kBAA0B;IAE1B,OAAO;QACL,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;QAC/D,oBAAoB,EAAE;YACpB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,UAAU,EAAE,OAAO;SACpB;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,aAAa;SACvB;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,8BAA8B,CAC5C,aAAqB;IAErB,OAAO,wBAAwB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,CAAC,UAAU;YACnB,CAAC,CAAC,KAAK,CAAC,UAAU;QACtB,aAAa,EACX,MAAM,CAAC,aAAa,KAAK,SAAS,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;YACnE,CAAC,CAAC,MAAM,CAAC,aAAa;YACtB,CAAC,CAAC,KAAK,CAAC,aAAa;QACzB,MAAM,EAAE,YAAY;QACpB,cAAc,EAAE,cAAc;QAC9B,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,mBAAmB,EAAE,wBAAwB,CAC3C,KAAK,CAAC,mBAAmB,EACzB,MAAM,CAAC,mBAAmB,CAC3B;KACF,CAAC;IAEF,OAAO;QACL,OAAO;QACP,cAAc;QACd,aAAa;QACb,YAAY;KACb,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAwB;IAExB,OAAO;QACL,GAAG,OAAO;QACV,iBAAiB,EAAE,OAAO,CAAC,MAAM;KAClC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Local + remote models for MoonPay Enterprise autoramp accounts.\n * Separate from {@link RampsOrder}: autoramps are standing routes; orders are payments.\n */\n\nimport type {\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n} from './autoramp-types.js';\nimport type { NeoBankCustomerAbilities } from './NeoBankService.js';\n\nexport type {\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n} from './autoramp-types.js';\n\n/**\n * Autoramp lifecycle statuses from MoonPay Enterprise.\n *\n * @see https://dev.enterprise.moonpay.com/autoramp-status\n */\nexport enum AutorampStatus {\n Created = 'Created',\n Authorized = 'Authorized',\n EditPending = 'EditPending',\n DepositAccountAdded = 'DepositAccountAdded',\n Approved = 'Approved',\n Rejected = 'Rejected',\n Cancelled = 'Cancelled',\n}\n\n/**\n * Local controller representation of an autoramp account.\n */\nexport type AutorampAccount = {\n /** MoonPay autoramp id. */\n id: string;\n /** MoonPay customer id. */\n customerId: string;\n /** Destination wallet address associated with this autoramp. */\n walletAddress: string;\n /** Latest status from MoonPay (source of truth after refresh). */\n status: AutorampStatus;\n /**\n * Status observed before the most recent remote apply.\n * Used for transition UX / analytics (e.g. Authorized → Approved).\n */\n lastSeenStatus: AutorampStatus;\n /**\n * Last status for which the UI already showed a notification.\n * Prevents duplicate toasts across refresh and push.\n */\n notifiedForStatus?: AutorampStatus;\n /** Epoch ms of the last local update from remote or push. */\n updatedAt: number;\n /** Optional non-PII deposit readiness cache. */\n depositRailsSummary?: AutorampDepositRailsSummary;\n};\n\n/**\n * Controller-facing payload for creating an autoramp.\n *\n * Mirrors the MoonPay `POST /api/autoramps` body that\n * {@link NeoBankService.createAutoramp} forwards opaquely, minus `customer_id`:\n * `RampsController.createAutoramp` injects the vendor customer id resolved from\n * Profile Sync, so callers never supply (or need to know) it.\n */\nexport type CreateAutorampRequest = Record<string, unknown>;\n\n/**\n * Standing fiat → mUSD autoramp for a Money Account on Monad.\n *\n * `customer_id` is omitted; {@link RampsController.createAutoramp} injects it.\n * The fiat code is required: this helper does not default to BRL.\n *\n * The body does not set `source_is_third_party`: neobank-proxy overwrites it\n * on every market create, choosing per customer from the eligible rails.\n *\n * @param walletAddress - Money Account address that receives mUSD.\n * @param sourceCurrencyCode - Fiat code placed in `source_currencies[0].code`.\n * @returns MoonPay `POST /autoramps` market body.\n */\nexport function buildMusdAutorampRequest(\n walletAddress: string,\n sourceCurrencyCode: string,\n): CreateAutorampRequest {\n return {\n source_currencies: [{ type: 'Fiat', code: sourceCurrencyCode }],\n destination_currency: {\n type: 'Crypto',\n token: 'mUSD',\n blockchain: 'Monad',\n },\n recipient_account: {\n type: 'Crypto',\n chain: 'Monad',\n address: walletAddress,\n },\n };\n}\n\n/**\n * Standing BRL → mUSD autoramp for a Money Account on Monad.\n *\n * Wrapper around {@link buildMusdAutorampRequest} with code `BRL`.\n * `customer_id` is omitted; {@link RampsController.createAutoramp} injects it.\n *\n * @param walletAddress - Money Account address that receives mUSD.\n * @returns MoonPay `POST /autoramps` market body.\n */\nexport function buildBrazilMusdAutorampRequest(\n walletAddress: string,\n): CreateAutorampRequest {\n return buildMusdAutorampRequest(walletAddress, 'BRL');\n}\n\n/**\n * Deposit rails MoonPay needs Active before it accepts a\n * {@link buildMusdAutorampRequest} create, keyed by fiat code. neobank-proxy\n * normally sends creates as third-party, so that rail is required too. EUR is\n * the exception: the proxy falls back to a first-party autoramp when\n * `sepa_thirdparty` is not Active, so only the base rail is required.\n */\nconst MUSD_AUTORAMP_REQUIRED_DEPOSIT_RAILS: Readonly<\n Record<string, readonly string[]>\n> = {\n BRL: ['pix', 'pix_thirdparty'],\n USD: ['ach', 'ach_thirdparty'],\n EUR: ['sepa'],\n};\n\nconst BLOCKED_ABILITY_STATUSES: ReadonlySet<string> = new Set([\n 'Unavailable',\n 'Blocked',\n]);\n\n/**\n * Whether the deposit rails a fiat → mUSD autoramp needs are usable.\n *\n * - `active`: every required rail is Active, or the fiat has none.\n * - `pending`: a required rail is not Active yet (Pending, Maintenance or\n * missing), so MoonPay would reject the create for now.\n * - `blocked`: a required rail is Unavailable or Blocked.\n */\nexport type MusdAutorampDepositRailReadiness = 'active' | 'pending' | 'blocked';\n\n/**\n * Reads the deposit rail readiness for a fiat → mUSD autoramp from the\n * customer's abilities.\n *\n * @param abilities - Customer abilities, e.g. `vbaCustomerAbilities`.\n * @param sourceCurrencyCode - Fiat code passed to\n * {@link buildMusdAutorampRequest}.\n * @returns The rail readiness.\n */\nexport function getMusdAutorampDepositRailReadiness(\n abilities: NeoBankCustomerAbilities,\n sourceCurrencyCode: string,\n): MusdAutorampDepositRailReadiness {\n const code = sourceCurrencyCode.toUpperCase();\n const rails = MUSD_AUTORAMP_REQUIRED_DEPOSIT_RAILS[code];\n if (!rails) {\n return 'active';\n }\n const currencyRails = abilities.fiat_deposit[code.toLowerCase()] ?? {};\n const statuses = rails.map((rail) => currencyRails[rail]);\n if (\n statuses.some(\n (status) => status !== undefined && BLOCKED_ABILITY_STATUSES.has(status),\n )\n ) {\n return 'blocked';\n }\n return statuses.every((status) => status === 'Active') ? 'active' : 'pending';\n}\n\n/**\n * Result of applying a remote autoramp snapshot onto local state.\n */\nexport type ApplyAutorampRemoteStatusResult = {\n account: AutorampAccount;\n previousStatus: AutorampStatus;\n statusChanged: boolean;\n /** True when status changed and UI has not yet notified for the new status. */\n shouldNotify: boolean;\n};\n\n/**\n * Terminal autoramp statuses — no further lifecycle progress expected.\n */\nexport const TERMINAL_AUTORAMP_STATUSES: ReadonlySet<AutorampStatus> = new Set([\n AutorampStatus.Rejected,\n AutorampStatus.Cancelled,\n]);\n\n/**\n * Statuses that commonly warrant user-visible transition UX (toast / banner).\n */\nexport const NOTABLE_AUTORAMP_STATUSES: ReadonlySet<AutorampStatus> = new Set([\n AutorampStatus.Approved,\n AutorampStatus.Rejected,\n AutorampStatus.Cancelled,\n]);\n\n/**\n * Whether an autoramp status is terminal.\n *\n * @param status - Status to test.\n * @returns Whether the status is terminal.\n */\nexport function isTerminalAutorampStatus(status: AutorampStatus): boolean {\n return TERMINAL_AUTORAMP_STATUSES.has(status);\n}\n\n/**\n * Normalize a remote status string into {@link AutorampStatus}.\n * Unknown values fall back to {@link AutorampStatus.Created}.\n *\n * @param status - Remote status string.\n * @returns A known {@link AutorampStatus}.\n */\nexport function normalizeAutorampStatus(\n status: AutorampStatus | string,\n): AutorampStatus {\n if (Object.values(AutorampStatus).includes(status as AutorampStatus)) {\n return status as AutorampStatus;\n }\n return AutorampStatus.Created;\n}\n\n/**\n * Build a new local autoramp account from create/response fields.\n *\n * @param input - Required identity + status fields.\n * @param input.id - MoonPay autoramp id.\n * @param input.customerId - MoonPay customer id.\n * @param input.walletAddress - Destination wallet address.\n * @param input.status - Optional remote status (defaults to Authorized).\n * @param input.depositRailsSummary - Optional non-PII deposit readiness cache.\n * @param input.updatedAt - Optional epoch ms timestamp (defaults to now).\n * @returns A new {@link AutorampAccount}.\n */\nexport function createAutorampAccount(input: {\n id: string;\n customerId: string;\n walletAddress: string;\n status?: AutorampStatus | string;\n depositRailsSummary?: AutorampDepositRailsSummary;\n updatedAt?: number;\n}): AutorampAccount {\n const status = normalizeAutorampStatus(\n input.status ?? AutorampStatus.Authorized,\n );\n return {\n id: input.id,\n customerId: input.customerId,\n walletAddress: input.walletAddress,\n status,\n lastSeenStatus: status,\n updatedAt: input.updatedAt ?? Date.now(),\n depositRailsSummary: input.depositRailsSummary,\n };\n}\n\n/**\n * Keeps a currency the client already learned when a later snapshot omits it.\n * Readiness follows the remote snapshot. A remote currency replaces the local one.\n *\n * @param local - Currency summary already stored for this autoramp.\n * @param remote - Currency summary from the latest GET or push.\n * @returns The summary to store, or undefined when neither side has one.\n */\nexport function mergeDepositRailsSummary(\n local: AutorampDepositRailsSummary | undefined,\n remote: AutorampDepositRailsSummary | undefined,\n): AutorampDepositRailsSummary | undefined {\n if (!remote) {\n return local;\n }\n if (!local) {\n return remote;\n }\n const currency = remote.currency ?? local.currency;\n return {\n ready: remote.ready,\n ...(currency ? { currency } : {}),\n };\n}\n\n/**\n * Apply a remote autoramp snapshot onto a local account for transition detection.\n * Pure helper — shared by refresh-on-load and websocket push paths.\n *\n * @param local - Current local account (or null when first upserting from remote).\n * @param remote - Remote snapshot (MoonPay GET or push).\n * @returns Updated account plus change / notify flags.\n */\nexport function applyAutorampRemoteStatus(\n local: AutorampAccount | null,\n remote: AutorampRemoteSnapshot,\n): ApplyAutorampRemoteStatusResult {\n const remoteStatus = normalizeAutorampStatus(remote.status);\n\n if (!local) {\n const account = createAutorampAccount({\n id: remote.id,\n customerId: remote.customerId ?? '',\n walletAddress: remote.walletAddress ?? '',\n status: remoteStatus,\n depositRailsSummary: remote.depositRailsSummary,\n });\n return {\n account,\n previousStatus: remoteStatus,\n statusChanged: false,\n shouldNotify: false,\n };\n }\n\n const previousStatus = local.status;\n const statusChanged = previousStatus !== remoteStatus;\n const shouldNotify =\n statusChanged &&\n local.notifiedForStatus !== remoteStatus &&\n NOTABLE_AUTORAMP_STATUSES.has(remoteStatus);\n\n const account: AutorampAccount = {\n ...local,\n id: remote.id,\n // A blank remote identity field means \"not supplied\", not \"cleared\": the\n // proxy omits or empties these on partial status pushes, so keep the local\n // value rather than wiping it.\n customerId:\n remote.customerId !== undefined && remote.customerId.length > 0\n ? remote.customerId\n : local.customerId,\n walletAddress:\n remote.walletAddress !== undefined && remote.walletAddress.length > 0\n ? remote.walletAddress\n : local.walletAddress,\n status: remoteStatus,\n lastSeenStatus: previousStatus,\n updatedAt: Date.now(),\n depositRailsSummary: mergeDepositRailsSummary(\n local.depositRailsSummary,\n remote.depositRailsSummary,\n ),\n };\n\n return {\n account,\n previousStatus,\n statusChanged,\n shouldNotify,\n };\n}\n\n/**\n * Mark that the UI has notified for the account's current status.\n *\n * @param account - Account to update.\n * @returns Account with `notifiedForStatus` set to current status.\n */\nexport function markAutorampNotified(\n account: AutorampAccount,\n): AutorampAccount {\n return {\n ...account,\n notifiedForStatus: account.status,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"autorampAccount.js","sourceRoot":"","sources":["../src/autorampAccount.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,2CAAyB,CAAA;IACzB,6CAA2B,CAAA;IAC3B,6DAA2C,CAAA;IAC3C,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,yCAAuB,CAAA;AACzB,CAAC,EARW,cAAc,KAAd,cAAc,QAQzB;AAwCD,sEAAsE;AACtE,MAAM,gBAAgB,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAW,CAAC;AAEzE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CACtC,aAAqB,EACrB,kBAA0B;IAE1B,OAAO;QACL,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;QAC/D,oBAAoB,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E,MAAM,CAAC,EAAE;QACb,yEAAyE;QACzE,2EAA2E;QAC3E,+BAA+B;QAC/B,UAAU,EACR,MAAM,CAAC,UAAU,KAAK,SAAS,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;YAC7D,CAAC,CAAC,MAAM,CAAC,UAAU;YACnB,CAAC,CAAC,KAAK,CAAC,UAAU;QACtB,aAAa,EACX,MAAM,CAAC,aAAa,KAAK,SAAS,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;YACnE,CAAC,CAAC,MAAM,CAAC,aAAa;YACtB,CAAC,CAAC,KAAK,CAAC,aAAa;QACzB,MAAM,EAAE,YAAY;QACpB,cAAc,EAAE,cAAc;QAC9B,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,mBAAmB,EAAE,wBAAwB,CAC3C,KAAK,CAAC,mBAAmB,EACzB,MAAM,CAAC,mBAAmB,CAC3B;KACF,CAAC;IAEF,OAAO;QACL,OAAO;QACP,cAAc;QACd,aAAa;QACb,YAAY;KACb,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAwB;IAExB,OAAO;QACL,GAAG,OAAO;QACV,iBAAiB,EAAE,OAAO,CAAC,MAAM;KAClC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Local + remote models for MoonPay Enterprise autoramp accounts.\n * Separate from {@link RampsOrder}: autoramps are standing routes; orders are payments.\n */\n\nimport type {\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n} from './autoramp-types.js';\nimport type { NeoBankCustomerAbilities } from './NeoBankService.js';\n\nexport type {\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n} from './autoramp-types.js';\n\n/**\n * Autoramp lifecycle statuses from MoonPay Enterprise.\n *\n * @see https://dev.enterprise.moonpay.com/autoramp-status\n */\nexport enum AutorampStatus {\n Created = 'Created',\n Authorized = 'Authorized',\n EditPending = 'EditPending',\n DepositAccountAdded = 'DepositAccountAdded',\n Approved = 'Approved',\n Rejected = 'Rejected',\n Cancelled = 'Cancelled',\n}\n\n/**\n * Local controller representation of an autoramp account.\n */\nexport type AutorampAccount = {\n /** MoonPay autoramp id. */\n id: string;\n /** MoonPay customer id. */\n customerId: string;\n /** Destination wallet address associated with this autoramp. */\n walletAddress: string;\n /** Latest status from MoonPay (source of truth after refresh). */\n status: AutorampStatus;\n /**\n * Status observed before the most recent remote apply.\n * Used for transition UX / analytics (e.g. Authorized → Approved).\n */\n lastSeenStatus: AutorampStatus;\n /**\n * Last status for which the UI already showed a notification.\n * Prevents duplicate toasts across refresh and push.\n */\n notifiedForStatus?: AutorampStatus;\n /** Epoch ms of the last local update from remote or push. */\n updatedAt: number;\n /** Optional non-PII deposit readiness cache. */\n depositRailsSummary?: AutorampDepositRailsSummary;\n};\n\n/**\n * Controller-facing payload for creating an autoramp.\n *\n * Mirrors the MoonPay `POST /api/autoramps` body that\n * {@link NeoBankService.createAutoramp} forwards opaquely, minus `customer_id`:\n * `RampsController.createAutoramp` injects the vendor customer id resolved from\n * Profile Sync, so callers never supply (or need to know) it.\n */\nexport type CreateAutorampRequest = Record<string, unknown>;\n\n/** Destination of every {@link buildMusdAutorampRequest} autoramp. */\nconst MUSD_DESTINATION = { token: 'mUSD', blockchain: 'Monad' } as const;\n\n/**\n * Standing fiat → mUSD autoramp for a Money Account on Monad.\n *\n * `customer_id` is omitted; {@link RampsController.createAutoramp} injects it.\n * The fiat code is required: this helper does not default to BRL.\n *\n * The body does not set `source_is_third_party`: neobank-proxy overwrites it\n * on every market create, choosing per customer from the eligible rails.\n *\n * @param walletAddress - Money Account address that receives mUSD.\n * @param sourceCurrencyCode - Fiat code placed in `source_currencies[0].code`.\n * @returns MoonPay `POST /autoramps` market body.\n */\nexport function buildMusdAutorampRequest(\n walletAddress: string,\n sourceCurrencyCode: string,\n): CreateAutorampRequest {\n return {\n source_currencies: [{ type: 'Fiat', code: sourceCurrencyCode }],\n destination_currency: { type: 'Crypto', ...MUSD_DESTINATION },\n recipient_account: {\n type: 'Crypto',\n chain: MUSD_DESTINATION.blockchain,\n address: walletAddress,\n },\n };\n}\n\n/**\n * Standing BRL → mUSD autoramp for a Money Account on Monad.\n *\n * Wrapper around {@link buildMusdAutorampRequest} with code `BRL`.\n * `customer_id` is omitted; {@link RampsController.createAutoramp} injects it.\n *\n * @param walletAddress - Money Account address that receives mUSD.\n * @returns MoonPay `POST /autoramps` market body.\n */\nexport function buildBrazilMusdAutorampRequest(\n walletAddress: string,\n): CreateAutorampRequest {\n return buildMusdAutorampRequest(walletAddress, 'BRL');\n}\n\n/**\n * Whether the customer may onramp into mUSD on Monad. MoonPay lists in\n * `currencies` only what the customer's jurisdiction allows, and rejects a\n * create for anything else. Fails open when `currencies` is missing.\n *\n * @param abilities - Customer abilities.\n * @returns False only when `currencies` lacks mUSD on Monad with `Onramp`.\n */\nfunction isMusdDestinationAvailable(\n abilities: NeoBankCustomerAbilities,\n): boolean {\n const { currencies } = abilities as { currencies?: unknown };\n if (!Array.isArray(currencies)) {\n return true;\n }\n return (currencies as NeoBankCustomerAbilities['currencies']).some(\n ({ currency, flows }) =>\n currency?.type === 'Crypto' &&\n currency.token?.toLowerCase() === MUSD_DESTINATION.token.toLowerCase() &&\n currency.blockchain?.toLowerCase() ===\n MUSD_DESTINATION.blockchain.toLowerCase() &&\n Array.isArray(flows) &&\n flows.includes('Onramp'),\n );\n}\n\n/**\n * A create rejected because the destination token is not available in the\n * customer's jurisdiction: neobank-proxy's error code, or MoonPay's own text\n * when the proxy forwards the body as is.\n */\nconst TOKEN_UNAVAILABLE_IN_JURISDICTION =\n /token_unavailable_in_jurisdiction|not available in the jurisdiction/iu;\n\n/**\n * Whether a failed create was rejected because the destination token is not\n * available in the customer's jurisdiction. The response body is only carried\n * in the error message, so this matches it there.\n *\n * @param error - Error thrown by `RampsController.createAutoramp`.\n * @returns True when the error message carries the jurisdiction rejection.\n */\nexport function isTokenUnavailableInJurisdictionError(error: unknown): boolean {\n return (\n error instanceof Error &&\n TOKEN_UNAVAILABLE_IN_JURISDICTION.test(error.message)\n );\n}\n\n/**\n * Deposit rails MoonPay needs Active before it accepts a\n * {@link buildMusdAutorampRequest} create, keyed by fiat code. neobank-proxy\n * normally sends creates as third-party, so that rail is required too. EUR is\n * the exception: the proxy falls back to a first-party autoramp when\n * `sepa_thirdparty` is not Active, so only the base rail is required.\n */\nconst MUSD_AUTORAMP_REQUIRED_DEPOSIT_RAILS: Readonly<\n Record<string, readonly string[]>\n> = {\n BRL: ['pix', 'pix_thirdparty'],\n USD: ['ach', 'ach_thirdparty'],\n EUR: ['sepa'],\n};\n\nconst BLOCKED_ABILITY_STATUSES: ReadonlySet<string> = new Set([\n 'Unavailable',\n 'Blocked',\n]);\n\n/**\n * Whether a fiat → mUSD autoramp can be created now.\n *\n * - `active`: every required rail is Active, or the fiat has none, and mUSD\n * on Monad is available to the customer.\n * - `pending`: a required rail is not Active yet (Pending, Maintenance or\n * missing), so MoonPay would reject the create for now.\n * - `blocked`: a required rail is Unavailable or Blocked.\n * - `unavailable`: the rails are ready, but mUSD on Monad is not available to\n * the customer's jurisdiction (missing from abilities `currencies`, or\n * without `Onramp`), so MoonPay would reject the create. It follows the\n * customer's KYC region, so an immediate retry does not help, but a later\n * check passes once MoonPay offers the token to that customer.\n */\nexport type MusdAutorampDepositRailReadiness =\n | 'active'\n | 'pending'\n | 'blocked'\n | 'unavailable';\n\n/**\n * Reads whether a fiat → mUSD autoramp can be created from the customer's\n * abilities: the deposit rails first, then the destination token. The token\n * is only checked once the rails are ready, so a customer whose rails are\n * still settling keeps waiting instead of failing on a partial `currencies`.\n *\n * @param abilities - Customer abilities, e.g. `vbaCustomerAbilities`.\n * @param sourceCurrencyCode - Fiat code passed to\n * {@link buildMusdAutorampRequest}.\n * @returns The autoramp readiness.\n */\nexport function getMusdAutorampDepositRailReadiness(\n abilities: NeoBankCustomerAbilities,\n sourceCurrencyCode: string,\n): MusdAutorampDepositRailReadiness {\n const railReadiness = getDepositRailReadiness(abilities, sourceCurrencyCode);\n if (railReadiness === 'active' && !isMusdDestinationAvailable(abilities)) {\n return 'unavailable';\n }\n return railReadiness;\n}\n\n/**\n * Reads the deposit rail readiness for a fiat → mUSD autoramp.\n *\n * @param abilities - Customer abilities.\n * @param sourceCurrencyCode - Fiat code passed to\n * {@link buildMusdAutorampRequest}.\n * @returns The rail readiness.\n */\nfunction getDepositRailReadiness(\n abilities: NeoBankCustomerAbilities,\n sourceCurrencyCode: string,\n): Exclude<MusdAutorampDepositRailReadiness, 'unavailable'> {\n const code = sourceCurrencyCode.toUpperCase();\n const rails = MUSD_AUTORAMP_REQUIRED_DEPOSIT_RAILS[code];\n if (!rails) {\n return 'active';\n }\n const currencyRails = abilities.fiat_deposit[code.toLowerCase()] ?? {};\n const statuses = rails.map((rail) => currencyRails[rail]);\n if (\n statuses.some(\n (status) => status !== undefined && BLOCKED_ABILITY_STATUSES.has(status),\n )\n ) {\n return 'blocked';\n }\n return statuses.every((status) => status === 'Active') ? 'active' : 'pending';\n}\n\n/**\n * Result of applying a remote autoramp snapshot onto local state.\n */\nexport type ApplyAutorampRemoteStatusResult = {\n account: AutorampAccount;\n previousStatus: AutorampStatus;\n statusChanged: boolean;\n /** True when status changed and UI has not yet notified for the new status. */\n shouldNotify: boolean;\n};\n\n/**\n * Terminal autoramp statuses — no further lifecycle progress expected.\n */\nexport const TERMINAL_AUTORAMP_STATUSES: ReadonlySet<AutorampStatus> = new Set([\n AutorampStatus.Rejected,\n AutorampStatus.Cancelled,\n]);\n\n/**\n * Statuses that commonly warrant user-visible transition UX (toast / banner).\n */\nexport const NOTABLE_AUTORAMP_STATUSES: ReadonlySet<AutorampStatus> = new Set([\n AutorampStatus.Approved,\n AutorampStatus.Rejected,\n AutorampStatus.Cancelled,\n]);\n\n/**\n * Whether an autoramp status is terminal.\n *\n * @param status - Status to test.\n * @returns Whether the status is terminal.\n */\nexport function isTerminalAutorampStatus(status: AutorampStatus): boolean {\n return TERMINAL_AUTORAMP_STATUSES.has(status);\n}\n\n/**\n * Normalize a remote status string into {@link AutorampStatus}.\n * Unknown values fall back to {@link AutorampStatus.Created}.\n *\n * @param status - Remote status string.\n * @returns A known {@link AutorampStatus}.\n */\nexport function normalizeAutorampStatus(\n status: AutorampStatus | string,\n): AutorampStatus {\n if (Object.values(AutorampStatus).includes(status as AutorampStatus)) {\n return status as AutorampStatus;\n }\n return AutorampStatus.Created;\n}\n\n/**\n * Build a new local autoramp account from create/response fields.\n *\n * @param input - Required identity + status fields.\n * @param input.id - MoonPay autoramp id.\n * @param input.customerId - MoonPay customer id.\n * @param input.walletAddress - Destination wallet address.\n * @param input.status - Optional remote status (defaults to Authorized).\n * @param input.depositRailsSummary - Optional non-PII deposit readiness cache.\n * @param input.updatedAt - Optional epoch ms timestamp (defaults to now).\n * @returns A new {@link AutorampAccount}.\n */\nexport function createAutorampAccount(input: {\n id: string;\n customerId: string;\n walletAddress: string;\n status?: AutorampStatus | string;\n depositRailsSummary?: AutorampDepositRailsSummary;\n updatedAt?: number;\n}): AutorampAccount {\n const status = normalizeAutorampStatus(\n input.status ?? AutorampStatus.Authorized,\n );\n return {\n id: input.id,\n customerId: input.customerId,\n walletAddress: input.walletAddress,\n status,\n lastSeenStatus: status,\n updatedAt: input.updatedAt ?? Date.now(),\n depositRailsSummary: input.depositRailsSummary,\n };\n}\n\n/**\n * Keeps a currency the client already learned when a later snapshot omits it.\n * Readiness follows the remote snapshot. A remote currency replaces the local one.\n *\n * @param local - Currency summary already stored for this autoramp.\n * @param remote - Currency summary from the latest GET or push.\n * @returns The summary to store, or undefined when neither side has one.\n */\nexport function mergeDepositRailsSummary(\n local: AutorampDepositRailsSummary | undefined,\n remote: AutorampDepositRailsSummary | undefined,\n): AutorampDepositRailsSummary | undefined {\n if (!remote) {\n return local;\n }\n if (!local) {\n return remote;\n }\n const currency = remote.currency ?? local.currency;\n return {\n ready: remote.ready,\n ...(currency ? { currency } : {}),\n };\n}\n\n/**\n * Apply a remote autoramp snapshot onto a local account for transition detection.\n * Pure helper — shared by refresh-on-load and websocket push paths.\n *\n * @param local - Current local account (or null when first upserting from remote).\n * @param remote - Remote snapshot (MoonPay GET or push).\n * @returns Updated account plus change / notify flags.\n */\nexport function applyAutorampRemoteStatus(\n local: AutorampAccount | null,\n remote: AutorampRemoteSnapshot,\n): ApplyAutorampRemoteStatusResult {\n const remoteStatus = normalizeAutorampStatus(remote.status);\n\n if (!local) {\n const account = createAutorampAccount({\n id: remote.id,\n customerId: remote.customerId ?? '',\n walletAddress: remote.walletAddress ?? '',\n status: remoteStatus,\n depositRailsSummary: remote.depositRailsSummary,\n });\n return {\n account,\n previousStatus: remoteStatus,\n statusChanged: false,\n shouldNotify: false,\n };\n }\n\n const previousStatus = local.status;\n const statusChanged = previousStatus !== remoteStatus;\n const shouldNotify =\n statusChanged &&\n local.notifiedForStatus !== remoteStatus &&\n NOTABLE_AUTORAMP_STATUSES.has(remoteStatus);\n\n const account: AutorampAccount = {\n ...local,\n id: remote.id,\n // A blank remote identity field means \"not supplied\", not \"cleared\": the\n // proxy omits or empties these on partial status pushes, so keep the local\n // value rather than wiping it.\n customerId:\n remote.customerId !== undefined && remote.customerId.length > 0\n ? remote.customerId\n : local.customerId,\n walletAddress:\n remote.walletAddress !== undefined && remote.walletAddress.length > 0\n ? remote.walletAddress\n : local.walletAddress,\n status: remoteStatus,\n lastSeenStatus: previousStatus,\n updatedAt: Date.now(),\n depositRailsSummary: mergeDepositRailsSummary(\n local.depositRailsSummary,\n remote.depositRailsSummary,\n ),\n };\n\n return {\n account,\n previousStatus,\n statusChanged,\n shouldNotify,\n };\n}\n\n/**\n * Mark that the UI has notified for the account's current status.\n *\n * @param account - Account to update.\n * @returns Account with `notifiedForStatus` set to current status.\n */\nexport function markAutorampNotified(\n account: AutorampAccount,\n): AutorampAccount {\n return {\n ...account,\n notifiedForStatus: account.status,\n };\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export { TransakApiError, TransakService, TransakEnvironment, TransakOrderIdTran
|
|
|
28
28
|
export { getTransakApiMessage, isTransakPhoneRegisteredError, } from './transakApiErrorUtils.js';
|
|
29
29
|
export type { TransakServiceMethodActions, TransakServiceSendUserOtpAction, TransakServiceVerifyUserOtpAction, TransakServiceGetUserDetailsAction, TransakServiceGetBuyQuoteAction, TransakServiceGetKycRequirementAction, TransakServiceCreateOrderAction, TransakServiceGetOrderAction, TransakServiceRequestOttAction, TransakServiceGeneratePaymentWidgetUrlAction, TransakServiceCreateWidgetUrlAction, } from './TransakService-method-action-types.js';
|
|
30
30
|
export type { AutorampAccount, ApplyAutorampRemoteStatusResult, CreateAutorampRequest, MusdAutorampDepositRailReadiness, } from './autorampAccount.js';
|
|
31
|
-
export { AutorampStatus, TERMINAL_AUTORAMP_STATUSES, NOTABLE_AUTORAMP_STATUSES, isTerminalAutorampStatus, normalizeAutorampStatus, createAutorampAccount, applyAutorampRemoteStatus, markAutorampNotified, buildMusdAutorampRequest, buildBrazilMusdAutorampRequest, getMusdAutorampDepositRailReadiness, } from './autorampAccount.js';
|
|
31
|
+
export { AutorampStatus, TERMINAL_AUTORAMP_STATUSES, NOTABLE_AUTORAMP_STATUSES, isTerminalAutorampStatus, normalizeAutorampStatus, createAutorampAccount, applyAutorampRemoteStatus, markAutorampNotified, buildMusdAutorampRequest, buildBrazilMusdAutorampRequest, getMusdAutorampDepositRailReadiness, isTokenUnavailableInJurisdictionError, } from './autorampAccount.js';
|
|
32
32
|
export { buildOwnershipMessage } from './ownership-message.js';
|
|
33
33
|
export type { AutorampTransactionRecord, AutorampTransactionRecords, AutorampTransactionChange, } from './diffAutorampTransactions.js';
|
|
34
34
|
export { diffAutorampTransactions } from './diffAutorampTransactions.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EAC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AAC9B,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,mCAAmC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,sCAAsC,EACtC,yCAAyC,EACzC,uCAAuC,EACvC,sBAAsB,EACtB,gCAAgC,EAChC,UAAU,EACV,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,8BAA8B,EAC9B,oCAAoC,EACpC,0CAA0C,EAC1C,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,YAAY,EACV,mCAAmC,EACnC,iCAAiC,EACjC,oCAAoC,EACpC,kCAAkC,EAClC,wCAAwC,EACxC,gDAAgD,EAChD,2CAA2C,EAC3C,yBAAyB,EACzB,iCAAiC,EACjC,8BAA8B,EAC9B,qCAAqC,EACrC,iCAAiC,EACjC,sCAAsC,EACtC,gDAAgD,EAChD,6CAA6C,EAC7C,8BAA8B,EAC9B,qCAAqC,EACrC,6BAA6B,EAC7B,gCAAgC,EAChC,gCAAgC,EAChC,mCAAmC,EACnC,yCAAyC,EACzC,mCAAmC,EACnC,+CAA+C,EAC/C,2CAA2C,EAC3C,gDAAgD,EAChD,oCAAoC,EACpC,qCAAqC,EACrC,gDAAgD,EAChD,6CAA6C,EAC7C,sCAAsC,EACtC,qCAAqC,EACrC,qCAAqC,EACrC,6CAA6C,EAC7C,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,EACtC,oCAAoC,EACpC,kCAAkC,EAClC,+CAA+C,EAC/C,uCAAuC,EACvC,2CAA2C,EAC3C,wCAAwC,EACxC,oCAAoC,EACpC,wCAAwC,EACxC,+CAA+C,EAC/C,4CAA4C,GAC7C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,cAAc,EACd,WAAW,IAAI,kBAAkB,EACjC,kCAAkC,EAClC,6BAA6B,EAC7B,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { getErrorMessage, extractExplicitTypedError, normalizeToTypedError, } fr
|
|
|
13
13
|
export { USER_STORAGE_RAMPS_ORDERS_FEATURE, USER_STORAGE_VERSION, USER_STORAGE_VERSION_KEY, createOrderStorageKey, isSyncableOrder, mapRampsOrderToUserStorageEntry, mapUserStorageEntryToRampsOrder, stripPaymentDetailsForRemoteStorage, stripSyncMetadata, stripDeletedAt, areOrdersEqual, canPerformOrderSyncing, syncOrdersWithUserStorage, updateOrderInUserStorage, deleteOrderInUserStorage, } from './order-syncing/index.js';
|
|
14
14
|
export { TransakApiError, TransakService, TransakEnvironment, TransakOrderIdTransformer, } from './TransakService.js';
|
|
15
15
|
export { getTransakApiMessage, isTransakPhoneRegisteredError, } from './transakApiErrorUtils.js';
|
|
16
|
-
export { AutorampStatus, TERMINAL_AUTORAMP_STATUSES, NOTABLE_AUTORAMP_STATUSES, isTerminalAutorampStatus, normalizeAutorampStatus, createAutorampAccount, applyAutorampRemoteStatus, markAutorampNotified, buildMusdAutorampRequest, buildBrazilMusdAutorampRequest, getMusdAutorampDepositRailReadiness, } from './autorampAccount.js';
|
|
16
|
+
export { AutorampStatus, TERMINAL_AUTORAMP_STATUSES, NOTABLE_AUTORAMP_STATUSES, isTerminalAutorampStatus, normalizeAutorampStatus, createAutorampAccount, applyAutorampRemoteStatus, markAutorampNotified, buildMusdAutorampRequest, buildBrazilMusdAutorampRequest, getMusdAutorampDepositRailReadiness, isTokenUnavailableInJurisdictionError, } from './autorampAccount.js';
|
|
17
17
|
export { buildOwnershipMessage } from './ownership-message.js';
|
|
18
18
|
export { diffAutorampTransactions } from './diffAutorampTransactions.js';
|
|
19
19
|
export { NeoBankService, serviceName as neoBankServiceName, mapNeoBankAutorampToRemoteSnapshot, extractPixDepositInstructions, extractSepaDepositInstructions, extractUsBankDepositInstructions, } from './NeoBankService.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAsElE,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,8BAA8B,EAC9B,oBAAoB,EACpB,yCAAyC,EACzC,4CAA4C,GAC7C,MAAM,sBAAsB,CAAC;AA2C9B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAmB9B,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EACL,sCAAsC,EACt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gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC","sourcesContent":["export type {\n RampsControllerActions,\n RampsControllerEvents,\n RampsControllerGetStateAction,\n RampsControllerMessenger,\n RampsControllerState,\n RampsControllerStateChangeEvent,\n RampsControllerOrderStatusChangedEvent,\n RampsControllerAutorampStatusChangedEvent,\n AutorampTransactionStatusChangedPayload,\n RampsControllerOptions,\n PaymentMethodsForContextResponse,\n UserRegion,\n ResourceState,\n TransakState,\n NativeProvidersState,\n MoneyAccountWalletRegistration,\n MoneyAccountWalletRegistrationResult,\n KeyringControllerSignPersonalMessageAction,\n VbaAutorampStatus,\n VbaKycStatus,\n VbaOnboardingSnapshot,\n VbaProviderFlowStatus,\n SelectProviderForAssetOptions,\n} from './RampsController.js';\nexport type { RampsProviderHistoryEntry } from './providerHistory.js';\nexport { getPreviouslyUsedProviders } from './providerHistory.js';\nexport type {\n RampsControllerExecuteRequestAction,\n RampsControllerAbortRequestAction,\n RampsControllerGetRequestStateAction,\n RampsControllerSetUserRegionAction,\n RampsControllerSetSelectedProviderAction,\n RampsControllerSetSelectedProviderForAssetAction,\n RampsControllerSelectProviderForAssetAction,\n RampsControllerInitAction,\n RampsControllerGetCountriesAction,\n RampsControllerGetTokensAction,\n RampsControllerSetSelectedTokenAction,\n RampsControllerGetProvidersAction,\n RampsControllerGetPaymentMethodsAction,\n RampsControllerGetPaymentMethodsForContextAction,\n RampsControllerSetSelectedPaymentMethodAction,\n RampsControllerGetQuotesAction,\n RampsControllerGetQuoteWithFeesAction,\n RampsControllerAddOrderAction,\n RampsControllerRemoveOrderAction,\n RampsControllerAddAutorampAction,\n RampsControllerCreateAutorampAction,\n RampsControllerHydrateVbaOnboardingAction,\n RampsControllerRemoveAutorampAction,\n RampsControllerRegisterMoneyAccountWalletAction,\n RampsControllerMarkAutorampAsNotifiedAction,\n RampsControllerApplyAutorampStatusFromPushAction,\n RampsControllerRefreshAutorampAction,\n RampsControllerRefreshAutorampsAction,\n RampsControllerRefreshAutorampTransactionsAction,\n RampsControllerRefreshCustomerAbilitiesAction,\n RampsControllerStartOrderPollingAction,\n RampsControllerStopOrderPollingAction,\n RampsControllerGetBuyWidgetDataAction,\n RampsControllerGetFallbackBuyWidgetDataAction,\n RampsControllerAddPrecreatedOrderAction,\n RampsControllerGetOrderAction,\n RampsControllerGetOrderFromCallbackAction,\n RampsControllerTransakSetApiKeyAction,\n RampsControllerTransakSetAccessTokenAction,\n RampsControllerTransakClearAccessTokenAction,\n RampsControllerTransakSetAuthenticatedAction,\n RampsControllerTransakResetStateAction,\n RampsControllerTransakSendUserOtpAction,\n RampsControllerTransakVerifyUserOtpAction,\n RampsControllerTransakLogoutAction,\n RampsControllerTransakGetUserDetailsAction,\n RampsControllerTransakGetBuyQuoteAction,\n RampsControllerTransakGetKycRequirementAction,\n RampsControllerTransakGetAdditionalRequirementsAction,\n RampsControllerTransakCreateOrderAction,\n RampsControllerTransakGetOrderAction,\n RampsControllerTransakGetUserLimitsAction,\n RampsControllerTransakRequestOttAction,\n RampsControllerTransakGeneratePaymentWidgetUrlAction,\n RampsControllerTransakSubmitPurposeOfUsageFormAction,\n RampsControllerTransakPatchUserAction,\n RampsControllerTransakSubmitSsnDetailsAction,\n RampsControllerTransakConfirmPaymentAction,\n RampsControllerTransakGetTranslationAction,\n RampsControllerTransakGetIdProofStatusAction,\n RampsControllerTransakCancelOrderAction,\n RampsControllerTransakCancelAllActiveOrdersAction,\n RampsControllerTransakGetActiveOrdersAction,\n RampsControllerTransakSubmitMicaConsentAction,\n RampsControllerTransakSubmitSourceOfIncomeAction,\n RampsControllerTransakSubmitAdditionalDetailsNationalityAction,\n RampsControllerSyncOrdersWithUserStorageAction,\n} from './RampsController-method-action-types.js';\nexport {\n RampsController,\n VBA_AUTORAMP_STATUSES,\n VBA_KYC_STATUSES,\n VBA_PROVIDER_FLOW_STATUSES,\n getDefaultRampsControllerState,\n getInternalOrderCode,\n RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS,\n RAMPS_CONTROLLER_REQUIRED_CONTROLLER_ACTIONS,\n} from './RampsController.js';\nexport type {\n RampsServiceActions,\n RampsServiceEvents,\n RampsServiceMessenger,\n RampsServiceInvalidateQueriesAction,\n RampsServiceCacheUpdatedEvent,\n RampsServiceGranularCacheUpdatedEvent,\n Country,\n State,\n SupportedActions,\n CountryPhone,\n Provider,\n ProviderLink,\n ProviderLogos,\n ProviderBrowserType,\n ProviderLimit,\n ProviderFiatLimits,\n ProviderLimits,\n ProviderSortOrder,\n ProvidersResponse,\n RampAction,\n PaymentMethod,\n PaymentMethodsResponse,\n Quote,\n QuoteError,\n QuoteSortBy,\n QuoteSortOrder,\n QuoteCryptoTranslation,\n QuoteCustomAction,\n QuotesResponse,\n GetQuotesParams,\n RampsToken,\n TokensResponse,\n BuyWidget,\n BuyWidgetFallback,\n RampsOrder,\n RampsOrderNetwork,\n RampsOrderCryptoCurrency,\n RampsOrderFiatCurrency,\n RampsOrderPaymentMethod,\n OrderPaymentDetail,\n} from './RampsService.js';\nexport {\n RampsService,\n RampsEnvironment,\n RampsApiService,\n RampsOrderStatus,\n RAMPS_SDK_VERSION,\n getDefaultRedirectCallbackUrl,\n} from './RampsService.js';\nexport type { RampsClientIdentity } from './client-identity.js';\nexport {\n addRampsClientIdentityParams,\n RAMPS_CLIENT_PRODUCT_PARAM,\n RAMPS_CLIENT_VERSION_PARAM,\n} from './client-identity.js';\nexport type {\n RampsServiceGetDefaultRedirectCallbackUrlAction,\n RampsServiceGetGeolocationAction,\n RampsServiceGetCountriesAction,\n RampsServiceGetPaymentMethodsAction,\n RampsServiceGetQuotesAction,\n RampsServiceGetBuyWidgetUrlAction,\n RampsServiceGetOrderAction,\n RampsServiceGetOrderFromCallbackAction,\n} from './RampsService-method-action-types.js';\nexport type {\n RequestCache,\n RequestState,\n ExecuteRequestOptions,\n PendingRequest,\n ResourceType,\n} from './RequestCache.js';\nexport type { RampsErrorCode } from './rampsErrorCodes.js';\nexport {\n RequestStatus,\n DEFAULT_REQUEST_CACHE_TTL,\n DEFAULT_REQUEST_CACHE_MAX_SIZE,\n createCacheKey,\n isCacheExpired,\n createLoadingState,\n createSuccessState,\n createErrorState,\n} from './RequestCache.js';\nexport { RAMPS_ERROR_CODES } from './rampsErrorCodes.js';\nexport type { RequestSelectorResult } from './selectors.js';\nexport { createRequestSelector } from './selectors.js';\nexport type { HeadlessFeatureFlagsLookup } from './featureFlags.js';\nexport {\n HEADLESS_ALL_PROVIDERS_FEATURE_VERSION,\n MONEY_HEADLESS_ALL_PROVIDERS_FLAG_KEY,\n getHeadlessProviderAllowlist,\n isHeadlessAllProvidersEnabled,\n} from './featureFlags.js';\nexport {\n normalizeRampsAssetId,\n providerServesAsset,\n getProvidersServingAsset,\n regionHasProviderForAsset,\n isFiatDepositAvailable,\n} from './providerAvailability.js';\nexport {\n isExternalBrowserQuote,\n isCustomActionQuote,\n isInAppOnlyQuote,\n getBuyWidgetFallback,\n} from './quoteClassification.js';\nexport {\n TERMINAL_ORDER_STATUSES,\n isTerminalOrderStatus,\n} from './orderStatus.js';\nexport type { TypedError } from './errorNormalization.js';\nexport {\n getErrorMessage,\n extractExplicitTypedError,\n normalizeToTypedError,\n} from './errorNormalization.js';\nexport type {\n UserStorageRampsOrderEntry,\n SyncRampsOrder,\n OrderSyncingController,\n OrderSyncingOptions,\n SyncOrdersWithUserStorageConfig,\n} from './order-syncing/index.js';\nexport {\n USER_STORAGE_RAMPS_ORDERS_FEATURE,\n USER_STORAGE_VERSION,\n USER_STORAGE_VERSION_KEY,\n createOrderStorageKey,\n isSyncableOrder,\n mapRampsOrderToUserStorageEntry,\n mapUserStorageEntryToRampsOrder,\n stripPaymentDetailsForRemoteStorage,\n stripSyncMetadata,\n stripDeletedAt,\n areOrdersEqual,\n canPerformOrderSyncing,\n syncOrdersWithUserStorage,\n updateOrderInUserStorage,\n deleteOrderInUserStorage,\n} from './order-syncing/index.js';\nexport type {\n TransakServiceActions,\n TransakServiceCacheUpdatedEvent,\n TransakServiceEvents,\n TransakServiceGranularCacheUpdatedEvent,\n TransakServiceInvalidateQueriesAction,\n TransakServiceMessenger,\n TransakAccessToken,\n TransakUserDetails,\n TransakUserDetailsAddress,\n TransakUserDetailsKycDetails,\n TransakBuyQuote,\n TransakKycRequirement,\n TransakAdditionalRequirement,\n TransakAdditionalRequirementsResponse,\n TransakOttResponse,\n TransakOrderPaymentMethod,\n TransakDepositOrder,\n TransakDepositNetwork,\n TransakDepositCryptoCurrency,\n TransakDepositPaymentMethod,\n TransakDepositRegion,\n TransakOrder,\n TransakQuoteTranslation,\n TransakTranslationRequest,\n TransakUserLimits,\n TransakIdProofStatus,\n PatchUserRequestBody as TransakPatchUserRequestBody,\n SubmitMicaConsentRequest,\n SubmitMicaConsentResponse,\n SubmitSourceOfIncomeRequest,\n SubmitSourceOfIncomeResponse,\n SubmitAdditionalDetailsNationalityRequest,\n SubmitAdditionalDetailsNationalityResponse,\n} from './TransakService.js';\nexport {\n TransakApiError,\n TransakService,\n TransakEnvironment,\n TransakOrderIdTransformer,\n} from './TransakService.js';\nexport {\n getTransakApiMessage,\n isTransakPhoneRegisteredError,\n} from './transakApiErrorUtils.js';\nexport type {\n TransakServiceMethodActions,\n TransakServiceSendUserOtpAction,\n TransakServiceVerifyUserOtpAction,\n TransakServiceGetUserDetailsAction,\n TransakServiceGetBuyQuoteAction,\n TransakServiceGetKycRequirementAction,\n TransakServiceCreateOrderAction,\n TransakServiceGetOrderAction,\n TransakServiceRequestOttAction,\n TransakServiceGeneratePaymentWidgetUrlAction,\n TransakServiceCreateWidgetUrlAction,\n} from './TransakService-method-action-types.js';\nexport type {\n AutorampAccount,\n ApplyAutorampRemoteStatusResult,\n CreateAutorampRequest,\n MusdAutorampDepositRailReadiness,\n} from './autorampAccount.js';\nexport {\n AutorampStatus,\n TERMINAL_AUTORAMP_STATUSES,\n NOTABLE_AUTORAMP_STATUSES,\n isTerminalAutorampStatus,\n normalizeAutorampStatus,\n createAutorampAccount,\n applyAutorampRemoteStatus,\n markAutorampNotified,\n buildMusdAutorampRequest,\n buildBrazilMusdAutorampRequest,\n getMusdAutorampDepositRailReadiness,\n} from './autorampAccount.js';\nexport { buildOwnershipMessage } from './ownership-message.js';\nexport type {\n AutorampTransactionRecord,\n AutorampTransactionRecords,\n AutorampTransactionChange,\n} from './diffAutorampTransactions.js';\nexport { diffAutorampTransactions } from './diffAutorampTransactions.js';\nexport type {\n AutorampDepositInstructions,\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n AutorampTransactionSummary,\n PixDepositInstructions,\n SepaDepositInstructions,\n UsBankDepositInstructions,\n UsBankDepositRail,\n} from './autoramp-types.js';\nexport type {\n NeoBankServiceActions,\n NeoBankServiceCacheUpdatedEvent,\n NeoBankServiceEvents,\n NeoBankServiceGranularCacheUpdatedEvent,\n NeoBankServiceInvalidateQueriesAction,\n NeoBankServiceMessenger,\n NeoBankAutorampResponse,\n NeoBankMicrodeposit,\n NeoBankAbilityCurrency,\n NeoBankAbilityStatus,\n NeoBankCurrencyAbility,\n NeoBankCustomerAbilities,\n NeoBankFiatAbilities,\n NeoBankRequestOptions,\n NeoBankQueryParams,\n GetWalletRegistrationStatusParams,\n RegisterSelfHostedWalletParams,\n} from './NeoBankService.js';\nexport type {\n NeoBankServiceGetAutorampAction,\n NeoBankServiceGetAutorampsAction,\n NeoBankServiceGetPixDepositInstructionsAction,\n NeoBankServiceGetDepositInstructionsAction,\n NeoBankServiceListAutorampTransactionsAction,\n NeoBankServiceRegisterPixAddressAction,\n NeoBankServiceGetAutorampQuoteAction,\n NeoBankServiceCreateAutorampAction,\n NeoBankServiceGetAutorampQuoteForAutorampAction,\n NeoBankServiceAttachAutorampQuoteAction,\n NeoBankServiceGetCustomerByExternalIdAction,\n NeoBankServiceGetMoonpayCustomerIdAction,\n NeoBankServiceGetMicrodepositsAction,\n NeoBankServiceGetCustomerAbilitiesAction,\n NeoBankServiceGetWalletRegistrationStatusAction,\n NeoBankServiceRegisterSelfHostedWalletAction,\n} from './NeoBankService-method-action-types.js';\nexport {\n NeoBankService,\n serviceName as neoBankServiceName,\n mapNeoBankAutorampToRemoteSnapshot,\n extractPixDepositInstructions,\n extractSepaDepositInstructions,\n extractUsBankDepositInstructions,\n} from './NeoBankService.js';\nexport type {\n Blockchain,\n RegistrationOutcome,\n RegistrationStatus,\n SelfHostedRegistration,\n WalletRegistrationErrorKind,\n} from './wallet-registration-service.js';\nexport { WalletRegistrationError } from './wallet-registration-service.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAsElE,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,8BAA8B,EAC9B,oBAAoB,EACpB,yCAAyC,EACzC,4CAA4C,GAC7C,MAAM,sBAAsB,CAAC;AA2C9B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAmB9B,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EACL,sCAAsC,EACtC,qCAAqC,EACrC,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,yBA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RampsControllerEvents,\n RampsControllerGetStateAction,\n RampsControllerMessenger,\n RampsControllerState,\n RampsControllerStateChangeEvent,\n RampsControllerOrderStatusChangedEvent,\n RampsControllerAutorampStatusChangedEvent,\n AutorampTransactionStatusChangedPayload,\n RampsControllerOptions,\n PaymentMethodsForContextResponse,\n UserRegion,\n ResourceState,\n TransakState,\n NativeProvidersState,\n MoneyAccountWalletRegistration,\n MoneyAccountWalletRegistrationResult,\n KeyringControllerSignPersonalMessageAction,\n VbaAutorampStatus,\n VbaKycStatus,\n VbaOnboardingSnapshot,\n VbaProviderFlowStatus,\n SelectProviderForAssetOptions,\n} from './RampsController.js';\nexport type { RampsProviderHistoryEntry } from './providerHistory.js';\nexport { getPreviouslyUsedProviders } from './providerHistory.js';\nexport type {\n RampsControllerExecuteRequestAction,\n RampsControllerAbortRequestAction,\n RampsControllerGetRequestStateAction,\n RampsControllerSetUserRegionAction,\n RampsControllerSetSelectedProviderAction,\n RampsControllerSetSelectedProviderForAssetAction,\n RampsControllerSelectProviderForAssetAction,\n RampsControllerInitAction,\n RampsControllerGetCountriesAction,\n RampsControllerGetTokensAction,\n RampsControllerSetSelectedTokenAction,\n RampsControllerGetProvidersAction,\n RampsControllerGetPaymentMethodsAction,\n RampsControllerGetPaymentMethodsForContextAction,\n RampsControllerSetSelectedPaymentMethodAction,\n RampsControllerGetQuotesAction,\n RampsControllerGetQuoteWithFeesAction,\n RampsControllerAddOrderAction,\n RampsControllerRemoveOrderAction,\n RampsControllerAddAutorampAction,\n RampsControllerCreateAutorampAction,\n RampsControllerHydrateVbaOnboardingAction,\n RampsControllerRemoveAutorampAction,\n RampsControllerRegisterMoneyAccountWalletAction,\n RampsControllerMarkAutorampAsNotifiedAction,\n RampsControllerApplyAutorampStatusFromPushAction,\n RampsControllerRefreshAutorampAction,\n RampsControllerRefreshAutorampsAction,\n RampsControllerRefreshAutorampTransactionsAction,\n RampsControllerRefreshCustomerAbilitiesAction,\n RampsControllerStartOrderPollingAction,\n RampsControllerStopOrderPollingAction,\n RampsControllerGetBuyWidgetDataAction,\n RampsControllerGetFallbackBuyWidgetDataAction,\n RampsControllerAddPrecreatedOrderAction,\n RampsControllerGetOrderAction,\n RampsControllerGetOrderFromCallbackAction,\n RampsControllerTransakSetApiKeyAction,\n RampsControllerTransakSetAccessTokenAction,\n RampsControllerTransakClearAccessTokenAction,\n RampsControllerTransakSetAuthenticatedAction,\n RampsControllerTransakResetStateAction,\n RampsControllerTransakSendUserOtpAction,\n RampsControllerTransakVerifyUserOtpAction,\n RampsControllerTransakLogoutAction,\n RampsControllerTransakGetUserDetailsAction,\n RampsControllerTransakGetBuyQuoteAction,\n RampsControllerTransakGetKycRequirementAction,\n RampsControllerTransakGetAdditionalRequirementsAction,\n RampsControllerTransakCreateOrderAction,\n RampsControllerTransakGetOrderAction,\n RampsControllerTransakGetUserLimitsAction,\n RampsControllerTransakRequestOttAction,\n RampsControllerTransakGeneratePaymentWidgetUrlAction,\n RampsControllerTransakSubmitPurposeOfUsageFormAction,\n RampsControllerTransakPatchUserAction,\n RampsControllerTransakSubmitSsnDetailsAction,\n RampsControllerTransakConfirmPaymentAction,\n RampsControllerTransakGetTranslationAction,\n RampsControllerTransakGetIdProofStatusAction,\n RampsControllerTransakCancelOrderAction,\n RampsControllerTransakCancelAllActiveOrdersAction,\n RampsControllerTransakGetActiveOrdersAction,\n RampsControllerTransakSubmitMicaConsentAction,\n RampsControllerTransakSubmitSourceOfIncomeAction,\n RampsControllerTransakSubmitAdditionalDetailsNationalityAction,\n RampsControllerSyncOrdersWithUserStorageAction,\n} from './RampsController-method-action-types.js';\nexport {\n RampsController,\n VBA_AUTORAMP_STATUSES,\n VBA_KYC_STATUSES,\n VBA_PROVIDER_FLOW_STATUSES,\n getDefaultRampsControllerState,\n getInternalOrderCode,\n RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS,\n RAMPS_CONTROLLER_REQUIRED_CONTROLLER_ACTIONS,\n} from './RampsController.js';\nexport type {\n RampsServiceActions,\n RampsServiceEvents,\n RampsServiceMessenger,\n RampsServiceInvalidateQueriesAction,\n RampsServiceCacheUpdatedEvent,\n RampsServiceGranularCacheUpdatedEvent,\n Country,\n State,\n SupportedActions,\n CountryPhone,\n Provider,\n ProviderLink,\n ProviderLogos,\n ProviderBrowserType,\n ProviderLimit,\n ProviderFiatLimits,\n ProviderLimits,\n ProviderSortOrder,\n ProvidersResponse,\n RampAction,\n PaymentMethod,\n PaymentMethodsResponse,\n Quote,\n QuoteError,\n QuoteSortBy,\n QuoteSortOrder,\n QuoteCryptoTranslation,\n QuoteCustomAction,\n QuotesResponse,\n GetQuotesParams,\n RampsToken,\n TokensResponse,\n BuyWidget,\n BuyWidgetFallback,\n RampsOrder,\n RampsOrderNetwork,\n RampsOrderCryptoCurrency,\n RampsOrderFiatCurrency,\n RampsOrderPaymentMethod,\n OrderPaymentDetail,\n} from './RampsService.js';\nexport {\n RampsService,\n RampsEnvironment,\n RampsApiService,\n RampsOrderStatus,\n RAMPS_SDK_VERSION,\n getDefaultRedirectCallbackUrl,\n} from './RampsService.js';\nexport type { RampsClientIdentity } from './client-identity.js';\nexport {\n addRampsClientIdentityParams,\n RAMPS_CLIENT_PRODUCT_PARAM,\n RAMPS_CLIENT_VERSION_PARAM,\n} from './client-identity.js';\nexport type {\n RampsServiceGetDefaultRedirectCallbackUrlAction,\n RampsServiceGetGeolocationAction,\n RampsServiceGetCountriesAction,\n RampsServiceGetPaymentMethodsAction,\n RampsServiceGetQuotesAction,\n RampsServiceGetBuyWidgetUrlAction,\n RampsServiceGetOrderAction,\n RampsServiceGetOrderFromCallbackAction,\n} from './RampsService-method-action-types.js';\nexport type {\n RequestCache,\n RequestState,\n ExecuteRequestOptions,\n PendingRequest,\n ResourceType,\n} from './RequestCache.js';\nexport type { RampsErrorCode } from './rampsErrorCodes.js';\nexport {\n RequestStatus,\n DEFAULT_REQUEST_CACHE_TTL,\n DEFAULT_REQUEST_CACHE_MAX_SIZE,\n createCacheKey,\n isCacheExpired,\n createLoadingState,\n createSuccessState,\n createErrorState,\n} from './RequestCache.js';\nexport { RAMPS_ERROR_CODES } from './rampsErrorCodes.js';\nexport type { RequestSelectorResult } from './selectors.js';\nexport { createRequestSelector } from './selectors.js';\nexport type { HeadlessFeatureFlagsLookup } from './featureFlags.js';\nexport {\n HEADLESS_ALL_PROVIDERS_FEATURE_VERSION,\n MONEY_HEADLESS_ALL_PROVIDERS_FLAG_KEY,\n getHeadlessProviderAllowlist,\n isHeadlessAllProvidersEnabled,\n} from './featureFlags.js';\nexport {\n normalizeRampsAssetId,\n providerServesAsset,\n getProvidersServingAsset,\n regionHasProviderForAsset,\n isFiatDepositAvailable,\n} from './providerAvailability.js';\nexport {\n isExternalBrowserQuote,\n isCustomActionQuote,\n isInAppOnlyQuote,\n getBuyWidgetFallback,\n} from './quoteClassification.js';\nexport {\n TERMINAL_ORDER_STATUSES,\n isTerminalOrderStatus,\n} from './orderStatus.js';\nexport type { TypedError } from './errorNormalization.js';\nexport {\n getErrorMessage,\n extractExplicitTypedError,\n normalizeToTypedError,\n} from './errorNormalization.js';\nexport type {\n UserStorageRampsOrderEntry,\n SyncRampsOrder,\n OrderSyncingController,\n OrderSyncingOptions,\n SyncOrdersWithUserStorageConfig,\n} from './order-syncing/index.js';\nexport {\n USER_STORAGE_RAMPS_ORDERS_FEATURE,\n USER_STORAGE_VERSION,\n USER_STORAGE_VERSION_KEY,\n createOrderStorageKey,\n isSyncableOrder,\n mapRampsOrderToUserStorageEntry,\n mapUserStorageEntryToRampsOrder,\n stripPaymentDetailsForRemoteStorage,\n stripSyncMetadata,\n stripDeletedAt,\n areOrdersEqual,\n canPerformOrderSyncing,\n syncOrdersWithUserStorage,\n updateOrderInUserStorage,\n deleteOrderInUserStorage,\n} from './order-syncing/index.js';\nexport type {\n TransakServiceActions,\n TransakServiceCacheUpdatedEvent,\n TransakServiceEvents,\n TransakServiceGranularCacheUpdatedEvent,\n TransakServiceInvalidateQueriesAction,\n TransakServiceMessenger,\n TransakAccessToken,\n TransakUserDetails,\n TransakUserDetailsAddress,\n TransakUserDetailsKycDetails,\n TransakBuyQuote,\n TransakKycRequirement,\n TransakAdditionalRequirement,\n TransakAdditionalRequirementsResponse,\n TransakOttResponse,\n TransakOrderPaymentMethod,\n TransakDepositOrder,\n TransakDepositNetwork,\n TransakDepositCryptoCurrency,\n TransakDepositPaymentMethod,\n TransakDepositRegion,\n TransakOrder,\n TransakQuoteTranslation,\n TransakTranslationRequest,\n TransakUserLimits,\n TransakIdProofStatus,\n PatchUserRequestBody as TransakPatchUserRequestBody,\n SubmitMicaConsentRequest,\n SubmitMicaConsentResponse,\n SubmitSourceOfIncomeRequest,\n SubmitSourceOfIncomeResponse,\n SubmitAdditionalDetailsNationalityRequest,\n SubmitAdditionalDetailsNationalityResponse,\n} from './TransakService.js';\nexport {\n TransakApiError,\n TransakService,\n TransakEnvironment,\n TransakOrderIdTransformer,\n} from './TransakService.js';\nexport {\n getTransakApiMessage,\n isTransakPhoneRegisteredError,\n} from './transakApiErrorUtils.js';\nexport type {\n TransakServiceMethodActions,\n TransakServiceSendUserOtpAction,\n TransakServiceVerifyUserOtpAction,\n TransakServiceGetUserDetailsAction,\n TransakServiceGetBuyQuoteAction,\n TransakServiceGetKycRequirementAction,\n TransakServiceCreateOrderAction,\n TransakServiceGetOrderAction,\n TransakServiceRequestOttAction,\n TransakServiceGeneratePaymentWidgetUrlAction,\n TransakServiceCreateWidgetUrlAction,\n} from './TransakService-method-action-types.js';\nexport type {\n AutorampAccount,\n ApplyAutorampRemoteStatusResult,\n CreateAutorampRequest,\n MusdAutorampDepositRailReadiness,\n} from './autorampAccount.js';\nexport {\n AutorampStatus,\n TERMINAL_AUTORAMP_STATUSES,\n NOTABLE_AUTORAMP_STATUSES,\n isTerminalAutorampStatus,\n normalizeAutorampStatus,\n createAutorampAccount,\n applyAutorampRemoteStatus,\n markAutorampNotified,\n buildMusdAutorampRequest,\n buildBrazilMusdAutorampRequest,\n getMusdAutorampDepositRailReadiness,\n isTokenUnavailableInJurisdictionError,\n} from './autorampAccount.js';\nexport { buildOwnershipMessage } from './ownership-message.js';\nexport type {\n AutorampTransactionRecord,\n AutorampTransactionRecords,\n AutorampTransactionChange,\n} from './diffAutorampTransactions.js';\nexport { diffAutorampTransactions } from './diffAutorampTransactions.js';\nexport type {\n AutorampDepositInstructions,\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n AutorampTransactionSummary,\n PixDepositInstructions,\n SepaDepositInstructions,\n UsBankDepositInstructions,\n UsBankDepositRail,\n} from './autoramp-types.js';\nexport type {\n NeoBankServiceActions,\n NeoBankServiceCacheUpdatedEvent,\n NeoBankServiceEvents,\n NeoBankServiceGranularCacheUpdatedEvent,\n NeoBankServiceInvalidateQueriesAction,\n NeoBankServiceMessenger,\n NeoBankAutorampResponse,\n NeoBankMicrodeposit,\n NeoBankAbilityCurrency,\n NeoBankAbilityStatus,\n NeoBankCurrencyAbility,\n NeoBankCustomerAbilities,\n NeoBankFiatAbilities,\n NeoBankRequestOptions,\n NeoBankQueryParams,\n GetWalletRegistrationStatusParams,\n RegisterSelfHostedWalletParams,\n} from './NeoBankService.js';\nexport type {\n NeoBankServiceGetAutorampAction,\n NeoBankServiceGetAutorampsAction,\n NeoBankServiceGetPixDepositInstructionsAction,\n NeoBankServiceGetDepositInstructionsAction,\n NeoBankServiceListAutorampTransactionsAction,\n NeoBankServiceRegisterPixAddressAction,\n NeoBankServiceGetAutorampQuoteAction,\n NeoBankServiceCreateAutorampAction,\n NeoBankServiceGetAutorampQuoteForAutorampAction,\n NeoBankServiceAttachAutorampQuoteAction,\n NeoBankServiceGetCustomerByExternalIdAction,\n NeoBankServiceGetMoonpayCustomerIdAction,\n NeoBankServiceGetMicrodepositsAction,\n NeoBankServiceGetCustomerAbilitiesAction,\n NeoBankServiceGetWalletRegistrationStatusAction,\n NeoBankServiceRegisterSelfHostedWalletAction,\n} from './NeoBankService-method-action-types.js';\nexport {\n NeoBankService,\n serviceName as neoBankServiceName,\n mapNeoBankAutorampToRemoteSnapshot,\n extractPixDepositInstructions,\n extractSepaDepositInstructions,\n extractUsBankDepositInstructions,\n} from './NeoBankService.js';\nexport type {\n Blockchain,\n RegistrationOutcome,\n RegistrationStatus,\n SelfHostedRegistration,\n WalletRegistrationErrorKind,\n} from './wallet-registration-service.js';\nexport { WalletRegistrationError } from './wallet-registration-service.js';\n"]}
|
package/package.json
CHANGED