@metamask/transaction-pay-controller 16.0.0 → 16.1.1
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 +27 -1
- package/dist/TransactionPayController.cjs +16 -5
- package/dist/TransactionPayController.cjs.map +1 -1
- package/dist/TransactionPayController.d.cts +1 -1
- package/dist/TransactionPayController.d.cts.map +1 -1
- package/dist/TransactionPayController.d.mts +1 -1
- package/dist/TransactionPayController.d.mts.map +1 -1
- package/dist/TransactionPayController.mjs +17 -6
- package/dist/TransactionPayController.mjs.map +1 -1
- package/dist/constants.cjs +12 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +7 -0
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +7 -0
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +10 -0
- package/dist/constants.mjs.map +1 -1
- package/dist/helpers/QuoteRefresher.cjs +7 -4
- package/dist/helpers/QuoteRefresher.cjs.map +1 -1
- package/dist/helpers/QuoteRefresher.d.cts +4 -1
- package/dist/helpers/QuoteRefresher.d.cts.map +1 -1
- package/dist/helpers/QuoteRefresher.d.mts +4 -1
- package/dist/helpers/QuoteRefresher.d.mts.map +1 -1
- package/dist/helpers/QuoteRefresher.mjs +7 -4
- package/dist/helpers/QuoteRefresher.mjs.map +1 -1
- package/dist/helpers/TransactionPayPublishHook.cjs +1 -1
- package/dist/helpers/TransactionPayPublishHook.cjs.map +1 -1
- package/dist/helpers/TransactionPayPublishHook.mjs +2 -2
- package/dist/helpers/TransactionPayPublishHook.mjs.map +1 -1
- package/dist/strategy/bridge/bridge-quotes.cjs +1 -0
- package/dist/strategy/bridge/bridge-quotes.cjs.map +1 -1
- package/dist/strategy/bridge/bridge-quotes.mjs +1 -0
- package/dist/strategy/bridge/bridge-quotes.mjs.map +1 -1
- package/dist/strategy/relay/relay-quotes.cjs +13 -8
- package/dist/strategy/relay/relay-quotes.cjs.map +1 -1
- package/dist/strategy/relay/relay-quotes.mjs +13 -8
- package/dist/strategy/relay/relay-quotes.mjs.map +1 -1
- package/dist/strategy/relay/relay-submit.cjs +1 -1
- package/dist/strategy/relay/relay-submit.cjs.map +1 -1
- package/dist/strategy/relay/relay-submit.mjs +1 -1
- package/dist/strategy/relay/relay-submit.mjs.map +1 -1
- package/dist/strategy/relay/types.cjs.map +1 -1
- package/dist/strategy/relay/types.d.cts +3 -0
- package/dist/strategy/relay/types.d.cts.map +1 -1
- package/dist/strategy/relay/types.d.mts +3 -0
- package/dist/strategy/relay/types.d.mts.map +1 -1
- package/dist/strategy/relay/types.mjs.map +1 -1
- package/dist/strategy/test/TestStrategy.cjs +1 -0
- package/dist/strategy/test/TestStrategy.cjs.map +1 -1
- package/dist/strategy/test/TestStrategy.d.cts.map +1 -1
- package/dist/strategy/test/TestStrategy.d.mts.map +1 -1
- package/dist/strategy/test/TestStrategy.mjs +1 -0
- package/dist/strategy/test/TestStrategy.mjs.map +1 -1
- package/dist/tests/messenger-mock.d.cts +2 -1
- package/dist/tests/messenger-mock.d.cts.map +1 -1
- package/dist/tests/messenger-mock.d.mts +2 -1
- package/dist/tests/messenger-mock.d.mts.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +9 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +9 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/feature-flags.cjs +26 -3
- package/dist/utils/feature-flags.cjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +11 -0
- package/dist/utils/feature-flags.d.cts.map +1 -1
- package/dist/utils/feature-flags.d.mts +11 -0
- package/dist/utils/feature-flags.d.mts.map +1 -1
- package/dist/utils/feature-flags.mjs +23 -0
- package/dist/utils/feature-flags.mjs.map +1 -1
- package/dist/utils/quotes.cjs +62 -26
- package/dist/utils/quotes.cjs.map +1 -1
- package/dist/utils/quotes.d.cts +5 -1
- package/dist/utils/quotes.d.cts.map +1 -1
- package/dist/utils/quotes.d.mts +5 -1
- package/dist/utils/quotes.d.mts.map +1 -1
- package/dist/utils/quotes.mjs +63 -27
- package/dist/utils/quotes.mjs.map +1 -1
- package/dist/utils/strategy.cjs +25 -13
- package/dist/utils/strategy.cjs.map +1 -1
- package/dist/utils/strategy.d.cts +13 -10
- package/dist/utils/strategy.d.cts.map +1 -1
- package/dist/utils/strategy.d.mts +13 -10
- package/dist/utils/strategy.d.mts.map +1 -1
- package/dist/utils/strategy.mjs +23 -11
- package/dist/utils/strategy.mjs.map +1 -1
- package/dist/utils/totals.cjs +4 -0
- package/dist/utils/totals.cjs.map +1 -1
- package/dist/utils/totals.d.cts.map +1 -1
- package/dist/utils/totals.d.mts.map +1 -1
- package/dist/utils/totals.mjs +4 -0
- package/dist/utils/totals.mjs.map +1 -1
- package/package.json +5 -6
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,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,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAAE,mDAAmD,EAAE,qCAAqC;AACxG,OAAO,KAA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E;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
|
@@ -62,6 +62,8 @@ export type TransactionPayControllerOptions = {
|
|
|
62
62
|
getDelegationTransaction: GetDelegationTransactionCallback;
|
|
63
63
|
/** Callback to select the PayStrategy for a transaction. */
|
|
64
64
|
getStrategy?: (transaction: TransactionMeta) => TransactionPayStrategy;
|
|
65
|
+
/** Callback to select ordered PayStrategies for a transaction. */
|
|
66
|
+
getStrategies?: (transaction: TransactionMeta) => TransactionPayStrategy[];
|
|
65
67
|
/** Controller messenger. */
|
|
66
68
|
messenger: TransactionPayControllerMessenger;
|
|
67
69
|
/** Initial state of the controller. */
|
|
@@ -210,6 +212,8 @@ export type TransactionPayFees = {
|
|
|
210
212
|
isSourceGasFeeToken?: boolean;
|
|
211
213
|
/** Whether a gas fee token is used to pay target network fees. */
|
|
212
214
|
isTargetGasFeeToken?: boolean;
|
|
215
|
+
/** Fee charged by MetaMask. */
|
|
216
|
+
metaMask: FiatValue;
|
|
213
217
|
/** Fee charged by the quote provider. */
|
|
214
218
|
provider: FiatValue;
|
|
215
219
|
/** Network fee for transactions on the source network. */
|
|
@@ -275,6 +279,11 @@ export type PayStrategyGetRefreshIntervalRequest = {
|
|
|
275
279
|
};
|
|
276
280
|
/** Strategy used to obtain required tokens for a transaction. */
|
|
277
281
|
export type PayStrategy<OriginalQuote> = {
|
|
282
|
+
/**
|
|
283
|
+
* Check if the strategy supports the given request.
|
|
284
|
+
* Defaults to true if not implemented.
|
|
285
|
+
*/
|
|
286
|
+
supports?: (request: PayStrategyGetQuotesRequest) => boolean;
|
|
278
287
|
/** Retrieve quotes for required tokens. */
|
|
279
288
|
getQuotes: (request: PayStrategyGetQuotesRequest) => Promise<TransactionPayQuote<OriginalQuote>[]>;
|
|
280
289
|
/** Retrieve batch transactions for quotes, if supported by the strategy. */
|
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,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,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,sCAAsC,EACtC,2CAA2C,EAC3C,oDAAoD,EACrD,yCAAyC;AAC1C,OAAO,KAAK,EACV,gBAAgB,EAChB,yCAAyC,EACzC,0CAA0C,EAC1C,mCAAmC,EACnC,q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EAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IAEd,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
|
package/dist/types.mjs.map
CHANGED
|
@@ -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 { 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 | 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\n/** Action to update transaction configuration using a callback. */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `${typeof CONTROLLER_NAME}:setTransactionConfig`;\n handler: (transactionId: string, callback: TransactionConfigCallback) => void;\n};\n\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\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/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerSetTransactionConfigAction\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 /** 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 /**\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/** 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 /** 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 /** Amount of target token provided. */\n targetAmount: FiatValue;\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 /** 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/** 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 { 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 | 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\n/** Action to update transaction configuration using a callback. */\nexport type TransactionPayControllerSetTransactionConfigAction = {\n type: `${typeof CONTROLLER_NAME}:setTransactionConfig`;\n handler: (transactionId: string, callback: TransactionConfigCallback) => void;\n};\n\n/** Configurable properties of a transaction. */\nexport type TransactionConfig = {\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/** Callback to update transaction config. */\nexport type TransactionConfigCallback = (config: TransactionConfig) => void;\n\nexport type TransactionPayControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof CONTROLLER_NAME,\n TransactionPayControllerState\n >;\n\nexport type TransactionPayControllerActions =\n | TransactionPayControllerGetDelegationTransactionAction\n | TransactionPayControllerGetStateAction\n | TransactionPayControllerGetStrategyAction\n | TransactionPayControllerSetTransactionConfigAction\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 /** 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 /** 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 /**\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/** 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 /** 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 /** 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 /** 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/** 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,15 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEIP7702SupportedChains = exports.getSlippage = 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;
|
|
3
|
+
exports.getEIP7702SupportedChains = exports.getSlippage = exports.getGasBuffer = exports.getFeatureFlags = exports.getStrategyOrder = exports.DEFAULT_STRATEGY_ORDER = 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
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const constants_1 = require("../constants.cjs");
|
|
5
7
|
const logger_1 = require("../logger.cjs");
|
|
6
|
-
const
|
|
8
|
+
const constants_2 = require("../strategy/relay/constants.cjs");
|
|
7
9
|
const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'feature-flags');
|
|
8
10
|
exports.DEFAULT_GAS_BUFFER = 1.0;
|
|
9
11
|
exports.DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;
|
|
10
12
|
exports.DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;
|
|
11
|
-
exports.DEFAULT_RELAY_QUOTE_URL = `${
|
|
13
|
+
exports.DEFAULT_RELAY_QUOTE_URL = `${constants_2.RELAY_URL_BASE}/quote`;
|
|
12
14
|
exports.DEFAULT_SLIPPAGE = 0.005;
|
|
15
|
+
exports.DEFAULT_STRATEGY_ORDER = [
|
|
16
|
+
constants_1.TransactionPayStrategy.Relay,
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Get ordered list of strategies to try.
|
|
20
|
+
*
|
|
21
|
+
* @param messenger - Controller messenger.
|
|
22
|
+
* @returns Ordered strategy list.
|
|
23
|
+
*/
|
|
24
|
+
function getStrategyOrder(messenger) {
|
|
25
|
+
const { strategyOrder: strategyPriority } = getFeatureFlagsRaw(messenger);
|
|
26
|
+
if (!Array.isArray(strategyPriority)) {
|
|
27
|
+
return [...exports.DEFAULT_STRATEGY_ORDER];
|
|
28
|
+
}
|
|
29
|
+
const validStrategyPriority = (0, lodash_1.uniq)(strategyPriority.filter((strategy) => (0, constants_1.isTransactionPayStrategy)(strategy)));
|
|
30
|
+
if (!validStrategyPriority.length) {
|
|
31
|
+
return [...exports.DEFAULT_STRATEGY_ORDER];
|
|
32
|
+
}
|
|
33
|
+
return validStrategyPriority;
|
|
34
|
+
}
|
|
35
|
+
exports.getStrategyOrder = getStrategyOrder;
|
|
13
36
|
/**
|
|
14
37
|
* Get feature flags related to the controller.
|
|
15
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.cjs","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":";;;AACA,2CAAqD;
|
|
1
|
+
{"version":3,"file":"feature-flags.cjs","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":";;;AACA,2CAAqD;AACrD,mCAA8B;AAG9B,gDAAgF;AAChF,0CAA0C;AAC1C,+DAA6D;AAE7D,MAAM,GAAG,GAAG,IAAA,0BAAkB,EAAC,sBAAa,EAAE,eAAe,CAAC,CAAC;AAIlD,QAAA,kBAAkB,GAAG,GAAG,CAAC;AACzB,QAAA,mCAAmC,GAAG,MAAM,CAAC;AAC7C,QAAA,8BAA8B,GAAG,OAAO,CAAC;AACzC,QAAA,uBAAuB,GAAG,GAAG,0BAAc,QAAQ,CAAC;AACpD,QAAA,gBAAgB,GAAG,K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E,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,aAAa,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CACvC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,aAAa,CAC3C,CAAC;IAEF,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CACvC,SAA4C;IAE5C,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IACrE,MAAM,YAAY,GAAG,KAAK,CAAC,kBAAkB,CAAC,sBAEjC,CAAC;IAEd,OAAO,YAAY,EAAE,eAAe,IAAI,EAAE,CAAC;AAC7C,CAAC;AATD,8DASC;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';\nimport { uniq } from 'lodash';\n\nimport type { TransactionPayControllerMessenger } from '..';\nimport { isTransactionPayStrategy, TransactionPayStrategy } from '../constants';\nimport { projectLogger } from '../logger';\nimport { RELAY_URL_BASE } from '../strategy/relay/constants';\n\nconst log = createModuleLogger(projectLogger, 'feature-flags');\n\ntype StrategyOrder = [TransactionPayStrategy, ...TransactionPayStrategy[]];\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;\nexport const DEFAULT_STRATEGY_ORDER: StrategyOrder = [\n TransactionPayStrategy.Relay,\n];\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 slippageTokens?: Record<Hex, Record<Hex, number>>;\n strategyOrder?: string[];\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 ordered list of strategies to try.\n *\n * @param messenger - Controller messenger.\n * @returns Ordered strategy list.\n */\nexport function getStrategyOrder(\n messenger: TransactionPayControllerMessenger,\n): StrategyOrder {\n const { strategyOrder: strategyPriority } = getFeatureFlagsRaw(messenger);\n\n if (!Array.isArray(strategyPriority)) {\n return [...DEFAULT_STRATEGY_ORDER];\n }\n\n const validStrategyPriority = uniq(\n strategyPriority.filter((strategy): strategy is TransactionPayStrategy =>\n isTransactionPayStrategy(strategy),\n ),\n );\n\n if (!validStrategyPriority.length) {\n return [...DEFAULT_STRATEGY_ORDER];\n }\n\n return validStrategyPriority as StrategyOrder;\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 slippage value for a specific chain ID and token address.\n * Falls back to the general slippage feature flag, then the static default.\n *\n * @param messenger - Controller messenger.\n * @param chainId - Chain ID to get slippage for.\n * @param tokenAddress - Token address to get slippage for.\n * @returns Slippage value as a decimal (e.g., 0.005 for 0.5%).\n */\nexport function getSlippage(\n messenger: TransactionPayControllerMessenger,\n chainId: Hex,\n tokenAddress: Hex,\n): number {\n const featureFlags = getFeatureFlagsRaw(messenger);\n const { slippageTokens } = featureFlags;\n\n const tokenMap = getCaseInsensitive(slippageTokens, chainId);\n const tokenSlippage = getCaseInsensitive(tokenMap, tokenAddress);\n\n if (tokenSlippage !== undefined) {\n log('Using token-specific slippage', {\n chainId,\n tokenAddress,\n slippage: tokenSlippage,\n });\n return tokenSlippage;\n }\n\n const slippage = featureFlags.slippage ?? DEFAULT_SLIPPAGE;\n log('Using default slippage', { chainId, tokenAddress, slippage });\n return slippage;\n}\n\n/**\n * Get a value from a record using a case-insensitive key lookup.\n *\n * @param record - The record to search.\n * @param key - The key to look up (case-insensitive).\n * @returns The value if found, undefined otherwise.\n */\nfunction getCaseInsensitive<Value>(\n record: Record<string, Value> | undefined,\n key: string,\n): Value | undefined {\n if (!record) {\n return undefined;\n }\n\n const normalizedKey = key.toLowerCase();\n const entry = Object.entries(record).find(\n ([k]) => k.toLowerCase() === normalizedKey,\n );\n\n return entry?.[1];\n}\n\n/**\n * Retrieves the supported EIP-7702 chains from feature flags.\n *\n * @param messenger - Controller messenger.\n * @returns Array of chain IDs that support EIP-7702.\n */\nexport function getEIP7702SupportedChains(\n messenger: TransactionPayControllerMessenger,\n): Hex[] {\n const state = messenger.call('RemoteFeatureFlagController:getState');\n const eip7702Flags = state.remoteFeatureFlags.confirmations_eip_7702 as\n | { supportedChains?: Hex[] }\n | undefined;\n\n return eip7702Flags?.supportedChains ?? [];\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,10 +1,13 @@
|
|
|
1
1
|
import type { Hex } from "@metamask/utils";
|
|
2
2
|
import type { TransactionPayControllerMessenger } from "../index.cjs";
|
|
3
|
+
import { TransactionPayStrategy } from "../constants.cjs";
|
|
4
|
+
type StrategyOrder = [TransactionPayStrategy, ...TransactionPayStrategy[]];
|
|
3
5
|
export declare const DEFAULT_GAS_BUFFER = 1;
|
|
4
6
|
export declare const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;
|
|
5
7
|
export declare const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;
|
|
6
8
|
export declare const DEFAULT_RELAY_QUOTE_URL = "https://api.relay.link/quote";
|
|
7
9
|
export declare const DEFAULT_SLIPPAGE = 0.005;
|
|
10
|
+
export declare const DEFAULT_STRATEGY_ORDER: StrategyOrder;
|
|
8
11
|
export type FeatureFlags = {
|
|
9
12
|
relayDisabledGasStationChains: Hex[];
|
|
10
13
|
relayFallbackGas: {
|
|
@@ -14,6 +17,13 @@ export type FeatureFlags = {
|
|
|
14
17
|
relayQuoteUrl: string;
|
|
15
18
|
slippage: number;
|
|
16
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Get ordered list of strategies to try.
|
|
22
|
+
*
|
|
23
|
+
* @param messenger - Controller messenger.
|
|
24
|
+
* @returns Ordered strategy list.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getStrategyOrder(messenger: TransactionPayControllerMessenger): StrategyOrder;
|
|
17
27
|
/**
|
|
18
28
|
* Get feature flags related to the controller.
|
|
19
29
|
*
|
|
@@ -46,4 +56,5 @@ export declare function getSlippage(messenger: TransactionPayControllerMessenger
|
|
|
46
56
|
* @returns Array of chain IDs that support EIP-7702.
|
|
47
57
|
*/
|
|
48
58
|
export declare function getEIP7702SupportedChains(messenger: TransactionPayControllerMessenger): Hex[];
|
|
59
|
+
export {};
|
|
49
60
|
//# 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;
|
|
1
|
+
{"version":3,"file":"feature-flags.d.cts","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAI3C,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAW;AAC5D,OAAO,EAA4B,sBAAsB,EAAE,yBAAqB;AAMhF,KAAK,aAAa,GAAG,CAAC,sBAAsB,EAAE,GAAG,sBAAsB,EAAE,CAAC,CAAC;AAE3E,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;AACtC,eAAO,MAAM,sBAAsB,EAAE,aAEpC,CAAC;AAwBF,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,gBAAgB,CAC9B,SAAS,EAAE,iCAAiC,GAC3C,aAAa,CAkBf;AAED;;;;;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;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,iCAAiC,EAC5C,OAAO,EAAE,GAAG,EACZ,YAAY,EAAE,GAAG,GAChB,MAAM,CAmBR;AAyBD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iCAAiC,GAC3C,GAAG,EAAE,CAOP"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Hex } from "@metamask/utils";
|
|
2
2
|
import type { TransactionPayControllerMessenger } from "../index.mjs";
|
|
3
|
+
import { TransactionPayStrategy } from "../constants.mjs";
|
|
4
|
+
type StrategyOrder = [TransactionPayStrategy, ...TransactionPayStrategy[]];
|
|
3
5
|
export declare const DEFAULT_GAS_BUFFER = 1;
|
|
4
6
|
export declare const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;
|
|
5
7
|
export declare const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;
|
|
6
8
|
export declare const DEFAULT_RELAY_QUOTE_URL = "https://api.relay.link/quote";
|
|
7
9
|
export declare const DEFAULT_SLIPPAGE = 0.005;
|
|
10
|
+
export declare const DEFAULT_STRATEGY_ORDER: StrategyOrder;
|
|
8
11
|
export type FeatureFlags = {
|
|
9
12
|
relayDisabledGasStationChains: Hex[];
|
|
10
13
|
relayFallbackGas: {
|
|
@@ -14,6 +17,13 @@ export type FeatureFlags = {
|
|
|
14
17
|
relayQuoteUrl: string;
|
|
15
18
|
slippage: number;
|
|
16
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Get ordered list of strategies to try.
|
|
22
|
+
*
|
|
23
|
+
* @param messenger - Controller messenger.
|
|
24
|
+
* @returns Ordered strategy list.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getStrategyOrder(messenger: TransactionPayControllerMessenger): StrategyOrder;
|
|
17
27
|
/**
|
|
18
28
|
* Get feature flags related to the controller.
|
|
19
29
|
*
|
|
@@ -46,4 +56,5 @@ export declare function getSlippage(messenger: TransactionPayControllerMessenger
|
|
|
46
56
|
* @returns Array of chain IDs that support EIP-7702.
|
|
47
57
|
*/
|
|
48
58
|
export declare function getEIP7702SupportedChains(messenger: TransactionPayControllerMessenger): Hex[];
|
|
59
|
+
export {};
|
|
49
60
|
//# 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;
|
|
1
|
+
{"version":3,"file":"feature-flags.d.mts","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAI3C,OAAO,KAAK,EAAE,iCAAiC,EAAE,qBAAW;AAC5D,OAAO,EAA4B,sBAAsB,EAAE,yBAAqB;AAMhF,KAAK,aAAa,GAAG,CAAC,sBAAsB,EAAE,GAAG,sBAAsB,EAAE,CAAC,CAAC;AAE3E,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;AACtC,eAAO,MAAM,sBAAsB,EAAE,aAEpC,CAAC;AAwBF,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,gBAAgB,CAC9B,SAAS,EAAE,iCAAiC,GAC3C,aAAa,CAkBf;AAED;;;;;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;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,iCAAiC,EAC5C,OAAO,EAAE,GAAG,EACZ,YAAY,EAAE,GAAG,GAChB,MAAM,CAmBR;AAyBD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iCAAiC,GAC3C,GAAG,EAAE,CAOP"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { createModuleLogger } from "@metamask/utils";
|
|
2
|
+
import $lodash from "lodash";
|
|
3
|
+
const { uniq } = $lodash;
|
|
4
|
+
import { isTransactionPayStrategy, TransactionPayStrategy } from "../constants.mjs";
|
|
2
5
|
import { projectLogger } from "../logger.mjs";
|
|
3
6
|
import { RELAY_URL_BASE } from "../strategy/relay/constants.mjs";
|
|
4
7
|
const log = createModuleLogger(projectLogger, 'feature-flags');
|
|
@@ -7,6 +10,26 @@ export const DEFAULT_RELAY_FALLBACK_GAS_ESTIMATE = 900000;
|
|
|
7
10
|
export const DEFAULT_RELAY_FALLBACK_GAS_MAX = 1500000;
|
|
8
11
|
export const DEFAULT_RELAY_QUOTE_URL = `${RELAY_URL_BASE}/quote`;
|
|
9
12
|
export const DEFAULT_SLIPPAGE = 0.005;
|
|
13
|
+
export const DEFAULT_STRATEGY_ORDER = [
|
|
14
|
+
TransactionPayStrategy.Relay,
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* Get ordered list of strategies to try.
|
|
18
|
+
*
|
|
19
|
+
* @param messenger - Controller messenger.
|
|
20
|
+
* @returns Ordered strategy list.
|
|
21
|
+
*/
|
|
22
|
+
export function getStrategyOrder(messenger) {
|
|
23
|
+
const { strategyOrder: strategyPriority } = getFeatureFlagsRaw(messenger);
|
|
24
|
+
if (!Array.isArray(strategyPriority)) {
|
|
25
|
+
return [...DEFAULT_STRATEGY_ORDER];
|
|
26
|
+
}
|
|
27
|
+
const validStrategyPriority = uniq(strategyPriority.filter((strategy) => isTransactionPayStrategy(strategy)));
|
|
28
|
+
if (!validStrategyPriority.length) {
|
|
29
|
+
return [...DEFAULT_STRATEGY_ORDER];
|
|
30
|
+
}
|
|
31
|
+
return validStrategyPriority;
|
|
32
|
+
}
|
|
10
33
|
/**
|
|
11
34
|
* Get feature flags related to the controller.
|
|
12
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.mjs","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;
|
|
1
|
+
{"version":3,"file":"feature-flags.mjs","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;;;AAIrD,OAAO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'@metamask/utils';\nimport { uniq } from 'lodash';\n\nimport type { TransactionPayControllerMessenger } from '..';\nimport { isTransactionPayStrategy, TransactionPayStrategy } from '../constants';\nimport { projectLogger } from '../logger';\nimport { RELAY_URL_BASE } from '../strategy/relay/constants';\n\nconst log = createModuleLogger(projectLogger, 'feature-flags');\n\ntype StrategyOrder = [TransactionPayStrategy, ...TransactionPayStrategy[]];\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;\nexport const DEFAULT_STRATEGY_ORDER: StrategyOrder = [\n TransactionPayStrategy.Relay,\n];\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 slippageTokens?: Record<Hex, Record<Hex, number>>;\n strategyOrder?: string[];\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 ordered list of strategies to try.\n *\n * @param messenger - Controller messenger.\n * @returns Ordered strategy list.\n */\nexport function getStrategyOrder(\n messenger: TransactionPayControllerMessenger,\n): StrategyOrder {\n const { strategyOrder: strategyPriority } = getFeatureFlagsRaw(messenger);\n\n if (!Array.isArray(strategyPriority)) {\n return [...DEFAULT_STRATEGY_ORDER];\n }\n\n const validStrategyPriority = uniq(\n strategyPriority.filter((strategy): strategy is TransactionPayStrategy =>\n isTransactionPayStrategy(strategy),\n ),\n );\n\n if (!validStrategyPriority.length) {\n return [...DEFAULT_STRATEGY_ORDER];\n }\n\n return validStrategyPriority as StrategyOrder;\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 slippage value for a specific chain ID and token address.\n * Falls back to the general slippage feature flag, then the static default.\n *\n * @param messenger - Controller messenger.\n * @param chainId - Chain ID to get slippage for.\n * @param tokenAddress - Token address to get slippage for.\n * @returns Slippage value as a decimal (e.g., 0.005 for 0.5%).\n */\nexport function getSlippage(\n messenger: TransactionPayControllerMessenger,\n chainId: Hex,\n tokenAddress: Hex,\n): number {\n const featureFlags = getFeatureFlagsRaw(messenger);\n const { slippageTokens } = featureFlags;\n\n const tokenMap = getCaseInsensitive(slippageTokens, chainId);\n const tokenSlippage = getCaseInsensitive(tokenMap, tokenAddress);\n\n if (tokenSlippage !== undefined) {\n log('Using token-specific slippage', {\n chainId,\n tokenAddress,\n slippage: tokenSlippage,\n });\n return tokenSlippage;\n }\n\n const slippage = featureFlags.slippage ?? DEFAULT_SLIPPAGE;\n log('Using default slippage', { chainId, tokenAddress, slippage });\n return slippage;\n}\n\n/**\n * Get a value from a record using a case-insensitive key lookup.\n *\n * @param record - The record to search.\n * @param key - The key to look up (case-insensitive).\n * @returns The value if found, undefined otherwise.\n */\nfunction getCaseInsensitive<Value>(\n record: Record<string, Value> | undefined,\n key: string,\n): Value | undefined {\n if (!record) {\n return undefined;\n }\n\n const normalizedKey = key.toLowerCase();\n const entry = Object.entries(record).find(\n ([k]) => k.toLowerCase() === normalizedKey,\n );\n\n return entry?.[1];\n}\n\n/**\n * Retrieves the supported EIP-7702 chains from feature flags.\n *\n * @param messenger - Controller messenger.\n * @returns Array of chain IDs that support EIP-7702.\n */\nexport function getEIP7702SupportedChains(\n messenger: TransactionPayControllerMessenger,\n): Hex[] {\n const state = messenger.call('RemoteFeatureFlagController:getState');\n const eip7702Flags = state.remoteFeatureFlags.confirmations_eip_7702 as\n | { supportedChains?: Hex[] }\n | undefined;\n\n return eip7702Flags?.supportedChains ?? [];\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"]}
|
package/dist/utils/quotes.cjs
CHANGED
|
@@ -7,6 +7,7 @@ const strategy_1 = require("./strategy.cjs");
|
|
|
7
7
|
const token_1 = require("./token.cjs");
|
|
8
8
|
const totals_1 = require("./totals.cjs");
|
|
9
9
|
const transaction_1 = require("./transaction.cjs");
|
|
10
|
+
const constants_1 = require("../constants.cjs");
|
|
10
11
|
const logger_1 = require("../logger.cjs");
|
|
11
12
|
const DEFAULT_REFRESH_INTERVAL = 30 * 1000; // 30 Seconds
|
|
12
13
|
const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'quotes');
|
|
@@ -17,7 +18,7 @@ const log = (0, utils_1.createModuleLogger)(logger_1.projectLogger, 'quotes');
|
|
|
17
18
|
* @returns Boolean indicating if the quotes were updated.
|
|
18
19
|
*/
|
|
19
20
|
async function updateQuotes(request) {
|
|
20
|
-
const { messenger, transactionData, transactionId, updateTransactionData } = request;
|
|
21
|
+
const { getStrategies, messenger, transactionData, transactionId, updateTransactionData, } = request;
|
|
21
22
|
const transaction = (0, transaction_1.getTransaction)(transactionId, messenger);
|
|
22
23
|
if (!transaction || !transactionData) {
|
|
23
24
|
throw new Error('Transaction not found');
|
|
@@ -48,7 +49,7 @@ async function updateQuotes(request) {
|
|
|
48
49
|
tokens,
|
|
49
50
|
transactionId,
|
|
50
51
|
});
|
|
51
|
-
const { batchTransactions, quotes } = await getQuotes(transaction, requests, messenger);
|
|
52
|
+
const { batchTransactions, quotes } = await getQuotes(transaction, requests, getStrategies, messenger);
|
|
52
53
|
const totals = (0, totals_1.calculateTotals)({
|
|
53
54
|
isMaxAmount,
|
|
54
55
|
messenger,
|
|
@@ -117,8 +118,9 @@ function syncTransaction({ batchTransactions, isPostQuote, messenger, paymentTok
|
|
|
117
118
|
*
|
|
118
119
|
* @param messenger - Messenger instance.
|
|
119
120
|
* @param updateTransactionData - Callback to update transaction data.
|
|
121
|
+
* @param getStrategies - Callback to get ordered strategy names for a transaction.
|
|
120
122
|
*/
|
|
121
|
-
async function refreshQuotes(messenger, updateTransactionData) {
|
|
123
|
+
async function refreshQuotes(messenger, updateTransactionData, getStrategies) {
|
|
122
124
|
const state = messenger.call('TransactionPayController:getState');
|
|
123
125
|
const transactionIds = Object.keys(state.transactionData);
|
|
124
126
|
for (const transactionId of transactionIds) {
|
|
@@ -138,6 +140,7 @@ async function refreshQuotes(messenger, updateTransactionData) {
|
|
|
138
140
|
continue;
|
|
139
141
|
}
|
|
140
142
|
const isUpdated = await updateQuotes({
|
|
143
|
+
getStrategies,
|
|
141
144
|
messenger,
|
|
142
145
|
transactionData,
|
|
143
146
|
transactionId,
|
|
@@ -276,36 +279,69 @@ async function refreshPaymentTokenBalance({ from, messenger, paymentToken, trans
|
|
|
276
279
|
*
|
|
277
280
|
* @param transaction - Transaction metadata.
|
|
278
281
|
* @param requests - Quote requests.
|
|
282
|
+
* @param getStrategies - Callback to get ordered strategy names for a transaction.
|
|
279
283
|
* @param messenger - Controller messenger.
|
|
280
284
|
* @returns An object containing batch transactions and quotes.
|
|
281
285
|
*/
|
|
282
|
-
async function getQuotes(transaction, requests, messenger) {
|
|
286
|
+
async function getQuotes(transaction, requests, getStrategies, messenger) {
|
|
283
287
|
const { id: transactionId } = transaction;
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
: []
|
|
288
|
+
const strategies = (0, strategy_1.getStrategiesByName)(getStrategies(transaction), (strategyName) => {
|
|
289
|
+
log('Skipping unknown strategy', {
|
|
290
|
+
strategy: strategyName,
|
|
291
|
+
transactionId,
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
if (!requests?.length) {
|
|
295
|
+
return {
|
|
296
|
+
batchTransactions: [],
|
|
297
|
+
quotes: [],
|
|
298
|
+
};
|
|
294
299
|
}
|
|
295
|
-
|
|
296
|
-
|
|
300
|
+
const request = {
|
|
301
|
+
messenger,
|
|
302
|
+
requests,
|
|
303
|
+
transaction,
|
|
304
|
+
};
|
|
305
|
+
for (const { name, strategy } of strategies) {
|
|
306
|
+
try {
|
|
307
|
+
if (strategy.supports && !strategy.supports(request)) {
|
|
308
|
+
log('Strategy does not support request', {
|
|
309
|
+
strategy: name,
|
|
310
|
+
transactionId,
|
|
311
|
+
});
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
const quotes = (await strategy.getQuotes(request));
|
|
315
|
+
if (!quotes.length) {
|
|
316
|
+
log('Strategy returned no quotes', { strategy: name, transactionId });
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
log('Updated', { transactionId, quotes });
|
|
320
|
+
const batchTransactions = strategy.getBatchTransactions
|
|
321
|
+
? await strategy.getBatchTransactions({
|
|
322
|
+
messenger,
|
|
323
|
+
quotes,
|
|
324
|
+
})
|
|
325
|
+
: [];
|
|
326
|
+
log('Batch transactions', { transactionId, batchTransactions });
|
|
327
|
+
return {
|
|
328
|
+
batchTransactions,
|
|
329
|
+
quotes,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
log('Strategy failed, trying next', {
|
|
334
|
+
error,
|
|
335
|
+
strategy: name,
|
|
336
|
+
transactionId,
|
|
337
|
+
});
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
297
340
|
}
|
|
298
|
-
log('
|
|
299
|
-
const batchTransactions = quotes?.length && strategy.getBatchTransactions
|
|
300
|
-
? await strategy.getBatchTransactions({
|
|
301
|
-
messenger,
|
|
302
|
-
quotes,
|
|
303
|
-
})
|
|
304
|
-
: [];
|
|
305
|
-
log('Batch transactions', { transactionId, batchTransactions });
|
|
341
|
+
log('No quotes available', { transactionId });
|
|
306
342
|
return {
|
|
307
|
-
batchTransactions,
|
|
308
|
-
quotes,
|
|
343
|
+
batchTransactions: [],
|
|
344
|
+
quotes: [],
|
|
309
345
|
};
|
|
310
346
|
}
|
|
311
347
|
//# sourceMappingURL=quotes.cjs.map
|