@metamask-previews/bridge-controller 21.0.0-preview-7bf3a3b5 → 22.0.0-preview-971e1a64

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 CHANGED
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Changed
11
11
 
12
+ - **BREAKING** Rename `QuoteResponse.bridgePriceData` to `priceData` ([#5784](https://github.com/MetaMask/core/pull/5784))
13
+
14
+ ## [22.0.0]
15
+
16
+ ### Changed
17
+
18
+ - **BREAKING:** Bump `@metamask/assets-controller` peer dependency to `^62.0.0` ([#5780](https://github.com/MetaMask/core/pull/5780))
12
19
  - Bump `@metamask/controller-utils` to `^11.8.0` ([#5765](https://github.com/MetaMask/core/pull/5765))
13
20
 
14
21
  ## [21.0.0]
@@ -208,7 +215,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
208
215
 
209
216
  - Initial release ([#5317](https://github.com/MetaMask/core/pull/5317))
210
217
 
211
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@21.0.0...HEAD
218
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@22.0.0...HEAD
219
+ [22.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@21.0.0...@metamask/bridge-controller@22.0.0
212
220
  [21.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@20.0.0...@metamask/bridge-controller@21.0.0
213
221
  [20.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@19.0.0...@metamask/bridge-controller@20.0.0
214
222
  [19.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@18.0.0...@metamask/bridge-controller@19.0.0
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AA4CA;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,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;AACxD,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AACD,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,8EAAoD,CAAA;IACpD,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;IACtD,iFAAuD,CAAA;AACzD,CAAC,EALW,sBAAsB,sCAAtB,sBAAsB,QAKjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\nimport type {\n GetCurrencyRateState,\n MultichainAssetsRatesControllerGetStateAction,\n TokenRatesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type {\n ControllerStateChangeEvent,\n RestrictedMessenger,\n} from '@metamask/base-controller';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipAssetType,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\n\nimport type { BridgeController } from './bridge-controller';\nimport type { BRIDGE_CONTROLLER_NAME } from './constants/bridge';\n\n/**\n * Additional options accepted by the extension's fetchWithCache function\n */\ntype FetchWithCacheOptions = {\n cacheOptions?: {\n cacheRefreshTime: number;\n };\n functionName?: string;\n};\n\nexport type FetchFunction = (\n input: RequestInfo | URL,\n init?: RequestInit & FetchWithCacheOptions,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => Promise<any>;\n\n/**\n * The types of assets that a user can send\n */\nexport enum AssetType {\n /** The native asset for the current network, such as ETH */\n native = 'NATIVE',\n /** An ERC20 token */\n token = 'TOKEN',\n /** An ERC721 or ERC1155 token. */\n NFT = 'NFT',\n /**\n * A transaction interacting with a contract that isn't a token method\n * interaction will be marked as dealing with an unknown asset type.\n */\n unknown = 'UNKNOWN',\n}\n\nexport type ChainConfiguration = {\n isActiveSrc: boolean;\n isActiveDest: boolean;\n refreshRate?: number;\n topAssets?: string[];\n};\n\nexport type L1GasFees = {\n l1GasFeesInHexWei?: string; // l1 fees for approval and trade in hex wei, appended by BridgeController.#appendL1GasFees\n};\n\nexport type SolanaFees = {\n solanaFeesInLamports?: string; // solana fees in lamports, appended by BridgeController.#appendSolanaFees\n};\n\n/**\n * The types of values for the token amount and its values when converted to the user's selected currency and USD\n */\nexport type TokenAmountValues = {\n /**\n * The amount of the token\n *\n * @example \"1000000000000000000\"\n */\n amount: string;\n /**\n * The amount of the token in the user's selected currency\n *\n * @example \"4.55\"\n */\n valueInCurrency: string | null;\n /**\n * The amount of the token in USD\n *\n * @example \"1.234\"\n */\n usd: string | null;\n};\n\n/**\n * Asset exchange rate values for a given chain and address\n */\nexport type ExchangeRate = { exchangeRate?: string; usdExchangeRate?: string };\n\n/**\n * Values derived from the quote response\n */\nexport type QuoteMetadata = {\n gasFee: TokenAmountValues;\n totalNetworkFee: TokenAmountValues; // estimatedGasFees + relayerFees\n totalMaxNetworkFee: TokenAmountValues; // maxGasFees + relayerFees\n toTokenAmount: TokenAmountValues;\n adjustedReturn: Omit<TokenAmountValues, 'amount'>; // destTokenAmount - totalNetworkFee\n sentAmount: TokenAmountValues; // srcTokenAmount + metabridgeFee\n swapRate: string; // destTokenAmount / sentAmount\n cost: Omit<TokenAmountValues, 'amount'>; // sentAmount - adjustedReturn\n};\n\n/**\n * Sort order set by the user\n */\nexport enum SortOrder {\n COST_ASC = 'cost_ascending',\n ETA_ASC = 'time_descending',\n}\n\n/**\n * This is the interface for the asset object returned by the bridge-api\n * This type is used in the QuoteResponse and in the fetchBridgeTokens response\n */\nexport type BridgeAsset = {\n /**\n * The chainId of the token\n */\n chainId: ChainId;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * The symbol of token object\n */\n symbol: string;\n /**\n * The name for the network\n */\n name: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n icon?: string;\n /**\n * URL for token icon\n */\n iconUrl?: string;\n /**\n * The assetId of the token\n */\n assetId: CaipAssetType;\n};\n\n/**\n * This is the interface for the token object used in the extension client\n * In addition to the {@link BridgeAsset} fields, it includes balance information\n */\nexport type BridgeToken = {\n address: string;\n symbol: string;\n image: string;\n decimals: number;\n chainId: number | Hex | ChainId | CaipChainId;\n balance: string; // raw balance\n // TODO deprecate this field and use balance instead\n string: string | undefined; // normalized balance as a stringified number\n tokenFiatAmount?: number | null;\n occurrences?: number;\n};\n\ntype DecimalChainId = string;\nexport type GasMultiplierByChainId = Record<DecimalChainId, number>;\n\ntype FeatureFlagResponsePlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<string, ChainConfiguration>;\n};\n\nexport type FeatureFlagResponse = FeatureFlagResponsePlatformConfig;\n\n/**\n * This is the interface for the quote request sent to the bridge-api\n * and should only be used by the fetchBridgeQuotes utility function\n * Components and redux stores should use the {@link GenericQuoteRequest} type\n */\nexport type QuoteRequest<\n ChainIdType = ChainId | number,\n TokenAddressType = string,\n WalletAddressType = string,\n> = {\n walletAddress: WalletAddressType;\n destWalletAddress?: WalletAddressType;\n srcChainId: ChainIdType;\n destChainId: ChainIdType;\n srcTokenAddress: TokenAddressType;\n destTokenAddress: TokenAddressType;\n /**\n * This is the amount sent, in atomic amount\n */\n srcTokenAmount: string;\n slippage?: number;\n aggIds?: string[];\n bridgeIds?: string[];\n insufficientBal?: boolean;\n resetApproval?: boolean;\n refuel?: boolean;\n};\n\nexport enum StatusTypes {\n UNKNOWN = 'UNKNOWN',\n FAILED = 'FAILED',\n PENDING = 'PENDING',\n COMPLETE = 'COMPLETE',\n}\n\n/**\n * These are types that components pass in. Since data is a mix of types when coming from the redux store, we need to use a generic type that can cover all the types.\n * Payloads with this type are transformed into QuoteRequest by fetchBridgeQuotes right before fetching quotes\n */\nexport type GenericQuoteRequest = QuoteRequest<\n Hex | CaipChainId | string | number, // chainIds\n Hex | CaipAssetId | string, // assetIds/addresses\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n Hex | CaipAccountId | string // accountIds/addresses\n>;\n\nexport type Protocol = {\n name: string;\n displayName?: string;\n icon?: string;\n};\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nexport type Step = {\n action: ActionTypes;\n srcChainId: ChainId;\n destChainId?: ChainId;\n srcAsset?: BridgeAsset;\n destAsset?: BridgeAsset;\n srcAmount: string;\n destAmount: string;\n protocol: Protocol;\n};\n\nexport type RefuelData = Step;\n\nexport type Quote = {\n requestId: string;\n srcChainId: ChainId;\n srcAsset: BridgeAsset;\n // Some tokens have a fee of 0, so sometimes it's equal to amount sent\n srcTokenAmount: string; // Atomic amount, the amount sent - fees\n destChainId: ChainId;\n destAsset: BridgeAsset;\n destTokenAmount: string; // Atomic amount, the amount received\n feeData: Record<FeeType.METABRIDGE, FeeData> &\n Partial<Record<FeeType, FeeData>>;\n bridgeId: string;\n bridges: string[];\n steps: Step[];\n refuel?: RefuelData;\n bridgePriceData?: {\n totalFromAmountUsd?: string;\n totalToAmountUsd?: string;\n priceImpact?: string;\n };\n};\n\n/**\n * This is the type for the quote response from the bridge-api\n * TxDataType can be overriden to be a string when the quote is non-evm\n */\nexport type QuoteResponse<TradeType = TxData, ApprovalType = TxData | null> = {\n quote: Quote;\n approval?: ApprovalType;\n trade: TradeType;\n estimatedProcessingTimeInSeconds: number;\n};\n\nexport enum ChainId {\n ETH = 1,\n OPTIMISM = 10,\n BSC = 56,\n POLYGON = 137,\n ZKSYNC = 324,\n BASE = 8453,\n ARBITRUM = 42161,\n AVALANCHE = 43114,\n LINEA = 59144,\n SOLANA = 1151111081099710,\n}\n\nexport enum FeeType {\n METABRIDGE = 'metabridge',\n REFUEL = 'refuel',\n}\nexport type FeeData = {\n amount: string;\n asset: BridgeAsset;\n};\nexport type TxData = {\n chainId: ChainId;\n to: string;\n from: string;\n value: string;\n data: string;\n gasLimit: number | null;\n};\n\nexport type FeatureFlagsPlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport enum RequestStatus {\n LOADING,\n FETCHED,\n ERROR,\n}\nexport enum BridgeUserAction {\n SELECT_DEST_NETWORK = 'selectDestNetwork',\n UPDATE_QUOTE_PARAMS = 'updateBridgeQuoteRequestParams',\n}\nexport enum BridgeBackgroundAction {\n SET_CHAIN_INTERVAL_LENGTH = 'setChainIntervalLength',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n TRACK_METAMETRICS_EVENT = 'trackUnifiedSwapBridgeEvent',\n}\n\nexport type BridgeControllerState = {\n quoteRequest: Partial<GenericQuoteRequest>;\n quotes: (QuoteResponse & L1GasFees & SolanaFees)[];\n quotesInitialLoadTime: number | null;\n quotesLastFetched: number | null;\n quotesLoadingStatus: RequestStatus | null;\n quoteFetchError: string | null;\n quotesRefreshCount: number;\n /**\n * Asset exchange rates for EVM and multichain assets that are not indexed by the assets controllers\n */\n assetExchangeRates: Record<CaipAssetType, ExchangeRate>;\n};\n\nexport type BridgeControllerAction<\n FunctionName extends keyof BridgeController,\n> = {\n type: `${typeof BRIDGE_CONTROLLER_NAME}:${FunctionName}`;\n handler: BridgeController[FunctionName];\n};\n\n// Maps to BridgeController function names\nexport type BridgeControllerActions =\n | BridgeControllerAction<BridgeBackgroundAction.SET_CHAIN_INTERVAL_LENGTH>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\n | BridgeControllerAction<BridgeBackgroundAction.TRACK_METAMETRICS_EVENT>\n | BridgeControllerAction<BridgeUserAction.UPDATE_QUOTE_PARAMS>;\n\nexport type BridgeControllerEvents = ControllerStateChangeEvent<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerState\n>;\n\nexport type AllowedActions =\n | AccountsControllerGetSelectedMultichainAccountAction\n | GetCurrencyRateState\n | TokenRatesControllerGetStateAction\n | MultichainAssetsRatesControllerGetStateAction\n | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction;\nexport type AllowedEvents = never;\n\n/**\n * The messenger for the BridgeController.\n */\nexport type BridgeControllerMessenger = RestrictedMessenger<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerActions | AllowedActions,\n BridgeControllerEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AA4CA;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,4DAA4D;IAC5D,8BAAiB,CAAA;IACjB,qBAAqB;IACrB,4BAAe,CAAA;IACf,kCAAkC;IAClC,wBAAW,CAAA;IACX;;;OAGG;IACH,gCAAmB,CAAA;AACrB,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AA4DD;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AA+FD,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;AACvB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAmBD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAgDD,IAAY,OAWX;AAXD,WAAY,OAAO;IACjB,mCAAO,CAAA;IACP,8CAAa,CAAA;IACb,oCAAQ,CAAA;IACR,6CAAa,CAAA;IACb,2CAAY,CAAA;IACZ,wCAAW,CAAA;IACX,iDAAgB,CAAA;IAChB,mDAAiB,CAAA;IACjB,2CAAa,CAAA;IACb,wDAAyB,CAAA;AAC3B,CAAC,EAXW,OAAO,uBAAP,OAAO,QAWlB;AAED,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,4BAAiB,CAAA;AACnB,CAAC,EAHW,OAAO,uBAAP,OAAO,QAGlB;AAqBD,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,uDAAO,CAAA;IACP,uDAAO,CAAA;IACP,mDAAK,CAAA;AACP,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AACD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,6DAAyC,CAAA;IACzC,0EAAsD,CAAA;AACxD,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AACD,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,8EAAoD,CAAA;IACpD,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;IACtD,iFAAuD,CAAA;AACzD,CAAC,EALW,sBAAsB,sCAAtB,sBAAsB,QAKjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\nimport type {\n GetCurrencyRateState,\n MultichainAssetsRatesControllerGetStateAction,\n TokenRatesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type {\n ControllerStateChangeEvent,\n RestrictedMessenger,\n} from '@metamask/base-controller';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipAssetType,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\n\nimport type { BridgeController } from './bridge-controller';\nimport type { BRIDGE_CONTROLLER_NAME } from './constants/bridge';\n\n/**\n * Additional options accepted by the extension's fetchWithCache function\n */\ntype FetchWithCacheOptions = {\n cacheOptions?: {\n cacheRefreshTime: number;\n };\n functionName?: string;\n};\n\nexport type FetchFunction = (\n input: RequestInfo | URL,\n init?: RequestInit & FetchWithCacheOptions,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => Promise<any>;\n\n/**\n * The types of assets that a user can send\n */\nexport enum AssetType {\n /** The native asset for the current network, such as ETH */\n native = 'NATIVE',\n /** An ERC20 token */\n token = 'TOKEN',\n /** An ERC721 or ERC1155 token. */\n NFT = 'NFT',\n /**\n * A transaction interacting with a contract that isn't a token method\n * interaction will be marked as dealing with an unknown asset type.\n */\n unknown = 'UNKNOWN',\n}\n\nexport type ChainConfiguration = {\n isActiveSrc: boolean;\n isActiveDest: boolean;\n refreshRate?: number;\n topAssets?: string[];\n};\n\nexport type L1GasFees = {\n l1GasFeesInHexWei?: string; // l1 fees for approval and trade in hex wei, appended by BridgeController.#appendL1GasFees\n};\n\nexport type SolanaFees = {\n solanaFeesInLamports?: string; // solana fees in lamports, appended by BridgeController.#appendSolanaFees\n};\n\n/**\n * The types of values for the token amount and its values when converted to the user's selected currency and USD\n */\nexport type TokenAmountValues = {\n /**\n * The amount of the token\n *\n * @example \"1000000000000000000\"\n */\n amount: string;\n /**\n * The amount of the token in the user's selected currency\n *\n * @example \"4.55\"\n */\n valueInCurrency: string | null;\n /**\n * The amount of the token in USD\n *\n * @example \"1.234\"\n */\n usd: string | null;\n};\n\n/**\n * Asset exchange rate values for a given chain and address\n */\nexport type ExchangeRate = { exchangeRate?: string; usdExchangeRate?: string };\n\n/**\n * Values derived from the quote response\n */\nexport type QuoteMetadata = {\n gasFee: TokenAmountValues;\n totalNetworkFee: TokenAmountValues; // estimatedGasFees + relayerFees\n totalMaxNetworkFee: TokenAmountValues; // maxGasFees + relayerFees\n toTokenAmount: TokenAmountValues;\n adjustedReturn: Omit<TokenAmountValues, 'amount'>; // destTokenAmount - totalNetworkFee\n sentAmount: TokenAmountValues; // srcTokenAmount + metabridgeFee\n swapRate: string; // destTokenAmount / sentAmount\n cost: Omit<TokenAmountValues, 'amount'>; // sentAmount - adjustedReturn\n};\n\n/**\n * Sort order set by the user\n */\nexport enum SortOrder {\n COST_ASC = 'cost_ascending',\n ETA_ASC = 'time_descending',\n}\n\n/**\n * This is the interface for the asset object returned by the bridge-api\n * This type is used in the QuoteResponse and in the fetchBridgeTokens response\n */\nexport type BridgeAsset = {\n /**\n * The chainId of the token\n */\n chainId: ChainId;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * The symbol of token object\n */\n symbol: string;\n /**\n * The name for the network\n */\n name: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n icon?: string;\n /**\n * URL for token icon\n */\n iconUrl?: string;\n /**\n * The assetId of the token\n */\n assetId: CaipAssetType;\n};\n\n/**\n * This is the interface for the token object used in the extension client\n * In addition to the {@link BridgeAsset} fields, it includes balance information\n */\nexport type BridgeToken = {\n address: string;\n symbol: string;\n image: string;\n decimals: number;\n chainId: number | Hex | ChainId | CaipChainId;\n balance: string; // raw balance\n // TODO deprecate this field and use balance instead\n string: string | undefined; // normalized balance as a stringified number\n tokenFiatAmount?: number | null;\n occurrences?: number;\n};\n\ntype DecimalChainId = string;\nexport type GasMultiplierByChainId = Record<DecimalChainId, number>;\n\ntype FeatureFlagResponsePlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<string, ChainConfiguration>;\n};\n\nexport type FeatureFlagResponse = FeatureFlagResponsePlatformConfig;\n\n/**\n * This is the interface for the quote request sent to the bridge-api\n * and should only be used by the fetchBridgeQuotes utility function\n * Components and redux stores should use the {@link GenericQuoteRequest} type\n */\nexport type QuoteRequest<\n ChainIdType = ChainId | number,\n TokenAddressType = string,\n WalletAddressType = string,\n> = {\n walletAddress: WalletAddressType;\n destWalletAddress?: WalletAddressType;\n srcChainId: ChainIdType;\n destChainId: ChainIdType;\n srcTokenAddress: TokenAddressType;\n destTokenAddress: TokenAddressType;\n /**\n * This is the amount sent, in atomic amount\n */\n srcTokenAmount: string;\n slippage?: number;\n aggIds?: string[];\n bridgeIds?: string[];\n insufficientBal?: boolean;\n resetApproval?: boolean;\n refuel?: boolean;\n};\n\nexport enum StatusTypes {\n UNKNOWN = 'UNKNOWN',\n FAILED = 'FAILED',\n PENDING = 'PENDING',\n COMPLETE = 'COMPLETE',\n}\n\n/**\n * These are types that components pass in. Since data is a mix of types when coming from the redux store, we need to use a generic type that can cover all the types.\n * Payloads with this type are transformed into QuoteRequest by fetchBridgeQuotes right before fetching quotes\n */\nexport type GenericQuoteRequest = QuoteRequest<\n Hex | CaipChainId | string | number, // chainIds\n Hex | CaipAssetId | string, // assetIds/addresses\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n Hex | CaipAccountId | string // accountIds/addresses\n>;\n\nexport type Protocol = {\n name: string;\n displayName?: string;\n icon?: string;\n};\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nexport type Step = {\n action: ActionTypes;\n srcChainId: ChainId;\n destChainId?: ChainId;\n srcAsset?: BridgeAsset;\n destAsset?: BridgeAsset;\n srcAmount: string;\n destAmount: string;\n protocol: Protocol;\n};\n\nexport type RefuelData = Step;\n\nexport type Quote = {\n requestId: string;\n srcChainId: ChainId;\n srcAsset: BridgeAsset;\n // Some tokens have a fee of 0, so sometimes it's equal to amount sent\n srcTokenAmount: string; // Atomic amount, the amount sent - fees\n destChainId: ChainId;\n destAsset: BridgeAsset;\n destTokenAmount: string; // Atomic amount, the amount received\n feeData: Record<FeeType.METABRIDGE, FeeData> &\n Partial<Record<FeeType, FeeData>>;\n bridgeId: string;\n bridges: string[];\n steps: Step[];\n refuel?: RefuelData;\n priceData?: {\n totalFromAmountUsd?: string;\n totalToAmountUsd?: string;\n priceImpact?: string;\n };\n};\n\n/**\n * This is the type for the quote response from the bridge-api\n * TxDataType can be overriden to be a string when the quote is non-evm\n */\nexport type QuoteResponse<TradeType = TxData, ApprovalType = TxData | null> = {\n quote: Quote;\n approval?: ApprovalType;\n trade: TradeType;\n estimatedProcessingTimeInSeconds: number;\n};\n\nexport enum ChainId {\n ETH = 1,\n OPTIMISM = 10,\n BSC = 56,\n POLYGON = 137,\n ZKSYNC = 324,\n BASE = 8453,\n ARBITRUM = 42161,\n AVALANCHE = 43114,\n LINEA = 59144,\n SOLANA = 1151111081099710,\n}\n\nexport enum FeeType {\n METABRIDGE = 'metabridge',\n REFUEL = 'refuel',\n}\nexport type FeeData = {\n amount: string;\n asset: BridgeAsset;\n};\nexport type TxData = {\n chainId: ChainId;\n to: string;\n from: string;\n value: string;\n data: string;\n gasLimit: number | null;\n};\n\nexport type FeatureFlagsPlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport enum RequestStatus {\n LOADING,\n FETCHED,\n ERROR,\n}\nexport enum BridgeUserAction {\n SELECT_DEST_NETWORK = 'selectDestNetwork',\n UPDATE_QUOTE_PARAMS = 'updateBridgeQuoteRequestParams',\n}\nexport enum BridgeBackgroundAction {\n SET_CHAIN_INTERVAL_LENGTH = 'setChainIntervalLength',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n TRACK_METAMETRICS_EVENT = 'trackUnifiedSwapBridgeEvent',\n}\n\nexport type BridgeControllerState = {\n quoteRequest: Partial<GenericQuoteRequest>;\n quotes: (QuoteResponse & L1GasFees & SolanaFees)[];\n quotesInitialLoadTime: number | null;\n quotesLastFetched: number | null;\n quotesLoadingStatus: RequestStatus | null;\n quoteFetchError: string | null;\n quotesRefreshCount: number;\n /**\n * Asset exchange rates for EVM and multichain assets that are not indexed by the assets controllers\n */\n assetExchangeRates: Record<CaipAssetType, ExchangeRate>;\n};\n\nexport type BridgeControllerAction<\n FunctionName extends keyof BridgeController,\n> = {\n type: `${typeof BRIDGE_CONTROLLER_NAME}:${FunctionName}`;\n handler: BridgeController[FunctionName];\n};\n\n// Maps to BridgeController function names\nexport type BridgeControllerActions =\n | BridgeControllerAction<BridgeBackgroundAction.SET_CHAIN_INTERVAL_LENGTH>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\n | BridgeControllerAction<BridgeBackgroundAction.TRACK_METAMETRICS_EVENT>\n | BridgeControllerAction<BridgeUserAction.UPDATE_QUOTE_PARAMS>;\n\nexport type BridgeControllerEvents = ControllerStateChangeEvent<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerState\n>;\n\nexport type AllowedActions =\n | AccountsControllerGetSelectedMultichainAccountAction\n | GetCurrencyRateState\n | TokenRatesControllerGetStateAction\n | MultichainAssetsRatesControllerGetStateAction\n | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction;\nexport type AllowedEvents = never;\n\n/**\n * The messenger for the BridgeController.\n */\nexport type BridgeControllerMessenger = RestrictedMessenger<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerActions | AllowedActions,\n BridgeControllerEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
package/dist/types.d.cts CHANGED
@@ -226,7 +226,7 @@ export type Quote = {
226
226
  bridges: string[];
227
227
  steps: Step[];
228
228
  refuel?: RefuelData;
229
- bridgePriceData?: {
229
+ priceData?: {
230
230
  totalFromAmountUsd?: string;
231
231
  totalToAmountUsd?: string;
232
232
  priceImpact?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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BAAgB,CAAC,mBAAmB,CAAC,CAAC;AAEjE,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,CAC7D,OAAO,sBAAsB,EAC7B,qBAAqB,CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB,oDAAoD,GACpD,oBAAoB,GACpB,kCAAkC,GAClC,6CAA6C,GAC7C,iBAAiB,GACjB,mDAAmD,GACnD,+BAA+B,GAC/B,2CAA2C,GAC3C,yCAAyC,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,CACzD,OAAO,sBAAsB,EAC7B,uBAAuB,GAAG,cAAc,EACxC,sBAAsB,GAAG,aAAa,EACtC,cAAc,CAAC,MAAM,CAAC,EACtB,aAAa,CAAC,MAAM,CAAC,CACtB,CAAC"}
package/dist/types.d.mts CHANGED
@@ -226,7 +226,7 @@ export type Quote = {
226
226
  bridges: string[];
227
227
  steps: Step[];
228
228
  refuel?: RefuelData;
229
- bridgePriceData?: {
229
+ priceData?: {
230
230
  totalFromAmountUsd?: string;
231
231
  totalToAmountUsd?: string;
232
232
  priceImpact?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oDAAoD,EAAE,sCAAsC;AAC1G,OAAO,KAAK,EACV,oBAAoB,EACpB,6CAA6C,EAC7C,kCAAkC,EACnC,qCAAqC;AACtC,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACpB,kCAAkC;AACnC,OAAO,KAAK,EACV,mDAAmD,EACnD,+BAA+B,EAC/B,2CAA2C,EAC5C,qCAAqC;AACtC,OAAO,KAAK,EAAE,yCAAyC,EAAE,iDAAiD;AAC1G,OAAO,KAAK,EAAE,iBAAiB,EAAE,oCAAoC;AACrE,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,WAAW,EACX,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D,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,4BAAiB,CAAA;AACnB,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAqBD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,uDAAO,CAAA;IACP,uDAAO,CAAA;IACP,mDAAK,CAAA;AACP,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AACD,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,6DAAyC,CAAA;IACzC,0EAAsD,CAAA;AACxD,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AACD,MAAM,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,8EAAoD,CAAA;IACpD,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;IACtD,iFAAuD,CAAA;AACzD,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\nimport type {\n GetCurrencyRateState,\n MultichainAssetsRatesControllerGetStateAction,\n TokenRatesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type {\n ControllerStateChangeEvent,\n RestrictedMessenger,\n} from '@metamask/base-controller';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipAssetType,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\n\nimport type { BridgeController } from './bridge-controller';\nimport type { BRIDGE_CONTROLLER_NAME } from './constants/bridge';\n\n/**\n * Additional options accepted by the extension's fetchWithCache function\n */\ntype FetchWithCacheOptions = {\n cacheOptions?: {\n cacheRefreshTime: number;\n };\n functionName?: string;\n};\n\nexport type FetchFunction = (\n input: RequestInfo | URL,\n init?: RequestInit & FetchWithCacheOptions,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => Promise<any>;\n\n/**\n * The types of assets that a user can send\n */\nexport enum AssetType {\n /** The native asset for the current network, such as ETH */\n native = 'NATIVE',\n /** An ERC20 token */\n token = 'TOKEN',\n /** An ERC721 or ERC1155 token. */\n NFT = 'NFT',\n /**\n * A transaction interacting with a contract that isn't a token method\n * interaction will be marked as dealing with an unknown asset type.\n */\n unknown = 'UNKNOWN',\n}\n\nexport type ChainConfiguration = {\n isActiveSrc: boolean;\n isActiveDest: boolean;\n refreshRate?: number;\n topAssets?: string[];\n};\n\nexport type L1GasFees = {\n l1GasFeesInHexWei?: string; // l1 fees for approval and trade in hex wei, appended by BridgeController.#appendL1GasFees\n};\n\nexport type SolanaFees = {\n solanaFeesInLamports?: string; // solana fees in lamports, appended by BridgeController.#appendSolanaFees\n};\n\n/**\n * The types of values for the token amount and its values when converted to the user's selected currency and USD\n */\nexport type TokenAmountValues = {\n /**\n * The amount of the token\n *\n * @example \"1000000000000000000\"\n */\n amount: string;\n /**\n * The amount of the token in the user's selected currency\n *\n * @example \"4.55\"\n */\n valueInCurrency: string | null;\n /**\n * The amount of the token in USD\n *\n * @example \"1.234\"\n */\n usd: string | null;\n};\n\n/**\n * Asset exchange rate values for a given chain and address\n */\nexport type ExchangeRate = { exchangeRate?: string; usdExchangeRate?: string };\n\n/**\n * Values derived from the quote response\n */\nexport type QuoteMetadata = {\n gasFee: TokenAmountValues;\n totalNetworkFee: TokenAmountValues; // estimatedGasFees + relayerFees\n totalMaxNetworkFee: TokenAmountValues; // maxGasFees + relayerFees\n toTokenAmount: TokenAmountValues;\n adjustedReturn: Omit<TokenAmountValues, 'amount'>; // destTokenAmount - totalNetworkFee\n sentAmount: TokenAmountValues; // srcTokenAmount + metabridgeFee\n swapRate: string; // destTokenAmount / sentAmount\n cost: Omit<TokenAmountValues, 'amount'>; // sentAmount - adjustedReturn\n};\n\n/**\n * Sort order set by the user\n */\nexport enum SortOrder {\n COST_ASC = 'cost_ascending',\n ETA_ASC = 'time_descending',\n}\n\n/**\n * This is the interface for the asset object returned by the bridge-api\n * This type is used in the QuoteResponse and in the fetchBridgeTokens response\n */\nexport type BridgeAsset = {\n /**\n * The chainId of the token\n */\n chainId: ChainId;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * The symbol of token object\n */\n symbol: string;\n /**\n * The name for the network\n */\n name: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n icon?: string;\n /**\n * URL for token icon\n */\n iconUrl?: string;\n /**\n * The assetId of the token\n */\n assetId: CaipAssetType;\n};\n\n/**\n * This is the interface for the token object used in the extension client\n * In addition to the {@link BridgeAsset} fields, it includes balance information\n */\nexport type BridgeToken = {\n address: string;\n symbol: string;\n image: string;\n decimals: number;\n chainId: number | Hex | ChainId | CaipChainId;\n balance: string; // raw balance\n // TODO deprecate this field and use balance instead\n string: string | undefined; // normalized balance as a stringified number\n tokenFiatAmount?: number | null;\n occurrences?: number;\n};\n\ntype DecimalChainId = string;\nexport type GasMultiplierByChainId = Record<DecimalChainId, number>;\n\ntype FeatureFlagResponsePlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<string, ChainConfiguration>;\n};\n\nexport type FeatureFlagResponse = FeatureFlagResponsePlatformConfig;\n\n/**\n * This is the interface for the quote request sent to the bridge-api\n * and should only be used by the fetchBridgeQuotes utility function\n * Components and redux stores should use the {@link GenericQuoteRequest} type\n */\nexport type QuoteRequest<\n ChainIdType = ChainId | number,\n TokenAddressType = string,\n WalletAddressType = string,\n> = {\n walletAddress: WalletAddressType;\n destWalletAddress?: WalletAddressType;\n srcChainId: ChainIdType;\n destChainId: ChainIdType;\n srcTokenAddress: TokenAddressType;\n destTokenAddress: TokenAddressType;\n /**\n * This is the amount sent, in atomic amount\n */\n srcTokenAmount: string;\n slippage?: number;\n aggIds?: string[];\n bridgeIds?: string[];\n insufficientBal?: boolean;\n resetApproval?: boolean;\n refuel?: boolean;\n};\n\nexport enum StatusTypes {\n UNKNOWN = 'UNKNOWN',\n FAILED = 'FAILED',\n PENDING = 'PENDING',\n COMPLETE = 'COMPLETE',\n}\n\n/**\n * These are types that components pass in. Since data is a mix of types when coming from the redux store, we need to use a generic type that can cover all the types.\n * Payloads with this type are transformed into QuoteRequest by fetchBridgeQuotes right before fetching quotes\n */\nexport type GenericQuoteRequest = QuoteRequest<\n Hex | CaipChainId | string | number, // chainIds\n Hex | CaipAssetId | string, // assetIds/addresses\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n Hex | CaipAccountId | string // accountIds/addresses\n>;\n\nexport type Protocol = {\n name: string;\n displayName?: string;\n icon?: string;\n};\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nexport type Step = {\n action: ActionTypes;\n srcChainId: ChainId;\n destChainId?: ChainId;\n srcAsset?: BridgeAsset;\n destAsset?: BridgeAsset;\n srcAmount: string;\n destAmount: string;\n protocol: Protocol;\n};\n\nexport type RefuelData = Step;\n\nexport type Quote = {\n requestId: string;\n srcChainId: ChainId;\n srcAsset: BridgeAsset;\n // Some tokens have a fee of 0, so sometimes it's equal to amount sent\n srcTokenAmount: string; // Atomic amount, the amount sent - fees\n destChainId: ChainId;\n destAsset: BridgeAsset;\n destTokenAmount: string; // Atomic amount, the amount received\n feeData: Record<FeeType.METABRIDGE, FeeData> &\n Partial<Record<FeeType, FeeData>>;\n bridgeId: string;\n bridges: string[];\n steps: Step[];\n refuel?: RefuelData;\n bridgePriceData?: {\n totalFromAmountUsd?: string;\n totalToAmountUsd?: string;\n priceImpact?: string;\n };\n};\n\n/**\n * This is the type for the quote response from the bridge-api\n * TxDataType can be overriden to be a string when the quote is non-evm\n */\nexport type QuoteResponse<TradeType = TxData, ApprovalType = TxData | null> = {\n quote: Quote;\n approval?: ApprovalType;\n trade: TradeType;\n estimatedProcessingTimeInSeconds: number;\n};\n\nexport enum ChainId {\n ETH = 1,\n OPTIMISM = 10,\n BSC = 56,\n POLYGON = 137,\n ZKSYNC = 324,\n BASE = 8453,\n ARBITRUM = 42161,\n AVALANCHE = 43114,\n LINEA = 59144,\n SOLANA = 1151111081099710,\n}\n\nexport enum FeeType {\n METABRIDGE = 'metabridge',\n REFUEL = 'refuel',\n}\nexport type FeeData = {\n amount: string;\n asset: BridgeAsset;\n};\nexport type TxData = {\n chainId: ChainId;\n to: string;\n from: string;\n value: string;\n data: string;\n gasLimit: number | null;\n};\n\nexport type FeatureFlagsPlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport enum RequestStatus {\n LOADING,\n FETCHED,\n ERROR,\n}\nexport enum BridgeUserAction {\n SELECT_DEST_NETWORK = 'selectDestNetwork',\n UPDATE_QUOTE_PARAMS = 'updateBridgeQuoteRequestParams',\n}\nexport enum BridgeBackgroundAction {\n SET_CHAIN_INTERVAL_LENGTH = 'setChainIntervalLength',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n TRACK_METAMETRICS_EVENT = 'trackUnifiedSwapBridgeEvent',\n}\n\nexport type BridgeControllerState = {\n quoteRequest: Partial<GenericQuoteRequest>;\n quotes: (QuoteResponse & L1GasFees & SolanaFees)[];\n quotesInitialLoadTime: number | null;\n quotesLastFetched: number | null;\n quotesLoadingStatus: RequestStatus | null;\n quoteFetchError: string | null;\n quotesRefreshCount: number;\n /**\n * Asset exchange rates for EVM and multichain assets that are not indexed by the assets controllers\n */\n assetExchangeRates: Record<CaipAssetType, ExchangeRate>;\n};\n\nexport type BridgeControllerAction<\n FunctionName extends keyof BridgeController,\n> = {\n type: `${typeof BRIDGE_CONTROLLER_NAME}:${FunctionName}`;\n handler: BridgeController[FunctionName];\n};\n\n// Maps to BridgeController function names\nexport type BridgeControllerActions =\n | BridgeControllerAction<BridgeBackgroundAction.SET_CHAIN_INTERVAL_LENGTH>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\n | BridgeControllerAction<BridgeBackgroundAction.TRACK_METAMETRICS_EVENT>\n | BridgeControllerAction<BridgeUserAction.UPDATE_QUOTE_PARAMS>;\n\nexport type BridgeControllerEvents = ControllerStateChangeEvent<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerState\n>;\n\nexport type AllowedActions =\n | AccountsControllerGetSelectedMultichainAccountAction\n | GetCurrencyRateState\n | TokenRatesControllerGetStateAction\n | MultichainAssetsRatesControllerGetStateAction\n | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction;\nexport type AllowedEvents = never;\n\n/**\n * The messenger for the BridgeController.\n */\nexport type BridgeControllerMessenger = RestrictedMessenger<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerActions | AllowedActions,\n BridgeControllerEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA4CA;;GAEG;AACH,MAAM,CAAN,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,4DAA4D;IAC5D,8BAAiB,CAAA;IACjB,qBAAqB;IACrB,4BAAe,CAAA;IACf,kCAAkC;IAClC,wBAAW,CAAA;IACX;;;OAGG;IACH,gCAAmB,CAAA;AACrB,CAAC,EAZW,SAAS,KAAT,SAAS,QAYpB;AA4DD;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA+FD,MAAM,CAA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'@metamask/accounts-controller';\nimport type {\n GetCurrencyRateState,\n MultichainAssetsRatesControllerGetStateAction,\n TokenRatesControllerGetStateAction,\n} from '@metamask/assets-controllers';\nimport type {\n ControllerStateChangeEvent,\n RestrictedMessenger,\n} from '@metamask/base-controller';\nimport type {\n NetworkControllerFindNetworkClientIdByChainIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerGetNetworkClientByIdAction,\n} from '@metamask/network-controller';\nimport type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller';\nimport type { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipAssetType,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\n\nimport type { BridgeController } from './bridge-controller';\nimport type { BRIDGE_CONTROLLER_NAME } from './constants/bridge';\n\n/**\n * Additional options accepted by the extension's fetchWithCache function\n */\ntype FetchWithCacheOptions = {\n cacheOptions?: {\n cacheRefreshTime: number;\n };\n functionName?: string;\n};\n\nexport type FetchFunction = (\n input: RequestInfo | URL,\n init?: RequestInit & FetchWithCacheOptions,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => Promise<any>;\n\n/**\n * The types of assets that a user can send\n */\nexport enum AssetType {\n /** The native asset for the current network, such as ETH */\n native = 'NATIVE',\n /** An ERC20 token */\n token = 'TOKEN',\n /** An ERC721 or ERC1155 token. */\n NFT = 'NFT',\n /**\n * A transaction interacting with a contract that isn't a token method\n * interaction will be marked as dealing with an unknown asset type.\n */\n unknown = 'UNKNOWN',\n}\n\nexport type ChainConfiguration = {\n isActiveSrc: boolean;\n isActiveDest: boolean;\n refreshRate?: number;\n topAssets?: string[];\n};\n\nexport type L1GasFees = {\n l1GasFeesInHexWei?: string; // l1 fees for approval and trade in hex wei, appended by BridgeController.#appendL1GasFees\n};\n\nexport type SolanaFees = {\n solanaFeesInLamports?: string; // solana fees in lamports, appended by BridgeController.#appendSolanaFees\n};\n\n/**\n * The types of values for the token amount and its values when converted to the user's selected currency and USD\n */\nexport type TokenAmountValues = {\n /**\n * The amount of the token\n *\n * @example \"1000000000000000000\"\n */\n amount: string;\n /**\n * The amount of the token in the user's selected currency\n *\n * @example \"4.55\"\n */\n valueInCurrency: string | null;\n /**\n * The amount of the token in USD\n *\n * @example \"1.234\"\n */\n usd: string | null;\n};\n\n/**\n * Asset exchange rate values for a given chain and address\n */\nexport type ExchangeRate = { exchangeRate?: string; usdExchangeRate?: string };\n\n/**\n * Values derived from the quote response\n */\nexport type QuoteMetadata = {\n gasFee: TokenAmountValues;\n totalNetworkFee: TokenAmountValues; // estimatedGasFees + relayerFees\n totalMaxNetworkFee: TokenAmountValues; // maxGasFees + relayerFees\n toTokenAmount: TokenAmountValues;\n adjustedReturn: Omit<TokenAmountValues, 'amount'>; // destTokenAmount - totalNetworkFee\n sentAmount: TokenAmountValues; // srcTokenAmount + metabridgeFee\n swapRate: string; // destTokenAmount / sentAmount\n cost: Omit<TokenAmountValues, 'amount'>; // sentAmount - adjustedReturn\n};\n\n/**\n * Sort order set by the user\n */\nexport enum SortOrder {\n COST_ASC = 'cost_ascending',\n ETA_ASC = 'time_descending',\n}\n\n/**\n * This is the interface for the asset object returned by the bridge-api\n * This type is used in the QuoteResponse and in the fetchBridgeTokens response\n */\nexport type BridgeAsset = {\n /**\n * The chainId of the token\n */\n chainId: ChainId;\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string;\n /**\n * The symbol of token object\n */\n symbol: string;\n /**\n * The name for the network\n */\n name: string;\n /**\n * Number of digits after decimal point\n */\n decimals: number;\n icon?: string;\n /**\n * URL for token icon\n */\n iconUrl?: string;\n /**\n * The assetId of the token\n */\n assetId: CaipAssetType;\n};\n\n/**\n * This is the interface for the token object used in the extension client\n * In addition to the {@link BridgeAsset} fields, it includes balance information\n */\nexport type BridgeToken = {\n address: string;\n symbol: string;\n image: string;\n decimals: number;\n chainId: number | Hex | ChainId | CaipChainId;\n balance: string; // raw balance\n // TODO deprecate this field and use balance instead\n string: string | undefined; // normalized balance as a stringified number\n tokenFiatAmount?: number | null;\n occurrences?: number;\n};\n\ntype DecimalChainId = string;\nexport type GasMultiplierByChainId = Record<DecimalChainId, number>;\n\ntype FeatureFlagResponsePlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<string, ChainConfiguration>;\n};\n\nexport type FeatureFlagResponse = FeatureFlagResponsePlatformConfig;\n\n/**\n * This is the interface for the quote request sent to the bridge-api\n * and should only be used by the fetchBridgeQuotes utility function\n * Components and redux stores should use the {@link GenericQuoteRequest} type\n */\nexport type QuoteRequest<\n ChainIdType = ChainId | number,\n TokenAddressType = string,\n WalletAddressType = string,\n> = {\n walletAddress: WalletAddressType;\n destWalletAddress?: WalletAddressType;\n srcChainId: ChainIdType;\n destChainId: ChainIdType;\n srcTokenAddress: TokenAddressType;\n destTokenAddress: TokenAddressType;\n /**\n * This is the amount sent, in atomic amount\n */\n srcTokenAmount: string;\n slippage?: number;\n aggIds?: string[];\n bridgeIds?: string[];\n insufficientBal?: boolean;\n resetApproval?: boolean;\n refuel?: boolean;\n};\n\nexport enum StatusTypes {\n UNKNOWN = 'UNKNOWN',\n FAILED = 'FAILED',\n PENDING = 'PENDING',\n COMPLETE = 'COMPLETE',\n}\n\n/**\n * These are types that components pass in. Since data is a mix of types when coming from the redux store, we need to use a generic type that can cover all the types.\n * Payloads with this type are transformed into QuoteRequest by fetchBridgeQuotes right before fetching quotes\n */\nexport type GenericQuoteRequest = QuoteRequest<\n Hex | CaipChainId | string | number, // chainIds\n Hex | CaipAssetId | string, // assetIds/addresses\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n Hex | CaipAccountId | string // accountIds/addresses\n>;\n\nexport type Protocol = {\n name: string;\n displayName?: string;\n icon?: string;\n};\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nexport type Step = {\n action: ActionTypes;\n srcChainId: ChainId;\n destChainId?: ChainId;\n srcAsset?: BridgeAsset;\n destAsset?: BridgeAsset;\n srcAmount: string;\n destAmount: string;\n protocol: Protocol;\n};\n\nexport type RefuelData = Step;\n\nexport type Quote = {\n requestId: string;\n srcChainId: ChainId;\n srcAsset: BridgeAsset;\n // Some tokens have a fee of 0, so sometimes it's equal to amount sent\n srcTokenAmount: string; // Atomic amount, the amount sent - fees\n destChainId: ChainId;\n destAsset: BridgeAsset;\n destTokenAmount: string; // Atomic amount, the amount received\n feeData: Record<FeeType.METABRIDGE, FeeData> &\n Partial<Record<FeeType, FeeData>>;\n bridgeId: string;\n bridges: string[];\n steps: Step[];\n refuel?: RefuelData;\n priceData?: {\n totalFromAmountUsd?: string;\n totalToAmountUsd?: string;\n priceImpact?: string;\n };\n};\n\n/**\n * This is the type for the quote response from the bridge-api\n * TxDataType can be overriden to be a string when the quote is non-evm\n */\nexport type QuoteResponse<TradeType = TxData, ApprovalType = TxData | null> = {\n quote: Quote;\n approval?: ApprovalType;\n trade: TradeType;\n estimatedProcessingTimeInSeconds: number;\n};\n\nexport enum ChainId {\n ETH = 1,\n OPTIMISM = 10,\n BSC = 56,\n POLYGON = 137,\n ZKSYNC = 324,\n BASE = 8453,\n ARBITRUM = 42161,\n AVALANCHE = 43114,\n LINEA = 59144,\n SOLANA = 1151111081099710,\n}\n\nexport enum FeeType {\n METABRIDGE = 'metabridge',\n REFUEL = 'refuel',\n}\nexport type FeeData = {\n amount: string;\n asset: BridgeAsset;\n};\nexport type TxData = {\n chainId: ChainId;\n to: string;\n from: string;\n value: string;\n data: string;\n gasLimit: number | null;\n};\n\nexport type FeatureFlagsPlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport enum RequestStatus {\n LOADING,\n FETCHED,\n ERROR,\n}\nexport enum BridgeUserAction {\n SELECT_DEST_NETWORK = 'selectDestNetwork',\n UPDATE_QUOTE_PARAMS = 'updateBridgeQuoteRequestParams',\n}\nexport enum BridgeBackgroundAction {\n SET_CHAIN_INTERVAL_LENGTH = 'setChainIntervalLength',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n TRACK_METAMETRICS_EVENT = 'trackUnifiedSwapBridgeEvent',\n}\n\nexport type BridgeControllerState = {\n quoteRequest: Partial<GenericQuoteRequest>;\n quotes: (QuoteResponse & L1GasFees & SolanaFees)[];\n quotesInitialLoadTime: number | null;\n quotesLastFetched: number | null;\n quotesLoadingStatus: RequestStatus | null;\n quoteFetchError: string | null;\n quotesRefreshCount: number;\n /**\n * Asset exchange rates for EVM and multichain assets that are not indexed by the assets controllers\n */\n assetExchangeRates: Record<CaipAssetType, ExchangeRate>;\n};\n\nexport type BridgeControllerAction<\n FunctionName extends keyof BridgeController,\n> = {\n type: `${typeof BRIDGE_CONTROLLER_NAME}:${FunctionName}`;\n handler: BridgeController[FunctionName];\n};\n\n// Maps to BridgeController function names\nexport type BridgeControllerActions =\n | BridgeControllerAction<BridgeBackgroundAction.SET_CHAIN_INTERVAL_LENGTH>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\n | BridgeControllerAction<BridgeBackgroundAction.TRACK_METAMETRICS_EVENT>\n | BridgeControllerAction<BridgeUserAction.UPDATE_QUOTE_PARAMS>;\n\nexport type BridgeControllerEvents = ControllerStateChangeEvent<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerState\n>;\n\nexport type AllowedActions =\n | AccountsControllerGetSelectedMultichainAccountAction\n | GetCurrencyRateState\n | TokenRatesControllerGetStateAction\n | MultichainAssetsRatesControllerGetStateAction\n | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction\n | RemoteFeatureFlagControllerGetStateAction;\nexport type AllowedEvents = never;\n\n/**\n * The messenger for the BridgeController.\n */\nexport type BridgeControllerMessenger = RestrictedMessenger<\n typeof BRIDGE_CONTROLLER_NAME,\n BridgeControllerActions | AllowedActions,\n BridgeControllerEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/bridge-controller",
3
- "version": "21.0.0-preview-7bf3a3b5",
3
+ "version": "22.0.0-preview-971e1a64",
4
4
  "description": "Manages bridge-related quote fetching functionality for MetaMask",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -65,14 +65,14 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "@metamask/accounts-controller": "^28.0.0",
68
- "@metamask/assets-controllers": "^61.0.0",
68
+ "@metamask/assets-controllers": "^62.0.0",
69
69
  "@metamask/auto-changelog": "^3.4.4",
70
70
  "@metamask/eth-json-rpc-provider": "^4.1.8",
71
71
  "@metamask/network-controller": "^23.4.0",
72
72
  "@metamask/remote-feature-flag-controller": "^1.6.0",
73
73
  "@metamask/snaps-controllers": "^11.2.1",
74
74
  "@metamask/superstruct": "^3.1.0",
75
- "@metamask/transaction-controller": "^55.0.0",
75
+ "@metamask/transaction-controller": "^55.0.1",
76
76
  "@types/jest": "^27.4.1",
77
77
  "deepmerge": "^4.2.2",
78
78
  "jest": "^27.5.1",
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@metamask/accounts-controller": "^28.0.0",
89
- "@metamask/assets-controllers": "^61.0.0",
89
+ "@metamask/assets-controllers": "^62.0.0",
90
90
  "@metamask/network-controller": "^23.0.0",
91
91
  "@metamask/remote-feature-flag-controller": "^1.6.0",
92
92
  "@metamask/snaps-controllers": "^11.0.0",