@metamask/bridge-controller 75.2.0 → 76.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -1
- package/dist/bridge-controller-method-action-types.cjs.map +1 -1
- package/dist/bridge-controller-method-action-types.d.cts +5 -1
- package/dist/bridge-controller-method-action-types.d.cts.map +1 -1
- package/dist/bridge-controller-method-action-types.d.mts +5 -1
- package/dist/bridge-controller-method-action-types.d.mts.map +1 -1
- package/dist/bridge-controller-method-action-types.mjs.map +1 -1
- package/dist/bridge-controller.cjs +24 -0
- package/dist/bridge-controller.cjs.map +1 -1
- package/dist/bridge-controller.d.cts +2 -1
- package/dist/bridge-controller.d.cts.map +1 -1
- package/dist/bridge-controller.d.mts +2 -1
- package/dist/bridge-controller.d.mts.map +1 -1
- package/dist/bridge-controller.mjs +24 -0
- package/dist/bridge-controller.mjs.map +1 -1
- package/dist/constants/bridge.cjs +1 -0
- package/dist/constants/bridge.cjs.map +1 -1
- package/dist/constants/bridge.d.cts.map +1 -1
- package/dist/constants/bridge.d.mts.map +1 -1
- package/dist/constants/bridge.mjs +1 -0
- package/dist/constants/bridge.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +7 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +7 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/metrics/constants.cjs +1 -0
- package/dist/utils/metrics/constants.cjs.map +1 -1
- package/dist/utils/metrics/constants.d.cts +1 -0
- package/dist/utils/metrics/constants.d.cts.map +1 -1
- package/dist/utils/metrics/constants.d.mts +1 -0
- package/dist/utils/metrics/constants.d.mts.map +1 -1
- package/dist/utils/metrics/constants.mjs +1 -0
- package/dist/utils/metrics/constants.mjs.map +1 -1
- package/dist/utils/metrics/types.cjs.map +1 -1
- package/dist/utils/metrics/types.d.cts +25 -9
- package/dist/utils/metrics/types.d.cts.map +1 -1
- package/dist/utils/metrics/types.d.mts +25 -9
- package/dist/utils/metrics/types.d.mts.map +1 -1
- package/dist/utils/metrics/types.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type { FeatureId, SortOrder, StatusTypes } from '../../types';\nimport type {\n UnifiedSwapBridgeEventName,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants';\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 * Client-supplied security classification for the destination token\n * (e.g. from token security/scanning data). Stored on the controller\n * and merged into every analytics event that includes\n * `token_address_destination`. Pass `null` when no security data is\n * available for the selected destination token.\n */\n token_security_type_destination: string | null;\n};\n\nexport type AccountHardwareType =\n | 'Ledger'\n | 'Trezor'\n | 'QR Hardware'\n | 'Lattice'\n | null;\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 account_hardware_type: AccountHardwareType;\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 has_gas_included_quote: boolean;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n gas_included_7702: 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 | 'token_amount_source';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n token_amount_source: string;\n};\n\nexport type QuoteWarning =\n | 'low_return'\n | 'no_quotes'\n | 'insufficient_gas_balance'\n | 'insufficient_gas_for_selected_quote'\n | 'insufficient_balance'\n | 'market_closed'\n | 'price_impact'\n | 'quote_expired'\n | 'tx_alert';\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This is the base type without the `location` property which is added to all events\n * via the RequiredEventContextFromClient mapped type.\n */\ntype RequiredEventContextFromClientBase = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { environment_type?: string };\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 | 'token_amount_source';\n input_value: InputValues[keyof InputValues];\n input_amount_preset?: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {\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 token_security_type_destination: RequestParams['token_security_type_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' | 'usd_amount_source'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_security_type_destination: RequestParams['token_security_type_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n warnings: QuoteWarning[];\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n usd_balance_source?: number;\n has_sufficient_gas_for_quote?: boolean | null;\n };\n [UnifiedSwapBridgeEventName.QuotesError]: 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.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'token_address_source'\n | 'token_address_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n | 'token_security_type_destination'\n > & {\n action_type: MetricsActionType;\n batch_id?: string;\n };\n [UnifiedSwapBridgeEventName.Completed]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n TxStatusData &\n RequestParams & {\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 batch_id?: string;\n };\n [UnifiedSwapBridgeEventName.Failed]: (\n | // Tx failed before confirmation\n (Pick<\n RequestMetadata,\n | 'stx_enabled'\n | 'usd_amount_source'\n | 'is_hardware_wallet'\n | 'account_hardware_type'\n > &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'token_address_source'\n | 'token_address_destination'\n | 'token_security_type_destination'\n >)\n // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n TxStatusData & {\n actual_time_minutes: number;\n })\n ) &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n error_message: string;\n batch_id?: string;\n };\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: {\n polling_status: PollingStatus;\n retry_attempts: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: {\n failures: string[];\n refresh_count: number;\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 can_submit: QuoteFetchData['can_submit'];\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 can_submit: QuoteFetchData['can_submit'];\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 can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: {\n token_name: string;\n token_symbol: string;\n token_contract: string;\n chain_name: string;\n chain_id: string;\n };\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: {\n failures: string[];\n };\n [UnifiedSwapBridgeEventName.AssetPickerOpened]: {\n asset_location: 'source' | 'destination';\n };\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This combines the event-specific properties from RequiredEventContextFromClientBase\n * with an optional `location` property. When `location` is omitted, the controller\n * falls back to the value stored via `setLocation()` (defaults to MainView).\n *\n * `ab_tests` is the legacy field and `active_ab_tests` is the newer field.\n * Both are kept for a migration window and are treated as separate payloads.\n */\nexport type RequiredEventContextFromClient = {\n [K in keyof RequiredEventContextFromClientBase]: RequiredEventContextFromClientBase[K] & {\n location?: MetaMetricsSwapsEventSource;\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n feature_id: FeatureId;\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 Omit<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source' | 'security_warnings'\n >;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n input_value: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: 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.QuotesError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.Submitted]: null;\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 };\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 [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;\n [UnifiedSwapBridgeEventName.AssetPickerOpened]: null;\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n batch_id?: string;\n };\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n *\n * `ab_tests` will be deprecated in favor of `active_ab_tests` in the future.\n * `ab_tests` and `active_ab_tests` intentionally coexist during migration.\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n feature_id: FeatureId;\n action_type: MetricsActionType;\n location: MetaMetricsSwapsEventSource;\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n FeatureId,\n InputPrimaryDenomination,\n SortOrder,\n StatusTypes,\n} from '../../types';\nimport type {\n UnifiedSwapBridgeEventName,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants';\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 * Client-supplied security classification for the destination token\n * (e.g. from token security/scanning data). Stored on the controller\n * and merged into every analytics event that includes\n * `token_address_destination`. Pass `null` when no security data is\n * available for the selected destination token.\n */\n token_security_type_destination: string | null;\n};\n\nexport type AccountHardwareType =\n | 'Ledger'\n | 'Trezor'\n | 'QR Hardware'\n | 'Lattice'\n | null;\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 account_hardware_type: AccountHardwareType;\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 has_gas_included_quote: boolean;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n gas_included_7702: 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 InputPrimaryDenominationData = {\n input_primary_denomination?: InputPrimaryDenomination;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage'\n | 'token_amount_source';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n token_amount_source: string;\n};\n\nexport type QuoteWarning =\n | 'low_return'\n | 'no_quotes'\n | 'insufficient_gas_balance'\n | 'insufficient_gas_for_selected_quote'\n | 'insufficient_balance'\n | 'market_closed'\n | 'price_impact'\n | 'quote_expired'\n | 'tx_alert';\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This is the base type without the `location` property which is added to all events\n * via the RequiredEventContextFromClient mapped type.\n */\ntype RequiredEventContextFromClientBase = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { environment_type?: string };\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 | 'token_amount_source';\n input_value: InputValues[keyof InputValues];\n input_amount_preset?: string;\n };\n [UnifiedSwapBridgeEventName.FiatCryptoToggleClicked]: {\n token_symbol_source: string;\n token_symbol_destination: string | null;\n previous_primary_denomination: InputPrimaryDenomination;\n new_primary_denomination: InputPrimaryDenomination;\n chain_id_source?: RequestParams['chain_id_source'];\n chain_id_destination?: RequestParams['chain_id_destination'];\n token_address_source?: RequestParams['token_address_source'];\n token_address_destination?: RequestParams['token_address_destination'];\n token_security_type_destination?: RequestParams['token_security_type_destination'];\n swap_type?: RequestMetadata['swap_type'];\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {\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 token_security_type_destination: RequestParams['token_security_type_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' | 'usd_amount_source'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_security_type_destination: RequestParams['token_security_type_destination'];\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> &\n InputPrimaryDenominationData & {\n warnings: QuoteWarning[];\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n usd_balance_source?: number;\n has_sufficient_gas_for_quote?: boolean | null;\n };\n [UnifiedSwapBridgeEventName.QuotesError]: 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.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'token_address_source'\n | 'token_address_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n | 'token_security_type_destination'\n > & {\n action_type: MetricsActionType;\n batch_id?: string;\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.Completed]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n TxStatusData &\n RequestParams & {\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 batch_id?: string;\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.Failed]: (\n | // Tx failed before confirmation\n (Pick<\n RequestMetadata,\n | 'stx_enabled'\n | 'usd_amount_source'\n | 'is_hardware_wallet'\n | 'account_hardware_type'\n > &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'token_address_source'\n | 'token_address_destination'\n | 'token_security_type_destination'\n >)\n // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n TxStatusData & {\n actual_time_minutes: number;\n })\n ) &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n error_message: string;\n batch_id?: string;\n };\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: {\n polling_status: PollingStatus;\n retry_attempts: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: {\n failures: string[];\n refresh_count: number;\n } & Partial<RequestParams>;\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 can_submit: QuoteFetchData['can_submit'];\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 can_submit: QuoteFetchData['can_submit'];\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 can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: {\n token_name: string;\n token_symbol: string;\n token_contract: string;\n chain_name: string;\n chain_id: string;\n };\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: {\n failures: string[];\n };\n [UnifiedSwapBridgeEventName.AssetPickerOpened]: {\n asset_location: 'source' | 'destination';\n };\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This combines the event-specific properties from RequiredEventContextFromClientBase\n * with an optional `location` property. When `location` is omitted, the controller\n * falls back to the value stored via `setLocation()` (defaults to MainView).\n *\n * `ab_tests` is the legacy field and `active_ab_tests` is the newer field.\n * Both are kept for a migration window and are treated as separate payloads.\n */\nexport type RequiredEventContextFromClient = {\n [K in keyof RequiredEventContextFromClientBase]: RequiredEventContextFromClientBase[K] & {\n location?: MetaMetricsSwapsEventSource;\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n feature_id: FeatureId;\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 Omit<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source' | 'security_warnings'\n > &\n InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n input_value: string;\n };\n [UnifiedSwapBridgeEventName.FiatCryptoToggleClicked]: RequestParams &\n Pick<RequestMetadata, 'swap_type'>;\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: RequestParams;\n [UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData & {\n refresh_count: number; // starts from 0\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.QuotesError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.Submitted]: null;\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 };\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 [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;\n [UnifiedSwapBridgeEventName.AssetPickerOpened]: null;\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n batch_id?: string;\n };\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n *\n * `ab_tests` will be deprecated in favor of `active_ab_tests` in the future.\n * `ab_tests` and `active_ab_tests` intentionally coexist during migration.\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n feature_id: FeatureId;\n action_type: MetricsActionType;\n location: MetaMetricsSwapsEventSource;\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CaipAssetType, CaipChainId } from "@metamask/utils";
|
|
2
|
-
import type { FeatureId, SortOrder, StatusTypes } from "../../types.cjs";
|
|
2
|
+
import type { FeatureId, InputPrimaryDenomination, SortOrder, StatusTypes } from "../../types.cjs";
|
|
3
3
|
import type { UnifiedSwapBridgeEventName, MetaMetricsSwapsEventSource, MetricsActionType, MetricsSwapType, PollingStatus } from "./constants.cjs";
|
|
4
4
|
/**
|
|
5
5
|
* 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
|
|
@@ -54,6 +54,9 @@ export type TxStatusData = {
|
|
|
54
54
|
source_transaction?: StatusTypes;
|
|
55
55
|
destination_transaction?: StatusTypes;
|
|
56
56
|
};
|
|
57
|
+
export type InputPrimaryDenominationData = {
|
|
58
|
+
input_primary_denomination?: InputPrimaryDenomination;
|
|
59
|
+
};
|
|
57
60
|
export type InputKeys = 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage' | 'token_amount_source';
|
|
58
61
|
export type InputValues = {
|
|
59
62
|
token_source: CaipAssetType;
|
|
@@ -79,6 +82,18 @@ type RequiredEventContextFromClientBase = {
|
|
|
79
82
|
input_value: InputValues[keyof InputValues];
|
|
80
83
|
input_amount_preset?: string;
|
|
81
84
|
};
|
|
85
|
+
[UnifiedSwapBridgeEventName.FiatCryptoToggleClicked]: {
|
|
86
|
+
token_symbol_source: string;
|
|
87
|
+
token_symbol_destination: string | null;
|
|
88
|
+
previous_primary_denomination: InputPrimaryDenomination;
|
|
89
|
+
new_primary_denomination: InputPrimaryDenomination;
|
|
90
|
+
chain_id_source?: RequestParams['chain_id_source'];
|
|
91
|
+
chain_id_destination?: RequestParams['chain_id_destination'];
|
|
92
|
+
token_address_source?: RequestParams['token_address_source'];
|
|
93
|
+
token_address_destination?: RequestParams['token_address_destination'];
|
|
94
|
+
token_security_type_destination?: RequestParams['token_security_type_destination'];
|
|
95
|
+
swap_type?: RequestMetadata['swap_type'];
|
|
96
|
+
};
|
|
82
97
|
[UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {
|
|
83
98
|
token_symbol_source: RequestParams['token_symbol_source'];
|
|
84
99
|
token_symbol_destination: RequestParams['token_symbol_destination'];
|
|
@@ -92,8 +107,8 @@ type RequiredEventContextFromClientBase = {
|
|
|
92
107
|
token_symbol_source: RequestParams['token_symbol_source'];
|
|
93
108
|
token_symbol_destination: RequestParams['token_symbol_destination'];
|
|
94
109
|
token_security_type_destination: RequestParams['token_security_type_destination'];
|
|
95
|
-
};
|
|
96
|
-
[UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
110
|
+
} & InputPrimaryDenominationData;
|
|
111
|
+
[UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & InputPrimaryDenominationData & {
|
|
97
112
|
warnings: QuoteWarning[];
|
|
98
113
|
best_quote_provider: QuoteFetchData['best_quote_provider'];
|
|
99
114
|
price_impact: QuoteFetchData['price_impact'];
|
|
@@ -108,7 +123,7 @@ type RequiredEventContextFromClientBase = {
|
|
|
108
123
|
[UnifiedSwapBridgeEventName.Submitted]: TradeData & Pick<QuoteFetchData, 'price_impact'> & Omit<RequestMetadata, 'security_warnings'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination' | 'token_address_source' | 'token_address_destination' | 'chain_id_source' | 'chain_id_destination' | 'token_security_type_destination'> & {
|
|
109
124
|
action_type: MetricsActionType;
|
|
110
125
|
batch_id?: string;
|
|
111
|
-
};
|
|
126
|
+
} & InputPrimaryDenominationData;
|
|
112
127
|
[UnifiedSwapBridgeEventName.Completed]: TradeData & Pick<QuoteFetchData, 'price_impact'> & Omit<RequestMetadata, 'security_warnings'> & TxStatusData & RequestParams & {
|
|
113
128
|
actual_time_minutes: number;
|
|
114
129
|
usd_actual_return: number;
|
|
@@ -117,7 +132,7 @@ type RequiredEventContextFromClientBase = {
|
|
|
117
132
|
quoted_vs_used_gas_ratio: number;
|
|
118
133
|
action_type: MetricsActionType;
|
|
119
134
|
batch_id?: string;
|
|
120
|
-
};
|
|
135
|
+
} & InputPrimaryDenominationData;
|
|
121
136
|
[UnifiedSwapBridgeEventName.Failed]: (// Tx failed before confirmation
|
|
122
137
|
(Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source' | 'is_hardware_wallet' | 'account_hardware_type'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination' | 'token_address_source' | 'token_address_destination' | 'token_security_type_destination'>) | (RequestParams & RequestMetadata & TxStatusData & {
|
|
123
138
|
actual_time_minutes: number;
|
|
@@ -132,7 +147,7 @@ type RequiredEventContextFromClientBase = {
|
|
|
132
147
|
[UnifiedSwapBridgeEventName.StatusValidationFailed]: {
|
|
133
148
|
failures: string[];
|
|
134
149
|
refresh_count: number;
|
|
135
|
-
}
|
|
150
|
+
} & Partial<RequestParams>;
|
|
136
151
|
[UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
137
152
|
stx_enabled: RequestMetadata['stx_enabled'];
|
|
138
153
|
can_submit: QuoteFetchData['can_submit'];
|
|
@@ -188,18 +203,19 @@ export type RequiredEventContextFromClient = {
|
|
|
188
203
|
*/
|
|
189
204
|
export type EventPropertiesFromControllerState = {
|
|
190
205
|
[UnifiedSwapBridgeEventName.ButtonClicked]: RequestParams;
|
|
191
|
-
[UnifiedSwapBridgeEventName.PageViewed]: RequestParams & Omit<RequestMetadata, 'stx_enabled' | 'usd_amount_source' | 'security_warnings'
|
|
206
|
+
[UnifiedSwapBridgeEventName.PageViewed]: RequestParams & Omit<RequestMetadata, 'stx_enabled' | 'usd_amount_source' | 'security_warnings'> & InputPrimaryDenominationData;
|
|
192
207
|
[UnifiedSwapBridgeEventName.InputChanged]: {
|
|
193
208
|
input: InputKeys;
|
|
194
209
|
input_value: string;
|
|
195
210
|
};
|
|
211
|
+
[UnifiedSwapBridgeEventName.FiatCryptoToggleClicked]: RequestParams & Pick<RequestMetadata, 'swap_type'>;
|
|
196
212
|
[UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: RequestParams;
|
|
197
213
|
[UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams & RequestMetadata & {
|
|
198
214
|
has_sufficient_funds: boolean;
|
|
199
|
-
};
|
|
215
|
+
} & InputPrimaryDenominationData;
|
|
200
216
|
[UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams & RequestMetadata & QuoteFetchData & TradeData & {
|
|
201
217
|
refresh_count: number;
|
|
202
|
-
};
|
|
218
|
+
} & InputPrimaryDenominationData;
|
|
203
219
|
[UnifiedSwapBridgeEventName.QuotesError]: RequestParams & RequestMetadata & {
|
|
204
220
|
has_sufficient_funds: boolean;
|
|
205
221
|
error_message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB;AAElE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB;AAElE,OAAO,KAAK,EACV,SAAS,EACT,wBAAwB,EACxB,SAAS,EACT,WAAW,EACZ,wBAAoB;AACrB,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EACf,aAAa,EACd,wBAAoB;AAErB;;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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AAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,2BAA2B,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,eAAe,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpD,GACD,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CaipAssetType, CaipChainId } from "@metamask/utils";
|
|
2
|
-
import type { FeatureId, SortOrder, StatusTypes } from "../../types.mjs";
|
|
2
|
+
import type { FeatureId, InputPrimaryDenomination, SortOrder, StatusTypes } from "../../types.mjs";
|
|
3
3
|
import type { UnifiedSwapBridgeEventName, MetaMetricsSwapsEventSource, MetricsActionType, MetricsSwapType, PollingStatus } from "./constants.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* 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
|
|
@@ -54,6 +54,9 @@ export type TxStatusData = {
|
|
|
54
54
|
source_transaction?: StatusTypes;
|
|
55
55
|
destination_transaction?: StatusTypes;
|
|
56
56
|
};
|
|
57
|
+
export type InputPrimaryDenominationData = {
|
|
58
|
+
input_primary_denomination?: InputPrimaryDenomination;
|
|
59
|
+
};
|
|
57
60
|
export type InputKeys = 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage' | 'token_amount_source';
|
|
58
61
|
export type InputValues = {
|
|
59
62
|
token_source: CaipAssetType;
|
|
@@ -79,6 +82,18 @@ type RequiredEventContextFromClientBase = {
|
|
|
79
82
|
input_value: InputValues[keyof InputValues];
|
|
80
83
|
input_amount_preset?: string;
|
|
81
84
|
};
|
|
85
|
+
[UnifiedSwapBridgeEventName.FiatCryptoToggleClicked]: {
|
|
86
|
+
token_symbol_source: string;
|
|
87
|
+
token_symbol_destination: string | null;
|
|
88
|
+
previous_primary_denomination: InputPrimaryDenomination;
|
|
89
|
+
new_primary_denomination: InputPrimaryDenomination;
|
|
90
|
+
chain_id_source?: RequestParams['chain_id_source'];
|
|
91
|
+
chain_id_destination?: RequestParams['chain_id_destination'];
|
|
92
|
+
token_address_source?: RequestParams['token_address_source'];
|
|
93
|
+
token_address_destination?: RequestParams['token_address_destination'];
|
|
94
|
+
token_security_type_destination?: RequestParams['token_security_type_destination'];
|
|
95
|
+
swap_type?: RequestMetadata['swap_type'];
|
|
96
|
+
};
|
|
82
97
|
[UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {
|
|
83
98
|
token_symbol_source: RequestParams['token_symbol_source'];
|
|
84
99
|
token_symbol_destination: RequestParams['token_symbol_destination'];
|
|
@@ -92,8 +107,8 @@ type RequiredEventContextFromClientBase = {
|
|
|
92
107
|
token_symbol_source: RequestParams['token_symbol_source'];
|
|
93
108
|
token_symbol_destination: RequestParams['token_symbol_destination'];
|
|
94
109
|
token_security_type_destination: RequestParams['token_security_type_destination'];
|
|
95
|
-
};
|
|
96
|
-
[UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
110
|
+
} & InputPrimaryDenominationData;
|
|
111
|
+
[UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & InputPrimaryDenominationData & {
|
|
97
112
|
warnings: QuoteWarning[];
|
|
98
113
|
best_quote_provider: QuoteFetchData['best_quote_provider'];
|
|
99
114
|
price_impact: QuoteFetchData['price_impact'];
|
|
@@ -108,7 +123,7 @@ type RequiredEventContextFromClientBase = {
|
|
|
108
123
|
[UnifiedSwapBridgeEventName.Submitted]: TradeData & Pick<QuoteFetchData, 'price_impact'> & Omit<RequestMetadata, 'security_warnings'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination' | 'token_address_source' | 'token_address_destination' | 'chain_id_source' | 'chain_id_destination' | 'token_security_type_destination'> & {
|
|
109
124
|
action_type: MetricsActionType;
|
|
110
125
|
batch_id?: string;
|
|
111
|
-
};
|
|
126
|
+
} & InputPrimaryDenominationData;
|
|
112
127
|
[UnifiedSwapBridgeEventName.Completed]: TradeData & Pick<QuoteFetchData, 'price_impact'> & Omit<RequestMetadata, 'security_warnings'> & TxStatusData & RequestParams & {
|
|
113
128
|
actual_time_minutes: number;
|
|
114
129
|
usd_actual_return: number;
|
|
@@ -117,7 +132,7 @@ type RequiredEventContextFromClientBase = {
|
|
|
117
132
|
quoted_vs_used_gas_ratio: number;
|
|
118
133
|
action_type: MetricsActionType;
|
|
119
134
|
batch_id?: string;
|
|
120
|
-
};
|
|
135
|
+
} & InputPrimaryDenominationData;
|
|
121
136
|
[UnifiedSwapBridgeEventName.Failed]: (// Tx failed before confirmation
|
|
122
137
|
(Pick<RequestMetadata, 'stx_enabled' | 'usd_amount_source' | 'is_hardware_wallet' | 'account_hardware_type'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination' | 'token_address_source' | 'token_address_destination' | 'token_security_type_destination'>) | (RequestParams & RequestMetadata & TxStatusData & {
|
|
123
138
|
actual_time_minutes: number;
|
|
@@ -132,7 +147,7 @@ type RequiredEventContextFromClientBase = {
|
|
|
132
147
|
[UnifiedSwapBridgeEventName.StatusValidationFailed]: {
|
|
133
148
|
failures: string[];
|
|
134
149
|
refresh_count: number;
|
|
135
|
-
}
|
|
150
|
+
} & Partial<RequestParams>;
|
|
136
151
|
[UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<TradeData, 'gas_included'> & Pick<QuoteFetchData, 'price_impact'> & Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {
|
|
137
152
|
stx_enabled: RequestMetadata['stx_enabled'];
|
|
138
153
|
can_submit: QuoteFetchData['can_submit'];
|
|
@@ -188,18 +203,19 @@ export type RequiredEventContextFromClient = {
|
|
|
188
203
|
*/
|
|
189
204
|
export type EventPropertiesFromControllerState = {
|
|
190
205
|
[UnifiedSwapBridgeEventName.ButtonClicked]: RequestParams;
|
|
191
|
-
[UnifiedSwapBridgeEventName.PageViewed]: RequestParams & Omit<RequestMetadata, 'stx_enabled' | 'usd_amount_source' | 'security_warnings'
|
|
206
|
+
[UnifiedSwapBridgeEventName.PageViewed]: RequestParams & Omit<RequestMetadata, 'stx_enabled' | 'usd_amount_source' | 'security_warnings'> & InputPrimaryDenominationData;
|
|
192
207
|
[UnifiedSwapBridgeEventName.InputChanged]: {
|
|
193
208
|
input: InputKeys;
|
|
194
209
|
input_value: string;
|
|
195
210
|
};
|
|
211
|
+
[UnifiedSwapBridgeEventName.FiatCryptoToggleClicked]: RequestParams & Pick<RequestMetadata, 'swap_type'>;
|
|
196
212
|
[UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: RequestParams;
|
|
197
213
|
[UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams & RequestMetadata & {
|
|
198
214
|
has_sufficient_funds: boolean;
|
|
199
|
-
};
|
|
215
|
+
} & InputPrimaryDenominationData;
|
|
200
216
|
[UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams & RequestMetadata & QuoteFetchData & TradeData & {
|
|
201
217
|
refresh_count: number;
|
|
202
|
-
};
|
|
218
|
+
} & InputPrimaryDenominationData;
|
|
203
219
|
[UnifiedSwapBridgeEventName.QuotesError]: RequestParams & RequestMetadata & {
|
|
204
220
|
has_sufficient_funds: boolean;
|
|
205
221
|
error_message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB;AAElE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/ut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,CAAC;IACnE,CAAC,0BAA0B,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACrD,CAAC,0BAA0B,CAAC,oBAAoB,CAAC,EAAE,SAAS,GAC1D,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GACpC,IAAI,CAAC,eAAe,EAAE,mBAAmB,CAAC,GAC1C,IAAI,CACF,aAAa,EACX,qBAAqB,GACrB,0BAA0B,GAC1B,iBAAiB,GACjB,sBAAsB,CACzB,GAAG;QACF,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACL,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,8BAA8B,CACxC,CAAC,SAAS,0BAA0B,IAElC;IACE,UAAU,EAAE,SAAS,CAAC;IACtB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,2BAA2B,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,eAAe,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpD,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":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type { FeatureId, SortOrder, StatusTypes } from '../../types';\nimport type {\n UnifiedSwapBridgeEventName,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants';\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 * Client-supplied security classification for the destination token\n * (e.g. from token security/scanning data). Stored on the controller\n * and merged into every analytics event that includes\n * `token_address_destination`. Pass `null` when no security data is\n * available for the selected destination token.\n */\n token_security_type_destination: string | null;\n};\n\nexport type AccountHardwareType =\n | 'Ledger'\n | 'Trezor'\n | 'QR Hardware'\n | 'Lattice'\n | null;\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 account_hardware_type: AccountHardwareType;\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 has_gas_included_quote: boolean;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n gas_included_7702: 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 | 'token_amount_source';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n token_amount_source: string;\n};\n\nexport type QuoteWarning =\n | 'low_return'\n | 'no_quotes'\n | 'insufficient_gas_balance'\n | 'insufficient_gas_for_selected_quote'\n | 'insufficient_balance'\n | 'market_closed'\n | 'price_impact'\n | 'quote_expired'\n | 'tx_alert';\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This is the base type without the `location` property which is added to all events\n * via the RequiredEventContextFromClient mapped type.\n */\ntype RequiredEventContextFromClientBase = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { environment_type?: string };\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 | 'token_amount_source';\n input_value: InputValues[keyof InputValues];\n input_amount_preset?: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {\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 token_security_type_destination: RequestParams['token_security_type_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' | 'usd_amount_source'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_security_type_destination: RequestParams['token_security_type_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n warnings: QuoteWarning[];\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n usd_balance_source?: number;\n has_sufficient_gas_for_quote?: boolean | null;\n };\n [UnifiedSwapBridgeEventName.QuotesError]: 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.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'token_address_source'\n | 'token_address_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n | 'token_security_type_destination'\n > & {\n action_type: MetricsActionType;\n batch_id?: string;\n };\n [UnifiedSwapBridgeEventName.Completed]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n TxStatusData &\n RequestParams & {\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 batch_id?: string;\n };\n [UnifiedSwapBridgeEventName.Failed]: (\n | // Tx failed before confirmation\n (Pick<\n RequestMetadata,\n | 'stx_enabled'\n | 'usd_amount_source'\n | 'is_hardware_wallet'\n | 'account_hardware_type'\n > &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'token_address_source'\n | 'token_address_destination'\n | 'token_security_type_destination'\n >)\n // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n TxStatusData & {\n actual_time_minutes: number;\n })\n ) &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n error_message: string;\n batch_id?: string;\n };\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: {\n polling_status: PollingStatus;\n retry_attempts: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: {\n failures: string[];\n refresh_count: number;\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 can_submit: QuoteFetchData['can_submit'];\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 can_submit: QuoteFetchData['can_submit'];\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 can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: {\n token_name: string;\n token_symbol: string;\n token_contract: string;\n chain_name: string;\n chain_id: string;\n };\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: {\n failures: string[];\n };\n [UnifiedSwapBridgeEventName.AssetPickerOpened]: {\n asset_location: 'source' | 'destination';\n };\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This combines the event-specific properties from RequiredEventContextFromClientBase\n * with an optional `location` property. When `location` is omitted, the controller\n * falls back to the value stored via `setLocation()` (defaults to MainView).\n *\n * `ab_tests` is the legacy field and `active_ab_tests` is the newer field.\n * Both are kept for a migration window and are treated as separate payloads.\n */\nexport type RequiredEventContextFromClient = {\n [K in keyof RequiredEventContextFromClientBase]: RequiredEventContextFromClientBase[K] & {\n location?: MetaMetricsSwapsEventSource;\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n feature_id: FeatureId;\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 Omit<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source' | 'security_warnings'\n >;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n input_value: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: 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.QuotesError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.Submitted]: null;\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 };\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 [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;\n [UnifiedSwapBridgeEventName.AssetPickerOpened]: null;\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n batch_id?: string;\n };\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n *\n * `ab_tests` will be deprecated in favor of `active_ab_tests` in the future.\n * `ab_tests` and `active_ab_tests` intentionally coexist during migration.\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n feature_id: FeatureId;\n action_type: MetricsActionType;\n location: MetaMetricsSwapsEventSource;\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n FeatureId,\n InputPrimaryDenomination,\n SortOrder,\n StatusTypes,\n} from '../../types';\nimport type {\n UnifiedSwapBridgeEventName,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants';\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 * Client-supplied security classification for the destination token\n * (e.g. from token security/scanning data). Stored on the controller\n * and merged into every analytics event that includes\n * `token_address_destination`. Pass `null` when no security data is\n * available for the selected destination token.\n */\n token_security_type_destination: string | null;\n};\n\nexport type AccountHardwareType =\n | 'Ledger'\n | 'Trezor'\n | 'QR Hardware'\n | 'Lattice'\n | null;\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 account_hardware_type: AccountHardwareType;\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 has_gas_included_quote: boolean;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n gas_included_7702: 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 InputPrimaryDenominationData = {\n input_primary_denomination?: InputPrimaryDenomination;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage'\n | 'token_amount_source';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n token_amount_source: string;\n};\n\nexport type QuoteWarning =\n | 'low_return'\n | 'no_quotes'\n | 'insufficient_gas_balance'\n | 'insufficient_gas_for_selected_quote'\n | 'insufficient_balance'\n | 'market_closed'\n | 'price_impact'\n | 'quote_expired'\n | 'tx_alert';\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This is the base type without the `location` property which is added to all events\n * via the RequiredEventContextFromClient mapped type.\n */\ntype RequiredEventContextFromClientBase = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { environment_type?: string };\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 | 'token_amount_source';\n input_value: InputValues[keyof InputValues];\n input_amount_preset?: string;\n };\n [UnifiedSwapBridgeEventName.FiatCryptoToggleClicked]: {\n token_symbol_source: string;\n token_symbol_destination: string | null;\n previous_primary_denomination: InputPrimaryDenomination;\n new_primary_denomination: InputPrimaryDenomination;\n chain_id_source?: RequestParams['chain_id_source'];\n chain_id_destination?: RequestParams['chain_id_destination'];\n token_address_source?: RequestParams['token_address_source'];\n token_address_destination?: RequestParams['token_address_destination'];\n token_security_type_destination?: RequestParams['token_security_type_destination'];\n swap_type?: RequestMetadata['swap_type'];\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {\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 token_security_type_destination: RequestParams['token_security_type_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' | 'usd_amount_source'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_security_type_destination: RequestParams['token_security_type_destination'];\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> &\n InputPrimaryDenominationData & {\n warnings: QuoteWarning[];\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n usd_balance_source?: number;\n has_sufficient_gas_for_quote?: boolean | null;\n };\n [UnifiedSwapBridgeEventName.QuotesError]: 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.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'token_address_source'\n | 'token_address_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n | 'token_security_type_destination'\n > & {\n action_type: MetricsActionType;\n batch_id?: string;\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.Completed]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n TxStatusData &\n RequestParams & {\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 batch_id?: string;\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.Failed]: (\n | // Tx failed before confirmation\n (Pick<\n RequestMetadata,\n | 'stx_enabled'\n | 'usd_amount_source'\n | 'is_hardware_wallet'\n | 'account_hardware_type'\n > &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'token_address_source'\n | 'token_address_destination'\n | 'token_security_type_destination'\n >)\n // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n TxStatusData & {\n actual_time_minutes: number;\n })\n ) &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n error_message: string;\n batch_id?: string;\n };\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: {\n polling_status: PollingStatus;\n retry_attempts: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: {\n failures: string[];\n refresh_count: number;\n } & Partial<RequestParams>;\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 can_submit: QuoteFetchData['can_submit'];\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 can_submit: QuoteFetchData['can_submit'];\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 can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: {\n token_name: string;\n token_symbol: string;\n token_contract: string;\n chain_name: string;\n chain_id: string;\n };\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: {\n failures: string[];\n };\n [UnifiedSwapBridgeEventName.AssetPickerOpened]: {\n asset_location: 'source' | 'destination';\n };\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This combines the event-specific properties from RequiredEventContextFromClientBase\n * with an optional `location` property. When `location` is omitted, the controller\n * falls back to the value stored via `setLocation()` (defaults to MainView).\n *\n * `ab_tests` is the legacy field and `active_ab_tests` is the newer field.\n * Both are kept for a migration window and are treated as separate payloads.\n */\nexport type RequiredEventContextFromClient = {\n [K in keyof RequiredEventContextFromClientBase]: RequiredEventContextFromClientBase[K] & {\n location?: MetaMetricsSwapsEventSource;\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n feature_id: FeatureId;\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 Omit<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source' | 'security_warnings'\n > &\n InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n input_value: string;\n };\n [UnifiedSwapBridgeEventName.FiatCryptoToggleClicked]: RequestParams &\n Pick<RequestMetadata, 'swap_type'>;\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: RequestParams;\n [UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData & {\n refresh_count: number; // starts from 0\n } & InputPrimaryDenominationData;\n [UnifiedSwapBridgeEventName.QuotesError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.Submitted]: null;\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 };\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 [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;\n [UnifiedSwapBridgeEventName.AssetPickerOpened]: null;\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n batch_id?: string;\n };\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n *\n * `ab_tests` will be deprecated in favor of `active_ab_tests` in the future.\n * `ab_tests` and `active_ab_tests` intentionally coexist during migration.\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n feature_id: FeatureId;\n action_type: MetricsActionType;\n location: MetaMetricsSwapsEventSource;\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\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": "76.0.0",
|
|
4
4
|
"description": "Manages bridge-related quote fetching functionality for MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -57,22 +57,22 @@
|
|
|
57
57
|
"@ethersproject/constants": "^5.7.0",
|
|
58
58
|
"@ethersproject/contracts": "^5.7.0",
|
|
59
59
|
"@ethersproject/providers": "^5.7.0",
|
|
60
|
-
"@metamask/accounts-controller": "^39.0.
|
|
61
|
-
"@metamask/assets-controller": "^9.0.
|
|
62
|
-
"@metamask/assets-controllers": "^109.2.
|
|
60
|
+
"@metamask/accounts-controller": "^39.0.2",
|
|
61
|
+
"@metamask/assets-controller": "^9.0.2",
|
|
62
|
+
"@metamask/assets-controllers": "^109.2.1",
|
|
63
63
|
"@metamask/base-controller": "^9.1.0",
|
|
64
|
-
"@metamask/controller-utils": "^12.
|
|
65
|
-
"@metamask/gas-fee-controller": "^26.2.
|
|
64
|
+
"@metamask/controller-utils": "^12.3.0",
|
|
65
|
+
"@metamask/gas-fee-controller": "^26.2.3",
|
|
66
66
|
"@metamask/keyring-api": "^23.1.0",
|
|
67
67
|
"@metamask/messenger": "^1.2.0",
|
|
68
68
|
"@metamask/metamask-eth-abis": "^3.1.1",
|
|
69
|
-
"@metamask/multichain-network-controller": "^3.1.
|
|
70
|
-
"@metamask/network-controller": "^
|
|
71
|
-
"@metamask/polling-controller": "^16.0.
|
|
69
|
+
"@metamask/multichain-network-controller": "^3.1.4",
|
|
70
|
+
"@metamask/network-controller": "^33.0.0",
|
|
71
|
+
"@metamask/polling-controller": "^16.0.7",
|
|
72
72
|
"@metamask/profile-sync-controller": "^28.2.0",
|
|
73
73
|
"@metamask/remote-feature-flag-controller": "^4.2.2",
|
|
74
74
|
"@metamask/snaps-controllers": "^19.0.0",
|
|
75
|
-
"@metamask/transaction-controller": "^68.1.
|
|
75
|
+
"@metamask/transaction-controller": "^68.1.1",
|
|
76
76
|
"@metamask/utils": "^11.11.0",
|
|
77
77
|
"bignumber.js": "^9.1.2",
|
|
78
78
|
"reselect": "^5.1.1",
|