@metamask-previews/bridge-controller 79.3.1-preview-264a60683 → 79.3.1-preview-e68ab1498

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +0 -9
  2. package/dist/bridge-controller.cjs +10 -22
  3. package/dist/bridge-controller.cjs.map +1 -1
  4. package/dist/bridge-controller.d.cts.map +1 -1
  5. package/dist/bridge-controller.d.mts.map +1 -1
  6. package/dist/bridge-controller.mjs +11 -23
  7. package/dist/bridge-controller.mjs.map +1 -1
  8. package/dist/index.cjs +3 -13
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +2 -3
  11. package/dist/index.d.cts.map +1 -1
  12. package/dist/index.d.mts +2 -3
  13. package/dist/index.d.mts.map +1 -1
  14. package/dist/index.mjs +1 -2
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/utils/metrics/constants.cjs +1 -26
  17. package/dist/utils/metrics/constants.cjs.map +1 -1
  18. package/dist/utils/metrics/constants.d.cts +0 -23
  19. package/dist/utils/metrics/constants.d.cts.map +1 -1
  20. package/dist/utils/metrics/constants.d.mts +0 -23
  21. package/dist/utils/metrics/constants.d.mts.map +1 -1
  22. package/dist/utils/metrics/constants.mjs +0 -25
  23. package/dist/utils/metrics/constants.mjs.map +1 -1
  24. package/dist/utils/metrics/types.cjs.map +1 -1
  25. package/dist/utils/metrics/types.d.cts +5 -13
  26. package/dist/utils/metrics/types.d.cts.map +1 -1
  27. package/dist/utils/metrics/types.d.mts +5 -13
  28. package/dist/utils/metrics/types.d.mts.map +1 -1
  29. package/dist/utils/metrics/types.mjs.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/utils/metrics/failure-telemetry.cjs +0 -119
  32. package/dist/utils/metrics/failure-telemetry.cjs.map +0 -1
  33. package/dist/utils/metrics/failure-telemetry.d.cts +0 -62
  34. package/dist/utils/metrics/failure-telemetry.d.cts.map +0 -1
  35. package/dist/utils/metrics/failure-telemetry.d.mts +0 -62
  36. package/dist/utils/metrics/failure-telemetry.d.mts.map +0 -1
  37. package/dist/utils/metrics/failure-telemetry.mjs +0 -109
  38. package/dist/utils/metrics/failure-telemetry.mjs.map +0 -1
@@ -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,EACV,wBAAwB,EACxB,SAAS,EACT,WAAW,EACZ,wBAAuB;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,2CAA0C;AACnE,OAAO,KAAK,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,+BAA+B,EAC/B,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,mBAAmB,EACpB,wBAAuB;AAExB;;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;IAChD;;;;;;OAMG;IACH,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,SAAS,GACT,IAAI,CAAC;AAET,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,qBAAqB,EAAE,mBAAmB,C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CAAC,yBAAyB,CAAC,6BAA6B,CAAC,EAAE,4CAA4C,CAAC;CACzG,CAAC;AAEF,KAAK,oCAAoC,CACvC,CAAC,SAAS,gCAAgC,IAExC;IACE,UAAU,EAAE,SAAS,CAAC;IACtB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,+BAA+B,CAAC;IAC1C,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;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,8BAA8B,CACxC,CAAC,SAAS,gCAAgC,IACxC,CAAC,SAAS,yBAAyB,GACnC,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,oCAAoC,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 {\n InputPrimaryDenomination,\n SortOrder,\n StatusTypes,\n} from '../../types.js';\nimport type { FeatureId } from '../../validators/feature-flags.js';\nimport type {\n UnifiedSwapBridgeEventName,\n BatchSellMetricsEventName,\n BatchSellMetricsLocation,\n BridgeControllerMetricsEventName,\n BridgeControllerMetricsLocation,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n FailurePhase,\n SwapBridgeErrorCode,\n} from './constants.js';\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 HashPresenceData = {\n source_hash_present?: boolean;\n destination_hash_present?: boolean;\n};\n\nexport type FailureTelemetryData = HashPresenceData & {\n failure_phase?: FailurePhase;\n error_code?: SwapBridgeErrorCode;\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\ntype BatchSellChainProperties = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n};\n\ntype BatchSellTokenPageEventContext = BatchSellChainProperties & {\n location: BatchSellMetricsLocation;\n};\n\ntype BatchSellSourceTokenEventContext = BatchSellTokenPageEventContext & {\n source_token_symbols: string[];\n source_token_addresses: CaipAssetType[];\n};\n\ntype BatchSellQuotePageEventContext = BatchSellSourceTokenEventContext & {\n destination_token_symbol: string;\n destination_token_address: CaipAssetType;\n usd_amount_source_tokens: number[];\n usd_amount_source_total: number;\n source_token_slippages: number[];\n};\n\ntype BatchSellReviewModalSubmittedEventContext =\n BatchSellQuotePageEventContext &\n Pick<TradeData, 'usd_quoted_gas' | 'usd_quoted_return'>;\n\ntype BatchSellTokenPageEventProperties = BatchSellChainProperties &\n BatchSellTokenPageEventContext;\n\ntype BatchSellSourceTokenEventProperties = BatchSellChainProperties &\n BatchSellSourceTokenEventContext & {\n source_token_count: number;\n };\n\ntype BatchSellQuotePageEventProperties = BatchSellChainProperties &\n BatchSellQuotePageEventContext & {\n source_token_count: number;\n };\n\ntype BatchSellReviewModalSubmittedEventProperties = BatchSellChainProperties &\n BatchSellReviewModalSubmittedEventContext & {\n source_token_count: number;\n };\n\ntype SharedEventContextFromClient = {\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n feature_id: FeatureId;\n};\n\ntype OptionalLocationContextFromClient<T> = T extends {\n location: unknown;\n}\n ? object\n : { location?: BridgeControllerMetricsLocation };\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * Most events receive an optional location via RequiredEventContextFromClient;\n * Batch Sell events define their own required location enum.\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 usd_amount_source: number;\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 Pick<FailureTelemetryData, 'failure_phase' | 'error_code'>;\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 HashPresenceData;\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 transaction_internal_id?: string;\n } & InputPrimaryDenominationData &\n HashPresenceData;\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 } & FailureTelemetryData;\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' | 'gas_included_7702'\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' | 'gas_included_7702'\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 [BatchSellMetricsEventName.BatchSellTokenPageViewed]: BatchSellTokenPageEventContext;\n [BatchSellMetricsEventName.BatchSellTokenPageContinueClicked]: BatchSellSourceTokenEventContext;\n [BatchSellMetricsEventName.BatchSellQuotePageViewed]: BatchSellQuotePageEventContext;\n [BatchSellMetricsEventName.BatchSellQuotePageReviewClicked]: BatchSellQuotePageEventContext;\n [BatchSellMetricsEventName.BatchSellReviewModalSubmitted]: BatchSellReviewModalSubmittedEventContext;\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 Unknown).\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]: K extends BatchSellMetricsEventName\n ? RequiredEventContextFromClientBase[K]\n : RequiredEventContextFromClientBase[K] &\n OptionalLocationContextFromClient<\n RequiredEventContextFromClientBase[K]\n > &\n SharedEventContextFromClient;\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 [BatchSellMetricsEventName.BatchSellTokenPageViewed]: BatchSellTokenPageEventProperties;\n [BatchSellMetricsEventName.BatchSellTokenPageContinueClicked]: BatchSellSourceTokenEventProperties;\n [BatchSellMetricsEventName.BatchSellQuotePageViewed]: BatchSellQuotePageEventProperties;\n [BatchSellMetricsEventName.BatchSellQuotePageReviewClicked]: BatchSellQuotePageEventProperties;\n [BatchSellMetricsEventName.BatchSellReviewModalSubmitted]: BatchSellReviewModalSubmittedEventProperties;\n};\n\ntype SharedCrossChainSwapsEventProperties<\n T extends BridgeControllerMetricsEventName,\n> =\n | {\n feature_id: FeatureId;\n action_type: MetricsActionType;\n location: BridgeControllerMetricsLocation;\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\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 BridgeControllerMetricsEventName,\n> = T extends BatchSellMetricsEventName\n ? Pick<EventPropertiesFromControllerState, T>[T]\n : SharedCrossChainSwapsEventProperties<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 InputPrimaryDenomination,\n SortOrder,\n StatusTypes,\n} from '../../types.js';\nimport type { FeatureId } from '../../validators/feature-flags.js';\nimport type {\n UnifiedSwapBridgeEventName,\n BatchSellMetricsEventName,\n BatchSellMetricsLocation,\n BridgeControllerMetricsEventName,\n BridgeControllerMetricsLocation,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants.js';\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\ntype BatchSellChainProperties = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n};\n\ntype BatchSellTokenPageEventContext = BatchSellChainProperties & {\n location: BatchSellMetricsLocation;\n};\n\ntype BatchSellSourceTokenEventContext = BatchSellTokenPageEventContext & {\n source_token_symbols: string[];\n source_token_addresses: CaipAssetType[];\n};\n\ntype BatchSellQuotePageEventContext = BatchSellSourceTokenEventContext & {\n destination_token_symbol: string;\n destination_token_address: CaipAssetType;\n usd_amount_source_tokens: number[];\n usd_amount_source_total: number;\n source_token_slippages: number[];\n};\n\ntype BatchSellReviewModalSubmittedEventContext =\n BatchSellQuotePageEventContext &\n Pick<TradeData, 'usd_quoted_gas' | 'usd_quoted_return'>;\n\ntype BatchSellTokenPageEventProperties = BatchSellChainProperties &\n BatchSellTokenPageEventContext;\n\ntype BatchSellSourceTokenEventProperties = BatchSellChainProperties &\n BatchSellSourceTokenEventContext & {\n source_token_count: number;\n };\n\ntype BatchSellQuotePageEventProperties = BatchSellChainProperties &\n BatchSellQuotePageEventContext & {\n source_token_count: number;\n };\n\ntype BatchSellReviewModalSubmittedEventProperties = BatchSellChainProperties &\n BatchSellReviewModalSubmittedEventContext & {\n source_token_count: number;\n };\n\ntype SharedEventContextFromClient = {\n ab_tests?: Record<string, string>;\n active_ab_tests?: { key: string; value: string }[];\n feature_id: FeatureId;\n};\n\ntype OptionalLocationContextFromClient<T> = T extends {\n location: unknown;\n}\n ? object\n : { location?: BridgeControllerMetricsLocation };\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * Most events receive an optional location via RequiredEventContextFromClient;\n * Batch Sell events define their own required location enum.\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 usd_amount_source: number;\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 transaction_internal_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' | 'gas_included_7702'\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' | 'gas_included_7702'\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 [BatchSellMetricsEventName.BatchSellTokenPageViewed]: BatchSellTokenPageEventContext;\n [BatchSellMetricsEventName.BatchSellTokenPageContinueClicked]: BatchSellSourceTokenEventContext;\n [BatchSellMetricsEventName.BatchSellQuotePageViewed]: BatchSellQuotePageEventContext;\n [BatchSellMetricsEventName.BatchSellQuotePageReviewClicked]: BatchSellQuotePageEventContext;\n [BatchSellMetricsEventName.BatchSellReviewModalSubmitted]: BatchSellReviewModalSubmittedEventContext;\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 Unknown).\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]: K extends BatchSellMetricsEventName\n ? RequiredEventContextFromClientBase[K]\n : RequiredEventContextFromClientBase[K] &\n OptionalLocationContextFromClient<\n RequiredEventContextFromClientBase[K]\n > &\n SharedEventContextFromClient;\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 [BatchSellMetricsEventName.BatchSellTokenPageViewed]: BatchSellTokenPageEventProperties;\n [BatchSellMetricsEventName.BatchSellTokenPageContinueClicked]: BatchSellSourceTokenEventProperties;\n [BatchSellMetricsEventName.BatchSellQuotePageViewed]: BatchSellQuotePageEventProperties;\n [BatchSellMetricsEventName.BatchSellQuotePageReviewClicked]: BatchSellQuotePageEventProperties;\n [BatchSellMetricsEventName.BatchSellReviewModalSubmitted]: BatchSellReviewModalSubmittedEventProperties;\n};\n\ntype SharedCrossChainSwapsEventProperties<\n T extends BridgeControllerMetricsEventName,\n> =\n | {\n feature_id: FeatureId;\n action_type: MetricsActionType;\n location: BridgeControllerMetricsLocation;\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\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 BridgeControllerMetricsEventName,\n> = T extends BatchSellMetricsEventName\n ? Pick<EventPropertiesFromControllerState, T>[T]\n : SharedCrossChainSwapsEventProperties<T>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/bridge-controller",
3
- "version": "79.3.1-preview-264a60683",
3
+ "version": "79.3.1-preview-e68ab1498",
4
4
  "description": "Manages bridge-related quote fetching functionality for MetaMask",
5
5
  "keywords": [
6
6
  "Ethereum",
@@ -1,119 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStatusFailureTelemetry = exports.getSubmitFailureTelemetry = exports.promoteFailurePhase = exports.getStatusFailurePhase = exports.getHashPresenceProperties = exports.getSubmitErrorCode = exports.getQuoteFetchErrorCode = void 0;
4
- /* eslint-disable @typescript-eslint/naming-convention */
5
- const constants_js_1 = require("./constants.cjs");
6
- /**
7
- * Classify a thrown value for Quotes Error. Quote fetch always stays in the
8
- * `quote` phase; this only chooses `error_code`.
9
- *
10
- * @param error - The thrown value from quote fetch.
11
- * @returns The Mixpanel `error_code`.
12
- */
13
- const getQuoteFetchErrorCode = (error) => {
14
- if (error === undefined || error === null) {
15
- return constants_js_1.SwapBridgeErrorCode.MissingErrorObject;
16
- }
17
- if (error instanceof Error) {
18
- return constants_js_1.SwapBridgeErrorCode.QuoteFetchFailed;
19
- }
20
- return constants_js_1.SwapBridgeErrorCode.NonErrorRejection;
21
- };
22
- exports.getQuoteFetchErrorCode = getQuoteFetchErrorCode;
23
- /**
24
- * Classify a thrown value from submit (sign/broadcast) catch paths.
25
- *
26
- * @param error - The thrown value from submit.
27
- * @returns The Mixpanel `error_code`.
28
- */
29
- const getSubmitErrorCode = (error) => {
30
- if (error === undefined || error === null) {
31
- return constants_js_1.SwapBridgeErrorCode.MissingErrorObject;
32
- }
33
- if (error instanceof Error) {
34
- return constants_js_1.SwapBridgeErrorCode.Unknown;
35
- }
36
- return constants_js_1.SwapBridgeErrorCode.NonErrorRejection;
37
- };
38
- exports.getSubmitErrorCode = getSubmitErrorCode;
39
- /**
40
- * @param sourceHash - Source tx hash if known at emit time.
41
- * @param destinationHash - Destination tx hash if known at emit time.
42
- * @returns Boolean hash-presence properties.
43
- */
44
- const getHashPresenceProperties = (sourceHash, destinationHash) => {
45
- return {
46
- source_hash_present: Boolean(sourceHash),
47
- destination_hash_present: Boolean(destinationHash),
48
- };
49
- };
50
- exports.getHashPresenceProperties = getHashPresenceProperties;
51
- /**
52
- * Prefer destination_execution over source_execution over poll.
53
- *
54
- * @param hashPresence - Hash presence at emit time.
55
- * @returns The Mixpanel `failure_phase` for a status/polling Failed event.
56
- */
57
- const getStatusFailurePhase = (hashPresence) => {
58
- if (hashPresence.destination_hash_present) {
59
- return constants_js_1.FailurePhase.DestinationExecution;
60
- }
61
- if (hashPresence.source_hash_present) {
62
- return constants_js_1.FailurePhase.SourceExecution;
63
- }
64
- return constants_js_1.FailurePhase.Poll;
65
- };
66
- exports.getStatusFailurePhase = getStatusFailurePhase;
67
- /**
68
- * Align `failure_phase` with combined hash presence without turning a
69
- * no-hash `broadcast` failure into `poll`.
70
- *
71
- * @param phase - Phase from the emitting path.
72
- * @param hashPresence - Combined history + caller hash flags.
73
- * @returns The Mixpanel `failure_phase`.
74
- */
75
- const promoteFailurePhase = (phase, hashPresence) => {
76
- if (hashPresence.destination_hash_present) {
77
- return constants_js_1.FailurePhase.DestinationExecution;
78
- }
79
- if (hashPresence.source_hash_present &&
80
- (phase === constants_js_1.FailurePhase.Broadcast ||
81
- phase === constants_js_1.FailurePhase.Poll ||
82
- phase === constants_js_1.FailurePhase.Unknown)) {
83
- return constants_js_1.FailurePhase.SourceExecution;
84
- }
85
- return phase;
86
- };
87
- exports.promoteFailurePhase = promoteFailurePhase;
88
- /**
89
- * Telemetry for Failed events emitted from the submit catch (no tx hash yet).
90
- *
91
- * @param error - The thrown value from submit.
92
- * @returns Phase, error code, and hash-presence flags.
93
- */
94
- const getSubmitFailureTelemetry = (error) => {
95
- return {
96
- failure_phase: constants_js_1.FailurePhase.Broadcast,
97
- error_code: (0, exports.getSubmitErrorCode)(error),
98
- source_hash_present: false,
99
- destination_hash_present: false,
100
- };
101
- };
102
- exports.getSubmitFailureTelemetry = getSubmitFailureTelemetry;
103
- /**
104
- * Telemetry for Failed events derived from a status poll.
105
- *
106
- * @param sourceHash - Source tx hash if known.
107
- * @param destinationHash - Destination tx hash if known.
108
- * @returns Phase, error code, and hash-presence flags.
109
- */
110
- const getStatusFailureTelemetry = (sourceHash, destinationHash) => {
111
- const hashPresence = (0, exports.getHashPresenceProperties)(sourceHash, destinationHash);
112
- return {
113
- ...hashPresence,
114
- failure_phase: (0, exports.getStatusFailurePhase)(hashPresence),
115
- error_code: constants_js_1.SwapBridgeErrorCode.StatusFailedWithoutReason,
116
- };
117
- };
118
- exports.getStatusFailureTelemetry = getStatusFailureTelemetry;
119
- //# sourceMappingURL=failure-telemetry.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"failure-telemetry.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/failure-telemetry.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,kDAAmE;AAYnE;;;;;;GAMG;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAc,EAAuB,EAAE;IAC5E,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,kCAAmB,CAAC,kBAAkB,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,kCAAmB,CAAC,gBAAgB,CAAC;IAC9C,CAAC;IACD,OAAO,kCAAmB,CAAC,iBAAiB,CAAC;AAC/C,CAAC,CAAC;AARW,QAAA,sBAAsB,0BAQjC;AAEF;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAuB,EAAE;IACxE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,kCAAmB,CAAC,kBAAkB,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,kCAAmB,CAAC,OAAO,CAAC;IACrC,CAAC;IACD,OAAO,kCAAmB,CAAC,iBAAiB,CAAC;AAC/C,CAAC,CAAC;A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AAK,CAAC;QACrC,mBAAmB,EAAE,KAAK;QAC1B,wBAAwB,EAAE,KAAK;KAChC,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,yBAAyB,6BASpC;AAEF;;;;;;GAMG;AACI,MAAM,yBAAyB,GAAG,CACvC,UAA0B,EAC1B,eAA+B,EACH,EAAE;IAC9B,MAAM,YAAY,GAAG,IAAA,iCAAyB,EAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC5E,OAAO;QACL,GAAG,YAAY;QACf,aAAa,EAAE,IAAA,6BAAqB,EAAC,YAAY,CAAC;QAClD,UAAU,EAAE,kCAAmB,CAAC,yBAAyB;KAC1D,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,yBAAyB,6BAUpC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { FailurePhase, SwapBridgeErrorCode } from './constants.js';\n\nexport type HashPresenceProperties = {\n source_hash_present: boolean;\n destination_hash_present: boolean;\n};\n\nexport type FailureTelemetryProperties = HashPresenceProperties & {\n failure_phase: FailurePhase;\n error_code: SwapBridgeErrorCode;\n};\n\n/**\n * Classify a thrown value for Quotes Error. Quote fetch always stays in the\n * `quote` phase; this only chooses `error_code`.\n *\n * @param error - The thrown value from quote fetch.\n * @returns The Mixpanel `error_code`.\n */\nexport const getQuoteFetchErrorCode = (error: unknown): SwapBridgeErrorCode => {\n if (error === undefined || error === null) {\n return SwapBridgeErrorCode.MissingErrorObject;\n }\n if (error instanceof Error) {\n return SwapBridgeErrorCode.QuoteFetchFailed;\n }\n return SwapBridgeErrorCode.NonErrorRejection;\n};\n\n/**\n * Classify a thrown value from submit (sign/broadcast) catch paths.\n *\n * @param error - The thrown value from submit.\n * @returns The Mixpanel `error_code`.\n */\nexport const getSubmitErrorCode = (error: unknown): SwapBridgeErrorCode => {\n if (error === undefined || error === null) {\n return SwapBridgeErrorCode.MissingErrorObject;\n }\n if (error instanceof Error) {\n return SwapBridgeErrorCode.Unknown;\n }\n return SwapBridgeErrorCode.NonErrorRejection;\n};\n\n/**\n * @param sourceHash - Source tx hash if known at emit time.\n * @param destinationHash - Destination tx hash if known at emit time.\n * @returns Boolean hash-presence properties.\n */\nexport const getHashPresenceProperties = (\n sourceHash?: string | null,\n destinationHash?: string | null,\n): HashPresenceProperties => {\n return {\n source_hash_present: Boolean(sourceHash),\n destination_hash_present: Boolean(destinationHash),\n };\n};\n\n/**\n * Prefer destination_execution over source_execution over poll.\n *\n * @param hashPresence - Hash presence at emit time.\n * @returns The Mixpanel `failure_phase` for a status/polling Failed event.\n */\nexport const getStatusFailurePhase = (\n hashPresence: HashPresenceProperties,\n): FailurePhase => {\n if (hashPresence.destination_hash_present) {\n return FailurePhase.DestinationExecution;\n }\n if (hashPresence.source_hash_present) {\n return FailurePhase.SourceExecution;\n }\n return FailurePhase.Poll;\n};\n\n/**\n * Align `failure_phase` with combined hash presence without turning a\n * no-hash `broadcast` failure into `poll`.\n *\n * @param phase - Phase from the emitting path.\n * @param hashPresence - Combined history + caller hash flags.\n * @returns The Mixpanel `failure_phase`.\n */\nexport const promoteFailurePhase = (\n phase: FailurePhase,\n hashPresence: HashPresenceProperties,\n): FailurePhase => {\n if (hashPresence.destination_hash_present) {\n return FailurePhase.DestinationExecution;\n }\n if (\n hashPresence.source_hash_present &&\n (phase === FailurePhase.Broadcast ||\n phase === FailurePhase.Poll ||\n phase === FailurePhase.Unknown)\n ) {\n return FailurePhase.SourceExecution;\n }\n return phase;\n};\n\n/**\n * Telemetry for Failed events emitted from the submit catch (no tx hash yet).\n *\n * @param error - The thrown value from submit.\n * @returns Phase, error code, and hash-presence flags.\n */\nexport const getSubmitFailureTelemetry = (\n error: unknown,\n): FailureTelemetryProperties => {\n return {\n failure_phase: FailurePhase.Broadcast,\n error_code: getSubmitErrorCode(error),\n source_hash_present: false,\n destination_hash_present: false,\n };\n};\n\n/**\n * Telemetry for Failed events derived from a status poll.\n *\n * @param sourceHash - Source tx hash if known.\n * @param destinationHash - Destination tx hash if known.\n * @returns Phase, error code, and hash-presence flags.\n */\nexport const getStatusFailureTelemetry = (\n sourceHash?: string | null,\n destinationHash?: string | null,\n): FailureTelemetryProperties => {\n const hashPresence = getHashPresenceProperties(sourceHash, destinationHash);\n return {\n ...hashPresence,\n failure_phase: getStatusFailurePhase(hashPresence),\n error_code: SwapBridgeErrorCode.StatusFailedWithoutReason,\n };\n};\n"]}
@@ -1,62 +0,0 @@
1
- import { FailurePhase, SwapBridgeErrorCode } from "./constants.cjs";
2
- export type HashPresenceProperties = {
3
- source_hash_present: boolean;
4
- destination_hash_present: boolean;
5
- };
6
- export type FailureTelemetryProperties = HashPresenceProperties & {
7
- failure_phase: FailurePhase;
8
- error_code: SwapBridgeErrorCode;
9
- };
10
- /**
11
- * Classify a thrown value for Quotes Error. Quote fetch always stays in the
12
- * `quote` phase; this only chooses `error_code`.
13
- *
14
- * @param error - The thrown value from quote fetch.
15
- * @returns The Mixpanel `error_code`.
16
- */
17
- export declare const getQuoteFetchErrorCode: (error: unknown) => SwapBridgeErrorCode;
18
- /**
19
- * Classify a thrown value from submit (sign/broadcast) catch paths.
20
- *
21
- * @param error - The thrown value from submit.
22
- * @returns The Mixpanel `error_code`.
23
- */
24
- export declare const getSubmitErrorCode: (error: unknown) => SwapBridgeErrorCode;
25
- /**
26
- * @param sourceHash - Source tx hash if known at emit time.
27
- * @param destinationHash - Destination tx hash if known at emit time.
28
- * @returns Boolean hash-presence properties.
29
- */
30
- export declare const getHashPresenceProperties: (sourceHash?: string | null, destinationHash?: string | null) => HashPresenceProperties;
31
- /**
32
- * Prefer destination_execution over source_execution over poll.
33
- *
34
- * @param hashPresence - Hash presence at emit time.
35
- * @returns The Mixpanel `failure_phase` for a status/polling Failed event.
36
- */
37
- export declare const getStatusFailurePhase: (hashPresence: HashPresenceProperties) => FailurePhase;
38
- /**
39
- * Align `failure_phase` with combined hash presence without turning a
40
- * no-hash `broadcast` failure into `poll`.
41
- *
42
- * @param phase - Phase from the emitting path.
43
- * @param hashPresence - Combined history + caller hash flags.
44
- * @returns The Mixpanel `failure_phase`.
45
- */
46
- export declare const promoteFailurePhase: (phase: FailurePhase, hashPresence: HashPresenceProperties) => FailurePhase;
47
- /**
48
- * Telemetry for Failed events emitted from the submit catch (no tx hash yet).
49
- *
50
- * @param error - The thrown value from submit.
51
- * @returns Phase, error code, and hash-presence flags.
52
- */
53
- export declare const getSubmitFailureTelemetry: (error: unknown) => FailureTelemetryProperties;
54
- /**
55
- * Telemetry for Failed events derived from a status poll.
56
- *
57
- * @param sourceHash - Source tx hash if known.
58
- * @param destinationHash - Destination tx hash if known.
59
- * @returns Phase, error code, and hash-presence flags.
60
- */
61
- export declare const getStatusFailureTelemetry: (sourceHash?: string | null, destinationHash?: string | null) => FailureTelemetryProperties;
62
- //# sourceMappingURL=failure-telemetry.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"failure-telemetry.d.cts","sourceRoot":"","sources":["../../../src/utils/metrics/failure-telemetry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,wBAAuB;AAEnE,MAAM,MAAM,sBAAsB,GAAG;IACnC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,wBAAwB,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,GAAG;IAChE,aAAa,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,UAAW,OAAO,KAAG,mBAQvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,UAAW,OAAO,KAAG,mBAQnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,gBACvB,MAAM,GAAG,IAAI,oBACR,MAAM,GAAG,IAAI,KAC9B,sBAKF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,iBAClB,sBAAsB,KACnC,YAQF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,UACvB,YAAY,gBACL,sBAAsB,KACnC,YAaF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,UAC7B,OAAO,KACb,0BAOF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,gBACvB,MAAM,GAAG,IAAI,oBACR,MAAM,GAAG,IAAI,KAC9B,0BAOF,CAAC"}
@@ -1,62 +0,0 @@
1
- import { FailurePhase, SwapBridgeErrorCode } from "./constants.mjs";
2
- export type HashPresenceProperties = {
3
- source_hash_present: boolean;
4
- destination_hash_present: boolean;
5
- };
6
- export type FailureTelemetryProperties = HashPresenceProperties & {
7
- failure_phase: FailurePhase;
8
- error_code: SwapBridgeErrorCode;
9
- };
10
- /**
11
- * Classify a thrown value for Quotes Error. Quote fetch always stays in the
12
- * `quote` phase; this only chooses `error_code`.
13
- *
14
- * @param error - The thrown value from quote fetch.
15
- * @returns The Mixpanel `error_code`.
16
- */
17
- export declare const getQuoteFetchErrorCode: (error: unknown) => SwapBridgeErrorCode;
18
- /**
19
- * Classify a thrown value from submit (sign/broadcast) catch paths.
20
- *
21
- * @param error - The thrown value from submit.
22
- * @returns The Mixpanel `error_code`.
23
- */
24
- export declare const getSubmitErrorCode: (error: unknown) => SwapBridgeErrorCode;
25
- /**
26
- * @param sourceHash - Source tx hash if known at emit time.
27
- * @param destinationHash - Destination tx hash if known at emit time.
28
- * @returns Boolean hash-presence properties.
29
- */
30
- export declare const getHashPresenceProperties: (sourceHash?: string | null, destinationHash?: string | null) => HashPresenceProperties;
31
- /**
32
- * Prefer destination_execution over source_execution over poll.
33
- *
34
- * @param hashPresence - Hash presence at emit time.
35
- * @returns The Mixpanel `failure_phase` for a status/polling Failed event.
36
- */
37
- export declare const getStatusFailurePhase: (hashPresence: HashPresenceProperties) => FailurePhase;
38
- /**
39
- * Align `failure_phase` with combined hash presence without turning a
40
- * no-hash `broadcast` failure into `poll`.
41
- *
42
- * @param phase - Phase from the emitting path.
43
- * @param hashPresence - Combined history + caller hash flags.
44
- * @returns The Mixpanel `failure_phase`.
45
- */
46
- export declare const promoteFailurePhase: (phase: FailurePhase, hashPresence: HashPresenceProperties) => FailurePhase;
47
- /**
48
- * Telemetry for Failed events emitted from the submit catch (no tx hash yet).
49
- *
50
- * @param error - The thrown value from submit.
51
- * @returns Phase, error code, and hash-presence flags.
52
- */
53
- export declare const getSubmitFailureTelemetry: (error: unknown) => FailureTelemetryProperties;
54
- /**
55
- * Telemetry for Failed events derived from a status poll.
56
- *
57
- * @param sourceHash - Source tx hash if known.
58
- * @param destinationHash - Destination tx hash if known.
59
- * @returns Phase, error code, and hash-presence flags.
60
- */
61
- export declare const getStatusFailureTelemetry: (sourceHash?: string | null, destinationHash?: string | null) => FailureTelemetryProperties;
62
- //# sourceMappingURL=failure-telemetry.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"failure-telemetry.d.mts","sourceRoot":"","sources":["../../../src/utils/metrics/failure-telemetry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,wBAAuB;AAEnE,MAAM,MAAM,sBAAsB,GAAG;IACnC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,wBAAwB,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,GAAG;IAChE,aAAa,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,UAAW,OAAO,KAAG,mBAQvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,UAAW,OAAO,KAAG,mBAQnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,gBACvB,MAAM,GAAG,IAAI,oBACR,MAAM,GAAG,IAAI,KAC9B,sBAKF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,iBAClB,sBAAsB,KACnC,YAQF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,UACvB,YAAY,gBACL,sBAAsB,KACnC,YAaF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,UAC7B,OAAO,KACb,0BAOF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,gBACvB,MAAM,GAAG,IAAI,oBACR,MAAM,GAAG,IAAI,KAC9B,0BAOF,CAAC"}
@@ -1,109 +0,0 @@
1
- /* eslint-disable @typescript-eslint/naming-convention */
2
- import { FailurePhase, SwapBridgeErrorCode } from "./constants.mjs";
3
- /**
4
- * Classify a thrown value for Quotes Error. Quote fetch always stays in the
5
- * `quote` phase; this only chooses `error_code`.
6
- *
7
- * @param error - The thrown value from quote fetch.
8
- * @returns The Mixpanel `error_code`.
9
- */
10
- export const getQuoteFetchErrorCode = (error) => {
11
- if (error === undefined || error === null) {
12
- return SwapBridgeErrorCode.MissingErrorObject;
13
- }
14
- if (error instanceof Error) {
15
- return SwapBridgeErrorCode.QuoteFetchFailed;
16
- }
17
- return SwapBridgeErrorCode.NonErrorRejection;
18
- };
19
- /**
20
- * Classify a thrown value from submit (sign/broadcast) catch paths.
21
- *
22
- * @param error - The thrown value from submit.
23
- * @returns The Mixpanel `error_code`.
24
- */
25
- export const getSubmitErrorCode = (error) => {
26
- if (error === undefined || error === null) {
27
- return SwapBridgeErrorCode.MissingErrorObject;
28
- }
29
- if (error instanceof Error) {
30
- return SwapBridgeErrorCode.Unknown;
31
- }
32
- return SwapBridgeErrorCode.NonErrorRejection;
33
- };
34
- /**
35
- * @param sourceHash - Source tx hash if known at emit time.
36
- * @param destinationHash - Destination tx hash if known at emit time.
37
- * @returns Boolean hash-presence properties.
38
- */
39
- export const getHashPresenceProperties = (sourceHash, destinationHash) => {
40
- return {
41
- source_hash_present: Boolean(sourceHash),
42
- destination_hash_present: Boolean(destinationHash),
43
- };
44
- };
45
- /**
46
- * Prefer destination_execution over source_execution over poll.
47
- *
48
- * @param hashPresence - Hash presence at emit time.
49
- * @returns The Mixpanel `failure_phase` for a status/polling Failed event.
50
- */
51
- export const getStatusFailurePhase = (hashPresence) => {
52
- if (hashPresence.destination_hash_present) {
53
- return FailurePhase.DestinationExecution;
54
- }
55
- if (hashPresence.source_hash_present) {
56
- return FailurePhase.SourceExecution;
57
- }
58
- return FailurePhase.Poll;
59
- };
60
- /**
61
- * Align `failure_phase` with combined hash presence without turning a
62
- * no-hash `broadcast` failure into `poll`.
63
- *
64
- * @param phase - Phase from the emitting path.
65
- * @param hashPresence - Combined history + caller hash flags.
66
- * @returns The Mixpanel `failure_phase`.
67
- */
68
- export const promoteFailurePhase = (phase, hashPresence) => {
69
- if (hashPresence.destination_hash_present) {
70
- return FailurePhase.DestinationExecution;
71
- }
72
- if (hashPresence.source_hash_present &&
73
- (phase === FailurePhase.Broadcast ||
74
- phase === FailurePhase.Poll ||
75
- phase === FailurePhase.Unknown)) {
76
- return FailurePhase.SourceExecution;
77
- }
78
- return phase;
79
- };
80
- /**
81
- * Telemetry for Failed events emitted from the submit catch (no tx hash yet).
82
- *
83
- * @param error - The thrown value from submit.
84
- * @returns Phase, error code, and hash-presence flags.
85
- */
86
- export const getSubmitFailureTelemetry = (error) => {
87
- return {
88
- failure_phase: FailurePhase.Broadcast,
89
- error_code: getSubmitErrorCode(error),
90
- source_hash_present: false,
91
- destination_hash_present: false,
92
- };
93
- };
94
- /**
95
- * Telemetry for Failed events derived from a status poll.
96
- *
97
- * @param sourceHash - Source tx hash if known.
98
- * @param destinationHash - Destination tx hash if known.
99
- * @returns Phase, error code, and hash-presence flags.
100
- */
101
- export const getStatusFailureTelemetry = (sourceHash, destinationHash) => {
102
- const hashPresence = getHashPresenceProperties(sourceHash, destinationHash);
103
- return {
104
- ...hashPresence,
105
- failure_phase: getStatusFailurePhase(hashPresence),
106
- error_code: SwapBridgeErrorCode.StatusFailedWithoutReason,
107
- };
108
- };
109
- //# sourceMappingURL=failure-telemetry.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"failure-telemetry.mjs","sourceRoot":"","sources":["../../../src/utils/metrics/failure-telemetry.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,wBAAuB;AAYnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAc,EAAuB,EAAE;IAC5E,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,mBAAmB,CAAC,kBAAkB,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,mBAAmB,CAAC,gBAAgB,CAAC;IAC9C,CAAC;IACD,OAAO,mBAAmB,CAAC,iBAAiB,CAAC;AAC/C,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAuB,EAAE;IACxE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,mBAAmB,CAAC,kBAAkB,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,mBAAmB,CAAC,OAAO,CAAC;IACrC,CAAC;IACD,OAAO,mBAAmB,CAAC,iBAAiB,CAAC;AAC/C,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,UAA0B,EAC1B,eAA+B,EACP,EAAE;IAC1B,OAAO;QACL,mBAAmB,EAAE,OAAO,CAAC,UAAU,CAAC;QACxC,wBAAwB,EAAE,OAAO,CAAC,eAAe,CAAC;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,YAAoC,EACtB,EAAE;IAChB,IAAI,YAAY,CAAC,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ent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { FailurePhase, SwapBridgeErrorCode } from './constants.js';\n\nexport type HashPresenceProperties = {\n source_hash_present: boolean;\n destination_hash_present: boolean;\n};\n\nexport type FailureTelemetryProperties = HashPresenceProperties & {\n failure_phase: FailurePhase;\n error_code: SwapBridgeErrorCode;\n};\n\n/**\n * Classify a thrown value for Quotes Error. Quote fetch always stays in the\n * `quote` phase; this only chooses `error_code`.\n *\n * @param error - The thrown value from quote fetch.\n * @returns The Mixpanel `error_code`.\n */\nexport const getQuoteFetchErrorCode = (error: unknown): SwapBridgeErrorCode => {\n if (error === undefined || error === null) {\n return SwapBridgeErrorCode.MissingErrorObject;\n }\n if (error instanceof Error) {\n return SwapBridgeErrorCode.QuoteFetchFailed;\n }\n return SwapBridgeErrorCode.NonErrorRejection;\n};\n\n/**\n * Classify a thrown value from submit (sign/broadcast) catch paths.\n *\n * @param error - The thrown value from submit.\n * @returns The Mixpanel `error_code`.\n */\nexport const getSubmitErrorCode = (error: unknown): SwapBridgeErrorCode => {\n if (error === undefined || error === null) {\n return SwapBridgeErrorCode.MissingErrorObject;\n }\n if (error instanceof Error) {\n return SwapBridgeErrorCode.Unknown;\n }\n return SwapBridgeErrorCode.NonErrorRejection;\n};\n\n/**\n * @param sourceHash - Source tx hash if known at emit time.\n * @param destinationHash - Destination tx hash if known at emit time.\n * @returns Boolean hash-presence properties.\n */\nexport const getHashPresenceProperties = (\n sourceHash?: string | null,\n destinationHash?: string | null,\n): HashPresenceProperties => {\n return {\n source_hash_present: Boolean(sourceHash),\n destination_hash_present: Boolean(destinationHash),\n };\n};\n\n/**\n * Prefer destination_execution over source_execution over poll.\n *\n * @param hashPresence - Hash presence at emit time.\n * @returns The Mixpanel `failure_phase` for a status/polling Failed event.\n */\nexport const getStatusFailurePhase = (\n hashPresence: HashPresenceProperties,\n): FailurePhase => {\n if (hashPresence.destination_hash_present) {\n return FailurePhase.DestinationExecution;\n }\n if (hashPresence.source_hash_present) {\n return FailurePhase.SourceExecution;\n }\n return FailurePhase.Poll;\n};\n\n/**\n * Align `failure_phase` with combined hash presence without turning a\n * no-hash `broadcast` failure into `poll`.\n *\n * @param phase - Phase from the emitting path.\n * @param hashPresence - Combined history + caller hash flags.\n * @returns The Mixpanel `failure_phase`.\n */\nexport const promoteFailurePhase = (\n phase: FailurePhase,\n hashPresence: HashPresenceProperties,\n): FailurePhase => {\n if (hashPresence.destination_hash_present) {\n return FailurePhase.DestinationExecution;\n }\n if (\n hashPresence.source_hash_present &&\n (phase === FailurePhase.Broadcast ||\n phase === FailurePhase.Poll ||\n phase === FailurePhase.Unknown)\n ) {\n return FailurePhase.SourceExecution;\n }\n return phase;\n};\n\n/**\n * Telemetry for Failed events emitted from the submit catch (no tx hash yet).\n *\n * @param error - The thrown value from submit.\n * @returns Phase, error code, and hash-presence flags.\n */\nexport const getSubmitFailureTelemetry = (\n error: unknown,\n): FailureTelemetryProperties => {\n return {\n failure_phase: FailurePhase.Broadcast,\n error_code: getSubmitErrorCode(error),\n source_hash_present: false,\n destination_hash_present: false,\n };\n};\n\n/**\n * Telemetry for Failed events derived from a status poll.\n *\n * @param sourceHash - Source tx hash if known.\n * @param destinationHash - Destination tx hash if known.\n * @returns Phase, error code, and hash-presence flags.\n */\nexport const getStatusFailureTelemetry = (\n sourceHash?: string | null,\n destinationHash?: string | null,\n): FailureTelemetryProperties => {\n const hashPresence = getHashPresenceProperties(sourceHash, destinationHash);\n return {\n ...hashPresence,\n failure_phase: getStatusFailurePhase(hashPresence),\n error_code: SwapBridgeErrorCode.StatusFailedWithoutReason,\n };\n};\n"]}