@metamask/transaction-pay-controller 19.2.2 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -1
- package/dist/TransactionPayController.cjs +10 -1
- package/dist/TransactionPayController.cjs.map +1 -1
- package/dist/TransactionPayController.d.cts.map +1 -1
- package/dist/TransactionPayController.d.mts.map +1 -1
- package/dist/TransactionPayController.mjs +10 -1
- package/dist/TransactionPayController.mjs.map +1 -1
- package/dist/actions/update-payment-token.cjs +3 -1
- package/dist/actions/update-payment-token.cjs.map +1 -1
- package/dist/actions/update-payment-token.d.cts.map +1 -1
- package/dist/actions/update-payment-token.d.mts.map +1 -1
- package/dist/actions/update-payment-token.mjs +3 -1
- package/dist/actions/update-payment-token.mjs.map +1 -1
- package/dist/helpers/TransactionPayPublishHook.cjs +3 -0
- package/dist/helpers/TransactionPayPublishHook.cjs.map +1 -1
- package/dist/helpers/TransactionPayPublishHook.d.cts.map +1 -1
- package/dist/helpers/TransactionPayPublishHook.d.mts.map +1 -1
- package/dist/helpers/TransactionPayPublishHook.mjs +3 -0
- package/dist/helpers/TransactionPayPublishHook.mjs.map +1 -1
- package/dist/strategy/across/AcrossStrategy.cjs +34 -3
- package/dist/strategy/across/AcrossStrategy.cjs.map +1 -1
- package/dist/strategy/across/AcrossStrategy.d.cts +2 -1
- package/dist/strategy/across/AcrossStrategy.d.cts.map +1 -1
- package/dist/strategy/across/AcrossStrategy.d.mts +2 -1
- package/dist/strategy/across/AcrossStrategy.d.mts.map +1 -1
- package/dist/strategy/across/AcrossStrategy.mjs +34 -3
- package/dist/strategy/across/AcrossStrategy.mjs.map +1 -1
- package/dist/strategy/across/across-quotes.cjs +4 -2
- package/dist/strategy/across/across-quotes.cjs.map +1 -1
- package/dist/strategy/across/across-quotes.mjs +4 -2
- package/dist/strategy/across/across-quotes.mjs.map +1 -1
- package/dist/strategy/across/types.cjs.map +1 -1
- package/dist/strategy/across/types.d.cts +1 -0
- package/dist/strategy/across/types.d.cts.map +1 -1
- package/dist/strategy/across/types.d.mts +1 -0
- package/dist/strategy/across/types.d.mts.map +1 -1
- package/dist/strategy/across/types.mjs.map +1 -1
- package/dist/strategy/fiat/fiat-quotes.cjs +2 -1
- package/dist/strategy/fiat/fiat-quotes.cjs.map +1 -1
- package/dist/strategy/fiat/fiat-quotes.d.cts.map +1 -1
- package/dist/strategy/fiat/fiat-quotes.d.mts.map +1 -1
- package/dist/strategy/fiat/fiat-quotes.mjs +2 -1
- package/dist/strategy/fiat/fiat-quotes.mjs.map +1 -1
- package/dist/strategy/relay/relay-quotes.cjs +3 -1
- package/dist/strategy/relay/relay-quotes.cjs.map +1 -1
- package/dist/strategy/relay/relay-quotes.mjs +3 -1
- package/dist/strategy/relay/relay-quotes.mjs.map +1 -1
- package/dist/strategy/relay/relay-submit.cjs +5 -2
- package/dist/strategy/relay/relay-submit.cjs.map +1 -1
- package/dist/strategy/relay/relay-submit.mjs +5 -2
- package/dist/strategy/relay/relay-submit.mjs.map +1 -1
- package/dist/tests/messenger-mock.cjs +12 -0
- package/dist/tests/messenger-mock.cjs.map +1 -1
- package/dist/tests/messenger-mock.d.cts +2 -4
- package/dist/tests/messenger-mock.d.cts.map +1 -1
- package/dist/tests/messenger-mock.d.mts +2 -4
- package/dist/tests/messenger-mock.d.mts.map +1 -1
- package/dist/tests/messenger-mock.mjs +12 -0
- package/dist/tests/messenger-mock.mjs.map +1 -1
- package/dist/types.cjs +9 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +42 -3
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +42 -3
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +8 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/7702.cjs +23 -0
- package/dist/utils/7702.cjs.map +1 -0
- package/dist/utils/7702.d.cts +15 -0
- package/dist/utils/7702.d.cts.map +1 -0
- package/dist/utils/7702.d.mts +15 -0
- package/dist/utils/7702.d.mts.map +1 -0
- package/dist/utils/7702.mjs +19 -0
- package/dist/utils/7702.mjs.map +1 -0
- package/dist/utils/feature-flags.cjs +1 -1
- package/dist/utils/feature-flags.cjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +1 -1
- package/dist/utils/feature-flags.d.mts +1 -1
- package/dist/utils/feature-flags.mjs +1 -1
- package/dist/utils/feature-flags.mjs.map +1 -1
- package/dist/utils/quote-gas.cjs +2 -1
- package/dist/utils/quote-gas.cjs.map +1 -1
- package/dist/utils/quote-gas.d.cts +1 -0
- package/dist/utils/quote-gas.d.cts.map +1 -1
- package/dist/utils/quote-gas.d.mts +1 -0
- package/dist/utils/quote-gas.d.mts.map +1 -1
- package/dist/utils/quote-gas.mjs +2 -1
- package/dist/utils/quote-gas.mjs.map +1 -1
- package/dist/utils/quotes.cjs +22 -5
- package/dist/utils/quotes.cjs.map +1 -1
- package/dist/utils/quotes.d.cts.map +1 -1
- package/dist/utils/quotes.d.mts.map +1 -1
- package/dist/utils/quotes.mjs +23 -6
- package/dist/utils/quotes.mjs.map +1 -1
- package/dist/utils/strategy.cjs +30 -1
- package/dist/utils/strategy.cjs.map +1 -1
- package/dist/utils/strategy.d.cts +21 -1
- package/dist/utils/strategy.d.cts.map +1 -1
- package/dist/utils/strategy.d.mts +21 -1
- package/dist/utils/strategy.d.mts.map +1 -1
- package/dist/utils/strategy.mjs +27 -0
- package/dist/utils/strategy.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messenger-mock.mjs","sourceRoot":"","sources":["../../src/tests/messenger-mock.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,4BAA4B;AAyBpE;;;;;;GAMG;AACH,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAC,EAC/B,YAAY,MACkB,EAAE;IAChC,MAAM,sBAAsB,GAExB,IAAI,CAAC,EAAE,EAAE,CAAC;IAEd,MAAM,eAA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CACrC,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,iCAAiC,EACjC,kCAAkC,CACnC,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,wCAAwC,EACxC,wBAAwB,CACzB,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,mDAAmD,EACnD,4BAA4B,CAC7B,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,uCAAuC,EACvC,mBAAmB,CACpB,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,mCAAmC,EACnC,eAAe,CAChB,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,wCAAwC,EACxC,oBAAoB,CACrB,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,4CAA4C,EAC5C,4BAA4B,CAC7B,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAElD,OAAO;QACL,kBAAkB;QAClB,4BAA4B;QAC5B,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 {\n BridgeStatusControllerGetStateAction,\n BridgeStatusControllerSubmitTxAction,\n} 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 {\n TransactionPayControllerGetDelegationTransactionAction,\n TransactionPayControllerGetStrategyAction,\n} from '../TransactionPayController-method-action-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 getAssetsControllerStateMock = 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 messenger.registerActionHandler(\n 'AssetsController:getStateForTransactionPay',\n getAssetsControllerStateMock,\n );\n }\n\n const publish = messenger.publish.bind(messenger);\n\n return {\n addTransactionMock,\n getAssetsControllerStateMock,\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
|
+
{"version":3,"file":"messenger-mock.mjs","sourceRoot":"","sources":["../../src/tests/messenger-mock.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,4BAA4B;AAyBpE;;;;;;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,MAA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,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,mCAAmC,EACnC,oCAAoC,CACrC,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,iCAAiC,EACjC,kCAAkC,CACnC,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,wCAAwC,EACxC,wBAAwB,CACzB,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,mDAAmD,EACnD,4BAA4B,CAC7B,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,uCAAuC,EACvC,mBAAmB,CACpB,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,mCAAmC,EACnC,eAAe,CAChB,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,wCAAwC,EACxC,oBAAoB,CACrB,CAAC;QAEF,SAAS,CAAC,qBAAqB,CAC7B,4CAA4C,EAC5C,4BAA4B,CAC7B,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,qBAAqB,CAC7B,4BAA4B,EAC5B,6BAA6B,CAC9B,CAAC;IAEF,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAElD,OAAO;QACL,kBAAkB;QAClB,4BAA4B;QAC5B,uBAAuB;QACvB,eAAe;QACf,oBAAoB;QACpB,eAAe;QACf,gCAAgC;QAChC,oCAAoC;QACpC,kCAAkC;QAClC,sBAAsB;QACtB,kCAAkC;QAClC,4BAA4B;QAC5B,4BAA4B;QAC5B,mBAAmB;QACnB,6BAA6B;QAC7B,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 {\n BridgeStatusControllerGetStateAction,\n BridgeStatusControllerSubmitTxAction,\n} from '@metamask/bridge-status-controller';\nimport type { KeyringControllerGetStateAction } from '@metamask/keyring-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 {\n TransactionPayControllerGetDelegationTransactionAction,\n TransactionPayControllerGetStrategyAction,\n} from '../TransactionPayController-method-action-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 getAssetsControllerStateMock = jest.fn();\n\n const getKeyringControllerStateMock: jest.MockedFn<\n KeyringControllerGetStateAction['handler']\n > = jest.fn().mockReturnValue({\n isUnlocked: true,\n keyrings: [\n {\n type: 'HD Key Tree',\n accounts: ['0x1234567890123456789012345678901234567891'],\n metadata: { id: 'hd-keyring', name: 'HD Key Tree' },\n },\n ],\n });\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 messenger.registerActionHandler(\n 'AssetsController:getStateForTransactionPay',\n getAssetsControllerStateMock,\n );\n }\n\n messenger.registerActionHandler(\n 'KeyringController:getState',\n getKeyringControllerStateMock,\n );\n\n const publish = messenger.publish.bind(messenger);\n\n return {\n addTransactionMock,\n getAssetsControllerStateMock,\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 getKeyringControllerStateMock,\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"]}
|
package/dist/types.cjs
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KEYRING_TYPES_SUPPORTING_7702 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Keyring types that support EIP-7702 authorization signing.
|
|
6
|
+
* Hardware wallets, snap keyrings, and money keyrings do not support 7702.
|
|
7
|
+
*/
|
|
8
|
+
exports.KEYRING_TYPES_SUPPORTING_7702 = [
|
|
9
|
+
'HD Key Tree',
|
|
10
|
+
'Simple Key Pair',
|
|
11
|
+
];
|
|
3
12
|
//# sourceMappingURL=types.cjs.map
|
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AssetsControllerGetStateForTransactionPayAction } from '@metamask/assets-controller';\nimport type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} 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 { KeyringControllerSignTypedMessageAction } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RampsControllerGetQuotesAction } from '@metamask/ramps-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';\nimport type { TransactionPayControllerMethodActions } from './TransactionPayController-method-action-types';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | AssetsControllerGetStateForTransactionPayAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | KeyringControllerSignTypedMessageAction\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RampsControllerGetQuotesAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\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\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\n /**\n * Whether the source of funds is HyperLiquid (HyperCore).\n * When true, the Relay strategy uses the HyperLiquid 2-step withdrawal\n * flow: (1) authorize nonce-mapping, (2) sendAsset to Relay solver.\n */\n isHyperliquidSource?: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request. Use this for post-quote flows where the user's funds originate\n * from a smart contract account (e.g. Predict Safe proxy) so that refunds\n * go back to that account rather than the EOA.\n */\n refundTo?: Hex;\n};\n\n/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\n/** Callback to update fiat payment state. */\nexport type TransactionFiatPaymentCallback = (\n fiatPayment: TransactionFiatPayment,\n) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerMethodActions;\n\nexport type TransactionPayControllerEvents =\n TransactionPayControllerStateChangeEvent;\n\nexport type TransactionPayControllerMessenger = Messenger<\n typeof CONTROLLER_NAME,\n TransactionPayControllerActions | AllowedActions,\n TransactionPayControllerEvents | AllowedEvents\n>;\n\n/** Options for the TransactionPayController. */\nexport type TransactionPayControllerOptions = {\n /** 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 /** Callback to select ordered PayStrategies for a transaction. */\n getStrategies?: (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 /** Fiat payment method state. */\n fiatPayment?: TransactionFiatPayment;\n\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n * Used when funds need to be moved after a transaction completes\n * (e.g., bridging output to a different token/chain).\n */\n isPostQuote?: boolean;\n\n /** Whether the source of funds is HyperLiquid (HyperCore). */\n isHyperliquidSource?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /**\n * Token selected for the transaction.\n * - For standard flows (isPostQuote=false): This is the SOURCE/payment token\n * - For post-quote flows (isPostQuote=true): This is the DESTINATION token\n */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\n\n /** Timestamp of when quotes were last updated. */\n quotesLastUpdated?: number;\n\n /** Amounts of payment token required for each required token. */\n sourceAmounts?: TransactionPaySourceAmount[];\n\n /** Tokens required by the transaction. */\n tokens: TransactionPayRequiredToken[];\n\n /** Calculated totals for the transaction. */\n totals?: TransactionPayTotals;\n};\n\n/** Fiat payment state stored per transaction. */\nexport type TransactionFiatPayment = {\n /** Entered fiat amount for the selected payment method. */\n amountFiat?: string;\n\n /** Selected fiat payment method ID. */\n selectedPaymentMethodId?: string;\n};\n\n/** A token required by a transaction. */\nexport type TransactionPayRequiredToken = {\n /** Address of the required token. */\n address: Hex;\n\n /** Whether to allow quotes that return less than the minimum amount requested. */\n allowUnderMinimum: boolean;\n\n /** Amount required in the selected currency. */\n amountFiat: string;\n\n /** Amount required in a human-readable format factoring token decimals. */\n amountHuman: string;\n\n /** Amount required in atomic format without factoring token decimals. */\n amountRaw: string;\n\n /** Amount required in USD. */\n amountUsd: string;\n\n /** Balance of the required token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the required token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the required token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the required token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the required token. */\n chainId: Hex;\n\n /** Decimals of the required token. */\n decimals: number;\n\n /** Whether to skip transfer of this token if balance is already sufficient. */\n skipIfBalance: boolean;\n\n /** Symbol of the required token. */\n symbol: string;\n};\n\n/** Amount of payment token required by a required token. */\nexport type TransactionPaySourceAmount = {\n /** Amount of payment token required in the selected currency. */\n sourceAmountHuman: string;\n\n /** Amount of payment token required in atomic format without factoring token decimals. */\n sourceAmountRaw: string;\n\n /** Balance of the source token in atomic format (for post-quote flows). */\n sourceBalanceRaw?: string;\n\n /** Chain ID of the source token (for post-quote flows). */\n sourceChainId?: Hex;\n\n /** Address of the source token (for post-quote flows). */\n sourceTokenAddress?: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** 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 /** Whether the transaction is a maximum amount transaction. */\n isMaxAmount?: boolean;\n\n /** Whether this is a post-quote flow. */\n isPostQuote?: boolean;\n\n /** Whether the source of funds is HyperLiquid (HyperCore). */\n isHyperliquidSource?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: 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 MetaMask. */\n metaMask: FiatValue;\n\n /** Fee charged by the quote provider. */\n provider: FiatValue;\n\n /** Fee charged by fiat on-ramp provider (breakdown of the provider total). */\n providerFiat?: FiatValue;\n\n /** Network fee for transactions on the source network. */\n sourceNetwork: {\n estimate: Amount;\n max: Amount;\n };\n\n /** Network fee for transactions on the target network. */\n targetNetwork: FiatValue;\n};\n\n/** Quote returned to retrieve a required token using the payment token. */\nexport type TransactionPayQuote<OriginalQuote> = {\n /** Additional amount provided by the quote beyond the minimum requested. */\n dust: FiatValue;\n\n /** Duration estimated for the transaction to complete in seconds. */\n estimatedDuration: number;\n\n /** Fees associated with the transaction pay quote. */\n fees: TransactionPayFees;\n\n /** 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 /** Amount of target token provided. */\n targetAmount: FiatValue;\n};\n\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Selected fiat payment method ID, if applicable. */\n fiatPaymentMethod?: string;\n\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 /**\n * Check if the strategy supports the given request.\n * Defaults to true if not implemented.\n */\n supports?: (request: PayStrategyGetQuotesRequest) => boolean;\n\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 /** Total amount of target token provided. */\n targetAmount: FiatValue;\n\n /** Overall total cost for the target transaction and all quotes. */\n total: FiatValue;\n};\n\n/** Request to update the payment token for a transaction. */\nexport type UpdatePaymentTokenRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Address of the new payment token. */\n tokenAddress: Hex;\n\n /** Chain ID of the new payment token. */\n chainId: Hex;\n};\n\n/** Request to update fiat payment state for a transaction. */\nexport type UpdateFiatPaymentRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Callback to mutate fiat payment state. */\n callback: TransactionFiatPaymentCallback;\n};\n\n/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\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":";;;AA+IA;;;GAGG;AACU,QAAA,6BAA6B,GAAwB;IAChE,aAAa;IACb,iBAAiB;CAClB,CAAC","sourcesContent":["import type { AssetsControllerGetStateForTransactionPayAction } from '@metamask/assets-controller';\nimport type {\n CurrencyRateControllerActions,\n TokenBalancesControllerGetStateAction,\n} 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 {\n KeyringControllerGetStateAction,\n KeyringControllerSignTypedMessageAction,\n KeyringTypes,\n} from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { NetworkControllerFindNetworkClientIdByChainIdAction } from '@metamask/network-controller';\nimport type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller';\nimport type { RampsControllerGetQuotesAction } from '@metamask/ramps-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';\nimport type { TransactionPayControllerMethodActions } from './TransactionPayController-method-action-types';\n\nexport type AllowedActions =\n | AccountTrackerControllerGetStateAction\n | AssetsControllerGetStateForTransactionPayAction\n | BridgeControllerActions\n | BridgeStatusControllerActions\n | CurrencyRateControllerActions\n | GasFeeControllerActions\n | KeyringControllerGetStateAction\n | KeyringControllerSignTypedMessageAction\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetNetworkClientByIdAction\n | RampsControllerGetQuotesAction\n | RemoteFeatureFlagControllerGetStateAction\n | TokenBalancesControllerGetStateAction\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\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\n /**\n * Whether the source of funds is HyperLiquid (HyperCore).\n * When true, the Relay strategy uses the HyperLiquid 2-step withdrawal\n * flow: (1) authorize nonce-mapping, (2) sendAsset to Relay solver.\n */\n isHyperliquidSource?: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n */\n isPostQuote?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request. Use this for post-quote flows where the user's funds originate\n * from a smart contract account (e.g. Predict Safe proxy) so that refunds\n * go back to that account rather than the EOA.\n */\n refundTo?: Hex;\n\n /**\n * Optional address to override the default account used by the transaction.\n * When `isPostQuote` is true, used as the recipient of the MM Pay transfer.\n * When `isPostQuote` is false, it provides the funds and pays for gas.\n */\n accountOverride?: Hex;\n};\n\n/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\n/** Callback to update fiat payment state. */\nexport type TransactionFiatPaymentCallback = (\n fiatPayment: TransactionFiatPayment,\n) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerMethodActions;\n\nexport type TransactionPayControllerEvents =\n TransactionPayControllerStateChangeEvent;\n\nexport type TransactionPayControllerMessenger = Messenger<\n typeof CONTROLLER_NAME,\n TransactionPayControllerActions | AllowedActions,\n TransactionPayControllerEvents | AllowedEvents\n>;\n\n/**\n * Keyring types that support EIP-7702 authorization signing.\n * Hardware wallets, snap keyrings, and money keyrings do not support 7702.\n */\nexport const KEYRING_TYPES_SUPPORTING_7702: `${KeyringTypes}`[] = [\n 'HD Key Tree',\n 'Simple Key Pair',\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 /** Callback to select ordered PayStrategies for a transaction. */\n getStrategies?: (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 /** Fiat payment method state. */\n fiatPayment?: TransactionFiatPayment;\n\n /** Whether quotes are currently being retrieved. */\n isLoading: boolean;\n\n /** Whether the user has selected the maximum amount. */\n isMaxAmount?: boolean;\n\n /**\n * Whether this is a post-quote transaction.\n * When true, the paymentToken represents the destination token,\n * and the quote source is derived from the transaction's output token.\n * Used when funds need to be moved after a transaction completes\n * (e.g., bridging output to a different token/chain).\n */\n isPostQuote?: boolean;\n\n /** Whether the source of funds is HyperLiquid (HyperCore). */\n isHyperliquidSource?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: Hex;\n\n /**\n * Optional address to override the default account used by the transaction.\n * When `isPostQuote` is true, used as the recipient of the MM Pay transfer.\n * When `isPostQuote` is false, it provides the funds and pays for gas.\n */\n accountOverride?: Hex;\n\n /**\n * Token selected for the transaction.\n * - For standard flows (isPostQuote=false): This is the SOURCE/payment token\n * - For post-quote flows (isPostQuote=true): This is the DESTINATION token\n */\n paymentToken?: TransactionPaymentToken;\n\n /** Quotes retrieved for the transaction. */\n quotes?: TransactionPayQuote<Json>[];\n\n /** Timestamp of when quotes were last updated. */\n quotesLastUpdated?: number;\n\n /** Amounts of payment token required for each required token. */\n sourceAmounts?: TransactionPaySourceAmount[];\n\n /** Tokens required by the transaction. */\n tokens: TransactionPayRequiredToken[];\n\n /** Calculated totals for the transaction. */\n totals?: TransactionPayTotals;\n};\n\n/** Fiat payment state stored per transaction. */\nexport type TransactionFiatPayment = {\n /** Entered fiat amount for the selected payment method. */\n amountFiat?: string;\n\n /** Selected fiat payment method ID. */\n selectedPaymentMethodId?: string;\n};\n\n/** A token required by a transaction. */\nexport type TransactionPayRequiredToken = {\n /** Address of the required token. */\n address: Hex;\n\n /** Whether to allow quotes that return less than the minimum amount requested. */\n allowUnderMinimum: boolean;\n\n /** Amount required in the selected currency. */\n amountFiat: string;\n\n /** Amount required in a human-readable format factoring token decimals. */\n amountHuman: string;\n\n /** Amount required in atomic format without factoring token decimals. */\n amountRaw: string;\n\n /** Amount required in USD. */\n amountUsd: string;\n\n /** Balance of the required token in the selected currency. */\n balanceFiat: string;\n\n /** Balance of the required token in a human-readable format factoring token decimals. */\n balanceHuman: string;\n\n /** Balance of the required token in atomic format without factoring token decimals. */\n balanceRaw: string;\n\n /** Balance of the required token in USD. */\n balanceUsd: string;\n\n /** Chain ID of the required token. */\n chainId: Hex;\n\n /** Decimals of the required token. */\n decimals: number;\n\n /** Whether to skip transfer of this token if balance is already sufficient. */\n skipIfBalance: boolean;\n\n /** Symbol of the required token. */\n symbol: string;\n};\n\n/** Amount of payment token required by a required token. */\nexport type TransactionPaySourceAmount = {\n /** Amount of payment token required in the selected currency. */\n sourceAmountHuman: string;\n\n /** Amount of payment token required in atomic format without factoring token decimals. */\n sourceAmountRaw: string;\n\n /** Balance of the source token in atomic format (for post-quote flows). */\n sourceBalanceRaw?: string;\n\n /** Chain ID of the source token (for post-quote flows). */\n sourceChainId?: Hex;\n\n /** Address of the source token (for post-quote flows). */\n sourceTokenAddress?: Hex;\n\n /** Address of the target token. */\n targetTokenAddress: Hex;\n};\n\n/** 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 /** Whether the transaction is a maximum amount transaction. */\n isMaxAmount?: boolean;\n\n /** Whether this is a post-quote flow. */\n isPostQuote?: boolean;\n\n /** Whether the source of funds is HyperLiquid (HyperCore). */\n isHyperliquidSource?: boolean;\n\n /**\n * Optional address to receive refunds if the Relay transaction fails.\n * When set, overrides the default refund recipient (EOA) in the Relay quote\n * request.\n */\n refundTo?: 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 MetaMask. */\n metaMask: FiatValue;\n\n /** Fee charged by the quote provider. */\n provider: FiatValue;\n\n /** Fee charged by fiat on-ramp provider (breakdown of the provider total). */\n providerFiat?: FiatValue;\n\n /** Network fee for transactions on the source network. */\n sourceNetwork: {\n estimate: Amount;\n max: Amount;\n };\n\n /** Network fee for transactions on the target network. */\n targetNetwork: FiatValue;\n};\n\n/** Quote returned to retrieve a required token using the payment token. */\nexport type TransactionPayQuote<OriginalQuote> = {\n /** Additional amount provided by the quote beyond the minimum requested. */\n dust: FiatValue;\n\n /** Duration estimated for the transaction to complete in seconds. */\n estimatedDuration: number;\n\n /** Fees associated with the transaction pay quote. */\n fees: TransactionPayFees;\n\n /** 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 /** Amount of target token provided. */\n targetAmount: FiatValue;\n};\n\n/** Request to get quotes for a transaction. */\nexport type PayStrategyGetQuotesRequest = {\n /** Whether the account supports EIP-7702 authorization signing. */\n accountSupports7702: boolean;\n\n /** Selected fiat payment method ID, if applicable. */\n fiatPaymentMethod?: string;\n\n /** 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 /** Whether the account supports EIP-7702 authorization signing. */\n accountSupports7702: boolean;\n\n /** Callback to determine if the transaction is a smart transaction. */\n isSmartTransaction: (chainId: Hex) => boolean;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes to be submitted. */\n quotes: TransactionPayQuote<OriginalRequest>[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get batch transactions for quotes. */\nexport type PayStrategyGetBatchRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes for required tokens. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n};\n\n/** Request to check whether retrieved quotes can be executed by a strategy. */\nexport type PayStrategyCheckQuoteSupportRequest<OriginalQuote> = {\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n\n /** Quotes returned by the strategy. */\n quotes: TransactionPayQuote<OriginalQuote>[];\n\n /** Metadata of the original target transaction. */\n transaction: TransactionMeta;\n};\n\n/** Request to get refresh interval for a specific strategy. */\nexport type PayStrategyGetRefreshIntervalRequest = {\n /** Chain ID of the source or payment token. */\n chainId: Hex;\n\n /** Controller messenger. */\n messenger: TransactionPayControllerMessenger;\n};\n\n/** Strategy used to obtain required tokens for a transaction. */\nexport type PayStrategy<OriginalQuote> = {\n /**\n * Check if the strategy supports the given request.\n * Defaults to true if not implemented.\n */\n supports?: (\n request: PayStrategyGetQuotesRequest,\n ) => boolean | Promise<boolean>;\n\n /** Retrieve quotes for required tokens. */\n getQuotes: (\n request: PayStrategyGetQuotesRequest,\n ) => Promise<TransactionPayQuote<OriginalQuote>[]>;\n\n /**\n * Check if the returned quotes are supported after provider quote\n * construction and gas planning.\n *\n * Use this for limitations that are only knowable once quote metadata is\n * available, such as whether execution will require an EIP-7702\n * authorization list.\n */\n checkQuoteSupport?: (\n request: PayStrategyCheckQuoteSupportRequest<OriginalQuote>,\n ) => boolean | Promise<boolean>;\n\n /** Retrieve batch transactions for quotes, if supported by the strategy. */\n getBatchTransactions?: (\n request: PayStrategyGetBatchRequest<OriginalQuote>,\n ) => Promise<BatchTransaction[]>;\n\n /**\n * Retrieve refresh interval for the strategy, if applicable.\n * Defaults to 30 seconds.\n */\n getRefreshInterval?: (\n request: PayStrategyGetRefreshIntervalRequest,\n ) => Promise<number | undefined>;\n\n /** Execute or submit the quotes to obtain required tokens. */\n execute: (request: PayStrategyExecuteRequest<OriginalQuote>) => Promise<{\n transactionHash?: Hex;\n }>;\n};\n\n/** Single fiat value in alternate currencies. */\nexport type FiatValue = {\n /** Value in the selected fiat currency. */\n fiat: string;\n\n /** Value in USD. */\n usd: string;\n};\n\n/** Calculated totals for a target transaction and all quotes. */\nexport type TransactionPayTotals = {\n /** Total estimated duration for the target transaction and all quotes. */\n estimatedDuration: number;\n\n /** Total fees for the target transaction and all quotes. */\n fees: TransactionPayFees;\n\n /** Total amount of source token required. */\n sourceAmount: Amount;\n\n /** Total amount of target token provided. */\n targetAmount: FiatValue;\n\n /** Overall total cost for the target transaction and all quotes. */\n total: FiatValue;\n};\n\n/** Request to update the payment token for a transaction. */\nexport type UpdatePaymentTokenRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Address of the new payment token. */\n tokenAddress: Hex;\n\n /** Chain ID of the new payment token. */\n chainId: Hex;\n};\n\n/** Request to update fiat payment state for a transaction. */\nexport type UpdateFiatPaymentRequest = {\n /** ID of the transaction to update. */\n transactionId: string;\n\n /** Callback to mutate fiat payment state. */\n callback: TransactionFiatPaymentCallback;\n};\n\n/** Callback to convert a transaction to a redeem delegation. */\nexport type GetDelegationTransactionCallback = ({\n transaction,\n}: {\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
|
@@ -9,7 +9,7 @@ import type { BridgeControllerActions } from "@metamask/bridge-controller";
|
|
|
9
9
|
import type { BridgeStatusControllerStateChangeEvent } from "@metamask/bridge-status-controller";
|
|
10
10
|
import type { BridgeStatusControllerActions } from "@metamask/bridge-status-controller";
|
|
11
11
|
import type { GasFeeControllerActions } from "@metamask/gas-fee-controller";
|
|
12
|
-
import type { KeyringControllerSignTypedMessageAction } from "@metamask/keyring-controller";
|
|
12
|
+
import type { KeyringControllerGetStateAction, KeyringControllerSignTypedMessageAction, KeyringTypes } from "@metamask/keyring-controller";
|
|
13
13
|
import type { Messenger } from "@metamask/messenger";
|
|
14
14
|
import type { NetworkControllerFindNetworkClientIdByChainIdAction } from "@metamask/network-controller";
|
|
15
15
|
import type { NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
|
|
@@ -21,7 +21,7 @@ import type { Hex, Json } from "@metamask/utils";
|
|
|
21
21
|
import type { Draft } from "immer";
|
|
22
22
|
import type { CONTROLLER_NAME, TransactionPayStrategy } from "./constants.cjs";
|
|
23
23
|
import type { TransactionPayControllerMethodActions } from "./TransactionPayController-method-action-types.cjs";
|
|
24
|
-
export type AllowedActions = AccountTrackerControllerGetStateAction | AssetsControllerGetStateForTransactionPayAction | BridgeControllerActions | BridgeStatusControllerActions | CurrencyRateControllerActions | GasFeeControllerActions | KeyringControllerSignTypedMessageAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | RampsControllerGetQuotesAction | RemoteFeatureFlagControllerGetStateAction | TokenBalancesControllerGetStateAction | TokenRatesControllerGetStateAction | TokensControllerGetStateAction | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
|
|
24
|
+
export type AllowedActions = AccountTrackerControllerGetStateAction | AssetsControllerGetStateForTransactionPayAction | BridgeControllerActions | BridgeStatusControllerActions | CurrencyRateControllerActions | GasFeeControllerActions | KeyringControllerGetStateAction | KeyringControllerSignTypedMessageAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | RampsControllerGetQuotesAction | RemoteFeatureFlagControllerGetStateAction | TokenBalancesControllerGetStateAction | TokenRatesControllerGetStateAction | TokensControllerGetStateAction | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
|
|
25
25
|
export type AllowedEvents = BridgeStatusControllerStateChangeEvent | TransactionControllerStateChangeEvent | TransactionControllerUnapprovedTransactionAddedEvent;
|
|
26
26
|
export type TransactionPayControllerGetStateAction = ControllerGetStateAction<typeof CONTROLLER_NAME, TransactionPayControllerState>;
|
|
27
27
|
/** Configurable properties of a transaction. */
|
|
@@ -48,6 +48,12 @@ export type TransactionConfig = {
|
|
|
48
48
|
* go back to that account rather than the EOA.
|
|
49
49
|
*/
|
|
50
50
|
refundTo?: Hex;
|
|
51
|
+
/**
|
|
52
|
+
* Optional address to override the default account used by the transaction.
|
|
53
|
+
* When `isPostQuote` is true, used as the recipient of the MM Pay transfer.
|
|
54
|
+
* When `isPostQuote` is false, it provides the funds and pays for gas.
|
|
55
|
+
*/
|
|
56
|
+
accountOverride?: Hex;
|
|
51
57
|
};
|
|
52
58
|
/** Callback to update transaction config. */
|
|
53
59
|
export type TransactionConfigCallback = (config: TransactionConfig) => void;
|
|
@@ -57,6 +63,11 @@ export type TransactionPayControllerStateChangeEvent = ControllerStateChangeEven
|
|
|
57
63
|
export type TransactionPayControllerActions = TransactionPayControllerGetStateAction | TransactionPayControllerMethodActions;
|
|
58
64
|
export type TransactionPayControllerEvents = TransactionPayControllerStateChangeEvent;
|
|
59
65
|
export type TransactionPayControllerMessenger = Messenger<typeof CONTROLLER_NAME, TransactionPayControllerActions | AllowedActions, TransactionPayControllerEvents | AllowedEvents>;
|
|
66
|
+
/**
|
|
67
|
+
* Keyring types that support EIP-7702 authorization signing.
|
|
68
|
+
* Hardware wallets, snap keyrings, and money keyrings do not support 7702.
|
|
69
|
+
*/
|
|
70
|
+
export declare const KEYRING_TYPES_SUPPORTING_7702: `${KeyringTypes}`[];
|
|
60
71
|
/** Options for the TransactionPayController. */
|
|
61
72
|
export type TransactionPayControllerOptions = {
|
|
62
73
|
/** Callback to convert a transaction into a redeem delegation. */
|
|
@@ -99,6 +110,12 @@ export type TransactionData = {
|
|
|
99
110
|
* request.
|
|
100
111
|
*/
|
|
101
112
|
refundTo?: Hex;
|
|
113
|
+
/**
|
|
114
|
+
* Optional address to override the default account used by the transaction.
|
|
115
|
+
* When `isPostQuote` is true, used as the recipient of the MM Pay transfer.
|
|
116
|
+
* When `isPostQuote` is false, it provides the funds and pays for gas.
|
|
117
|
+
*/
|
|
118
|
+
accountOverride?: Hex;
|
|
102
119
|
/**
|
|
103
120
|
* Token selected for the transaction.
|
|
104
121
|
* - For standard flows (isPostQuote=false): This is the SOURCE/payment token
|
|
@@ -273,6 +290,8 @@ export type TransactionPayQuote<OriginalQuote> = {
|
|
|
273
290
|
};
|
|
274
291
|
/** Request to get quotes for a transaction. */
|
|
275
292
|
export type PayStrategyGetQuotesRequest = {
|
|
293
|
+
/** Whether the account supports EIP-7702 authorization signing. */
|
|
294
|
+
accountSupports7702: boolean;
|
|
276
295
|
/** Selected fiat payment method ID, if applicable. */
|
|
277
296
|
fiatPaymentMethod?: string;
|
|
278
297
|
/** Controller messenger. */
|
|
@@ -284,6 +303,8 @@ export type PayStrategyGetQuotesRequest = {
|
|
|
284
303
|
};
|
|
285
304
|
/** Request to submit quotes for a transaction. */
|
|
286
305
|
export type PayStrategyExecuteRequest<OriginalRequest> = {
|
|
306
|
+
/** Whether the account supports EIP-7702 authorization signing. */
|
|
307
|
+
accountSupports7702: boolean;
|
|
287
308
|
/** Callback to determine if the transaction is a smart transaction. */
|
|
288
309
|
isSmartTransaction: (chainId: Hex) => boolean;
|
|
289
310
|
/** Controller messenger. */
|
|
@@ -300,6 +321,15 @@ export type PayStrategyGetBatchRequest<OriginalQuote> = {
|
|
|
300
321
|
/** Quotes for required tokens. */
|
|
301
322
|
quotes: TransactionPayQuote<OriginalQuote>[];
|
|
302
323
|
};
|
|
324
|
+
/** Request to check whether retrieved quotes can be executed by a strategy. */
|
|
325
|
+
export type PayStrategyCheckQuoteSupportRequest<OriginalQuote> = {
|
|
326
|
+
/** Controller messenger. */
|
|
327
|
+
messenger: TransactionPayControllerMessenger;
|
|
328
|
+
/** Quotes returned by the strategy. */
|
|
329
|
+
quotes: TransactionPayQuote<OriginalQuote>[];
|
|
330
|
+
/** Metadata of the original target transaction. */
|
|
331
|
+
transaction: TransactionMeta;
|
|
332
|
+
};
|
|
303
333
|
/** Request to get refresh interval for a specific strategy. */
|
|
304
334
|
export type PayStrategyGetRefreshIntervalRequest = {
|
|
305
335
|
/** Chain ID of the source or payment token. */
|
|
@@ -313,9 +343,18 @@ export type PayStrategy<OriginalQuote> = {
|
|
|
313
343
|
* Check if the strategy supports the given request.
|
|
314
344
|
* Defaults to true if not implemented.
|
|
315
345
|
*/
|
|
316
|
-
supports?: (request: PayStrategyGetQuotesRequest) => boolean
|
|
346
|
+
supports?: (request: PayStrategyGetQuotesRequest) => boolean | Promise<boolean>;
|
|
317
347
|
/** Retrieve quotes for required tokens. */
|
|
318
348
|
getQuotes: (request: PayStrategyGetQuotesRequest) => Promise<TransactionPayQuote<OriginalQuote>[]>;
|
|
349
|
+
/**
|
|
350
|
+
* Check if the returned quotes are supported after provider quote
|
|
351
|
+
* construction and gas planning.
|
|
352
|
+
*
|
|
353
|
+
* Use this for limitations that are only knowable once quote metadata is
|
|
354
|
+
* available, such as whether execution will require an EIP-7702
|
|
355
|
+
* authorization list.
|
|
356
|
+
*/
|
|
357
|
+
checkQuoteSupport?: (request: PayStrategyCheckQuoteSupportRequest<OriginalQuote>) => boolean | Promise<boolean>;
|
|
319
358
|
/** Retrieve batch transactions for quotes, if supported by the strategy. */
|
|
320
359
|
getBatchTransactions?: (request: PayStrategyGetBatchRequest<OriginalQuote>) => Promise<BatchTransaction[]>;
|
|
321
360
|
/**
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+CAA+C,EAAE,oCAAoC;AACnG,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,qCAAqC;AACtC,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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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
|
@@ -9,7 +9,7 @@ import type { BridgeControllerActions } from "@metamask/bridge-controller";
|
|
|
9
9
|
import type { BridgeStatusControllerStateChangeEvent } from "@metamask/bridge-status-controller";
|
|
10
10
|
import type { BridgeStatusControllerActions } from "@metamask/bridge-status-controller";
|
|
11
11
|
import type { GasFeeControllerActions } from "@metamask/gas-fee-controller";
|
|
12
|
-
import type { KeyringControllerSignTypedMessageAction } from "@metamask/keyring-controller";
|
|
12
|
+
import type { KeyringControllerGetStateAction, KeyringControllerSignTypedMessageAction, KeyringTypes } from "@metamask/keyring-controller";
|
|
13
13
|
import type { Messenger } from "@metamask/messenger";
|
|
14
14
|
import type { NetworkControllerFindNetworkClientIdByChainIdAction } from "@metamask/network-controller";
|
|
15
15
|
import type { NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
|
|
@@ -21,7 +21,7 @@ import type { Hex, Json } from "@metamask/utils";
|
|
|
21
21
|
import type { Draft } from "immer";
|
|
22
22
|
import type { CONTROLLER_NAME, TransactionPayStrategy } from "./constants.mjs";
|
|
23
23
|
import type { TransactionPayControllerMethodActions } from "./TransactionPayController-method-action-types.mjs";
|
|
24
|
-
export type AllowedActions = AccountTrackerControllerGetStateAction | AssetsControllerGetStateForTransactionPayAction | BridgeControllerActions | BridgeStatusControllerActions | CurrencyRateControllerActions | GasFeeControllerActions | KeyringControllerSignTypedMessageAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | RampsControllerGetQuotesAction | RemoteFeatureFlagControllerGetStateAction | TokenBalancesControllerGetStateAction | TokenRatesControllerGetStateAction | TokensControllerGetStateAction | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
|
|
24
|
+
export type AllowedActions = AccountTrackerControllerGetStateAction | AssetsControllerGetStateForTransactionPayAction | BridgeControllerActions | BridgeStatusControllerActions | CurrencyRateControllerActions | GasFeeControllerActions | KeyringControllerGetStateAction | KeyringControllerSignTypedMessageAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerGetNetworkClientByIdAction | RampsControllerGetQuotesAction | RemoteFeatureFlagControllerGetStateAction | TokenBalancesControllerGetStateAction | TokenRatesControllerGetStateAction | TokensControllerGetStateAction | TransactionControllerAddTransactionAction | TransactionControllerAddTransactionBatchAction | TransactionControllerEstimateGasAction | TransactionControllerEstimateGasBatchAction | TransactionControllerGetGasFeeTokensAction | TransactionControllerGetStateAction | TransactionControllerUpdateTransactionAction;
|
|
25
25
|
export type AllowedEvents = BridgeStatusControllerStateChangeEvent | TransactionControllerStateChangeEvent | TransactionControllerUnapprovedTransactionAddedEvent;
|
|
26
26
|
export type TransactionPayControllerGetStateAction = ControllerGetStateAction<typeof CONTROLLER_NAME, TransactionPayControllerState>;
|
|
27
27
|
/** Configurable properties of a transaction. */
|
|
@@ -48,6 +48,12 @@ export type TransactionConfig = {
|
|
|
48
48
|
* go back to that account rather than the EOA.
|
|
49
49
|
*/
|
|
50
50
|
refundTo?: Hex;
|
|
51
|
+
/**
|
|
52
|
+
* Optional address to override the default account used by the transaction.
|
|
53
|
+
* When `isPostQuote` is true, used as the recipient of the MM Pay transfer.
|
|
54
|
+
* When `isPostQuote` is false, it provides the funds and pays for gas.
|
|
55
|
+
*/
|
|
56
|
+
accountOverride?: Hex;
|
|
51
57
|
};
|
|
52
58
|
/** Callback to update transaction config. */
|
|
53
59
|
export type TransactionConfigCallback = (config: TransactionConfig) => void;
|
|
@@ -57,6 +63,11 @@ export type TransactionPayControllerStateChangeEvent = ControllerStateChangeEven
|
|
|
57
63
|
export type TransactionPayControllerActions = TransactionPayControllerGetStateAction | TransactionPayControllerMethodActions;
|
|
58
64
|
export type TransactionPayControllerEvents = TransactionPayControllerStateChangeEvent;
|
|
59
65
|
export type TransactionPayControllerMessenger = Messenger<typeof CONTROLLER_NAME, TransactionPayControllerActions | AllowedActions, TransactionPayControllerEvents | AllowedEvents>;
|
|
66
|
+
/**
|
|
67
|
+
* Keyring types that support EIP-7702 authorization signing.
|
|
68
|
+
* Hardware wallets, snap keyrings, and money keyrings do not support 7702.
|
|
69
|
+
*/
|
|
70
|
+
export declare const KEYRING_TYPES_SUPPORTING_7702: `${KeyringTypes}`[];
|
|
60
71
|
/** Options for the TransactionPayController. */
|
|
61
72
|
export type TransactionPayControllerOptions = {
|
|
62
73
|
/** Callback to convert a transaction into a redeem delegation. */
|
|
@@ -99,6 +110,12 @@ export type TransactionData = {
|
|
|
99
110
|
* request.
|
|
100
111
|
*/
|
|
101
112
|
refundTo?: Hex;
|
|
113
|
+
/**
|
|
114
|
+
* Optional address to override the default account used by the transaction.
|
|
115
|
+
* When `isPostQuote` is true, used as the recipient of the MM Pay transfer.
|
|
116
|
+
* When `isPostQuote` is false, it provides the funds and pays for gas.
|
|
117
|
+
*/
|
|
118
|
+
accountOverride?: Hex;
|
|
102
119
|
/**
|
|
103
120
|
* Token selected for the transaction.
|
|
104
121
|
* - For standard flows (isPostQuote=false): This is the SOURCE/payment token
|
|
@@ -273,6 +290,8 @@ export type TransactionPayQuote<OriginalQuote> = {
|
|
|
273
290
|
};
|
|
274
291
|
/** Request to get quotes for a transaction. */
|
|
275
292
|
export type PayStrategyGetQuotesRequest = {
|
|
293
|
+
/** Whether the account supports EIP-7702 authorization signing. */
|
|
294
|
+
accountSupports7702: boolean;
|
|
276
295
|
/** Selected fiat payment method ID, if applicable. */
|
|
277
296
|
fiatPaymentMethod?: string;
|
|
278
297
|
/** Controller messenger. */
|
|
@@ -284,6 +303,8 @@ export type PayStrategyGetQuotesRequest = {
|
|
|
284
303
|
};
|
|
285
304
|
/** Request to submit quotes for a transaction. */
|
|
286
305
|
export type PayStrategyExecuteRequest<OriginalRequest> = {
|
|
306
|
+
/** Whether the account supports EIP-7702 authorization signing. */
|
|
307
|
+
accountSupports7702: boolean;
|
|
287
308
|
/** Callback to determine if the transaction is a smart transaction. */
|
|
288
309
|
isSmartTransaction: (chainId: Hex) => boolean;
|
|
289
310
|
/** Controller messenger. */
|
|
@@ -300,6 +321,15 @@ export type PayStrategyGetBatchRequest<OriginalQuote> = {
|
|
|
300
321
|
/** Quotes for required tokens. */
|
|
301
322
|
quotes: TransactionPayQuote<OriginalQuote>[];
|
|
302
323
|
};
|
|
324
|
+
/** Request to check whether retrieved quotes can be executed by a strategy. */
|
|
325
|
+
export type PayStrategyCheckQuoteSupportRequest<OriginalQuote> = {
|
|
326
|
+
/** Controller messenger. */
|
|
327
|
+
messenger: TransactionPayControllerMessenger;
|
|
328
|
+
/** Quotes returned by the strategy. */
|
|
329
|
+
quotes: TransactionPayQuote<OriginalQuote>[];
|
|
330
|
+
/** Metadata of the original target transaction. */
|
|
331
|
+
transaction: TransactionMeta;
|
|
332
|
+
};
|
|
303
333
|
/** Request to get refresh interval for a specific strategy. */
|
|
304
334
|
export type PayStrategyGetRefreshIntervalRequest = {
|
|
305
335
|
/** Chain ID of the source or payment token. */
|
|
@@ -313,9 +343,18 @@ export type PayStrategy<OriginalQuote> = {
|
|
|
313
343
|
* Check if the strategy supports the given request.
|
|
314
344
|
* Defaults to true if not implemented.
|
|
315
345
|
*/
|
|
316
|
-
supports?: (request: PayStrategyGetQuotesRequest) => boolean
|
|
346
|
+
supports?: (request: PayStrategyGetQuotesRequest) => boolean | Promise<boolean>;
|
|
317
347
|
/** Retrieve quotes for required tokens. */
|
|
318
348
|
getQuotes: (request: PayStrategyGetQuotesRequest) => Promise<TransactionPayQuote<OriginalQuote>[]>;
|
|
349
|
+
/**
|
|
350
|
+
* Check if the returned quotes are supported after provider quote
|
|
351
|
+
* construction and gas planning.
|
|
352
|
+
*
|
|
353
|
+
* Use this for limitations that are only knowable once quote metadata is
|
|
354
|
+
* available, such as whether execution will require an EIP-7702
|
|
355
|
+
* authorization list.
|
|
356
|
+
*/
|
|
357
|
+
checkQuoteSupport?: (request: PayStrategyCheckQuoteSupportRequest<OriginalQuote>) => boolean | Promise<boolean>;
|
|
319
358
|
/** Retrieve batch transactions for quotes, if supported by the strategy. */
|
|
320
359
|
getBatchTransactions?: (request: PayStrategyGetBatchRequest<OriginalQuote>) => Promise<BatchTransaction[]>;
|
|
321
360
|
/**
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+CAA+C,EAAE,oCAAoC;AACnG,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,qCAAqC;AACtC,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,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+CAA+C,EAAE,oCAAoC;AACnG,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,qCAAqC;AACtC,OAAO,KAAK,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kBAAkB,CAAC;IAEzB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IAErB,6CAA6C;IAC7C,YAAY,EAAE,SAAS,CAAC;IAExB,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,8DAA8D;AAC9D,MAAM,MAAM,wBAAwB,GAAG;IACrC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IAEtB,6CAA6C;IAC7C,QAAQ,EAAE,8BAA8B,CAAC;CAC1C,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.mjs
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Keyring types that support EIP-7702 authorization signing.
|
|
3
|
+
* Hardware wallets, snap keyrings, and money keyrings do not support 7702.
|
|
4
|
+
*/
|
|
5
|
+
export const KEYRING_TYPES_SUPPORTING_7702 = [
|
|
6
|
+
'HD Key Tree',
|
|
7
|
+
'Simple Key Pair',
|
|
8
|
+
];
|
|
2
9
|
//# sourceMappingURL=types.mjs.map
|