@metamask-previews/transaction-pay-controller 26.3.0-preview-6b4bcdab3 → 26.3.0-preview-4758e65ff

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +1 -13
  2. package/dist/TransactionPayController-method-action-types.cjs.map +1 -1
  3. package/dist/TransactionPayController-method-action-types.d.cts +1 -31
  4. package/dist/TransactionPayController-method-action-types.d.cts.map +1 -1
  5. package/dist/TransactionPayController-method-action-types.d.mts +1 -31
  6. package/dist/TransactionPayController-method-action-types.d.mts.map +1 -1
  7. package/dist/TransactionPayController-method-action-types.mjs.map +1 -1
  8. package/dist/TransactionPayController.cjs +2 -74
  9. package/dist/TransactionPayController.cjs.map +1 -1
  10. package/dist/TransactionPayController.d.cts +0 -29
  11. package/dist/TransactionPayController.d.cts.map +1 -1
  12. package/dist/TransactionPayController.d.mts +0 -29
  13. package/dist/TransactionPayController.d.mts.map +1 -1
  14. package/dist/TransactionPayController.mjs +2 -74
  15. package/dist/TransactionPayController.mjs.map +1 -1
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +1 -4
  18. package/dist/index.d.cts.map +1 -1
  19. package/dist/index.d.mts +1 -4
  20. package/dist/index.d.mts.map +1 -1
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/strategy/fiat/FiatStrategy.cjs +0 -3
  23. package/dist/strategy/fiat/FiatStrategy.cjs.map +1 -1
  24. package/dist/strategy/fiat/FiatStrategy.d.cts.map +1 -1
  25. package/dist/strategy/fiat/FiatStrategy.d.mts.map +1 -1
  26. package/dist/strategy/fiat/FiatStrategy.mjs +0 -3
  27. package/dist/strategy/fiat/FiatStrategy.mjs.map +1 -1
  28. package/dist/strategy/fiat/fiat-direct-musd.cjs.map +1 -1
  29. package/dist/strategy/fiat/fiat-direct-musd.d.cts +3 -2
  30. package/dist/strategy/fiat/fiat-direct-musd.d.cts.map +1 -1
  31. package/dist/strategy/fiat/fiat-direct-musd.d.mts +3 -2
  32. package/dist/strategy/fiat/fiat-direct-musd.d.mts.map +1 -1
  33. package/dist/strategy/fiat/fiat-direct-musd.mjs.map +1 -1
  34. package/dist/strategy/fiat/fiat-submit.cjs +0 -3
  35. package/dist/strategy/fiat/fiat-submit.cjs.map +1 -1
  36. package/dist/strategy/fiat/fiat-submit.d.cts.map +1 -1
  37. package/dist/strategy/fiat/fiat-submit.d.mts.map +1 -1
  38. package/dist/strategy/fiat/fiat-submit.mjs +0 -3
  39. package/dist/strategy/fiat/fiat-submit.mjs.map +1 -1
  40. package/dist/tests/messenger-mock.cjs +0 -3
  41. package/dist/tests/messenger-mock.cjs.map +1 -1
  42. package/dist/tests/messenger-mock.d.cts +0 -1
  43. package/dist/tests/messenger-mock.d.cts.map +1 -1
  44. package/dist/tests/messenger-mock.d.mts +0 -1
  45. package/dist/tests/messenger-mock.d.mts.map +1 -1
  46. package/dist/tests/messenger-mock.mjs +0 -3
  47. package/dist/tests/messenger-mock.mjs.map +1 -1
  48. package/dist/types.cjs.map +1 -1
  49. package/dist/types.d.cts +1 -11
  50. package/dist/types.d.cts.map +1 -1
  51. package/dist/types.d.mts +1 -11
  52. package/dist/types.d.mts.map +1 -1
  53. package/dist/types.mjs.map +1 -1
  54. package/dist/utils/chomp.cjs +5 -37
  55. package/dist/utils/chomp.cjs.map +1 -1
  56. package/dist/utils/chomp.d.cts +1 -15
  57. package/dist/utils/chomp.d.cts.map +1 -1
  58. package/dist/utils/chomp.d.mts +1 -15
  59. package/dist/utils/chomp.d.mts.map +1 -1
  60. package/dist/utils/chomp.mjs +5 -37
  61. package/dist/utils/chomp.mjs.map +1 -1
  62. package/dist/utils/ma-vault-deposit.cjs +16 -58
  63. package/dist/utils/ma-vault-deposit.cjs.map +1 -1
  64. package/dist/utils/ma-vault-deposit.d.cts +5 -33
  65. package/dist/utils/ma-vault-deposit.d.cts.map +1 -1
  66. package/dist/utils/ma-vault-deposit.d.mts +5 -33
  67. package/dist/utils/ma-vault-deposit.d.mts.map +1 -1
  68. package/dist/utils/ma-vault-deposit.mjs +14 -55
  69. package/dist/utils/ma-vault-deposit.mjs.map +1 -1
  70. package/package.json +1 -2
  71. package/dist/utils/ma-vault-payout.cjs +0 -57
  72. package/dist/utils/ma-vault-payout.cjs.map +0 -1
  73. package/dist/utils/ma-vault-payout.d.cts +0 -18
  74. package/dist/utils/ma-vault-payout.d.cts.map +0 -1
  75. package/dist/utils/ma-vault-payout.d.mts +0 -18
  76. package/dist/utils/ma-vault-payout.d.mts.map +0 -1
  77. package/dist/utils/ma-vault-payout.mjs +0 -53
  78. package/dist/utils/ma-vault-payout.mjs.map +0 -1
  79. package/dist/utils/ma-vault-withdraw.cjs +0 -80
  80. package/dist/utils/ma-vault-withdraw.cjs.map +0 -1
  81. package/dist/utils/ma-vault-withdraw.d.cts +0 -22
  82. package/dist/utils/ma-vault-withdraw.d.cts.map +0 -1
  83. package/dist/utils/ma-vault-withdraw.d.mts +0 -22
  84. package/dist/utils/ma-vault-withdraw.d.mts.map +0 -1
  85. package/dist/utils/ma-vault-withdraw.mjs +0 -76
  86. package/dist/utils/ma-vault-withdraw.mjs.map +0 -1
  87. package/dist/utils/money-account-vault-config.cjs +0 -62
  88. package/dist/utils/money-account-vault-config.cjs.map +0 -1
  89. package/dist/utils/money-account-vault-config.d.cts +0 -27
  90. package/dist/utils/money-account-vault-config.d.cts.map +0 -1
  91. package/dist/utils/money-account-vault-config.d.mts +0 -27
  92. package/dist/utils/money-account-vault-config.d.mts.map +0 -1
  93. package/dist/utils/money-account-vault-config.mjs +0 -57
  94. package/dist/utils/money-account-vault-config.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,21 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Added
11
-
12
- - Add `TransactionPayController:submitMoneyAccountVaultDeposit` action to vault a completed mUSD payout into the Money Account vault, resolving the deposit amount from the payout transaction hash ([#9849](https://github.com/MetaMask/core/pull/9849), [#9853](https://github.com/MetaMask/core/pull/9853))
13
- - Add `TransactionPayController:submitMoneyAccountVaultWithdraw` action to redeem vmUSD and transfer the resulting mUSD to a given recipient in a single atomic, user-confirmed batch ([#9849](https://github.com/MetaMask/core/pull/9849), [#9853](https://github.com/MetaMask/core/pull/9853))
14
-
15
10
  ### Changed
16
11
 
17
- - Slim `SubmitMoneyAccountVaultWithdrawRequest` to on-chain fields only (`amountInRaw`, `moneyAccountAddress`, `recipient`, `requestId`); quote / chain / token validation stays outside Core ([#9849](https://github.com/MetaMask/core/pull/9849), [#9853](https://github.com/MetaMask/core/pull/9853))
18
- - Return `{ skipped: true }` from Money Account vault deposit helpers when vaulting is disabled instead of a fake `0x` transaction hash ([#9849](https://github.com/MetaMask/core/pull/9849), [#9853](https://github.com/MetaMask/core/pull/9853))
19
- - Bump `@metamask/transaction-controller` from `^69.5.1` to `^69.5.2` ([#9823](https://github.com/MetaMask/core/pull/9823), [#9853](https://github.com/MetaMask/core/pull/9853))
20
-
21
- ### Fixed
22
-
23
- - Persist successful Money Account vault deposit and withdraw results for the controller lifetime so retries / webhook replays do not re-submit or open a second approval. Skipped results (vaulting disabled) are not retained, so a later enablement can retry the same payout hash. ([#9849](https://github.com/MetaMask/core/pull/9849), [#9861](https://github.com/MetaMask/core/pull/9861), [#9853](https://github.com/MetaMask/core/pull/9853))
24
- - Match CHOMP vault deposits only when mUSD is transferred to the boring vault with an exact source amount ([#9849](https://github.com/MetaMask/core/pull/9849), [#9853](https://github.com/MetaMask/core/pull/9853))
12
+ - Bump `@metamask/transaction-controller` from `^69.5.1` to `^69.5.2` ([#9823](https://github.com/MetaMask/core/pull/9823))
25
13
 
26
14
  ## [26.3.0]
27
15
 
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionPayController-method-action-types.cjs","sourceRoot":"","sources":["../src/TransactionPayController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { TransactionPayController } from './TransactionPayController.js';\n\n/**\n * Sets the transaction configuration.\n *\n * The callback receives the current configuration properties and can mutate\n * them in place. Updated values are written back to the transaction data.\n *\n * @param transactionId - The ID of the transaction to configure.\n * @param callback - A callback that receives a mutable {@link TransactionConfig} object.\n */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `TransactionPayController:setTransactionConfig`;\n handler: TransactionPayController['setTransactionConfig'];\n};\n\n/**\n * Updates the payment token for a transaction.\n *\n * Resolves token metadata and balances, then stores the new payment token\n * in the transaction data. This triggers recalculation of source amounts\n * and quote retrieval.\n *\n * @param request - The payment token update request containing the\n * transaction ID, token address, and chain ID.\n */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `TransactionPayController:updatePaymentToken`;\n handler: TransactionPayController['updatePaymentToken'];\n};\n\n/**\n * Updates the fiat payment state for a transaction.\n *\n * The request callback receives the current fiat payment state and can\n * mutate it to update properties such as the selected payment method or\n * fiat amount.\n *\n * @param request - The fiat payment update request containing the\n * transaction ID and a callback to mutate fiat payment state.\n */\nexport type TransactionPayControllerUpdateFiatPaymentAction = {\n type: `TransactionPayController:updateFiatPayment`;\n handler: TransactionPayController['updateFiatPayment'];\n};\n\n/**\n * Vaults mUSD received in a completed Iron payout transaction.\n *\n * Concurrent calls for the same payout hash share one in-flight submission.\n * Successful results are retained for the controller lifetime so retries\n * return the prior hash without submitting again. Skipped results (vaulting\n * disabled) are not retained, so a later enablement can retry the same hash.\n *\n * @param request - Completed Iron payout details.\n * @returns Hash of the confirmed vault transaction, or `{ skipped: true }`\n * when vaulting is disabled.\n */\nexport type TransactionPayControllerSubmitMoneyAccountVaultDepositAction = {\n type: `TransactionPayController:submitMoneyAccountVaultDeposit`;\n handler: TransactionPayController['submitMoneyAccountVaultDeposit'];\n};\n\n/**\n * Creates a user-confirmed exact-out vmUSD withdrawal to Iron.\n *\n * Concurrent calls with the same request ID share one in-flight batch setup.\n * Successful batch results are retained so a later call returns the same\n * `batchId` without creating another approval.\n *\n * @param request - Backend-bound exact-out Iron intent.\n * @returns Pending transaction batch ID.\n */\nexport type TransactionPayControllerSubmitMoneyAccountVaultWithdrawAction = {\n type: `TransactionPayController:submitMoneyAccountVaultWithdraw`;\n handler: TransactionPayController['submitMoneyAccountVaultWithdraw'];\n};\n\n/**\n * Gets the delegation transaction for a given transaction.\n *\n * Converts the provided transaction into a redeem delegation by delegating\n * to the configured callback. Returns the delegation transaction data\n * including the encoded call data, target address, value, and an optional\n * authorization list.\n *\n * @param args - The arguments forwarded to the {@link GetDelegationTransactionCallback},\n * containing the transaction metadata.\n * @returns A promise resolving to the delegation transaction data.\n */\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `TransactionPayController:getDelegationTransaction`;\n handler: TransactionPayController['getDelegationTransaction'];\n};\n\n/**\n * Returns additional transactions for the paymentOverride flow.\n *\n * Delegates to the client-supplied {@link GetPaymentOverrideDataCallback}.\n * Called during quote execution when `paymentOverride` is defined on the transaction.\n * Returns an empty array when no callback is configured.\n *\n * @param args - The arguments forwarded to the {@link GetPaymentOverrideDataCallback}.\n * @returns A promise resolving to the additional transactions array.\n */\nexport type TransactionPayControllerGetAmountDataAction = {\n type: `TransactionPayController:getAmountData`;\n handler: TransactionPayController['getAmountData'];\n};\n\n/**\n * Returns optional fiat execution configuration.\n *\n * This is intentionally not stored in controller state.\n *\n * @returns Fiat execution options, if configured.\n */\nexport type TransactionPayControllerGetFiatOptionsAction = {\n type: `TransactionPayController:getFiatOptions`;\n handler: TransactionPayController['getFiatOptions'];\n};\n\nexport type TransactionPayControllerGetPaymentOverrideDataAction = {\n type: `TransactionPayController:getPaymentOverrideData`;\n handler: TransactionPayController['getPaymentOverrideData'];\n};\n\n/**\n * Gets the preferred strategy for a transaction.\n *\n * Returns the first strategy from the ordered list of strategies applicable\n * to the given transaction. Falls back to the default strategy order derived\n * from feature flags when no custom strategy callback is configured.\n *\n * @param transaction - The transaction metadata to determine the strategy for.\n * @returns The preferred {@link TransactionPayStrategy} for the transaction.\n */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `TransactionPayController:getStrategy`;\n handler: TransactionPayController['getStrategy'];\n};\n\n/**\n * Derives the Polymarket deposit-wallet address for an EOA via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.getDepositWalletAddress}.\n * @returns A promise resolving to the deposit-wallet address.\n */\nexport type TransactionPayControllerPolymarketGetDepositWalletAddressAction = {\n type: `TransactionPayController:polymarketGetDepositWalletAddress`;\n handler: TransactionPayController['polymarketGetDepositWalletAddress'];\n};\n\n/**\n * Signs and broadcasts a Polymarket deposit-wallet batch via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.submitDepositWalletBatch}.\n * @returns A promise resolving to the relayer-issued source hash.\n */\nexport type TransactionPayControllerPolymarketSubmitDepositWalletBatchAction = {\n type: `TransactionPayController:polymarketSubmitDepositWalletBatch`;\n handler: TransactionPayController['polymarketSubmitDepositWalletBatch'];\n};\n\n/**\n * Union of all TransactionPayController action types.\n */\nexport type TransactionPayControllerMethodActions =\n | TransactionPayControllerSetTransactionConfigAction\n | TransactionPayControllerUpdatePaymentTokenAction\n | TransactionPayControllerUpdateFiatPaymentAction\n | TransactionPayControllerSubmitMoneyAccountVaultDepositAction\n | TransactionPayControllerSubmitMoneyAccountVaultWithdrawAction\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetAmountDataAction\n | TransactionPayControllerGetFiatOptionsAction\n | TransactionPayControllerGetPaymentOverrideDataAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerPolymarketGetDepositWalletAddressAction\n | TransactionPayControllerPolymarketSubmitDepositWalletBatchAction;\n"]}
1
+ {"version":3,"file":"TransactionPayController-method-action-types.cjs","sourceRoot":"","sources":["../src/TransactionPayController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { TransactionPayController } from './TransactionPayController.js';\n\n/**\n * Sets the transaction configuration.\n *\n * The callback receives the current configuration properties and can mutate\n * them in place. Updated values are written back to the transaction data.\n *\n * @param transactionId - The ID of the transaction to configure.\n * @param callback - A callback that receives a mutable {@link TransactionConfig} object.\n */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `TransactionPayController:setTransactionConfig`;\n handler: TransactionPayController['setTransactionConfig'];\n};\n\n/**\n * Updates the payment token for a transaction.\n *\n * Resolves token metadata and balances, then stores the new payment token\n * in the transaction data. This triggers recalculation of source amounts\n * and quote retrieval.\n *\n * @param request - The payment token update request containing the\n * transaction ID, token address, and chain ID.\n */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `TransactionPayController:updatePaymentToken`;\n handler: TransactionPayController['updatePaymentToken'];\n};\n\n/**\n * Updates the fiat payment state for a transaction.\n *\n * The request callback receives the current fiat payment state and can\n * mutate it to update properties such as the selected payment method or\n * fiat amount.\n *\n * @param request - The fiat payment update request containing the\n * transaction ID and a callback to mutate fiat payment state.\n */\nexport type TransactionPayControllerUpdateFiatPaymentAction = {\n type: `TransactionPayController:updateFiatPayment`;\n handler: TransactionPayController['updateFiatPayment'];\n};\n\n/**\n * Gets the delegation transaction for a given transaction.\n *\n * Converts the provided transaction into a redeem delegation by delegating\n * to the configured callback. Returns the delegation transaction data\n * including the encoded call data, target address, value, and an optional\n * authorization list.\n *\n * @param args - The arguments forwarded to the {@link GetDelegationTransactionCallback},\n * containing the transaction metadata.\n * @returns A promise resolving to the delegation transaction data.\n */\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `TransactionPayController:getDelegationTransaction`;\n handler: TransactionPayController['getDelegationTransaction'];\n};\n\n/**\n * Returns additional transactions for the paymentOverride flow.\n *\n * Delegates to the client-supplied {@link GetPaymentOverrideDataCallback}.\n * Called during quote execution when `paymentOverride` is defined on the transaction.\n * Returns an empty array when no callback is configured.\n *\n * @param args - The arguments forwarded to the {@link GetPaymentOverrideDataCallback}.\n * @returns A promise resolving to the additional transactions array.\n */\nexport type TransactionPayControllerGetAmountDataAction = {\n type: `TransactionPayController:getAmountData`;\n handler: TransactionPayController['getAmountData'];\n};\n\n/**\n * Returns optional fiat execution configuration.\n *\n * This is intentionally not stored in controller state.\n *\n * @returns Fiat execution options, if configured.\n */\nexport type TransactionPayControllerGetFiatOptionsAction = {\n type: `TransactionPayController:getFiatOptions`;\n handler: TransactionPayController['getFiatOptions'];\n};\n\nexport type TransactionPayControllerGetPaymentOverrideDataAction = {\n type: `TransactionPayController:getPaymentOverrideData`;\n handler: TransactionPayController['getPaymentOverrideData'];\n};\n\n/**\n * Gets the preferred strategy for a transaction.\n *\n * Returns the first strategy from the ordered list of strategies applicable\n * to the given transaction. Falls back to the default strategy order derived\n * from feature flags when no custom strategy callback is configured.\n *\n * @param transaction - The transaction metadata to determine the strategy for.\n * @returns The preferred {@link TransactionPayStrategy} for the transaction.\n */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `TransactionPayController:getStrategy`;\n handler: TransactionPayController['getStrategy'];\n};\n\n/**\n * Derives the Polymarket deposit-wallet address for an EOA via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.getDepositWalletAddress}.\n * @returns A promise resolving to the deposit-wallet address.\n */\nexport type TransactionPayControllerPolymarketGetDepositWalletAddressAction = {\n type: `TransactionPayController:polymarketGetDepositWalletAddress`;\n handler: TransactionPayController['polymarketGetDepositWalletAddress'];\n};\n\n/**\n * Signs and broadcasts a Polymarket deposit-wallet batch via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.submitDepositWalletBatch}.\n * @returns A promise resolving to the relayer-issued source hash.\n */\nexport type TransactionPayControllerPolymarketSubmitDepositWalletBatchAction = {\n type: `TransactionPayController:polymarketSubmitDepositWalletBatch`;\n handler: TransactionPayController['polymarketSubmitDepositWalletBatch'];\n};\n\n/**\n * Union of all TransactionPayController action types.\n */\nexport type TransactionPayControllerMethodActions =\n | TransactionPayControllerSetTransactionConfigAction\n | TransactionPayControllerUpdatePaymentTokenAction\n | TransactionPayControllerUpdateFiatPaymentAction\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetAmountDataAction\n | TransactionPayControllerGetFiatOptionsAction\n | TransactionPayControllerGetPaymentOverrideDataAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerPolymarketGetDepositWalletAddressAction\n | TransactionPayControllerPolymarketSubmitDepositWalletBatchAction;\n"]}
@@ -44,36 +44,6 @@ export type TransactionPayControllerUpdateFiatPaymentAction = {
44
44
  type: `TransactionPayController:updateFiatPayment`;
45
45
  handler: TransactionPayController['updateFiatPayment'];
46
46
  };
47
- /**
48
- * Vaults mUSD received in a completed Iron payout transaction.
49
- *
50
- * Concurrent calls for the same payout hash share one in-flight submission.
51
- * Successful results are retained for the controller lifetime so retries
52
- * return the prior hash without submitting again. Skipped results (vaulting
53
- * disabled) are not retained, so a later enablement can retry the same hash.
54
- *
55
- * @param request - Completed Iron payout details.
56
- * @returns Hash of the confirmed vault transaction, or `{ skipped: true }`
57
- * when vaulting is disabled.
58
- */
59
- export type TransactionPayControllerSubmitMoneyAccountVaultDepositAction = {
60
- type: `TransactionPayController:submitMoneyAccountVaultDeposit`;
61
- handler: TransactionPayController['submitMoneyAccountVaultDeposit'];
62
- };
63
- /**
64
- * Creates a user-confirmed exact-out vmUSD withdrawal to Iron.
65
- *
66
- * Concurrent calls with the same request ID share one in-flight batch setup.
67
- * Successful batch results are retained so a later call returns the same
68
- * `batchId` without creating another approval.
69
- *
70
- * @param request - Backend-bound exact-out Iron intent.
71
- * @returns Pending transaction batch ID.
72
- */
73
- export type TransactionPayControllerSubmitMoneyAccountVaultWithdrawAction = {
74
- type: `TransactionPayController:submitMoneyAccountVaultWithdraw`;
75
- handler: TransactionPayController['submitMoneyAccountVaultWithdraw'];
76
- };
77
47
  /**
78
48
  * Gets the delegation transaction for a given transaction.
79
49
  *
@@ -158,5 +128,5 @@ export type TransactionPayControllerPolymarketSubmitDepositWalletBatchAction = {
158
128
  /**
159
129
  * Union of all TransactionPayController action types.
160
130
  */
161
- export type TransactionPayControllerMethodActions = TransactionPayControllerSetTransactionConfigAction | TransactionPayControllerUpdatePaymentTokenAction | TransactionPayControllerUpdateFiatPaymentAction | TransactionPayControllerSubmitMoneyAccountVaultDepositAction | TransactionPayControllerSubmitMoneyAccountVaultWithdrawAction | TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetAmountDataAction | TransactionPayControllerGetFiatOptionsAction | TransactionPayControllerGetPaymentOverrideDataAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerPolymarketGetDepositWalletAddressAction | TransactionPayControllerPolymarketSubmitDepositWalletBatchAction;
131
+ export type TransactionPayControllerMethodActions = TransactionPayControllerSetTransactionConfigAction | TransactionPayControllerUpdatePaymentTokenAction | TransactionPayControllerUpdateFiatPaymentAction | TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetAmountDataAction | TransactionPayControllerGetFiatOptionsAction | TransactionPayControllerGetPaymentOverrideDataAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerPolymarketGetDepositWalletAddressAction | TransactionPayControllerPolymarketSubmitDepositWalletBatchAction;
162
132
  //# sourceMappingURL=TransactionPayController-method-action-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionPayController-method-action-types.d.cts","sourceRoot":"","sources":["../src/TransactionPayController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAsC;AAE9E;;;;;;;;GAQG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE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AEF;;;;;;GAMG;AACH,MAAM,MAAM,+DAA+D,GAAG;IAC5E,IAAI,EAAE,4DAA4D,CAAC;IACnE,OAAO,EAAE,wBAAwB,CAAC,mCAAmC,CAAC,CAAC;CACxE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gEAAgE,GAAG;IAC7E,IAAI,EAAE,6DAA6D,CAAC;IACpE,OAAO,EAAE,wBAAwB,CAAC,oCAAoC,CAAC,CAAC;CACzE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC7C,kDAAkD,GAClD,gDAAgD,GAChD,+CAA+C,GAC/C,4DAA4D,GAC5D,6DAA6D,GAC7D,sDAAsD,GACtD,2CAA2C,GAC3C,4CAA4C,GAC5C,oDAAoD,GACpD,yCAAyC,GACzC,+DAA+D,GAC/D,gEAAgE,CAAC"}
1
+ {"version":3,"file":"TransactionPayController-method-action-types.d.cts","sourceRoot":"","sources":["../src/TransactionPayController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAsC;AAE9E;;;;;;;;GAQG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sDAAsD,GAAG;IACnE,IAAI,EAAE,mDAAmD,CAAC;IAC1D,OAAO,EAAE,wBAAwB,CAAC,0BAA0B,CAAC,CAAC;CAC/D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,wBAAwB,CAAC,eAAe,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,oDAAoD,GAAG;IACjE,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,wBAAwB,CAAC,wBAAwB,CAAC,CAAC;CAC7D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,wBAAwB,CAAC,aAAa,CAAC,CAAC;CAClD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,+DAA+D,GAAG;IAC5E,IAAI,EAAE,4DAA4D,CAAC;IACnE,OAAO,EAAE,wBAAwB,CAAC,mCAAmC,CAAC,CAAC;CACxE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gEAAgE,GAAG;IAC7E,IAAI,EAAE,6DAA6D,CAAC;IACpE,OAAO,EAAE,wBAAwB,CAAC,oCAAoC,CAAC,CAAC;CACzE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC7C,kDAAkD,GAClD,gDAAgD,GAChD,+CAA+C,GAC/C,sDAAsD,GACtD,2CAA2C,GAC3C,4CAA4C,GAC5C,oDAAoD,GACpD,yCAAyC,GACzC,+DAA+D,GAC/D,gEAAgE,CAAC"}
@@ -44,36 +44,6 @@ export type TransactionPayControllerUpdateFiatPaymentAction = {
44
44
  type: `TransactionPayController:updateFiatPayment`;
45
45
  handler: TransactionPayController['updateFiatPayment'];
46
46
  };
47
- /**
48
- * Vaults mUSD received in a completed Iron payout transaction.
49
- *
50
- * Concurrent calls for the same payout hash share one in-flight submission.
51
- * Successful results are retained for the controller lifetime so retries
52
- * return the prior hash without submitting again. Skipped results (vaulting
53
- * disabled) are not retained, so a later enablement can retry the same hash.
54
- *
55
- * @param request - Completed Iron payout details.
56
- * @returns Hash of the confirmed vault transaction, or `{ skipped: true }`
57
- * when vaulting is disabled.
58
- */
59
- export type TransactionPayControllerSubmitMoneyAccountVaultDepositAction = {
60
- type: `TransactionPayController:submitMoneyAccountVaultDeposit`;
61
- handler: TransactionPayController['submitMoneyAccountVaultDeposit'];
62
- };
63
- /**
64
- * Creates a user-confirmed exact-out vmUSD withdrawal to Iron.
65
- *
66
- * Concurrent calls with the same request ID share one in-flight batch setup.
67
- * Successful batch results are retained so a later call returns the same
68
- * `batchId` without creating another approval.
69
- *
70
- * @param request - Backend-bound exact-out Iron intent.
71
- * @returns Pending transaction batch ID.
72
- */
73
- export type TransactionPayControllerSubmitMoneyAccountVaultWithdrawAction = {
74
- type: `TransactionPayController:submitMoneyAccountVaultWithdraw`;
75
- handler: TransactionPayController['submitMoneyAccountVaultWithdraw'];
76
- };
77
47
  /**
78
48
  * Gets the delegation transaction for a given transaction.
79
49
  *
@@ -158,5 +128,5 @@ export type TransactionPayControllerPolymarketSubmitDepositWalletBatchAction = {
158
128
  /**
159
129
  * Union of all TransactionPayController action types.
160
130
  */
161
- export type TransactionPayControllerMethodActions = TransactionPayControllerSetTransactionConfigAction | TransactionPayControllerUpdatePaymentTokenAction | TransactionPayControllerUpdateFiatPaymentAction | TransactionPayControllerSubmitMoneyAccountVaultDepositAction | TransactionPayControllerSubmitMoneyAccountVaultWithdrawAction | TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetAmountDataAction | TransactionPayControllerGetFiatOptionsAction | TransactionPayControllerGetPaymentOverrideDataAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerPolymarketGetDepositWalletAddressAction | TransactionPayControllerPolymarketSubmitDepositWalletBatchAction;
131
+ export type TransactionPayControllerMethodActions = TransactionPayControllerSetTransactionConfigAction | TransactionPayControllerUpdatePaymentTokenAction | TransactionPayControllerUpdateFiatPaymentAction | TransactionPayControllerGetDelegationTransactionAction | TransactionPayControllerGetAmountDataAction | TransactionPayControllerGetFiatOptionsAction | TransactionPayControllerGetPaymentOverrideDataAction | TransactionPayControllerGetStrategyAction | TransactionPayControllerPolymarketGetDepositWalletAddressAction | TransactionPayControllerPolymarketSubmitDepositWalletBatchAction;
162
132
  //# sourceMappingURL=TransactionPayController-method-action-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionPayController-method-action-types.d.mts","sourceRoot":"","sources":["../src/TransactionPayController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAsC;AAE9E;;;;;;;;GAQG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,4DAA4D,GAAG;IACzE,IAAI,EAAE,yDAAyD,CAAC;IAChE,OAAO,EAAE,wBAAwB,CAAC,gCAAgC,CAAC,CAAC;CACrE,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,6DAA6D,GAAG;IAC1E,IAAI,EAAE,0D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GACtD,2CAA2C,GAC3C,4CAA4C,GAC5C,oDAAoD,GACpD,yCAAyC,GACzC,+DAA+D,GAC/D,gEAAgE,CAAC"}
1
+ {"version":3,"file":"TransactionPayController-method-action-types.d.mts","sourceRoot":"","sources":["../src/TransactionPayController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAsC;AAE9E;;;;;;;;GAQG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sDAAsD,GAAG;IACnE,IAAI,EAAE,mDAAmD,CAAC;IAC1D,OAAO,EAAE,wBAAwB,CAAC,0BAA0B,CAAC,CAAC;CAC/D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,wBAAwB,CAAC,eAAe,CAAC,CAAC;CACpD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,oDAAoD,GAAG;IACjE,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,wBAAwB,CAAC,wBAAwB,CAAC,CAAC;CAC7D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,wBAAwB,CAAC,aAAa,CAAC,CAAC;CAClD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,+DAA+D,GAAG;IAC5E,IAAI,EAAE,4DAA4D,CAAC;IACnE,OAAO,EAAE,wBAAwB,CAAC,mCAAmC,CAAC,CAAC;CACxE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gEAAgE,GAAG;IAC7E,IAAI,EAAE,6DAA6D,CAAC;IACpE,OAAO,EAAE,wBAAwB,CAAC,oCAAoC,CAAC,CAAC;CACzE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC7C,kDAAkD,GAClD,gDAAgD,GAChD,+CAA+C,GAC/C,sDAAsD,GACtD,2CAA2C,GAC3C,4CAA4C,GAC5C,oDAAoD,GACpD,yCAAyC,GACzC,+DAA+D,GAC/D,gEAAgE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionPayController-method-action-types.mjs","sourceRoot":"","sources":["../src/TransactionPayController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { TransactionPayController } from './TransactionPayController.js';\n\n/**\n * Sets the transaction configuration.\n *\n * The callback receives the current configuration properties and can mutate\n * them in place. Updated values are written back to the transaction data.\n *\n * @param transactionId - The ID of the transaction to configure.\n * @param callback - A callback that receives a mutable {@link TransactionConfig} object.\n */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `TransactionPayController:setTransactionConfig`;\n handler: TransactionPayController['setTransactionConfig'];\n};\n\n/**\n * Updates the payment token for a transaction.\n *\n * Resolves token metadata and balances, then stores the new payment token\n * in the transaction data. This triggers recalculation of source amounts\n * and quote retrieval.\n *\n * @param request - The payment token update request containing the\n * transaction ID, token address, and chain ID.\n */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `TransactionPayController:updatePaymentToken`;\n handler: TransactionPayController['updatePaymentToken'];\n};\n\n/**\n * Updates the fiat payment state for a transaction.\n *\n * The request callback receives the current fiat payment state and can\n * mutate it to update properties such as the selected payment method or\n * fiat amount.\n *\n * @param request - The fiat payment update request containing the\n * transaction ID and a callback to mutate fiat payment state.\n */\nexport type TransactionPayControllerUpdateFiatPaymentAction = {\n type: `TransactionPayController:updateFiatPayment`;\n handler: TransactionPayController['updateFiatPayment'];\n};\n\n/**\n * Vaults mUSD received in a completed Iron payout transaction.\n *\n * Concurrent calls for the same payout hash share one in-flight submission.\n * Successful results are retained for the controller lifetime so retries\n * return the prior hash without submitting again. Skipped results (vaulting\n * disabled) are not retained, so a later enablement can retry the same hash.\n *\n * @param request - Completed Iron payout details.\n * @returns Hash of the confirmed vault transaction, or `{ skipped: true }`\n * when vaulting is disabled.\n */\nexport type TransactionPayControllerSubmitMoneyAccountVaultDepositAction = {\n type: `TransactionPayController:submitMoneyAccountVaultDeposit`;\n handler: TransactionPayController['submitMoneyAccountVaultDeposit'];\n};\n\n/**\n * Creates a user-confirmed exact-out vmUSD withdrawal to Iron.\n *\n * Concurrent calls with the same request ID share one in-flight batch setup.\n * Successful batch results are retained so a later call returns the same\n * `batchId` without creating another approval.\n *\n * @param request - Backend-bound exact-out Iron intent.\n * @returns Pending transaction batch ID.\n */\nexport type TransactionPayControllerSubmitMoneyAccountVaultWithdrawAction = {\n type: `TransactionPayController:submitMoneyAccountVaultWithdraw`;\n handler: TransactionPayController['submitMoneyAccountVaultWithdraw'];\n};\n\n/**\n * Gets the delegation transaction for a given transaction.\n *\n * Converts the provided transaction into a redeem delegation by delegating\n * to the configured callback. Returns the delegation transaction data\n * including the encoded call data, target address, value, and an optional\n * authorization list.\n *\n * @param args - The arguments forwarded to the {@link GetDelegationTransactionCallback},\n * containing the transaction metadata.\n * @returns A promise resolving to the delegation transaction data.\n */\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `TransactionPayController:getDelegationTransaction`;\n handler: TransactionPayController['getDelegationTransaction'];\n};\n\n/**\n * Returns additional transactions for the paymentOverride flow.\n *\n * Delegates to the client-supplied {@link GetPaymentOverrideDataCallback}.\n * Called during quote execution when `paymentOverride` is defined on the transaction.\n * Returns an empty array when no callback is configured.\n *\n * @param args - The arguments forwarded to the {@link GetPaymentOverrideDataCallback}.\n * @returns A promise resolving to the additional transactions array.\n */\nexport type TransactionPayControllerGetAmountDataAction = {\n type: `TransactionPayController:getAmountData`;\n handler: TransactionPayController['getAmountData'];\n};\n\n/**\n * Returns optional fiat execution configuration.\n *\n * This is intentionally not stored in controller state.\n *\n * @returns Fiat execution options, if configured.\n */\nexport type TransactionPayControllerGetFiatOptionsAction = {\n type: `TransactionPayController:getFiatOptions`;\n handler: TransactionPayController['getFiatOptions'];\n};\n\nexport type TransactionPayControllerGetPaymentOverrideDataAction = {\n type: `TransactionPayController:getPaymentOverrideData`;\n handler: TransactionPayController['getPaymentOverrideData'];\n};\n\n/**\n * Gets the preferred strategy for a transaction.\n *\n * Returns the first strategy from the ordered list of strategies applicable\n * to the given transaction. Falls back to the default strategy order derived\n * from feature flags when no custom strategy callback is configured.\n *\n * @param transaction - The transaction metadata to determine the strategy for.\n * @returns The preferred {@link TransactionPayStrategy} for the transaction.\n */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `TransactionPayController:getStrategy`;\n handler: TransactionPayController['getStrategy'];\n};\n\n/**\n * Derives the Polymarket deposit-wallet address for an EOA via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.getDepositWalletAddress}.\n * @returns A promise resolving to the deposit-wallet address.\n */\nexport type TransactionPayControllerPolymarketGetDepositWalletAddressAction = {\n type: `TransactionPayController:polymarketGetDepositWalletAddress`;\n handler: TransactionPayController['polymarketGetDepositWalletAddress'];\n};\n\n/**\n * Signs and broadcasts a Polymarket deposit-wallet batch via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.submitDepositWalletBatch}.\n * @returns A promise resolving to the relayer-issued source hash.\n */\nexport type TransactionPayControllerPolymarketSubmitDepositWalletBatchAction = {\n type: `TransactionPayController:polymarketSubmitDepositWalletBatch`;\n handler: TransactionPayController['polymarketSubmitDepositWalletBatch'];\n};\n\n/**\n * Union of all TransactionPayController action types.\n */\nexport type TransactionPayControllerMethodActions =\n | TransactionPayControllerSetTransactionConfigAction\n | TransactionPayControllerUpdatePaymentTokenAction\n | TransactionPayControllerUpdateFiatPaymentAction\n | TransactionPayControllerSubmitMoneyAccountVaultDepositAction\n | TransactionPayControllerSubmitMoneyAccountVaultWithdrawAction\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetAmountDataAction\n | TransactionPayControllerGetFiatOptionsAction\n | TransactionPayControllerGetPaymentOverrideDataAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerPolymarketGetDepositWalletAddressAction\n | TransactionPayControllerPolymarketSubmitDepositWalletBatchAction;\n"]}
1
+ {"version":3,"file":"TransactionPayController-method-action-types.mjs","sourceRoot":"","sources":["../src/TransactionPayController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { TransactionPayController } from './TransactionPayController.js';\n\n/**\n * Sets the transaction configuration.\n *\n * The callback receives the current configuration properties and can mutate\n * them in place. Updated values are written back to the transaction data.\n *\n * @param transactionId - The ID of the transaction to configure.\n * @param callback - A callback that receives a mutable {@link TransactionConfig} object.\n */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `TransactionPayController:setTransactionConfig`;\n handler: TransactionPayController['setTransactionConfig'];\n};\n\n/**\n * Updates the payment token for a transaction.\n *\n * Resolves token metadata and balances, then stores the new payment token\n * in the transaction data. This triggers recalculation of source amounts\n * and quote retrieval.\n *\n * @param request - The payment token update request containing the\n * transaction ID, token address, and chain ID.\n */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `TransactionPayController:updatePaymentToken`;\n handler: TransactionPayController['updatePaymentToken'];\n};\n\n/**\n * Updates the fiat payment state for a transaction.\n *\n * The request callback receives the current fiat payment state and can\n * mutate it to update properties such as the selected payment method or\n * fiat amount.\n *\n * @param request - The fiat payment update request containing the\n * transaction ID and a callback to mutate fiat payment state.\n */\nexport type TransactionPayControllerUpdateFiatPaymentAction = {\n type: `TransactionPayController:updateFiatPayment`;\n handler: TransactionPayController['updateFiatPayment'];\n};\n\n/**\n * Gets the delegation transaction for a given transaction.\n *\n * Converts the provided transaction into a redeem delegation by delegating\n * to the configured callback. Returns the delegation transaction data\n * including the encoded call data, target address, value, and an optional\n * authorization list.\n *\n * @param args - The arguments forwarded to the {@link GetDelegationTransactionCallback},\n * containing the transaction metadata.\n * @returns A promise resolving to the delegation transaction data.\n */\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `TransactionPayController:getDelegationTransaction`;\n handler: TransactionPayController['getDelegationTransaction'];\n};\n\n/**\n * Returns additional transactions for the paymentOverride flow.\n *\n * Delegates to the client-supplied {@link GetPaymentOverrideDataCallback}.\n * Called during quote execution when `paymentOverride` is defined on the transaction.\n * Returns an empty array when no callback is configured.\n *\n * @param args - The arguments forwarded to the {@link GetPaymentOverrideDataCallback}.\n * @returns A promise resolving to the additional transactions array.\n */\nexport type TransactionPayControllerGetAmountDataAction = {\n type: `TransactionPayController:getAmountData`;\n handler: TransactionPayController['getAmountData'];\n};\n\n/**\n * Returns optional fiat execution configuration.\n *\n * This is intentionally not stored in controller state.\n *\n * @returns Fiat execution options, if configured.\n */\nexport type TransactionPayControllerGetFiatOptionsAction = {\n type: `TransactionPayController:getFiatOptions`;\n handler: TransactionPayController['getFiatOptions'];\n};\n\nexport type TransactionPayControllerGetPaymentOverrideDataAction = {\n type: `TransactionPayController:getPaymentOverrideData`;\n handler: TransactionPayController['getPaymentOverrideData'];\n};\n\n/**\n * Gets the preferred strategy for a transaction.\n *\n * Returns the first strategy from the ordered list of strategies applicable\n * to the given transaction. Falls back to the default strategy order derived\n * from feature flags when no custom strategy callback is configured.\n *\n * @param transaction - The transaction metadata to determine the strategy for.\n * @returns The preferred {@link TransactionPayStrategy} for the transaction.\n */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `TransactionPayController:getStrategy`;\n handler: TransactionPayController['getStrategy'];\n};\n\n/**\n * Derives the Polymarket deposit-wallet address for an EOA via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.getDepositWalletAddress}.\n * @returns A promise resolving to the deposit-wallet address.\n */\nexport type TransactionPayControllerPolymarketGetDepositWalletAddressAction = {\n type: `TransactionPayController:polymarketGetDepositWalletAddress`;\n handler: TransactionPayController['polymarketGetDepositWalletAddress'];\n};\n\n/**\n * Signs and broadcasts a Polymarket deposit-wallet batch via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.submitDepositWalletBatch}.\n * @returns A promise resolving to the relayer-issued source hash.\n */\nexport type TransactionPayControllerPolymarketSubmitDepositWalletBatchAction = {\n type: `TransactionPayController:polymarketSubmitDepositWalletBatch`;\n handler: TransactionPayController['polymarketSubmitDepositWalletBatch'];\n};\n\n/**\n * Union of all TransactionPayController action types.\n */\nexport type TransactionPayControllerMethodActions =\n | TransactionPayControllerSetTransactionConfigAction\n | TransactionPayControllerUpdatePaymentTokenAction\n | TransactionPayControllerUpdateFiatPaymentAction\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetAmountDataAction\n | TransactionPayControllerGetFiatOptionsAction\n | TransactionPayControllerGetPaymentOverrideDataAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerPolymarketGetDepositWalletAddressAction\n | TransactionPayControllerPolymarketSubmitDepositWalletBatchAction;\n"]}
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
11
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
12
  };
13
- var _TransactionPayController_instances, _TransactionPayController_getAmountData, _TransactionPayController_getDelegationTransaction, _TransactionPayController_fiatOptions, _TransactionPayController_getPaymentOverrideData, _TransactionPayController_getStrategy, _TransactionPayController_getStrategies, _TransactionPayController_polymarket, _TransactionPayController_resolveSourceAmount, _TransactionPayController_vaultDepositRequests, _TransactionPayController_vaultWithdrawRequests, _TransactionPayController_requirePolymarket, _TransactionPayController_removeTransactionData, _TransactionPayController_updateTransactionData, _TransactionPayController_getStrategiesWithFallback;
13
+ var _TransactionPayController_instances, _TransactionPayController_getAmountData, _TransactionPayController_getDelegationTransaction, _TransactionPayController_fiatOptions, _TransactionPayController_getPaymentOverrideData, _TransactionPayController_getStrategy, _TransactionPayController_getStrategies, _TransactionPayController_polymarket, _TransactionPayController_resolveSourceAmount, _TransactionPayController_requirePolymarket, _TransactionPayController_removeTransactionData, _TransactionPayController_updateTransactionData, _TransactionPayController_getStrategiesWithFallback;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.TransactionPayController = void 0;
16
16
  const base_controller_1 = require("@metamask/base-controller");
@@ -20,8 +20,6 @@ const update_payment_token_js_1 = require("./actions/update-payment-token.cjs");
20
20
  const constants_js_1 = require("./constants.cjs");
21
21
  const QuoteRefresher_js_1 = require("./helpers/QuoteRefresher.cjs");
22
22
  const feature_flags_js_1 = require("./utils/feature-flags.cjs");
23
- const ma_vault_payout_js_1 = require("./utils/ma-vault-payout.cjs");
24
- const ma_vault_withdraw_js_1 = require("./utils/ma-vault-withdraw.cjs");
25
23
  const quotes_js_1 = require("./utils/quotes.cjs");
26
24
  const source_amounts_js_1 = require("./utils/source-amounts.cjs");
27
25
  const transaction_js_1 = require("./utils/transaction.cjs");
@@ -34,8 +32,6 @@ const MESSENGER_EXPOSED_METHODS = [
34
32
  'polymarketGetDepositWalletAddress',
35
33
  'polymarketSubmitDepositWalletBatch',
36
34
  'setTransactionConfig',
37
- 'submitMoneyAccountVaultDeposit',
38
- 'submitMoneyAccountVaultWithdraw',
39
35
  'updateFiatPayment',
40
36
  'updatePaymentToken',
41
37
  ];
@@ -67,19 +63,6 @@ class TransactionPayController extends base_controller_1.BaseController {
67
63
  _TransactionPayController_getStrategies.set(this, void 0);
68
64
  _TransactionPayController_polymarket.set(this, void 0);
69
65
  _TransactionPayController_resolveSourceAmount.set(this, void 0);
70
- /**
71
- * In-flight and completed payout vault deposits, keyed by payout tx hash.
72
- * Completed successes stay cached for the controller lifetime so webhook
73
- * replays / retries do not re-submit. Preferable to persisted state here
74
- * because vaulting is idempotent per process and avoids a state migration.
75
- */
76
- _TransactionPayController_vaultDepositRequests.set(this, new Map());
77
- /**
78
- * In-flight and completed withdraw batch setups, keyed by requestId.
79
- * Successful `addTransactionBatch` results stay cached for the controller
80
- * lifetime so a second call cannot open another approval for the same id.
81
- */
82
- _TransactionPayController_vaultWithdrawRequests.set(this, new Map());
83
66
  __classPrivateFieldSet(this, _TransactionPayController_getAmountData, getAmountData, "f");
84
67
  __classPrivateFieldSet(this, _TransactionPayController_getDelegationTransaction, getDelegationTransaction, "f");
85
68
  __classPrivateFieldSet(this, _TransactionPayController_fiatOptions, fiatOptions, "f");
@@ -161,61 +144,6 @@ class TransactionPayController extends base_controller_1.BaseController {
161
144
  updateTransactionData: __classPrivateFieldGet(this, _TransactionPayController_instances, "m", _TransactionPayController_updateTransactionData).bind(this),
162
145
  });
163
146
  }
164
- /**
165
- * Vaults mUSD received in a completed Iron payout transaction.
166
- *
167
- * Concurrent calls for the same payout hash share one in-flight submission.
168
- * Successful results are retained for the controller lifetime so retries
169
- * return the prior hash without submitting again. Skipped results (vaulting
170
- * disabled) are not retained, so a later enablement can retry the same hash.
171
- *
172
- * @param request - Completed Iron payout details.
173
- * @returns Hash of the confirmed vault transaction, or `{ skipped: true }`
174
- * when vaulting is disabled.
175
- */
176
- submitMoneyAccountVaultDeposit(request) {
177
- const key = request.transactionHash.toLowerCase();
178
- const current = __classPrivateFieldGet(this, _TransactionPayController_vaultDepositRequests, "f").get(key);
179
- if (current) {
180
- return current;
181
- }
182
- const pending = (0, ma_vault_payout_js_1.submitMoneyAccountVaultDepositFromPayout)(request, this.messenger)
183
- .then((result) => {
184
- if (result.skipped) {
185
- __classPrivateFieldGet(this, _TransactionPayController_vaultDepositRequests, "f").delete(key);
186
- }
187
- return result;
188
- })
189
- .catch((error) => {
190
- __classPrivateFieldGet(this, _TransactionPayController_vaultDepositRequests, "f").delete(key);
191
- throw error;
192
- });
193
- __classPrivateFieldGet(this, _TransactionPayController_vaultDepositRequests, "f").set(key, pending);
194
- return pending;
195
- }
196
- /**
197
- * Creates a user-confirmed exact-out vmUSD withdrawal to Iron.
198
- *
199
- * Concurrent calls with the same request ID share one in-flight batch setup.
200
- * Successful batch results are retained so a later call returns the same
201
- * `batchId` without creating another approval.
202
- *
203
- * @param request - Backend-bound exact-out Iron intent.
204
- * @returns Pending transaction batch ID.
205
- */
206
- submitMoneyAccountVaultWithdraw(request) {
207
- const key = request.requestId;
208
- const current = __classPrivateFieldGet(this, _TransactionPayController_vaultWithdrawRequests, "f").get(key);
209
- if (current) {
210
- return current;
211
- }
212
- const pending = (0, ma_vault_withdraw_js_1.submitMoneyAccountVaultWithdraw)(request, this.messenger).catch((error) => {
213
- __classPrivateFieldGet(this, _TransactionPayController_vaultWithdrawRequests, "f").delete(key);
214
- throw error;
215
- });
216
- __classPrivateFieldGet(this, _TransactionPayController_vaultWithdrawRequests, "f").set(key, pending);
217
- return pending;
218
- }
219
147
  /**
220
148
  * Gets the delegation transaction for a given transaction.
221
149
  *
@@ -292,7 +220,7 @@ class TransactionPayController extends base_controller_1.BaseController {
292
220
  }
293
221
  }
294
222
  exports.TransactionPayController = TransactionPayController;
295
- _TransactionPayController_getAmountData = new WeakMap(), _TransactionPayController_getDelegationTransaction = new WeakMap(), _TransactionPayController_fiatOptions = new WeakMap(), _TransactionPayController_getPaymentOverrideData = new WeakMap(), _TransactionPayController_getStrategy = new WeakMap(), _TransactionPayController_getStrategies = new WeakMap(), _TransactionPayController_polymarket = new WeakMap(), _TransactionPayController_resolveSourceAmount = new WeakMap(), _TransactionPayController_vaultDepositRequests = new WeakMap(), _TransactionPayController_vaultWithdrawRequests = new WeakMap(), _TransactionPayController_instances = new WeakSet(), _TransactionPayController_requirePolymarket = function _TransactionPayController_requirePolymarket() {
223
+ _TransactionPayController_getAmountData = new WeakMap(), _TransactionPayController_getDelegationTransaction = new WeakMap(), _TransactionPayController_fiatOptions = new WeakMap(), _TransactionPayController_getPaymentOverrideData = new WeakMap(), _TransactionPayController_getStrategy = new WeakMap(), _TransactionPayController_getStrategies = new WeakMap(), _TransactionPayController_polymarket = new WeakMap(), _TransactionPayController_resolveSourceAmount = new WeakMap(), _TransactionPayController_instances = new WeakSet(), _TransactionPayController_requirePolymarket = function _TransactionPayController_requirePolymarket() {
296
224
  if (!__classPrivateFieldGet(this, _TransactionPayController_polymarket, "f")) {
297
225
  throw new Error('TransactionPayController: Polymarket callbacks missing');
298
226
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionPayController.cjs","sourceRoot":"","sources":["../src/TransactionPayController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+DAA2D;AAG3D,mCAA8B;AAE9B,8EAAqE;AACrE,gFAAuE;AACvE,kDAIwB;AACxB,oEAA6D;AAiB7D,gEAA4D;AAG5D,oEAAsF;AAEtF,wEAAsH;AACtH,kDAAiD;AACjD,kEAAgE;AAChE,4DAGgC;AAEhC,MAAM,yBAAyB,GAAG;IAChC,eAAe;IACf,0BAA0B;IAC1B,gBAAgB;IAChB,wBAAwB;IACxB,aAAa;IACb,mCAAmC;IACnC,oCAAoC;IACpC,sBAAsB;IACtB,gCAAgC;IAChC,iCAAiC;IACjC,mBAAmB;IACnB,oBAAoB;CACZ,CAAC;AAEX,M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,CACrC,CAAC;IAEF,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,MAAM,YAAY,GAAG,eAAe,EAAE,YAAY,CAAC;IAEnD,OAAO,IAAA,mCAAgB,EACrB,IAAI,CAAC,SAAS,EACd,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,WAAW,CAAC,IAAI,EAChB,eAAe,EAAE,WAAW,EAAE,uBAAuB,CACtD,CAAC;AACJ,CAAC","sourcesContent":["import type { StateMetadata } from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { TransactionMeta } from '@metamask/transaction-controller';\nimport type { Draft } from 'immer';\nimport { noop } from 'lodash';\n\nimport { updateFiatPayment } from './actions/update-fiat-payment.js';\nimport { updatePaymentToken } from './actions/update-payment-token.js';\nimport {\n CONTROLLER_NAME,\n isTransactionPayStrategy,\n TransactionPayStrategy,\n} from './constants.js';\nimport { QuoteRefresher } from './helpers/QuoteRefresher.js';\nimport type {\n GetAmountDataCallback,\n GetDelegationTransactionCallback,\n GetPaymentOverrideDataCallback,\n PolymarketCallbacks,\n ResolveSourceAmountCallback,\n TransactionConfig,\n TransactionConfigCallback,\n TransactionData,\n TransactionPayControllerMessenger,\n TransactionPayFiatOptions,\n TransactionPayControllerOptions,\n TransactionPayControllerState,\n UpdateFiatPaymentRequest,\n UpdatePaymentTokenRequest,\n} from './types.js';\nimport { getStrategyOrder } from './utils/feature-flags.js';\nimport type { SubmitMoneyAccountVaultDepositResult } from './utils/ma-vault-deposit.js';\nimport type { SubmitMoneyAccountVaultDepositRequest } from './utils/ma-vault-payout.js';\nimport { submitMoneyAccountVaultDepositFromPayout } from './utils/ma-vault-payout.js';\nimport type { SubmitMoneyAccountVaultWithdrawRequest } from './utils/ma-vault-withdraw.js';\nimport { submitMoneyAccountVaultWithdraw as submitMoneyAccountVaultWithdrawUtil } from './utils/ma-vault-withdraw.js';\nimport { updateQuotes } from './utils/quotes.js';\nimport { updateSourceAmounts } from './utils/source-amounts.js';\nimport {\n subscribeAssetChanges,\n subscribeTransactionChanges,\n} from './utils/transaction.js';\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getAmountData',\n 'getDelegationTransaction',\n 'getFiatOptions',\n 'getPaymentOverrideData',\n 'getStrategy',\n 'polymarketGetDepositWalletAddress',\n 'polymarketSubmitDepositWalletBatch',\n 'setTransactionConfig',\n 'submitMoneyAccountVaultDeposit',\n 'submitMoneyAccountVaultWithdraw',\n 'updateFiatPayment',\n 'updatePaymentToken',\n] as const;\n\nconst stateMetadata: StateMetadata<TransactionPayControllerState> = {\n transactionData: {\n includeInDebugSnapshot: false,\n includeInStateLogs: true,\n persist: false,\n usedInUi: true,\n },\n};\n\nconst getDefaultState = (): TransactionPayControllerState => ({\n transactionData: {},\n});\n\nexport class TransactionPayController extends BaseController<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState,\n TransactionPayControllerMessenger\n> {\n readonly #getAmountData?: GetAmountDataCallback;\n\n readonly #getDelegationTransaction: GetDelegationTransactionCallback;\n\n readonly #fiatOptions?: TransactionPayFiatOptions;\n\n readonly #getPaymentOverrideData?: GetPaymentOverrideDataCallback;\n\n readonly #getStrategy?: (\n transaction: TransactionMeta,\n ) => TransactionPayStrategy;\n\n readonly #getStrategies?: (\n transaction: TransactionMeta,\n ) => TransactionPayStrategy[];\n\n readonly #polymarket?: PolymarketCallbacks;\n\n readonly #resolveSourceAmount?: ResolveSourceAmountCallback;\n\n /**\n * In-flight and completed payout vault deposits, keyed by payout tx hash.\n * Completed successes stay cached for the controller lifetime so webhook\n * replays / retries do not re-submit. Preferable to persisted state here\n * because vaulting is idempotent per process and avoids a state migration.\n */\n readonly #vaultDepositRequests = new Map<\n string,\n Promise<SubmitMoneyAccountVaultDepositResult>\n >();\n\n /**\n * In-flight and completed withdraw batch setups, keyed by requestId.\n * Successful `addTransactionBatch` results stay cached for the controller\n * lifetime so a second call cannot open another approval for the same id.\n */\n readonly #vaultWithdrawRequests = new Map<\n string,\n Promise<{ batchId: `0x${string}` }>\n >();\n\n constructor({\n fiatOptions,\n getAmountData,\n getDelegationTransaction,\n getPaymentOverrideData,\n getStrategy,\n getStrategies,\n messenger,\n polymarket,\n resolveSourceAmount,\n state,\n }: TransactionPayControllerOptions) {\n super({\n name: CONTROLLER_NAME,\n metadata: stateMetadata,\n messenger,\n state: { ...getDefaultState(), ...state },\n });\n\n this.#getAmountData = getAmountData;\n this.#getDelegationTransaction = getDelegationTransaction;\n this.#fiatOptions = fiatOptions;\n this.#getPaymentOverrideData = getPaymentOverrideData;\n this.#getStrategy = getStrategy;\n this.#getStrategies = getStrategies;\n this.#polymarket = polymarket;\n this.#resolveSourceAmount = resolveSourceAmount;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n\n subscribeTransactionChanges(\n messenger,\n this.#updateTransactionData.bind(this),\n this.#removeTransactionData.bind(this),\n );\n\n subscribeAssetChanges(\n messenger,\n () => this.state,\n this.#updateTransactionData.bind(this),\n );\n\n // eslint-disable-next-line no-new\n new QuoteRefresher({\n getStrategies: this.#getStrategiesWithFallback.bind(this),\n messenger,\n updateTransactionData: this.#updateTransactionData.bind(this),\n });\n }\n\n /**\n * Sets the transaction configuration.\n *\n * The callback receives the current configuration properties and can mutate\n * them in place. Updated values are written back to the transaction data.\n *\n * @param transactionId - The ID of the transaction to configure.\n * @param callback - A callback that receives a mutable {@link TransactionConfig} object.\n */\n setTransactionConfig(\n transactionId: string,\n callback: TransactionConfigCallback,\n ): void {\n this.#updateTransactionData(transactionId, (transactionData) => {\n const config: TransactionConfig = {\n accountOverride: transactionData.accountOverride,\n atomic: transactionData.atomic,\n isHyperliquidSource: transactionData.isHyperliquidSource,\n isMaxAmount: transactionData.isMaxAmount,\n isPolymarketDepositWallet: transactionData.isPolymarketDepositWallet,\n isPostQuote: transactionData.isPostQuote,\n isQuoteRequired: transactionData.isQuoteRequired,\n paymentOverride: transactionData.paymentOverride,\n refundTo: transactionData.refundTo,\n };\n\n const previousAccountOverride = config.accountOverride;\n\n callback(config);\n\n Object.assign(transactionData, config);\n\n if (\n !config.isPostQuote &&\n config.accountOverride !== previousAccountOverride\n ) {\n transactionData.paymentToken = undefined;\n }\n });\n }\n\n /**\n * Updates the payment token for a transaction.\n *\n * Resolves token metadata and balances, then stores the new payment token\n * in the transaction data. This triggers recalculation of source amounts\n * and quote retrieval.\n *\n * @param request - The payment token update request containing the\n * transaction ID, token address, and chain ID.\n */\n updatePaymentToken(request: UpdatePaymentTokenRequest): void {\n updatePaymentToken(request, {\n messenger: this.messenger,\n updateTransactionData: this.#updateTransactionData.bind(this),\n });\n }\n\n /**\n * Updates the fiat payment state for a transaction.\n *\n * The request callback receives the current fiat payment state and can\n * mutate it to update properties such as the selected payment method or\n * fiat amount.\n *\n * @param request - The fiat payment update request containing the\n * transaction ID and a callback to mutate fiat payment state.\n */\n updateFiatPayment(request: UpdateFiatPaymentRequest): void {\n updateFiatPayment(request, {\n messenger: this.messenger,\n updateTransactionData: this.#updateTransactionData.bind(this),\n });\n }\n\n /**\n * Vaults mUSD received in a completed Iron payout transaction.\n *\n * Concurrent calls for the same payout hash share one in-flight submission.\n * Successful results are retained for the controller lifetime so retries\n * return the prior hash without submitting again. Skipped results (vaulting\n * disabled) are not retained, so a later enablement can retry the same hash.\n *\n * @param request - Completed Iron payout details.\n * @returns Hash of the confirmed vault transaction, or `{ skipped: true }`\n * when vaulting is disabled.\n */\n submitMoneyAccountVaultDeposit(\n request: SubmitMoneyAccountVaultDepositRequest,\n ): Promise<SubmitMoneyAccountVaultDepositResult> {\n const key = request.transactionHash.toLowerCase();\n const current = this.#vaultDepositRequests.get(key);\n if (current) {\n return current;\n }\n\n const pending = submitMoneyAccountVaultDepositFromPayout(\n request,\n this.messenger,\n )\n .then((result) => {\n if (result.skipped) {\n this.#vaultDepositRequests.delete(key);\n }\n return result;\n })\n .catch((error: unknown) => {\n this.#vaultDepositRequests.delete(key);\n throw error;\n });\n this.#vaultDepositRequests.set(key, pending);\n return pending;\n }\n\n /**\n * Creates a user-confirmed exact-out vmUSD withdrawal to Iron.\n *\n * Concurrent calls with the same request ID share one in-flight batch setup.\n * Successful batch results are retained so a later call returns the same\n * `batchId` without creating another approval.\n *\n * @param request - Backend-bound exact-out Iron intent.\n * @returns Pending transaction batch ID.\n */\n submitMoneyAccountVaultWithdraw(\n request: SubmitMoneyAccountVaultWithdrawRequest,\n ): Promise<{ batchId: `0x${string}` }> {\n const key = request.requestId;\n const current = this.#vaultWithdrawRequests.get(key);\n if (current) {\n return current;\n }\n\n const pending = submitMoneyAccountVaultWithdrawUtil(\n request,\n this.messenger,\n ).catch((error: unknown) => {\n this.#vaultWithdrawRequests.delete(key);\n throw error;\n });\n this.#vaultWithdrawRequests.set(key, pending);\n return pending;\n }\n\n /**\n * Gets the delegation transaction for a given transaction.\n *\n * Converts the provided transaction into a redeem delegation by delegating\n * to the configured callback. Returns the delegation transaction data\n * including the encoded call data, target address, value, and an optional\n * authorization list.\n *\n * @param args - The arguments forwarded to the {@link GetDelegationTransactionCallback},\n * containing the transaction metadata.\n * @returns A promise resolving to the delegation transaction data.\n */\n getDelegationTransaction(\n ...args: Parameters<GetDelegationTransactionCallback>\n ): ReturnType<GetDelegationTransactionCallback> {\n return this.#getDelegationTransaction(...args);\n }\n\n /**\n * Returns additional transactions for the paymentOverride flow.\n *\n * Delegates to the client-supplied {@link GetPaymentOverrideDataCallback}.\n * Called during quote execution when `paymentOverride` is defined on the transaction.\n * Returns an empty array when no callback is configured.\n *\n * @param args - The arguments forwarded to the {@link GetPaymentOverrideDataCallback}.\n * @returns A promise resolving to the additional transactions array.\n */\n getAmountData(\n ...args: Parameters<GetAmountDataCallback>\n ): ReturnType<GetAmountDataCallback> {\n return this.#getAmountData?.(...args) ?? Promise.resolve({ updates: [] });\n }\n\n /**\n * Returns optional fiat execution configuration.\n *\n * This is intentionally not stored in controller state.\n *\n * @returns Fiat execution options, if configured.\n */\n getFiatOptions(): TransactionPayFiatOptions | undefined {\n return this.#fiatOptions;\n }\n\n getPaymentOverrideData(\n ...args: Parameters<GetPaymentOverrideDataCallback>\n ): ReturnType<GetPaymentOverrideDataCallback> {\n return (\n this.#getPaymentOverrideData?.(...args) ?? Promise.resolve({ calls: [] })\n );\n }\n\n /**\n * Gets the preferred strategy for a transaction.\n *\n * Returns the first strategy from the ordered list of strategies applicable\n * to the given transaction. Falls back to the default strategy order derived\n * from feature flags when no custom strategy callback is configured.\n *\n * @param transaction - The transaction metadata to determine the strategy for.\n * @returns The preferred {@link TransactionPayStrategy} for the transaction.\n */\n getStrategy(transaction: TransactionMeta): TransactionPayStrategy {\n return this.#getStrategiesWithFallback(transaction)[0];\n }\n\n /**\n * Derives the Polymarket deposit-wallet address for an EOA via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.getDepositWalletAddress}.\n * @returns A promise resolving to the deposit-wallet address.\n */\n polymarketGetDepositWalletAddress(\n ...args: Parameters<PolymarketCallbacks['getDepositWalletAddress']>\n ): ReturnType<PolymarketCallbacks['getDepositWalletAddress']> {\n return this.#requirePolymarket().getDepositWalletAddress(...args);\n }\n\n /**\n * Signs and broadcasts a Polymarket deposit-wallet batch via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.submitDepositWalletBatch}.\n * @returns A promise resolving to the relayer-issued source hash.\n */\n polymarketSubmitDepositWalletBatch(\n ...args: Parameters<PolymarketCallbacks['submitDepositWalletBatch']>\n ): ReturnType<PolymarketCallbacks['submitDepositWalletBatch']> {\n return this.#requirePolymarket().submitDepositWalletBatch(...args);\n }\n\n #requirePolymarket(): PolymarketCallbacks {\n if (!this.#polymarket) {\n throw new Error('TransactionPayController: Polymarket callbacks missing');\n }\n return this.#polymarket;\n }\n\n #removeTransactionData(transactionId: string): void {\n this.update((state) => {\n delete state.transactionData[transactionId];\n });\n }\n\n #updateTransactionData(\n transactionId: string,\n fn: (transactionData: Draft<TransactionData>) => void,\n ): void {\n let shouldUpdateQuotes = false;\n\n this.update((state) => {\n const { transactionData } = state;\n let current = transactionData[transactionId];\n const originalPaymentToken = current?.paymentToken;\n const originalTokens = current?.tokens;\n const originalIsMaxAmount = current?.isMaxAmount;\n const originalIsPostQuote = current?.isPostQuote;\n const originalAccountOverride = current?.accountOverride;\n const originalFiatPaymentAmount = current?.fiatPayment?.amountFiat;\n const originalFiatPaymentMethodId =\n current?.fiatPayment?.selectedPaymentMethodId;\n\n if (!current) {\n transactionData[transactionId] = {\n fiatPayment: {},\n isLoading: false,\n tokens: [],\n };\n\n current = transactionData[transactionId];\n }\n\n fn(current);\n\n const isPaymentTokenUpdated =\n current.paymentToken?.address?.toLowerCase() !==\n originalPaymentToken?.address?.toLowerCase() ||\n current.paymentToken?.chainId !== originalPaymentToken?.chainId;\n\n const isTokensUpdated = current.tokens !== originalTokens;\n const isIsMaxUpdated = current.isMaxAmount !== originalIsMaxAmount;\n const isPostQuoteUpdated = current.isPostQuote !== originalIsPostQuote;\n const isAccountOverrideUpdated =\n current.accountOverride !== originalAccountOverride;\n const isFiatAmountUpdated =\n current.fiatPayment?.amountFiat !== originalFiatPaymentAmount;\n const isFiatPaymentMethodUpdated =\n current.fiatPayment?.selectedPaymentMethodId !==\n originalFiatPaymentMethodId;\n\n if (\n isPaymentTokenUpdated ||\n isIsMaxUpdated ||\n isTokensUpdated ||\n isPostQuoteUpdated ||\n isAccountOverrideUpdated\n ) {\n updateSourceAmounts(\n transactionId,\n current as never,\n this.messenger,\n this.#resolveSourceAmount,\n );\n\n shouldUpdateQuotes = true;\n }\n\n if (isFiatAmountUpdated || isFiatPaymentMethodUpdated) {\n shouldUpdateQuotes = true;\n }\n });\n\n if (shouldUpdateQuotes) {\n updateQuotes({\n getStrategies: this.#getStrategiesWithFallback.bind(this),\n messenger: this.messenger,\n transactionData: this.state.transactionData[transactionId],\n transactionId,\n updateTransactionData: this.#updateTransactionData.bind(this),\n }).catch(noop);\n }\n }\n\n #getStrategiesWithFallback(\n transaction: TransactionMeta,\n ): TransactionPayStrategy[] {\n const transactionData = this.state.transactionData[transaction.id];\n\n const strategyCandidates: unknown[] =\n this.#getStrategies?.(transaction) ??\n (this.#getStrategy ? [this.#getStrategy(transaction)] : []);\n\n const validStrategies = strategyCandidates.filter(\n (strategy): strategy is TransactionPayStrategy =>\n isTransactionPayStrategy(strategy),\n );\n\n if (validStrategies.length) {\n return validStrategies;\n }\n\n const paymentToken = transactionData?.paymentToken;\n\n return getStrategyOrder(\n this.messenger,\n paymentToken?.chainId,\n paymentToken?.address,\n transaction.type,\n transactionData?.fiatPayment?.selectedPaymentMethodId,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"TransactionPayController.cjs","sourceRoot":"","sources":["../src/TransactionPayController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+DAA2D;AAG3D,mCAA8B;AAE9B,8EAAqE;AACrE,gFAAuE;AACvE,kDAIwB;AACxB,oEAA6D;AAiB7D,gEAA4D;AAC5D,kDAAiD;AACjD,kEAAgE;AAChE,4DAGgC;AAEhC,MAAM,yBAAyB,GAAG;IAChC,eAAe;IACf,0BAA0B;IAC1B,gBAAgB;IAChB,wBAAwB;IACxB,aAAa;IACb,mCAAmC;IACnC,oCAAoC;IACpC,sBAAsB;IACtB,mBAAmB;IACnB,oBAAoB;CACZ,CAAC;AAEX,MAAM,aAAa,GAAiD;IAClE,eAAe,EAAE;QACf,sBAAsB,EAAE,KAAK;QAC7B,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,IAAI;KACf;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,GAAkC,EAAE,CAAC,CAAC;IAC5D,eAAe,EAAE,EAAE;CACpB,CAAC,CAAC;AAEH,MAAa,wBAAyB,SAAQ,gCAI7C;IAqBC,YAAY,EACV,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,SAAS,E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A,IAAI,4FAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;SAC9D,CAAC,CAAC,KAAK,CAAC,aAAI,CAAC,CAAC;IACjB,CAAC;AACH,CAAC,qHAGC,WAA4B;IAE5B,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAEnE,MAAM,kBAAkB,GACtB,uBAAA,IAAI,+CAAe,EAAE,KAArB,IAAI,EAAkB,WAAW,CAAC;QAClC,CAAC,uBAAA,IAAI,6CAAa,CAAC,CAAC,CAAC,CAAC,uBAAA,IAAI,6CAAa,MAAjB,IAAI,EAAc,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAE9D,MAAM,eAAe,GAAG,kBAAkB,CAAC,MAAM,CAC/C,CAAC,QAAQ,EAAsC,EAAE,CAC/C,IAAA,uCAAwB,EAAC,QAAQ,CAAC,CACrC,CAAC;IAEF,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,MAAM,YAAY,GAAG,eAAe,EAAE,YAAY,CAAC;IAEnD,OAAO,IAAA,mCAAgB,EACrB,IAAI,CAAC,SAAS,EACd,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,EACrB,WAAW,CAAC,IAAI,EAChB,eAAe,EAAE,WAAW,EAAE,uBAAuB,CACtD,CAAC;AACJ,CAAC","sourcesContent":["import type { StateMetadata } from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { TransactionMeta } from '@metamask/transaction-controller';\nimport type { Draft } from 'immer';\nimport { noop } from 'lodash';\n\nimport { updateFiatPayment } from './actions/update-fiat-payment.js';\nimport { updatePaymentToken } from './actions/update-payment-token.js';\nimport {\n CONTROLLER_NAME,\n isTransactionPayStrategy,\n TransactionPayStrategy,\n} from './constants.js';\nimport { QuoteRefresher } from './helpers/QuoteRefresher.js';\nimport type {\n GetAmountDataCallback,\n GetDelegationTransactionCallback,\n GetPaymentOverrideDataCallback,\n PolymarketCallbacks,\n ResolveSourceAmountCallback,\n TransactionConfig,\n TransactionConfigCallback,\n TransactionData,\n TransactionPayControllerMessenger,\n TransactionPayFiatOptions,\n TransactionPayControllerOptions,\n TransactionPayControllerState,\n UpdateFiatPaymentRequest,\n UpdatePaymentTokenRequest,\n} from './types.js';\nimport { getStrategyOrder } from './utils/feature-flags.js';\nimport { updateQuotes } from './utils/quotes.js';\nimport { updateSourceAmounts } from './utils/source-amounts.js';\nimport {\n subscribeAssetChanges,\n subscribeTransactionChanges,\n} from './utils/transaction.js';\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getAmountData',\n 'getDelegationTransaction',\n 'getFiatOptions',\n 'getPaymentOverrideData',\n 'getStrategy',\n 'polymarketGetDepositWalletAddress',\n 'polymarketSubmitDepositWalletBatch',\n 'setTransactionConfig',\n 'updateFiatPayment',\n 'updatePaymentToken',\n] as const;\n\nconst stateMetadata: StateMetadata<TransactionPayControllerState> = {\n transactionData: {\n includeInDebugSnapshot: false,\n includeInStateLogs: true,\n persist: false,\n usedInUi: true,\n },\n};\n\nconst getDefaultState = (): TransactionPayControllerState => ({\n transactionData: {},\n});\n\nexport class TransactionPayController extends BaseController<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState,\n TransactionPayControllerMessenger\n> {\n readonly #getAmountData?: GetAmountDataCallback;\n\n readonly #getDelegationTransaction: GetDelegationTransactionCallback;\n\n readonly #fiatOptions?: TransactionPayFiatOptions;\n\n readonly #getPaymentOverrideData?: GetPaymentOverrideDataCallback;\n\n readonly #getStrategy?: (\n transaction: TransactionMeta,\n ) => TransactionPayStrategy;\n\n readonly #getStrategies?: (\n transaction: TransactionMeta,\n ) => TransactionPayStrategy[];\n\n readonly #polymarket?: PolymarketCallbacks;\n\n readonly #resolveSourceAmount?: ResolveSourceAmountCallback;\n\n constructor({\n fiatOptions,\n getAmountData,\n getDelegationTransaction,\n getPaymentOverrideData,\n getStrategy,\n getStrategies,\n messenger,\n polymarket,\n resolveSourceAmount,\n state,\n }: TransactionPayControllerOptions) {\n super({\n name: CONTROLLER_NAME,\n metadata: stateMetadata,\n messenger,\n state: { ...getDefaultState(), ...state },\n });\n\n this.#getAmountData = getAmountData;\n this.#getDelegationTransaction = getDelegationTransaction;\n this.#fiatOptions = fiatOptions;\n this.#getPaymentOverrideData = getPaymentOverrideData;\n this.#getStrategy = getStrategy;\n this.#getStrategies = getStrategies;\n this.#polymarket = polymarket;\n this.#resolveSourceAmount = resolveSourceAmount;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n\n subscribeTransactionChanges(\n messenger,\n this.#updateTransactionData.bind(this),\n this.#removeTransactionData.bind(this),\n );\n\n subscribeAssetChanges(\n messenger,\n () => this.state,\n this.#updateTransactionData.bind(this),\n );\n\n // eslint-disable-next-line no-new\n new QuoteRefresher({\n getStrategies: this.#getStrategiesWithFallback.bind(this),\n messenger,\n updateTransactionData: this.#updateTransactionData.bind(this),\n });\n }\n\n /**\n * Sets the transaction configuration.\n *\n * The callback receives the current configuration properties and can mutate\n * them in place. Updated values are written back to the transaction data.\n *\n * @param transactionId - The ID of the transaction to configure.\n * @param callback - A callback that receives a mutable {@link TransactionConfig} object.\n */\n setTransactionConfig(\n transactionId: string,\n callback: TransactionConfigCallback,\n ): void {\n this.#updateTransactionData(transactionId, (transactionData) => {\n const config: TransactionConfig = {\n accountOverride: transactionData.accountOverride,\n atomic: transactionData.atomic,\n isHyperliquidSource: transactionData.isHyperliquidSource,\n isMaxAmount: transactionData.isMaxAmount,\n isPolymarketDepositWallet: transactionData.isPolymarketDepositWallet,\n isPostQuote: transactionData.isPostQuote,\n isQuoteRequired: transactionData.isQuoteRequired,\n paymentOverride: transactionData.paymentOverride,\n refundTo: transactionData.refundTo,\n };\n\n const previousAccountOverride = config.accountOverride;\n\n callback(config);\n\n Object.assign(transactionData, config);\n\n if (\n !config.isPostQuote &&\n config.accountOverride !== previousAccountOverride\n ) {\n transactionData.paymentToken = undefined;\n }\n });\n }\n\n /**\n * Updates the payment token for a transaction.\n *\n * Resolves token metadata and balances, then stores the new payment token\n * in the transaction data. This triggers recalculation of source amounts\n * and quote retrieval.\n *\n * @param request - The payment token update request containing the\n * transaction ID, token address, and chain ID.\n */\n updatePaymentToken(request: UpdatePaymentTokenRequest): void {\n updatePaymentToken(request, {\n messenger: this.messenger,\n updateTransactionData: this.#updateTransactionData.bind(this),\n });\n }\n\n /**\n * Updates the fiat payment state for a transaction.\n *\n * The request callback receives the current fiat payment state and can\n * mutate it to update properties such as the selected payment method or\n * fiat amount.\n *\n * @param request - The fiat payment update request containing the\n * transaction ID and a callback to mutate fiat payment state.\n */\n updateFiatPayment(request: UpdateFiatPaymentRequest): void {\n updateFiatPayment(request, {\n messenger: this.messenger,\n updateTransactionData: this.#updateTransactionData.bind(this),\n });\n }\n\n /**\n * Gets the delegation transaction for a given transaction.\n *\n * Converts the provided transaction into a redeem delegation by delegating\n * to the configured callback. Returns the delegation transaction data\n * including the encoded call data, target address, value, and an optional\n * authorization list.\n *\n * @param args - The arguments forwarded to the {@link GetDelegationTransactionCallback},\n * containing the transaction metadata.\n * @returns A promise resolving to the delegation transaction data.\n */\n getDelegationTransaction(\n ...args: Parameters<GetDelegationTransactionCallback>\n ): ReturnType<GetDelegationTransactionCallback> {\n return this.#getDelegationTransaction(...args);\n }\n\n /**\n * Returns additional transactions for the paymentOverride flow.\n *\n * Delegates to the client-supplied {@link GetPaymentOverrideDataCallback}.\n * Called during quote execution when `paymentOverride` is defined on the transaction.\n * Returns an empty array when no callback is configured.\n *\n * @param args - The arguments forwarded to the {@link GetPaymentOverrideDataCallback}.\n * @returns A promise resolving to the additional transactions array.\n */\n getAmountData(\n ...args: Parameters<GetAmountDataCallback>\n ): ReturnType<GetAmountDataCallback> {\n return this.#getAmountData?.(...args) ?? Promise.resolve({ updates: [] });\n }\n\n /**\n * Returns optional fiat execution configuration.\n *\n * This is intentionally not stored in controller state.\n *\n * @returns Fiat execution options, if configured.\n */\n getFiatOptions(): TransactionPayFiatOptions | undefined {\n return this.#fiatOptions;\n }\n\n getPaymentOverrideData(\n ...args: Parameters<GetPaymentOverrideDataCallback>\n ): ReturnType<GetPaymentOverrideDataCallback> {\n return (\n this.#getPaymentOverrideData?.(...args) ?? Promise.resolve({ calls: [] })\n );\n }\n\n /**\n * Gets the preferred strategy for a transaction.\n *\n * Returns the first strategy from the ordered list of strategies applicable\n * to the given transaction. Falls back to the default strategy order derived\n * from feature flags when no custom strategy callback is configured.\n *\n * @param transaction - The transaction metadata to determine the strategy for.\n * @returns The preferred {@link TransactionPayStrategy} for the transaction.\n */\n getStrategy(transaction: TransactionMeta): TransactionPayStrategy {\n return this.#getStrategiesWithFallback(transaction)[0];\n }\n\n /**\n * Derives the Polymarket deposit-wallet address for an EOA via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.getDepositWalletAddress}.\n * @returns A promise resolving to the deposit-wallet address.\n */\n polymarketGetDepositWalletAddress(\n ...args: Parameters<PolymarketCallbacks['getDepositWalletAddress']>\n ): ReturnType<PolymarketCallbacks['getDepositWalletAddress']> {\n return this.#requirePolymarket().getDepositWalletAddress(...args);\n }\n\n /**\n * Signs and broadcasts a Polymarket deposit-wallet batch via the\n * client-supplied callback.\n *\n * @param args - The arguments forwarded to {@link PolymarketCallbacks.submitDepositWalletBatch}.\n * @returns A promise resolving to the relayer-issued source hash.\n */\n polymarketSubmitDepositWalletBatch(\n ...args: Parameters<PolymarketCallbacks['submitDepositWalletBatch']>\n ): ReturnType<PolymarketCallbacks['submitDepositWalletBatch']> {\n return this.#requirePolymarket().submitDepositWalletBatch(...args);\n }\n\n #requirePolymarket(): PolymarketCallbacks {\n if (!this.#polymarket) {\n throw new Error('TransactionPayController: Polymarket callbacks missing');\n }\n return this.#polymarket;\n }\n\n #removeTransactionData(transactionId: string): void {\n this.update((state) => {\n delete state.transactionData[transactionId];\n });\n }\n\n #updateTransactionData(\n transactionId: string,\n fn: (transactionData: Draft<TransactionData>) => void,\n ): void {\n let shouldUpdateQuotes = false;\n\n this.update((state) => {\n const { transactionData } = state;\n let current = transactionData[transactionId];\n const originalPaymentToken = current?.paymentToken;\n const originalTokens = current?.tokens;\n const originalIsMaxAmount = current?.isMaxAmount;\n const originalIsPostQuote = current?.isPostQuote;\n const originalAccountOverride = current?.accountOverride;\n const originalFiatPaymentAmount = current?.fiatPayment?.amountFiat;\n const originalFiatPaymentMethodId =\n current?.fiatPayment?.selectedPaymentMethodId;\n\n if (!current) {\n transactionData[transactionId] = {\n fiatPayment: {},\n isLoading: false,\n tokens: [],\n };\n\n current = transactionData[transactionId];\n }\n\n fn(current);\n\n const isPaymentTokenUpdated =\n current.paymentToken?.address?.toLowerCase() !==\n originalPaymentToken?.address?.toLowerCase() ||\n current.paymentToken?.chainId !== originalPaymentToken?.chainId;\n\n const isTokensUpdated = current.tokens !== originalTokens;\n const isIsMaxUpdated = current.isMaxAmount !== originalIsMaxAmount;\n const isPostQuoteUpdated = current.isPostQuote !== originalIsPostQuote;\n const isAccountOverrideUpdated =\n current.accountOverride !== originalAccountOverride;\n const isFiatAmountUpdated =\n current.fiatPayment?.amountFiat !== originalFiatPaymentAmount;\n const isFiatPaymentMethodUpdated =\n current.fiatPayment?.selectedPaymentMethodId !==\n originalFiatPaymentMethodId;\n\n if (\n isPaymentTokenUpdated ||\n isIsMaxUpdated ||\n isTokensUpdated ||\n isPostQuoteUpdated ||\n isAccountOverrideUpdated\n ) {\n updateSourceAmounts(\n transactionId,\n current as never,\n this.messenger,\n this.#resolveSourceAmount,\n );\n\n shouldUpdateQuotes = true;\n }\n\n if (isFiatAmountUpdated || isFiatPaymentMethodUpdated) {\n shouldUpdateQuotes = true;\n }\n });\n\n if (shouldUpdateQuotes) {\n updateQuotes({\n getStrategies: this.#getStrategiesWithFallback.bind(this),\n messenger: this.messenger,\n transactionData: this.state.transactionData[transactionId],\n transactionId,\n updateTransactionData: this.#updateTransactionData.bind(this),\n }).catch(noop);\n }\n }\n\n #getStrategiesWithFallback(\n transaction: TransactionMeta,\n ): TransactionPayStrategy[] {\n const transactionData = this.state.transactionData[transaction.id];\n\n const strategyCandidates: unknown[] =\n this.#getStrategies?.(transaction) ??\n (this.#getStrategy ? [this.#getStrategy(transaction)] : []);\n\n const validStrategies = strategyCandidates.filter(\n (strategy): strategy is TransactionPayStrategy =>\n isTransactionPayStrategy(strategy),\n );\n\n if (validStrategies.length) {\n return validStrategies;\n }\n\n const paymentToken = transactionData?.paymentToken;\n\n return getStrategyOrder(\n this.messenger,\n paymentToken?.chainId,\n paymentToken?.address,\n transaction.type,\n transactionData?.fiatPayment?.selectedPaymentMethodId,\n );\n }\n}\n"]}
@@ -2,9 +2,6 @@ import { BaseController } from "@metamask/base-controller";
2
2
  import type { TransactionMeta } from "@metamask/transaction-controller";
3
3
  import { CONTROLLER_NAME, TransactionPayStrategy } from "./constants.cjs";
4
4
  import type { GetAmountDataCallback, GetDelegationTransactionCallback, GetPaymentOverrideDataCallback, PolymarketCallbacks, TransactionConfigCallback, TransactionPayControllerMessenger, TransactionPayFiatOptions, TransactionPayControllerOptions, TransactionPayControllerState, UpdateFiatPaymentRequest, UpdatePaymentTokenRequest } from "./types.cjs";
5
- import type { SubmitMoneyAccountVaultDepositResult } from "./utils/ma-vault-deposit.cjs";
6
- import type { SubmitMoneyAccountVaultDepositRequest } from "./utils/ma-vault-payout.cjs";
7
- import type { SubmitMoneyAccountVaultWithdrawRequest } from "./utils/ma-vault-withdraw.cjs";
8
5
  export declare class TransactionPayController extends BaseController<typeof CONTROLLER_NAME, TransactionPayControllerState, TransactionPayControllerMessenger> {
9
6
  #private;
10
7
  constructor({ fiatOptions, getAmountData, getDelegationTransaction, getPaymentOverrideData, getStrategy, getStrategies, messenger, polymarket, resolveSourceAmount, state, }: TransactionPayControllerOptions);
@@ -40,32 +37,6 @@ export declare class TransactionPayController extends BaseController<typeof CONT
40
37
  * transaction ID and a callback to mutate fiat payment state.
41
38
  */
42
39
  updateFiatPayment(request: UpdateFiatPaymentRequest): void;
43
- /**
44
- * Vaults mUSD received in a completed Iron payout transaction.
45
- *
46
- * Concurrent calls for the same payout hash share one in-flight submission.
47
- * Successful results are retained for the controller lifetime so retries
48
- * return the prior hash without submitting again. Skipped results (vaulting
49
- * disabled) are not retained, so a later enablement can retry the same hash.
50
- *
51
- * @param request - Completed Iron payout details.
52
- * @returns Hash of the confirmed vault transaction, or `{ skipped: true }`
53
- * when vaulting is disabled.
54
- */
55
- submitMoneyAccountVaultDeposit(request: SubmitMoneyAccountVaultDepositRequest): Promise<SubmitMoneyAccountVaultDepositResult>;
56
- /**
57
- * Creates a user-confirmed exact-out vmUSD withdrawal to Iron.
58
- *
59
- * Concurrent calls with the same request ID share one in-flight batch setup.
60
- * Successful batch results are retained so a later call returns the same
61
- * `batchId` without creating another approval.
62
- *
63
- * @param request - Backend-bound exact-out Iron intent.
64
- * @returns Pending transaction batch ID.
65
- */
66
- submitMoneyAccountVaultWithdraw(request: SubmitMoneyAccountVaultWithdrawRequest): Promise<{
67
- batchId: `0x${string}`;
68
- }>;
69
40
  /**
70
41
  * Gets the delegation transaction for a given transaction.
71
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionPayController.d.cts","sourceRoot":"","sources":["../src/TransactionPayController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,yCAAyC;AAMxE,OAAO,EACL,eAAe,EAEf,sBAAsB,EACvB,wBAAuB;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,gCAAgC,EAChC,8BAA8B,EAC9B,mBAAmB,EAGnB,yBAAyB,EAEzB,iCAAiC,EACjC,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,EACxB,yBAAyB,EAC1B,oBAAmB;AAEpB,OAAO,KAAK,EAAE,oCAAoC,EAAE,qCAAoC;AAC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ACH,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,sBAAsB;IAIjE;;;;;;OAMG;IACH,iCAAiC,CAC/B,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC,GAClE,UAAU,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;IAI7D;;;;;;OAMG;IACH,kCAAkC,CAChC,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,0BAA0B,CAAC,CAAC,GACnE,UAAU,CAAC,mBAAmB,CAAC,0BAA0B,CAAC,CAAC;CA4H/D"}
1
+ {"version":3,"file":"TransactionPayController.d.cts","sourceRoot":"","sources":["../src/TransactionPayController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,yCAAyC;AAMxE,OAAO,EACL,eAAe,EAEf,sBAAsB,EACvB,wBAAuB;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,gCAAgC,EAChC,8BAA8B,EAC9B,mBAAmB,EAGnB,yBAAyB,EAEzB,iCAAiC,EACjC,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,EACxB,yBAAyB,EAC1B,oBAAmB;AAmCpB,qBAAa,wBAAyB,SAAQ,cAAc,CAC1D,OAAO,eAAe,EACtB,6BAA6B,EAC7B,iCAAiC,CAClC;;gBAqBa,EACV,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,KAAK,GACN,EAAE,+BAA+B;IA0ClC;;;;;;;;OAQG;IACH,oBAAoB,CAClB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,yBAAyB,GAClC,IAAI;IA6BP;;;;;;;;;OASG;IACH,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAO5D;;;;;;;;;OASG;IACH,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI;IAO1D;;;;;;;;;;;OAWG;IACH,wBAAwB,CACtB,GAAG,IAAI,EAAE,UAAU,CAAC,gCAAgC,CAAC,GACpD,UAAU,CAAC,gCAAgC,CAAC;IAI/C;;;;;;;;;OASG;IACH,aAAa,CACX,GAAG,IAAI,EAAE,UAAU,CAAC,qBAAqB,CAAC,GACzC,UAAU,CAAC,qBAAqB,CAAC;IAIpC;;;;;;OAMG;IACH,cAAc,IAAI,yBAAyB,GAAG,SAAS;IAIvD,sBAAsB,CACpB,GAAG,IAAI,EAAE,UAAU,CAAC,8BAA8B,CAAC,GAClD,UAAU,CAAC,8BAA8B,CAAC;IAM7C;;;;;;;;;OASG;IACH,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,sBAAsB;IAIjE;;;;;;OAMG;IACH,iCAAiC,CAC/B,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC,GAClE,UAAU,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;IAI7D;;;;;;OAMG;IACH,kCAAkC,CAChC,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,0BAA0B,CAAC,CAAC,GACnE,UAAU,CAAC,mBAAmB,CAAC,0BAA0B,CAAC,CAAC;CA4H/D"}
@@ -2,9 +2,6 @@ import { BaseController } from "@metamask/base-controller";
2
2
  import type { TransactionMeta } from "@metamask/transaction-controller";
3
3
  import { CONTROLLER_NAME, TransactionPayStrategy } from "./constants.mjs";
4
4
  import type { GetAmountDataCallback, GetDelegationTransactionCallback, GetPaymentOverrideDataCallback, PolymarketCallbacks, TransactionConfigCallback, TransactionPayControllerMessenger, TransactionPayFiatOptions, TransactionPayControllerOptions, TransactionPayControllerState, UpdateFiatPaymentRequest, UpdatePaymentTokenRequest } from "./types.mjs";
5
- import type { SubmitMoneyAccountVaultDepositResult } from "./utils/ma-vault-deposit.mjs";
6
- import type { SubmitMoneyAccountVaultDepositRequest } from "./utils/ma-vault-payout.mjs";
7
- import type { SubmitMoneyAccountVaultWithdrawRequest } from "./utils/ma-vault-withdraw.mjs";
8
5
  export declare class TransactionPayController extends BaseController<typeof CONTROLLER_NAME, TransactionPayControllerState, TransactionPayControllerMessenger> {
9
6
  #private;
10
7
  constructor({ fiatOptions, getAmountData, getDelegationTransaction, getPaymentOverrideData, getStrategy, getStrategies, messenger, polymarket, resolveSourceAmount, state, }: TransactionPayControllerOptions);
@@ -40,32 +37,6 @@ export declare class TransactionPayController extends BaseController<typeof CONT
40
37
  * transaction ID and a callback to mutate fiat payment state.
41
38
  */
42
39
  updateFiatPayment(request: UpdateFiatPaymentRequest): void;
43
- /**
44
- * Vaults mUSD received in a completed Iron payout transaction.
45
- *
46
- * Concurrent calls for the same payout hash share one in-flight submission.
47
- * Successful results are retained for the controller lifetime so retries
48
- * return the prior hash without submitting again. Skipped results (vaulting
49
- * disabled) are not retained, so a later enablement can retry the same hash.
50
- *
51
- * @param request - Completed Iron payout details.
52
- * @returns Hash of the confirmed vault transaction, or `{ skipped: true }`
53
- * when vaulting is disabled.
54
- */
55
- submitMoneyAccountVaultDeposit(request: SubmitMoneyAccountVaultDepositRequest): Promise<SubmitMoneyAccountVaultDepositResult>;
56
- /**
57
- * Creates a user-confirmed exact-out vmUSD withdrawal to Iron.
58
- *
59
- * Concurrent calls with the same request ID share one in-flight batch setup.
60
- * Successful batch results are retained so a later call returns the same
61
- * `batchId` without creating another approval.
62
- *
63
- * @param request - Backend-bound exact-out Iron intent.
64
- * @returns Pending transaction batch ID.
65
- */
66
- submitMoneyAccountVaultWithdraw(request: SubmitMoneyAccountVaultWithdrawRequest): Promise<{
67
- batchId: `0x${string}`;
68
- }>;
69
40
  /**
70
41
  * Gets the delegation transaction for a given transaction.
71
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionPayController.d.mts","sourceRoot":"","sources":["../src/TransactionPayController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,E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I,EAAE,UAAU,CAAC,gCAAgC,CAAC,GACpD,UAAU,CAAC,gCAAgC,CAAC;IAI/C;;;;;;;;;OASG;IACH,aAAa,CACX,GAAG,IAAI,EAAE,UAAU,CAAC,qBAAqB,CAAC,GACzC,UAAU,CAAC,qBAAqB,CAAC;IAIpC;;;;;;OAMG;IACH,cAAc,IAAI,yBAAyB,GAAG,SAAS;IAIvD,sBAAsB,CACpB,GAAG,IAAI,EAAE,UAAU,CAAC,8BAA8B,CAAC,GAClD,UAAU,CAAC,8BAA8B,CAAC;IAM7C;;;;;;;;;OASG;IACH,WAAW,CAAC,WAAW,EAAE,eAAe,GAAG,sBAAsB;IAIjE;;;;;;OAMG;IACH,iCAAiC,CAC/B,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC,GAClE,UAAU,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;IAI7D;;;;;;OAMG;IACH,kCAAkC,CAChC,GAAG,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC,0BAA0B,CAAC,CAAC,GACnE,UAAU,CAAC,mBAAmB,CAAC,0BAA0B,CAAC,CAAC;CA4H/D"}
1
+ {"version":3,"file":"TransactionPayController.d.mts","sourceRoot":"","sources":["../src/TransactionPayController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,yCAAyC;AAMxE,OAAO,EACL,eAAe,EAEf,sBAAsB,EACvB,wBAAuB;AAExB,OAAO,KAAK,EACV,qBAAqB,EACrB,gCAAgC,EAChC,8BAA8B,EAC9B,mBAAmB,EAGnB,yBAAyB,EAEzB,iCAAiC,EACjC,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,wBAAwB,EACxB,yBAAyB,EAC1B,oBAAmB;AAmCpB,qBAAa,wBAAyB,SAAQ,cAAc,CAC1D,OAAO,eAAe,EACtB,6BAA6B,EAC7B,iCAAiC,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