@metamask/bridge-controller 32.2.0 → 33.0.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 +25 -4
- package/dist/bridge-controller.cjs +18 -5
- package/dist/bridge-controller.cjs.map +1 -1
- package/dist/bridge-controller.d.cts +1 -0
- package/dist/bridge-controller.d.cts.map +1 -1
- package/dist/bridge-controller.d.mts +1 -0
- package/dist/bridge-controller.d.mts.map +1 -1
- package/dist/bridge-controller.mjs +18 -5
- package/dist/bridge-controller.mjs.map +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs +1 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +3 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +3 -2
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +1 -0
- package/dist/types.mjs.map +1 -1
- package/dist/utils/metrics/types.cjs.map +1 -1
- package/dist/utils/metrics/types.d.cts +16 -14
- package/dist/utils/metrics/types.d.cts.map +1 -1
- package/dist/utils/metrics/types.d.mts +16 -14
- package/dist/utils/metrics/types.d.mts.map +1 -1
- package/dist/utils/metrics/types.mjs.map +1 -1
- package/package.json +12 -12
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,oDAAoD,EAAE,sCAAsC;AAC1G,OAAO,KAAK,EACV,oBAAoB,EACpB,6CAA6C,EAC7C,kCAAkC,EACnC,qCAAqC;AACtC,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACpB,kCAAkC;AACnC,OAAO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,CAAC,CAAC;AAEjE,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,CAC7D,OAAO,sBAAsB,EAC7B,qBAAqB,CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB,oDAAoD,GACpD,oBAAoB,GACpB,kCAAkC,GAClC,6CAA6C,GAC7C,iBAAiB,GACjB,mDAAmD,GACnD,+BAA+B,GAC/B,2CAA2C,GAC3C,yCAAyC,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,CACzD,OAAO,sBAAsB,EAC7B,uBAAuB,GAAG,cAAc,EACxC,sBAAsB,GAAG,aAAa,EACtC,cAAc,CAAC,MAAM,CAAC,EACtB,aAAa,CAAC,MAAM,CAAC,CACtB,CAAC"}
|
package/dist/types.mjs
CHANGED
|
@@ -71,5 +71,6 @@ export var BridgeBackgroundAction;
|
|
|
71
71
|
BridgeBackgroundAction["RESET_STATE"] = "resetState";
|
|
72
72
|
BridgeBackgroundAction["GET_BRIDGE_ERC20_ALLOWANCE"] = "getBridgeERC20Allowance";
|
|
73
73
|
BridgeBackgroundAction["TRACK_METAMETRICS_EVENT"] = "trackUnifiedSwapBridgeEvent";
|
|
74
|
+
BridgeBackgroundAction["STOP_POLLING_FOR_QUOTES"] = "stopPollingForQuotes";
|
|
74
75
|
})(BridgeBackgroundAction || (BridgeBackgroundAction = {}));
|
|
75
76
|
//# sourceMappingURL=types.mjs.map
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA4CA;;GAEG;AACH,MAAM,CAAN,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,4DAA4D;IAC5D,8BAAiB,CAAA;IACjB,qBAAqB;IACrB,4BAAe,CAAA;IACf,kCAAkC;IAClC,wBAAW,CAAA;IACX;;;OAGG;IACH,gCAAmB,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M,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,8EAAoD,CAAA;IACpD,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;IACtD,iFAAuD,CAAA;AACzD,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\nimport type {\n GetCurrencyRateState,\n MultichainAssetsRatesControllerGetStateAction,\n TokenRatesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type {\n ControllerStateChangeEvent,\n RestrictedMessenger,\n} from '@metamask/base-controller';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipAssetType,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\n\nimport type { BridgeController } from './bridge-controller';\nimport type { BRIDGE_CONTROLLER_NAME } from './constants/bridge';\n\n/**\n * Additional options accepted by the extension's fetchWithCache function\n */\ntype FetchWithCacheOptions = {\n cacheOptions?: {\n cacheRefreshTime: number;\n };\n functionName?: string;\n};\n\nexport type FetchFunction = (\n input: RequestInfo | URL,\n init?: RequestInit & FetchWithCacheOptions,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => Promise<any>;\n\n/**\n * The types of assets that a user can send\n */\nexport enum AssetType {\n /** The native asset for the current network, such as ETH */\n native = 'NATIVE',\n /** An ERC20 token */\n token = 'TOKEN',\n /** An ERC721 or ERC1155 token. */\n NFT = 'NFT',\n /**\n * A transaction interacting with a contract that isn't a token method\n * interaction will be marked as dealing with an unknown asset type.\n */\n unknown = 'UNKNOWN',\n}\n\nexport type ChainConfiguration = {\n isActiveSrc: boolean;\n isActiveDest: boolean;\n refreshRate?: number;\n topAssets?: string[];\n isUnifiedUIEnabled?: boolean;\n isSnapConfirmationEnabled?: boolean;\n};\n\nexport type L1GasFees = {\n l1GasFeesInHexWei?: string; // l1 fees for approval and trade in hex wei, appended by BridgeController.#appendL1GasFees\n};\n\nexport type SolanaFees = {\n solanaFeesInLamports?: string; // solana fees in lamports, appended by BridgeController.#appendSolanaFees\n};\n\n/**\n * The types of values for the token amount and its values when converted to the user's selected currency and USD\n */\nexport type TokenAmountValues = {\n /**\n * The amount of the token\n *\n * @example \"1000000000000000000\"\n */\n amount: string;\n /**\n * The amount of the token in the user's selected currency\n *\n * @example \"4.55\"\n */\n valueInCurrency: string | null;\n /**\n * The amount of the token in USD\n *\n * @example \"1.234\"\n */\n usd: string | null;\n};\n\n/**\n * Asset exchange rate values for a given chain and address\n */\nexport type ExchangeRate = { exchangeRate?: string; usdExchangeRate?: string };\n\n/**\n * Values derived from the quote response\n */\nexport type QuoteMetadata = {\n gasFee: TokenAmountValues;\n totalNetworkFee: TokenAmountValues; // estimatedGasFees + relayerFees\n totalMaxNetworkFee: TokenAmountValues; // maxGasFees + relayerFees\n toTokenAmount: TokenAmountValues;\n adjustedReturn: Omit<TokenAmountValues, 'amount'>; // destTokenAmount - totalNetworkFee\n sentAmount: TokenAmountValues; // srcTokenAmount + metabridgeFee\n swapRate: string; // destTokenAmount / sentAmount\n cost: Omit<TokenAmountValues, 'amount'>; // sentAmount - adjustedReturn\n};\n\n/**\n * Sort order set by the user\n */\nexport enum SortOrder {\n COST_ASC = 'cost_ascending',\n ETA_ASC = 'time_descending',\n}\n\n/**\n * This is the interface for the asset object returned by the bridge-api\n * This type is used in the QuoteResponse and in the fetchBridgeTokens response\n */\nexport type BridgeAsset = {\n /**\n * The chainId of the token\n */\n chainId: ChainId;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * The symbol of token object\n */\n symbol: string;\n /**\n * The name for the network\n */\n name: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n icon?: string;\n /**\n * URL for token icon\n */\n iconUrl?: string;\n /**\n * The assetId of the token\n */\n assetId: CaipAssetType;\n};\n\n/**\n * This is the interface for the token object used in the extension client\n * In addition to the {@link BridgeAsset} fields, it includes balance information\n */\nexport type BridgeToken = {\n address: string;\n symbol: string;\n image: string;\n decimals: number;\n chainId: number | Hex | ChainId | CaipChainId;\n balance: string; // raw balance\n // TODO deprecate this field and use balance instead\n string: string | undefined; // normalized balance as a stringified number\n tokenFiatAmount?: number | null;\n occurrences?: number;\n};\n\ntype DecimalChainId = string;\nexport type GasMultiplierByChainId = Record<DecimalChainId, number>;\n\ntype FeatureFlagResponsePlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<string, ChainConfiguration>;\n};\n\nexport type FeatureFlagResponse = FeatureFlagResponsePlatformConfig;\n\n/**\n * This is the interface for the quote request sent to the bridge-api\n * and should only be used by the fetchBridgeQuotes utility function\n * Components and redux stores should use the {@link GenericQuoteRequest} type\n */\nexport type QuoteRequest<\n ChainIdType = ChainId | number,\n TokenAddressType = string,\n WalletAddressType = string,\n> = {\n walletAddress: WalletAddressType;\n destWalletAddress?: WalletAddressType;\n srcChainId: ChainIdType;\n destChainId: ChainIdType;\n srcTokenAddress: TokenAddressType;\n destTokenAddress: TokenAddressType;\n /**\n * This is the amount sent, in atomic amount\n */\n srcTokenAmount: string;\n slippage?: number;\n aggIds?: string[];\n bridgeIds?: string[];\n insufficientBal?: boolean;\n resetApproval?: boolean;\n refuel?: boolean;\n};\n\nexport enum StatusTypes {\n UNKNOWN = 'UNKNOWN',\n FAILED = 'FAILED',\n PENDING = 'PENDING',\n COMPLETE = 'COMPLETE',\n}\n\n/**\n * These are types that components pass in. Since data is a mix of types when coming from the redux store, we need to use a generic type that can cover all the types.\n * Payloads with this type are transformed into QuoteRequest by fetchBridgeQuotes right before fetching quotes\n */\nexport type GenericQuoteRequest = QuoteRequest<\n Hex | CaipChainId | string | number, // chainIds\n Hex | CaipAssetId | string, // assetIds/addresses\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n Hex | CaipAccountId | string // accountIds/addresses\n>;\n\nexport type Protocol = {\n name: string;\n displayName?: string;\n icon?: string;\n};\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nexport type Step = {\n action: ActionTypes;\n srcChainId: ChainId;\n destChainId?: ChainId;\n srcAsset?: BridgeAsset;\n destAsset?: BridgeAsset;\n srcAmount: string;\n destAmount: string;\n protocol: Protocol;\n};\n\nexport type RefuelData = Step;\n\nexport type Quote = {\n requestId: string;\n srcChainId: ChainId;\n srcAsset: BridgeAsset;\n // Some tokens have a fee of 0, so sometimes it's equal to amount sent\n srcTokenAmount: string; // Atomic amount, the amount sent - fees\n destChainId: ChainId;\n destAsset: BridgeAsset;\n destTokenAmount: string; // Atomic amount, the amount received\n feeData: Record<FeeType.METABRIDGE, FeeData> &\n Partial<Record<FeeType, FeeData>>;\n bridgeId: string;\n bridges: string[];\n steps: Step[];\n refuel?: RefuelData;\n priceData?: {\n totalFromAmountUsd?: string;\n totalToAmountUsd?: string;\n priceImpact?: string;\n };\n};\n\n/**\n * This is the type for the quote response from the bridge-api\n * TxDataType can be overriden to be a string when the quote is non-evm\n */\nexport type QuoteResponse<TradeType = TxData, ApprovalType = TxData | null> = {\n quote: Quote;\n approval?: ApprovalType;\n trade: TradeType;\n estimatedProcessingTimeInSeconds: number;\n};\n\nexport enum ChainId {\n ETH = 1,\n OPTIMISM = 10,\n BSC = 56,\n POLYGON = 137,\n ZKSYNC = 324,\n BASE = 8453,\n ARBITRUM = 42161,\n AVALANCHE = 43114,\n LINEA = 59144,\n SOLANA = 1151111081099710,\n}\n\nexport enum FeeType {\n METABRIDGE = 'metabridge',\n REFUEL = 'refuel',\n}\nexport type FeeData = {\n amount: string;\n asset: BridgeAsset;\n};\nexport type TxData = {\n chainId: ChainId;\n to: string;\n from: string;\n value: string;\n data: string;\n gasLimit: number | null;\n};\n\nexport type FeatureFlagsPlatformConfig = {\n minimumVersion: string;\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport enum RequestStatus {\n LOADING,\n FETCHED,\n ERROR,\n}\nexport enum BridgeUserAction {\n SELECT_DEST_NETWORK = 'selectDestNetwork',\n UPDATE_QUOTE_PARAMS = 'updateBridgeQuoteRequestParams',\n}\nexport enum BridgeBackgroundAction {\n SET_CHAIN_INTERVAL_LENGTH = 'setChainIntervalLength',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n TRACK_METAMETRICS_EVENT = 'trackUnifiedSwapBridgeEvent',\n}\n\nexport type BridgeControllerState = {\n quoteRequest: Partial<GenericQuoteRequest>;\n quotes: (QuoteResponse & L1GasFees & SolanaFees)[];\n quotesInitialLoadTime: number | null;\n quotesLastFetched: number | null;\n quotesLoadingStatus: RequestStatus | null;\n quoteFetchError: string | null;\n quotesRefreshCount: number;\n /**\n * Asset exchange rates for EVM and multichain assets that are not indexed by the assets controllers\n */\n assetExchangeRates: Record<CaipAssetType, ExchangeRate>;\n /**\n * When the src token is SOL, this needs to be subtracted from their balance to determine\n * the max amount that can be sent.\n */\n minimumBalanceForRentExemptionInLamports: string | null;\n};\n\nexport type BridgeControllerAction<\n FunctionName extends keyof BridgeController,\n> = {\n type: `${typeof BRIDGE_CONTROLLER_NAME}:${FunctionName}`;\n handler: BridgeController[FunctionName];\n};\n\n// Maps to BridgeController function names\nexport type BridgeControllerActions =\n | BridgeControllerAction<BridgeBackgroundAction.SET_CHAIN_INTERVAL_LENGTH>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\n | BridgeControllerAction<BridgeBackgroundAction.TRACK_METAMETRICS_EVENT>\n | BridgeControllerAction<BridgeUserAction.UPDATE_QUOTE_PARAMS>;\n\nexport type BridgeControllerEvents = ControllerStateChangeEvent<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerState\n>;\n\nexport type AllowedActions =\n | AccountsControllerGetSelectedMultichainAccountAction\n | GetCurrencyRateState\n | TokenRatesControllerGetStateAction\n | MultichainAssetsRatesControllerGetStateAction\n | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction;\nexport type AllowedEvents = never;\n\n/**\n * The messenger for the BridgeController.\n */\nexport type BridgeControllerMessenger = RestrictedMessenger<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerActions | AllowedActions,\n BridgeControllerEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA4CA;;GAEG;AACH,MAAM,CAAN,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,4DAA4D;IAC5D,8BAAiB,CAAA;IACjB,qBAAqB;IACrB,4BAAe,CAAA;IACf,kCAAkC;IAClC,wBAAW,CAAA;IACX;;;OAGG;IACH,gCAAmB,CAAA;AACrB,CAAC,EAZW,SAAS,KAAT,SAAS,QAYpB;AA8DD;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA+FD,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;AACvB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAmBD,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAgDD,MAAM,CAAN,IAAY,OAWX;AAXD,WAAY,OAAO;IACjB,mCAAO,CAAA;IACP,8CAAa,CAAA;IACb,oCAAQ,CAAA;IACR,6CAAa,CAAA;IACb,2CAAY,CAAA;IACZ,wCAAW,CAAA;IACX,iDAAgB,CAAA;IAChB,mDAAiB,CAAA;IACjB,2CAAa,CAAA;IACb,wDAAyB,CAAA;AAC3B,CAAC,EAXW,OAAO,KAAP,OAAO,QAWlB;AAED,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,4BAAiB,CAAA;AACnB,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAsBD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,uDAAO,CAAA;IACP,uDAAO,CAAA;IACP,mDAAK,CAAA;AACP,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AACD,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,6DAAyC,CAAA;IACzC,0EAAsD,CAAA;AACxD,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AACD,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,8EAAoD,CAAA;IACpD,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;IACtD,iFAAuD,CAAA;IACvD,0EAAgD,CAAA;AAClD,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\nimport type {\n GetCurrencyRateState,\n MultichainAssetsRatesControllerGetStateAction,\n TokenRatesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type {\n ControllerStateChangeEvent,\n RestrictedMessenger,\n} from '@metamask/base-controller';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipAssetType,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\n\nimport type { BridgeController } from './bridge-controller';\nimport type { BRIDGE_CONTROLLER_NAME } from './constants/bridge';\n\n/**\n * Additional options accepted by the extension's fetchWithCache function\n */\ntype FetchWithCacheOptions = {\n cacheOptions?: {\n cacheRefreshTime: number;\n };\n functionName?: string;\n};\n\nexport type FetchFunction = (\n input: RequestInfo | URL,\n init?: RequestInit & FetchWithCacheOptions,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => Promise<any>;\n\n/**\n * The types of assets that a user can send\n */\nexport enum AssetType {\n /** The native asset for the current network, such as ETH */\n native = 'NATIVE',\n /** An ERC20 token */\n token = 'TOKEN',\n /** An ERC721 or ERC1155 token. */\n NFT = 'NFT',\n /**\n * A transaction interacting with a contract that isn't a token method\n * interaction will be marked as dealing with an unknown asset type.\n */\n unknown = 'UNKNOWN',\n}\n\nexport type ChainConfiguration = {\n isActiveSrc: boolean;\n isActiveDest: boolean;\n refreshRate?: number;\n topAssets?: string[];\n isUnifiedUIEnabled?: boolean;\n isSnapConfirmationEnabled?: boolean;\n};\n\nexport type L1GasFees = {\n l1GasFeesInHexWei?: string; // l1 fees for approval and trade in hex wei, appended by BridgeController.#appendL1GasFees\n};\n\nexport type SolanaFees = {\n solanaFeesInLamports?: string; // solana fees in lamports, appended by BridgeController.#appendSolanaFees\n};\n\n/**\n * The types of values for the token amount and its values when converted to the user's selected currency and USD\n */\nexport type TokenAmountValues = {\n /**\n * The amount of the token\n *\n * @example \"1000000000000000000\"\n */\n amount: string;\n /**\n * The amount of the token in the user's selected currency\n *\n * @example \"4.55\"\n */\n valueInCurrency: string | null;\n /**\n * The amount of the token in USD\n *\n * @example \"1.234\"\n */\n usd: string | null;\n};\n\n/**\n * Asset exchange rate values for a given chain and address\n */\nexport type ExchangeRate = { exchangeRate?: string; usdExchangeRate?: string };\n\n/**\n * Values derived from the quote response\n */\nexport type QuoteMetadata = {\n gasFee: TokenAmountValues;\n totalNetworkFee: TokenAmountValues; // estimatedGasFees + relayerFees\n totalMaxNetworkFee: TokenAmountValues; // maxGasFees + relayerFees\n toTokenAmount: TokenAmountValues;\n adjustedReturn: Omit<TokenAmountValues, 'amount'>; // destTokenAmount - totalNetworkFee\n sentAmount: TokenAmountValues; // srcTokenAmount + metabridgeFee\n swapRate: string; // destTokenAmount / sentAmount\n cost: Omit<TokenAmountValues, 'amount'>; // sentAmount - adjustedReturn\n};\n\n/**\n * Sort order set by the user\n */\nexport enum SortOrder {\n COST_ASC = 'cost_ascending',\n ETA_ASC = 'time_descending',\n}\n\n/**\n * This is the interface for the asset object returned by the bridge-api\n * This type is used in the QuoteResponse and in the fetchBridgeTokens response\n */\nexport type BridgeAsset = {\n /**\n * The chainId of the token\n */\n chainId: ChainId;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * The symbol of token object\n */\n symbol: string;\n /**\n * The name for the network\n */\n name: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n icon?: string;\n /**\n * URL for token icon\n */\n iconUrl?: string;\n /**\n * The assetId of the token\n */\n assetId: CaipAssetType;\n};\n\n/**\n * This is the interface for the token object used in the extension client\n * In addition to the {@link BridgeAsset} fields, it includes balance information\n */\nexport type BridgeToken = {\n address: string;\n symbol: string;\n image: string;\n decimals: number;\n chainId: number | Hex | ChainId | CaipChainId;\n balance: string; // raw balance\n // TODO deprecate this field and use balance instead\n string: string | undefined; // normalized balance as a stringified number\n tokenFiatAmount?: number | null;\n occurrences?: number;\n};\n\ntype DecimalChainId = string;\nexport type GasMultiplierByChainId = Record<DecimalChainId, number>;\n\ntype FeatureFlagResponsePlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<string, ChainConfiguration>;\n};\n\nexport type FeatureFlagResponse = FeatureFlagResponsePlatformConfig;\n\n/**\n * This is the interface for the quote request sent to the bridge-api\n * and should only be used by the fetchBridgeQuotes utility function\n * Components and redux stores should use the {@link GenericQuoteRequest} type\n */\nexport type QuoteRequest<\n ChainIdType = ChainId | number,\n TokenAddressType = string,\n WalletAddressType = string,\n> = {\n walletAddress: WalletAddressType;\n destWalletAddress?: WalletAddressType;\n srcChainId: ChainIdType;\n destChainId: ChainIdType;\n srcTokenAddress: TokenAddressType;\n destTokenAddress: TokenAddressType;\n /**\n * This is the amount sent, in atomic amount\n */\n srcTokenAmount: string;\n slippage?: number;\n aggIds?: string[];\n bridgeIds?: string[];\n insufficientBal?: boolean;\n resetApproval?: boolean;\n refuel?: boolean;\n};\n\nexport enum StatusTypes {\n UNKNOWN = 'UNKNOWN',\n FAILED = 'FAILED',\n PENDING = 'PENDING',\n COMPLETE = 'COMPLETE',\n}\n\n/**\n * These are types that components pass in. Since data is a mix of types when coming from the redux store, we need to use a generic type that can cover all the types.\n * Payloads with this type are transformed into QuoteRequest by fetchBridgeQuotes right before fetching quotes\n */\nexport type GenericQuoteRequest = QuoteRequest<\n Hex | CaipChainId | string | number, // chainIds\n Hex | CaipAssetId | string, // assetIds/addresses\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n Hex | CaipAccountId | string // accountIds/addresses\n>;\n\nexport type Protocol = {\n name: string;\n displayName?: string;\n icon?: string;\n};\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nexport type Step = {\n action: ActionTypes;\n srcChainId: ChainId;\n destChainId?: ChainId;\n srcAsset?: BridgeAsset;\n destAsset?: BridgeAsset;\n srcAmount: string;\n destAmount: string;\n protocol: Protocol;\n};\n\nexport type RefuelData = Step;\n\nexport type Quote = {\n requestId: string;\n srcChainId: ChainId;\n srcAsset: BridgeAsset;\n // Some tokens have a fee of 0, so sometimes it's equal to amount sent\n srcTokenAmount: string; // Atomic amount, the amount sent - fees\n destChainId: ChainId;\n destAsset: BridgeAsset;\n destTokenAmount: string; // Atomic amount, the amount received\n feeData: Record<FeeType.METABRIDGE, FeeData> &\n Partial<Record<FeeType, FeeData>>;\n bridgeId: string;\n bridges: string[];\n steps: Step[];\n refuel?: RefuelData;\n priceData?: {\n totalFromAmountUsd?: string;\n totalToAmountUsd?: string;\n priceImpact?: string;\n };\n};\n\n/**\n * This is the type for the quote response from the bridge-api\n * TxDataType can be overriden to be a string when the quote is non-evm\n */\nexport type QuoteResponse<TradeType = TxData, ApprovalType = TxData | null> = {\n quote: Quote;\n approval?: ApprovalType;\n trade: TradeType;\n estimatedProcessingTimeInSeconds: number;\n};\n\nexport enum ChainId {\n ETH = 1,\n OPTIMISM = 10,\n BSC = 56,\n POLYGON = 137,\n ZKSYNC = 324,\n BASE = 8453,\n ARBITRUM = 42161,\n AVALANCHE = 43114,\n LINEA = 59144,\n SOLANA = 1151111081099710,\n}\n\nexport enum FeeType {\n METABRIDGE = 'metabridge',\n REFUEL = 'refuel',\n}\nexport type FeeData = {\n amount: string;\n asset: BridgeAsset;\n};\nexport type TxData = {\n chainId: ChainId;\n to: string;\n from: string;\n value: string;\n data: string;\n gasLimit: number | null;\n};\n\nexport type FeatureFlagsPlatformConfig = {\n minimumVersion: string;\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport enum RequestStatus {\n LOADING,\n FETCHED,\n ERROR,\n}\nexport enum BridgeUserAction {\n SELECT_DEST_NETWORK = 'selectDestNetwork',\n UPDATE_QUOTE_PARAMS = 'updateBridgeQuoteRequestParams',\n}\nexport enum BridgeBackgroundAction {\n SET_CHAIN_INTERVAL_LENGTH = 'setChainIntervalLength',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n TRACK_METAMETRICS_EVENT = 'trackUnifiedSwapBridgeEvent',\n STOP_POLLING_FOR_QUOTES = 'stopPollingForQuotes',\n}\n\nexport type BridgeControllerState = {\n quoteRequest: Partial<GenericQuoteRequest>;\n quotes: (QuoteResponse & L1GasFees & SolanaFees)[];\n quotesInitialLoadTime: number | null;\n quotesLastFetched: number | null;\n quotesLoadingStatus: RequestStatus | null;\n quoteFetchError: string | null;\n quotesRefreshCount: number;\n /**\n * Asset exchange rates for EVM and multichain assets that are not indexed by the assets controllers\n */\n assetExchangeRates: Record<CaipAssetType, ExchangeRate>;\n /**\n * When the src token is SOL, this needs to be subtracted from their balance to determine\n * the max amount that can be sent.\n */\n minimumBalanceForRentExemptionInLamports: string | null;\n};\n\nexport type BridgeControllerAction<\n FunctionName extends keyof BridgeController,\n> = {\n type: `${typeof BRIDGE_CONTROLLER_NAME}:${FunctionName}`;\n handler: BridgeController[FunctionName];\n};\n\n// Maps to BridgeController function names\nexport type BridgeControllerActions =\n | BridgeControllerAction<BridgeBackgroundAction.SET_CHAIN_INTERVAL_LENGTH>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\n | BridgeControllerAction<BridgeBackgroundAction.TRACK_METAMETRICS_EVENT>\n | BridgeControllerAction<BridgeBackgroundAction.STOP_POLLING_FOR_QUOTES>\n | BridgeControllerAction<BridgeUserAction.UPDATE_QUOTE_PARAMS>;\n\nexport type BridgeControllerEvents = ControllerStateChangeEvent<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerState\n>;\n\nexport type AllowedActions =\n | AccountsControllerGetSelectedMultichainAccountAction\n | GetCurrencyRateState\n | TokenRatesControllerGetStateAction\n | MultichainAssetsRatesControllerGetStateAction\n | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction;\nexport type AllowedEvents = never;\n\n/**\n * The messenger for the BridgeController.\n */\nexport type BridgeControllerMessenger = RestrictedMessenger<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerActions | AllowedActions,\n BridgeControllerEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n UnifiedSwapBridgeEventName,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n} from './constants';\nimport type { SortOrder, StatusTypes } from '../../types';\n\n/**\n * These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml\n */\nexport type RequestParams = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n token_symbol_source: string;\n token_symbol_destination: string | null;\n token_address_source: CaipAssetType;\n token_address_destination: CaipAssetType | null;\n};\n\nexport type RequestMetadata = {\n slippage_limit?: number; // undefined === auto\n custom_slippage: boolean;\n usd_amount_source: number; // Use quoteResponse when available\n stx_enabled: boolean;\n is_hardware_wallet: boolean;\n swap_type: MetricsSwapType;\n security_warnings: string[];\n};\n\nexport type QuoteFetchData = {\n can_submit: boolean;\n best_quote_provider?: `${string}_${string}`;\n quotes_count: number;\n quotes_list: `${string}_${string}`[];\n initial_load_time_all_quotes: number;\n price_impact: number;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n quoted_time_minutes: number;\n usd_quoted_return: number;\n provider: `${string}_${string}`;\n};\n\nexport type TxStatusData = {\n allowance_reset_transaction?: StatusTypes;\n approval_transaction?: StatusTypes;\n source_transaction?: StatusTypes;\n destination_transaction?: StatusTypes;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called\n */\nexport type RequiredEventContextFromClient = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: {\n location: MetaMetricsSwapsEventSource;\n } & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;\n // When type is object, the payload can be anything\n [UnifiedSwapBridgeEventName.PageViewed]: object;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input:\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n value: InputValues[keyof InputValues];\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationFlipped]: {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_address_source: RequestParams['token_address_source'];\n token_address_destination: RequestParams['token_address_destination'];\n chain_id_source: RequestParams['chain_id_source'];\n chain_id_destination: RequestParams['chain_id_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n [UnifiedSwapBridgeEventName.QuotesRequested]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & {\n warnings: string[]; // TODO standardize warnings\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n };\n [UnifiedSwapBridgeEventName.QuoteError]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n // Emitted by BridgeStatusController\n [UnifiedSwapBridgeEventName.SnapConfirmationViewed]: Pick<\n QuoteFetchData,\n 'price_impact'\n > &\n TradeData & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Submitted]:
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n UnifiedSwapBridgeEventName,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n} from './constants';\nimport type { SortOrder, StatusTypes } from '../../types';\n\n/**\n * These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml\n */\nexport type RequestParams = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n token_symbol_source: string;\n token_symbol_destination: string | null;\n token_address_source: CaipAssetType;\n token_address_destination: CaipAssetType | null;\n};\n\nexport type RequestMetadata = {\n slippage_limit?: number; // undefined === auto\n custom_slippage: boolean;\n usd_amount_source: number; // Use quoteResponse when available\n stx_enabled: boolean;\n is_hardware_wallet: boolean;\n swap_type: MetricsSwapType;\n security_warnings: string[];\n};\n\nexport type QuoteFetchData = {\n can_submit: boolean;\n best_quote_provider?: `${string}_${string}`;\n quotes_count: number;\n quotes_list: `${string}_${string}`[];\n initial_load_time_all_quotes: number;\n price_impact: number;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n quoted_time_minutes: number;\n usd_quoted_return: number;\n provider: `${string}_${string}`;\n};\n\nexport type TxStatusData = {\n allowance_reset_transaction?: StatusTypes;\n approval_transaction?: StatusTypes;\n source_transaction?: StatusTypes;\n destination_transaction?: StatusTypes;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called\n */\nexport type RequiredEventContextFromClient = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: {\n location: MetaMetricsSwapsEventSource;\n } & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;\n // When type is object, the payload can be anything\n [UnifiedSwapBridgeEventName.PageViewed]: object;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input:\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n value: InputValues[keyof InputValues];\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationFlipped]: {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_address_source: RequestParams['token_address_source'];\n token_address_destination: RequestParams['token_address_destination'];\n chain_id_source: RequestParams['chain_id_source'];\n chain_id_destination: RequestParams['chain_id_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n [UnifiedSwapBridgeEventName.QuotesRequested]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & {\n warnings: string[]; // TODO standardize warnings\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n };\n [UnifiedSwapBridgeEventName.QuoteError]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n // Emitted by BridgeStatusController\n [UnifiedSwapBridgeEventName.SnapConfirmationViewed]: Pick<\n QuoteFetchData,\n 'price_impact'\n > &\n TradeData & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;\n [UnifiedSwapBridgeEventName.Completed]: RequestParams &\n RequestMetadata &\n TxStatusData &\n Pick<QuoteFetchData, 'price_impact'> &\n TradeData & {\n actual_time_minutes: number;\n usd_actual_return: number;\n usd_actual_gas: number;\n quote_vs_execution_ratio: number;\n quoted_vs_used_gas_ratio: number;\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Failed]:\n | // Tx failed before confirmation\n (TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source'> &\n Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { error_message: string }) // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n Pick<QuoteFetchData, 'price_impact'> &\n TxStatusData &\n TradeData & {\n actual_time_minutes: number;\n error_message?: string;\n action_type: MetricsActionType;\n });\n // Emitted by clients\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n };\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n sort_order: SortOrder;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n };\n [UnifiedSwapBridgeEventName.QuoteSelected]: TradeData & {\n is_best_quote: boolean;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n };\n};\n\n/**\n * Properties that can be derived from the bridge controller state\n */\nexport type EventPropertiesFromControllerState = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: RequestParams;\n [UnifiedSwapBridgeEventName.PageViewed]: RequestParams;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n value: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationFlipped]: RequestParams;\n [UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData & {\n refresh_count: number; // starts from 0\n };\n [UnifiedSwapBridgeEventName.QuoteError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.SnapConfirmationViewed]: RequestMetadata &\n RequestParams &\n QuoteFetchData &\n TradeData;\n [UnifiedSwapBridgeEventName.Submitted]: RequestParams &\n RequestMetadata &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Completed]: null;\n [UnifiedSwapBridgeEventName.Failed]: RequestParams &\n RequestMetadata &\n TxStatusData &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n actual_time_minutes: number;\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.QuoteSelected]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData;\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n action_type: MetricsActionType;\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
|
@@ -86,9 +86,7 @@ export type RequiredEventContextFromClient = {
|
|
|
86
86
|
[UnifiedSwapBridgeEventName.SnapConfirmationViewed]: Pick<QuoteFetchData, 'price_impact'> & TradeData & {
|
|
87
87
|
action_type: MetricsActionType;
|
|
88
88
|
};
|
|
89
|
-
[UnifiedSwapBridgeEventName.Submitted]:
|
|
90
|
-
action_type: MetricsActionType;
|
|
91
|
-
};
|
|
89
|
+
[UnifiedSwapBridgeEventName.Submitted]: TradeData & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;
|
|
92
90
|
[UnifiedSwapBridgeEventName.Completed]: RequestParams & RequestMetadata & TxStatusData & Pick<QuoteFetchData, 'price_impact'> & TradeData & {
|
|
93
91
|
actual_time_minutes: number;
|
|
94
92
|
usd_actual_return: number;
|
|
@@ -97,20 +95,19 @@ export type RequiredEventContextFromClient = {
|
|
|
97
95
|
quoted_vs_used_gas_ratio: number;
|
|
98
96
|
action_type: MetricsActionType;
|
|
99
97
|
};
|
|
100
|
-
[UnifiedSwapBridgeEventName.Failed]:
|
|
101
|
-
|
|
98
|
+
[UnifiedSwapBridgeEventName.Failed]: // Tx failed before confirmation
|
|
99
|
+
(TradeData & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
102
100
|
error_message: string;
|
|
101
|
+
}) | (RequestParams & RequestMetadata & Pick<QuoteFetchData, 'price_impact'> & TxStatusData & TradeData & {
|
|
102
|
+
actual_time_minutes: number;
|
|
103
|
+
error_message?: string;
|
|
103
104
|
action_type: MetricsActionType;
|
|
104
|
-
};
|
|
105
|
-
[UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & {
|
|
105
|
+
});
|
|
106
|
+
[UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
106
107
|
stx_enabled: RequestMetadata['stx_enabled'];
|
|
107
|
-
token_symbol_source: RequestParams['token_symbol_source'];
|
|
108
|
-
token_symbol_destination: RequestParams['token_symbol_destination'];
|
|
109
108
|
};
|
|
110
|
-
[UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & {
|
|
109
|
+
[UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
111
110
|
stx_enabled: RequestMetadata['stx_enabled'];
|
|
112
|
-
token_symbol_source: RequestParams['token_symbol_source'];
|
|
113
|
-
token_symbol_destination: RequestParams['token_symbol_destination'];
|
|
114
111
|
sort_order: SortOrder;
|
|
115
112
|
best_quote_provider: QuoteFetchData['best_quote_provider'];
|
|
116
113
|
};
|
|
@@ -142,9 +139,14 @@ export type EventPropertiesFromControllerState = {
|
|
|
142
139
|
error_message: string;
|
|
143
140
|
};
|
|
144
141
|
[UnifiedSwapBridgeEventName.SnapConfirmationViewed]: RequestMetadata & RequestParams & QuoteFetchData & TradeData;
|
|
145
|
-
[UnifiedSwapBridgeEventName.Submitted]:
|
|
142
|
+
[UnifiedSwapBridgeEventName.Submitted]: RequestParams & RequestMetadata & TradeData & Pick<QuoteFetchData, 'price_impact'> & {
|
|
143
|
+
action_type: MetricsActionType;
|
|
144
|
+
};
|
|
146
145
|
[UnifiedSwapBridgeEventName.Completed]: null;
|
|
147
|
-
[UnifiedSwapBridgeEventName.Failed]:
|
|
146
|
+
[UnifiedSwapBridgeEventName.Failed]: RequestParams & RequestMetadata & TxStatusData & TradeData & Pick<QuoteFetchData, 'price_impact'> & {
|
|
147
|
+
actual_time_minutes: number;
|
|
148
|
+
action_type: MetricsActionType;
|
|
149
|
+
};
|
|
148
150
|
[UnifiedSwapBridgeEventName.AllQuotesOpened]: RequestParams & RequestMetadata & TradeData & QuoteFetchData;
|
|
149
151
|
[UnifiedSwapBridgeEventName.AllQuotesSorted]: RequestParams & RequestMetadata & TradeData & QuoteFetchData;
|
|
150
152
|
[UnifiedSwapBridgeEventName.QuoteSelected]: RequestParams & RequestMetadata & QuoteFetchData & TradeData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB;AAElE,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EAChB,wBAAoB;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,wBAAoB;AAE1D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,WAAW,CAAC;IAC7B,oBAAoB,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,oBAAoB,EAAE,aAAa,CAAC;IACpC,yBAAyB,EAAE,aAAa,GAAG,IAAI,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,eAAe,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;IAC5C,YAAY,EAAE,MAAM,CAAC;IAC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AAM,CAAC;KACvB,CAAC;IACJ,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,EAAE,eAAe,GAClE,aAAa,GACb,cAAc,GACd,SAAS,CAAC;IACZ,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,aAAa,GACnD,eAAe,GACf,SAAS,GACT,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;QACrC,WAAW,EAAE,iBAAiB,CAAC;KAChC,CAAC;IACJ,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;IAC7C,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,aAAa,GAChD,eAAe,GACf,YAAY,GACZ,SAAS,GACT,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;QACrC,mBAAmB,EAAE,MAAM,CAAC;QAC5B,WAAW,EAAE,iBAAiB,CAAC;KAChC,CAAC;IACJ,CAAC,0BAA0B,CAAC,eAAe,CAAC,EAAE,aAAa,GACzD,eAAe,GACf,SAAS,GACT,cAAc,CAAC;IACjB,CAAC,0BAA0B,CAAC,eAAe,CAAC,EAAE,aAAa,GACzD,eAAe,GACf,SAAS,GACT,cAAc,CAAC;IACjB,CAAC,0BAA0B,CAAC,aAAa,CAAC,EAAE,aAAa,GACvD,eAAe,GACf,cAAc,GACd,SAAS,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,8BAA8B,CACxC,CAAC,SAAS,0BAA0B,IAElC;IACE,WAAW,EAAE,iBAAiB,CAAC;CAChC,GACD,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -86,9 +86,7 @@ export type RequiredEventContextFromClient = {
|
|
|
86
86
|
[UnifiedSwapBridgeEventName.SnapConfirmationViewed]: Pick<QuoteFetchData, 'price_impact'> & TradeData & {
|
|
87
87
|
action_type: MetricsActionType;
|
|
88
88
|
};
|
|
89
|
-
[UnifiedSwapBridgeEventName.Submitted]:
|
|
90
|
-
action_type: MetricsActionType;
|
|
91
|
-
};
|
|
89
|
+
[UnifiedSwapBridgeEventName.Submitted]: TradeData & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;
|
|
92
90
|
[UnifiedSwapBridgeEventName.Completed]: RequestParams & RequestMetadata & TxStatusData & Pick<QuoteFetchData, 'price_impact'> & TradeData & {
|
|
93
91
|
actual_time_minutes: number;
|
|
94
92
|
usd_actual_return: number;
|
|
@@ -97,20 +95,19 @@ export type RequiredEventContextFromClient = {
|
|
|
97
95
|
quoted_vs_used_gas_ratio: number;
|
|
98
96
|
action_type: MetricsActionType;
|
|
99
97
|
};
|
|
100
|
-
[UnifiedSwapBridgeEventName.Failed]:
|
|
101
|
-
|
|
98
|
+
[UnifiedSwapBridgeEventName.Failed]: // Tx failed before confirmation
|
|
99
|
+
(TradeData & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
102
100
|
error_message: string;
|
|
101
|
+
}) | (RequestParams & RequestMetadata & Pick<QuoteFetchData, 'price_impact'> & TxStatusData & TradeData & {
|
|
102
|
+
actual_time_minutes: number;
|
|
103
|
+
error_message?: string;
|
|
103
104
|
action_type: MetricsActionType;
|
|
104
|
-
};
|
|
105
|
-
[UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & {
|
|
105
|
+
});
|
|
106
|
+
[UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
106
107
|
stx_enabled: RequestMetadata['stx_enabled'];
|
|
107
|
-
token_symbol_source: RequestParams['token_symbol_source'];
|
|
108
|
-
token_symbol_destination: RequestParams['token_symbol_destination'];
|
|
109
108
|
};
|
|
110
|
-
[UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & {
|
|
109
|
+
[UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
111
110
|
stx_enabled: RequestMetadata['stx_enabled'];
|
|
112
|
-
token_symbol_source: RequestParams['token_symbol_source'];
|
|
113
|
-
token_symbol_destination: RequestParams['token_symbol_destination'];
|
|
114
111
|
sort_order: SortOrder;
|
|
115
112
|
best_quote_provider: QuoteFetchData['best_quote_provider'];
|
|
116
113
|
};
|
|
@@ -142,9 +139,14 @@ export type EventPropertiesFromControllerState = {
|
|
|
142
139
|
error_message: string;
|
|
143
140
|
};
|
|
144
141
|
[UnifiedSwapBridgeEventName.SnapConfirmationViewed]: RequestMetadata & RequestParams & QuoteFetchData & TradeData;
|
|
145
|
-
[UnifiedSwapBridgeEventName.Submitted]:
|
|
142
|
+
[UnifiedSwapBridgeEventName.Submitted]: RequestParams & RequestMetadata & TradeData & Pick<QuoteFetchData, 'price_impact'> & {
|
|
143
|
+
action_type: MetricsActionType;
|
|
144
|
+
};
|
|
146
145
|
[UnifiedSwapBridgeEventName.Completed]: null;
|
|
147
|
-
[UnifiedSwapBridgeEventName.Failed]:
|
|
146
|
+
[UnifiedSwapBridgeEventName.Failed]: RequestParams & RequestMetadata & TxStatusData & TradeData & Pick<QuoteFetchData, 'price_impact'> & {
|
|
147
|
+
actual_time_minutes: number;
|
|
148
|
+
action_type: MetricsActionType;
|
|
149
|
+
};
|
|
148
150
|
[UnifiedSwapBridgeEventName.AllQuotesOpened]: RequestParams & RequestMetadata & TradeData & QuoteFetchData;
|
|
149
151
|
[UnifiedSwapBridgeEventName.AllQuotesSorted]: RequestParams & RequestMetadata & TradeData & QuoteFetchData;
|
|
150
152
|
[UnifiedSwapBridgeEventName.QuoteSelected]: RequestParams & RequestMetadata & QuoteFetchData & TradeData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB;AAElE,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EAChB,wBAAoB;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,wBAAoB;AAE1D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,WAAW,CAAC;IAC7B,oBAAoB,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,oBAAoB,EAAE,aAAa,CAAC;IACpC,yBAAyB,EAAE,aAAa,GAAG,IAAI,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,eAAe,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,CAAC;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CAAC,EAAE,eAAe,GAClE,aAAa,GACb,cAAc,GACd,SAAS,CAAC;IACZ,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,aAAa,GACnD,eAAe,GACf,SAAS,GACT,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;QACrC,WAAW,EAAE,iBAAiB,CAAC;KAChC,CAAC;IACJ,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;IAC7C,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,aAAa,GAChD,eAAe,GACf,YAAY,GACZ,SAAS,GACT,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;QACrC,mBAAmB,EAAE,MAAM,CAAC;QAC5B,WAAW,EAAE,iBAAiB,CAAC;KAChC,CAAC;IACJ,CAAC,0BAA0B,CAAC,eAAe,CAAC,EAAE,aAAa,GACzD,eAAe,GACf,SAAS,GACT,cAAc,CAAC;IACjB,CAAC,0BAA0B,CAAC,eAAe,CAAC,EAAE,aAAa,GACzD,eAAe,GACf,SAAS,GACT,cAAc,CAAC;IACjB,CAAC,0BAA0B,CAAC,aAAa,CAAC,EAAE,aAAa,GACvD,eAAe,GACf,cAAc,GACd,SAAS,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,8BAA8B,CACxC,CAAC,SAAS,0BAA0B,IAElC;IACE,WAAW,EAAE,iBAAiB,CAAC;CAChC,GACD,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n UnifiedSwapBridgeEventName,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n} from './constants';\nimport type { SortOrder, StatusTypes } from '../../types';\n\n/**\n * These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml\n */\nexport type RequestParams = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n token_symbol_source: string;\n token_symbol_destination: string | null;\n token_address_source: CaipAssetType;\n token_address_destination: CaipAssetType | null;\n};\n\nexport type RequestMetadata = {\n slippage_limit?: number; // undefined === auto\n custom_slippage: boolean;\n usd_amount_source: number; // Use quoteResponse when available\n stx_enabled: boolean;\n is_hardware_wallet: boolean;\n swap_type: MetricsSwapType;\n security_warnings: string[];\n};\n\nexport type QuoteFetchData = {\n can_submit: boolean;\n best_quote_provider?: `${string}_${string}`;\n quotes_count: number;\n quotes_list: `${string}_${string}`[];\n initial_load_time_all_quotes: number;\n price_impact: number;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n quoted_time_minutes: number;\n usd_quoted_return: number;\n provider: `${string}_${string}`;\n};\n\nexport type TxStatusData = {\n allowance_reset_transaction?: StatusTypes;\n approval_transaction?: StatusTypes;\n source_transaction?: StatusTypes;\n destination_transaction?: StatusTypes;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called\n */\nexport type RequiredEventContextFromClient = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: {\n location: MetaMetricsSwapsEventSource;\n } & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;\n // When type is object, the payload can be anything\n [UnifiedSwapBridgeEventName.PageViewed]: object;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input:\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n value: InputValues[keyof InputValues];\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationFlipped]: {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_address_source: RequestParams['token_address_source'];\n token_address_destination: RequestParams['token_address_destination'];\n chain_id_source: RequestParams['chain_id_source'];\n chain_id_destination: RequestParams['chain_id_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n [UnifiedSwapBridgeEventName.QuotesRequested]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & {\n warnings: string[]; // TODO standardize warnings\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n };\n [UnifiedSwapBridgeEventName.QuoteError]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n // Emitted by BridgeStatusController\n [UnifiedSwapBridgeEventName.SnapConfirmationViewed]: Pick<\n QuoteFetchData,\n 'price_impact'\n > &\n TradeData & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Submitted]:
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n UnifiedSwapBridgeEventName,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n} from './constants';\nimport type { SortOrder, StatusTypes } from '../../types';\n\n/**\n * These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml\n */\nexport type RequestParams = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n token_symbol_source: string;\n token_symbol_destination: string | null;\n token_address_source: CaipAssetType;\n token_address_destination: CaipAssetType | null;\n};\n\nexport type RequestMetadata = {\n slippage_limit?: number; // undefined === auto\n custom_slippage: boolean;\n usd_amount_source: number; // Use quoteResponse when available\n stx_enabled: boolean;\n is_hardware_wallet: boolean;\n swap_type: MetricsSwapType;\n security_warnings: string[];\n};\n\nexport type QuoteFetchData = {\n can_submit: boolean;\n best_quote_provider?: `${string}_${string}`;\n quotes_count: number;\n quotes_list: `${string}_${string}`[];\n initial_load_time_all_quotes: number;\n price_impact: number;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n quoted_time_minutes: number;\n usd_quoted_return: number;\n provider: `${string}_${string}`;\n};\n\nexport type TxStatusData = {\n allowance_reset_transaction?: StatusTypes;\n approval_transaction?: StatusTypes;\n source_transaction?: StatusTypes;\n destination_transaction?: StatusTypes;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called\n */\nexport type RequiredEventContextFromClient = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: {\n location: MetaMetricsSwapsEventSource;\n } & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;\n // When type is object, the payload can be anything\n [UnifiedSwapBridgeEventName.PageViewed]: object;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input:\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n value: InputValues[keyof InputValues];\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationFlipped]: {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_address_source: RequestParams['token_address_source'];\n token_address_destination: RequestParams['token_address_destination'];\n chain_id_source: RequestParams['chain_id_source'];\n chain_id_destination: RequestParams['chain_id_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n [UnifiedSwapBridgeEventName.QuotesRequested]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & {\n warnings: string[]; // TODO standardize warnings\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n };\n [UnifiedSwapBridgeEventName.QuoteError]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n // Emitted by BridgeStatusController\n [UnifiedSwapBridgeEventName.SnapConfirmationViewed]: Pick<\n QuoteFetchData,\n 'price_impact'\n > &\n TradeData & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;\n [UnifiedSwapBridgeEventName.Completed]: RequestParams &\n RequestMetadata &\n TxStatusData &\n Pick<QuoteFetchData, 'price_impact'> &\n TradeData & {\n actual_time_minutes: number;\n usd_actual_return: number;\n usd_actual_gas: number;\n quote_vs_execution_ratio: number;\n quoted_vs_used_gas_ratio: number;\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Failed]:\n | // Tx failed before confirmation\n (TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source'> &\n Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { error_message: string }) // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n Pick<QuoteFetchData, 'price_impact'> &\n TxStatusData &\n TradeData & {\n actual_time_minutes: number;\n error_message?: string;\n action_type: MetricsActionType;\n });\n // Emitted by clients\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n };\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n sort_order: SortOrder;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n };\n [UnifiedSwapBridgeEventName.QuoteSelected]: TradeData & {\n is_best_quote: boolean;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n };\n};\n\n/**\n * Properties that can be derived from the bridge controller state\n */\nexport type EventPropertiesFromControllerState = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: RequestParams;\n [UnifiedSwapBridgeEventName.PageViewed]: RequestParams;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n value: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationFlipped]: RequestParams;\n [UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData & {\n refresh_count: number; // starts from 0\n };\n [UnifiedSwapBridgeEventName.QuoteError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.SnapConfirmationViewed]: RequestMetadata &\n RequestParams &\n QuoteFetchData &\n TradeData;\n [UnifiedSwapBridgeEventName.Submitted]: RequestParams &\n RequestMetadata &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Completed]: null;\n [UnifiedSwapBridgeEventName.Failed]: RequestParams &\n RequestMetadata &\n TxStatusData &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n actual_time_minutes: number;\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.QuoteSelected]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData;\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n action_type: MetricsActionType;\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/bridge-controller",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "33.0.1",
|
|
4
4
|
"description": "Manages bridge-related quote fetching functionality for MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -54,26 +54,26 @@
|
|
|
54
54
|
"@ethersproject/providers": "^5.7.0",
|
|
55
55
|
"@metamask/base-controller": "^8.0.1",
|
|
56
56
|
"@metamask/controller-utils": "^11.10.0",
|
|
57
|
-
"@metamask/gas-fee-controller": "^
|
|
57
|
+
"@metamask/gas-fee-controller": "^24.0.0",
|
|
58
58
|
"@metamask/keyring-api": "^18.0.0",
|
|
59
59
|
"@metamask/metamask-eth-abis": "^3.1.1",
|
|
60
|
-
"@metamask/multichain-network-controller": "^0.
|
|
61
|
-
"@metamask/polling-controller": "^
|
|
60
|
+
"@metamask/multichain-network-controller": "^0.9.0",
|
|
61
|
+
"@metamask/polling-controller": "^14.0.0",
|
|
62
62
|
"@metamask/utils": "^11.2.0",
|
|
63
63
|
"bignumber.js": "^9.1.2",
|
|
64
64
|
"reselect": "^5.1.1",
|
|
65
65
|
"uuid": "^8.3.2"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@metamask/accounts-controller": "^
|
|
69
|
-
"@metamask/assets-controllers": "^
|
|
68
|
+
"@metamask/accounts-controller": "^31.0.0",
|
|
69
|
+
"@metamask/assets-controllers": "^69.0.0",
|
|
70
70
|
"@metamask/auto-changelog": "^3.4.4",
|
|
71
71
|
"@metamask/eth-json-rpc-provider": "^4.1.8",
|
|
72
|
-
"@metamask/network-controller": "^
|
|
72
|
+
"@metamask/network-controller": "^24.0.0",
|
|
73
73
|
"@metamask/remote-feature-flag-controller": "^1.6.0",
|
|
74
74
|
"@metamask/snaps-controllers": "^12.3.1",
|
|
75
75
|
"@metamask/superstruct": "^3.1.0",
|
|
76
|
-
"@metamask/transaction-controller": "^
|
|
76
|
+
"@metamask/transaction-controller": "^58.0.0",
|
|
77
77
|
"@types/jest": "^27.4.1",
|
|
78
78
|
"deepmerge": "^4.2.2",
|
|
79
79
|
"jest": "^27.5.1",
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
"typescript": "~5.2.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@metamask/accounts-controller": "^
|
|
90
|
-
"@metamask/assets-controllers": "^
|
|
91
|
-
"@metamask/network-controller": "^
|
|
89
|
+
"@metamask/accounts-controller": "^31.0.0",
|
|
90
|
+
"@metamask/assets-controllers": "^69.0.0",
|
|
91
|
+
"@metamask/network-controller": "^24.0.0",
|
|
92
92
|
"@metamask/remote-feature-flag-controller": "^1.6.0",
|
|
93
93
|
"@metamask/snaps-controllers": "^12.0.0",
|
|
94
|
-
"@metamask/transaction-controller": "^
|
|
94
|
+
"@metamask/transaction-controller": "^58.0.0"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": "^18.18 || >=20"
|