@metamask/transaction-pay-controller 10.4.0 → 10.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/dist/TransactionPayController.cjs +3 -1
  3. package/dist/TransactionPayController.cjs.map +1 -1
  4. package/dist/TransactionPayController.d.cts.map +1 -1
  5. package/dist/TransactionPayController.d.mts.map +1 -1
  6. package/dist/TransactionPayController.mjs +3 -1
  7. package/dist/TransactionPayController.mjs.map +1 -1
  8. package/dist/actions/update-payment-token.cjs.map +1 -1
  9. package/dist/actions/update-payment-token.d.cts.map +1 -1
  10. package/dist/actions/update-payment-token.d.mts.map +1 -1
  11. package/dist/actions/update-payment-token.mjs.map +1 -1
  12. package/dist/helpers/QuoteRefresher.cjs.map +1 -1
  13. package/dist/helpers/QuoteRefresher.mjs.map +1 -1
  14. package/dist/strategy/bridge/BridgeStrategy.cjs.map +1 -1
  15. package/dist/strategy/bridge/BridgeStrategy.d.cts +5 -6
  16. package/dist/strategy/bridge/BridgeStrategy.d.cts.map +1 -1
  17. package/dist/strategy/bridge/BridgeStrategy.d.mts +5 -6
  18. package/dist/strategy/bridge/BridgeStrategy.d.mts.map +1 -1
  19. package/dist/strategy/bridge/BridgeStrategy.mjs.map +1 -1
  20. package/dist/strategy/bridge/bridge-quotes.cjs +3 -3
  21. package/dist/strategy/bridge/bridge-quotes.cjs.map +1 -1
  22. package/dist/strategy/bridge/bridge-quotes.mjs +3 -3
  23. package/dist/strategy/bridge/bridge-quotes.mjs.map +1 -1
  24. package/dist/strategy/bridge/bridge-submit.cjs +1 -3
  25. package/dist/strategy/bridge/bridge-submit.cjs.map +1 -1
  26. package/dist/strategy/bridge/bridge-submit.mjs +1 -3
  27. package/dist/strategy/bridge/bridge-submit.mjs.map +1 -1
  28. package/dist/strategy/relay/RelayStrategy.cjs.map +1 -1
  29. package/dist/strategy/relay/RelayStrategy.d.cts +3 -5
  30. package/dist/strategy/relay/RelayStrategy.d.cts.map +1 -1
  31. package/dist/strategy/relay/RelayStrategy.d.mts +3 -5
  32. package/dist/strategy/relay/RelayStrategy.d.mts.map +1 -1
  33. package/dist/strategy/relay/RelayStrategy.mjs.map +1 -1
  34. package/dist/strategy/relay/relay-quotes.cjs +158 -40
  35. package/dist/strategy/relay/relay-quotes.cjs.map +1 -1
  36. package/dist/strategy/relay/relay-quotes.d.cts.map +1 -1
  37. package/dist/strategy/relay/relay-quotes.d.mts.map +1 -1
  38. package/dist/strategy/relay/relay-quotes.mjs +159 -41
  39. package/dist/strategy/relay/relay-quotes.mjs.map +1 -1
  40. package/dist/strategy/relay/relay-submit.cjs +31 -18
  41. package/dist/strategy/relay/relay-submit.cjs.map +1 -1
  42. package/dist/strategy/relay/relay-submit.mjs +31 -18
  43. package/dist/strategy/relay/relay-submit.mjs.map +1 -1
  44. package/dist/strategy/relay/types.cjs.map +1 -1
  45. package/dist/strategy/relay/types.d.cts +4 -1
  46. package/dist/strategy/relay/types.d.cts.map +1 -1
  47. package/dist/strategy/relay/types.d.mts +4 -1
  48. package/dist/strategy/relay/types.d.mts.map +1 -1
  49. package/dist/strategy/relay/types.mjs.map +1 -1
  50. package/dist/strategy/test/TestStrategy.cjs.map +1 -1
  51. package/dist/strategy/test/TestStrategy.d.cts +1 -3
  52. package/dist/strategy/test/TestStrategy.d.cts.map +1 -1
  53. package/dist/strategy/test/TestStrategy.d.mts +1 -3
  54. package/dist/strategy/test/TestStrategy.d.mts.map +1 -1
  55. package/dist/strategy/test/TestStrategy.mjs.map +1 -1
  56. package/dist/tests/messenger-mock.cjs +7 -0
  57. package/dist/tests/messenger-mock.cjs.map +1 -1
  58. package/dist/tests/messenger-mock.d.cts +21 -0
  59. package/dist/tests/messenger-mock.d.cts.map +1 -1
  60. package/dist/tests/messenger-mock.d.mts +21 -0
  61. package/dist/tests/messenger-mock.d.mts.map +1 -1
  62. package/dist/tests/messenger-mock.mjs +7 -0
  63. package/dist/tests/messenger-mock.mjs.map +1 -1
  64. package/dist/types.cjs.map +1 -1
  65. package/dist/types.d.cts +2 -2
  66. package/dist/types.d.cts.map +1 -1
  67. package/dist/types.d.mts +2 -2
  68. package/dist/types.d.mts.map +1 -1
  69. package/dist/types.mjs.map +1 -1
  70. package/dist/utils/feature-flags.cjs +27 -3
  71. package/dist/utils/feature-flags.cjs.map +1 -1
  72. package/dist/utils/feature-flags.d.cts +9 -0
  73. package/dist/utils/feature-flags.d.cts.map +1 -1
  74. package/dist/utils/feature-flags.d.mts +9 -0
  75. package/dist/utils/feature-flags.d.mts.map +1 -1
  76. package/dist/utils/feature-flags.mjs +25 -2
  77. package/dist/utils/feature-flags.mjs.map +1 -1
  78. package/dist/utils/gas.cjs +6 -5
  79. package/dist/utils/gas.cjs.map +1 -1
  80. package/dist/utils/gas.mjs +6 -5
  81. package/dist/utils/gas.mjs.map +1 -1
  82. package/dist/utils/quotes.cjs +1 -1
  83. package/dist/utils/quotes.cjs.map +1 -1
  84. package/dist/utils/quotes.d.cts.map +1 -1
  85. package/dist/utils/quotes.d.mts.map +1 -1
  86. package/dist/utils/quotes.mjs +1 -1
  87. package/dist/utils/quotes.mjs.map +1 -1
  88. package/dist/utils/required-tokens.cjs +3 -3
  89. package/dist/utils/required-tokens.cjs.map +1 -1
  90. package/dist/utils/required-tokens.mjs +3 -3
  91. package/dist/utils/required-tokens.mjs.map +1 -1
  92. package/dist/utils/source-amounts.cjs +1 -1
  93. package/dist/utils/source-amounts.cjs.map +1 -1
  94. package/dist/utils/source-amounts.d.cts.map +1 -1
  95. package/dist/utils/source-amounts.d.mts.map +1 -1
  96. package/dist/utils/source-amounts.mjs +1 -1
  97. package/dist/utils/source-amounts.mjs.map +1 -1
  98. package/dist/utils/token.cjs +1 -1
  99. package/dist/utils/token.cjs.map +1 -1
  100. package/dist/utils/token.d.cts +3 -3
  101. package/dist/utils/token.d.cts.map +1 -1
  102. package/dist/utils/token.d.mts +3 -3
  103. package/dist/utils/token.d.mts.map +1 -1
  104. package/dist/utils/token.mjs +1 -1
  105. package/dist/utils/token.mjs.map +1 -1
  106. package/dist/utils/totals.cjs +2 -2
  107. package/dist/utils/totals.cjs.map +1 -1
  108. package/dist/utils/totals.d.cts.map +1 -1
  109. package/dist/utils/totals.d.mts.map +1 -1
  110. package/dist/utils/totals.mjs +2 -2
  111. package/dist/utils/totals.mjs.map +1 -1
  112. package/dist/utils/transaction.cjs +1 -1
  113. package/dist/utils/transaction.cjs.map +1 -1
  114. package/dist/utils/transaction.d.cts.map +1 -1
  115. package/dist/utils/transaction.d.mts.map +1 -1
  116. package/dist/utils/transaction.mjs +1 -1
  117. package/dist/utils/transaction.mjs.map +1 -1
  118. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"messenger-mock.mjs","sourceRoot":"","sources":["../../src/tests/messenger-mock.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,4BAA4B;AAwBpE;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,YAAY,MACkB,EAAE;IAChC,MAAM,sBAAsB,GAExB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,eAAe,GAEjB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,iCAAiC,GAEnC,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,kBAAkB,GAEpB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,uBAAuB,GAEzB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,gCAAgC,GAElC,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAElC,MAAM,uCAAuC,GAEzC,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,4BAA4B,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAE/C,MAAM,qBAAqB,GAEvB,IAAI,CAAC,EAAE,EAAE,C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AA8C;QACzD,OAAO;QACP,qBAAqB;QACrB,qBAAqB;KACtB,CAAC;AACJ,CAAC","sourcesContent":["import type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokenBalancesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { BridgeStatusControllerGetStateAction } from '@metamask/bridge-status-controller';\nimport type {\n MessengerActions,\n MessengerEvents,\n MockAnyNamespace,\n} from '@metamask/messenger';\nimport { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n TransactionControllerAddTransactionAction,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerGetGasFeeTokensAction,\n TransactionControllerGetStateAction,\n} from '@metamask/transaction-controller';\nimport type { TransactionControllerUpdateTransactionAction } from '@metamask/transaction-controller';\n\nimport type { TransactionPayControllerMessenger } from '..';\nimport type { BridgeStatusControllerSubmitTxAction } from '../../../bridge-status-controller/src/types';\nimport type {\n TransactionPayControllerGetDelegationTransactionAction,\n TransactionPayControllerGetStrategyAction,\n} from '../types';\nimport type { TransactionPayControllerGetStateAction } from '../types';\n\ntype AllActions = MessengerActions<TransactionPayControllerMessenger>;\ntype AllEvents = MessengerEvents<TransactionPayControllerMessenger>;\ntype RootMessenger = Messenger<MockAnyNamespace, AllActions, AllEvents>;\n\n/**\n * Creates a mock controller messenger for testing.\n *\n * @param options - Options for creating the messenger mock.\n * @param options.skipRegister - Whether to skip registering action handlers.\n * @returns The mock messenger and associated mock functions.\n */\nexport function getMessengerMock({\n skipRegister,\n}: { skipRegister?: boolean } = {}) {\n const getControllerStateMock: jest.MockedFn<\n TransactionPayControllerGetStateAction['handler']\n > = jest.fn();\n\n const getStrategyMock: jest.MockedFn<\n TransactionPayControllerGetStrategyAction['handler']\n > = jest.fn();\n\n const getTransactionControllerStateMock: jest.MockedFn<\n TransactionControllerGetStateAction['handler']\n > = jest.fn();\n\n const addTransactionMock: jest.MockedFn<\n TransactionControllerAddTransactionAction['handler']\n > = jest.fn();\n\n const addTransactionBatchMock: jest.MockedFn<\n TransactionControllerAddTransactionBatchAction['handler']\n > = jest.fn();\n\n const findNetworkClientIdByChainIdMock: jest.MockedFn<\n NetworkControllerFindNetworkClientIdByChainIdAction['handler']\n > = jest.fn();\n\n const fetchQuotesMock = jest.fn();\n\n const getRemoteFeatureFlagControllerStateMock: jest.MockedFn<\n RemoteFeatureFlagControllerGetStateAction['handler']\n > = jest.fn();\n\n const getGasFeeControllerStateMock = jest.fn();\n\n const submitTransactionMock: jest.MockedFunction<\n BridgeStatusControllerSubmitTxAction['handler']\n > = jest.fn();\n\n const updateTransactionMock: jest.MockedFn<\n TransactionControllerUpdateTransactionAction['handler']\n > = jest.fn();\n\n const getBridgeStatusControllerStateMock: jest.MockedFn<\n BridgeStatusControllerGetStateAction['handler']\n > = jest.fn();\n\n const getTokensControllerStateMock: jest.MockedFn<\n TokensControllerGetStateAction['handler']\n > = jest.fn();\n\n const getTokenBalanceControllerStateMock: jest.MockedFn<\n TokenBalancesControllerGetStateAction['handler']\n > = jest.fn();\n\n const getTokenRatesControllerStateMock: jest.MockedFn<\n TokenRatesControllerGetStateAction['handler']\n > = jest.fn();\n\n const getCurrencyRateControllerStateMock = jest.fn();\n\n const getAccountTrackerControllerStateMock: jest.MockedFn<\n AccountTrackerControllerGetStateAction['handler']\n > = jest.fn();\n\n const getNetworkClientByIdMock: jest.MockedFn<\n NetworkControllerGetNetworkClientByIdAction['handler']\n > = jest.fn();\n\n const getDelegationTransactionMock: jest.MockedFn<\n TransactionPayControllerGetDelegationTransactionAction['handler']\n > = jest.fn();\n\n const getGasFeeTokensMock: jest.MockedFn<\n TransactionControllerGetGasFeeTokensAction['handler']\n > = jest.fn();\n\n const messenger: RootMessenger = new Messenger({\n namespace: MOCK_ANY_NAMESPACE,\n });\n\n if (skipRegister !== true) {\n messenger.registerActionHandler(\n 'TransactionPayController:getState',\n getControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionPayController:getStrategy',\n getStrategyMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:getState',\n getTransactionControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:addTransaction',\n addTransactionMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:addTransactionBatch',\n addTransactionBatchMock,\n );\n\n messenger.registerActionHandler(\n 'NetworkController:findNetworkClientIdByChainId',\n findNetworkClientIdByChainIdMock,\n );\n\n messenger.registerActionHandler(\n 'BridgeController:fetchQuotes',\n fetchQuotesMock,\n );\n\n messenger.registerActionHandler(\n 'RemoteFeatureFlagController:getState',\n getRemoteFeatureFlagControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'BridgeStatusController:submitTx',\n submitTransactionMock,\n );\n\n messenger.registerActionHandler(\n 'GasFeeController:getState',\n getGasFeeControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:updateTransaction',\n updateTransactionMock,\n );\n\n messenger.registerActionHandler(\n 'BridgeStatusController:getState',\n getBridgeStatusControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TokensController:getState',\n getTokensControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TokenBalancesController:getState',\n getTokenBalanceControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TokenRatesController:getState',\n getTokenRatesControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'AccountTrackerController:getState',\n getAccountTrackerControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'CurrencyRateController:getState',\n getCurrencyRateControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'NetworkController:getNetworkClientById',\n getNetworkClientByIdMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionPayController:getDelegationTransaction',\n getDelegationTransactionMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:getGasFeeTokens',\n getGasFeeTokensMock,\n );\n }\n\n const publish = messenger.publish.bind(messenger);\n\n return {\n addTransactionMock,\n addTransactionBatchMock,\n fetchQuotesMock,\n findNetworkClientIdByChainIdMock,\n getAccountTrackerControllerStateMock,\n getBridgeStatusControllerStateMock,\n getControllerStateMock,\n getCurrencyRateControllerStateMock,\n getDelegationTransactionMock,\n getGasFeeControllerStateMock,\n getGasFeeTokensMock,\n getNetworkClientByIdMock,\n getRemoteFeatureFlagControllerStateMock,\n getStrategyMock,\n getTokenBalanceControllerStateMock,\n getTokenRatesControllerStateMock,\n getTokensControllerStateMock,\n getTransactionControllerStateMock,\n messenger: messenger as TransactionPayControllerMessenger,\n publish,\n submitTransactionMock,\n updateTransactionMock,\n };\n}\n"]}
1
+ {"version":3,"file":"messenger-mock.mjs","sourceRoot":"","sources":["../../src/tests/messenger-mock.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,4BAA4B;AA0BpE;;;;;;GAMG;AACH,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAC,EAC/B,YAAY,MACkB,EAAE;IAChC,MAAM,sBAAsB,GAExB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,eAAe,GAEjB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,iCAAiC,GAEnC,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,kBAAkB,GAEpB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,uBAAuB,GAEzB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,gCAAgC,GAElC,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAElC,MAAM,uCAAuC,GAEzC,IAAI,CAAC,EAAE,EAAE,C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IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAElD,OAAO;QACL,kBAAkB;QAClB,uBAAuB;QACvB,eAAe;QACf,oBAAoB;QACpB,eAAe;QACf,gCAAgC;QAChC,oCAAoC;QACpC,kCAAkC;QAClC,sBAAsB;QACtB,kCAAkC;QAClC,4BAA4B;QAC5B,4BAA4B;QAC5B,mBAAmB;QACnB,wBAAwB;QACxB,uCAAuC;QACvC,eAAe;QACf,kCAAkC;QAClC,gCAAgC;QAChC,4BAA4B;QAC5B,iCAAiC;QACjC,SAAS,EAAE,SAA8C;QACzD,OAAO;QACP,qBAAqB;QACrB,qBAAqB;KACtB,CAAC;AACJ,CAAC","sourcesContent":["import type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokenBalancesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { BridgeStatusControllerGetStateAction } from '@metamask/bridge-status-controller';\nimport type {\n MessengerActions,\n MessengerEvents,\n MockAnyNamespace,\n} from '@metamask/messenger';\nimport { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n TransactionControllerAddTransactionAction,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerGetGasFeeTokensAction,\n TransactionControllerGetStateAction,\n} from '@metamask/transaction-controller';\nimport type { TransactionControllerUpdateTransactionAction } from '@metamask/transaction-controller';\n\nimport type { TransactionPayControllerMessenger } from '..';\nimport type { BridgeStatusControllerSubmitTxAction } from '../../../bridge-status-controller/src/types';\nimport type {\n TransactionPayControllerGetDelegationTransactionAction,\n TransactionPayControllerGetStrategyAction,\n} from '../types';\nimport type { TransactionPayControllerGetStateAction } from '../types';\n\ntype AllActions = MessengerActions<TransactionPayControllerMessenger>;\ntype AllEvents = MessengerEvents<TransactionPayControllerMessenger>;\ntype RootMessenger = Messenger<MockAnyNamespace, AllActions, AllEvents>;\n\n/**\n * Creates a mock controller messenger for testing.\n *\n * @param options - Options for creating the messenger mock.\n * @param options.skipRegister - Whether to skip registering action handlers.\n * @returns The mock messenger and associated mock functions.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function getMessengerMock({\n skipRegister,\n}: { skipRegister?: boolean } = {}) {\n const getControllerStateMock: jest.MockedFn<\n TransactionPayControllerGetStateAction['handler']\n > = jest.fn();\n\n const getStrategyMock: jest.MockedFn<\n TransactionPayControllerGetStrategyAction['handler']\n > = jest.fn();\n\n const getTransactionControllerStateMock: jest.MockedFn<\n TransactionControllerGetStateAction['handler']\n > = jest.fn();\n\n const addTransactionMock: jest.MockedFn<\n TransactionControllerAddTransactionAction['handler']\n > = jest.fn();\n\n const addTransactionBatchMock: jest.MockedFn<\n TransactionControllerAddTransactionBatchAction['handler']\n > = jest.fn();\n\n const findNetworkClientIdByChainIdMock: jest.MockedFn<\n NetworkControllerFindNetworkClientIdByChainIdAction['handler']\n > = jest.fn();\n\n const fetchQuotesMock = jest.fn();\n\n const getRemoteFeatureFlagControllerStateMock: jest.MockedFn<\n RemoteFeatureFlagControllerGetStateAction['handler']\n > = jest.fn();\n\n const getGasFeeControllerStateMock = jest.fn();\n\n const submitTransactionMock: jest.MockedFunction<\n BridgeStatusControllerSubmitTxAction['handler']\n > = jest.fn();\n\n const updateTransactionMock: jest.MockedFn<\n TransactionControllerUpdateTransactionAction['handler']\n > = jest.fn();\n\n const getBridgeStatusControllerStateMock: jest.MockedFn<\n BridgeStatusControllerGetStateAction['handler']\n > = jest.fn();\n\n const getTokensControllerStateMock: jest.MockedFn<\n TokensControllerGetStateAction['handler']\n > = jest.fn();\n\n const getTokenBalanceControllerStateMock: jest.MockedFn<\n TokenBalancesControllerGetStateAction['handler']\n > = jest.fn();\n\n const getTokenRatesControllerStateMock: jest.MockedFn<\n TokenRatesControllerGetStateAction['handler']\n > = jest.fn();\n\n const getCurrencyRateControllerStateMock = jest.fn();\n\n const getAccountTrackerControllerStateMock: jest.MockedFn<\n AccountTrackerControllerGetStateAction['handler']\n > = jest.fn();\n\n const getNetworkClientByIdMock: jest.MockedFn<\n NetworkControllerGetNetworkClientByIdAction['handler']\n > = jest.fn();\n\n const getDelegationTransactionMock: jest.MockedFn<\n TransactionPayControllerGetDelegationTransactionAction['handler']\n > = jest.fn();\n\n const getGasFeeTokensMock: jest.MockedFn<\n TransactionControllerGetGasFeeTokensAction['handler']\n > = jest.fn();\n\n const estimateGasMock: jest.MockedFn<\n TransactionControllerEstimateGasAction['handler']\n > = jest.fn();\n\n const estimateGasBatchMock: jest.MockedFn<\n TransactionControllerEstimateGasBatchAction['handler']\n > = jest.fn();\n\n const messenger: RootMessenger = new Messenger({\n namespace: MOCK_ANY_NAMESPACE,\n });\n\n if (skipRegister !== true) {\n messenger.registerActionHandler(\n 'TransactionPayController:getState',\n getControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionPayController:getStrategy',\n getStrategyMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:getState',\n getTransactionControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:addTransaction',\n addTransactionMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:addTransactionBatch',\n addTransactionBatchMock,\n );\n\n messenger.registerActionHandler(\n 'NetworkController:findNetworkClientIdByChainId',\n findNetworkClientIdByChainIdMock,\n );\n\n messenger.registerActionHandler(\n 'BridgeController:fetchQuotes',\n fetchQuotesMock,\n );\n\n messenger.registerActionHandler(\n 'RemoteFeatureFlagController:getState',\n getRemoteFeatureFlagControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'BridgeStatusController:submitTx',\n submitTransactionMock,\n );\n\n messenger.registerActionHandler(\n 'GasFeeController:getState',\n getGasFeeControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:updateTransaction',\n updateTransactionMock,\n );\n\n messenger.registerActionHandler(\n 'BridgeStatusController:getState',\n getBridgeStatusControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TokensController:getState',\n getTokensControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TokenBalancesController:getState',\n getTokenBalanceControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'TokenRatesController:getState',\n getTokenRatesControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'AccountTrackerController:getState',\n getAccountTrackerControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'CurrencyRateController:getState',\n getCurrencyRateControllerStateMock,\n );\n\n messenger.registerActionHandler(\n 'NetworkController:getNetworkClientById',\n getNetworkClientByIdMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionPayController:getDelegationTransaction',\n getDelegationTransactionMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:getGasFeeTokens',\n getGasFeeTokensMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:estimateGas',\n estimateGasMock,\n );\n\n messenger.registerActionHandler(\n 'TransactionController:estimateGasBatch',\n estimateGasBatchMock,\n );\n }\n\n const publish = messenger.publish.bind(messenger);\n\n return {\n addTransactionMock,\n addTransactionBatchMock,\n estimateGasMock,\n estimateGasBatchMock,\n fetchQuotesMock,\n findNetworkClientIdByChainIdMock,\n getAccountTrackerControllerStateMock,\n getBridgeStatusControllerStateMock,\n getControllerStateMock,\n getCurrencyRateControllerStateMock,\n getDelegationTransactionMock,\n getGasFeeControllerStateMock,\n getGasFeeTokensMock,\n getNetworkClientByIdMock,\n getRemoteFeatureFlagControllerStateMock,\n getStrategyMock,\n getTokenBalanceControllerStateMock,\n getTokenRatesControllerStateMock,\n getTokensControllerStateMock,\n getTransactionControllerStateMock,\n messenger: messenger as TransactionPayControllerMessenger,\n publish,\n submitTransactionMock,\n updateTransactionMock,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type { TokenListControllerActions } from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { BridgeControllerActions } from '@metamask/bridge-controller';\nimport type { BridgeStatusControllerStateChangeEvent } from '@metamask/bridge-status-controller';\nimport type { BridgeStatusControllerActions } from '@metamask/bridge-status-controller';\nimport type { GasFeeControllerActions } from '@metamask/gas-fee-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\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 { CONTROLLER_NAME, TransactionPayStrategy } from './constants';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\n | TokenListControllerActions\n | TokenRatesControllerGetStateAction\n | TokensControllerGetStateAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | BridgeStatusControllerStateChangeEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `${typeof CONTROLLER_NAME}:getDelegationTransaction`;\n handler: GetDelegationTransactionCallback;\n};\n\n/** Action to get the pay strategy type used for a transaction. */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `${typeof CONTROLLER_NAME}:getStrategy`;\n handler: (transaction: TransactionMeta) => TransactionPayStrategy;\n};\n\n/** Action to update the payment token for a transaction. */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;\n handler: (request: UpdatePaymentTokenRequest) => void;\n};\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerUpdatePaymentTokenAction;\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 /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\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/** State relating to a single transaction. */\nexport type TransactionData = {\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Source token selected for the transaction. */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\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/** 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 /** Address of the required token. */\n targetTokenAddress: Hex;\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 /** Address of the user's account. */\n from: Hex;\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/** 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 the quote provider. */\n provider: 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 /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\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\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\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 /** 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\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\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\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 /** Total amount of source token required. */\n sourceAmount: Amount;\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/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\n transaction: TransactionMeta;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: 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.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type { TokenListControllerActions } from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { BridgeControllerActions } from '@metamask/bridge-controller';\nimport type { BridgeStatusControllerStateChangeEvent } from '@metamask/bridge-status-controller';\nimport type { BridgeStatusControllerActions } from '@metamask/bridge-status-controller';\nimport type { GasFeeControllerActions } from '@metamask/gas-fee-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\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 { CONTROLLER_NAME, TransactionPayStrategy } from './constants';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\n | TokenListControllerActions\n | TokenRatesControllerGetStateAction\n | TokensControllerGetStateAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | BridgeStatusControllerStateChangeEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `${typeof CONTROLLER_NAME}:getDelegationTransaction`;\n handler: GetDelegationTransactionCallback;\n};\n\n/** Action to get the pay strategy type used for a transaction. */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `${typeof CONTROLLER_NAME}:getStrategy`;\n handler: (transaction: TransactionMeta) => TransactionPayStrategy;\n};\n\n/** Action to update the payment token for a transaction. */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;\n handler: (request: UpdatePaymentTokenRequest) => void;\n};\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerUpdatePaymentTokenAction;\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 /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\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/** State relating to a single transaction. */\nexport type TransactionData = {\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Source token selected for the transaction. */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\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/** 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 /** Address of the required token. */\n targetTokenAddress: Hex;\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 /** Address of the user's account. */\n from: Hex;\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/** 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 the quote provider. */\n provider: 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 /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\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\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\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 /** 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\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\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\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 /** Total amount of source token required. */\n sourceAmount: Amount;\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/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\n transaction: TransactionMeta;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: 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"]}
package/dist/types.d.cts CHANGED
@@ -13,12 +13,12 @@ import type { Messenger } from "@metamask/messenger";
13
13
  import type { NetworkControllerFindNetworkClientIdByChainIdAction } from "@metamask/network-controller";
14
14
  import type { NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
15
15
  import type { RemoteFeatureFlagControllerGetStateAction } from "@metamask/remote-feature-flag-controller";
16
- import type { AuthorizationList, TransactionControllerAddTransactionBatchAction, TransactionControllerUnapprovedTransactionAddedEvent } from "@metamask/transaction-controller";
16
+ import type { AuthorizationList, TransactionControllerAddTransactionBatchAction, TransactionControllerEstimateGasAction, TransactionControllerEstimateGasBatchAction, TransactionControllerUnapprovedTransactionAddedEvent } from "@metamask/transaction-controller";
17
17
  import type { BatchTransaction, TransactionControllerAddTransactionAction, TransactionControllerGetGasFeeTokensAction, TransactionControllerGetStateAction, TransactionControllerStateChangeEvent, TransactionControllerUpdateTransactionAction, TransactionMeta } from "@metamask/transaction-controller";
18
18
  import type { Hex, Json } from "@metamask/utils";
19
19
  import type { Draft } from "immer";
20
20
  import type { CONTROLLER_NAME, TransactionPayStrategy } from "./constants.cjs";
21
- export type AllowedActions = AccountTrackerControllerGetStateAction | BridgeControllerActions | BridgeStatusControllerActions | CurrencyRateControllerActions | GasFeeControllerActions | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | RemoteFeatureFlagControllerGetStateAction | TokenBalancesControllerGetStateAction | TokenListControllerActions | TokenRatesControllerGetStateAction | TokensControllerGetStateAction | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
21
+ export type AllowedActions = AccountTrackerControllerGetStateAction | BridgeControllerActions | BridgeStatusControllerActions | CurrencyRateControllerActions | GasFeeControllerActions | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | RemoteFeatureFlagControllerGetStateAction | TokenBalancesControllerGetStateAction | TokenListControllerActions | TokenRatesControllerGetStateAction | TokensControllerGetStateAction | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
22
22
  export type AllowedEvents = BridgeStatusControllerStateChangeEvent | TransactionControllerStateChangeEvent | TransactionControllerUnapprovedTransactionAddedEvent;
23
23
  export type TransactionPayControllerGetStateAction = ControllerGetStateAction<typeof CONTROLLER_NAME, TransactionPayControllerState>;
24
24
  export type TransactionPayControllerGetDelegationTransactionAction = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,qCAAqC;AACtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,qCAAqC;AAC/E,OAAO,KAAK,EAAE,kCAAkC,EAAE,qCAAqC;AACvF,OAAO,KAAK,EAAE,8BAA8B,EAAE,qCAAqC;AACnF,OAAO,KAAK,EAAE,sCAAsC,EAAE,qCAAqC;AAC3F,OAAO,KAAK,EAAE,0BAA0B,EAAE,kCAAkC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,kCAAkC;AAC1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,oCAAoC;AAC3E,OAAO,KAAK,EAAE,sCAAsC,EAAE,2CAA2C;AACjG,OAAO,KAAK,EAAE,6B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ACpB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,oBAAoB,GAAG;IACjC,0EAA0E;IAC1E,iBAAiB,EAAE,MAAM,CAAC;IAE1B,4DAA4D;IAC5D,IAAI,EAAE,kBAAkB,CAAC;IAEzB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IAErB,oEAAoE;IACpE,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,yBAAyB,GAAG;IACtC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IAEtB,wCAAwC;IACxC,YAAY,EAAE,GAAG,CAAC;IAElB,yCAAyC;IACzC,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,gCAAgC,GAAG,CAAC,EAC9C,WAAW,GACZ,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;CAC9B,KAAK,OAAO,CAAC;IACZ,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,IAAI,EAAE,GAAG,CAAC;IACV,EAAE,EAAE,GAAG,CAAC;IACR,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC,CAAC;AAEH,0CAA0C;AAC1C,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG;IAC/B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IAEd,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
package/dist/types.d.mts CHANGED
@@ -13,12 +13,12 @@ import type { Messenger } from "@metamask/messenger";
13
13
  import type { NetworkControllerFindNetworkClientIdByChainIdAction } from "@metamask/network-controller";
14
14
  import type { NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
15
15
  import type { RemoteFeatureFlagControllerGetStateAction } from "@metamask/remote-feature-flag-controller";
16
- import type { AuthorizationList, TransactionControllerAddTransactionBatchAction, TransactionControllerUnapprovedTransactionAddedEvent } from "@metamask/transaction-controller";
16
+ import type { AuthorizationList, TransactionControllerAddTransactionBatchAction, TransactionControllerEstimateGasAction, TransactionControllerEstimateGasBatchAction, TransactionControllerUnapprovedTransactionAddedEvent } from "@metamask/transaction-controller";
17
17
  import type { BatchTransaction, TransactionControllerAddTransactionAction, TransactionControllerGetGasFeeTokensAction, TransactionControllerGetStateAction, TransactionControllerStateChangeEvent, TransactionControllerUpdateTransactionAction, TransactionMeta } from "@metamask/transaction-controller";
18
18
  import type { Hex, Json } from "@metamask/utils";
19
19
  import type { Draft } from "immer";
20
20
  import type { CONTROLLER_NAME, TransactionPayStrategy } from "./constants.mjs";
21
- export type AllowedActions = AccountTrackerControllerGetStateAction | BridgeControllerActions | BridgeStatusControllerActions | CurrencyRateControllerActions | GasFeeControllerActions | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | RemoteFeatureFlagControllerGetStateAction | TokenBalancesControllerGetStateAction | TokenListControllerActions | TokenRatesControllerGetStateAction | TokensControllerGetStateAction | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
21
+ export type AllowedActions = AccountTrackerControllerGetStateAction | BridgeControllerActions | BridgeStatusControllerActions | CurrencyRateControllerActions | GasFeeControllerActions | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | RemoteFeatureFlagControllerGetStateAction | TokenBalancesControllerGetStateAction | TokenListControllerActions | TokenRatesControllerGetStateAction | TokensControllerGetStateAction | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
22
22
  export type AllowedEvents = BridgeStatusControllerStateChangeEvent | TransactionControllerStateChangeEvent | TransactionControllerUnapprovedTransactionAddedEvent;
23
23
  export type TransactionPayControllerGetStateAction = ControllerGetStateAction<typeof CONTROLLER_NAME, TransactionPayControllerState>;
24
24
  export type TransactionPayControllerGetDelegationTransactionAction = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,qCAAqC;AACtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,qCAAqC;AAC/E,OAAO,KAAK,EAAE,kCAAkC,EAAE,qCAAqC;AACvF,OAAO,KAAK,EAAE,8BAA8B,EAAE,qCAAqC;AACnF,OAAO,KAAK,EAAE,sCAAsC,EAAE,qCAAqC;AAC3F,OAAO,KAAK,EAAE,0BAA0B,EAAE,kCAAkC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,kCAAkC;AAC1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,oCAAoC;AAC3E,OAAO,KAAK,EAAE,sCAAsC,EAAE,2CAA2C;AACjG,OAAO,KAAK,EAAE,6BAA6B,EAAE,2CAA2C;AACxF,OAAO,KAAK,EAAE,uBAAuB,EAAE,qCAAqC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAAE,mDAAmD,EAAE,qCAAqC;AACxG,OAAO,KAAK,EAAE,2CAA2C,EAAE,qCAAqC;AAChG,OAAO,KAAK,EAAE,yCAAyC,EAAE,iDAAiD;AAC1G,OAAO,KAAK,EACV,iBAAiB,EACjB,8CAA8C,EAC9C,oDAAoD,EACrD,yCAAyC;AAC1C,OAAO,KAAK,EACV,gBAAgB,EAChB,yCAAyC,EACzC,0CAA0C,EAC1C,mCAAmC,EACnC,qCAAqC,EACrC,4CAA4C,EAC5C,eAAe,EAChB,yCAAyC;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,wBAAwB;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc;AAEnC,OAAO,KAAK,EAAE,eAAe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,KAAK,OAAO,CAAC;IACZ,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,IAAI,EAAE,GAAG,CAAC;IACV,EAAE,EAAE,GAAG,CAAC;IACR,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC,CAAC;AAEH,0CAA0C;AAC1C,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG;IAC/B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IAEd,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type { TokenListControllerActions } from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { BridgeControllerActions } from '@metamask/bridge-controller';\nimport type { BridgeStatusControllerStateChangeEvent } from '@metamask/bridge-status-controller';\nimport type { BridgeStatusControllerActions } from '@metamask/bridge-status-controller';\nimport type { GasFeeControllerActions } from '@metamask/gas-fee-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\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 { CONTROLLER_NAME, TransactionPayStrategy } from './constants';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\n | TokenListControllerActions\n | TokenRatesControllerGetStateAction\n | TokensControllerGetStateAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | BridgeStatusControllerStateChangeEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `${typeof CONTROLLER_NAME}:getDelegationTransaction`;\n handler: GetDelegationTransactionCallback;\n};\n\n/** Action to get the pay strategy type used for a transaction. */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `${typeof CONTROLLER_NAME}:getStrategy`;\n handler: (transaction: TransactionMeta) => TransactionPayStrategy;\n};\n\n/** Action to update the payment token for a transaction. */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;\n handler: (request: UpdatePaymentTokenRequest) => void;\n};\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerUpdatePaymentTokenAction;\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 /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\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/** State relating to a single transaction. */\nexport type TransactionData = {\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Source token selected for the transaction. */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\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/** 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 /** Address of the required token. */\n targetTokenAddress: Hex;\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 /** Address of the user's account. */\n from: Hex;\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/** 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 the quote provider. */\n provider: 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 /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\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\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\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 /** 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\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\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\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 /** Total amount of source token required. */\n sourceAmount: Amount;\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/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\n transaction: TransactionMeta;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: 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.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type { TokenListControllerActions } from '@metamask/assets-controllers';\nimport type { TokenRatesControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { TokensControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { AccountTrackerControllerGetStateAction } from '@metamask/assets-controllers';\nimport type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { ControllerGetStateAction } from '@metamask/base-controller';\nimport type { BridgeControllerActions } from '@metamask/bridge-controller';\nimport type { BridgeStatusControllerStateChangeEvent } from '@metamask/bridge-status-controller';\nimport type { BridgeStatusControllerActions } from '@metamask/bridge-status-controller';\nimport type { GasFeeControllerActions } from '@metamask/gas-fee-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type {\n AuthorizationList,\n TransactionControllerAddTransactionBatchAction,\n TransactionControllerEstimateGasAction,\n TransactionControllerEstimateGasBatchAction,\n TransactionControllerUnapprovedTransactionAddedEvent,\n} from '@metamask/transaction-controller';\nimport type {\n BatchTransaction,\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 { CONTROLLER_NAME, TransactionPayStrategy } from './constants';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\n | TokenListControllerActions\n | TokenRatesControllerGetStateAction\n | TokensControllerGetStateAction\n | TransactionControllerAddTransactionAction\n | TransactionControllerAddTransactionBatchAction\n | TransactionControllerEstimateGasAction\n | TransactionControllerEstimateGasBatchAction\n | TransactionControllerGetGasFeeTokensAction\n | TransactionControllerGetStateAction\n | TransactionControllerUpdateTransactionAction;\n\nexport type AllowedEvents =\n | BridgeStatusControllerStateChangeEvent\n | TransactionControllerStateChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent;\n\nexport type TransactionPayControllerGetStateAction = ControllerGetStateAction<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n>;\n\nexport type TransactionPayControllerGetDelegationTransactionAction = {\n type: `${typeof CONTROLLER_NAME}:getDelegationTransaction`;\n handler: GetDelegationTransactionCallback;\n};\n\n/** Action to get the pay strategy type used for a transaction. */\nexport type TransactionPayControllerGetStrategyAction = {\n type: `${typeof CONTROLLER_NAME}:getStrategy`;\n handler: (transaction: TransactionMeta) => TransactionPayStrategy;\n};\n\n/** Action to update the payment token for a transaction. */\nexport type TransactionPayControllerUpdatePaymentTokenAction = {\n type: `${typeof CONTROLLER_NAME}:updatePaymentToken`;\n handler: (request: UpdatePaymentTokenRequest) => void;\n};\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerUpdatePaymentTokenAction;\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 /** Callback to convert a transaction into a redeem delegation. */\n getDelegationTransaction: GetDelegationTransactionCallback;\n\n /** Callback to select the PayStrategy for a transaction. */\n getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\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/** State relating to a single transaction. */\nexport type TransactionData = {\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Source token selected for the transaction. */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\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/** 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 /** Address of the required token. */\n targetTokenAddress: Hex;\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 /** Address of the user's account. */\n from: Hex;\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/** 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 the quote provider. */\n provider: 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 /** Raw quote data returned by the provider. */\n original: OriginalQuote;\n\n /** Associated quote request. */\n request: QuoteRequest;\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\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quote requests for required tokens. */\n requests: QuoteRequest[];\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 /** 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\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\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\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 /** Total amount of source token required. */\n sourceAmount: Amount;\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/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\n transaction: TransactionMeta;\n}) => Promise<{\n authorizationList?: AuthorizationList;\n data: Hex;\n to: Hex;\n value: 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,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFeatureFlags = exports.DEFAULT_SLIPPAGE = exports.DEFAULT_RELAY_QUOTE_URL = exports.DEFAULT_RELAY_FALLBACK_GAS_MAX = exports.DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = void 0;
3
+ exports.getGasBuffer = exports.getFeatureFlags = exports.DEFAULT_SLIPPAGE = exports.DEFAULT_RELAY_QUOTE_URL = exports.DEFAULT_RELAY_FALLBACK_GAS_MAX = exports.DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = exports.DEFAULT_GAS_BUFFER = void 0;
4
4
  const utils_1 = require("@metamask/utils");
5
5
  const logger_1 = require("../logger.cjs");
6
6
  const constants_1 = require("../strategy/relay/constants.cjs");
7
7
  const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'feature-flags');
8
+ exports.DEFAULT_GAS_BUFFER = 1.0;
8
9
  exports.DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;
9
10
  exports.DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;
10
11
  exports.DEFAULT_RELAY_QUOTE_URL = `${constants_1.RELAY_URL_BASE}/quote`;
@@ -16,8 +17,7 @@ exports.DEFAULT_SLIPPAGE = 0.005;
16
17
  * @returns Feature flags.
17
18
  */
18
19
  function getFeatureFlags(messenger) {
19
- const state = messenger.call('RemoteFeatureFlagController:getState');
20
- const featureFlags = state.remoteFeatureFlags.confirmations_pay ?? {};
20
+ const featureFlags = getFeatureFlagsRaw(messenger);
21
21
  const estimate = featureFlags.relayFallbackGas?.estimate ??
22
22
  exports.DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE;
23
23
  const max = featureFlags.relayFallbackGas?.max ?? exports.DEFAULT_RELAY_FALLBACK_GAS_MAX;
@@ -37,4 +37,28 @@ function getFeatureFlags(messenger) {
37
37
  return result;
38
38
  }
39
39
  exports.getFeatureFlags = getFeatureFlags;
40
+ /**
41
+ * Get the gas buffer value for a specific chain ID.
42
+ *
43
+ * @param messenger - Controller messenger.
44
+ * @param chainId - Chain ID to get gas buffer for.
45
+ * @returns Gas buffer value.
46
+ */
47
+ function getGasBuffer(messenger, chainId) {
48
+ const featureFlags = getFeatureFlagsRaw(messenger);
49
+ return (featureFlags.gasBuffer?.perChainConfig?.[chainId]?.buffer ??
50
+ featureFlags.gasBuffer?.default ??
51
+ exports.DEFAULT_GAS_BUFFER);
52
+ }
53
+ exports.getGasBuffer = getGasBuffer;
54
+ /**
55
+ * Get the raw feature flags from the remote feature flag controller.
56
+ *
57
+ * @param messenger - Controller messenger.
58
+ * @returns Raw feature flags.
59
+ */
60
+ function getFeatureFlagsRaw(messenger) {
61
+ const state = messenger.call('RemoteFeatureFlagController:getState');
62
+ return state.remoteFeatureFlags.confirmations_pay ?? {};
63
+ }
40
64
  //# sourceMappingURL=feature-flags.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags.cjs","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":";;;AACA,2CAAqD;AAGrD,0CAA0C;AAC1C,+DAA6D;AAE7D,MAAM,GAAG,GAAG,IAAA,0BAAkB,EAAC,sBAAa,EAAE,eAAe,CAAC,CAAC;AAElD,QAAA,mCAAmC,GAAG,MAAM,CAAC;AAC7C,QAAA,8BAA8B,GAAG,OAAO,CAAC;AACzC,QAAA,uBAAuB,GAAG,GAAG,0BAAc,QAAQ,CAAC;AACpD,QAAA,gBAAgB,GAAG,KAAK,CAAC;AAsBtC;;;;;GAKG;AACH,SAAgB,eAAe,CAC7B,SAA4C;IAE5C,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IAErE,MAAM,YAAY,GACf,KAAK,CAAC,kBAAkB,CAAC,iBAAqC,IAAI,EAAE,CAAC;IAExE,MAAM,QAAQ,GACZ,YAAY,CAAC,gBAAgB,EAAE,QAAQ;QACvC,2CAAmC,CAAC;IAEtC,MAAM,GAAG,GACP,YAAY,CAAC,gBAAgB,EAAE,GAAG,IAAI,sCAA8B,CAAC;IAEvE,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,IAAI,+BAAuB,CAAC;IAE5E,MAAM,6BAA6B,GACjC,YAAY,CAAC,6BAA6B,IAAI,EAAE,CAAC;IAEnD,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,IAAI,wBAAgB,CAAC;IAE3D,MAAM,MAAM,GAAG;QACb,6BAA6B;QAC7B,gBAAgB,EAAE;YAChB,QAAQ;YACR,GAAG;SACJ;QACD,aAAa;QACb,QAAQ;KACT,CAAC;IAEF,GAAG,CAAC,gBAAgB,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IAErD,OAAO,MAAM,CAAC;AAChB,CAAC;AAnCD,0CAmCC","sourcesContent":["import type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport type { TransactionPayControllerMessenger } from '..';\nimport { projectLogger } from '../logger';\nimport { RELAY_URL_BASE } from '../strategy/relay/constants';\n\nconst log = createModuleLogger(projectLogger, 'feature-flags');\n\nexport const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;\nexport const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;\nexport const DEFAULT_RELAY_QUOTE_URL = `${RELAY_URL_BASE}/quote`;\nexport const DEFAULT_SLIPPAGE = 0.005;\n\ntype FeatureFlagsRaw = {\n relayDisabledGasStationChains?: Hex[];\n relayFallbackGas?: {\n estimate?: number;\n max?: number;\n };\n relayQuoteUrl?: string;\n slippage?: number;\n};\n\nexport type FeatureFlags = {\n relayDisabledGasStationChains: Hex[];\n relayFallbackGas: {\n estimate: number;\n max: number;\n };\n relayQuoteUrl: string;\n slippage: number;\n};\n\n/**\n * Get feature flags related to the controller.\n *\n * @param messenger - Controller messenger.\n * @returns Feature flags.\n */\nexport function getFeatureFlags(\n messenger: TransactionPayControllerMessenger,\n): FeatureFlags {\n const state = messenger.call('RemoteFeatureFlagController:getState');\n\n const featureFlags: FeatureFlagsRaw =\n (state.remoteFeatureFlags.confirmations_pay as FeatureFlagsRaw) ?? {};\n\n const estimate =\n featureFlags.relayFallbackGas?.estimate ??\n DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE;\n\n const max =\n featureFlags.relayFallbackGas?.max ?? DEFAULT_RELAY_FALLBACK_GAS_MAX;\n\n const relayQuoteUrl = featureFlags.relayQuoteUrl ?? DEFAULT_RELAY_QUOTE_URL;\n\n const relayDisabledGasStationChains =\n featureFlags.relayDisabledGasStationChains ?? [];\n\n const slippage = featureFlags.slippage ?? DEFAULT_SLIPPAGE;\n\n const result = {\n relayDisabledGasStationChains,\n relayFallbackGas: {\n estimate,\n max,\n },\n relayQuoteUrl,\n slippage,\n };\n\n log('Feature flags:', { raw: featureFlags, result });\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"feature-flags.cjs","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":";;;AACA,2CAAqD;AAGrD,0CAA0C;AAC1C,+DAA6D;AAE7D,MAAM,GAA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O;QAC/B,0BAAkB,CACnB,CAAC;AACJ,CAAC;AAXD,oCAWC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB,CACzB,SAA4C;IAE5C,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IACrE,OAAQ,KAAK,CAAC,kBAAkB,CAAC,iBAAqC,IAAI,EAAE,CAAC;AAC/E,CAAC","sourcesContent":["import type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport type { TransactionPayControllerMessenger } from '..';\nimport { projectLogger } from '../logger';\nimport { RELAY_URL_BASE } from '../strategy/relay/constants';\n\nconst log = createModuleLogger(projectLogger, 'feature-flags');\n\nexport const DEFAULT_GAS_BUFFER = 1.0;\nexport const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;\nexport const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;\nexport const DEFAULT_RELAY_QUOTE_URL = `${RELAY_URL_BASE}/quote`;\nexport const DEFAULT_SLIPPAGE = 0.005;\n\ntype FeatureFlagsRaw = {\n gasBuffer?: {\n default?: number;\n perChainConfig?: Record<\n Hex,\n {\n name?: string;\n buffer?: number;\n }\n >;\n };\n relayDisabledGasStationChains?: Hex[];\n relayFallbackGas?: {\n estimate?: number;\n max?: number;\n };\n relayQuoteUrl?: string;\n slippage?: number;\n};\n\nexport type FeatureFlags = {\n relayDisabledGasStationChains: Hex[];\n relayFallbackGas: {\n estimate: number;\n max: number;\n };\n relayQuoteUrl: string;\n slippage: number;\n};\n\n/**\n * Get feature flags related to the controller.\n *\n * @param messenger - Controller messenger.\n * @returns Feature flags.\n */\nexport function getFeatureFlags(\n messenger: TransactionPayControllerMessenger,\n): FeatureFlags {\n const featureFlags = getFeatureFlagsRaw(messenger);\n\n const estimate =\n featureFlags.relayFallbackGas?.estimate ??\n DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE;\n\n const max =\n featureFlags.relayFallbackGas?.max ?? DEFAULT_RELAY_FALLBACK_GAS_MAX;\n\n const relayQuoteUrl = featureFlags.relayQuoteUrl ?? DEFAULT_RELAY_QUOTE_URL;\n\n const relayDisabledGasStationChains =\n featureFlags.relayDisabledGasStationChains ?? [];\n\n const slippage = featureFlags.slippage ?? DEFAULT_SLIPPAGE;\n\n const result = {\n relayDisabledGasStationChains,\n relayFallbackGas: {\n estimate,\n max,\n },\n relayQuoteUrl,\n slippage,\n };\n\n log('Feature flags:', { raw: featureFlags, result });\n\n return result;\n}\n\n/**\n * Get the gas buffer value for a specific chain ID.\n *\n * @param messenger - Controller messenger.\n * @param chainId - Chain ID to get gas buffer for.\n * @returns Gas buffer value.\n */\nexport function getGasBuffer(\n messenger: TransactionPayControllerMessenger,\n chainId: Hex,\n): number {\n const featureFlags = getFeatureFlagsRaw(messenger);\n\n return (\n featureFlags.gasBuffer?.perChainConfig?.[chainId]?.buffer ??\n featureFlags.gasBuffer?.default ??\n DEFAULT_GAS_BUFFER\n );\n}\n\n/**\n * Get the raw feature flags from the remote feature flag controller.\n *\n * @param messenger - Controller messenger.\n * @returns Raw feature flags.\n */\nfunction getFeatureFlagsRaw(\n messenger: TransactionPayControllerMessenger,\n): FeatureFlagsRaw {\n const state = messenger.call('RemoteFeatureFlagController:getState');\n return (state.remoteFeatureFlags.confirmations_pay as FeatureFlagsRaw) ?? {};\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { Hex } from "@metamask/utils";
2
2
  import type { TransactionPayControllerMessenger } from "../index.cjs";
3
+ export declare const DEFAULT_GAS_BUFFER = 1;
3
4
  export declare const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;
4
5
  export declare const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;
5
6
  export declare const DEFAULT_RELAY_QUOTE_URL = "https://api.relay.link/quote";
@@ -20,4 +21,12 @@ export type FeatureFlags = {
20
21
  * @returns Feature flags.
21
22
  */
22
23
  export declare function getFeatureFlags(messenger: TransactionPayControllerMessenger): FeatureFlags;
24
+ /**
25
+ * Get the gas buffer value for a specific chain ID.
26
+ *
27
+ * @param messenger - Controller messenger.
28
+ * @param chainId - Chain ID to get gas buffer for.
29
+ * @returns Gas buffer value.
30
+ */
31
+ export declare function getGasBuffer(messenger: TransactionPayControllerMessenger, chainId: Hex): number;
23
32
  //# sourceMappingURL=feature-flags.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags.d.cts","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAG3C,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAW;AAM5D,eAAO,MAAM,mCAAmC,SAAS,CAAC;AAC1D,eAAO,MAAM,8BAA8B,UAAU,CAAC;AACtD,eAAO,MAAM,uBAAuB,iCAA4B,CAAC;AACjE,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAYtC,MAAM,MAAM,YAAY,GAAG;IACzB,6BAA6B,EAAE,GAAG,EAAE,CAAC;IACrC,gBAAgB,EAAE;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iCAAiC,GAC3C,YAAY,CAiCd"}
1
+ {"version":3,"file":"feature-flags.d.cts","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAG3C,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAW;AAM5D,eAAO,MAAM,kBAAkB,IAAM,CAAC;AACtC,eAAO,MAAM,mCAAmC,SAAS,CAAC;AAC1D,eAAO,MAAM,8BAA8B,UAAU,CAAC;AACtD,eAAO,MAAM,uBAAuB,iCAA4B,CAAC;AACjE,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAsBtC,MAAM,MAAM,YAAY,GAAG;IACzB,6BAA6B,EAAE,GAAG,EAAE,CAAC;IACrC,gBAAgB,EAAE;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iCAAiC,GAC3C,YAAY,CA8Bd;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,iCAAiC,EAC5C,OAAO,EAAE,GAAG,GACX,MAAM,CAQR"}
@@ -1,5 +1,6 @@
1
1
  import type { Hex } from "@metamask/utils";
2
2
  import type { TransactionPayControllerMessenger } from "../index.mjs";
3
+ export declare const DEFAULT_GAS_BUFFER = 1;
3
4
  export declare const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;
4
5
  export declare const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;
5
6
  export declare const DEFAULT_RELAY_QUOTE_URL = "https://api.relay.link/quote";
@@ -20,4 +21,12 @@ export type FeatureFlags = {
20
21
  * @returns Feature flags.
21
22
  */
22
23
  export declare function getFeatureFlags(messenger: TransactionPayControllerMessenger): FeatureFlags;
24
+ /**
25
+ * Get the gas buffer value for a specific chain ID.
26
+ *
27
+ * @param messenger - Controller messenger.
28
+ * @param chainId - Chain ID to get gas buffer for.
29
+ * @returns Gas buffer value.
30
+ */
31
+ export declare function getGasBuffer(messenger: TransactionPayControllerMessenger, chainId: Hex): number;
23
32
  //# sourceMappingURL=feature-flags.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags.d.mts","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAG3C,OAAO,KAAK,EAAE,iCAAiC,EAAE,q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,iCAAiC,EAC5C,OAAO,EAAE,GAAG,GACX,MAAM,CAQR"}
@@ -2,6 +2,7 @@ import { createModuleLogger } from "@metamask/utils";
2
2
  import { projectLogger } from "../logger.mjs";
3
3
  import { RELAY_URL_BASE } from "../strategy/relay/constants.mjs";
4
4
  const log = createModuleLogger(projectLogger, 'feature-flags');
5
+ export const DEFAULT_GAS_BUFFER = 1.0;
5
6
  export const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;
6
7
  export const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;
7
8
  export const DEFAULT_RELAY_QUOTE_URL = `${RELAY_URL_BASE}/quote`;
@@ -13,8 +14,7 @@ export const DEFAULT_SLIPPAGE = 0.005;
13
14
  * @returns Feature flags.
14
15
  */
15
16
  export function getFeatureFlags(messenger) {
16
- const state = messenger.call('RemoteFeatureFlagController:getState');
17
- const featureFlags = state.remoteFeatureFlags.confirmations_pay ?? {};
17
+ const featureFlags = getFeatureFlagsRaw(messenger);
18
18
  const estimate = featureFlags.relayFallbackGas?.estimate ??
19
19
  DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE;
20
20
  const max = featureFlags.relayFallbackGas?.max ?? DEFAULT_RELAY_FALLBACK_GAS_MAX;
@@ -33,4 +33,27 @@ export function getFeatureFlags(messenger) {
33
33
  log('Feature flags:', { raw: featureFlags, result });
34
34
  return result;
35
35
  }
36
+ /**
37
+ * Get the gas buffer value for a specific chain ID.
38
+ *
39
+ * @param messenger - Controller messenger.
40
+ * @param chainId - Chain ID to get gas buffer for.
41
+ * @returns Gas buffer value.
42
+ */
43
+ export function getGasBuffer(messenger, chainId) {
44
+ const featureFlags = getFeatureFlagsRaw(messenger);
45
+ return (featureFlags.gasBuffer?.perChainConfig?.[chainId]?.buffer ??
46
+ featureFlags.gasBuffer?.default ??
47
+ DEFAULT_GAS_BUFFER);
48
+ }
49
+ /**
50
+ * Get the raw feature flags from the remote feature flag controller.
51
+ *
52
+ * @param messenger - Controller messenger.
53
+ * @returns Raw feature flags.
54
+ */
55
+ function getFeatureFlagsRaw(messenger) {
56
+ const state = messenger.call('RemoteFeatureFlagController:getState');
57
+ return state.remoteFeatureFlags.confirmations_pay ?? {};
58
+ }
36
59
  //# sourceMappingURL=feature-flags.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags.mjs","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;AAGrD,OAAO,EAAE,aAAa,EAAE,sBAAkB;AAC1C,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D,MAAM,GAAG,GAAG,kBAAkB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAC1D,MAAM,CAAC,MAAM,8BAA8B,GAAG,OAAO,CAAC;AACtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,cAAc,QAAQ,CAAC;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAsBtC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,SAA4C;IAE5C,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IAErE,MAAM,YAAY,GACf,KAAK,CAAC,kBAAkB,CAAC,iBAAqC,IAAI,EAAE,CAAC;IAExE,MAAM,QAAQ,GACZ,YAAY,CAAC,gBAAgB,EAAE,QAAQ;QACvC,mCAAmC,CAAC;IAEtC,MAAM,GAAG,GACP,YAAY,CAAC,gBAAgB,EAAE,GAAG,IAAI,8BAA8B,CAAC;IAEvE,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,IAAI,uBAAuB,CAAC;IAE5E,MAAM,6BAA6B,GACjC,YAAY,CAAC,6BAA6B,IAAI,EAAE,CAAC;IAEnD,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,IAAI,gBAAgB,CAAC;IAE3D,MAAM,MAAM,GAAG;QACb,6BAA6B;QAC7B,gBAAgB,EAAE;YAChB,QAAQ;YACR,GAAG;SACJ;QACD,aAAa;QACb,QAAQ;KACT,CAAC;IAEF,GAAG,CAAC,gBAAgB,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IAErD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport type { TransactionPayControllerMessenger } from '..';\nimport { projectLogger } from '../logger';\nimport { RELAY_URL_BASE } from '../strategy/relay/constants';\n\nconst log = createModuleLogger(projectLogger, 'feature-flags');\n\nexport const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;\nexport const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;\nexport const DEFAULT_RELAY_QUOTE_URL = `${RELAY_URL_BASE}/quote`;\nexport const DEFAULT_SLIPPAGE = 0.005;\n\ntype FeatureFlagsRaw = {\n relayDisabledGasStationChains?: Hex[];\n relayFallbackGas?: {\n estimate?: number;\n max?: number;\n };\n relayQuoteUrl?: string;\n slippage?: number;\n};\n\nexport type FeatureFlags = {\n relayDisabledGasStationChains: Hex[];\n relayFallbackGas: {\n estimate: number;\n max: number;\n };\n relayQuoteUrl: string;\n slippage: number;\n};\n\n/**\n * Get feature flags related to the controller.\n *\n * @param messenger - Controller messenger.\n * @returns Feature flags.\n */\nexport function getFeatureFlags(\n messenger: TransactionPayControllerMessenger,\n): FeatureFlags {\n const state = messenger.call('RemoteFeatureFlagController:getState');\n\n const featureFlags: FeatureFlagsRaw =\n (state.remoteFeatureFlags.confirmations_pay as FeatureFlagsRaw) ?? {};\n\n const estimate =\n featureFlags.relayFallbackGas?.estimate ??\n DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE;\n\n const max =\n featureFlags.relayFallbackGas?.max ?? DEFAULT_RELAY_FALLBACK_GAS_MAX;\n\n const relayQuoteUrl = featureFlags.relayQuoteUrl ?? DEFAULT_RELAY_QUOTE_URL;\n\n const relayDisabledGasStationChains =\n featureFlags.relayDisabledGasStationChains ?? [];\n\n const slippage = featureFlags.slippage ?? DEFAULT_SLIPPAGE;\n\n const result = {\n relayDisabledGasStationChains,\n relayFallbackGas: {\n estimate,\n max,\n },\n relayQuoteUrl,\n slippage,\n };\n\n log('Feature flags:', { raw: featureFlags, result });\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"feature-flags.mjs","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;AAGrD,OAAO,EAAE,aAAa,EAAE,sBAAkB;AAC1C,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D,MAAM,GAAG,GAAG,kBAAkB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAC1D,MAAM,CAAC,MAAM,8BAA8B,GAAG,OAAO,CAAC;AACtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,cAAc,QAAQ,CAAC;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAgCtC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,SAA4C;IAE5C,MAAM,YAAY,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAM,QAAQ,GACZ,YAAY,CAAC,gBAAgB,EAAE,QAAQ;QACvC,mCAAmC,CAAC;IAEtC,MAAM,GAAG,GACP,YAAY,CAAC,gBAAgB,EAAE,GAAG,IAAI,8BAA8B,CAAC;IAEvE,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,IAAI,uBAAuB,CAAC;IAE5E,MAAM,6BAA6B,GACjC,YAAY,CAAC,6BAA6B,IAAI,EAAE,CAAC;IAEnD,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,IAAI,gBAAgB,CAAC;IAE3D,MAAM,MAAM,GAAG;QACb,6BAA6B;QAC7B,gBAAgB,EAAE;YAChB,QAAQ;YACR,GAAG;SACJ;QACD,aAAa;QACb,QAAQ;KACT,CAAC;IAEF,GAAG,CAAC,gBAAgB,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IAErD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,SAA4C,EAC5C,OAAY;IAEZ,MAAM,YAAY,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAEnD,OAAO,CACL,YAAY,CAAC,SAAS,EAAE,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM;QACzD,YAAY,CAAC,SAAS,EAAE,OAAO;QAC/B,kBAAkB,CACnB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB,CACzB,SAA4C;IAE5C,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IACrE,OAAQ,KAAK,CAAC,kBAAkB,CAAC,iBAAqC,IAAI,EAAE,CAAC;AAC/E,CAAC","sourcesContent":["import type { Hex } from '@metamask/utils';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport type { TransactionPayControllerMessenger } from '..';\nimport { projectLogger } from '../logger';\nimport { RELAY_URL_BASE } from '../strategy/relay/constants';\n\nconst log = createModuleLogger(projectLogger, 'feature-flags');\n\nexport const DEFAULT_GAS_BUFFER = 1.0;\nexport const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;\nexport const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;\nexport const DEFAULT_RELAY_QUOTE_URL = `${RELAY_URL_BASE}/quote`;\nexport const DEFAULT_SLIPPAGE = 0.005;\n\ntype FeatureFlagsRaw = {\n gasBuffer?: {\n default?: number;\n perChainConfig?: Record<\n Hex,\n {\n name?: string;\n buffer?: number;\n }\n >;\n };\n relayDisabledGasStationChains?: Hex[];\n relayFallbackGas?: {\n estimate?: number;\n max?: number;\n };\n relayQuoteUrl?: string;\n slippage?: number;\n};\n\nexport type FeatureFlags = {\n relayDisabledGasStationChains: Hex[];\n relayFallbackGas: {\n estimate: number;\n max: number;\n };\n relayQuoteUrl: string;\n slippage: number;\n};\n\n/**\n * Get feature flags related to the controller.\n *\n * @param messenger - Controller messenger.\n * @returns Feature flags.\n */\nexport function getFeatureFlags(\n messenger: TransactionPayControllerMessenger,\n): FeatureFlags {\n const featureFlags = getFeatureFlagsRaw(messenger);\n\n const estimate =\n featureFlags.relayFallbackGas?.estimate ??\n DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE;\n\n const max =\n featureFlags.relayFallbackGas?.max ?? DEFAULT_RELAY_FALLBACK_GAS_MAX;\n\n const relayQuoteUrl = featureFlags.relayQuoteUrl ?? DEFAULT_RELAY_QUOTE_URL;\n\n const relayDisabledGasStationChains =\n featureFlags.relayDisabledGasStationChains ?? [];\n\n const slippage = featureFlags.slippage ?? DEFAULT_SLIPPAGE;\n\n const result = {\n relayDisabledGasStationChains,\n relayFallbackGas: {\n estimate,\n max,\n },\n relayQuoteUrl,\n slippage,\n };\n\n log('Feature flags:', { raw: featureFlags, result });\n\n return result;\n}\n\n/**\n * Get the gas buffer value for a specific chain ID.\n *\n * @param messenger - Controller messenger.\n * @param chainId - Chain ID to get gas buffer for.\n * @returns Gas buffer value.\n */\nexport function getGasBuffer(\n messenger: TransactionPayControllerMessenger,\n chainId: Hex,\n): number {\n const featureFlags = getFeatureFlagsRaw(messenger);\n\n return (\n featureFlags.gasBuffer?.perChainConfig?.[chainId]?.buffer ??\n featureFlags.gasBuffer?.default ??\n DEFAULT_GAS_BUFFER\n );\n}\n\n/**\n * Get the raw feature flags from the remote feature flag controller.\n *\n * @param messenger - Controller messenger.\n * @returns Raw feature flags.\n */\nfunction getFeatureFlagsRaw(\n messenger: TransactionPayControllerMessenger,\n): FeatureFlagsRaw {\n const state = messenger.call('RemoteFeatureFlagController:getState');\n return (state.remoteFeatureFlags.confirmations_pay as FeatureFlagsRaw) ?? {};\n}\n"]}
@@ -20,7 +20,7 @@ function calculateTransactionGasCost(transaction, messenger, { isMax } = {}) {
20
20
  const { chainId, gasUsed: gasUsedOriginal, gasLimitNoBuffer, txParams, } = transaction;
21
21
  const { from, gas, maxFeePerGas, maxPriorityFeePerGas } = txParams;
22
22
  const gasUsed = isMax ? undefined : gasUsedOriginal;
23
- const finalGas = gasUsed || gasLimitNoBuffer || gas || '0x0';
23
+ const finalGas = gasUsed ?? gasLimitNoBuffer ?? gas ?? '0x0';
24
24
  const result = calculateGasCost({
25
25
  chainId,
26
26
  gas: finalGas,
@@ -65,11 +65,11 @@ function calculateGasCost(request) {
65
65
  const { chainId: chainIdInput, gas, isMax, maxFeePerGas: maxFeePerGasInput, maxPriorityFeePerGas: maxPriorityFeePerGasInput, messenger, } = request;
66
66
  const chainId = (0, controller_utils_1.toHex)(chainIdInput);
67
67
  const { estimatedBaseFee, maxFeePerGas: maxFeePerGasEstimate, maxPriorityFeePerGas: maxPriorityFeePerGasEstimate, } = getGasFee(chainId, messenger);
68
- const maxFeePerGas = maxFeePerGasInput || maxFeePerGasEstimate;
69
- const maxPriorityFeePerGas = maxPriorityFeePerGasInput || maxPriorityFeePerGasEstimate;
68
+ const maxFeePerGas = maxFeePerGasInput ?? maxFeePerGasEstimate;
69
+ const maxPriorityFeePerGas = maxPriorityFeePerGasInput ?? maxPriorityFeePerGasEstimate;
70
70
  const feePerGas = estimatedBaseFee && maxPriorityFeePerGas && !isMax
71
71
  ? new bignumber_js_1.BigNumber(estimatedBaseFee).plus(maxPriorityFeePerGas)
72
- : new bignumber_js_1.BigNumber(maxFeePerGas || '0x0');
72
+ : new bignumber_js_1.BigNumber(maxFeePerGas ?? '0x0');
73
73
  const rawValue = new bignumber_js_1.BigNumber(gas).multipliedBy(feePerGas);
74
74
  const raw = rawValue.toString(10);
75
75
  const humanValue = rawValue.shiftedBy(-18);
@@ -160,7 +160,8 @@ function calculateTransactionGasFeeTokenCost({ hasBalance, messenger, transactio
160
160
  return undefined;
161
161
  }
162
162
  log('Calculating gas fee token cost', { selectedGasFeeToken, chainId });
163
- const gasFeeToken = gasFeeTokens?.find((t) => t.tokenAddress.toLowerCase() === selectedGasFeeToken.toLowerCase());
163
+ const gasFeeToken = gasFeeTokens?.find((singleGasFeeToken) => singleGasFeeToken.tokenAddress.toLowerCase() ===
164
+ selectedGasFeeToken.toLowerCase());
164
165
  if (!gasFeeToken) {
165
166
  log('Gas fee token not found', {
166
167
  gasFeeTokens,