@metamask/bridge-controller 11.0.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +1 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [13.0.0]
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **BREAKING:** Bump `@metamask/transaction-controller` peer dependency to `^54.0.0` ([#5615](https://github.com/MetaMask/core/pull/5615))
|
|
15
|
+
|
|
16
|
+
## [12.0.0]
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Occurrences added to BridgeToken type ([#5572](https://github.com/MetaMask/core/pull/5572))
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **BREAKING:** Bump `@metamask/transaction-controller` peer dependency to `^53.0.0` ([#5585](https://github.com/MetaMask/core/pull/5585))
|
|
25
|
+
- Bump `@metamask/controller-utils` to `^11.7.0` ([#5583](https://github.com/MetaMask/core/pull/5583))
|
|
26
|
+
|
|
10
27
|
## [11.0.0]
|
|
11
28
|
|
|
12
29
|
### Added
|
|
@@ -104,7 +121,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
104
121
|
|
|
105
122
|
- Initial release ([#5317](https://github.com/MetaMask/core/pull/5317))
|
|
106
123
|
|
|
107
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@
|
|
124
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@13.0.0...HEAD
|
|
125
|
+
[13.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@12.0.0...@metamask/bridge-controller@13.0.0
|
|
126
|
+
[12.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@11.0.0...@metamask/bridge-controller@12.0.0
|
|
108
127
|
[11.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@10.0.0...@metamask/bridge-controller@11.0.0
|
|
109
128
|
[10.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@9.0.0...@metamask/bridge-controller@10.0.0
|
|
110
129
|
[9.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@8.0.0...@metamask/bridge-controller@9.0.0
|
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAsCA;;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;AAwCD;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAsDD,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,mDAAqC,CAAA;IACrC,6CAA+B,CAAA;AACjC,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AA6DD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAuCD,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;AAaD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,6DAAoC,CAAA;IACpC,uDAA8B,CAAA;AAChC,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAaD,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,sBAIX;AAJD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;AACxD,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\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 { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\nimport type { BigNumber } from 'bignumber.js';\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 * valueInCurrency values are calculated based on the user's selected currency\n */\nexport type TokenAmountValues = {\n amount: BigNumber;\n valueInCurrency: BigNumber | null;\n usd: BigNumber | null;\n};\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: BigNumber; // 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: string;\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};\n\nexport enum BridgeFlag {\n EXTENSION_CONFIG = 'extension-config',\n MOBILE_CONFIG = 'mobile-config',\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 = {\n [BridgeFlag.EXTENSION_CONFIG]: FeatureFlagResponsePlatformConfig;\n [BridgeFlag.MOBILE_CONFIG]: FeatureFlagResponsePlatformConfig;\n};\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\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};\n\nexport type QuoteResponse = {\n quote: Quote;\n approval?: TxData | null;\n trade: TxData;\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};\nexport enum BridgeFeatureFlagsKey {\n EXTENSION_CONFIG = 'extensionConfig',\n MOBILE_CONFIG = 'mobileConfig',\n}\n\ntype FeatureFlagsPlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport type BridgeFeatureFlags = {\n [BridgeFeatureFlagsKey.EXTENSION_CONFIG]: FeatureFlagsPlatformConfig;\n [BridgeFeatureFlagsKey.MOBILE_CONFIG]: FeatureFlagsPlatformConfig;\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_FEATURE_FLAGS = 'setBridgeFeatureFlags',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n}\n\nexport type BridgeControllerState = {\n bridgeFeatureFlags: BridgeFeatureFlags;\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\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_FEATURE_FLAGS>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\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 | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction;\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":";;;AAsCA;;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;AAwCD;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAuDD,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,mDAAqC,CAAA;IACrC,6CAA+B,CAAA;AACjC,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AA6DD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAuCD,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;AAaD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,6DAAoC,CAAA;IACpC,uDAA8B,CAAA;AAChC,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAaD,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,sBAIX;AAJD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;AACxD,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\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 { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\nimport type { BigNumber } from 'bignumber.js';\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 * valueInCurrency values are calculated based on the user's selected currency\n */\nexport type TokenAmountValues = {\n amount: BigNumber;\n valueInCurrency: BigNumber | null;\n usd: BigNumber | null;\n};\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: BigNumber; // 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: string;\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\nexport enum BridgeFlag {\n EXTENSION_CONFIG = 'extension-config',\n MOBILE_CONFIG = 'mobile-config',\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 = {\n [BridgeFlag.EXTENSION_CONFIG]: FeatureFlagResponsePlatformConfig;\n [BridgeFlag.MOBILE_CONFIG]: FeatureFlagResponsePlatformConfig;\n};\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\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};\n\nexport type QuoteResponse = {\n quote: Quote;\n approval?: TxData | null;\n trade: TxData;\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};\nexport enum BridgeFeatureFlagsKey {\n EXTENSION_CONFIG = 'extensionConfig',\n MOBILE_CONFIG = 'mobileConfig',\n}\n\ntype FeatureFlagsPlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport type BridgeFeatureFlags = {\n [BridgeFeatureFlagsKey.EXTENSION_CONFIG]: FeatureFlagsPlatformConfig;\n [BridgeFeatureFlagsKey.MOBILE_CONFIG]: FeatureFlagsPlatformConfig;\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_FEATURE_FLAGS = 'setBridgeFeatureFlags',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n}\n\nexport type BridgeControllerState = {\n bridgeFeatureFlags: BridgeFeatureFlags;\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\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_FEATURE_FLAGS>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\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 | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction;\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
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oDAAoD,EAAE,sCAAsC;AAC1G,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,iBAAiB,EAAE,oCAAoC;AACrE,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,GAAG,EACJ,wBAAwB;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,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AM,sBAAsB,GAAG,0BAA0B,CAC7D,OAAO,sBAAsB,EAC7B,qBAAqB,CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB,oDAAoD,GACpD,iBAAiB,GACjB,mDAAmD,GACnD,+BAA+B,GAC/B,2CAA2C,CAAC;AAChD,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
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oDAAoD,EAAE,sCAAsC;AAC1G,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACpB,kCAAkC;AACnC,OAAO,KAAK,EACV,mDAAmD,EACnD,+BAA+B,EAC/B,2CAA2C,EAC5C,qCAAqC;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,oCAAoC;AACrE,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,GAAG,EACJ,wBAAwB;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,+BAA2B;AAEjE;;GAEG;AACH,KAAK,qBAAqB,GAAG;IAC3B,YAAY,CAAC,EAAE;QACb,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,CAC1B,KAAK,EAAE,WAAW,GAAG,G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CAAA;IACzB,4BAAiB,CAAA;AACnB,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAaD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,6DAAoC,CAAA;IACpC,uDAA8B,CAAA;AAChC,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAaD,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,sBAIX;AAJD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;AACxD,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,QAIjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\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 { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\nimport type { BigNumber } from 'bignumber.js';\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 * valueInCurrency values are calculated based on the user's selected currency\n */\nexport type TokenAmountValues = {\n amount: BigNumber;\n valueInCurrency: BigNumber | null;\n usd: BigNumber | null;\n};\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: BigNumber; // 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: string;\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};\n\nexport enum BridgeFlag {\n EXTENSION_CONFIG = 'extension-config',\n MOBILE_CONFIG = 'mobile-config',\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 = {\n [BridgeFlag.EXTENSION_CONFIG]: FeatureFlagResponsePlatformConfig;\n [BridgeFlag.MOBILE_CONFIG]: FeatureFlagResponsePlatformConfig;\n};\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\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};\n\nexport type QuoteResponse = {\n quote: Quote;\n approval?: TxData | null;\n trade: TxData;\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};\nexport enum BridgeFeatureFlagsKey {\n EXTENSION_CONFIG = 'extensionConfig',\n MOBILE_CONFIG = 'mobileConfig',\n}\n\ntype FeatureFlagsPlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport type BridgeFeatureFlags = {\n [BridgeFeatureFlagsKey.EXTENSION_CONFIG]: FeatureFlagsPlatformConfig;\n [BridgeFeatureFlagsKey.MOBILE_CONFIG]: FeatureFlagsPlatformConfig;\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_FEATURE_FLAGS = 'setBridgeFeatureFlags',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n}\n\nexport type BridgeControllerState = {\n bridgeFeatureFlags: BridgeFeatureFlags;\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\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_FEATURE_FLAGS>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\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 | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction;\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":"AAsCA;;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;AAwCD;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAuDD,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,mDAAqC,CAAA;IACrC,6CAA+B,CAAA;AACjC,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AA6DD,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAuCD,MAAM,CAAN,IAAY,OAWX;AAXD,WAAY,OAAO;IACjB,mCAAO,CAAA;IACP,8CAAa,CAAA;IACb,oCAAQ,CAAA;IACR,6CAAa,CAAA;IACb,2CAAY,CAAA;IACZ,wCAAW,CAAA;IACX,iDAAgB,CAAA;IAChB,mDAAiB,CAAA;IACjB,2CAAa,CAAA;IACb,wDAAyB,CAAA;AAC3B,CAAC,EAXW,OAAO,KAAP,OAAO,QAWlB;AAED,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,4BAAiB,CAAA;AACnB,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAaD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,6DAAoC,CAAA;IACpC,uDAA8B,CAAA;AAChC,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAaD,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,sBAIX;AAJD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,oDAA0B,CAAA;IAC1B,gFAAsD,CAAA;AACxD,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,QAIjC","sourcesContent":["import type { AccountsControllerGetSelectedMultichainAccountAction } from '@metamask/accounts-controller';\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 { HandleSnapRequest } from '@metamask/snaps-controllers';\nimport type {\n CaipAccountId,\n CaipAssetId,\n CaipChainId,\n Hex,\n} from '@metamask/utils';\nimport type { BigNumber } from 'bignumber.js';\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 * valueInCurrency values are calculated based on the user's selected currency\n */\nexport type TokenAmountValues = {\n amount: BigNumber;\n valueInCurrency: BigNumber | null;\n usd: BigNumber | null;\n};\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: BigNumber; // 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: string;\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\nexport enum BridgeFlag {\n EXTENSION_CONFIG = 'extension-config',\n MOBILE_CONFIG = 'mobile-config',\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 = {\n [BridgeFlag.EXTENSION_CONFIG]: FeatureFlagResponsePlatformConfig;\n [BridgeFlag.MOBILE_CONFIG]: FeatureFlagResponsePlatformConfig;\n};\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\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};\n\nexport type QuoteResponse = {\n quote: Quote;\n approval?: TxData | null;\n trade: TxData;\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};\nexport enum BridgeFeatureFlagsKey {\n EXTENSION_CONFIG = 'extensionConfig',\n MOBILE_CONFIG = 'mobileConfig',\n}\n\ntype FeatureFlagsPlatformConfig = {\n refreshRate: number;\n maxRefreshCount: number;\n support: boolean;\n chains: Record<CaipChainId, ChainConfiguration>;\n};\n\nexport type BridgeFeatureFlags = {\n [BridgeFeatureFlagsKey.EXTENSION_CONFIG]: FeatureFlagsPlatformConfig;\n [BridgeFeatureFlagsKey.MOBILE_CONFIG]: FeatureFlagsPlatformConfig;\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_FEATURE_FLAGS = 'setBridgeFeatureFlags',\n RESET_STATE = 'resetState',\n GET_BRIDGE_ERC20_ALLOWANCE = 'getBridgeERC20Allowance',\n}\n\nexport type BridgeControllerState = {\n bridgeFeatureFlags: BridgeFeatureFlags;\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\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_FEATURE_FLAGS>\n | BridgeControllerAction<BridgeBackgroundAction.RESET_STATE>\n | BridgeControllerAction<BridgeBackgroundAction.GET_BRIDGE_ERC20_ALLOWANCE>\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 | HandleSnapRequest\n | NetworkControllerFindNetworkClientIdByChainIdAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction;\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/bridge-controller",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Manages bridge-related quote fetching functionality for MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@ethersproject/contracts": "^5.7.0",
|
|
54
54
|
"@ethersproject/providers": "^5.7.0",
|
|
55
55
|
"@metamask/base-controller": "^8.0.0",
|
|
56
|
-
"@metamask/controller-utils": "^11.
|
|
57
|
-
"@metamask/keyring-api": "^17.
|
|
56
|
+
"@metamask/controller-utils": "^11.7.0",
|
|
57
|
+
"@metamask/keyring-api": "^17.4.0",
|
|
58
58
|
"@metamask/metamask-eth-abis": "^3.1.1",
|
|
59
59
|
"@metamask/multichain-network-controller": "^0.3.0",
|
|
60
60
|
"@metamask/polling-controller": "^13.0.0",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@metamask/accounts-controller": "^27.0.0",
|
|
66
66
|
"@metamask/auto-changelog": "^3.4.4",
|
|
67
67
|
"@metamask/eth-json-rpc-provider": "^4.1.8",
|
|
68
|
-
"@metamask/network-controller": "^23.
|
|
68
|
+
"@metamask/network-controller": "^23.2.0",
|
|
69
69
|
"@metamask/snaps-controllers": "^9.19.0",
|
|
70
70
|
"@metamask/superstruct": "^3.1.0",
|
|
71
|
-
"@metamask/transaction-controller": "^
|
|
71
|
+
"@metamask/transaction-controller": "^54.0.0",
|
|
72
72
|
"@types/jest": "^27.4.1",
|
|
73
73
|
"deepmerge": "^4.2.2",
|
|
74
74
|
"jest": "^27.5.1",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@metamask/accounts-controller": "^27.0.0",
|
|
85
85
|
"@metamask/network-controller": "^23.0.0",
|
|
86
86
|
"@metamask/snaps-controllers": "^9.19.0",
|
|
87
|
-
"@metamask/transaction-controller": "^
|
|
87
|
+
"@metamask/transaction-controller": "^54.0.0"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": "^18.18 || >=20"
|