@metamask-previews/transaction-pay-controller 31.2.1-preview-1ae799a5c → 31.2.1-preview-e80304db4

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 (100) hide show
  1. package/CHANGELOG.md +1 -20
  2. package/dist/TransactionPayController.d.ts.map +1 -1
  3. package/dist/TransactionPayController.js +5 -4
  4. package/dist/TransactionPayController.js.map +1 -1
  5. package/dist/actions/update-payment-token.d.ts.map +1 -1
  6. package/dist/actions/update-payment-token.js +22 -51
  7. package/dist/actions/update-payment-token.js.map +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/strategy/across/AcrossStrategy.d.ts.map +1 -1
  12. package/dist/strategy/across/AcrossStrategy.js +1 -6
  13. package/dist/strategy/across/AcrossStrategy.js.map +1 -1
  14. package/dist/strategy/across/across-quotes.js +4 -7
  15. package/dist/strategy/across/across-quotes.js.map +1 -1
  16. package/dist/strategy/across/across-submit.d.ts.map +1 -1
  17. package/dist/strategy/across/across-submit.js +1 -3
  18. package/dist/strategy/across/across-submit.js.map +1 -1
  19. package/dist/strategy/fiat/FiatStrategy.d.ts +0 -1
  20. package/dist/strategy/fiat/FiatStrategy.d.ts.map +1 -1
  21. package/dist/strategy/fiat/FiatStrategy.js +0 -4
  22. package/dist/strategy/fiat/FiatStrategy.js.map +1 -1
  23. package/dist/strategy/fiat/fiat-direct-musd.d.ts.map +1 -1
  24. package/dist/strategy/fiat/fiat-direct-musd.js +2 -4
  25. package/dist/strategy/fiat/fiat-direct-musd.js.map +1 -1
  26. package/dist/strategy/fiat/fiat-quotes.d.ts.map +1 -1
  27. package/dist/strategy/fiat/fiat-quotes.js +2 -4
  28. package/dist/strategy/fiat/fiat-quotes.js.map +1 -1
  29. package/dist/strategy/fiat/fiat-submit.d.ts.map +1 -1
  30. package/dist/strategy/fiat/fiat-submit.js +2 -5
  31. package/dist/strategy/fiat/fiat-submit.js.map +1 -1
  32. package/dist/strategy/fiat/fiat-test-funding.d.ts.map +1 -1
  33. package/dist/strategy/fiat/fiat-test-funding.js +5 -3
  34. package/dist/strategy/fiat/fiat-test-funding.js.map +1 -1
  35. package/dist/strategy/relay/RelayStrategy.d.ts +0 -4
  36. package/dist/strategy/relay/RelayStrategy.d.ts.map +1 -1
  37. package/dist/strategy/relay/RelayStrategy.js +1 -6
  38. package/dist/strategy/relay/RelayStrategy.js.map +1 -1
  39. package/dist/strategy/relay/relay-quotes.d.ts.map +1 -1
  40. package/dist/strategy/relay/relay-quotes.js +6 -10
  41. package/dist/strategy/relay/relay-quotes.js.map +1 -1
  42. package/dist/strategy/relay/relay-submit-execute.d.ts.map +1 -1
  43. package/dist/strategy/relay/relay-submit-execute.js +1 -3
  44. package/dist/strategy/relay/relay-submit-execute.js.map +1 -1
  45. package/dist/strategy/relay/relay-submit.d.ts.map +1 -1
  46. package/dist/strategy/relay/relay-submit.js +6 -8
  47. package/dist/strategy/relay/relay-submit.js.map +1 -1
  48. package/dist/strategy/relay/relay-validation.d.ts.map +1 -1
  49. package/dist/strategy/relay/relay-validation.js +2 -5
  50. package/dist/strategy/relay/relay-validation.js.map +1 -1
  51. package/dist/strategy/server/ServerStrategy.d.ts.map +1 -1
  52. package/dist/strategy/server/ServerStrategy.js +0 -4
  53. package/dist/strategy/server/ServerStrategy.js.map +1 -1
  54. package/dist/strategy/server/server-quotes.js +4 -7
  55. package/dist/strategy/server/server-quotes.js.map +1 -1
  56. package/dist/strategy/server/server-submit.d.ts.map +1 -1
  57. package/dist/strategy/server/server-submit.js +6 -9
  58. package/dist/strategy/server/server-submit.js.map +1 -1
  59. package/dist/strategy/server/server-validation.d.ts.map +1 -1
  60. package/dist/strategy/server/server-validation.js +1 -3
  61. package/dist/strategy/server/server-validation.js.map +1 -1
  62. package/dist/types.d.ts +25 -60
  63. package/dist/types.d.ts.map +1 -1
  64. package/dist/types.js.map +1 -1
  65. package/dist/utils/account.d.ts +0 -54
  66. package/dist/utils/account.d.ts.map +1 -1
  67. package/dist/utils/account.js +0 -124
  68. package/dist/utils/account.js.map +1 -1
  69. package/dist/utils/gas-payment.d.ts +3 -12
  70. package/dist/utils/gas-payment.d.ts.map +1 -1
  71. package/dist/utils/gas-payment.js +2 -2
  72. package/dist/utils/gas-payment.js.map +1 -1
  73. package/dist/utils/max-gas-station.d.ts.map +1 -1
  74. package/dist/utils/max-gas-station.js +5 -9
  75. package/dist/utils/max-gas-station.js.map +1 -1
  76. package/dist/utils/max-quote.js +2 -3
  77. package/dist/utils/max-quote.js.map +1 -1
  78. package/dist/utils/no-op-quote.d.ts +3 -3
  79. package/dist/utils/no-op-quote.d.ts.map +1 -1
  80. package/dist/utils/no-op-quote.js +3 -4
  81. package/dist/utils/no-op-quote.js.map +1 -1
  82. package/dist/utils/perps.d.ts.map +1 -1
  83. package/dist/utils/perps.js +2 -5
  84. package/dist/utils/perps.js.map +1 -1
  85. package/dist/utils/post-quote.js +3 -4
  86. package/dist/utils/post-quote.js.map +1 -1
  87. package/dist/utils/quotes.d.ts.map +1 -1
  88. package/dist/utils/quotes.js +25 -99
  89. package/dist/utils/quotes.js.map +1 -1
  90. package/dist/utils/source-amounts.d.ts.map +1 -1
  91. package/dist/utils/source-amounts.js +4 -25
  92. package/dist/utils/source-amounts.js.map +1 -1
  93. package/dist/utils/token.d.ts +1 -84
  94. package/dist/utils/token.d.ts.map +1 -1
  95. package/dist/utils/token.js +13 -144
  96. package/dist/utils/token.js.map +1 -1
  97. package/dist/utils/validation.d.ts.map +1 -1
  98. package/dist/utils/validation.js +11 -14
  99. package/dist/utils/validation.js.map +1 -1
  100. package/package.json +1 -2
@@ -5,7 +5,6 @@ import { getEIP7702UpgradeContractAddress, isServerValidationEnabled, } from '..
5
5
  import { GasPaymentMode } from '../../utils/gas-payment.js';
6
6
  import { buildPolymarketDepositWalletSimulation, isPredictWithdraw, } from '../../utils/polymarket/withdraw.js';
7
7
  import { build7702BatchSimulation, buildCallsSimulation, buildDelegationSimulation, } from '../../utils/simulation.js';
8
- import { getEvmQuoteSource } from '../../utils/token.js';
9
8
  import { validateQuotes } from '../../utils/validation.js';
10
9
  import { getServerDepositData } from './deposit-step.js';
11
10
  import { getServerExecuteDelegation, getServerGasPayment, getServerSubmitParams, } from './server-submit.js';
@@ -68,8 +67,7 @@ function shouldSkipValidation(quote, transaction, messenger) {
68
67
  return false;
69
68
  }
70
69
  async function buildServerSimulation(quote, messenger, transaction) {
71
- const { from, targetChainId } = quote.request;
72
- const { chainId: sourceChainId } = getEvmQuoteSource(quote.request);
70
+ const { from, sourceChainId, targetChainId } = quote.request;
73
71
  const context = { from, sourceChainId, targetChainId };
74
72
  if (quote.request.isPolymarketDepositWallet) {
75
73
  log('Building deposit wallet simulation', context);
@@ -1 +1 @@
1
- {"version":3,"file":"server-validation.js","sourceRoot":"","sources":["../../../src/strategy/server/server-validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,gCAAgC,EAChC,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,sCAAsC,EACtC,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,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WAAW,CAAC,CAAC;IAEtE,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,EAAE,CAAC;QAClD,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;QAE5C,MAAM,UAAU,GAAG,MAAM,0BAA0B,CACjD,KAAK,EACL,MAAM,EACN,SAAS,EACT,WAAW,CACZ,CAAC;QAEF,OAAO,yBAAyB,CAAC,EAAE,GAAG,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACtD,GAAG,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;QAE/C,wEAAwE;QACxE,yEAAyE;QACzE,6DAA6D;QAC7D,wDAAwD;QACxD,OAAO,wBAAwB,CAAC;YAC9B,oBAAoB,EAAE,gCAAgC,CACpD,SAAS,EACT,aAAa,CACd;YACD,KAAK,EAAE,MAAM;YACb,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,GAAG,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IAE3C,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import type { TransactionMeta } from '@metamask/transaction-controller';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport { projectLogger } from '../../logger.js';\nimport type {\n TransactionPayControllerMessenger,\n TransactionPayQuote,\n} from '../../types.js';\nimport { isMpcMoneyAccountPayer } from '../../utils/account.js';\nimport {\n getEIP7702UpgradeContractAddress,\n isServerValidationEnabled,\n} from '../../utils/feature-flags.js';\nimport { GasPaymentMode } from '../../utils/gas-payment.js';\nimport {\n buildPolymarketDepositWalletSimulation,\n isPredictWithdraw,\n} from '../../utils/polymarket/withdraw.js';\nimport {\n build7702BatchSimulation,\n buildCallsSimulation,\n buildDelegationSimulation,\n} from '../../utils/simulation.js';\nimport type { QuoteSimulation } from '../../utils/simulation.js';\nimport { getEvmQuoteSource } from '../../utils/token.js';\nimport { validateQuotes } from '../../utils/validation.js';\nimport { getServerDepositData } from './deposit-step.js';\nimport {\n getServerExecuteDelegation,\n getServerGasPayment,\n getServerSubmitParams,\n} from './server-submit.js';\nimport type { ServerQuote } from './types.js';\n\nconst log = createModuleLogger(projectLogger, 'server-validation');\n\nexport type ValidateServerQuotesRequest = {\n messenger: TransactionPayControllerMessenger;\n quotes: TransactionPayQuote<ServerQuote>[];\n signal?: AbortSignal;\n transaction: TransactionMeta;\n};\n\n/**\n * Validate server quotes by checking the live source balance and simulating\n * the transactions each quote would submit on the source chain.\n *\n * Gated by the `payStrategies.server.validationEnabled` feature flag.\n *\n * @param request - Validation request.\n */\nexport async function validateServerQuotes(\n request: ValidateServerQuotesRequest,\n): Promise<void> {\n const { messenger, quotes, signal, transaction } = request;\n\n if (!isServerValidationEnabled(messenger, transaction)) {\n return;\n }\n\n await validateQuotes({\n buildSimulation: async (quote) =>\n shouldSkipValidation(quote, transaction, messenger)\n ? undefined\n : await buildServerSimulation(quote, messenger, transaction),\n messenger,\n quotes,\n signal,\n });\n}\n\nfunction shouldSkipValidation(\n quote: TransactionPayQuote<ServerQuote>,\n transaction: TransactionMeta,\n messenger: TransactionPayControllerMessenger,\n): boolean {\n const { request } = quote;\n\n if (request.isHyperliquidSource) {\n log('Skipping quote validation: Hyperliquid source', {\n from: request.from,\n });\n return true;\n }\n\n // Legacy Safe Predict withdraws convert USDC.e to pUSD outside the calls the\n // controller can see, so they cannot be faithfully simulated and are skipped.\n if (\n isPredictWithdraw(request, transaction) &&\n !request.isPolymarketDepositWallet\n ) {\n log('Skipping quote validation: legacy Safe Predict withdraw', {\n from: request.from,\n });\n return true;\n }\n\n if (!quote.original.steps.some((step) => step.type === 'transaction')) {\n log('Skipping quote validation: no transaction steps', {\n from: request.from,\n });\n return true;\n }\n\n // Simulation rebuilds the submit calls, which signs a delegation through the\n // client payment-override callback. Skip that for an MPC Money payer so\n // quote refresh does not prompt for MFA ahead of the real submit.\n if (isMpcMoneyAccountPayer(messenger, request)) {\n log('Skipping quote validation: MPC Money account payer', {\n from: request.from,\n refundTo: request.refundTo,\n });\n return true;\n }\n\n return false;\n}\n\nasync function buildServerSimulation(\n quote: TransactionPayQuote<ServerQuote>,\n messenger: TransactionPayControllerMessenger,\n transaction: TransactionMeta,\n): Promise<QuoteSimulation> {\n const { from, targetChainId } = quote.request;\n const { chainId: sourceChainId } = getEvmQuoteSource(quote.request);\n const context = { from, sourceChainId, targetChainId };\n\n if (quote.request.isPolymarketDepositWallet) {\n log('Building deposit wallet simulation', context);\n\n return await buildPolymarketDepositWalletSimulation({\n depositData: getServerDepositData(quote.original),\n from,\n messenger,\n sourceAmountRaw: quote.sourceAmount.raw,\n });\n }\n\n const params = await getServerSubmitParams(quote, messenger, transaction);\n const gasPayment = getServerGasPayment(quote, messenger, transaction);\n\n if (gasPayment.mode === GasPaymentMode.Delegation) {\n log('Building execute simulation', context);\n\n const delegation = await getServerExecuteDelegation(\n quote,\n params,\n messenger,\n transaction,\n );\n\n return buildDelegationSimulation({ ...delegation, from });\n }\n\n if (params.length > 1 && quote.original.client.is7702) {\n log('Building 7702 batch simulation', context);\n\n // The batch is an ERC-7821 `execute` on the sender's own account, so an\n // authorization is always included as the live upgrade state is unknown.\n // The gas limit is omitted since it was estimated without an\n // authorization for accounts that are already upgraded.\n return build7702BatchSimulation({\n authorizationAddress: getEIP7702UpgradeContractAddress(\n messenger,\n sourceChainId,\n ),\n calls: params,\n from,\n });\n }\n\n log('Building normal simulation', context);\n\n return buildCallsSimulation(params);\n}\n"]}
1
+ {"version":3,"file":"server-validation.js","sourceRoot":"","sources":["../../../src/strategy/server/server-validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAw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AoC,EAAE,OAAO,CAAC,CAAC;QAEnD,OAAO,MAAM,sCAAsC,CAAC;YAClD,WAAW,EAAE,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC;YACjD,IAAI;YACJ,SAAS;YACT,eAAe,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG;SACxC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAC1E,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAEtE,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,EAAE,CAAC;QAClD,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;QAE5C,MAAM,UAAU,GAAG,MAAM,0BAA0B,CACjD,KAAK,EACL,MAAM,EACN,SAAS,EACT,WAAW,CACZ,CAAC;QAEF,OAAO,yBAAyB,CAAC,EAAE,GAAG,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACtD,GAAG,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;QAE/C,wEAAwE;QACxE,yEAAyE;QACzE,6DAA6D;QAC7D,wDAAwD;QACxD,OAAO,wBAAwB,CAAC;YAC9B,oBAAoB,EAAE,gCAAgC,CACpD,SAAS,EACT,aAAa,CACd;YACD,KAAK,EAAE,MAAM;YACb,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,GAAG,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IAE3C,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import type { TransactionMeta } from '@metamask/transaction-controller';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport { projectLogger } from '../../logger.js';\nimport type {\n TransactionPayControllerMessenger,\n TransactionPayQuote,\n} from '../../types.js';\nimport { isMpcMoneyAccountPayer } from '../../utils/account.js';\nimport {\n getEIP7702UpgradeContractAddress,\n isServerValidationEnabled,\n} from '../../utils/feature-flags.js';\nimport { GasPaymentMode } from '../../utils/gas-payment.js';\nimport {\n buildPolymarketDepositWalletSimulation,\n isPredictWithdraw,\n} from '../../utils/polymarket/withdraw.js';\nimport {\n build7702BatchSimulation,\n buildCallsSimulation,\n buildDelegationSimulation,\n} from '../../utils/simulation.js';\nimport type { QuoteSimulation } from '../../utils/simulation.js';\nimport { validateQuotes } from '../../utils/validation.js';\nimport { getServerDepositData } from './deposit-step.js';\nimport {\n getServerExecuteDelegation,\n getServerGasPayment,\n getServerSubmitParams,\n} from './server-submit.js';\nimport type { ServerQuote } from './types.js';\n\nconst log = createModuleLogger(projectLogger, 'server-validation');\n\nexport type ValidateServerQuotesRequest = {\n messenger: TransactionPayControllerMessenger;\n quotes: TransactionPayQuote<ServerQuote>[];\n signal?: AbortSignal;\n transaction: TransactionMeta;\n};\n\n/**\n * Validate server quotes by checking the live source balance and simulating\n * the transactions each quote would submit on the source chain.\n *\n * Gated by the `payStrategies.server.validationEnabled` feature flag.\n *\n * @param request - Validation request.\n */\nexport async function validateServerQuotes(\n request: ValidateServerQuotesRequest,\n): Promise<void> {\n const { messenger, quotes, signal, transaction } = request;\n\n if (!isServerValidationEnabled(messenger, transaction)) {\n return;\n }\n\n await validateQuotes({\n buildSimulation: async (quote) =>\n shouldSkipValidation(quote, transaction, messenger)\n ? undefined\n : await buildServerSimulation(quote, messenger, transaction),\n messenger,\n quotes,\n signal,\n });\n}\n\nfunction shouldSkipValidation(\n quote: TransactionPayQuote<ServerQuote>,\n transaction: TransactionMeta,\n messenger: TransactionPayControllerMessenger,\n): boolean {\n const { request } = quote;\n\n if (request.isHyperliquidSource) {\n log('Skipping quote validation: Hyperliquid source', {\n from: request.from,\n });\n return true;\n }\n\n // Legacy Safe Predict withdraws convert USDC.e to pUSD outside the calls the\n // controller can see, so they cannot be faithfully simulated and are skipped.\n if (\n isPredictWithdraw(request, transaction) &&\n !request.isPolymarketDepositWallet\n ) {\n log('Skipping quote validation: legacy Safe Predict withdraw', {\n from: request.from,\n });\n return true;\n }\n\n if (!quote.original.steps.some((step) => step.type === 'transaction')) {\n log('Skipping quote validation: no transaction steps', {\n from: request.from,\n });\n return true;\n }\n\n // Simulation rebuilds the submit calls, which signs a delegation through the\n // client payment-override callback. Skip that for an MPC Money payer so\n // quote refresh does not prompt for MFA ahead of the real submit.\n if (isMpcMoneyAccountPayer(messenger, request)) {\n log('Skipping quote validation: MPC Money account payer', {\n from: request.from,\n refundTo: request.refundTo,\n });\n return true;\n }\n\n return false;\n}\n\nasync function buildServerSimulation(\n quote: TransactionPayQuote<ServerQuote>,\n messenger: TransactionPayControllerMessenger,\n transaction: TransactionMeta,\n): Promise<QuoteSimulation> {\n const { from, sourceChainId, targetChainId } = quote.request;\n const context = { from, sourceChainId, targetChainId };\n\n if (quote.request.isPolymarketDepositWallet) {\n log('Building deposit wallet simulation', context);\n\n return await buildPolymarketDepositWalletSimulation({\n depositData: getServerDepositData(quote.original),\n from,\n messenger,\n sourceAmountRaw: quote.sourceAmount.raw,\n });\n }\n\n const params = await getServerSubmitParams(quote, messenger, transaction);\n const gasPayment = getServerGasPayment(quote, messenger, transaction);\n\n if (gasPayment.mode === GasPaymentMode.Delegation) {\n log('Building execute simulation', context);\n\n const delegation = await getServerExecuteDelegation(\n quote,\n params,\n messenger,\n transaction,\n );\n\n return buildDelegationSimulation({ ...delegation, from });\n }\n\n if (params.length > 1 && quote.original.client.is7702) {\n log('Building 7702 batch simulation', context);\n\n // The batch is an ERC-7821 `execute` on the sender's own account, so an\n // authorization is always included as the live upgrade state is unknown.\n // The gas limit is omitted since it was estimated without an\n // authorization for accounts that are already upgraded.\n return build7702BatchSimulation({\n authorizationAddress: getEIP7702UpgradeContractAddress(\n messenger,\n sourceChainId,\n ),\n calls: params,\n from,\n });\n }\n\n log('Building normal simulation', context);\n\n return buildCallsSimulation(params);\n}\n"]}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { AccountTreeControllerGetAccountContextAction, AccountTreeControllerGetAccountGroupObjectAction } from '@metamask/account-tree-controller';
2
1
  import type { AccountsControllerGetStateAction } from '@metamask/accounts-controller';
3
2
  import type { AssetsControllerGetStateAction, AssetsControllerStateChangeEvent } from '@metamask/assets-controller';
4
3
  import type { ControllerStateChangeEvent } from '@metamask/base-controller';
@@ -15,27 +14,21 @@ import type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote
15
14
  import type { SentinelApiServiceActions } from '@metamask/sentinel-api-service';
16
15
  import type { AuthorizationList, TransactionControllerAddTransactionBatchAction, TransactionControllerEstimateGasAction, TransactionControllerEstimateGasBatchAction, TransactionControllerUnapprovedTransactionAddedEvent } from '@metamask/transaction-controller';
17
16
  import type { BatchTransaction, BatchTransactionParams, TransactionControllerAddTransactionAction, TransactionControllerGetGasFeeTokensAction, TransactionControllerGetStateAction, TransactionControllerStateChangeEvent, TransactionControllerUpdateTransactionAction, TransactionMeta } from '@metamask/transaction-controller';
18
- import type { CaipAccountId, CaipAssetType, CaipChainId, Hex, Json } from '@metamask/utils';
17
+ import type { Hex, Json } from '@metamask/utils';
19
18
  import type { Draft } from 'immer';
20
19
  import type { CONTROLLER_NAME, PaymentOverride, TransactionPayClientId, TransactionPayStrategy } from './constants.js';
21
20
  import type { TransactionPayControllerMethodActions } from './TransactionPayController-method-action-types.js';
22
- export type AllowedActions = AccountTreeControllerGetAccountContextAction | AccountTreeControllerGetAccountGroupObjectAction | AccountsControllerGetStateAction | AssetsControllerGetStateAction | GetGasFeeState | KeyringControllerGetStateAction | KeyringControllerSignTypedMessageAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerGetNetworkConfigurationByChainIdAction | RampsControllerGetOrderAction | RampsControllerGetQuoteWithFeesAction | RemoteFeatureFlagControllerGetStateAction | SentinelApiServiceActions | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
21
+ export type AllowedActions = AccountsControllerGetStateAction | AssetsControllerGetStateAction | GetGasFeeState | KeyringControllerGetStateAction | KeyringControllerSignTypedMessageAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerGetNetworkConfigurationByChainIdAction | RampsControllerGetOrderAction | RampsControllerGetQuoteWithFeesAction | RemoteFeatureFlagControllerGetStateAction | SentinelApiServiceActions | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
23
22
  export type AllowedEvents = AssetsControllerStateChangeEvent | KeyringControllerUnlockEvent | TransactionControllerStateChangeEvent | TransactionControllerUnapprovedTransactionAddedEvent;
24
23
  export type TransactionPayControllerGetStateAction = ControllerGetStateAction<typeof CONTROLLER_NAME, TransactionPayControllerState>;
25
24
  /** Configurable properties of a transaction. */
26
25
  export type TransactionConfig = {
27
26
  /**
28
- * Optional ID of an `InternalAccount` to override the default account used
29
- * by the transaction.
27
+ * Optional address to override the default account used by the transaction.
30
28
  * When `isPostQuote` is true, used as the recipient of the MM Pay transfer.
31
29
  * When `isPostQuote` is false, it provides the funds and pays for gas.
32
- *
33
- * An EVM account overrides the EVM account. The account holding a non-EVM
34
- * payment token is the override account when it supports the payment token
35
- * chain, otherwise the account in the same account group as the override
36
- * account, or as the transaction account, that supports that chain.
37
30
  */
38
- accountOverride?: string;
31
+ accountOverride?: Hex;
39
32
  /**
40
33
  * Whether the target transaction (or `paymentOverride` batch) is executed
41
34
  * atomically with the Relay quote. Defaults to `true` (embedded in the quote
@@ -186,7 +179,7 @@ export type TransactionPayControllerOptions = {
186
179
  };
187
180
  /** State of the TransactionPayController. */
188
181
  export type TransactionPayControllerState = {
189
- /** Transient state relating to each transaction, keyed by transaction ID. */
182
+ /** State relating to each transaction, keyed by transaction ID. */
190
183
  transactionData: Record<string, TransactionData>;
191
184
  };
192
185
  /** Optional fiat execution configuration. */
@@ -199,17 +192,11 @@ export type TransactionPayFiatOptions = {
199
192
  /** State relating to a single transaction. */
200
193
  export type TransactionData = {
201
194
  /**
202
- * Optional ID of an `InternalAccount` to override the default account used
203
- * by the transaction.
195
+ * Optional address to override the default account used by the transaction.
204
196
  * When `isPostQuote` is true, used as the recipient of the MM Pay transfer.
205
197
  * When `isPostQuote` is false, it provides the funds and pays for gas.
206
- *
207
- * An EVM account overrides the EVM account. The account holding a non-EVM
208
- * payment token is the override account when it supports the payment token
209
- * chain, otherwise the account in the same account group as the override
210
- * account, or as the transaction account, that supports that chain.
211
198
  */
212
- accountOverride?: string;
199
+ accountOverride?: Hex;
213
200
  /**
214
201
  * Whether the target transaction is executed atomically with the Relay
215
202
  * quote. See {@link TransactionConfig.atomic}.
@@ -350,11 +337,8 @@ export type QuoteErrorInfo = {
350
337
  };
351
338
  /** Source token used to pay for required tokens. */
352
339
  export type TransactionPaymentToken = {
353
- /**
354
- * CAIP-19 asset type of the payment token, as keyed in `AssetsController`
355
- * state. The chain and, for EVM tokens, the token address are derived from it.
356
- */
357
- assetId: CaipAssetType;
340
+ /** Address of the payment token. */
341
+ address: Hex;
358
342
  /** Balance of the payment token in the selected currency. */
359
343
  balanceFiat: string;
360
344
  /** Balance of the payment token in a human-readable format factoring token decimals. */
@@ -363,21 +347,13 @@ export type TransactionPaymentToken = {
363
347
  balanceRaw: string;
364
348
  /** Balance of the payment token in USD. */
365
349
  balanceUsd: string;
350
+ /** Chain ID of the payment token. */
351
+ chainId: Hex;
366
352
  /** Decimals of the payment token. */
367
353
  decimals: number;
368
354
  /** Symbol of the payment token. */
369
355
  symbol: string;
370
356
  };
371
- /**
372
- * Payment token on an EVM chain, with its chain ID and token address derived
373
- * from its asset ID. Used internally by the EVM quote and balance paths.
374
- */
375
- export type EvmPaymentToken = TransactionPaymentToken & {
376
- /** Address of the payment token, derived from its asset ID. */
377
- address: Hex;
378
- /** Chain ID of the payment token, derived from its asset ID. */
379
- chainId: Hex;
380
- };
381
357
  /** Callback to update state for a single transaction. */
382
358
  export type UpdateTransactionDataCallback = (
383
359
  /** ID of the transaction to update. */
@@ -391,14 +367,7 @@ export type FiatRates = {
391
367
  /** Conversion rate for the native currency to USD. */
392
368
  usdRate: string;
393
369
  };
394
- /**
395
- * Request for a quote to retrieve a required token.
396
- *
397
- * The source is identified by its CAIP-19 asset type and CAIP-10 account for
398
- * every protocol. Strategies support or reject a request based on the
399
- * protocol of `sourceAssetId`, and EVM strategies derive the Hex chain ID and
400
- * token address from it.
401
- */
370
+ /** Request for a quote to retrieve a required token. */
402
371
  export type QuoteRequest = {
403
372
  /**
404
373
  * Selected account receiving post-quote output.
@@ -434,15 +403,12 @@ export type QuoteRequest = {
434
403
  refundTo?: Hex;
435
404
  /** Whether to skip processTransactions in relay-quotes. Defaults to `isPostQuote`. */
436
405
  skipProcessTransactions?: boolean;
437
- /** CAIP-10 account ID of the account holding the source token. */
438
- sourceAccountId: CaipAccountId;
439
- /**
440
- * CAIP-19 asset type of the source token. The protocol of its chain selects
441
- * the strategy execution path.
442
- */
443
- sourceAssetId: CaipAssetType;
444
406
  /** Balance of the source token in atomic format without factoring token decimals. */
445
407
  sourceBalanceRaw: string;
408
+ /** Chain ID of the source token. */
409
+ sourceChainId: Hex;
410
+ /** Address of the source token. */
411
+ sourceTokenAddress: Hex;
446
412
  /** Amount of the required token in atomic format without factoring token decimals. */
447
413
  sourceTokenAmount: string;
448
414
  /** Minimum amount required of the target token in atomic format without factoring token decimals. */
@@ -526,10 +492,7 @@ export type PayStrategyGetQuotesRequest = {
526
492
  from: Hex;
527
493
  /** Controller messenger. */
528
494
  messenger: TransactionPayControllerMessenger;
529
- /**
530
- * Quote requests for required tokens. Strategies support or reject the
531
- * requests based on the protocol of their `sourceAssetId`.
532
- */
495
+ /** Quote requests for required tokens. */
533
496
  requests: QuoteRequest[];
534
497
  /**
535
498
  * Signal that aborts when a newer quote request supersedes this one.
@@ -541,7 +504,7 @@ export type PayStrategyGetQuotesRequest = {
541
504
  transaction: TransactionMeta;
542
505
  };
543
506
  /** Request to submit quotes for a transaction. */
544
- export type PayStrategyExecuteRequest<OriginalQuote> = {
507
+ export type PayStrategyExecuteRequest<OriginalRequest> = {
545
508
  /** Whether the account supports EIP-7702 authorization signing. */
546
509
  accountSupports7702: boolean;
547
510
  /** Callback to determine if the transaction is a smart transaction. */
@@ -549,7 +512,7 @@ export type PayStrategyExecuteRequest<OriginalQuote> = {
549
512
  /** Controller messenger. */
550
513
  messenger: TransactionPayControllerMessenger;
551
514
  /** Quotes to be submitted. */
552
- quotes: TransactionPayQuote<OriginalQuote>[];
515
+ quotes: TransactionPayQuote<OriginalRequest>[];
553
516
  /** Metadata of the original target transaction. */
554
517
  transaction: TransactionMeta;
555
518
  };
@@ -575,8 +538,8 @@ export type PayStrategyCheckQuoteSupportRequest<OriginalQuote> = {
575
538
  };
576
539
  /** Request to get refresh interval for a specific strategy. */
577
540
  export type PayStrategyGetRefreshIntervalRequest = {
578
- /** CAIP-2 chain ID of the source asset. */
579
- chainId: CaipChainId;
541
+ /** Chain ID of the source or payment token. */
542
+ chainId: Hex;
580
543
  /** Controller messenger. */
581
544
  messenger: TransactionPayControllerMessenger;
582
545
  /** ID of the transaction whose refresh interval is being resolved. */
@@ -638,8 +601,10 @@ export type TransactionPayTotals = {
638
601
  export type UpdatePaymentTokenRequest = {
639
602
  /** ID of the transaction to update. */
640
603
  transactionId: string;
641
- /** CAIP-19 asset type of the new payment token. */
642
- assetId: CaipAssetType;
604
+ /** Address of the new payment token. */
605
+ tokenAddress: Hex;
606
+ /** Chain ID of the new payment token. */
607
+ chainId: Hex;
643
608
  };
644
609
  /** Request to update fiat payment state for a transaction. */
645
610
  export type UpdateFiatPaymentRequest = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4CAA4C,EAC5C,gDAAgD,EACjD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,KAAK,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EACV,+BAA+B,EAC/B,uCAAuC,EACvC,4BAA4B,EAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,mDAAmD,EAAE,MAAM,8BAA8B,CAAC;AACxG,OAAO,KAAK,EAAE,2CAA2C,EAAE,MAAM,8BAA8B,CAAC;AAChG,OAAO,KAAK,EAAE,uDAAuD,EAAE,MAAM,8BAA8B,CAAC;AAC5G,OAAO,KAAK,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAC1G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EACV,iBAAiB,EACjB,8CAA8C,EAC9C,sCAAsC,EACtC,2CAA2C,EAC3C,oDAAoD,EACrD,MAAM,kC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AAC;CACb,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AccountTreeControllerGetAccountContextAction,\n AccountTreeControllerGetAccountGroupObjectAction,\n} from '@metamask/account-tree-controller';\nimport type { AccountsControllerGetStateAction } from '@metamask/accounts-controller';\nimport type {\n AssetsControllerGetStateAction,\n AssetsControllerStateChangeEvent,\n} from '@metamask/assets-controller';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { GetGasFeeState } from '@metamask/gas-fee-controller';\nimport type {\n KeyringControllerGetStateAction,\n KeyringControllerSignTypedMessageAction,\n KeyringControllerUnlockEvent,\n} from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkConfigurationByChainIdAction } from '@metamask/network-controller';\nimport type { Quote as RampsQuote } from '@metamask/ramps-controller';\nimport type {\n RampsControllerGetOrderAction,\n RampsControllerGetQuoteWithFeesAction,\n} from '@metamask/ramps-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type { SentinelApiServiceActions } from '@metamask/sentinel-api-service';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\n BatchTransactionParams,\n TransactionControllerAddTransactionAction,\n TransactionControllerGetGasFeeTokensAction,\n TransactionControllerGetStateAction,\n TransactionControllerStateChangeEvent,\n TransactionControllerUpdateTransactionAction,\n TransactionMeta,\n} from '@metamask/transaction-controller';\nimport type {\n CaipAccountId,\n CaipAssetType,\n CaipChainId,\n Hex,\n Json,\n} from '@metamask/utils';\nimport type { Draft } from 'immer';\n\nimport type {\n CONTROLLER_NAME,\n PaymentOverride,\n TransactionPayClientId,\n TransactionPayStrategy,\n} from './constants.js';\nimport type { TransactionPayControllerMethodActions } from './TransactionPayController-method-action-types.js';\n\nexport type AllowedActions =\n | AccountTreeControllerGetAccountContextAction\n | AccountTreeControllerGetAccountGroupObjectAction\n | AccountsControllerGetStateAction\n | AssetsControllerGetStateAction\n | GetGasFeeState\n | KeyringControllerGetStateAction\n | KeyringControllerSignTypedMessageAction\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerGetNetworkConfigurationByChainIdAction\n | RampsControllerGetOrderAction\n | RampsControllerGetQuoteWithFeesAction\n | RemoteFeatureFlagControllerGetStateAction\n | SentinelApiServiceActions\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | AssetsControllerStateChangeEvent\n | KeyringControllerUnlockEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\n /**\n * Optional ID of an `InternalAccount` to override the default account used\n * by the transaction.\n * When `isPostQuote` is true, used as the recipient of the MM Pay transfer.\n * When `isPostQuote` is false, it provides the funds and pays for gas.\n *\n * An EVM account overrides the EVM account. The account holding a non-EVM\n * payment token is the override account when it supports the payment token\n * chain, otherwise the account in the same account group as the override\n * account, or as the transaction account, that supports that chain.\n */\n accountOverride?: string;\n\n /**\n * Whether the target transaction (or `paymentOverride` batch) is executed\n * atomically with the Relay quote. Defaults to `true` (embedded in the quote\n * and executed by the Relay solver). When `false`, Pay does not embed the\n * target/override calls in the quote; the quote only bridges the required\n * asset to `recipient`, and the calls are submitted separately after Relay\n * completion. Used by flows whose second-leg amount is only known after\n * Relay settles (EXACT_INPUT max flows) or that require the second leg to\n * originate from a different signer than the Relay solver.\n * For max deposits enabled by `payStrategies.relay.atomicMaxEnabled`, this\n * is a subsidy hint: atomic quotes are retried non-atomically if not\n * subsidized, and subsidized non-atomic quotes are upgraded to atomic.\n */\n atomic?: boolean;\n\n /**\n * Whether the source of funds is HyperLiquid (HyperCore).\n * When true, the Relay strategy uses the HyperLiquid 2-step withdrawal\n * flow: (1) authorize nonce-mapping, (2) sendAsset to Relay solver.\n */\n isHyperliquidSource?: boolean;\n\n /** Whether the source of funds is a Polymarket deposit wallet. */\n isPolymarketDepositWallet?: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n */\n isPostQuote?: boolean;\n\n /** Overrides the payment source for the transaction. */\n paymentOverride?: PaymentOverride;\n\n /** When true, a quote is always fetched even when the source and target tokens are identical. */\n isQuoteRequired?: boolean;\n\n /**\n * Optional address to receive refunds if the quote provider transaction fails.\n * When set, overrides the default refund recipient (EOA) in the quote\n * request. Use this for post-quote flows where the user's funds originate\n * from a smart contract account (e.g. Predict Safe proxy) so that refunds\n * go back to that account rather than the EOA.\n */\n refundTo?: Hex;\n};\n\n/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\n/** Request passed to {@link GetPaymentOverrideDataCallback}. */\nexport type GetPaymentOverrideDataRequest = {\n /** Amount of the source token in human-readable format. */\n amount: string;\n\n /** Metadata of the original transaction. */\n transaction: TransactionMeta;\n\n /** Pay-controller state for the transaction. */\n transactionData: TransactionData;\n};\n\n/** Response returned by {@link GetPaymentOverrideDataCallback}. */\nexport type GetPaymentOverrideDataResponse = {\n /** Batch transaction params to prepend to the submit batch. */\n calls: BatchTransactionParams[];\n\n /** Optional recipient address for the funding token transfer. */\n recipient?: Hex;\n\n /** Optional EIP-7702 authorization list from delegation. */\n authorizationList?: AuthorizationList;\n};\n\n/**\n * Callback invoked during submit when `paymentOverride` is defined.\n * Returns batch transaction params to prepend to the submit batch.\n */\nexport type GetPaymentOverrideDataCallback = (\n request: GetPaymentOverrideDataRequest,\n) => Promise<GetPaymentOverrideDataResponse>;\n\nexport type GetAmountDataRequest = {\n /** Raw token amount (atomic units) to encode into calldata. */\n amount: string;\n\n /** Metadata of the transaction whose nested calls need updating. */\n transaction: TransactionMeta;\n};\n\nexport type GetAmountDataResponse = {\n /** Per-nested-call data updates; empty when no update is needed. */\n updates: { nestedTransactionIndex: number; data: Hex }[];\n};\n\n/**\n * Optional callback that re-encodes nested transaction calldata for a given\n * token amount. Used by transaction types with non-standard nested data\n * (e.g. vault approve + deposit) that cannot be derived from the amount alone\n * without client-side context (vault config, RPC providers, etc.).\n */\nexport type GetAmountDataCallback = (\n request: GetAmountDataRequest,\n) => Promise<GetAmountDataResponse>;\n\n/** Request passed to {@link GetBalanceCallback}. */\nexport type GetBalanceRequest = {\n /** Metadata of the transaction whose source balance is being resolved. */\n transaction: TransactionMeta;\n /** Pay-controller state for the transaction. */\n transactionData: TransactionData;\n};\n\n/** Balance override returned by {@link GetBalanceCallback}. */\nexport type GetBalanceResponse = {\n /** Balance in atomic format without factoring token decimals. */\n balanceRaw: string;\n};\n\n/**\n * Optional client-supplied callback that overrides the built-in\n * pay-token / required-token balance lookup used for `isMaxAmount`\n * source-amount calculation. Enables alternate balance sources\n * (perps, predict, money-account, post-quote, etc.) without adding\n * conditional branches inside the controller. MUST be synchronous:\n * it runs inside the controller state-update block.\n * Return `undefined` to fall back to the built-in token balance.\n */\nexport type GetBalanceCallback = (\n request: GetBalanceRequest,\n) => GetBalanceResponse | undefined;\n\n/** Callback to update fiat payment state. */\nexport type TransactionFiatPaymentCallback = (\n fiatPayment: TransactionFiatPayment,\n) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerMethodActions;\n\nexport type TransactionPayControllerEvents =\n TransactionPayControllerStateChangeEvent;\n\nexport type TransactionPayControllerMessenger = Messenger<\n typeof CONTROLLER_NAME,\n TransactionPayControllerActions | AllowedActions,\n TransactionPayControllerEvents | AllowedEvents\n>;\n\n/** Options for the TransactionPayController. */\nexport type TransactionPayControllerOptions = {\n /**\n * Identifies the MetaMask client, sent as the `X-Client-Id` header on\n * requests to the intents API so the server can distinguish Mobile from\n * Extension traffic.\n */\n clientId?: TransactionPayClientId;\n\n /** Optional callback to re-encode nested transaction calldata for a given amount. */\n getAmountData?: GetAmountDataCallback;\n\n /** Optional callback to override the source balance used for max-amount calculation. */\n getBalance?: GetBalanceCallback;\n\n /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Optional fiat execution configuration. */\n fiatOptions?: TransactionPayFiatOptions;\n\n /**\n * Optional callback invoked during quote execution when `paymentOverride` is defined.\n * Returns additional transactions to be submitted alongside the quote batch.\n */\n getPaymentOverrideData?: GetPaymentOverrideDataCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Callback to select ordered PayStrategies for a transaction. */\n getStrategies?: (transaction: TransactionMeta) => TransactionPayStrategy[];\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Callbacks for the Polymarket relayer; required only for the Polymarket deposit-wallet flow. */\n polymarket?: PolymarketCallbacks;\n\n /** Initial state of the controller. */\n state?: Partial<TransactionPayControllerState>;\n};\n\n/** State of the TransactionPayController. */\nexport type TransactionPayControllerState = {\n /** Transient state relating to each transaction, keyed by transaction ID. */\n transactionData: Record<string, TransactionData>;\n};\n\n/** Optional fiat execution configuration. */\nexport type TransactionPayFiatOptions = {\n /** Test funding source used to bypass fiat on-ramp execution during local QA. */\n testFundingSource?: Hex;\n\n /** Optional human amount to transfer from the test funding source. */\n testAmountOverride?: string;\n};\n\n/** State relating to a single transaction. */\nexport type TransactionData = {\n /**\n * Optional ID of an `InternalAccount` to override the default account used\n * by the transaction.\n * When `isPostQuote` is true, used as the recipient of the MM Pay transfer.\n * When `isPostQuote` is false, it provides the funds and pays for gas.\n *\n * An EVM account overrides the EVM account. The account holding a non-EVM\n * payment token is the override account when it supports the payment token\n * chain, otherwise the account in the same account group as the override\n * account, or as the transaction account, that supports that chain.\n */\n accountOverride?: string;\n\n /**\n * Whether the target transaction is executed atomically with the Relay\n * quote. See {@link TransactionConfig.atomic}.\n */\n atomic?: boolean;\n\n /** Fiat payment method state. */\n fiatPayment?: TransactionFiatPayment;\n\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n * Used when funds need to be moved after a transaction completes\n * (e.g., bridging output to a different token/chain).\n */\n isPostQuote?: boolean;\n\n /** Whether the source of funds is HyperLiquid (HyperCore). */\n isHyperliquidSource?: boolean;\n\n /** Whether the source of funds is a Polymarket deposit wallet. */\n isPolymarketDepositWallet?: boolean;\n\n /** Overrides the payment source for the transaction. */\n paymentOverride?: PaymentOverride;\n\n /** When true, a quote is always fetched even when the source and target tokens are identical. */\n isQuoteRequired?: boolean;\n\n /**\n * Optional address to receive refunds if the quote provider transaction fails.\n * When set, overrides the default refund recipient (EOA) in the quote\n * request.\n */\n refundTo?: Hex;\n\n /**\n * Token selected for the transaction.\n * - For standard flows (isPostQuote=false): This is the SOURCE/payment token\n * - For post-quote flows (isPostQuote=true): This is the DESTINATION token\n */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\n\n /** Most relevant structured validation error from the latest quote attempt. */\n quoteError?: QuoteErrorInfo;\n\n /** Timestamp of when quotes were last updated. */\n quotesLastUpdated?: number;\n\n /** Amounts of payment token required for each required token. */\n sourceAmounts?: TransactionPaySourceAmount[];\n\n /** Tokens required by the transaction. */\n tokens: TransactionPayRequiredToken[];\n\n /** Calculated totals for the transaction. */\n totals?: TransactionPayTotals;\n};\n\n/** Fiat payment state stored per transaction. */\nexport type TransactionFiatPayment = {\n /** Entered fiat amount for the selected payment method. */\n amountFiat?: string;\n\n /** CAIP-19 asset id derived from the transaction type for the fiat on-ramp. */\n caipAssetId?: string;\n\n /** Order identifier in normalized format (/providers/{provider}/orders/{id}). */\n orderId?: string;\n\n /** The ramps quote received from the ramps provider. */\n rampsQuote?: RampsQuote;\n\n /** Selected fiat payment method ID. */\n selectedPaymentMethodId?: string;\n};\n\n/** A token required by a transaction. */\nexport type TransactionPayRequiredToken = {\n /** Address of the required token. */\n address: Hex;\n\n /** Whether to allow quotes that return less than the minimum amount requested. */\n allowUnderMinimum: boolean;\n\n /** Amount required in the selected currency. */\n amountFiat: string;\n\n /** Amount required in a human-readable format factoring token decimals. */\n amountHuman: string;\n\n /** Amount required in atomic format without factoring token decimals. */\n amountRaw: string;\n\n /** Amount required in USD. */\n amountUsd: string;\n\n /** Balance of the required token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the required token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the required token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the required token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the required token. */\n chainId: Hex;\n\n /** Decimals of the required token. */\n decimals: number;\n\n /** Whether to skip transfer of this token if balance is already sufficient. */\n skipIfBalance: boolean;\n\n /** Symbol of the required token. */\n symbol: string;\n};\n\n/** Amount of payment token required by a required token. */\nexport type TransactionPaySourceAmount = {\n /** Amount of payment token required in the selected currency. */\n sourceAmountHuman: string;\n\n /** Amount of payment token required in atomic format without factoring token decimals. */\n sourceAmountRaw: string;\n\n /** Balance of the source token in atomic format (for post-quote flows). */\n sourceBalanceRaw?: string;\n\n /** Chain ID of the source token (for post-quote flows). */\n sourceChainId?: Hex;\n\n /** Address of the source token (for post-quote flows). */\n sourceTokenAddress?: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/**\n * Machine-readable discriminator for a quote validation failure.\n *\n * Used for analytics and tests. Human-readable copy is carried by `message`\n * and `detail` on {@link QuoteErrorInfo}.\n */\nexport type QuoteErrorReason =\n /**\n * @deprecated No longer emitted. An unreadable live balance is treated as\n * unknown rather than insufficient, so it no longer blocks the quote. Kept\n * so existing consumers and historical analytics still type-check.\n */\n | 'balance-unavailable'\n | 'insufficient-source-balance'\n | 'insufficient-transfer-balance'\n | 'no-quotes'\n | 'simulation-failed';\n\n/**\n * Structured description of why a quote failed validation.\n *\n * `message` and `detail` are formatted (English) copy ready to display; `reason`\n * is a machine-readable discriminator for analytics and tests.\n */\nexport type QuoteErrorInfo = {\n /** Short, display-ready summary of the failure. */\n message: string;\n\n /** Machine-readable discriminator for the failure. */\n reason: QuoteErrorReason;\n\n /** Optional display-ready detail rows (e.g. Required / Current / Missing). */\n detail?: string[];\n};\n\n/** Source token used to pay for required tokens. */\nexport type TransactionPaymentToken = {\n /**\n * CAIP-19 asset type of the payment token, as keyed in `AssetsController`\n * state. The chain and, for EVM tokens, the token address are derived from it.\n */\n assetId: CaipAssetType;\n\n /** Balance of the payment token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the payment token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the payment token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the payment token in USD. */\n balanceUsd: string;\n\n /** Decimals of the payment token. */\n decimals: number;\n\n /** Symbol of the payment token. */\n symbol: string;\n};\n\n/**\n * Payment token on an EVM chain, with its chain ID and token address derived\n * from its asset ID. Used internally by the EVM quote and balance paths.\n */\nexport type EvmPaymentToken = TransactionPaymentToken & {\n /** Address of the payment token, derived from its asset ID. */\n address: Hex;\n\n /** Chain ID of the payment token, derived from its asset ID. */\n chainId: Hex;\n};\n\n/** Callback to update state for a single transaction. */\nexport type UpdateTransactionDataCallback = (\n /** ID of the transaction to update. */\n transactionId: string,\n /** Function that receives a draft of the transaction data to update. */\n fn: (data: Draft<TransactionData>) => void,\n) => void;\n\n/** Conversion rates from the native currency to other currencies. */\nexport type FiatRates = {\n /** Conversion rate for the native currency to the selected fiat currency. */\n fiatRate: string;\n\n /** Conversion rate for the native currency to USD. */\n usdRate: string;\n};\n\n/**\n * Request for a quote to retrieve a required token.\n *\n * The source is identified by its CAIP-19 asset type and CAIP-10 account for\n * every protocol. Strategies support or reject a request based on the\n * protocol of `sourceAssetId`, and EVM strategies derive the Hex chain ID and\n * token address from it.\n */\nexport type QuoteRequest = {\n /**\n * Selected account receiving post-quote output.\n * See {@link TransactionConfig.accountOverride}.\n */\n accountOverride?: Hex;\n\n /**\n * Whether the target transaction is executed atomically with the Relay\n * quote. See {@link TransactionConfig.atomic}.\n */\n atomic?: boolean;\n\n /** Address of the user's account. */\n from: Hex;\n\n /** Whether the transaction is a maximum amount transaction. */\n isMaxAmount?: boolean;\n\n /** Whether this is a post-quote flow. */\n isPostQuote?: boolean;\n\n /** Whether the source of funds is HyperLiquid (HyperCore). */\n isHyperliquidSource?: boolean;\n\n /** Whether the source of funds is a Polymarket deposit wallet. */\n isPolymarketDepositWallet?: boolean;\n\n /** Whether this quote is the direct mUSD-to-Money-Account fiat flow. */\n isDirectMusdMoneyAccount?: boolean;\n\n /** Overrides the payment source for the transaction. */\n paymentOverride?: PaymentOverride;\n\n /** Optional recipient address for Relay requests. When set, overrides the default `from` address. */\n recipient?: Hex;\n\n /**\n * Optional address to receive refunds if the quote provider transaction fails.\n * When set, overrides the default refund recipient (EOA) in the quote\n * request.\n */\n refundTo?: Hex;\n\n /** Whether to skip processTransactions in relay-quotes. Defaults to `isPostQuote`. */\n skipProcessTransactions?: boolean;\n\n /** CAIP-10 account ID of the account holding the source token. */\n sourceAccountId: CaipAccountId;\n\n /**\n * CAIP-19 asset type of the source token. The protocol of its chain selects\n * the strategy execution path.\n */\n sourceAssetId: CaipAssetType;\n\n /** Balance of the source token in atomic format without factoring token decimals. */\n sourceBalanceRaw: string;\n\n /** Amount of the required token in atomic format without factoring token decimals. */\n sourceTokenAmount: string;\n\n /** Minimum amount required of the target token in atomic format without factoring token decimals. */\n targetAmountMinimum: string;\n\n /** Chain ID of the target token. */\n targetChainId: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n\n /**\n * One-time HyperLiquid activation fee (USD) reserved from the source amount\n * for an unactivated HyperCore account. The source amount sent to the\n * provider is reduced by this amount so HyperLiquid retains enough balance\n * for the fee, and the amount is surfaced as part of the provider fee.\n */\n hyperliquidActivationFeeUsd?: string;\n};\n\n/** Fees associated with a transaction pay quote. */\nexport type TransactionPayFees = {\n /** Whether a gas fee token is used to pay source network fees. */\n isSourceGasFeeToken?: boolean;\n\n /** Whether a gas fee token is used to pay target network fees. */\n isTargetGasFeeToken?: boolean;\n\n /** Fee charged by MetaMask. */\n metaMask: FiatValue;\n\n /** Fee charged by the quote provider. */\n provider: FiatValue;\n\n /** Fee charged by fiat on-ramp provider (breakdown of the provider total). */\n providerFiat?: FiatValue;\n\n /** Network fee for transactions on the source network. */\n sourceNetwork: {\n estimate: Amount;\n max: Amount;\n };\n\n /** Network fee for transactions on the target network. */\n targetNetwork: FiatValue;\n};\n\n/** Quote returned to retrieve a required token using the payment token. */\nexport type TransactionPayQuote<OriginalQuote> = {\n /** Additional amount provided by the quote beyond the minimum requested. */\n dust: FiatValue;\n\n /** Duration estimated for the transaction to complete in seconds. */\n estimatedDuration: number;\n\n /** Fees associated with the transaction pay quote. */\n fees: TransactionPayFees;\n\n /** Whether fees are subtracted from the destination amount, meaning the input amount is static. */\n isInputBased?: boolean;\n\n /** Whether the reported fees are already included in the source amount. */\n areFeesIncludedInSourceAmount?: boolean;\n\n /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\n\n /**\n * Whether the target calls could not be embedded in the quote and must be\n * submitted separately, on the target chain, once the quote settles.\n *\n * Set by the strategy at quote time, since only it knows whether the provider\n * accepted the calls. {@link TransactionConfig.atomic} is a hint rather than\n * a guarantee: a quote requested atomically still falls back to a second leg\n * when the provider cannot execute the calls itself.\n */\n requiresSecondLeg?: boolean;\n\n /** Amount of source token required. */\n sourceAmount: Amount;\n\n /** Name of the strategy used to retrieve the quote. */\n strategy: TransactionPayStrategy;\n\n /** Amount of target token provided. */\n targetAmount: FiatValue;\n};\n\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Whether the account supports EIP-7702 authorization signing. */\n accountSupports7702: boolean;\n\n /** Selected fiat payment method ID, if applicable. */\n fiatPaymentMethod?: string;\n\n /**\n * Account sending the quotes: `txParams.from` for post-quote flows,\n * otherwise `accountOverride ?? txParams.from`. Pre-computed by the quote\n * orchestrator so that individual strategies do not need to re-derive it.\n */\n from: Hex;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /**\n * Quote requests for required tokens. Strategies support or reject the\n * requests based on the protocol of their `sourceAssetId`.\n */\n requests: QuoteRequest[];\n\n /**\n * Signal that aborts when a newer quote request supersedes this one.\n * Strategies that perform their own network IO should forward this to\n * their fetch calls so cancelled requests release network resources.\n */\n signal?: AbortSignal;\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to submit quotes for a transaction. */\nexport type PayStrategyExecuteRequest<OriginalQuote> = {\n /** Whether the account supports EIP-7702 authorization signing. */\n accountSupports7702: boolean;\n\n /** Callback to determine if the transaction is a smart transaction. */\n isSmartTransaction: (chainId: Hex) => boolean;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes to be submitted. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get batch transactions for quotes. */\nexport type PayStrategyGetBatchRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes for required tokens. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n\n /** Signal that aborts when a newer quote request supersedes this one. */\n signal?: AbortSignal;\n};\n\n/** Request to check whether retrieved quotes can be executed by a strategy. */\nexport type PayStrategyCheckQuoteSupportRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes returned by the strategy. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n\n /** Signal that aborts when a newer quote request supersedes this one. */\n signal?: AbortSignal;\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get refresh interval for a specific strategy. */\nexport type PayStrategyGetRefreshIntervalRequest = {\n /** CAIP-2 chain ID of the source asset. */\n chainId: CaipChainId;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** ID of the transaction whose refresh interval is being resolved. */\n transactionId: string;\n};\n\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /**\n * Check if the strategy supports the given request.\n * Defaults to true if not implemented.\n */\n supports?: (\n request: PayStrategyGetQuotesRequest,\n ) => boolean | Promise<boolean>;\n\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\n\n /**\n * Check if the returned quotes are supported after provider quote\n * construction and gas planning.\n *\n * Use this for limitations that are only knowable once quote metadata is\n * available, such as whether execution will require an EIP-7702\n * authorization list.\n */\n checkQuoteSupport?: (\n request: PayStrategyCheckQuoteSupportRequest<OriginalQuote>,\n ) => boolean | Promise<boolean>;\n\n /** Retrieve batch transactions for quotes, if supported by the strategy. */\n getBatchTransactions?: (\n request: PayStrategyGetBatchRequest<OriginalQuote>,\n ) => Promise<BatchTransaction[]>;\n\n /**\n * Retrieve refresh interval for the strategy, if applicable.\n * Defaults to 30 seconds.\n */\n getRefreshInterval?: (\n request: PayStrategyGetRefreshIntervalRequest,\n ) => Promise<number | undefined>;\n\n /** Execute or submit the quotes to obtain required tokens. */\n execute: (request: PayStrategyExecuteRequest<OriginalQuote>) => Promise<{\n transactionHash?: Hex;\n }>;\n};\n\n/** Single fiat value in alternate currencies. */\nexport type FiatValue = {\n /** Value in the selected fiat currency. */\n fiat: string;\n\n /** Value in USD. */\n usd: string;\n};\n\n/** Calculated totals for a target transaction and all quotes. */\nexport type TransactionPayTotals = {\n /** Total estimated duration for the target transaction and all quotes. */\n estimatedDuration: number;\n\n /** Total fees for the target transaction and all quotes. */\n fees: TransactionPayFees;\n\n /** Whether the selected quotes subtract fees from the destination amount, meaning the input amount is static. */\n isInputBased?: boolean;\n\n /** Total amount of source token required. */\n sourceAmount: Amount;\n\n /** Total amount of target token provided. */\n targetAmount: FiatValue;\n\n /** Overall total cost for the target transaction and all quotes. */\n total: FiatValue;\n};\n\n/** Request to update the payment token for a transaction. */\nexport type UpdatePaymentTokenRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** CAIP-19 asset type of the new payment token. */\n assetId: CaipAssetType;\n};\n\n/** Request to update fiat payment state for a transaction. */\nexport type UpdateFiatPaymentRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Callback to mutate fiat payment state. */\n callback: TransactionFiatPaymentCallback;\n};\n\n/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n isSubsidized,\n}: {\n transaction: TransactionMeta;\n isSubsidized?: boolean;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: Hex;\n}>;\n\n/** Client-supplied callbacks for the Polymarket relayer protocol. */\nexport type PolymarketCallbacks = {\n /** Derive the deposit-wallet address (CREATE2) for the given EOA. */\n getDepositWalletAddress: (params: { eoa: Hex }) => Promise<Hex>;\n\n /** Sign and broadcast a deposit-wallet batch, returning the source hash. */\n submitDepositWalletBatch: (params: {\n eoa: Hex;\n depositWallet: Hex;\n calls: { target: Hex; data: Hex; value: string }[];\n }) => Promise<{ sourceHash: Hex }>;\n};\n\n/** Single amount in alternate formats. */\nexport type Amount = FiatValue & {\n /** Amount in human-readable format factoring token decimals. */\n human: string;\n\n /** Amount in atomic format without factoring token decimals. */\n raw: string;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountsControllerGetStateAction } from '@metamask/accounts-controller';\nimport type {\n AssetsControllerGetStateAction,\n AssetsControllerStateChangeEvent,\n} from '@metamask/assets-controller';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { GetGasFeeState } from '@metamask/gas-fee-controller';\nimport type {\n KeyringControllerGetStateAction,\n KeyringControllerSignTypedMessageAction,\n KeyringControllerUnlockEvent,\n} from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkConfigurationByChainIdAction } from '@metamask/network-controller';\nimport type { Quote as RampsQuote } from '@metamask/ramps-controller';\nimport type {\n RampsControllerGetOrderAction,\n RampsControllerGetQuoteWithFeesAction,\n} from '@metamask/ramps-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type { SentinelApiServiceActions } from '@metamask/sentinel-api-service';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\n BatchTransactionParams,\n TransactionControllerAddTransactionAction,\n TransactionControllerGetGasFeeTokensAction,\n TransactionControllerGetStateAction,\n TransactionControllerStateChangeEvent,\n TransactionControllerUpdateTransactionAction,\n TransactionMeta,\n} from '@metamask/transaction-controller';\nimport type { Hex, Json } from '@metamask/utils';\nimport type { Draft } from 'immer';\n\nimport type {\n CONTROLLER_NAME,\n PaymentOverride,\n TransactionPayClientId,\n TransactionPayStrategy,\n} from './constants.js';\nimport type { TransactionPayControllerMethodActions } from './TransactionPayController-method-action-types.js';\n\nexport type AllowedActions =\n | AccountsControllerGetStateAction\n | AssetsControllerGetStateAction\n | GetGasFeeState\n | KeyringControllerGetStateAction\n | KeyringControllerSignTypedMessageAction\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerGetNetworkConfigurationByChainIdAction\n | RampsControllerGetOrderAction\n | RampsControllerGetQuoteWithFeesAction\n | RemoteFeatureFlagControllerGetStateAction\n | SentinelApiServiceActions\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | AssetsControllerStateChangeEvent\n | KeyringControllerUnlockEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\n /**\n * Optional address to override the default account used by the transaction.\n * When `isPostQuote` is true, used as the recipient of the MM Pay transfer.\n * When `isPostQuote` is false, it provides the funds and pays for gas.\n */\n accountOverride?: Hex;\n\n /**\n * Whether the target transaction (or `paymentOverride` batch) is executed\n * atomically with the Relay quote. Defaults to `true` (embedded in the quote\n * and executed by the Relay solver). When `false`, Pay does not embed the\n * target/override calls in the quote; the quote only bridges the required\n * asset to `recipient`, and the calls are submitted separately after Relay\n * completion. Used by flows whose second-leg amount is only known after\n * Relay settles (EXACT_INPUT max flows) or that require the second leg to\n * originate from a different signer than the Relay solver.\n * For max deposits enabled by `payStrategies.relay.atomicMaxEnabled`, this\n * is a subsidy hint: atomic quotes are retried non-atomically if not\n * subsidized, and subsidized non-atomic quotes are upgraded to atomic.\n */\n atomic?: boolean;\n\n /**\n * Whether the source of funds is HyperLiquid (HyperCore).\n * When true, the Relay strategy uses the HyperLiquid 2-step withdrawal\n * flow: (1) authorize nonce-mapping, (2) sendAsset to Relay solver.\n */\n isHyperliquidSource?: boolean;\n\n /** Whether the source of funds is a Polymarket deposit wallet. */\n isPolymarketDepositWallet?: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n */\n isPostQuote?: boolean;\n\n /** Overrides the payment source for the transaction. */\n paymentOverride?: PaymentOverride;\n\n /** When true, a quote is always fetched even when the source and target tokens are identical. */\n isQuoteRequired?: boolean;\n\n /**\n * Optional address to receive refunds if the quote provider transaction fails.\n * When set, overrides the default refund recipient (EOA) in the quote\n * request. Use this for post-quote flows where the user's funds originate\n * from a smart contract account (e.g. Predict Safe proxy) so that refunds\n * go back to that account rather than the EOA.\n */\n refundTo?: Hex;\n};\n\n/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\n/** Request passed to {@link GetPaymentOverrideDataCallback}. */\nexport type GetPaymentOverrideDataRequest = {\n /** Amount of the source token in human-readable format. */\n amount: string;\n\n /** Metadata of the original transaction. */\n transaction: TransactionMeta;\n\n /** Pay-controller state for the transaction. */\n transactionData: TransactionData;\n};\n\n/** Response returned by {@link GetPaymentOverrideDataCallback}. */\nexport type GetPaymentOverrideDataResponse = {\n /** Batch transaction params to prepend to the submit batch. */\n calls: BatchTransactionParams[];\n\n /** Optional recipient address for the funding token transfer. */\n recipient?: Hex;\n\n /** Optional EIP-7702 authorization list from delegation. */\n authorizationList?: AuthorizationList;\n};\n\n/**\n * Callback invoked during submit when `paymentOverride` is defined.\n * Returns batch transaction params to prepend to the submit batch.\n */\nexport type GetPaymentOverrideDataCallback = (\n request: GetPaymentOverrideDataRequest,\n) => Promise<GetPaymentOverrideDataResponse>;\n\nexport type GetAmountDataRequest = {\n /** Raw token amount (atomic units) to encode into calldata. */\n amount: string;\n\n /** Metadata of the transaction whose nested calls need updating. */\n transaction: TransactionMeta;\n};\n\nexport type GetAmountDataResponse = {\n /** Per-nested-call data updates; empty when no update is needed. */\n updates: { nestedTransactionIndex: number; data: Hex }[];\n};\n\n/**\n * Optional callback that re-encodes nested transaction calldata for a given\n * token amount. Used by transaction types with non-standard nested data\n * (e.g. vault approve + deposit) that cannot be derived from the amount alone\n * without client-side context (vault config, RPC providers, etc.).\n */\nexport type GetAmountDataCallback = (\n request: GetAmountDataRequest,\n) => Promise<GetAmountDataResponse>;\n\n/** Request passed to {@link GetBalanceCallback}. */\nexport type GetBalanceRequest = {\n /** Metadata of the transaction whose source balance is being resolved. */\n transaction: TransactionMeta;\n /** Pay-controller state for the transaction. */\n transactionData: TransactionData;\n};\n\n/** Balance override returned by {@link GetBalanceCallback}. */\nexport type GetBalanceResponse = {\n /** Balance in atomic format without factoring token decimals. */\n balanceRaw: string;\n};\n\n/**\n * Optional client-supplied callback that overrides the built-in\n * pay-token / required-token balance lookup used for `isMaxAmount`\n * source-amount calculation. Enables alternate balance sources\n * (perps, predict, money-account, post-quote, etc.) without adding\n * conditional branches inside the controller. MUST be synchronous:\n * it runs inside the controller state-update block.\n * Return `undefined` to fall back to the built-in token balance.\n */\nexport type GetBalanceCallback = (\n request: GetBalanceRequest,\n) => GetBalanceResponse | undefined;\n\n/** Callback to update fiat payment state. */\nexport type TransactionFiatPaymentCallback = (\n fiatPayment: TransactionFiatPayment,\n) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerMethodActions;\n\nexport type TransactionPayControllerEvents =\n TransactionPayControllerStateChangeEvent;\n\nexport type TransactionPayControllerMessenger = Messenger<\n typeof CONTROLLER_NAME,\n TransactionPayControllerActions | AllowedActions,\n TransactionPayControllerEvents | AllowedEvents\n>;\n\n/** Options for the TransactionPayController. */\nexport type TransactionPayControllerOptions = {\n /**\n * Identifies the MetaMask client, sent as the `X-Client-Id` header on\n * requests to the intents API so the server can distinguish Mobile from\n * Extension traffic.\n */\n clientId?: TransactionPayClientId;\n\n /** Optional callback to re-encode nested transaction calldata for a given amount. */\n getAmountData?: GetAmountDataCallback;\n\n /** Optional callback to override the source balance used for max-amount calculation. */\n getBalance?: GetBalanceCallback;\n\n /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Optional fiat execution configuration. */\n fiatOptions?: TransactionPayFiatOptions;\n\n /**\n * Optional callback invoked during quote execution when `paymentOverride` is defined.\n * Returns additional transactions to be submitted alongside the quote batch.\n */\n getPaymentOverrideData?: GetPaymentOverrideDataCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Callback to select ordered PayStrategies for a transaction. */\n getStrategies?: (transaction: TransactionMeta) => TransactionPayStrategy[];\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Callbacks for the Polymarket relayer; required only for the Polymarket deposit-wallet flow. */\n polymarket?: PolymarketCallbacks;\n\n /** Initial state of the controller. */\n state?: Partial<TransactionPayControllerState>;\n};\n\n/** State of the TransactionPayController. */\nexport type TransactionPayControllerState = {\n /** State relating to each transaction, keyed by transaction ID. */\n transactionData: Record<string, TransactionData>;\n};\n\n/** Optional fiat execution configuration. */\nexport type TransactionPayFiatOptions = {\n /** Test funding source used to bypass fiat on-ramp execution during local QA. */\n testFundingSource?: Hex;\n\n /** Optional human amount to transfer from the test funding source. */\n testAmountOverride?: string;\n};\n\n/** State relating to a single transaction. */\nexport type TransactionData = {\n /**\n * Optional address to override the default account used by the transaction.\n * When `isPostQuote` is true, used as the recipient of the MM Pay transfer.\n * When `isPostQuote` is false, it provides the funds and pays for gas.\n */\n accountOverride?: Hex;\n\n /**\n * Whether the target transaction is executed atomically with the Relay\n * quote. See {@link TransactionConfig.atomic}.\n */\n atomic?: boolean;\n\n /** Fiat payment method state. */\n fiatPayment?: TransactionFiatPayment;\n\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n * Used when funds need to be moved after a transaction completes\n * (e.g., bridging output to a different token/chain).\n */\n isPostQuote?: boolean;\n\n /** Whether the source of funds is HyperLiquid (HyperCore). */\n isHyperliquidSource?: boolean;\n\n /** Whether the source of funds is a Polymarket deposit wallet. */\n isPolymarketDepositWallet?: boolean;\n\n /** Overrides the payment source for the transaction. */\n paymentOverride?: PaymentOverride;\n\n /** When true, a quote is always fetched even when the source and target tokens are identical. */\n isQuoteRequired?: boolean;\n\n /**\n * Optional address to receive refunds if the quote provider transaction fails.\n * When set, overrides the default refund recipient (EOA) in the quote\n * request.\n */\n refundTo?: Hex;\n\n /**\n * Token selected for the transaction.\n * - For standard flows (isPostQuote=false): This is the SOURCE/payment token\n * - For post-quote flows (isPostQuote=true): This is the DESTINATION token\n */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\n\n /** Most relevant structured validation error from the latest quote attempt. */\n quoteError?: QuoteErrorInfo;\n\n /** Timestamp of when quotes were last updated. */\n quotesLastUpdated?: number;\n\n /** Amounts of payment token required for each required token. */\n sourceAmounts?: TransactionPaySourceAmount[];\n\n /** Tokens required by the transaction. */\n tokens: TransactionPayRequiredToken[];\n\n /** Calculated totals for the transaction. */\n totals?: TransactionPayTotals;\n};\n\n/** Fiat payment state stored per transaction. */\nexport type TransactionFiatPayment = {\n /** Entered fiat amount for the selected payment method. */\n amountFiat?: string;\n\n /** CAIP-19 asset id derived from the transaction type for the fiat on-ramp. */\n caipAssetId?: string;\n\n /** Order identifier in normalized format (/providers/{provider}/orders/{id}). */\n orderId?: string;\n\n /** The ramps quote received from the ramps provider. */\n rampsQuote?: RampsQuote;\n\n /** Selected fiat payment method ID. */\n selectedPaymentMethodId?: string;\n};\n\n/** A token required by a transaction. */\nexport type TransactionPayRequiredToken = {\n /** Address of the required token. */\n address: Hex;\n\n /** Whether to allow quotes that return less than the minimum amount requested. */\n allowUnderMinimum: boolean;\n\n /** Amount required in the selected currency. */\n amountFiat: string;\n\n /** Amount required in a human-readable format factoring token decimals. */\n amountHuman: string;\n\n /** Amount required in atomic format without factoring token decimals. */\n amountRaw: string;\n\n /** Amount required in USD. */\n amountUsd: string;\n\n /** Balance of the required token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the required token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the required token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the required token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the required token. */\n chainId: Hex;\n\n /** Decimals of the required token. */\n decimals: number;\n\n /** Whether to skip transfer of this token if balance is already sufficient. */\n skipIfBalance: boolean;\n\n /** Symbol of the required token. */\n symbol: string;\n};\n\n/** Amount of payment token required by a required token. */\nexport type TransactionPaySourceAmount = {\n /** Amount of payment token required in the selected currency. */\n sourceAmountHuman: string;\n\n /** Amount of payment token required in atomic format without factoring token decimals. */\n sourceAmountRaw: string;\n\n /** Balance of the source token in atomic format (for post-quote flows). */\n sourceBalanceRaw?: string;\n\n /** Chain ID of the source token (for post-quote flows). */\n sourceChainId?: Hex;\n\n /** Address of the source token (for post-quote flows). */\n sourceTokenAddress?: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/**\n * Machine-readable discriminator for a quote validation failure.\n *\n * Used for analytics and tests. Human-readable copy is carried by `message`\n * and `detail` on {@link QuoteErrorInfo}.\n */\nexport type QuoteErrorReason =\n /**\n * @deprecated No longer emitted. An unreadable live balance is treated as\n * unknown rather than insufficient, so it no longer blocks the quote. Kept\n * so existing consumers and historical analytics still type-check.\n */\n | 'balance-unavailable'\n | 'insufficient-source-balance'\n | 'insufficient-transfer-balance'\n | 'no-quotes'\n | 'simulation-failed';\n\n/**\n * Structured description of why a quote failed validation.\n *\n * `message` and `detail` are formatted (English) copy ready to display; `reason`\n * is a machine-readable discriminator for analytics and tests.\n */\nexport type QuoteErrorInfo = {\n /** Short, display-ready summary of the failure. */\n message: string;\n\n /** Machine-readable discriminator for the failure. */\n reason: QuoteErrorReason;\n\n /** Optional display-ready detail rows (e.g. Required / Current / Missing). */\n detail?: string[];\n};\n\n/** Source token used to pay for required tokens. */\nexport type TransactionPaymentToken = {\n /** Address of the payment token. */\n address: Hex;\n\n /** Balance of the payment token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the payment token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the payment token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the payment token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the payment token. */\n chainId: Hex;\n\n /** Decimals of the payment token. */\n decimals: number;\n\n /** Symbol of the payment token. */\n symbol: string;\n};\n\n/** Callback to update state for a single transaction. */\nexport type UpdateTransactionDataCallback = (\n /** ID of the transaction to update. */\n transactionId: string,\n /** Function that receives a draft of the transaction data to update. */\n fn: (data: Draft<TransactionData>) => void,\n) => void;\n\n/** Conversion rates from the native currency to other currencies. */\nexport type FiatRates = {\n /** Conversion rate for the native currency to the selected fiat currency. */\n fiatRate: string;\n\n /** Conversion rate for the native currency to USD. */\n usdRate: string;\n};\n\n/** Request for a quote to retrieve a required token. */\nexport type QuoteRequest = {\n /**\n * Selected account receiving post-quote output.\n * See {@link TransactionConfig.accountOverride}.\n */\n accountOverride?: Hex;\n\n /**\n * Whether the target transaction is executed atomically with the Relay\n * quote. See {@link TransactionConfig.atomic}.\n */\n atomic?: boolean;\n\n /** Address of the user's account. */\n from: Hex;\n\n /** Whether the transaction is a maximum amount transaction. */\n isMaxAmount?: boolean;\n\n /** Whether this is a post-quote flow. */\n isPostQuote?: boolean;\n\n /** Whether the source of funds is HyperLiquid (HyperCore). */\n isHyperliquidSource?: boolean;\n\n /** Whether the source of funds is a Polymarket deposit wallet. */\n isPolymarketDepositWallet?: boolean;\n\n /** Whether this quote is the direct mUSD-to-Money-Account fiat flow. */\n isDirectMusdMoneyAccount?: boolean;\n\n /** Overrides the payment source for the transaction. */\n paymentOverride?: PaymentOverride;\n\n /** Optional recipient address for Relay requests. When set, overrides the default `from` address. */\n recipient?: Hex;\n\n /**\n * Optional address to receive refunds if the quote provider transaction fails.\n * When set, overrides the default refund recipient (EOA) in the quote\n * request.\n */\n refundTo?: Hex;\n\n /** Whether to skip processTransactions in relay-quotes. Defaults to `isPostQuote`. */\n skipProcessTransactions?: boolean;\n\n /** Balance of the source token in atomic format without factoring token decimals. */\n sourceBalanceRaw: string;\n\n /** Chain ID of the source token. */\n sourceChainId: Hex;\n\n /** Address of the source token. */\n sourceTokenAddress: Hex;\n\n /** Amount of the required token in atomic format without factoring token decimals. */\n sourceTokenAmount: string;\n\n /** Minimum amount required of the target token in atomic format without factoring token decimals. */\n targetAmountMinimum: string;\n\n /** Chain ID of the target token. */\n targetChainId: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n\n /**\n * One-time HyperLiquid activation fee (USD) reserved from the source amount\n * for an unactivated HyperCore account. The source amount sent to the\n * provider is reduced by this amount so HyperLiquid retains enough balance\n * for the fee, and the amount is surfaced as part of the provider fee.\n */\n hyperliquidActivationFeeUsd?: string;\n};\n\n/** Fees associated with a transaction pay quote. */\nexport type TransactionPayFees = {\n /** Whether a gas fee token is used to pay source network fees. */\n isSourceGasFeeToken?: boolean;\n\n /** Whether a gas fee token is used to pay target network fees. */\n isTargetGasFeeToken?: boolean;\n\n /** Fee charged by MetaMask. */\n metaMask: FiatValue;\n\n /** Fee charged by the quote provider. */\n provider: FiatValue;\n\n /** Fee charged by fiat on-ramp provider (breakdown of the provider total). */\n providerFiat?: FiatValue;\n\n /** Network fee for transactions on the source network. */\n sourceNetwork: {\n estimate: Amount;\n max: Amount;\n };\n\n /** Network fee for transactions on the target network. */\n targetNetwork: FiatValue;\n};\n\n/** Quote returned to retrieve a required token using the payment token. */\nexport type TransactionPayQuote<OriginalQuote> = {\n /** Additional amount provided by the quote beyond the minimum requested. */\n dust: FiatValue;\n\n /** Duration estimated for the transaction to complete in seconds. */\n estimatedDuration: number;\n\n /** Fees associated with the transaction pay quote. */\n fees: TransactionPayFees;\n\n /** Whether fees are subtracted from the destination amount, meaning the input amount is static. */\n isInputBased?: boolean;\n\n /** Whether the reported fees are already included in the source amount. */\n areFeesIncludedInSourceAmount?: boolean;\n\n /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\n\n /**\n * Whether the target calls could not be embedded in the quote and must be\n * submitted separately, on the target chain, once the quote settles.\n *\n * Set by the strategy at quote time, since only it knows whether the provider\n * accepted the calls. {@link TransactionConfig.atomic} is a hint rather than\n * a guarantee: a quote requested atomically still falls back to a second leg\n * when the provider cannot execute the calls itself.\n */\n requiresSecondLeg?: boolean;\n\n /** Amount of source token required. */\n sourceAmount: Amount;\n\n /** Name of the strategy used to retrieve the quote. */\n strategy: TransactionPayStrategy;\n\n /** Amount of target token provided. */\n targetAmount: FiatValue;\n};\n\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Whether the account supports EIP-7702 authorization signing. */\n accountSupports7702: boolean;\n\n /** Selected fiat payment method ID, if applicable. */\n fiatPaymentMethod?: string;\n\n /**\n * Account sending the quotes: `txParams.from` for post-quote flows,\n * otherwise `accountOverride ?? txParams.from`. Pre-computed by the quote\n * orchestrator so that individual strategies do not need to re-derive it.\n */\n from: Hex;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\n\n /**\n * Signal that aborts when a newer quote request supersedes this one.\n * Strategies that perform their own network IO should forward this to\n * their fetch calls so cancelled requests release network resources.\n */\n signal?: AbortSignal;\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to submit quotes for a transaction. */\nexport type PayStrategyExecuteRequest<OriginalRequest> = {\n /** Whether the account supports EIP-7702 authorization signing. */\n accountSupports7702: boolean;\n\n /** Callback to determine if the transaction is a smart transaction. */\n isSmartTransaction: (chainId: Hex) => boolean;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes to be submitted. */\n quotes: TransactionPayQuote<OriginalRequest>[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get batch transactions for quotes. */\nexport type PayStrategyGetBatchRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes for required tokens. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n\n /** Signal that aborts when a newer quote request supersedes this one. */\n signal?: AbortSignal;\n};\n\n/** Request to check whether retrieved quotes can be executed by a strategy. */\nexport type PayStrategyCheckQuoteSupportRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes returned by the strategy. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n\n /** Signal that aborts when a newer quote request supersedes this one. */\n signal?: AbortSignal;\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get refresh interval for a specific strategy. */\nexport type PayStrategyGetRefreshIntervalRequest = {\n /** Chain ID of the source or payment token. */\n chainId: Hex;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** ID of the transaction whose refresh interval is being resolved. */\n transactionId: string;\n};\n\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /**\n * Check if the strategy supports the given request.\n * Defaults to true if not implemented.\n */\n supports?: (\n request: PayStrategyGetQuotesRequest,\n ) => boolean | Promise<boolean>;\n\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\n\n /**\n * Check if the returned quotes are supported after provider quote\n * construction and gas planning.\n *\n * Use this for limitations that are only knowable once quote metadata is\n * available, such as whether execution will require an EIP-7702\n * authorization list.\n */\n checkQuoteSupport?: (\n request: PayStrategyCheckQuoteSupportRequest<OriginalQuote>,\n ) => boolean | Promise<boolean>;\n\n /** Retrieve batch transactions for quotes, if supported by the strategy. */\n getBatchTransactions?: (\n request: PayStrategyGetBatchRequest<OriginalQuote>,\n ) => Promise<BatchTransaction[]>;\n\n /**\n * Retrieve refresh interval for the strategy, if applicable.\n * Defaults to 30 seconds.\n */\n getRefreshInterval?: (\n request: PayStrategyGetRefreshIntervalRequest,\n ) => Promise<number | undefined>;\n\n /** Execute or submit the quotes to obtain required tokens. */\n execute: (request: PayStrategyExecuteRequest<OriginalQuote>) => Promise<{\n transactionHash?: Hex;\n }>;\n};\n\n/** Single fiat value in alternate currencies. */\nexport type FiatValue = {\n /** Value in the selected fiat currency. */\n fiat: string;\n\n /** Value in USD. */\n usd: string;\n};\n\n/** Calculated totals for a target transaction and all quotes. */\nexport type TransactionPayTotals = {\n /** Total estimated duration for the target transaction and all quotes. */\n estimatedDuration: number;\n\n /** Total fees for the target transaction and all quotes. */\n fees: TransactionPayFees;\n\n /** Whether the selected quotes subtract fees from the destination amount, meaning the input amount is static. */\n isInputBased?: boolean;\n\n /** Total amount of source token required. */\n sourceAmount: Amount;\n\n /** Total amount of target token provided. */\n targetAmount: FiatValue;\n\n /** Overall total cost for the target transaction and all quotes. */\n total: FiatValue;\n};\n\n/** Request to update the payment token for a transaction. */\nexport type UpdatePaymentTokenRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Address of the new payment token. */\n tokenAddress: Hex;\n\n /** Chain ID of the new payment token. */\n chainId: Hex;\n};\n\n/** Request to update fiat payment state for a transaction. */\nexport type UpdateFiatPaymentRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Callback to mutate fiat payment state. */\n callback: TransactionFiatPaymentCallback;\n};\n\n/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n isSubsidized,\n}: {\n transaction: TransactionMeta;\n isSubsidized?: boolean;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: Hex;\n}>;\n\n/** Client-supplied callbacks for the Polymarket relayer protocol. */\nexport type PolymarketCallbacks = {\n /** Derive the deposit-wallet address (CREATE2) for the given EOA. */\n getDepositWalletAddress: (params: { eoa: Hex }) => Promise<Hex>;\n\n /** Sign and broadcast a deposit-wallet batch, returning the source hash. */\n submitDepositWalletBatch: (params: {\n eoa: Hex;\n depositWallet: Hex;\n calls: { target: Hex; data: Hex; value: string }[];\n }) => Promise<{ sourceHash: Hex }>;\n};\n\n/** Single amount in alternate formats. */\nexport type Amount = FiatValue & {\n /** Amount in human-readable format factoring token decimals. */\n human: string;\n\n /** Amount in atomic format without factoring token decimals. */\n raw: string;\n};\n"]}
@@ -1,59 +1,5 @@
1
- import type { AccountsControllerState } from '@metamask/accounts-controller';
2
- import type { CaipAccountId, CaipAssetType, Hex } from '@metamask/utils';
3
1
  import { PaymentOverride } from '../constants.js';
4
2
  import type { TransactionPayControllerMessenger } from '../types.js';
5
- /** `InternalAccount` that holds an asset. */
6
- export type AssetAccount = AccountsControllerState['internalAccounts']['accounts'][string];
7
- /**
8
- * Get the EVM account address used by a transaction.
9
- *
10
- * The account override is an `InternalAccount` ID. It is only used as the
11
- * EVM account when it is an EVM account, since a non-EVM override selects the
12
- * account holding a non-EVM payment token.
13
- *
14
- * @param messenger - Controller messenger.
15
- * @param accountOverride - ID of the account override of the transaction, if any.
16
- * @param from - Address of the transaction sender.
17
- * @returns The EVM account address.
18
- */
19
- export declare function getEvmAccountAddress(messenger: TransactionPayControllerMessenger, accountOverride: string | undefined, from: Hex): Hex;
20
- /**
21
- * Get the EVM account override of a transaction, for flows that only support
22
- * EVM accounts.
23
- *
24
- * @param messenger - Controller messenger.
25
- * @param accountOverride - ID of the account override of the transaction, if any.
26
- * @returns The address of the EVM account override, or undefined if there is
27
- * no account override.
28
- */
29
- export declare function getEvmAccountOverride(messenger: TransactionPayControllerMessenger, accountOverride: string | undefined): Hex | undefined;
30
- /**
31
- * Get the `InternalAccount` that holds an asset.
32
- *
33
- * The account override is used when it supports the asset chain. Otherwise
34
- * the account is the one in the same account group as the account override,
35
- * or as the transaction sender, that supports the asset chain.
36
- *
37
- * @param messenger - Controller messenger.
38
- * @param request - Request parameters.
39
- * @param request.accountOverride - ID of the account override of the transaction, if any.
40
- * @param request.assetId - CAIP-19 asset type of the asset.
41
- * @param request.from - Address of the transaction sender.
42
- * @returns The `InternalAccount` holding the asset.
43
- */
44
- export declare function getAssetAccount(messenger: TransactionPayControllerMessenger, { accountOverride, assetId, from, }: {
45
- accountOverride: string | undefined;
46
- assetId: CaipAssetType;
47
- from: Hex;
48
- }): AssetAccount;
49
- /**
50
- * Get the CAIP-10 account ID of an address on the chain of a CAIP-19 asset.
51
- *
52
- * @param assetId - CAIP-19 asset type.
53
- * @param address - Address of the account holding the asset.
54
- * @returns The CAIP-10 account ID.
55
- */
56
- export declare function getCaipAccountId(assetId: CaipAssetType, address: string): CaipAccountId;
57
3
  /**
58
4
  * Check whether a given account supports EIP-7702 authorization signing.
59
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/utils/account.ts"],"names":[],"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