@metamask/ramps-controller 23.0.0 → 25.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 CHANGED
@@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [25.0.0]
11
+
12
+ ### Changed
13
+
14
+ - **BREAKING:** `RampsController:hydrateVbaOnboarding` now returns a `VbaOnboardingSnapshot` of KYC and autoramp facts instead of a linear `VbaOnboardingStage`. The persisted `vbaOnboardingStage` state field and `VbaOnboardingStage` enum are removed — hosts own funnel order and map the snapshot onto screens. ([#10354](https://github.com/MetaMask/core/pull/10354))
15
+ - `sessionExists`, disclaimer completion flags, `kycStatus`, and `autorampStatus` (`not_ready` / `in_progress` / `ready` / `retryable_failure`) are independent facts. `kycStatus` is the overall KYC session outcome; relay and vendor-specific statuses remain internal to `KycController`.
16
+ - After KYC approval, wallet registration and autoramp creation still run (coalesced). Setup failure sets `autorampStatus: 'retryable_failure'` rather than a fatal error.
17
+ - A persisted KYC session owned by a previous identity is discarded via `KycController:clearState` and returned as an empty snapshot (`sessionExists: false`).
18
+ - **BREAKING:** `RampsControllerMessenger` now also requires the `KycController:clearState` action, used to discard a foreign VBA onboarding session during hydration. ([#10354](https://github.com/MetaMask/core/pull/10354))
19
+ - The action type is declared structurally in the ramps package, so no dependency on `@metamask/kyc-controller` is added.
20
+ - Bump `@metamask/profile-sync-controller` from `^32.1.1` to `^32.2.0` ([#10348](https://github.com/MetaMask/core/pull/10348))
21
+
22
+ ## [24.0.0]
23
+
24
+ ### Added
25
+
26
+ - Add `NeoBankService:getAutoramps` to load all autoramp accounts for the authenticated customer from `GET /neobank/autoramps` ([#10278](https://github.com/MetaMask/core/pull/10278))
27
+ - Add `RampsController:hydrateVbaOnboarding`, the persisted `vbaOnboardingStage` state, and the `VbaOnboardingStage` enum for Mobile routing ([#10278](https://github.com/MetaMask/core/pull/10278))
28
+ - Resolve the current onboarding stage (email OTP, vendor terms, provider terms, SumSub, pending KYC, rejected KYC, or completed) from the customer's KYC session status.
29
+ - After KYC acceptance, register the Money Account wallet, load the customer's authoritative autoramps, and create one only when needed; keep the user on the pending stage if account activation is momentarily unavailable.
30
+ - Coalesce overlapping hydration calls to prevent duplicate wallet signatures or autoramp creation during polling.
31
+
32
+ ### Changed
33
+
34
+ - **BREAKING:** `RampsControllerMessenger` now requires the `KycController:getSessionStatusForVendor`, `KycController:refreshSessionStatus`, `KycController:hasCompletedVendorDisclaimers`, and `KycController:hasCompletedSessionDisclaimers` actions to hydrate VBA onboarding ([#10278](https://github.com/MetaMask/core/pull/10278))
35
+ - The action types are declared structurally in the ramps package, so no dependency on `@metamask/kyc-controller` is added.
36
+ - Stop sending `crypto` on `RampsService.getPaymentMethods`. Payment methods are provider + region; the param was ignored by `/v2/regions/:region/payments` and split the CDN cache per token. `assetId` remains on the method for caller cache keys. ([#10307](https://github.com/MetaMask/core/pull/10307))
37
+
10
38
  ## [23.0.0]
11
39
 
12
40
  ### Added
@@ -39,7 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
39
67
 
40
68
  ### Changed
41
69
 
42
- - **BREAKING:** `RampsControllerMessenger` now requires these actions to be delegated for order syncing ([#9474](https://github.com/MetaMask/core/pull/9474)):
70
+ - **BREAKING:** `RampsControllerMessenger` now requires these actions to be delegated for order syncing: ([#9474](https://github.com/MetaMask/core/pull/9474))
43
71
  - `UserStorageController:getState`
44
72
  - `UserStorageController:performGetStorageAllFeatureEntries`
45
73
  - `UserStorageController:performBatchSetStorage`
@@ -612,7 +640,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
612
640
  - Add `OnRampService` for interacting with the OnRamp API
613
641
  - Add geolocation detection via IP address lookup
614
642
 
615
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@23.0.0...HEAD
643
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@25.0.0...HEAD
644
+ [25.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@24.0.0...@metamask/ramps-controller@25.0.0
645
+ [24.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@23.0.0...@metamask/ramps-controller@24.0.0
616
646
  [23.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@22.0.0...@metamask/ramps-controller@23.0.0
617
647
  [22.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@21.0.0...@metamask/ramps-controller@22.0.0
618
648
  [21.0.0]: https://github.com/MetaMask/core/compare/@metamask/ramps-controller@20.3.0...@metamask/ramps-controller@21.0.0
@@ -15,6 +15,15 @@ export type NeoBankServiceGetAutorampAction = {
15
15
  type: `NeoBankService:getAutoramp`;
16
16
  handler: NeoBankService['getAutoramp'];
17
17
  };
18
+ /**
19
+ * Fetches all autoramp accounts belonging to the authenticated customer.
20
+ *
21
+ * @returns Remote snapshots for all customer autoramps.
22
+ */
23
+ export type NeoBankServiceGetAutorampsAction = {
24
+ type: `NeoBankService:getAutoramps`;
25
+ handler: NeoBankService['getAutoramps'];
26
+ };
18
27
  /**
19
28
  * Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.
20
29
  * Body is forwarded as opaque JSON (MoonPay address schema).
@@ -122,5 +131,5 @@ export type NeoBankServiceRegisterSelfHostedWalletAction = {
122
131
  /**
123
132
  * Union of all NeoBankService action types.
124
133
  */
125
- export type NeoBankServiceMethodActions = NeoBankServiceGetAutorampAction | NeoBankServiceRegisterPixAddressAction | NeoBankServiceGetAutorampQuoteAction | NeoBankServiceCreateAutorampAction | NeoBankServiceGetAutorampQuoteForAutorampAction | NeoBankServiceAttachAutorampQuoteAction | NeoBankServiceGetCustomerByExternalIdAction | NeoBankServiceGetMoonpayCustomerIdAction | NeoBankServiceGetWalletRegistrationStatusAction | NeoBankServiceRegisterSelfHostedWalletAction;
134
+ export type NeoBankServiceMethodActions = NeoBankServiceGetAutorampAction | NeoBankServiceGetAutorampsAction | NeoBankServiceRegisterPixAddressAction | NeoBankServiceGetAutorampQuoteAction | NeoBankServiceCreateAutorampAction | NeoBankServiceGetAutorampQuoteForAutorampAction | NeoBankServiceAttachAutorampQuoteAction | NeoBankServiceGetCustomerByExternalIdAction | NeoBankServiceGetMoonpayCustomerIdAction | NeoBankServiceGetWalletRegistrationStatusAction | NeoBankServiceRegisterSelfHostedWalletAction;
126
135
  //# sourceMappingURL=NeoBankService-method-action-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeoBankService-method-action-types.d.ts","sourceRoot":"","sources":["../src/NeoBankService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,cAAc,CAAC,6BAA6B,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,OAAO,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,cAAc,CAAC,yBAAyB,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,cAAc,CAAC,sBAAsB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,cAAc,CAAC,6BAA6B,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,cAAc,CAAC,0BAA0B,CAAC,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2BAA2B,GACnC,+BAA+B,GAC/B,sCAAsC,GACtC,oCAAoC,GACpC,kCAAkC,GAClC,+CAA+C,GAC/C,uCAAuC,GACvC,2CAA2C,GAC3C,wCAAwC,GACxC,+CAA+C,GAC/C,4CAA4C,CAAC"}
1
+ {"version":3,"file":"NeoBankService-method-action-types.d.ts","sourceRoot":"","sources":["../src/NeoBankService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;CACxC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IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,cAAc,CAAC,6BAA6B,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,cAAc,CAAC,0BAA0B,CAAC,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2BAA2B,GACnC,+BAA+B,GAC/B,gCAAgC,GAChC,sCAAsC,GACtC,oCAAoC,GACpC,kCAAkC,GAClC,+CAA+C,GAC/C,uCAAuC,GACvC,2CAA2C,GAC3C,wCAAwC,GACxC,+CAA+C,GAC/C,4CAA4C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NeoBankService-method-action-types.js","sourceRoot":"","sources":["../src/NeoBankService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NeoBankService } from './NeoBankService.js';\n\n/**\n * Fetches an autoramp account via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}` (MoonPay\n * `GET /api/autoramps/{autoramp_id}`).\n *\n * @param autorampId - MoonPay / Ramp API autoramp id.\n * @returns Remote snapshot for controller apply/refresh.\n */\nexport type NeoBankServiceGetAutorampAction = {\n type: `NeoBankService:getAutoramp`;\n handler: NeoBankService['getAutoramp'];\n};\n\n/**\n * Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.\n * Body is forwarded as opaque JSON (MoonPay address schema).\n *\n * @param body - Pix address registration payload.\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceRegisterPixAddressAction = {\n type: `NeoBankService:registerPixAddress`;\n handler: NeoBankService['registerPixAddress'];\n};\n\n/**\n * Fetches an autoramp quote via neobank-proxy `GET /neobank/autoramps/quote`.\n *\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceGetAutorampQuoteAction = {\n type: `NeoBankService:getAutorampQuote`;\n handler: NeoBankService['getAutorampQuote'];\n};\n\n/**\n * Creates an autoramp from a signed quote via neobank-proxy\n * `POST /neobank/autoramps` (MoonPay `POST /api/autoramps`).\n *\n * @param body - CreateAutoramp / signed-quote payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Remote snapshot for controller apply/refresh.\n */\nexport type NeoBankServiceCreateAutorampAction = {\n type: `NeoBankService:createAutoramp`;\n handler: NeoBankService['createAutoramp'];\n};\n\n/**\n * Fetches a quote for an existing autoramp via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}/quote`.\n *\n * @param autorampId - Autoramp id.\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceGetAutorampQuoteForAutorampAction = {\n type: `NeoBankService:getAutorampQuoteForAutoramp`;\n handler: NeoBankService['getAutorampQuoteForAutoramp'];\n};\n\n/**\n * Attaches a signed quote to an autoramp via neobank-proxy\n * `POST /neobank/autoramps/{autoramp_id}/quotes`.\n *\n * @param autorampId - Autoramp id.\n * @param body - Quote attachment payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceAttachAutorampQuoteAction = {\n type: `NeoBankService:attachAutorampQuote`;\n handler: NeoBankService['attachAutorampQuote'];\n};\n\n/**\n * Fetches a customer by partner external id via neobank-proxy\n * `GET /neobank/customers/{external_id}/external`.\n *\n * @param externalId - Partner-assigned external customer id.\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceGetCustomerByExternalIdAction = {\n type: `NeoBankService:getCustomerByExternalId`;\n handler: NeoBankService['getCustomerByExternalId'];\n};\n\n/**\n * Resolves Iron's internal customer id via neobank-proxy customer lookup,\n * using the MetaMask canonical profile id as the partner `external_id`.\n *\n * @returns Iron's internal customer id.\n */\nexport type NeoBankServiceGetMoonpayCustomerIdAction = {\n type: `NeoBankService:getMoonpayCustomerId`;\n handler: NeoBankService['getMoonpayCustomerId'];\n};\n\n/**\n * Checks whether a Monad Money Account address is already registered for the\n * given Iron customer.\n *\n * @param params - Customer id and address to check.\n * @param params.customerId - Iron / MoonPay customer UUID.\n * @param params.address - Money Account address.\n * @returns Active, disabled, or absent registration status.\n */\nexport type NeoBankServiceGetWalletRegistrationStatusAction = {\n type: `NeoBankService:getWalletRegistrationStatus`;\n handler: NeoBankService['getWalletRegistrationStatus'];\n};\n\n/**\n * Submits a signed Monad Money Account ownership proof via neobank-proxy\n * `POST /neobank/addresses/crypto/selfhosted`.\n *\n * @param params - Signed ownership proof.\n * @returns Registered wallet record.\n */\nexport type NeoBankServiceRegisterSelfHostedWalletAction = {\n type: `NeoBankService:registerSelfHostedWallet`;\n handler: NeoBankService['registerSelfHostedWallet'];\n};\n\n/**\n * Union of all NeoBankService action types.\n */\nexport type NeoBankServiceMethodActions =\n | NeoBankServiceGetAutorampAction\n | NeoBankServiceRegisterPixAddressAction\n | NeoBankServiceGetAutorampQuoteAction\n | NeoBankServiceCreateAutorampAction\n | NeoBankServiceGetAutorampQuoteForAutorampAction\n | NeoBankServiceAttachAutorampQuoteAction\n | NeoBankServiceGetCustomerByExternalIdAction\n | NeoBankServiceGetMoonpayCustomerIdAction\n | NeoBankServiceGetWalletRegistrationStatusAction\n | NeoBankServiceRegisterSelfHostedWalletAction;\n"]}
1
+ {"version":3,"file":"NeoBankService-method-action-types.js","sourceRoot":"","sources":["../src/NeoBankService-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NeoBankService } from './NeoBankService.js';\n\n/**\n * Fetches an autoramp account via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}` (MoonPay\n * `GET /api/autoramps/{autoramp_id}`).\n *\n * @param autorampId - MoonPay / Ramp API autoramp id.\n * @returns Remote snapshot for controller apply/refresh.\n */\nexport type NeoBankServiceGetAutorampAction = {\n type: `NeoBankService:getAutoramp`;\n handler: NeoBankService['getAutoramp'];\n};\n\n/**\n * Fetches all autoramp accounts belonging to the authenticated customer.\n *\n * @returns Remote snapshots for all customer autoramps.\n */\nexport type NeoBankServiceGetAutorampsAction = {\n type: `NeoBankService:getAutoramps`;\n handler: NeoBankService['getAutoramps'];\n};\n\n/**\n * Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.\n * Body is forwarded as opaque JSON (MoonPay address schema).\n *\n * @param body - Pix address registration payload.\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceRegisterPixAddressAction = {\n type: `NeoBankService:registerPixAddress`;\n handler: NeoBankService['registerPixAddress'];\n};\n\n/**\n * Fetches an autoramp quote via neobank-proxy `GET /neobank/autoramps/quote`.\n *\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceGetAutorampQuoteAction = {\n type: `NeoBankService:getAutorampQuote`;\n handler: NeoBankService['getAutorampQuote'];\n};\n\n/**\n * Creates an autoramp from a signed quote via neobank-proxy\n * `POST /neobank/autoramps` (MoonPay `POST /api/autoramps`).\n *\n * @param body - CreateAutoramp / signed-quote payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Remote snapshot for controller apply/refresh.\n */\nexport type NeoBankServiceCreateAutorampAction = {\n type: `NeoBankService:createAutoramp`;\n handler: NeoBankService['createAutoramp'];\n};\n\n/**\n * Fetches a quote for an existing autoramp via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}/quote`.\n *\n * @param autorampId - Autoramp id.\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceGetAutorampQuoteForAutorampAction = {\n type: `NeoBankService:getAutorampQuoteForAutoramp`;\n handler: NeoBankService['getAutorampQuoteForAutoramp'];\n};\n\n/**\n * Attaches a signed quote to an autoramp via neobank-proxy\n * `POST /neobank/autoramps/{autoramp_id}/quotes`.\n *\n * @param autorampId - Autoramp id.\n * @param body - Quote attachment payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceAttachAutorampQuoteAction = {\n type: `NeoBankService:attachAutorampQuote`;\n handler: NeoBankService['attachAutorampQuote'];\n};\n\n/**\n * Fetches a customer by partner external id via neobank-proxy\n * `GET /neobank/customers/{external_id}/external`.\n *\n * @param externalId - Partner-assigned external customer id.\n * @returns Parsed proxy JSON response.\n */\nexport type NeoBankServiceGetCustomerByExternalIdAction = {\n type: `NeoBankService:getCustomerByExternalId`;\n handler: NeoBankService['getCustomerByExternalId'];\n};\n\n/**\n * Resolves Iron's internal customer id via neobank-proxy customer lookup,\n * using the MetaMask canonical profile id as the partner `external_id`.\n *\n * @returns Iron's internal customer id.\n */\nexport type NeoBankServiceGetMoonpayCustomerIdAction = {\n type: `NeoBankService:getMoonpayCustomerId`;\n handler: NeoBankService['getMoonpayCustomerId'];\n};\n\n/**\n * Checks whether a Monad Money Account address is already registered for the\n * given Iron customer.\n *\n * @param params - Customer id and address to check.\n * @param params.customerId - Iron / MoonPay customer UUID.\n * @param params.address - Money Account address.\n * @returns Active, disabled, or absent registration status.\n */\nexport type NeoBankServiceGetWalletRegistrationStatusAction = {\n type: `NeoBankService:getWalletRegistrationStatus`;\n handler: NeoBankService['getWalletRegistrationStatus'];\n};\n\n/**\n * Submits a signed Monad Money Account ownership proof via neobank-proxy\n * `POST /neobank/addresses/crypto/selfhosted`.\n *\n * @param params - Signed ownership proof.\n * @returns Registered wallet record.\n */\nexport type NeoBankServiceRegisterSelfHostedWalletAction = {\n type: `NeoBankService:registerSelfHostedWallet`;\n handler: NeoBankService['registerSelfHostedWallet'];\n};\n\n/**\n * Union of all NeoBankService action types.\n */\nexport type NeoBankServiceMethodActions =\n | NeoBankServiceGetAutorampAction\n | NeoBankServiceGetAutorampsAction\n | NeoBankServiceRegisterPixAddressAction\n | NeoBankServiceGetAutorampQuoteAction\n | NeoBankServiceCreateAutorampAction\n | NeoBankServiceGetAutorampQuoteForAutorampAction\n | NeoBankServiceAttachAutorampQuoteAction\n | NeoBankServiceGetCustomerByExternalIdAction\n | NeoBankServiceGetMoonpayCustomerIdAction\n | NeoBankServiceGetWalletRegistrationStatusAction\n | NeoBankServiceRegisterSelfHostedWalletAction;\n"]}
@@ -106,6 +106,12 @@ export declare class NeoBankService {
106
106
  * @returns Remote snapshot for controller apply/refresh.
107
107
  */
108
108
  getAutoramp(autorampId: string): Promise<AutorampRemoteSnapshot>;
109
+ /**
110
+ * Fetches all autoramp accounts belonging to the authenticated customer.
111
+ *
112
+ * @returns Remote snapshots for all customer autoramps.
113
+ */
114
+ getAutoramps(): Promise<AutorampRemoteSnapshot[]>;
109
115
  /**
110
116
  * Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.
111
117
  * Body is forwarded as opaque JSON (MoonPay address schema).
@@ -1 +1 @@
1
- {"version":3,"file":"NeoBankService.d.ts","sourceRoot":"","sources":["../src/NeoBankService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,aAAa,EACd,MAAM,4BAA4B,CAAC;AAMpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAGlF,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAqB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAuB5C;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IAEX,WAAW,CAAC,EAAE,MAAM,CAAC;IACr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,CAC/B,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,kBAAuB,GAC7B,OAAO,CAAC,OAAO,CAAC,CAKlB;IAED;;;;;;;;OAQG;IACG,mBAAmB,CACvB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,OAAO,CAAC,CAMlB;IAED;;;;;;OAMG;IACG,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAIlE;IAED;;;;;OAKG;IACG,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAE5C;IAED;;;;;;;;OAQG;IACG,2BAA2B,CAAC,EAChC,UAAU,EACV,OAAO,GACR,EAAE,iCAAiC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAMjE;IAED;;;;;;OAMG;IACG,wBAAwB,CAC5B,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,mBAAmB,CAAC,CAK9B;IAyBD,OAAO,CACL,QAAQ,EAAE,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAChD,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAEtC;IAED,OAAO,CACL,QAAQ,EAAE,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAChD,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAEtC;IAED,UAAU,CACR,QAAQ,EAAE,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GACnD,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAEzC;CACF"}
@@ -28,6 +28,7 @@ function isRetryableError(error) {
28
28
  }
29
29
  const MESSENGER_EXPOSED_METHODS = [
30
30
  'getAutoramp',
31
+ 'getAutoramps',
31
32
  'registerPixAddress',
32
33
  'getAutorampQuote',
33
34
  'createAutoramp',
@@ -247,6 +248,18 @@ export class NeoBankService {
247
248
  const response = await this.#getJson(`autoramps/${encodeURIComponent(autorampId)}`);
248
249
  return this.#mapAutorampResponse(response);
249
250
  }
251
+ /**
252
+ * Fetches all autoramp accounts belonging to the authenticated customer.
253
+ *
254
+ * @returns Remote snapshots for all customer autoramps.
255
+ */
256
+ async getAutoramps() {
257
+ const response = await this.#getJson('autoramps');
258
+ if (!Array.isArray(response)) {
259
+ throw new Error('Malformed response received from neo-bank autoramps API');
260
+ }
261
+ return response.map((autoramp) => this.#mapAutorampResponse(autoramp));
262
+ }
250
263
  /**
251
264
  * Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.
252
265
  * Body is forwarded as opaque JSON (MoonPay address schema).
@@ -1 +1 @@
1
- {"version":3,"file":"NeoBankService.js","sourceRoot":"","sources":["../src/NeoBankService.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,SAAS,GACV,MAAM,4BAA4B,CAAC;AAIpC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAM1C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAM7E;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,SAAS,gBAAgB,CAAC,KAAc;IACtC,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC,UAAU,GAAG,GAAG,IAAI,KAAK,CAAC,UAAU,IAAI,GAAG,CAAC;IAC3D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AA+DD,MAAM,yBAAyB,GAAG;IAChC,aAAa;IACb,oBAAoB;IACpB,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D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CACL,QAAiD;QAEjD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,UAAU,CACR,QAAoD;QAEpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["import type {\n CreateServicePolicyOptions,\n ServicePolicy,\n} from '@metamask/controller-utils';\nimport {\n createServicePolicy,\n handleWhen,\n HttpError,\n} from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\nimport type { AuthenticationController } from '@metamask/profile-sync-controller';\n\nimport packageJson from '../package.json';\nimport type {\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n} from './autoramp-types.js';\nimport type { NeoBankServiceMethodActions } from './NeoBankService-method-action-types.js';\nimport { RAMPS_SDK_VERSION, RampsEnvironment } from './RampsService.js';\nimport { WalletRegistrationService } from './wallet-registration-service.js';\nimport type {\n RegistrationOutcome,\n RegistrationStatus,\n} from './wallet-registration-service.js';\n\n/**\n * Name of the NeoBankService messenger namespace.\n */\nexport const serviceName = 'NeoBankService';\n\n/**\n * Determines whether a failed neo-bank request is worth re-issuing.\n *\n * 4xx responses describe the request or the account's state (e.g. 403\n * \"Customer is not active\", 422 validation), so repeating them only multiplies\n * the same rejection. 429 stays retryable alongside 5xx and non-HTTP\n * network/timeout errors.\n *\n * @param error - Error thrown while performing the request.\n * @returns `true` when the error is worth retrying.\n */\nfunction isRetryableError(error: unknown): boolean {\n if (error instanceof HttpError) {\n if (error.httpStatus === 429) {\n return true;\n }\n return error.httpStatus < 400 || error.httpStatus >= 500;\n }\n return true;\n}\n\n/**\n * Raw autoramp payload from the MetaMask Ramp API neo-bank proxy.\n * Shape mirrors MoonPay Enterprise `GET /api/autoramps/{autoramp_id}`.\n * The Ramp API handles partner auth / headers; the client only sends the\n * MetaMask bearer token.\n */\nexport type NeoBankAutorampResponse = {\n id: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n customer_id?: string;\n status: string;\n /**\n * Destination wallet when present on the proxy response.\n * Field name may evolve with the Ramp API contract.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n wallet_address?: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n recipient_account?: {\n address?: string;\n };\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n deposit_rails?: unknown[];\n};\n\n/**\n * Optional headers for neo-bank mutating requests.\n */\nexport type NeoBankRequestOptions = {\n /**\n * Forwarded as `Idempotency-Key` when set (MoonPay requires it on some POSTs;\n * neobank-proxy generates one when omitted).\n */\n idempotencyKey?: string;\n};\n\n/**\n * Query string values accepted by neo-bank GET helpers.\n */\nexport type NeoBankQueryParams = Record<\n string,\n string | number | boolean | undefined | null\n>;\n\nexport type GetWalletRegistrationStatusParams = {\n customerId: string;\n address: string;\n};\n\nexport type RegisterSelfHostedWalletParams = {\n customerId: string;\n address: string;\n message: string;\n signature: string;\n /**\n * Forwarded as `Idempotency-Key` on the neobank-proxy POST. Prefer a stable\n * key across retries of the same ownership body.\n */\n idempotencyKey?: string;\n};\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getAutoramp',\n 'registerPixAddress',\n 'getAutorampQuote',\n 'createAutoramp',\n 'getAutorampQuoteForAutoramp',\n 'attachAutorampQuote',\n 'getCustomerByExternalId',\n 'getMoonpayCustomerId',\n 'getWalletRegistrationStatus',\n 'registerSelfHostedWallet',\n] as const;\n\n/**\n * Actions that {@link NeoBankService} exposes to other consumers.\n */\nexport type NeoBankServiceActions = NeoBankServiceMethodActions;\n\ntype AllowedActions =\n | AuthenticationController.AuthenticationControllerGetBearerTokenAction\n | AuthenticationController.AuthenticationControllerGetSessionProfileAction;\n\nexport type NeoBankServiceEvents = never;\n\ntype AllowedEvents = never;\n\n/**\n * The messenger restricted to actions and events accessed by\n * {@link NeoBankService}.\n */\nexport type NeoBankServiceMessenger = Messenger<\n typeof serviceName,\n NeoBankServiceActions | AllowedActions,\n NeoBankServiceEvents | AllowedEvents\n>;\n\n/**\n * Builds a path under the neobank-proxy global prefix.\n *\n * Live neobank-proxy (#1124) mounts routes at `/neobank` on the on-ramp.api\n * host (ALB path routing, no rewrite). Prefer this over `/api/v2/...` so Core\n * matches the proxy that ships.\n *\n * @param path - Path under `/neobank` (no leading slash).\n * @returns Absolute path segment for URL join against the Ramp API host.\n */\nfunction getNeoBankPath(path: string): string {\n return `neobank/${path.replace(/^\\//u, '')}`;\n}\n\n/**\n * Resolves the Ramp API host for neo-bank calls (same hosts as {@link RampsService}).\n *\n * @param environment - Ramp environment.\n * @returns Base URL.\n */\nfunction getBaseUrl(environment: RampsEnvironment): string {\n switch (environment) {\n case RampsEnvironment.Production:\n return 'https://on-ramp.api.cx.metamask.io';\n case RampsEnvironment.Staging:\n return 'https://on-ramp.uat-api.cx.metamask.io';\n case RampsEnvironment.Development:\n return 'https://on-ramp.dev-api.cx.metamask.io';\n case RampsEnvironment.Local:\n return 'http://localhost:3000';\n default:\n throw new Error(`Invalid environment: ${String(environment)}`);\n }\n}\n\n/**\n * Maps a Ramp API / MoonPay-shaped autoramp response into the local remote snapshot.\n *\n * @param response - Proxy response body.\n * @returns Snapshot for the controller last-seen cursor.\n */\nexport function mapNeoBankAutorampToRemoteSnapshot(\n response: NeoBankAutorampResponse,\n): AutorampRemoteSnapshot {\n const depositRails = response.deposit_rails;\n const hasDepositRails =\n Array.isArray(depositRails) && depositRails.length > 0;\n const depositRailsSummary: AutorampDepositRailsSummary | undefined =\n hasDepositRails || response.status === 'Approved'\n ? {\n ready: response.status === 'Approved' && hasDepositRails,\n }\n : undefined;\n\n return {\n id: response.id,\n customerId: response.customer_id,\n walletAddress:\n response.wallet_address !== undefined &&\n response.wallet_address.length > 0\n ? response.wallet_address\n : response.recipient_account?.address,\n status: response.status,\n depositRailsSummary,\n };\n}\n\n/**\n * Client for MetaMask Ramp API neo-bank endpoints (MoonPay Enterprise proxy).\n *\n * Lives alongside {@link RampsService} and {@link TransakService}. Authentication\n * and MoonPay partner headers are handled by the Ramp API; this service only\n * attaches the MetaMask user bearer token.\n *\n * Paths use the neobank-proxy `/neobank` prefix on the on-ramp.api host.\n */\nexport class NeoBankService {\n readonly name: typeof serviceName;\n\n readonly #messenger: NeoBankServiceMessenger;\n\n readonly #fetch: typeof fetch;\n\n readonly #policy: ServicePolicy;\n\n readonly #noRetryPolicy: ServicePolicy;\n\n readonly #environment: RampsEnvironment;\n\n readonly #context: string;\n\n readonly #baseUrlOverride?: string;\n\n #walletRegistrationService: WalletRegistrationService | undefined;\n\n constructor({\n messenger,\n environment = RampsEnvironment.Staging,\n context,\n fetch: fetchFunction,\n policyOptions = {},\n baseUrlOverride,\n }: {\n messenger: NeoBankServiceMessenger;\n environment?: RampsEnvironment;\n context: string;\n fetch: typeof fetch;\n policyOptions?: CreateServicePolicyOptions;\n baseUrlOverride?: string;\n }) {\n this.name = serviceName;\n this.#messenger = messenger;\n this.#fetch = fetchFunction;\n this.#policy = createServicePolicy({\n retryFilterPolicy: handleWhen(isRetryableError),\n ...policyOptions,\n });\n this.#noRetryPolicy = createServicePolicy({\n retryFilterPolicy: handleWhen(isRetryableError),\n ...policyOptions,\n maxRetries: 0,\n });\n this.#environment = environment;\n this.#context = context;\n this.#baseUrlOverride = baseUrlOverride;\n\n this.#messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n #getBaseUrl(): string {\n if (this.#baseUrlOverride) {\n return this.#baseUrlOverride;\n }\n return getBaseUrl(this.#environment);\n }\n\n /**\n * Lazily builds the wallet registration client. Deferred so constructing the\n * service never resolves the base URL eagerly (an invalid environment only\n * throws when a request is made, matching the other neo-bank methods).\n *\n * @returns The wallet registration client.\n */\n #getWalletRegistrationService(): WalletRegistrationService {\n this.#walletRegistrationService ??= new WalletRegistrationService({\n fetch: this.#fetch,\n baseUrl: this.#getBaseUrl(),\n getAuthToken: async (): Promise<string> =>\n this.#messenger.call('AuthenticationController:getBearerToken'),\n getExternalId: async (): Promise<string> =>\n this.#getCanonicalExternalId(),\n });\n return this.#walletRegistrationService;\n }\n\n async #getRequestHeaders(\n options: NeoBankRequestOptions = {},\n ): Promise<Record<string, string>> {\n const bearerToken = await this.#messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n const headers: Record<string, string> = {\n Authorization: `Bearer ${bearerToken}`,\n };\n if (options.idempotencyKey) {\n headers['Idempotency-Key'] = options.idempotencyKey;\n }\n return headers;\n }\n\n #buildUrl(path: string, query?: NeoBankQueryParams): URL {\n const url = new URL(getNeoBankPath(path), this.#getBaseUrl());\n url.searchParams.set('sdk', RAMPS_SDK_VERSION);\n url.searchParams.set('controller', packageJson.version);\n url.searchParams.set('context', this.#context);\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined && value !== null) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n return url;\n }\n\n /**\n * Throws an {@link HttpError} that carries the upstream response body.\n *\n * The neobank-proxy mirrors MoonPay's status *and* body verbatim, so the\n * body is usually the only place that explains a 4xx (e.g. which field or\n * permission was rejected). Dropping it makes failures undiagnosable.\n *\n * @param url - Request URL, for context in the message.\n * @param response - Non-OK fetch response.\n */\n async #throwHttpError(url: URL, response: Response): Promise<never> {\n let detail = '';\n try {\n const body = (await response.text()).trim();\n if (body) {\n detail = ` - ${body.slice(0, 500)}`;\n }\n } catch {\n // Body already consumed or unreadable; the status alone still helps.\n }\n throw new HttpError(\n response.status,\n `Fetching '${url.toString()}' failed with status '${response.status}'${detail}`,\n );\n }\n\n async #getJson<ResponseBody>(\n path: string,\n query?: NeoBankQueryParams,\n ): Promise<ResponseBody> {\n const url = this.#buildUrl(path, query);\n return this.#policy.execute(async () => {\n const headers = await this.#getRequestHeaders();\n const fetchResponse = await this.#fetch(url, { headers });\n if (!fetchResponse.ok) {\n await this.#throwHttpError(url, fetchResponse);\n }\n return fetchResponse.json() as Promise<ResponseBody>;\n });\n }\n\n async #postJson<ResponseBody>(\n path: string,\n body: Record<string, unknown>,\n options: NeoBankRequestOptions,\n ): Promise<ResponseBody> {\n const url = this.#buildUrl(path);\n return this.#noRetryPolicy.execute(async () => {\n const headers = await this.#getRequestHeaders(options);\n headers['Content-Type'] = 'application/json';\n const fetchResponse = await this.#fetch(url, {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n });\n if (!fetchResponse.ok) {\n await this.#throwHttpError(url, fetchResponse);\n }\n return fetchResponse.json() as Promise<ResponseBody>;\n });\n }\n\n #mapAutorampResponse(\n response: NeoBankAutorampResponse,\n ): AutorampRemoteSnapshot {\n if (!response || typeof response !== 'object' || !response.id) {\n throw new Error('Malformed response received from neo-bank autoramp API');\n }\n return mapNeoBankAutorampToRemoteSnapshot(response);\n }\n\n /**\n * Fetches an autoramp account via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}` (MoonPay\n * `GET /api/autoramps/{autoramp_id}`).\n *\n * @param autorampId - MoonPay / Ramp API autoramp id.\n * @returns Remote snapshot for controller apply/refresh.\n */\n async getAutoramp(autorampId: string): Promise<AutorampRemoteSnapshot> {\n const response = await this.#getJson<NeoBankAutorampResponse>(\n `autoramps/${encodeURIComponent(autorampId)}`,\n );\n return this.#mapAutorampResponse(response);\n }\n\n /**\n * Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.\n * Body is forwarded as opaque JSON (MoonPay address schema).\n *\n * @param body - Pix address registration payload.\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\n async registerPixAddress(\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<unknown> {\n return this.#postJson('addresses/pix', body, options);\n }\n\n /**\n * Fetches an autoramp quote via neobank-proxy `GET /neobank/autoramps/quote`.\n *\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\n async getAutorampQuote(query: NeoBankQueryParams = {}): Promise<unknown> {\n return this.#getJson('autoramps/quote', query);\n }\n\n /**\n * Creates an autoramp from a signed quote via neobank-proxy\n * `POST /neobank/autoramps` (MoonPay `POST /api/autoramps`).\n *\n * @param body - CreateAutoramp / signed-quote payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Remote snapshot for controller apply/refresh.\n */\n async createAutoramp(\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<AutorampRemoteSnapshot> {\n const response = await this.#postJson<NeoBankAutorampResponse>(\n 'autoramps',\n body,\n options,\n );\n return this.#mapAutorampResponse(response);\n }\n\n /**\n * Fetches a quote for an existing autoramp via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}/quote`.\n *\n * @param autorampId - Autoramp id.\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\n async getAutorampQuoteForAutoramp(\n autorampId: string,\n query: NeoBankQueryParams = {},\n ): Promise<unknown> {\n return this.#getJson(\n `autoramps/${encodeURIComponent(autorampId)}/quote`,\n query,\n );\n }\n\n /**\n * Attaches a signed quote to an autoramp via neobank-proxy\n * `POST /neobank/autoramps/{autoramp_id}/quotes`.\n *\n * @param autorampId - Autoramp id.\n * @param body - Quote attachment payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\n async attachAutorampQuote(\n autorampId: string,\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<unknown> {\n return this.#postJson(\n `autoramps/${encodeURIComponent(autorampId)}/quotes`,\n body,\n options,\n );\n }\n\n /**\n * Fetches a customer by partner external id via neobank-proxy\n * `GET /neobank/customers/{external_id}/external`.\n *\n * @param externalId - Partner-assigned external customer id.\n * @returns Parsed proxy JSON response.\n */\n async getCustomerByExternalId(externalId: string): Promise<unknown> {\n return this.#getJson(\n `customers/${encodeURIComponent(externalId)}/external`,\n );\n }\n\n /**\n * Resolves Iron's internal customer id via neobank-proxy customer lookup,\n * using the MetaMask canonical profile id as the partner `external_id`.\n *\n * @returns Iron's internal customer id.\n */\n async getMoonpayCustomerId(): Promise<string> {\n return await this.#getWalletRegistrationService().getMoonpayCustomerId();\n }\n\n /**\n * Checks whether a Monad Money Account address is already registered for the\n * given Iron customer.\n *\n * @param params - Customer id and address to check.\n * @param params.customerId - Iron / MoonPay customer UUID.\n * @param params.address - Money Account address.\n * @returns Active, disabled, or absent registration status.\n */\n async getWalletRegistrationStatus({\n customerId,\n address,\n }: GetWalletRegistrationStatusParams): Promise<RegistrationStatus> {\n return await this.#getWalletRegistrationService().getRegistrationStatus({\n customerId,\n address,\n blockchain: 'Monad',\n });\n }\n\n /**\n * Submits a signed Monad Money Account ownership proof via neobank-proxy\n * `POST /neobank/addresses/crypto/selfhosted`.\n *\n * @param params - Signed ownership proof.\n * @returns Registered wallet record.\n */\n async registerSelfHostedWallet(\n params: RegisterSelfHostedWalletParams,\n ): Promise<RegistrationOutcome> {\n return await this.#getWalletRegistrationService().registerSelfHostedWallet({\n ...params,\n blockchain: 'Monad',\n });\n }\n\n /**\n * Resolves the MetaMask canonical profile id used as MoonPay's partner\n * `external_id` for neobank customer lookup.\n *\n * @returns Canonical profile id.\n */\n async #getCanonicalExternalId(): Promise<string> {\n const profile = await this.#messenger.call(\n 'AuthenticationController:getSessionProfile',\n );\n const canonical = profile?.canonicalProfileId;\n const externalId =\n typeof canonical === 'string' && canonical.length > 0\n ? canonical\n : profile?.profileId;\n if (typeof externalId !== 'string' || externalId.length === 0) {\n throw new Error(\n 'Unable to resolve MetaMask canonical profile id for MoonPay customer lookup',\n );\n }\n return externalId;\n }\n\n onRetry(\n listener: Parameters<ServicePolicy['onRetry']>[0],\n ): ReturnType<ServicePolicy['onRetry']> {\n return this.#policy.onRetry(listener);\n }\n\n onBreak(\n listener: Parameters<ServicePolicy['onBreak']>[0],\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(listener);\n }\n\n onDegraded(\n listener: Parameters<ServicePolicy['onDegraded']>[0],\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(listener);\n }\n}\n"]}
1
+ {"version":3,"file":"NeoBankService.js","sourceRoot":"","sources":["../src/NeoBankService.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,SAAS,GACV,MAAM,4BAA4B,CAAC;AAIpC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAM1C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAM7E;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,SAAS,gBAAgB,CAAC,KAAc;IACtC,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC,UAAU,GAAG,GAAG,IAAI,KAAK,CAAC,UAAU,IAAI,GAAG,CAAC;IAC3D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AA+DD,MAAM,yBAAyB,GAAG;IAChC,aAAa;IACb,cAAc;IACd,oBAAoB;IACpB,kBAAkB;IAClB,gBAAgB;IAChB,6BAA6B;IAC7B,qBAAqB;IACrB,yBAAyB;IACzB,sBAAsB;IACtB,6BAA6B;IAC7B,0BAA0B;CAClB,CAAC;AAyBX;;;;;;;;;GASG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,WAAW,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,SAAS,UAAU,CAAC,WAA6B;IAC/C,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,gBAAgB,CAAC,UAAU;YAC9B,OAAO,oCAAoC,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OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CACL,QAAiD;QAEjD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,UAAU,CACR,QAAoD;QAEpD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["import type {\n CreateServicePolicyOptions,\n ServicePolicy,\n} from '@metamask/controller-utils';\nimport {\n createServicePolicy,\n handleWhen,\n HttpError,\n} from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\nimport type { AuthenticationController } from '@metamask/profile-sync-controller';\n\nimport packageJson from '../package.json';\nimport type {\n AutorampDepositRailsSummary,\n AutorampRemoteSnapshot,\n} from './autoramp-types.js';\nimport type { NeoBankServiceMethodActions } from './NeoBankService-method-action-types.js';\nimport { RAMPS_SDK_VERSION, RampsEnvironment } from './RampsService.js';\nimport { WalletRegistrationService } from './wallet-registration-service.js';\nimport type {\n RegistrationOutcome,\n RegistrationStatus,\n} from './wallet-registration-service.js';\n\n/**\n * Name of the NeoBankService messenger namespace.\n */\nexport const serviceName = 'NeoBankService';\n\n/**\n * Determines whether a failed neo-bank request is worth re-issuing.\n *\n * 4xx responses describe the request or the account's state (e.g. 403\n * \"Customer is not active\", 422 validation), so repeating them only multiplies\n * the same rejection. 429 stays retryable alongside 5xx and non-HTTP\n * network/timeout errors.\n *\n * @param error - Error thrown while performing the request.\n * @returns `true` when the error is worth retrying.\n */\nfunction isRetryableError(error: unknown): boolean {\n if (error instanceof HttpError) {\n if (error.httpStatus === 429) {\n return true;\n }\n return error.httpStatus < 400 || error.httpStatus >= 500;\n }\n return true;\n}\n\n/**\n * Raw autoramp payload from the MetaMask Ramp API neo-bank proxy.\n * Shape mirrors MoonPay Enterprise `GET /api/autoramps/{autoramp_id}`.\n * The Ramp API handles partner auth / headers; the client only sends the\n * MetaMask bearer token.\n */\nexport type NeoBankAutorampResponse = {\n id: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n customer_id?: string;\n status: string;\n /**\n * Destination wallet when present on the proxy response.\n * Field name may evolve with the Ramp API contract.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n wallet_address?: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n recipient_account?: {\n address?: string;\n };\n // eslint-disable-next-line @typescript-eslint/naming-convention -- MoonPay API field\n deposit_rails?: unknown[];\n};\n\n/**\n * Optional headers for neo-bank mutating requests.\n */\nexport type NeoBankRequestOptions = {\n /**\n * Forwarded as `Idempotency-Key` when set (MoonPay requires it on some POSTs;\n * neobank-proxy generates one when omitted).\n */\n idempotencyKey?: string;\n};\n\n/**\n * Query string values accepted by neo-bank GET helpers.\n */\nexport type NeoBankQueryParams = Record<\n string,\n string | number | boolean | undefined | null\n>;\n\nexport type GetWalletRegistrationStatusParams = {\n customerId: string;\n address: string;\n};\n\nexport type RegisterSelfHostedWalletParams = {\n customerId: string;\n address: string;\n message: string;\n signature: string;\n /**\n * Forwarded as `Idempotency-Key` on the neobank-proxy POST. Prefer a stable\n * key across retries of the same ownership body.\n */\n idempotencyKey?: string;\n};\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getAutoramp',\n 'getAutoramps',\n 'registerPixAddress',\n 'getAutorampQuote',\n 'createAutoramp',\n 'getAutorampQuoteForAutoramp',\n 'attachAutorampQuote',\n 'getCustomerByExternalId',\n 'getMoonpayCustomerId',\n 'getWalletRegistrationStatus',\n 'registerSelfHostedWallet',\n] as const;\n\n/**\n * Actions that {@link NeoBankService} exposes to other consumers.\n */\nexport type NeoBankServiceActions = NeoBankServiceMethodActions;\n\ntype AllowedActions =\n | AuthenticationController.AuthenticationControllerGetBearerTokenAction\n | AuthenticationController.AuthenticationControllerGetSessionProfileAction;\n\nexport type NeoBankServiceEvents = never;\n\ntype AllowedEvents = never;\n\n/**\n * The messenger restricted to actions and events accessed by\n * {@link NeoBankService}.\n */\nexport type NeoBankServiceMessenger = Messenger<\n typeof serviceName,\n NeoBankServiceActions | AllowedActions,\n NeoBankServiceEvents | AllowedEvents\n>;\n\n/**\n * Builds a path under the neobank-proxy global prefix.\n *\n * Live neobank-proxy (#1124) mounts routes at `/neobank` on the on-ramp.api\n * host (ALB path routing, no rewrite). Prefer this over `/api/v2/...` so Core\n * matches the proxy that ships.\n *\n * @param path - Path under `/neobank` (no leading slash).\n * @returns Absolute path segment for URL join against the Ramp API host.\n */\nfunction getNeoBankPath(path: string): string {\n return `neobank/${path.replace(/^\\//u, '')}`;\n}\n\n/**\n * Resolves the Ramp API host for neo-bank calls (same hosts as {@link RampsService}).\n *\n * @param environment - Ramp environment.\n * @returns Base URL.\n */\nfunction getBaseUrl(environment: RampsEnvironment): string {\n switch (environment) {\n case RampsEnvironment.Production:\n return 'https://on-ramp.api.cx.metamask.io';\n case RampsEnvironment.Staging:\n return 'https://on-ramp.uat-api.cx.metamask.io';\n case RampsEnvironment.Development:\n return 'https://on-ramp.dev-api.cx.metamask.io';\n case RampsEnvironment.Local:\n return 'http://localhost:3000';\n default:\n throw new Error(`Invalid environment: ${String(environment)}`);\n }\n}\n\n/**\n * Maps a Ramp API / MoonPay-shaped autoramp response into the local remote snapshot.\n *\n * @param response - Proxy response body.\n * @returns Snapshot for the controller last-seen cursor.\n */\nexport function mapNeoBankAutorampToRemoteSnapshot(\n response: NeoBankAutorampResponse,\n): AutorampRemoteSnapshot {\n const depositRails = response.deposit_rails;\n const hasDepositRails =\n Array.isArray(depositRails) && depositRails.length > 0;\n const depositRailsSummary: AutorampDepositRailsSummary | undefined =\n hasDepositRails || response.status === 'Approved'\n ? {\n ready: response.status === 'Approved' && hasDepositRails,\n }\n : undefined;\n\n return {\n id: response.id,\n customerId: response.customer_id,\n walletAddress:\n response.wallet_address !== undefined &&\n response.wallet_address.length > 0\n ? response.wallet_address\n : response.recipient_account?.address,\n status: response.status,\n depositRailsSummary,\n };\n}\n\n/**\n * Client for MetaMask Ramp API neo-bank endpoints (MoonPay Enterprise proxy).\n *\n * Lives alongside {@link RampsService} and {@link TransakService}. Authentication\n * and MoonPay partner headers are handled by the Ramp API; this service only\n * attaches the MetaMask user bearer token.\n *\n * Paths use the neobank-proxy `/neobank` prefix on the on-ramp.api host.\n */\nexport class NeoBankService {\n readonly name: typeof serviceName;\n\n readonly #messenger: NeoBankServiceMessenger;\n\n readonly #fetch: typeof fetch;\n\n readonly #policy: ServicePolicy;\n\n readonly #noRetryPolicy: ServicePolicy;\n\n readonly #environment: RampsEnvironment;\n\n readonly #context: string;\n\n readonly #baseUrlOverride?: string;\n\n #walletRegistrationService: WalletRegistrationService | undefined;\n\n constructor({\n messenger,\n environment = RampsEnvironment.Staging,\n context,\n fetch: fetchFunction,\n policyOptions = {},\n baseUrlOverride,\n }: {\n messenger: NeoBankServiceMessenger;\n environment?: RampsEnvironment;\n context: string;\n fetch: typeof fetch;\n policyOptions?: CreateServicePolicyOptions;\n baseUrlOverride?: string;\n }) {\n this.name = serviceName;\n this.#messenger = messenger;\n this.#fetch = fetchFunction;\n this.#policy = createServicePolicy({\n retryFilterPolicy: handleWhen(isRetryableError),\n ...policyOptions,\n });\n this.#noRetryPolicy = createServicePolicy({\n retryFilterPolicy: handleWhen(isRetryableError),\n ...policyOptions,\n maxRetries: 0,\n });\n this.#environment = environment;\n this.#context = context;\n this.#baseUrlOverride = baseUrlOverride;\n\n this.#messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n #getBaseUrl(): string {\n if (this.#baseUrlOverride) {\n return this.#baseUrlOverride;\n }\n return getBaseUrl(this.#environment);\n }\n\n /**\n * Lazily builds the wallet registration client. Deferred so constructing the\n * service never resolves the base URL eagerly (an invalid environment only\n * throws when a request is made, matching the other neo-bank methods).\n *\n * @returns The wallet registration client.\n */\n #getWalletRegistrationService(): WalletRegistrationService {\n this.#walletRegistrationService ??= new WalletRegistrationService({\n fetch: this.#fetch,\n baseUrl: this.#getBaseUrl(),\n getAuthToken: async (): Promise<string> =>\n this.#messenger.call('AuthenticationController:getBearerToken'),\n getExternalId: async (): Promise<string> =>\n this.#getCanonicalExternalId(),\n });\n return this.#walletRegistrationService;\n }\n\n async #getRequestHeaders(\n options: NeoBankRequestOptions = {},\n ): Promise<Record<string, string>> {\n const bearerToken = await this.#messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n const headers: Record<string, string> = {\n Authorization: `Bearer ${bearerToken}`,\n };\n if (options.idempotencyKey) {\n headers['Idempotency-Key'] = options.idempotencyKey;\n }\n return headers;\n }\n\n #buildUrl(path: string, query?: NeoBankQueryParams): URL {\n const url = new URL(getNeoBankPath(path), this.#getBaseUrl());\n url.searchParams.set('sdk', RAMPS_SDK_VERSION);\n url.searchParams.set('controller', packageJson.version);\n url.searchParams.set('context', this.#context);\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined && value !== null) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n return url;\n }\n\n /**\n * Throws an {@link HttpError} that carries the upstream response body.\n *\n * The neobank-proxy mirrors MoonPay's status *and* body verbatim, so the\n * body is usually the only place that explains a 4xx (e.g. which field or\n * permission was rejected). Dropping it makes failures undiagnosable.\n *\n * @param url - Request URL, for context in the message.\n * @param response - Non-OK fetch response.\n */\n async #throwHttpError(url: URL, response: Response): Promise<never> {\n let detail = '';\n try {\n const body = (await response.text()).trim();\n if (body) {\n detail = ` - ${body.slice(0, 500)}`;\n }\n } catch {\n // Body already consumed or unreadable; the status alone still helps.\n }\n throw new HttpError(\n response.status,\n `Fetching '${url.toString()}' failed with status '${response.status}'${detail}`,\n );\n }\n\n async #getJson<ResponseBody>(\n path: string,\n query?: NeoBankQueryParams,\n ): Promise<ResponseBody> {\n const url = this.#buildUrl(path, query);\n return this.#policy.execute(async () => {\n const headers = await this.#getRequestHeaders();\n const fetchResponse = await this.#fetch(url, { headers });\n if (!fetchResponse.ok) {\n await this.#throwHttpError(url, fetchResponse);\n }\n return fetchResponse.json() as Promise<ResponseBody>;\n });\n }\n\n async #postJson<ResponseBody>(\n path: string,\n body: Record<string, unknown>,\n options: NeoBankRequestOptions,\n ): Promise<ResponseBody> {\n const url = this.#buildUrl(path);\n return this.#noRetryPolicy.execute(async () => {\n const headers = await this.#getRequestHeaders(options);\n headers['Content-Type'] = 'application/json';\n const fetchResponse = await this.#fetch(url, {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n });\n if (!fetchResponse.ok) {\n await this.#throwHttpError(url, fetchResponse);\n }\n return fetchResponse.json() as Promise<ResponseBody>;\n });\n }\n\n #mapAutorampResponse(\n response: NeoBankAutorampResponse,\n ): AutorampRemoteSnapshot {\n if (!response || typeof response !== 'object' || !response.id) {\n throw new Error('Malformed response received from neo-bank autoramp API');\n }\n return mapNeoBankAutorampToRemoteSnapshot(response);\n }\n\n /**\n * Fetches an autoramp account via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}` (MoonPay\n * `GET /api/autoramps/{autoramp_id}`).\n *\n * @param autorampId - MoonPay / Ramp API autoramp id.\n * @returns Remote snapshot for controller apply/refresh.\n */\n async getAutoramp(autorampId: string): Promise<AutorampRemoteSnapshot> {\n const response = await this.#getJson<NeoBankAutorampResponse>(\n `autoramps/${encodeURIComponent(autorampId)}`,\n );\n return this.#mapAutorampResponse(response);\n }\n\n /**\n * Fetches all autoramp accounts belonging to the authenticated customer.\n *\n * @returns Remote snapshots for all customer autoramps.\n */\n async getAutoramps(): Promise<AutorampRemoteSnapshot[]> {\n const response = await this.#getJson<unknown>('autoramps');\n if (!Array.isArray(response)) {\n throw new Error(\n 'Malformed response received from neo-bank autoramps API',\n );\n }\n return response.map((autoramp) =>\n this.#mapAutorampResponse(autoramp as NeoBankAutorampResponse),\n );\n }\n\n /**\n * Registers a Pix address via neobank-proxy `POST /neobank/addresses/pix`.\n * Body is forwarded as opaque JSON (MoonPay address schema).\n *\n * @param body - Pix address registration payload.\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\n async registerPixAddress(\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<unknown> {\n return this.#postJson('addresses/pix', body, options);\n }\n\n /**\n * Fetches an autoramp quote via neobank-proxy `GET /neobank/autoramps/quote`.\n *\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\n async getAutorampQuote(query: NeoBankQueryParams = {}): Promise<unknown> {\n return this.#getJson('autoramps/quote', query);\n }\n\n /**\n * Creates an autoramp from a signed quote via neobank-proxy\n * `POST /neobank/autoramps` (MoonPay `POST /api/autoramps`).\n *\n * @param body - CreateAutoramp / signed-quote payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Remote snapshot for controller apply/refresh.\n */\n async createAutoramp(\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<AutorampRemoteSnapshot> {\n const response = await this.#postJson<NeoBankAutorampResponse>(\n 'autoramps',\n body,\n options,\n );\n return this.#mapAutorampResponse(response);\n }\n\n /**\n * Fetches a quote for an existing autoramp via neobank-proxy\n * `GET /neobank/autoramps/{autoramp_id}/quote`.\n *\n * @param autorampId - Autoramp id.\n * @param query - Quote query params (forwarded as-is).\n * @returns Parsed proxy JSON response.\n */\n async getAutorampQuoteForAutoramp(\n autorampId: string,\n query: NeoBankQueryParams = {},\n ): Promise<unknown> {\n return this.#getJson(\n `autoramps/${encodeURIComponent(autorampId)}/quote`,\n query,\n );\n }\n\n /**\n * Attaches a signed quote to an autoramp via neobank-proxy\n * `POST /neobank/autoramps/{autoramp_id}/quotes`.\n *\n * @param autorampId - Autoramp id.\n * @param body - Quote attachment payload (forwarded as-is).\n * @param options - Optional idempotency key.\n * @returns Parsed proxy JSON response.\n */\n async attachAutorampQuote(\n autorampId: string,\n body: Record<string, unknown>,\n options: NeoBankRequestOptions = {},\n ): Promise<unknown> {\n return this.#postJson(\n `autoramps/${encodeURIComponent(autorampId)}/quotes`,\n body,\n options,\n );\n }\n\n /**\n * Fetches a customer by partner external id via neobank-proxy\n * `GET /neobank/customers/{external_id}/external`.\n *\n * @param externalId - Partner-assigned external customer id.\n * @returns Parsed proxy JSON response.\n */\n async getCustomerByExternalId(externalId: string): Promise<unknown> {\n return this.#getJson(\n `customers/${encodeURIComponent(externalId)}/external`,\n );\n }\n\n /**\n * Resolves Iron's internal customer id via neobank-proxy customer lookup,\n * using the MetaMask canonical profile id as the partner `external_id`.\n *\n * @returns Iron's internal customer id.\n */\n async getMoonpayCustomerId(): Promise<string> {\n return await this.#getWalletRegistrationService().getMoonpayCustomerId();\n }\n\n /**\n * Checks whether a Monad Money Account address is already registered for the\n * given Iron customer.\n *\n * @param params - Customer id and address to check.\n * @param params.customerId - Iron / MoonPay customer UUID.\n * @param params.address - Money Account address.\n * @returns Active, disabled, or absent registration status.\n */\n async getWalletRegistrationStatus({\n customerId,\n address,\n }: GetWalletRegistrationStatusParams): Promise<RegistrationStatus> {\n return await this.#getWalletRegistrationService().getRegistrationStatus({\n customerId,\n address,\n blockchain: 'Monad',\n });\n }\n\n /**\n * Submits a signed Monad Money Account ownership proof via neobank-proxy\n * `POST /neobank/addresses/crypto/selfhosted`.\n *\n * @param params - Signed ownership proof.\n * @returns Registered wallet record.\n */\n async registerSelfHostedWallet(\n params: RegisterSelfHostedWalletParams,\n ): Promise<RegistrationOutcome> {\n return await this.#getWalletRegistrationService().registerSelfHostedWallet({\n ...params,\n blockchain: 'Monad',\n });\n }\n\n /**\n * Resolves the MetaMask canonical profile id used as MoonPay's partner\n * `external_id` for neobank customer lookup.\n *\n * @returns Canonical profile id.\n */\n async #getCanonicalExternalId(): Promise<string> {\n const profile = await this.#messenger.call(\n 'AuthenticationController:getSessionProfile',\n );\n const canonical = profile?.canonicalProfileId;\n const externalId =\n typeof canonical === 'string' && canonical.length > 0\n ? canonical\n : profile?.profileId;\n if (typeof externalId !== 'string' || externalId.length === 0) {\n throw new Error(\n 'Unable to resolve MetaMask canonical profile id for MoonPay customer lookup',\n );\n }\n return externalId;\n }\n\n onRetry(\n listener: Parameters<ServicePolicy['onRetry']>[0],\n ): ReturnType<ServicePolicy['onRetry']> {\n return this.#policy.onRetry(listener);\n }\n\n onBreak(\n listener: Parameters<ServicePolicy['onBreak']>[0],\n ): ReturnType<ServicePolicy['onBreak']> {\n return this.#policy.onBreak(listener);\n }\n\n onDegraded(\n listener: Parameters<ServicePolicy['onDegraded']>[0],\n ): ReturnType<ServicePolicy['onDegraded']> {\n return this.#policy.onDegraded(listener);\n }\n}\n"]}
@@ -403,6 +403,23 @@ export type RampsControllerRegisterMoneyAccountWalletAction = {
403
403
  type: `RampsController:registerMoneyAccountWallet`;
404
404
  handler: RampsController['registerMoneyAccountWallet'];
405
405
  };
406
+ /**
407
+ * Refreshes KYC session facts and, when Iron has approved KYC, activates the
408
+ * Money Account (wallet registration + autoramp). Hosts map the returned
409
+ * {@link VbaOnboardingSnapshot} onto their own funnel; this method does not
410
+ * name screens.
411
+ *
412
+ * Overlapping calls share one run so polling cannot trigger duplicate wallet
413
+ * signatures or autoramp creation.
414
+ *
415
+ * @param params - VBA onboarding parameters.
416
+ * @param params.walletAddress - Monad Money Account wallet address.
417
+ * @returns Independent KYC and autoramp facts for the current customer.
418
+ */
419
+ export type RampsControllerHydrateVbaOnboardingAction = {
420
+ type: `RampsController:hydrateVbaOnboarding`;
421
+ handler: RampsController['hydrateVbaOnboarding'];
422
+ };
406
423
  /**
407
424
  * Removes a local autoramp last-seen cursor by id.
408
425
  *
@@ -815,5 +832,5 @@ export type RampsControllerTransakGetActiveOrdersAction = {
815
832
  /**
816
833
  * Union of all RampsController action types.
817
834
  */
818
- export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerSetSelectedProviderForAssetAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerGetPaymentMethodsForContextAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerGetQuoteWithFeesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerSyncOrdersWithUserStorageAction | RampsControllerAddAutorampAction | RampsControllerCreateAutorampAction | RampsControllerRegisterMoneyAccountWalletAction | RampsControllerRemoveAutorampAction | RampsControllerMarkAutorampAsNotifiedAction | RampsControllerApplyAutorampStatusFromPushAction | RampsControllerRefreshAutorampAction | RampsControllerRefreshAutorampsAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakCreateWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
835
+ export type RampsControllerMethodActions = RampsControllerExecuteRequestAction | RampsControllerAbortRequestAction | RampsControllerGetRequestStateAction | RampsControllerSetUserRegionAction | RampsControllerSetSelectedProviderAction | RampsControllerSetSelectedProviderForAssetAction | RampsControllerInitAction | RampsControllerGetCountriesAction | RampsControllerGetTokensAction | RampsControllerSetSelectedTokenAction | RampsControllerGetProvidersAction | RampsControllerGetPaymentMethodsAction | RampsControllerGetPaymentMethodsForContextAction | RampsControllerSetSelectedPaymentMethodAction | RampsControllerGetQuotesAction | RampsControllerGetQuoteWithFeesAction | RampsControllerAddOrderAction | RampsControllerRemoveOrderAction | RampsControllerSyncOrdersWithUserStorageAction | RampsControllerAddAutorampAction | RampsControllerCreateAutorampAction | RampsControllerRegisterMoneyAccountWalletAction | RampsControllerHydrateVbaOnboardingAction | RampsControllerRemoveAutorampAction | RampsControllerMarkAutorampAsNotifiedAction | RampsControllerApplyAutorampStatusFromPushAction | RampsControllerRefreshAutorampAction | RampsControllerRefreshAutorampsAction | RampsControllerStartOrderPollingAction | RampsControllerStopOrderPollingAction | RampsControllerGetBuyWidgetDataAction | RampsControllerAddPrecreatedOrderAction | RampsControllerGetOrderAction | RampsControllerGetOrderFromCallbackAction | RampsControllerTransakSetApiKeyAction | RampsControllerTransakSetAccessTokenAction | RampsControllerTransakClearAccessTokenAction | RampsControllerTransakSetAuthenticatedAction | RampsControllerTransakResetStateAction | RampsControllerTransakSendUserOtpAction | RampsControllerTransakVerifyUserOtpAction | RampsControllerTransakLogoutAction | RampsControllerTransakGetUserDetailsAction | RampsControllerTransakGetBuyQuoteAction | RampsControllerTransakGetKycRequirementAction | RampsControllerTransakGetAdditionalRequirementsAction | RampsControllerTransakCreateOrderAction | RampsControllerTransakGetOrderAction | RampsControllerTransakGetUserLimitsAction | RampsControllerTransakRequestOttAction | RampsControllerTransakGeneratePaymentWidgetUrlAction | RampsControllerTransakCreateWidgetUrlAction | RampsControllerTransakSubmitPurposeOfUsageFormAction | RampsControllerTransakPatchUserAction | RampsControllerTransakSubmitSsnDetailsAction | RampsControllerTransakConfirmPaymentAction | RampsControllerTransakGetTranslationAction | RampsControllerTransakGetIdProofStatusAction | RampsControllerTransakCancelOrderAction | RampsControllerTransakCancelAllActiveOrdersAction | RampsControllerTransakGetActiveOrdersAction;
819
836
  //# sourceMappingURL=RampsController-method-action-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RampsController-method-action-types.d.ts","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,eAAe,CAAC,6BAA6B,CA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zC,kCAAkC,GAClC,0CAA0C,GAC1C,uCAAuC,GACvC,6CAA6C,GAC7C,qDAAqD,GACrD,uCAAuC,GACvC,oCAAoC,GACpC,yCAAyC,GACzC,sCAAsC,GACtC,oDAAoD,GACpD,2CAA2C,GAC3C,oDAAoD,GACpD,qCAAqC,GACrC,4CAA4C,GAC5C,0CAA0C,GAC1C,0CAA0C,GAC1C,4CAA4C,GAC5C,uCAAuC,GACvC,iDAAiD,GACjD,2CAA2C,CAAC"}
1
+ {"version":3,"file":"RampsController-method-action-types.d.ts","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;;;;;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ACnC,+CAA+C,GAC/C,yCAAyC,GACzC,mCAAmC,GACnC,2CAA2C,GAC3C,gDAAgD,GAChD,oCAAoC,GACpC,qCAAqC,GACrC,sCAAsC,GACtC,qCAAqC,GACrC,qCAAqC,GACrC,uCAAuC,GACvC,6BAA6B,GAC7B,yCAAyC,GACzC,qCAAqC,GACrC,0CAA0C,GAC1C,4CAA4C,GAC5C,4CAA4C,GAC5C,sCAAsC,GACtC,uCAAuC,GACvC,yCAAyC,GACzC,kCAAkC,GAClC,0CAA0C,GAC1C,uCAAuC,GACvC,6CAA6C,GAC7C,qDAAqD,GACrD,uCAAuC,GACvC,oCAAoC,GACpC,yCAAyC,GACzC,sCAAsC,GACtC,oDAAoD,GACpD,2CAA2C,GAC3C,oDAAoD,GACpD,qCAAqC,GACrC,4CAA4C,GAC5C,0CAA0C,GAC1C,0CAA0C,GAC1C,4CAA4C,GAC5C,uCAAuC,GACvC,iDAAiD,GACjD,2CAA2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RampsController-method-action-types.js","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { RampsController } from './RampsController.js';\n\n/**\n * Executes a request with caching, deduplication, and at most one in-flight\n * request per resource type.\n *\n * 1. **Same cache key in flight** – If a request with this cache key is\n * already pending, returns that promise (deduplication; no second request).\n *\n * 2. **Cache hit** – If valid, non-expired data exists in state.requests for\n * this key and forceRefresh is not set, returns that data without fetching.\n *\n * 3. **New request** – Creates an AbortController and fires the fetcher.\n * If options.resourceType is set, tags the pending request with that\n * resource type (so #abortDependentRequests can cancel it on region\n * change or cleanup) and ref-counts resource-level loading state.\n * On success or error, updates request state and resource error;\n * in finally, clears resource loading only if this request was not\n * aborted.\n *\n * @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).\n * @param fetcher - Async function that performs the fetch. Receives an AbortSignal\n * that is aborted when this request is superseded by another for the same resource.\n * @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.\n * @returns The result of the request (from cache, joined promise, or fetcher).\n */\nexport type RampsControllerExecuteRequestAction = {\n type: `RampsController:executeRequest`;\n handler: RampsController['executeRequest'];\n};\n\n/**\n * Aborts a pending request if one exists.\n *\n * @param cacheKey - The cache key of the request to abort.\n * @returns True if a request was aborted.\n */\nexport type RampsControllerAbortRequestAction = {\n type: `RampsController:abortRequest`;\n handler: RampsController['abortRequest'];\n};\n\n/**\n * Gets the state of a specific cached request.\n *\n * @param cacheKey - The cache key to look up.\n * @returns The request state, or undefined if not cached.\n */\nexport type RampsControllerGetRequestStateAction = {\n type: `RampsController:getRequestState`;\n handler: RampsController['getRequestState'];\n};\n\n/**\n * Sets the user's region manually (without fetching geolocation).\n * This allows users to override the detected region.\n *\n * @param region - The region code to set (e.g., \"US-CA\").\n * @param options - Options for cache behavior.\n * @returns The user region object.\n */\nexport type RampsControllerSetUserRegionAction = {\n type: `RampsController:setUserRegion`;\n handler: RampsController['setUserRegion'];\n};\n\n/**\n * Sets the user's selected provider.\n *\n * Accepts either a Provider object (stored directly) or a provider ID\n * string (looked up from state). The object form is preferred when the\n * caller already has the full data (e.g. from React Query cache).\n *\n * @param providerOrId - A Provider object, a provider ID string (e.g., \"/providers/moonpay\"), or null to clear.\n * @param options - Optional settings for the selection.\n * @param options.autoSelected - When true, marks the provider as system-guessed\n * (soft selection). The UI will silently auto-switch on token conflict instead\n * of showing the \"Token Not Available\" modal. Defaults to false.\n */\nexport type RampsControllerSetSelectedProviderAction = {\n type: `RampsController:setSelectedProvider`;\n handler: RampsController['setSelectedProvider'];\n};\n\n/**\n * Switches to the first provider in state that serves the given asset,\n * when the currently selected provider does not.\n *\n * This is the controller-level equivalent of UB2's BuildQuote tier-1\n * silent-switch effect and MMPay's `useEnsureCompatibleProvider` hook: it\n * keeps provider-asset compatibility logic in one place rather than\n * duplicating `providerServesAsset` + find-and-switch across multiple UI\n * layers.\n *\n * The compatibility check prefers the current provider's entry in\n * `providers.data` over the `providers.selected` copy, which can be stale\n * once a fresh providers list arrives.\n *\n * No-op when:\n * - `providers.data` is empty (providers not yet loaded)\n * - the currently selected provider already serves the asset\n * - no provider in the list serves the asset (no safe fallback)\n *\n * @param assetId - CAIP-19 asset id of the deposit asset.\n * @param options - Optional settings forwarded to `setSelectedProvider`.\n * @param options.autoSelected - When true, marks the new selection as\n * system-guessed (soft selection). Defaults to true.\n * @returns `true` if the selected provider was changed, `false` otherwise.\n */\nexport type RampsControllerSetSelectedProviderForAssetAction = {\n type: `RampsController:setSelectedProviderForAsset`;\n handler: RampsController['setSelectedProviderForAsset'];\n};\n\n/**\n * Initializes the controller by fetching the user's region from geolocation.\n * This should be called once at app startup to set up the initial region.\n *\n * Idempotent: subsequent calls return the same promise unless forceRefresh is set.\n * Force-refetches the countries catalog on startup (bypassing the in-session\n * request cache) so region preset amounts stay current. The catalog is not\n * persisted, so a cold start always re-fetches it regardless. Skips\n * geolocation when userRegion already exists.\n *\n * @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.\n * @returns Promise that resolves when initialization is complete.\n */\nexport type RampsControllerInitAction = {\n type: `RampsController:init`;\n handler: RampsController['init'];\n};\n\n/**\n * Fetches the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * The countries are saved in the controller state once fetched.\n *\n * @param options - Options for cache behavior.\n * @returns An array of countries.\n */\nexport type RampsControllerGetCountriesAction = {\n type: `RampsController:getCountries`;\n handler: RampsController['getCountries'];\n};\n\n/**\n * Fetches the list of available tokens for a given region and action.\n * The tokens are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\nexport type RampsControllerGetTokensAction = {\n type: `RampsController:getTokens`;\n handler: RampsController['getTokens'];\n};\n\n/**\n * Sets the user's selected token by asset ID.\n * Looks up the token from the current tokens in state and automatically\n * fetches payment methods for that token.\n *\n * @param assetId - The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\"), or undefined to clear.\n * @throws If region is not set, tokens are not loaded, or token is not found.\n */\nexport type RampsControllerSetSelectedTokenAction = {\n type: `RampsController:setSelectedToken`;\n handler: RampsController['setSelectedToken'];\n};\n\n/**\n * Fetches the list of providers for a given region.\n * The providers are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @param options.crypto - Crypto currency ID(s) to filter by.\n * @param options.payments - Payment method ID(s) to filter by.\n * @returns The providers response containing providers array.\n */\nexport type RampsControllerGetProvidersAction = {\n type: `RampsController:getProviders`;\n handler: RampsController['getProviders'];\n};\n\n/**\n * Fetches the list of payment methods for a given context.\n * The payment methods are saved in the controller state once fetched.\n *\n * @param region - User's region code (e.g. \"fr\", \"us-ny\").\n * @param options - Query parameters for filtering payment methods.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.provider - Provider ID path.\n * @returns The payment methods response containing payments array.\n */\nexport type RampsControllerGetPaymentMethodsAction = {\n type: `RampsController:getPaymentMethods`;\n handler: RampsController['getPaymentMethods'];\n};\n\n/**\n * Fetches payment methods for a quoting context without coupling callers to\n * the Buy flow's globally selected provider/token catalog.\n *\n * Provider contribution mirrors {@link getQuotes}:\n * - explicit `providers` (optionally filtered when\n * `restrictToKnownOrNativeProviders` is set)\n * - auto-select / restrict path, including `moneyHeadlessAllProviders`\n * widening: flag off uses the restricted/native resolver; flag on uses\n * supporting providers, intersected with the flag allowlist when that\n * allowlist is non-empty (pick-survivor set for picker methods)\n * - when those resolution flags and `providers` are omitted, uses only\n * `providers.selected` (UB2 selected-provider context)\n *\n * By default this is request-only: it does **not** mutate\n * `paymentMethods.data` or `paymentMethods.selected`. Pass `updateState:\n * true` only when the caller explicitly wants Buy-catalog write semantics\n * (UB2). Headless / MM Pay selection stays TPC-owned. `updateState: true`\n * throws when the resolved provider set holds more than one provider, because\n * the write guards cannot tell two such requests apart.\n *\n * Methods are request-eligible for the resolved provider set; they are not\n * guaranteed to produce a quote for every amount (provider fiat limits still\n * apply at quote time).\n *\n * @param options - Context for the payment-method fetch.\n * @param options.region - Region code. Defaults to `userRegion`.\n * @param options.assetId - Required CAIP-19 quoting asset.\n * @param options.providers - Explicit provider ids.\n * @param options.autoSelectProvider - Resolve providers like `getQuotes`.\n * @param options.preferredProviderIds - Preferred ids for auto-selection.\n * @param options.restrictToKnownOrNativeProviders - Headless gating.\n * @param options.updateState - When true, write `paymentMethods` state.\n * @param options.preferPaymentMethodId - Preserve this id when still present.\n * @param options.forceRefresh - Bypass request cache for provider fetches.\n * @param options.ttl - Custom TTL for provider payment-method fetches.\n * @returns Deduped methods, a request-only suggested selection, and the\n * provider ids that contributed.\n */\nexport type RampsControllerGetPaymentMethodsForContextAction = {\n type: `RampsController:getPaymentMethodsForContext`;\n handler: RampsController['getPaymentMethodsForContext'];\n};\n\n/**\n * Sets the user's selected payment method.\n *\n * Accepts either a payment method ID (looked up from state) or a full\n * PaymentMethod object (stored directly). The object form is preferred\n * when the caller already has the full data (e.g. from React Query cache),\n * as it avoids depending on controller state being populated.\n *\n * @param paymentMethodOrId - A PaymentMethod object, a payment method ID string, or undefined/null to clear.\n */\nexport type RampsControllerSetSelectedPaymentMethodAction = {\n type: `RampsController:setSelectedPaymentMethod`;\n handler: RampsController['setSelectedPaymentMethod'];\n};\n\n/**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the controller's request cache; callers manage the response in local state.\n *\n * @param options - The parameters for fetching quotes.\n * @param options.region - User's region code. If not provided, uses userRegion from state.\n * @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.amount - The amount (in fiat for buy, crypto for sell).\n * @param options.walletAddress - The destination wallet address.\n * @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.\n * @param options.providers - Optional provider IDs to filter quotes.\n * @param options.autoSelectProvider - When true and `providers` is omitted,\n * resolves a provider that supports `assetId` for this request only (no\n * state mutation). Ignored when `providers` is passed.\n * @param options.preferredProviderIds - Optional provider IDs to prefer\n * during auto-selection, in priority order (e.g. derived by the caller\n * from completed-order history). Only used when `autoSelectProvider` is\n * true and `providers` is omitted.\n * @param options.restrictToKnownOrNativeProviders - Headless-buy v0 gating. When\n * true, auto-selection resolves only a native provider, and an explicitly\n * passed `providers` list is filtered to those supporting the region and\n * asset. If nothing qualifies, `getQuotes` returns an empty response\n * instead of quoting other providers.\n * @param options.redirectUrl - Optional redirect URL after order completion.\n * @param options.action - The ramp action type. Defaults to 'buy'.\n * @param options.forceRefresh - Whether to bypass cache.\n * @param options.ttl - Custom TTL for this request.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\nexport type RampsControllerGetQuotesAction = {\n type: `RampsController:getQuotes`;\n handler: RampsController['getQuotes'];\n};\n\n/**\n * Fetches the best on-ramp quote for a request and, when the resolved\n * provider is Transak Native, reconciles its fees to match what Transak\n * Native actually charges.\n *\n * The aggregator `/quotes` estimate of Transak's fee does not match the\n * native integration. When the resolved provider is Transak Native this\n * fetches the native buy quote (an unauthenticated, API-key-only lookup, so\n * it is safe at estimate time) and rewrites the returned quote's fee fields\n * to its `totalFee`, keeping the aggregator's `networkFee` on the network\n * line and placing the remainder in the provider fee so the breakdown\n * survives and `providerFee + networkFee` still equals the native total. A\n * non-native provider, a failed lookup, or an unusable native fee returns the\n * aggregator quote unchanged.\n *\n * Consumers (e.g. `TransactionPayController`) call this instead of owning the\n * provider check, asset-id parsing, and second native quote themselves.\n *\n * @param options - Quote options; see {@link getQuotes}, plus the fee mode.\n * @param options.amount - Fiat amount for the quote.\n * @param options.assetId - CAIP-19 asset id being bought.\n * @param options.fiat - Optional fiat currency; defaults like {@link getQuotes}.\n * @param options.paymentMethods - Optional payment method ids.\n * @param options.walletAddress - Wallet address receiving the on-ramped asset.\n * @param options.isFeeExcludedFromFiat - Whether Transak adds its fee on top\n * of the fiat amount (`true`, fee-on-top) or carves it out (`false`). Must\n * mirror the eventual checkout mode so the estimate equals the charge.\n * Defaults to `true`.\n * @param options.providers - See {@link getQuotes}.\n * @param options.autoSelectProvider - See {@link getQuotes}.\n * @param options.restrictToKnownOrNativeProviders - See {@link getQuotes}.\n * @param options.preferredProviderIds - See {@link getQuotes}.\n * @param options.region - See {@link getQuotes}.\n * @param options.redirectUrl - See {@link getQuotes}.\n * @param options.action - See {@link getQuotes}.\n * @param options.forceRefresh - See {@link getQuotes}.\n * @param options.ttl - See {@link getQuotes}.\n * @returns The best quote with native-reconciled fees, or `undefined` when\n * no quote is available.\n */\nexport type RampsControllerGetQuoteWithFeesAction = {\n type: `RampsController:getQuoteWithFees`;\n handler: RampsController['getQuoteWithFees'];\n};\n\n/**\n * Adds or updates a V2 order in controller state.\n * If an order with the same internal order code already exists, the incoming\n * fields are merged on top of the existing order so that fields not present\n * in the update (e.g. paymentDetails from the Transak API) are preserved.\n * Unchanged syncable payloads (including unchanged poll results) are ignored\n * so `lastUpdatedAt` is not bumped and User Storage is not rewritten.\n *\n * @param order - The RampsOrder to add or update.\n */\nexport type RampsControllerAddOrderAction = {\n type: `RampsController:addOrder`;\n handler: RampsController['addOrder'];\n};\n\n/**\n * Removes a V2 order from controller state by providerOrderId.\n *\n * @param providerOrderId - The provider order ID to remove.\n */\nexport type RampsControllerRemoveOrderAction = {\n type: `RampsController:removeOrder`;\n handler: RampsController['removeOrder'];\n};\n\n/**\n * Bidirectionally syncs V2 ramps orders with User Storage.\n * Hosts should call this on unlock / when ramps syncing is enabled.\n *\n * Overlapping calls are coalesced into the in-flight worker. After the worker\n * settles, this method loops when `#orderSyncQueued` is still set so a\n * request that arrived between the worker's last loop check and promise\n * resolution is not dropped.\n */\nexport type RampsControllerSyncOrdersWithUserStorageAction = {\n type: `RampsController:syncOrdersWithUserStorage`;\n handler: RampsController['syncOrdersWithUserStorage'];\n};\n\n/**\n * Adds or updates a local autoramp last-seen cursor (e.g. after create).\n *\n * @param accountOrInput - Full account or create fields.\n * @returns The upserted {@link AutorampAccount}.\n */\nexport type RampsControllerAddAutorampAction = {\n type: `RampsController:addAutoramp`;\n handler: RampsController['addAutoramp'];\n};\n\n/**\n * Creates an autoramp via the neo-bank proxy and applies the returned\n * snapshot as the local last-seen cursor.\n *\n * The vendor `customer_id` is resolved via\n * {@link RampsController.resolveAutorampCustomerId} and injected into the\n * request (any caller-supplied `customer_id` is overwritten).\n *\n * @param request - CreateAutoramp payload.\n * @param options - Optional idempotency key forwarded to the proxy.\n * @param options.idempotencyKey - Value sent as `Idempotency-Key`.\n * @returns The created/updated local {@link AutorampAccount}.\n */\nexport type RampsControllerCreateAutorampAction = {\n type: `RampsController:createAutoramp`;\n handler: RampsController['createAutoramp'];\n};\n\n/**\n * Registers a Money Account wallet with MoonPay Iron via neobank-proxy.\n *\n * @param params - Money Account wallet registration parameters.\n * @param params.address - Monad Money Account address.\n * @returns The registration state, or `{ type: 'lookupUnavailable' }` when\n * the address-list lookup fails (never treated as unregistered).\n */\nexport type RampsControllerRegisterMoneyAccountWalletAction = {\n type: `RampsController:registerMoneyAccountWallet`;\n handler: RampsController['registerMoneyAccountWallet'];\n};\n\n/**\n * Removes a local autoramp last-seen cursor by id.\n *\n * @param autorampId - MoonPay autoramp id.\n */\nexport type RampsControllerRemoveAutorampAction = {\n type: `RampsController:removeAutoramp`;\n handler: RampsController['removeAutoramp'];\n};\n\n/**\n * Marks that the UI has already notified for the autoramp's current status.\n *\n * @param autorampId - MoonPay autoramp id.\n */\nexport type RampsControllerMarkAutorampAsNotifiedAction = {\n type: `RampsController:markAutorampAsNotified`;\n handler: RampsController['markAutorampAsNotified'];\n};\n\n/**\n * Applies a remote autoramp snapshot from a websocket / webhook push.\n *\n * @param remote - Remote autoramp snapshot.\n * @returns The updated local account.\n */\nexport type RampsControllerApplyAutorampStatusFromPushAction = {\n type: `RampsController:applyAutorampStatusFromPush`;\n handler: RampsController['applyAutorampStatusFromPush'];\n};\n\n/**\n * Fetches one autoramp from the neo-bank proxy and applies it to the\n * last-seen cursor. Does not recreate a cursor that was removed while the\n * request was in flight.\n *\n * @param autorampId - MoonPay autoramp id.\n * @returns The updated local account, or an unpersisted snapshot if the\n * cursor was removed during the fetch.\n */\nexport type RampsControllerRefreshAutorampAction = {\n type: `RampsController:refreshAutoramp`;\n handler: RampsController['refreshAutoramp'];\n};\n\n/**\n * Refreshes all known local autoramps from MoonPay.\n * Intended for app resume / unlock catch-up when webhooks were missed.\n *\n * @returns Updated autoramp accounts (failed fetches are skipped).\n */\nexport type RampsControllerRefreshAutorampsAction = {\n type: `RampsController:refreshAutoramps`;\n handler: RampsController['refreshAutoramps'];\n};\n\n/**\n * Starts polling all pending V2 orders at a fixed interval.\n * Each poll cycle iterates orders with non-terminal statuses,\n * respects pollingSecondsMinimum and backoff from error count.\n */\nexport type RampsControllerStartOrderPollingAction = {\n type: `RampsController:startOrderPolling`;\n handler: RampsController['startOrderPolling'];\n};\n\n/**\n * Stops order polling and clears the interval.\n */\nexport type RampsControllerStopOrderPollingAction = {\n type: `RampsController:stopOrderPolling`;\n handler: RampsController['stopOrderPolling'];\n};\n\n/**\n * Fetches the widget data from a quote for redirect providers.\n * Makes a request to the buyURL endpoint via the RampsService to get the\n * actual provider widget URL and optional order ID for polling.\n *\n * @param quote - The quote to fetch the widget URL from.\n * @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).\n * @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.\n */\nexport type RampsControllerGetBuyWidgetDataAction = {\n type: `RampsController:getBuyWidgetData`;\n handler: RampsController['getBuyWidgetData'];\n};\n\n/**\n * Registers an order ID for polling until the order is created or resolved.\n * Adds a minimal stub order to controller state; the existing order polling\n * will fetch the full order when the provider has created it.\n *\n * @param params - Object containing order identifiers and wallet info.\n * @param params.orderId - Full order ID (e.g. \"/providers/paypal/orders/abc123\") or order code.\n * @param params.providerCode - Canonical provider code (e.g. \"paypal\", \"transak\").\n * @param params.walletAddress - Wallet address for the order.\n * @param params.chainId - Chain ID for the order (decimal, hex, or CAIP-2). Must be non-empty.\n */\nexport type RampsControllerAddPrecreatedOrderAction = {\n type: `RampsController:addPrecreatedOrder`;\n handler: RampsController['addPrecreatedOrder'];\n};\n\n/**\n * Fetches an order from the unified V2 API endpoint.\n * Returns a normalized RampsOrder for all provider types (aggregator and native).\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"transak-native\", \"moonpay\").\n * @param orderCode - The order identifier.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderAction = {\n type: `RampsController:getOrder`;\n handler: RampsController['getOrder'];\n};\n\n/**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 backend for provider-specific parsing,\n * then fetches the full order. This is the V2 equivalent of the aggregator\n * SDK's `getOrderFromCallback`.\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"moonpay\").\n * @param callbackUrl - The full callback URL the provider redirected to.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderFromCallbackAction = {\n type: `RampsController:getOrderFromCallback`;\n handler: RampsController['getOrderFromCallback'];\n};\n\n/**\n * Sets the Transak API key used for all Transak API requests.\n *\n * @param apiKey - The Transak API key.\n */\nexport type RampsControllerTransakSetApiKeyAction = {\n type: `RampsController:transakSetApiKey`;\n handler: RampsController['transakSetApiKey'];\n};\n\n/**\n * Sets the Transak access token and marks the user as authenticated.\n *\n * @param token - The access token received from Transak auth.\n */\nexport type RampsControllerTransakSetAccessTokenAction = {\n type: `RampsController:transakSetAccessToken`;\n handler: RampsController['transakSetAccessToken'];\n};\n\n/**\n * Clears the Transak access token and marks the user as unauthenticated.\n */\nexport type RampsControllerTransakClearAccessTokenAction = {\n type: `RampsController:transakClearAccessToken`;\n handler: RampsController['transakClearAccessToken'];\n};\n\n/**\n * Updates the Transak authentication flag in controller state.\n *\n * @param isAuthenticated - Whether the user is authenticated with Transak.\n */\nexport type RampsControllerTransakSetAuthenticatedAction = {\n type: `RampsController:transakSetAuthenticated`;\n handler: RampsController['transakSetAuthenticated'];\n};\n\n/**\n * Resets all Transak state back to defaults (unauthenticated, no data).\n */\nexport type RampsControllerTransakResetStateAction = {\n type: `RampsController:transakResetState`;\n handler: RampsController['transakResetState'];\n};\n\n/**\n * Sends a one-time password to the user's email for Transak authentication.\n *\n * @param email - The user's email address.\n * @returns The OTP response containing a state token for verification.\n */\nexport type RampsControllerTransakSendUserOtpAction = {\n type: `RampsController:transakSendUserOtp`;\n handler: RampsController['transakSendUserOtp'];\n};\n\n/**\n * Verifies a one-time password and authenticates the user with Transak.\n * Updates the controller's authentication state on success.\n *\n * @param email - The user's email address.\n * @param verificationCode - The OTP code entered by the user.\n * @param stateToken - The state token from the sendUserOtp response.\n * @returns The access token for subsequent authenticated requests.\n */\nexport type RampsControllerTransakVerifyUserOtpAction = {\n type: `RampsController:transakVerifyUserOtp`;\n handler: RampsController['transakVerifyUserOtp'];\n};\n\n/**\n * Logs the user out of Transak. Clears authentication state and user details\n * regardless of whether the API call succeeds or fails.\n *\n * @returns A message indicating the logout result.\n */\nexport type RampsControllerTransakLogoutAction = {\n type: `RampsController:transakLogout`;\n handler: RampsController['transakLogout'];\n};\n\n/**\n * Fetches the authenticated user's details from Transak.\n * Updates the userDetails resource state with loading/success/error states.\n *\n * @returns The user's profile and KYC details.\n */\nexport type RampsControllerTransakGetUserDetailsAction = {\n type: `RampsController:transakGetUserDetails`;\n handler: RampsController['transakGetUserDetails'];\n};\n\n/**\n * Fetches a buy quote from Transak for the given parameters.\n * Updates the buyQuote resource state with loading/success/error states.\n *\n * @param fiatCurrency - The fiat currency code (e.g., \"USD\").\n * @param cryptoCurrency - The cryptocurrency identifier.\n * @param network - The blockchain network identifier.\n * @param paymentMethod - The payment method identifier.\n * @param fiatAmount - The fiat amount as a string.\n * @param isFeeExcludedFromFiat - Whether fees are added to the fiat amount.\n * Defaults to true to preserve Unified Buy's native Transak behavior.\n * @returns The buy quote with pricing and fee details.\n */\nexport type RampsControllerTransakGetBuyQuoteAction = {\n type: `RampsController:transakGetBuyQuote`;\n handler: RampsController['transakGetBuyQuote'];\n};\n\n/**\n * Fetches the KYC requirement for a given quote.\n * Updates the kycRequirement resource state with loading/success/error states.\n *\n * @param quoteId - The quote ID to check KYC requirements for.\n * @returns The KYC requirement status and whether the user can place an order.\n */\nexport type RampsControllerTransakGetKycRequirementAction = {\n type: `RampsController:transakGetKycRequirement`;\n handler: RampsController['transakGetKycRequirement'];\n};\n\n/**\n * Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.\n *\n * @param quoteId - The quote ID to check additional requirements for.\n * @returns The list of additional forms required.\n */\nexport type RampsControllerTransakGetAdditionalRequirementsAction = {\n type: `RampsController:transakGetAdditionalRequirements`;\n handler: RampsController['transakGetAdditionalRequirements'];\n};\n\n/**\n * Creates a new order on Transak. If an existing order conflicts (HTTP 409),\n * active orders are cancelled and the creation is retried.\n *\n * @param quoteId - The quote ID to create an order from.\n * @param walletAddress - The destination wallet address.\n * @param paymentMethodId - The payment method to use.\n * @returns The created deposit order.\n */\nexport type RampsControllerTransakCreateOrderAction = {\n type: `RampsController:transakCreateOrder`;\n handler: RampsController['transakCreateOrder'];\n};\n\n/**\n * Fetches an existing order from Transak by order ID.\n *\n * @param orderId - The order ID (deposit format or raw Transak format).\n * @param wallet - The wallet address associated with the order.\n * @param paymentDetails - Optional payment details to attach to the order.\n * @returns The deposit order details.\n */\nexport type RampsControllerTransakGetOrderAction = {\n type: `RampsController:transakGetOrder`;\n handler: RampsController['transakGetOrder'];\n};\n\n/**\n * Fetches the user's spending limits for a given currency and payment method.\n *\n * @param fiatCurrency - The fiat currency code.\n * @param paymentMethod - The payment method identifier.\n * @param kycType - The KYC level type.\n * @returns The user's limits, spending, and remaining amounts.\n */\nexport type RampsControllerTransakGetUserLimitsAction = {\n type: `RampsController:transakGetUserLimits`;\n handler: RampsController['transakGetUserLimits'];\n};\n\n/**\n * Requests a one-time token (OTT) for the Transak payment widget.\n *\n * @returns The OTT response containing the token.\n */\nexport type RampsControllerTransakRequestOttAction = {\n type: `RampsController:transakRequestOtt`;\n handler: RampsController['transakRequestOtt'];\n};\n\n/**\n * Generates a URL for the Transak payment widget with pre-filled parameters.\n *\n * @param ottToken - The one-time token for widget authentication.\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional URL parameters.\n * @returns The fully constructed widget URL string.\n */\nexport type RampsControllerTransakGeneratePaymentWidgetUrlAction = {\n type: `RampsController:transakGeneratePaymentWidgetUrl`;\n handler: RampsController['transakGeneratePaymentWidgetUrl'];\n};\n\n/**\n * Creates a Transak payment widget URL via the ramps API proxy, which\n * injects the partner API key server-side. Replaces the OTT flow\n * ({@link transakRequestOtt} + {@link transakGeneratePaymentWidgetUrl}).\n *\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional widget parameters (e.g. theming).\n * @returns The single-use widget URL.\n */\nexport type RampsControllerTransakCreateWidgetUrlAction = {\n type: `RampsController:transakCreateWidgetUrl`;\n handler: RampsController['transakCreateWidgetUrl'];\n};\n\n/**\n * Submits the user's purpose of usage form for KYC compliance.\n *\n * @param purpose - Array of purpose strings selected by the user.\n * @returns A promise that resolves when the form is submitted.\n */\nexport type RampsControllerTransakSubmitPurposeOfUsageFormAction = {\n type: `RampsController:transakSubmitPurposeOfUsageForm`;\n handler: RampsController['transakSubmitPurposeOfUsageForm'];\n};\n\n/**\n * Updates the user's personal or address details on Transak.\n *\n * @param data - The user data fields to update.\n * @returns The API response data.\n */\nexport type RampsControllerTransakPatchUserAction = {\n type: `RampsController:transakPatchUser`;\n handler: RampsController['transakPatchUser'];\n};\n\n/**\n * Submits the user's SSN for identity verification.\n *\n * @param ssn - The Social Security Number.\n * @param quoteId - The quote ID associated with the order requiring SSN.\n * @returns The API response data.\n */\nexport type RampsControllerTransakSubmitSsnDetailsAction = {\n type: `RampsController:transakSubmitSsnDetails`;\n handler: RampsController['transakSubmitSsnDetails'];\n};\n\n/**\n * Confirms payment for an order after the user has completed payment.\n *\n * @param orderId - The order ID to confirm payment for.\n * @param paymentMethodId - The payment method used.\n * @returns Whether the payment confirmation was successful.\n */\nexport type RampsControllerTransakConfirmPaymentAction = {\n type: `RampsController:transakConfirmPayment`;\n handler: RampsController['transakConfirmPayment'];\n};\n\n/**\n * Translates generic ramps identifiers to Transak-specific identifiers.\n *\n * @param request - The translation request with optional identifiers to translate.\n * @returns The translated Transak-specific identifiers.\n */\nexport type RampsControllerTransakGetTranslationAction = {\n type: `RampsController:transakGetTranslation`;\n handler: RampsController['transakGetTranslation'];\n};\n\n/**\n * Checks the status of an ID proof submission for KYC.\n *\n * @param workFlowRunId - The workflow run ID to check status for.\n * @returns The current ID proof status.\n */\nexport type RampsControllerTransakGetIdProofStatusAction = {\n type: `RampsController:transakGetIdProofStatus`;\n handler: RampsController['transakGetIdProofStatus'];\n};\n\n/**\n * Cancels a specific Transak order.\n *\n * @param depositOrderId - The deposit order ID to cancel.\n * @returns A promise that resolves when the order is cancelled.\n */\nexport type RampsControllerTransakCancelOrderAction = {\n type: `RampsController:transakCancelOrder`;\n handler: RampsController['transakCancelOrder'];\n};\n\n/**\n * Cancels all active Transak orders. Individual cancellation failures\n * are collected and returned rather than thrown.\n *\n * @returns An array of errors from any failed cancellations (empty if all succeeded).\n */\nexport type RampsControllerTransakCancelAllActiveOrdersAction = {\n type: `RampsController:transakCancelAllActiveOrders`;\n handler: RampsController['transakCancelAllActiveOrders'];\n};\n\n/**\n * Fetches all active Transak orders for the authenticated user.\n *\n * @returns The list of active orders.\n */\nexport type RampsControllerTransakGetActiveOrdersAction = {\n type: `RampsController:transakGetActiveOrders`;\n handler: RampsController['transakGetActiveOrders'];\n};\n\n/**\n * Union of all RampsController action types.\n */\nexport type RampsControllerMethodActions =\n | RampsControllerExecuteRequestAction\n | RampsControllerAbortRequestAction\n | RampsControllerGetRequestStateAction\n | RampsControllerSetUserRegionAction\n | RampsControllerSetSelectedProviderAction\n | RampsControllerSetSelectedProviderForAssetAction\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 | RampsControllerSyncOrdersWithUserStorageAction\n | RampsControllerAddAutorampAction\n | RampsControllerCreateAutorampAction\n | RampsControllerRegisterMoneyAccountWalletAction\n | RampsControllerRemoveAutorampAction\n | RampsControllerMarkAutorampAsNotifiedAction\n | RampsControllerApplyAutorampStatusFromPushAction\n | RampsControllerRefreshAutorampAction\n | RampsControllerRefreshAutorampsAction\n | RampsControllerStartOrderPollingAction\n | RampsControllerStopOrderPollingAction\n | RampsControllerGetBuyWidgetDataAction\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 | RampsControllerTransakCreateWidgetUrlAction\n | RampsControllerTransakSubmitPurposeOfUsageFormAction\n | RampsControllerTransakPatchUserAction\n | RampsControllerTransakSubmitSsnDetailsAction\n | RampsControllerTransakConfirmPaymentAction\n | RampsControllerTransakGetTranslationAction\n | RampsControllerTransakGetIdProofStatusAction\n | RampsControllerTransakCancelOrderAction\n | RampsControllerTransakCancelAllActiveOrdersAction\n | RampsControllerTransakGetActiveOrdersAction;\n"]}
1
+ {"version":3,"file":"RampsController-method-action-types.js","sourceRoot":"","sources":["../src/RampsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { RampsController } from './RampsController.js';\n\n/**\n * Executes a request with caching, deduplication, and at most one in-flight\n * request per resource type.\n *\n * 1. **Same cache key in flight** – If a request with this cache key is\n * already pending, returns that promise (deduplication; no second request).\n *\n * 2. **Cache hit** – If valid, non-expired data exists in state.requests for\n * this key and forceRefresh is not set, returns that data without fetching.\n *\n * 3. **New request** – Creates an AbortController and fires the fetcher.\n * If options.resourceType is set, tags the pending request with that\n * resource type (so #abortDependentRequests can cancel it on region\n * change or cleanup) and ref-counts resource-level loading state.\n * On success or error, updates request state and resource error;\n * in finally, clears resource loading only if this request was not\n * aborted.\n *\n * @param cacheKey - Unique identifier for this request (e.g. from createCacheKey).\n * @param fetcher - Async function that performs the fetch. Receives an AbortSignal\n * that is aborted when this request is superseded by another for the same resource.\n * @param options - Optional forceRefresh, ttl, and resourceType for loading/error state.\n * @returns The result of the request (from cache, joined promise, or fetcher).\n */\nexport type RampsControllerExecuteRequestAction = {\n type: `RampsController:executeRequest`;\n handler: RampsController['executeRequest'];\n};\n\n/**\n * Aborts a pending request if one exists.\n *\n * @param cacheKey - The cache key of the request to abort.\n * @returns True if a request was aborted.\n */\nexport type RampsControllerAbortRequestAction = {\n type: `RampsController:abortRequest`;\n handler: RampsController['abortRequest'];\n};\n\n/**\n * Gets the state of a specific cached request.\n *\n * @param cacheKey - The cache key to look up.\n * @returns The request state, or undefined if not cached.\n */\nexport type RampsControllerGetRequestStateAction = {\n type: `RampsController:getRequestState`;\n handler: RampsController['getRequestState'];\n};\n\n/**\n * Sets the user's region manually (without fetching geolocation).\n * This allows users to override the detected region.\n *\n * @param region - The region code to set (e.g., \"US-CA\").\n * @param options - Options for cache behavior.\n * @returns The user region object.\n */\nexport type RampsControllerSetUserRegionAction = {\n type: `RampsController:setUserRegion`;\n handler: RampsController['setUserRegion'];\n};\n\n/**\n * Sets the user's selected provider.\n *\n * Accepts either a Provider object (stored directly) or a provider ID\n * string (looked up from state). The object form is preferred when the\n * caller already has the full data (e.g. from React Query cache).\n *\n * @param providerOrId - A Provider object, a provider ID string (e.g., \"/providers/moonpay\"), or null to clear.\n * @param options - Optional settings for the selection.\n * @param options.autoSelected - When true, marks the provider as system-guessed\n * (soft selection). The UI will silently auto-switch on token conflict instead\n * of showing the \"Token Not Available\" modal. Defaults to false.\n */\nexport type RampsControllerSetSelectedProviderAction = {\n type: `RampsController:setSelectedProvider`;\n handler: RampsController['setSelectedProvider'];\n};\n\n/**\n * Switches to the first provider in state that serves the given asset,\n * when the currently selected provider does not.\n *\n * This is the controller-level equivalent of UB2's BuildQuote tier-1\n * silent-switch effect and MMPay's `useEnsureCompatibleProvider` hook: it\n * keeps provider-asset compatibility logic in one place rather than\n * duplicating `providerServesAsset` + find-and-switch across multiple UI\n * layers.\n *\n * The compatibility check prefers the current provider's entry in\n * `providers.data` over the `providers.selected` copy, which can be stale\n * once a fresh providers list arrives.\n *\n * No-op when:\n * - `providers.data` is empty (providers not yet loaded)\n * - the currently selected provider already serves the asset\n * - no provider in the list serves the asset (no safe fallback)\n *\n * @param assetId - CAIP-19 asset id of the deposit asset.\n * @param options - Optional settings forwarded to `setSelectedProvider`.\n * @param options.autoSelected - When true, marks the new selection as\n * system-guessed (soft selection). Defaults to true.\n * @returns `true` if the selected provider was changed, `false` otherwise.\n */\nexport type RampsControllerSetSelectedProviderForAssetAction = {\n type: `RampsController:setSelectedProviderForAsset`;\n handler: RampsController['setSelectedProviderForAsset'];\n};\n\n/**\n * Initializes the controller by fetching the user's region from geolocation.\n * This should be called once at app startup to set up the initial region.\n *\n * Idempotent: subsequent calls return the same promise unless forceRefresh is set.\n * Force-refetches the countries catalog on startup (bypassing the in-session\n * request cache) so region preset amounts stay current. The catalog is not\n * persisted, so a cold start always re-fetches it regardless. Skips\n * geolocation when userRegion already exists.\n *\n * @param options - Options for cache behavior. forceRefresh bypasses idempotency and re-runs the full flow.\n * @returns Promise that resolves when initialization is complete.\n */\nexport type RampsControllerInitAction = {\n type: `RampsController:init`;\n handler: RampsController['init'];\n};\n\n/**\n * Fetches the list of supported countries.\n * The API returns countries with support information for both buy and sell actions.\n * The countries are saved in the controller state once fetched.\n *\n * @param options - Options for cache behavior.\n * @returns An array of countries.\n */\nexport type RampsControllerGetCountriesAction = {\n type: `RampsController:getCountries`;\n handler: RampsController['getCountries'];\n};\n\n/**\n * Fetches the list of available tokens for a given region and action.\n * The tokens are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param action - The ramp action type ('buy' or 'sell').\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @returns The tokens response containing topTokens and allTokens.\n */\nexport type RampsControllerGetTokensAction = {\n type: `RampsController:getTokens`;\n handler: RampsController['getTokens'];\n};\n\n/**\n * Sets the user's selected token by asset ID.\n * Looks up the token from the current tokens in state and automatically\n * fetches payment methods for that token.\n *\n * @param assetId - The asset identifier in CAIP-19 format (e.g., \"eip155:1/erc20:0x...\"), or undefined to clear.\n * @throws If region is not set, tokens are not loaded, or token is not found.\n */\nexport type RampsControllerSetSelectedTokenAction = {\n type: `RampsController:setSelectedToken`;\n handler: RampsController['setSelectedToken'];\n};\n\n/**\n * Fetches the list of providers for a given region.\n * The providers are saved in the controller state once fetched.\n *\n * @param region - The region code (e.g., \"us\", \"fr\", \"us-ny\"). If not provided, uses the user's region from controller state.\n * @param options - Options for cache behavior and query filters.\n * @param options.provider - Provider ID(s) to filter by.\n * @param options.crypto - Crypto currency ID(s) to filter by.\n * @param options.payments - Payment method ID(s) to filter by.\n * @returns The providers response containing providers array.\n */\nexport type RampsControllerGetProvidersAction = {\n type: `RampsController:getProviders`;\n handler: RampsController['getProviders'];\n};\n\n/**\n * Fetches the list of payment methods for a given context.\n * The payment methods are saved in the controller state once fetched.\n *\n * @param region - User's region code (e.g. \"fr\", \"us-ny\").\n * @param options - Query parameters for filtering payment methods.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.provider - Provider ID path.\n * @returns The payment methods response containing payments array.\n */\nexport type RampsControllerGetPaymentMethodsAction = {\n type: `RampsController:getPaymentMethods`;\n handler: RampsController['getPaymentMethods'];\n};\n\n/**\n * Fetches payment methods for a quoting context without coupling callers to\n * the Buy flow's globally selected provider/token catalog.\n *\n * Provider contribution mirrors {@link getQuotes}:\n * - explicit `providers` (optionally filtered when\n * `restrictToKnownOrNativeProviders` is set)\n * - auto-select / restrict path, including `moneyHeadlessAllProviders`\n * widening: flag off uses the restricted/native resolver; flag on uses\n * supporting providers, intersected with the flag allowlist when that\n * allowlist is non-empty (pick-survivor set for picker methods)\n * - when those resolution flags and `providers` are omitted, uses only\n * `providers.selected` (UB2 selected-provider context)\n *\n * By default this is request-only: it does **not** mutate\n * `paymentMethods.data` or `paymentMethods.selected`. Pass `updateState:\n * true` only when the caller explicitly wants Buy-catalog write semantics\n * (UB2). Headless / MM Pay selection stays TPC-owned. `updateState: true`\n * throws when the resolved provider set holds more than one provider, because\n * the write guards cannot tell two such requests apart.\n *\n * Methods are request-eligible for the resolved provider set; they are not\n * guaranteed to produce a quote for every amount (provider fiat limits still\n * apply at quote time).\n *\n * @param options - Context for the payment-method fetch.\n * @param options.region - Region code. Defaults to `userRegion`.\n * @param options.assetId - Required CAIP-19 quoting asset.\n * @param options.providers - Explicit provider ids.\n * @param options.autoSelectProvider - Resolve providers like `getQuotes`.\n * @param options.preferredProviderIds - Preferred ids for auto-selection.\n * @param options.restrictToKnownOrNativeProviders - Headless gating.\n * @param options.updateState - When true, write `paymentMethods` state.\n * @param options.preferPaymentMethodId - Preserve this id when still present.\n * @param options.forceRefresh - Bypass request cache for provider fetches.\n * @param options.ttl - Custom TTL for provider payment-method fetches.\n * @returns Deduped methods, a request-only suggested selection, and the\n * provider ids that contributed.\n */\nexport type RampsControllerGetPaymentMethodsForContextAction = {\n type: `RampsController:getPaymentMethodsForContext`;\n handler: RampsController['getPaymentMethodsForContext'];\n};\n\n/**\n * Sets the user's selected payment method.\n *\n * Accepts either a payment method ID (looked up from state) or a full\n * PaymentMethod object (stored directly). The object form is preferred\n * when the caller already has the full data (e.g. from React Query cache),\n * as it avoids depending on controller state being populated.\n *\n * @param paymentMethodOrId - A PaymentMethod object, a payment method ID string, or undefined/null to clear.\n */\nexport type RampsControllerSetSelectedPaymentMethodAction = {\n type: `RampsController:setSelectedPaymentMethod`;\n handler: RampsController['setSelectedPaymentMethod'];\n};\n\n/**\n * Fetches quotes from all providers for a given set of parameters.\n * Uses the controller's request cache; callers manage the response in local state.\n *\n * @param options - The parameters for fetching quotes.\n * @param options.region - User's region code. If not provided, uses userRegion from state.\n * @param options.fiat - Fiat currency code. If not provided, uses userRegion currency.\n * @param options.assetId - CAIP-19 cryptocurrency identifier.\n * @param options.amount - The amount (in fiat for buy, crypto for sell).\n * @param options.walletAddress - The destination wallet address.\n * @param options.paymentMethods - Array of payment method IDs. If not provided, uses paymentMethods from state.\n * @param options.providers - Optional provider IDs to filter quotes.\n * @param options.autoSelectProvider - When true and `providers` is omitted,\n * resolves a provider that supports `assetId` for this request only (no\n * state mutation). Ignored when `providers` is passed.\n * @param options.preferredProviderIds - Optional provider IDs to prefer\n * during auto-selection, in priority order (e.g. derived by the caller\n * from completed-order history). Only used when `autoSelectProvider` is\n * true and `providers` is omitted.\n * @param options.restrictToKnownOrNativeProviders - Headless-buy v0 gating. When\n * true, auto-selection resolves only a native provider, and an explicitly\n * passed `providers` list is filtered to those supporting the region and\n * asset. If nothing qualifies, `getQuotes` returns an empty response\n * instead of quoting other providers.\n * @param options.redirectUrl - Optional redirect URL after order completion.\n * @param options.action - The ramp action type. Defaults to 'buy'.\n * @param options.forceRefresh - Whether to bypass cache.\n * @param options.ttl - Custom TTL for this request.\n * @returns The quotes response containing success, sorted, error, and customActions.\n */\nexport type RampsControllerGetQuotesAction = {\n type: `RampsController:getQuotes`;\n handler: RampsController['getQuotes'];\n};\n\n/**\n * Fetches the best on-ramp quote for a request and, when the resolved\n * provider is Transak Native, reconciles its fees to match what Transak\n * Native actually charges.\n *\n * The aggregator `/quotes` estimate of Transak's fee does not match the\n * native integration. When the resolved provider is Transak Native this\n * fetches the native buy quote (an unauthenticated, API-key-only lookup, so\n * it is safe at estimate time) and rewrites the returned quote's fee fields\n * to its `totalFee`, keeping the aggregator's `networkFee` on the network\n * line and placing the remainder in the provider fee so the breakdown\n * survives and `providerFee + networkFee` still equals the native total. A\n * non-native provider, a failed lookup, or an unusable native fee returns the\n * aggregator quote unchanged.\n *\n * Consumers (e.g. `TransactionPayController`) call this instead of owning the\n * provider check, asset-id parsing, and second native quote themselves.\n *\n * @param options - Quote options; see {@link getQuotes}, plus the fee mode.\n * @param options.amount - Fiat amount for the quote.\n * @param options.assetId - CAIP-19 asset id being bought.\n * @param options.fiat - Optional fiat currency; defaults like {@link getQuotes}.\n * @param options.paymentMethods - Optional payment method ids.\n * @param options.walletAddress - Wallet address receiving the on-ramped asset.\n * @param options.isFeeExcludedFromFiat - Whether Transak adds its fee on top\n * of the fiat amount (`true`, fee-on-top) or carves it out (`false`). Must\n * mirror the eventual checkout mode so the estimate equals the charge.\n * Defaults to `true`.\n * @param options.providers - See {@link getQuotes}.\n * @param options.autoSelectProvider - See {@link getQuotes}.\n * @param options.restrictToKnownOrNativeProviders - See {@link getQuotes}.\n * @param options.preferredProviderIds - See {@link getQuotes}.\n * @param options.region - See {@link getQuotes}.\n * @param options.redirectUrl - See {@link getQuotes}.\n * @param options.action - See {@link getQuotes}.\n * @param options.forceRefresh - See {@link getQuotes}.\n * @param options.ttl - See {@link getQuotes}.\n * @returns The best quote with native-reconciled fees, or `undefined` when\n * no quote is available.\n */\nexport type RampsControllerGetQuoteWithFeesAction = {\n type: `RampsController:getQuoteWithFees`;\n handler: RampsController['getQuoteWithFees'];\n};\n\n/**\n * Adds or updates a V2 order in controller state.\n * If an order with the same internal order code already exists, the incoming\n * fields are merged on top of the existing order so that fields not present\n * in the update (e.g. paymentDetails from the Transak API) are preserved.\n * Unchanged syncable payloads (including unchanged poll results) are ignored\n * so `lastUpdatedAt` is not bumped and User Storage is not rewritten.\n *\n * @param order - The RampsOrder to add or update.\n */\nexport type RampsControllerAddOrderAction = {\n type: `RampsController:addOrder`;\n handler: RampsController['addOrder'];\n};\n\n/**\n * Removes a V2 order from controller state by providerOrderId.\n *\n * @param providerOrderId - The provider order ID to remove.\n */\nexport type RampsControllerRemoveOrderAction = {\n type: `RampsController:removeOrder`;\n handler: RampsController['removeOrder'];\n};\n\n/**\n * Bidirectionally syncs V2 ramps orders with User Storage.\n * Hosts should call this on unlock / when ramps syncing is enabled.\n *\n * Overlapping calls are coalesced into the in-flight worker. After the worker\n * settles, this method loops when `#orderSyncQueued` is still set so a\n * request that arrived between the worker's last loop check and promise\n * resolution is not dropped.\n */\nexport type RampsControllerSyncOrdersWithUserStorageAction = {\n type: `RampsController:syncOrdersWithUserStorage`;\n handler: RampsController['syncOrdersWithUserStorage'];\n};\n\n/**\n * Adds or updates a local autoramp last-seen cursor (e.g. after create).\n *\n * @param accountOrInput - Full account or create fields.\n * @returns The upserted {@link AutorampAccount}.\n */\nexport type RampsControllerAddAutorampAction = {\n type: `RampsController:addAutoramp`;\n handler: RampsController['addAutoramp'];\n};\n\n/**\n * Creates an autoramp via the neo-bank proxy and applies the returned\n * snapshot as the local last-seen cursor.\n *\n * The vendor `customer_id` is resolved via\n * {@link RampsController.resolveAutorampCustomerId} and injected into the\n * request (any caller-supplied `customer_id` is overwritten).\n *\n * @param request - CreateAutoramp payload.\n * @param options - Optional idempotency key forwarded to the proxy.\n * @param options.idempotencyKey - Value sent as `Idempotency-Key`.\n * @returns The created/updated local {@link AutorampAccount}.\n */\nexport type RampsControllerCreateAutorampAction = {\n type: `RampsController:createAutoramp`;\n handler: RampsController['createAutoramp'];\n};\n\n/**\n * Registers a Money Account wallet with MoonPay Iron via neobank-proxy.\n *\n * @param params - Money Account wallet registration parameters.\n * @param params.address - Monad Money Account address.\n * @returns The registration state, or `{ type: 'lookupUnavailable' }` when\n * the address-list lookup fails (never treated as unregistered).\n */\nexport type RampsControllerRegisterMoneyAccountWalletAction = {\n type: `RampsController:registerMoneyAccountWallet`;\n handler: RampsController['registerMoneyAccountWallet'];\n};\n\n/**\n * Refreshes KYC session facts and, when Iron has approved KYC, activates the\n * Money Account (wallet registration + autoramp). Hosts map the returned\n * {@link VbaOnboardingSnapshot} onto their own funnel; this method does not\n * name screens.\n *\n * Overlapping calls share one run so polling cannot trigger duplicate wallet\n * signatures or autoramp creation.\n *\n * @param params - VBA onboarding parameters.\n * @param params.walletAddress - Monad Money Account wallet address.\n * @returns Independent KYC and autoramp facts for the current customer.\n */\nexport type RampsControllerHydrateVbaOnboardingAction = {\n type: `RampsController:hydrateVbaOnboarding`;\n handler: RampsController['hydrateVbaOnboarding'];\n};\n\n/**\n * Removes a local autoramp last-seen cursor by id.\n *\n * @param autorampId - MoonPay autoramp id.\n */\nexport type RampsControllerRemoveAutorampAction = {\n type: `RampsController:removeAutoramp`;\n handler: RampsController['removeAutoramp'];\n};\n\n/**\n * Marks that the UI has already notified for the autoramp's current status.\n *\n * @param autorampId - MoonPay autoramp id.\n */\nexport type RampsControllerMarkAutorampAsNotifiedAction = {\n type: `RampsController:markAutorampAsNotified`;\n handler: RampsController['markAutorampAsNotified'];\n};\n\n/**\n * Applies a remote autoramp snapshot from a websocket / webhook push.\n *\n * @param remote - Remote autoramp snapshot.\n * @returns The updated local account.\n */\nexport type RampsControllerApplyAutorampStatusFromPushAction = {\n type: `RampsController:applyAutorampStatusFromPush`;\n handler: RampsController['applyAutorampStatusFromPush'];\n};\n\n/**\n * Fetches one autoramp from the neo-bank proxy and applies it to the\n * last-seen cursor. Does not recreate a cursor that was removed while the\n * request was in flight.\n *\n * @param autorampId - MoonPay autoramp id.\n * @returns The updated local account, or an unpersisted snapshot if the\n * cursor was removed during the fetch.\n */\nexport type RampsControllerRefreshAutorampAction = {\n type: `RampsController:refreshAutoramp`;\n handler: RampsController['refreshAutoramp'];\n};\n\n/**\n * Refreshes all known local autoramps from MoonPay.\n * Intended for app resume / unlock catch-up when webhooks were missed.\n *\n * @returns Updated autoramp accounts (failed fetches are skipped).\n */\nexport type RampsControllerRefreshAutorampsAction = {\n type: `RampsController:refreshAutoramps`;\n handler: RampsController['refreshAutoramps'];\n};\n\n/**\n * Starts polling all pending V2 orders at a fixed interval.\n * Each poll cycle iterates orders with non-terminal statuses,\n * respects pollingSecondsMinimum and backoff from error count.\n */\nexport type RampsControllerStartOrderPollingAction = {\n type: `RampsController:startOrderPolling`;\n handler: RampsController['startOrderPolling'];\n};\n\n/**\n * Stops order polling and clears the interval.\n */\nexport type RampsControllerStopOrderPollingAction = {\n type: `RampsController:stopOrderPolling`;\n handler: RampsController['stopOrderPolling'];\n};\n\n/**\n * Fetches the widget data from a quote for redirect providers.\n * Makes a request to the buyURL endpoint via the RampsService to get the\n * actual provider widget URL and optional order ID for polling.\n *\n * @param quote - The quote to fetch the widget URL from.\n * @returns Promise resolving to the full BuyWidget (url, browser, orderId), or null if not available (missing buyURL or empty url in response).\n * @throws Rethrows errors from the RampsService (e.g. HttpError, network failures) so clients can react to fetch failures.\n */\nexport type RampsControllerGetBuyWidgetDataAction = {\n type: `RampsController:getBuyWidgetData`;\n handler: RampsController['getBuyWidgetData'];\n};\n\n/**\n * Registers an order ID for polling until the order is created or resolved.\n * Adds a minimal stub order to controller state; the existing order polling\n * will fetch the full order when the provider has created it.\n *\n * @param params - Object containing order identifiers and wallet info.\n * @param params.orderId - Full order ID (e.g. \"/providers/paypal/orders/abc123\") or order code.\n * @param params.providerCode - Canonical provider code (e.g. \"paypal\", \"transak\").\n * @param params.walletAddress - Wallet address for the order.\n * @param params.chainId - Chain ID for the order (decimal, hex, or CAIP-2). Must be non-empty.\n */\nexport type RampsControllerAddPrecreatedOrderAction = {\n type: `RampsController:addPrecreatedOrder`;\n handler: RampsController['addPrecreatedOrder'];\n};\n\n/**\n * Fetches an order from the unified V2 API endpoint.\n * Returns a normalized RampsOrder for all provider types (aggregator and native).\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"transak-native\", \"moonpay\").\n * @param orderCode - The order identifier.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderAction = {\n type: `RampsController:getOrder`;\n handler: RampsController['getOrder'];\n};\n\n/**\n * Extracts an order from a provider callback URL.\n * Sends the callback URL to the V2 backend for provider-specific parsing,\n * then fetches the full order. This is the V2 equivalent of the aggregator\n * SDK's `getOrderFromCallback`.\n *\n * @param providerCode - The provider code (e.g., \"transak\", \"moonpay\").\n * @param callbackUrl - The full callback URL the provider redirected to.\n * @param wallet - The wallet address associated with the order.\n * @returns The unified order data.\n */\nexport type RampsControllerGetOrderFromCallbackAction = {\n type: `RampsController:getOrderFromCallback`;\n handler: RampsController['getOrderFromCallback'];\n};\n\n/**\n * Sets the Transak API key used for all Transak API requests.\n *\n * @param apiKey - The Transak API key.\n */\nexport type RampsControllerTransakSetApiKeyAction = {\n type: `RampsController:transakSetApiKey`;\n handler: RampsController['transakSetApiKey'];\n};\n\n/**\n * Sets the Transak access token and marks the user as authenticated.\n *\n * @param token - The access token received from Transak auth.\n */\nexport type RampsControllerTransakSetAccessTokenAction = {\n type: `RampsController:transakSetAccessToken`;\n handler: RampsController['transakSetAccessToken'];\n};\n\n/**\n * Clears the Transak access token and marks the user as unauthenticated.\n */\nexport type RampsControllerTransakClearAccessTokenAction = {\n type: `RampsController:transakClearAccessToken`;\n handler: RampsController['transakClearAccessToken'];\n};\n\n/**\n * Updates the Transak authentication flag in controller state.\n *\n * @param isAuthenticated - Whether the user is authenticated with Transak.\n */\nexport type RampsControllerTransakSetAuthenticatedAction = {\n type: `RampsController:transakSetAuthenticated`;\n handler: RampsController['transakSetAuthenticated'];\n};\n\n/**\n * Resets all Transak state back to defaults (unauthenticated, no data).\n */\nexport type RampsControllerTransakResetStateAction = {\n type: `RampsController:transakResetState`;\n handler: RampsController['transakResetState'];\n};\n\n/**\n * Sends a one-time password to the user's email for Transak authentication.\n *\n * @param email - The user's email address.\n * @returns The OTP response containing a state token for verification.\n */\nexport type RampsControllerTransakSendUserOtpAction = {\n type: `RampsController:transakSendUserOtp`;\n handler: RampsController['transakSendUserOtp'];\n};\n\n/**\n * Verifies a one-time password and authenticates the user with Transak.\n * Updates the controller's authentication state on success.\n *\n * @param email - The user's email address.\n * @param verificationCode - The OTP code entered by the user.\n * @param stateToken - The state token from the sendUserOtp response.\n * @returns The access token for subsequent authenticated requests.\n */\nexport type RampsControllerTransakVerifyUserOtpAction = {\n type: `RampsController:transakVerifyUserOtp`;\n handler: RampsController['transakVerifyUserOtp'];\n};\n\n/**\n * Logs the user out of Transak. Clears authentication state and user details\n * regardless of whether the API call succeeds or fails.\n *\n * @returns A message indicating the logout result.\n */\nexport type RampsControllerTransakLogoutAction = {\n type: `RampsController:transakLogout`;\n handler: RampsController['transakLogout'];\n};\n\n/**\n * Fetches the authenticated user's details from Transak.\n * Updates the userDetails resource state with loading/success/error states.\n *\n * @returns The user's profile and KYC details.\n */\nexport type RampsControllerTransakGetUserDetailsAction = {\n type: `RampsController:transakGetUserDetails`;\n handler: RampsController['transakGetUserDetails'];\n};\n\n/**\n * Fetches a buy quote from Transak for the given parameters.\n * Updates the buyQuote resource state with loading/success/error states.\n *\n * @param fiatCurrency - The fiat currency code (e.g., \"USD\").\n * @param cryptoCurrency - The cryptocurrency identifier.\n * @param network - The blockchain network identifier.\n * @param paymentMethod - The payment method identifier.\n * @param fiatAmount - The fiat amount as a string.\n * @param isFeeExcludedFromFiat - Whether fees are added to the fiat amount.\n * Defaults to true to preserve Unified Buy's native Transak behavior.\n * @returns The buy quote with pricing and fee details.\n */\nexport type RampsControllerTransakGetBuyQuoteAction = {\n type: `RampsController:transakGetBuyQuote`;\n handler: RampsController['transakGetBuyQuote'];\n};\n\n/**\n * Fetches the KYC requirement for a given quote.\n * Updates the kycRequirement resource state with loading/success/error states.\n *\n * @param quoteId - The quote ID to check KYC requirements for.\n * @returns The KYC requirement status and whether the user can place an order.\n */\nexport type RampsControllerTransakGetKycRequirementAction = {\n type: `RampsController:transakGetKycRequirement`;\n handler: RampsController['transakGetKycRequirement'];\n};\n\n/**\n * Fetches additional KYC requirements (e.g., ID proof, address proof) for a quote.\n *\n * @param quoteId - The quote ID to check additional requirements for.\n * @returns The list of additional forms required.\n */\nexport type RampsControllerTransakGetAdditionalRequirementsAction = {\n type: `RampsController:transakGetAdditionalRequirements`;\n handler: RampsController['transakGetAdditionalRequirements'];\n};\n\n/**\n * Creates a new order on Transak. If an existing order conflicts (HTTP 409),\n * active orders are cancelled and the creation is retried.\n *\n * @param quoteId - The quote ID to create an order from.\n * @param walletAddress - The destination wallet address.\n * @param paymentMethodId - The payment method to use.\n * @returns The created deposit order.\n */\nexport type RampsControllerTransakCreateOrderAction = {\n type: `RampsController:transakCreateOrder`;\n handler: RampsController['transakCreateOrder'];\n};\n\n/**\n * Fetches an existing order from Transak by order ID.\n *\n * @param orderId - The order ID (deposit format or raw Transak format).\n * @param wallet - The wallet address associated with the order.\n * @param paymentDetails - Optional payment details to attach to the order.\n * @returns The deposit order details.\n */\nexport type RampsControllerTransakGetOrderAction = {\n type: `RampsController:transakGetOrder`;\n handler: RampsController['transakGetOrder'];\n};\n\n/**\n * Fetches the user's spending limits for a given currency and payment method.\n *\n * @param fiatCurrency - The fiat currency code.\n * @param paymentMethod - The payment method identifier.\n * @param kycType - The KYC level type.\n * @returns The user's limits, spending, and remaining amounts.\n */\nexport type RampsControllerTransakGetUserLimitsAction = {\n type: `RampsController:transakGetUserLimits`;\n handler: RampsController['transakGetUserLimits'];\n};\n\n/**\n * Requests a one-time token (OTT) for the Transak payment widget.\n *\n * @returns The OTT response containing the token.\n */\nexport type RampsControllerTransakRequestOttAction = {\n type: `RampsController:transakRequestOtt`;\n handler: RampsController['transakRequestOtt'];\n};\n\n/**\n * Generates a URL for the Transak payment widget with pre-filled parameters.\n *\n * @param ottToken - The one-time token for widget authentication.\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional URL parameters.\n * @returns The fully constructed widget URL string.\n */\nexport type RampsControllerTransakGeneratePaymentWidgetUrlAction = {\n type: `RampsController:transakGeneratePaymentWidgetUrl`;\n handler: RampsController['transakGeneratePaymentWidgetUrl'];\n};\n\n/**\n * Creates a Transak payment widget URL via the ramps API proxy, which\n * injects the partner API key server-side. Replaces the OTT flow\n * ({@link transakRequestOtt} + {@link transakGeneratePaymentWidgetUrl}).\n *\n * @param quote - The buy quote to pre-fill in the widget.\n * @param walletAddress - The destination wallet address.\n * @param extraParams - Optional additional widget parameters (e.g. theming).\n * @returns The single-use widget URL.\n */\nexport type RampsControllerTransakCreateWidgetUrlAction = {\n type: `RampsController:transakCreateWidgetUrl`;\n handler: RampsController['transakCreateWidgetUrl'];\n};\n\n/**\n * Submits the user's purpose of usage form for KYC compliance.\n *\n * @param purpose - Array of purpose strings selected by the user.\n * @returns A promise that resolves when the form is submitted.\n */\nexport type RampsControllerTransakSubmitPurposeOfUsageFormAction = {\n type: `RampsController:transakSubmitPurposeOfUsageForm`;\n handler: RampsController['transakSubmitPurposeOfUsageForm'];\n};\n\n/**\n * Updates the user's personal or address details on Transak.\n *\n * @param data - The user data fields to update.\n * @returns The API response data.\n */\nexport type RampsControllerTransakPatchUserAction = {\n type: `RampsController:transakPatchUser`;\n handler: RampsController['transakPatchUser'];\n};\n\n/**\n * Submits the user's SSN for identity verification.\n *\n * @param ssn - The Social Security Number.\n * @param quoteId - The quote ID associated with the order requiring SSN.\n * @returns The API response data.\n */\nexport type RampsControllerTransakSubmitSsnDetailsAction = {\n type: `RampsController:transakSubmitSsnDetails`;\n handler: RampsController['transakSubmitSsnDetails'];\n};\n\n/**\n * Confirms payment for an order after the user has completed payment.\n *\n * @param orderId - The order ID to confirm payment for.\n * @param paymentMethodId - The payment method used.\n * @returns Whether the payment confirmation was successful.\n */\nexport type RampsControllerTransakConfirmPaymentAction = {\n type: `RampsController:transakConfirmPayment`;\n handler: RampsController['transakConfirmPayment'];\n};\n\n/**\n * Translates generic ramps identifiers to Transak-specific identifiers.\n *\n * @param request - The translation request with optional identifiers to translate.\n * @returns The translated Transak-specific identifiers.\n */\nexport type RampsControllerTransakGetTranslationAction = {\n type: `RampsController:transakGetTranslation`;\n handler: RampsController['transakGetTranslation'];\n};\n\n/**\n * Checks the status of an ID proof submission for KYC.\n *\n * @param workFlowRunId - The workflow run ID to check status for.\n * @returns The current ID proof status.\n */\nexport type RampsControllerTransakGetIdProofStatusAction = {\n type: `RampsController:transakGetIdProofStatus`;\n handler: RampsController['transakGetIdProofStatus'];\n};\n\n/**\n * Cancels a specific Transak order.\n *\n * @param depositOrderId - The deposit order ID to cancel.\n * @returns A promise that resolves when the order is cancelled.\n */\nexport type RampsControllerTransakCancelOrderAction = {\n type: `RampsController:transakCancelOrder`;\n handler: RampsController['transakCancelOrder'];\n};\n\n/**\n * Cancels all active Transak orders. Individual cancellation failures\n * are collected and returned rather than thrown.\n *\n * @returns An array of errors from any failed cancellations (empty if all succeeded).\n */\nexport type RampsControllerTransakCancelAllActiveOrdersAction = {\n type: `RampsController:transakCancelAllActiveOrders`;\n handler: RampsController['transakCancelAllActiveOrders'];\n};\n\n/**\n * Fetches all active Transak orders for the authenticated user.\n *\n * @returns The list of active orders.\n */\nexport type RampsControllerTransakGetActiveOrdersAction = {\n type: `RampsController:transakGetActiveOrders`;\n handler: RampsController['transakGetActiveOrders'];\n};\n\n/**\n * Union of all RampsController action types.\n */\nexport type RampsControllerMethodActions =\n | RampsControllerExecuteRequestAction\n | RampsControllerAbortRequestAction\n | RampsControllerGetRequestStateAction\n | RampsControllerSetUserRegionAction\n | RampsControllerSetSelectedProviderAction\n | RampsControllerSetSelectedProviderForAssetAction\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 | RampsControllerSyncOrdersWithUserStorageAction\n | RampsControllerAddAutorampAction\n | RampsControllerCreateAutorampAction\n | RampsControllerRegisterMoneyAccountWalletAction\n | RampsControllerHydrateVbaOnboardingAction\n | RampsControllerRemoveAutorampAction\n | RampsControllerMarkAutorampAsNotifiedAction\n | RampsControllerApplyAutorampStatusFromPushAction\n | RampsControllerRefreshAutorampAction\n | RampsControllerRefreshAutorampsAction\n | RampsControllerStartOrderPollingAction\n | RampsControllerStopOrderPollingAction\n | RampsControllerGetBuyWidgetDataAction\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 | RampsControllerTransakCreateWidgetUrlAction\n | RampsControllerTransakSubmitPurposeOfUsageFormAction\n | RampsControllerTransakPatchUserAction\n | RampsControllerTransakSubmitSsnDetailsAction\n | RampsControllerTransakConfirmPaymentAction\n | RampsControllerTransakGetTranslationAction\n | RampsControllerTransakGetIdProofStatusAction\n | RampsControllerTransakCancelOrderAction\n | RampsControllerTransakCancelAllActiveOrdersAction\n | RampsControllerTransakGetActiveOrdersAction;\n"]}