@metamask/bridge-controller 67.4.0 → 69.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 +30 -1
- package/dist/bridge-controller.cjs +23 -4
- package/dist/bridge-controller.cjs.map +1 -1
- package/dist/bridge-controller.d.cts +7 -1
- package/dist/bridge-controller.d.cts.map +1 -1
- package/dist/bridge-controller.d.mts +7 -1
- package/dist/bridge-controller.d.mts.map +1 -1
- package/dist/bridge-controller.mjs +23 -4
- package/dist/bridge-controller.mjs.map +1 -1
- package/dist/constants/tokens.cjs +1 -1
- package/dist/constants/tokens.cjs.map +1 -1
- package/dist/constants/tokens.mjs +1 -1
- package/dist/constants/tokens.mjs.map +1 -1
- package/dist/selectors.cjs +24 -16
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +778 -169
- package/dist/selectors.d.cts.map +1 -1
- package/dist/selectors.d.mts +778 -169
- package/dist/selectors.d.mts.map +1 -1
- package/dist/selectors.mjs +24 -16
- package/dist/selectors.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +2 -1
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +2 -1
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +2 -0
- package/dist/utils/feature-flags.d.cts.map +1 -1
- package/dist/utils/feature-flags.d.mts +2 -0
- package/dist/utils/feature-flags.d.mts.map +1 -1
- package/dist/utils/metrics/constants.cjs +1 -0
- package/dist/utils/metrics/constants.cjs.map +1 -1
- package/dist/utils/metrics/constants.d.cts +1 -0
- package/dist/utils/metrics/constants.d.cts.map +1 -1
- package/dist/utils/metrics/constants.d.mts +1 -0
- package/dist/utils/metrics/constants.d.mts.map +1 -1
- package/dist/utils/metrics/constants.mjs +1 -0
- package/dist/utils/metrics/constants.mjs.map +1 -1
- package/dist/utils/metrics/types.cjs.map +1 -1
- package/dist/utils/metrics/types.d.cts +4 -0
- package/dist/utils/metrics/types.d.cts.map +1 -1
- package/dist/utils/metrics/types.d.mts +4 -0
- package/dist/utils/metrics/types.d.mts.map +1 -1
- package/dist/utils/metrics/types.mjs.map +1 -1
- package/dist/utils/validators.cjs +28 -4
- package/dist/utils/validators.cjs.map +1 -1
- package/dist/utils/validators.d.cts +132 -13
- package/dist/utils/validators.d.cts.map +1 -1
- package/dist/utils/validators.d.mts +132 -13
- package/dist/utils/validators.d.mts.map +1 -1
- package/dist/utils/validators.mjs +29 -5
- package/dist/utils/validators.mjs.map +1 -1
- package/package.json +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.cjs","sourceRoot":"","sources":["../../src/utils/validators.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAE/D,uDAgB+B;AAC/B,2CAIyB;AAEzB,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,4BAAiB,CAAA;IACjB,2BAAgB,CAAA;AAClB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB;AAED,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,4BAAe,CAAA;AACjB,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,MAAM,gBAAgB,GAAG,IAAA,oBAAM,EAAS,YAAY,EAAE,CAAC,CAAU,EAAE,EAAE,CACnE,IAAA,oCAAiB,EAAC,CAAW,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAC5D,CAAC;AAEF,MAAM,eAAe,GAAG,IAAA,oBAAM,EAAS,WAAW,EAAE,CAAC,CAAU,EAAE,EAAE,CACjE,IAAA,yBAAiB,EAAC,CAAW,CAAC,CAC/B,CAAC;AAEF,MAAM,mBAAmB,GAAG,IAA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AC,CAAC,CAAC;IAC9D,KAAK,EAAE,IAAA,mBAAK,EAAC;QACX,oBAAY;QACZ,8BAAsB;QACtB,2BAAmB;QACnB,IAAA,oBAAM,GAAE;KACT,CAAC;CACH,CAAC,CAAC;AAEI,MAAM,qBAAqB,GAAG,CACnC,IAAa,EAC8B,EAAE;IAC7C,IAAA,oBAAM,EAAC,IAAI,EAAE,2BAAmB,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AALW,QAAA,qBAAqB,yBAKhC","sourcesContent":["import { isValidHexAddress } from '@metamask/controller-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n string,\n boolean,\n number,\n type,\n is,\n record,\n array,\n nullable,\n optional,\n enums,\n define,\n union,\n assert,\n pattern,\n intersection,\n} from '@metamask/superstruct';\nimport {\n CaipAssetTypeStruct,\n CaipChainIdStruct,\n isStrictHexString,\n} from '@metamask/utils';\n\nexport enum FeeType {\n METABRIDGE = 'metabridge',\n REFUEL = 'refuel',\n TX_FEE = 'txFee',\n}\n\nexport enum FeatureId {\n PERPS = 'perps',\n}\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nconst HexAddressSchema = define<string>('HexAddress', (v: unknown) =>\n isValidHexAddress(v as string, { allowNonPrefixed: false }),\n);\n\nconst HexStringSchema = define<string>('HexString', (v: unknown) =>\n isStrictHexString(v as string),\n);\n\nconst VersionStringSchema = define<string>(\n 'VersionString',\n (v: unknown) =>\n typeof v === 'string' &&\n /^(\\d+\\.*){2}\\d+$/u.test(v) &&\n v.split('.').length === 3,\n);\n\nexport const truthyString = (s: string) => Boolean(s?.length);\nconst TruthyDigitStringSchema = pattern(string(), /^\\d+$/u);\n\nconst ChainIdSchema = number();\n\nexport const BridgeAssetSchema = type({\n /**\n * The chainId of the token\n */\n chainId: ChainIdSchema,\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string(),\n /**\n * The assetId of the token\n */\n assetId: CaipAssetTypeStruct,\n /**\n * The symbol of token object\n */\n symbol: string(),\n /**\n * The name for the network\n */\n name: string(),\n decimals: number(),\n /**\n * URL for token icon\n */\n icon: optional(nullable(string())),\n /**\n * URL for token icon\n */\n iconUrl: optional(nullable(string())),\n});\n\nconst DefaultPairSchema = type({\n /**\n * The standard default pairs. Use this if the pair is only set once.\n * The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.\n */\n standard: record(string(), string()),\n /**\n * The other default pairs. Use this if the dest token depends on the src token and can be set multiple times.\n * The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.\n */\n other: record(string(), string()),\n});\n\nexport const ChainRankingItemSchema = type({\n /**\n * The CAIP-2 chain identifier (e.g., \"eip155:1\" for Ethereum mainnet)\n */\n chainId: CaipChainIdStruct,\n /**\n * The display name of the chain (e.g., \"Ethereum\")\n */\n name: string(),\n});\n\nexport const ChainRankingSchema = optional(array(ChainRankingItemSchema));\n\nexport const ChainConfigurationSchema = type({\n isActiveSrc: boolean(),\n isActiveDest: boolean(),\n refreshRate: optional(number()),\n topAssets: optional(array(string())),\n stablecoins: optional(array(string())),\n isUnifiedUIEnabled: optional(boolean()),\n isSingleSwapBridgeButtonEnabled: optional(boolean()),\n isGaslessSwapEnabled: optional(boolean()),\n noFeeAssets: optional(array(string())),\n defaultPairs: optional(DefaultPairSchema),\n});\n\nexport const PriceImpactThresholdSchema = type({\n gasless: number(),\n normal: number(),\n});\n\nconst GenericQuoteRequestSchema = type({\n aggIds: optional(array(string())),\n bridgeIds: optional(array(string())),\n fee: optional(number()),\n});\n\nconst FeatureIdSchema = enums(Object.values(FeatureId));\n\n/**\n * This is the schema for the feature flags response from the RemoteFeatureFlagController\n */\nexport const PlatformConfigSchema = type({\n priceImpactThreshold: optional(PriceImpactThresholdSchema),\n quoteRequestOverrides: optional(\n record(FeatureIdSchema, optional(GenericQuoteRequestSchema)),\n ),\n minimumVersion: string(),\n refreshRate: number(),\n maxRefreshCount: number(),\n support: boolean(),\n chains: record(string(), ChainConfigurationSchema),\n /**\n * The bip44 default pairs for the chains\n * Key is the CAIP chainId namespace\n */\n bip44DefaultPairs: optional(record(string(), optional(DefaultPairSchema))),\n sse: optional(\n type({\n enabled: boolean(),\n /**\n * The minimum version of the client required to enable SSE, for example 13.8.0\n */\n minimumVersion: VersionStringSchema,\n }),\n ),\n /**\n * Array of chain objects ordered by preference/ranking\n */\n chainRanking: ChainRankingSchema,\n});\n\nexport const validateFeatureFlagsResponse = (\n data: unknown,\n): data is Infer<typeof PlatformConfigSchema> => {\n return is(data, PlatformConfigSchema);\n};\n\nexport const validateSwapsTokenObject = (\n data: unknown,\n): data is Infer<typeof BridgeAssetSchema> => {\n return is(data, BridgeAssetSchema);\n};\n\nexport const FeeDataSchema = type({\n amount: TruthyDigitStringSchema,\n asset: BridgeAssetSchema,\n});\n\nexport const ProtocolSchema = type({\n name: string(),\n displayName: optional(string()),\n icon: optional(string()),\n});\n\nexport const StepSchema = type({\n action: enums(Object.values(ActionTypes)),\n srcChainId: ChainIdSchema,\n destChainId: optional(ChainIdSchema),\n srcAsset: BridgeAssetSchema,\n destAsset: BridgeAssetSchema,\n srcAmount: string(),\n destAmount: string(),\n protocol: ProtocolSchema,\n});\n\nconst RefuelDataSchema = StepSchema;\n\n// Allow digit strings for amounts/validTo for flexibility across providers\nconst DigitStringOrNumberSchema = union([TruthyDigitStringSchema, number()]);\n\n/**\n * Identifier of the intent protocol used for order creation and submission.\n *\n * Examples:\n * - CoW Swap\n * - Other EIP-712–based intent protocols\n */\nconst IntentProtocolSchema = string();\n\n/**\n * Schema for an intent-based order used for EIP-712 signing and submission.\n *\n * This represents the minimal subset of fields required by intent-based\n * protocols (e.g. CoW Swap) to build, sign, and submit an order.\n */\nexport const IntentOrderSchema = type({\n /**\n * Address of the token being sold.\n */\n sellToken: HexAddressSchema,\n\n /**\n * Address of the token being bought.\n */\n buyToken: HexAddressSchema,\n\n /**\n * Optional receiver of the bought tokens.\n * If omitted, defaults to the signer / order owner.\n */\n receiver: optional(HexAddressSchema),\n\n /**\n * Order expiration time.\n *\n * Can be provided as a UNIX timestamp in seconds, either as a number\n * or as a digit string, depending on provider requirements.\n */\n validTo: DigitStringOrNumberSchema,\n\n /**\n * Arbitrary application-specific data attached to the order.\n */\n appData: string(),\n\n /**\n * Hash of the `appData` field, used for EIP-712 signing.\n */\n appDataHash: HexStringSchema,\n\n /**\n * Fee amount paid for order execution, expressed as a digit string.\n */\n feeAmount: TruthyDigitStringSchema,\n\n /**\n * Order kind.\n *\n * - `sell`: exact sell amount, variable buy amount\n * - `buy`: exact buy amount, variable sell amount\n */\n kind: enums(['sell', 'buy']),\n\n /**\n * Whether the order can be partially filled.\n */\n partiallyFillable: boolean(),\n\n /**\n * Exact amount of the sell token.\n *\n * Required for `sell` orders.\n */\n sellAmount: optional(TruthyDigitStringSchema),\n\n /**\n * Exact amount of the buy token.\n *\n * Required for `buy` orders.\n */\n buyAmount: optional(TruthyDigitStringSchema),\n\n /**\n * Optional order owner / sender address.\n *\n * Provided for convenience when building the EIP-712 domain and message.\n */\n from: optional(HexAddressSchema),\n});\n\n/**\n * Schema representing an intent submission payload.\n *\n * Wraps the intent order along with protocol and optional routing metadata\n * required by the backend or relayer infrastructure.\n */\nexport const IntentSchema = type({\n /**\n * Identifier of the intent protocol used to interpret the order.\n */\n protocol: IntentProtocolSchema,\n\n /**\n * The intent order to be signed and submitted.\n */\n order: IntentOrderSchema,\n\n /**\n * Optional settlement contract address used for execution.\n */\n settlementContract: optional(HexAddressSchema),\n\n /**\n * Optional relayer address responsible for order submission.\n */\n relayer: optional(HexAddressSchema),\n});\n\nexport const QuoteSchema = type({\n requestId: string(),\n srcChainId: ChainIdSchema,\n srcAsset: BridgeAssetSchema,\n /**\n * The amount sent, in atomic amount: amount sent - fees\n * Some tokens have a fee of 0, so sometimes it's equal to amount sent\n */\n srcTokenAmount: string(),\n destChainId: ChainIdSchema,\n destAsset: BridgeAssetSchema,\n /**\n * The amount received, in atomic amount\n */\n destTokenAmount: string(),\n /**\n * The minimum amount that will be received, in atomic amount\n */\n minDestTokenAmount: string(),\n feeData: type({\n [FeeType.METABRIDGE]: FeeDataSchema,\n /**\n * This is the fee for the swap transaction taken from either the\n * src or dest token if the quote has gas fees included or \"gasless\"\n */\n [FeeType.TX_FEE]: optional(\n intersection([\n FeeDataSchema,\n type({\n maxFeePerGas: string(),\n maxPriorityFeePerGas: string(),\n }),\n ]),\n ),\n }),\n gasIncluded: optional(boolean()),\n /**\n * Whether the quote can use EIP-7702 delegated gasless execution\n */\n gasIncluded7702: optional(boolean()),\n bridgeId: string(),\n bridges: array(string()),\n steps: array(StepSchema),\n refuel: optional(RefuelDataSchema),\n priceData: optional(\n type({\n totalFromAmountUsd: optional(string()),\n totalToAmountUsd: optional(string()),\n priceImpact: optional(string()),\n totalFeeAmountUsd: optional(string()),\n }),\n ),\n intent: optional(IntentSchema),\n /**\n * A third party sponsors the gas. If true, then gasIncluded7702 is also true.\n */\n gasSponsored: optional(boolean()),\n});\n\nexport const TxDataSchema = type({\n chainId: number(),\n to: HexAddressSchema,\n from: HexAddressSchema,\n value: HexStringSchema,\n data: HexStringSchema,\n gasLimit: nullable(number()),\n effectiveGas: optional(number()),\n});\n\nexport const BitcoinTradeDataSchema = type({\n unsignedPsbtBase64: string(),\n inputsToSign: nullable(array(type({}))),\n});\n\nexport const TronTradeDataSchema = type({\n raw_data_hex: string(),\n visible: optional(boolean()),\n raw_data: optional(\n nullable(\n type({\n contract: optional(\n array(\n type({\n type: optional(string()),\n }),\n ),\n ),\n fee_limit: optional(number()),\n }),\n ),\n ),\n});\n\nexport const QuoteResponseSchema = type({\n quote: QuoteSchema,\n estimatedProcessingTimeInSeconds: number(),\n approval: optional(union([TxDataSchema, TronTradeDataSchema])),\n trade: union([\n TxDataSchema,\n BitcoinTradeDataSchema,\n TronTradeDataSchema,\n string(),\n ]),\n});\n\nexport const validateQuoteResponse = (\n data: unknown,\n): data is Infer<typeof QuoteResponseSchema> => {\n assert(data, QuoteResponseSchema);\n return true;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"validators.cjs","sourceRoot":"","sources":["../../src/utils/validators.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAE/D,uDAiB+B;AAC/B,2CAIyB;AAEzB,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,oCAAyB,CAAA;IACzB,4BAAiB,CAAA;IACjB,2BAAgB,CAAA;AAClB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB;AAED,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,4BAAe,CAAA;AACjB,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,MAAM,gBAAgB,GAAG,IAAA,oBAAM,EAAS,YAAY,EAAE,CAAC,CAAU,EAAE,EAAE,CACnE,IAAA,oCAAiB,EAAC,CAAW,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAC5D,CAAC;AAEF,MAAM,eAAe,GAAG,IAAA,oBAAM,EAAS,WAAW,EAAE,CAAC,CAAU,EAAE,EAAE,CACjE,IAAA,yBAAiB,EAAC,CAAW,CAAC,CAC/B,CAAC;AAEF,MAAM,mBAAmB,GAAG,IAAA,oBAAM,EAChC,eAAe,EACf,CAAC,CAAU,EAAE,EAAE,CACb,OAAO,CAAC,KAAK,QAAQ;IACrB,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAC5B,CAAC;AAEK,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAAjD,QAAA,YAAY,gBAAqC;AAC9D,MAAM,uBAAuB,GAAG,I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BAAK,EACH,IAAA,kBAAI,EAAC;YACH,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;SACzB,CAAC,CACH,CACF;QACD,SAAS,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;KAC9B,CAAC,CACH,CACF;CACF,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,IAAA,kBAAI,EAAC;IACtC,KAAK,EAAE,mBAAW;IAClB,gCAAgC,EAAE,IAAA,oBAAM,GAAE;IAC1C,QAAQ,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,oBAAY,EAAE,2BAAmB,CAAC,CAAC,CAAC;IAC9D,KAAK,EAAE,IAAA,mBAAK,EAAC;QACX,oBAAY;QACZ,8BAAsB;QACtB,2BAAmB;QACnB,IAAA,oBAAM,GAAE;KACT,CAAC;CACH,CAAC,CAAC;AAEI,MAAM,qBAAqB,GAAG,CACnC,IAAa,EAC8B,EAAE;IAC7C,IAAA,oBAAM,EAAC,IAAI,EAAE,2BAAmB,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AALW,QAAA,qBAAqB,yBAKhC","sourcesContent":["import { isValidHexAddress } from '@metamask/controller-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n any,\n string,\n boolean,\n number,\n type,\n is,\n record,\n array,\n nullable,\n optional,\n enums,\n define,\n union,\n assert,\n pattern,\n intersection,\n} from '@metamask/superstruct';\nimport {\n CaipAssetTypeStruct,\n CaipChainIdStruct,\n isStrictHexString,\n} from '@metamask/utils';\n\nexport enum FeeType {\n METABRIDGE = 'metabridge',\n REFUEL = 'refuel',\n TX_FEE = 'txFee',\n}\n\nexport enum FeatureId {\n PERPS = 'perps',\n}\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nconst HexAddressSchema = define<string>('HexAddress', (v: unknown) =>\n isValidHexAddress(v as string, { allowNonPrefixed: false }),\n);\n\nconst HexStringSchema = define<string>('HexString', (v: unknown) =>\n isStrictHexString(v as string),\n);\n\nconst VersionStringSchema = define<string>(\n 'VersionString',\n (v: unknown) =>\n typeof v === 'string' &&\n /^(\\d+\\.*){2}\\d+$/u.test(v) &&\n v.split('.').length === 3,\n);\n\nexport const truthyString = (s: string) => Boolean(s?.length);\nconst TruthyDigitStringSchema = pattern(string(), /^\\d+$/u);\n\nconst ChainIdSchema = number();\n\nexport const BridgeAssetSchema = type({\n /**\n * The chainId of the token\n */\n chainId: ChainIdSchema,\n /**\n * An address that the metaswap-api recognizes as the default token\n */\n address: string(),\n /**\n * The assetId of the token\n */\n assetId: CaipAssetTypeStruct,\n /**\n * The symbol of token object\n */\n symbol: string(),\n /**\n * The name for the network\n */\n name: string(),\n decimals: number(),\n /**\n * URL for token icon\n */\n icon: optional(nullable(string())),\n /**\n * URL for token icon\n */\n iconUrl: optional(nullable(string())),\n});\n\nconst DefaultPairSchema = type({\n /**\n * The standard default pairs. Use this if the pair is only set once.\n * The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.\n */\n standard: record(string(), string()),\n /**\n * The other default pairs. Use this if the dest token depends on the src token and can be set multiple times.\n * The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.\n */\n other: record(string(), string()),\n});\n\nexport const ChainRankingItemSchema = type({\n /**\n * The CAIP-2 chain identifier (e.g., \"eip155:1\" for Ethereum mainnet)\n */\n chainId: CaipChainIdStruct,\n /**\n * The display name of the chain (e.g., \"Ethereum\")\n */\n name: string(),\n});\n\nexport const ChainRankingSchema = optional(array(ChainRankingItemSchema));\n\nexport const ChainConfigurationSchema = type({\n isActiveSrc: boolean(),\n isActiveDest: boolean(),\n refreshRate: optional(number()),\n topAssets: optional(array(string())),\n stablecoins: optional(array(string())),\n isUnifiedUIEnabled: optional(boolean()),\n isSingleSwapBridgeButtonEnabled: optional(boolean()),\n isGaslessSwapEnabled: optional(boolean()),\n noFeeAssets: optional(array(string())),\n defaultPairs: optional(DefaultPairSchema),\n});\n\nexport const PriceImpactThresholdSchema = type({\n // TODO:\n // We are moving into a unified approach where\n // price impact thresholds will be segmented by\n // importance rather than transaction type.\n // The introduction of warning/danger will first be handled\n // by mobile, followed by extension and then removal of gasless/normal\n // from LD configs.\n // To make the migration easier, we define all fields as optional for now.\n // After the migration takes place, gasless/normal will be removed\n // and warning/danger will be set as required fields.\n gasless: number(), // Percentage value in decimal format (eg 0.02 is 2%)\n normal: number(), // Percentage value in decimal format\n warning: optional(number()), // Percentage value in decimal format\n error: optional(number()), // Percentage value in decimal format\n});\n\nconst GenericQuoteRequestSchema = type({\n aggIds: optional(array(string())),\n bridgeIds: optional(array(string())),\n fee: optional(number()),\n});\n\nconst FeatureIdSchema = enums(Object.values(FeatureId));\n\n/**\n * This is the schema for the feature flags response from the RemoteFeatureFlagController\n */\nexport const PlatformConfigSchema = type({\n priceImpactThreshold: optional(PriceImpactThresholdSchema),\n quoteRequestOverrides: optional(\n record(FeatureIdSchema, optional(GenericQuoteRequestSchema)),\n ),\n minimumVersion: string(),\n refreshRate: number(),\n maxRefreshCount: number(),\n support: boolean(),\n chains: record(string(), ChainConfigurationSchema),\n /**\n * The bip44 default pairs for the chains\n * Key is the CAIP chainId namespace\n */\n bip44DefaultPairs: optional(record(string(), optional(DefaultPairSchema))),\n sse: optional(\n type({\n enabled: boolean(),\n /**\n * The minimum version of the client required to enable SSE, for example 13.8.0\n */\n minimumVersion: VersionStringSchema,\n }),\n ),\n /**\n * Array of chain objects ordered by preference/ranking\n */\n chainRanking: ChainRankingSchema,\n});\n\nexport const validateFeatureFlagsResponse = (\n data: unknown,\n): data is Infer<typeof PlatformConfigSchema> => {\n return is(data, PlatformConfigSchema);\n};\n\nexport const validateSwapsTokenObject = (\n data: unknown,\n): data is Infer<typeof BridgeAssetSchema> => {\n return is(data, BridgeAssetSchema);\n};\n\nexport const FeeDataSchema = type({\n amount: TruthyDigitStringSchema,\n asset: BridgeAssetSchema,\n});\n\nexport const ProtocolSchema = type({\n name: string(),\n displayName: optional(string()),\n icon: optional(string()),\n});\n\nexport const StepSchema = type({\n action: enums(Object.values(ActionTypes)),\n srcChainId: ChainIdSchema,\n destChainId: optional(ChainIdSchema),\n srcAsset: BridgeAssetSchema,\n destAsset: BridgeAssetSchema,\n srcAmount: string(),\n destAmount: string(),\n protocol: ProtocolSchema,\n});\n\nconst RefuelDataSchema = StepSchema;\n\n// Allow digit strings for amounts/validTo for flexibility across providers\nconst DigitStringOrNumberSchema = union([TruthyDigitStringSchema, number()]);\n\n/**\n * Identifier of the intent protocol used for order creation and submission.\n *\n * Examples:\n * - CoW Swap\n * - Other EIP-712–based intent protocols\n */\nconst IntentProtocolSchema = string();\n\n/**\n * Schema for an intent-based order used for EIP-712 signing and submission.\n *\n * This represents the minimal subset of fields required by intent-based\n * protocols (e.g. CoW Swap) to build, sign, and submit an order.\n */\nexport const IntentOrderSchema = type({\n /**\n * Address of the token being sold.\n */\n sellToken: HexAddressSchema,\n\n /**\n * Address of the token being bought.\n */\n buyToken: HexAddressSchema,\n\n /**\n * Optional receiver of the bought tokens.\n * If omitted, defaults to the signer / order owner.\n */\n receiver: optional(HexAddressSchema),\n\n /**\n * Order expiration time.\n *\n * Can be provided as a UNIX timestamp in seconds, either as a number\n * or as a digit string, depending on provider requirements.\n */\n validTo: DigitStringOrNumberSchema,\n\n /**\n * Arbitrary application-specific data attached to the order.\n */\n appData: string(),\n\n /**\n * Hash of the `appData` field, used for EIP-712 signing.\n */\n appDataHash: HexStringSchema,\n\n /**\n * Fee amount paid for order execution, expressed as a digit string.\n */\n feeAmount: TruthyDigitStringSchema,\n\n /**\n * Order kind.\n *\n * - `sell`: exact sell amount, variable buy amount\n * - `buy`: exact buy amount, variable sell amount\n */\n kind: enums(['sell', 'buy']),\n\n /**\n * Whether the order can be partially filled.\n */\n partiallyFillable: boolean(),\n\n /**\n * Exact amount of the sell token.\n *\n * Required for `sell` orders.\n */\n sellAmount: optional(TruthyDigitStringSchema),\n\n /**\n * Exact amount of the buy token.\n *\n * Required for `buy` orders.\n */\n buyAmount: optional(TruthyDigitStringSchema),\n\n /**\n * Optional order owner / sender address.\n *\n * Provided for convenience when building the EIP-712 domain and message.\n */\n from: optional(HexAddressSchema),\n});\n\n/**\n * Schema representing an intent submission payload.\n *\n * Wraps the intent order along with protocol and optional routing metadata\n * required by the backend or relayer infrastructure.\n */\nexport const IntentSchema = type({\n /**\n * Identifier of the intent protocol used to interpret the order.\n */\n protocol: IntentProtocolSchema,\n\n /**\n * The intent order to be signed and submitted.\n */\n order: IntentOrderSchema,\n\n /**\n * Optional settlement contract address used for execution.\n */\n settlementContract: optional(HexAddressSchema),\n\n /**\n * Optional EIP-712 typed data payload for signing.\n * Must be JSON-serializable and include required EIP-712 fields.\n */\n typedData: type({\n // Keep values as `any()` here. Using `unknown()` in this record causes\n // TS2321/TS2589 (excessive type instantiation depth) in bridge state\n // inference during build.\n types: record(\n string(),\n array(\n type({\n name: string(),\n type: string(),\n }),\n ),\n ),\n primaryType: string(),\n domain: record(string(), any()),\n message: record(string(), any()),\n }),\n});\n\nexport const QuoteSchema = type({\n requestId: string(),\n srcChainId: ChainIdSchema,\n srcAsset: BridgeAssetSchema,\n /**\n * The amount sent, in atomic amount: amount sent - fees\n * Some tokens have a fee of 0, so sometimes it's equal to amount sent\n */\n srcTokenAmount: string(),\n destChainId: ChainIdSchema,\n destAsset: BridgeAssetSchema,\n /**\n * The amount received, in atomic amount\n */\n destTokenAmount: string(),\n /**\n * The minimum amount that will be received, in atomic amount\n */\n minDestTokenAmount: string(),\n feeData: type({\n [FeeType.METABRIDGE]: FeeDataSchema,\n /**\n * This is the fee for the swap transaction taken from either the\n * src or dest token if the quote has gas fees included or \"gasless\"\n */\n [FeeType.TX_FEE]: optional(\n intersection([\n FeeDataSchema,\n type({\n maxFeePerGas: string(),\n maxPriorityFeePerGas: string(),\n }),\n ]),\n ),\n }),\n gasIncluded: optional(boolean()),\n /**\n * Whether the quote can use EIP-7702 delegated gasless execution\n */\n gasIncluded7702: optional(boolean()),\n bridgeId: string(),\n bridges: array(string()),\n steps: array(StepSchema),\n refuel: optional(RefuelDataSchema),\n priceData: optional(\n type({\n totalFromAmountUsd: optional(string()),\n totalToAmountUsd: optional(string()),\n priceImpact: optional(string()),\n totalFeeAmountUsd: optional(string()),\n }),\n ),\n intent: optional(IntentSchema),\n /**\n * A third party sponsors the gas. If true, then gasIncluded7702 is also true.\n */\n gasSponsored: optional(boolean()),\n});\n\nexport const TxDataSchema = type({\n chainId: number(),\n to: HexAddressSchema,\n from: HexAddressSchema,\n value: HexStringSchema,\n data: HexStringSchema,\n gasLimit: nullable(number()),\n effectiveGas: optional(number()),\n});\n\nexport const BitcoinTradeDataSchema = type({\n unsignedPsbtBase64: string(),\n inputsToSign: nullable(array(type({}))),\n});\n\nexport const TronTradeDataSchema = type({\n raw_data_hex: string(),\n visible: optional(boolean()),\n raw_data: optional(\n nullable(\n type({\n contract: optional(\n array(\n type({\n type: optional(string()),\n }),\n ),\n ),\n fee_limit: optional(number()),\n }),\n ),\n ),\n});\n\nexport const QuoteResponseSchema = type({\n quote: QuoteSchema,\n estimatedProcessingTimeInSeconds: number(),\n approval: optional(union([TxDataSchema, TronTradeDataSchema])),\n trade: union([\n TxDataSchema,\n BitcoinTradeDataSchema,\n TronTradeDataSchema,\n string(),\n ]),\n});\n\nexport const validateQuoteResponse = (\n data: unknown,\n): data is Infer<typeof QuoteResponseSchema> => {\n assert(data, QuoteResponseSchema);\n return true;\n};\n"]}
|
|
@@ -124,9 +124,13 @@ export declare const ChainConfigurationSchema: import("@metamask/superstruct").S
|
|
|
124
124
|
export declare const PriceImpactThresholdSchema: import("@metamask/superstruct").Struct<{
|
|
125
125
|
gasless: number;
|
|
126
126
|
normal: number;
|
|
127
|
+
warning?: number | undefined;
|
|
128
|
+
error?: number | undefined;
|
|
127
129
|
}, {
|
|
128
130
|
gasless: import("@metamask/superstruct").Struct<number, null>;
|
|
129
131
|
normal: import("@metamask/superstruct").Struct<number, null>;
|
|
132
|
+
warning: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
133
|
+
error: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
130
134
|
}>;
|
|
131
135
|
/**
|
|
132
136
|
* This is the schema for the feature flags response from the RemoteFeatureFlagController
|
|
@@ -154,6 +158,8 @@ export declare const PlatformConfigSchema: import("@metamask/superstruct").Struc
|
|
|
154
158
|
priceImpactThreshold?: {
|
|
155
159
|
gasless: number;
|
|
156
160
|
normal: number;
|
|
161
|
+
warning?: number | undefined;
|
|
162
|
+
error?: number | undefined;
|
|
157
163
|
} | undefined;
|
|
158
164
|
quoteRequestOverrides?: Record<FeatureId, {
|
|
159
165
|
aggIds?: string[] | undefined;
|
|
@@ -176,9 +182,13 @@ export declare const PlatformConfigSchema: import("@metamask/superstruct").Struc
|
|
|
176
182
|
priceImpactThreshold: import("@metamask/superstruct").Struct<{
|
|
177
183
|
gasless: number;
|
|
178
184
|
normal: number;
|
|
185
|
+
warning?: number | undefined;
|
|
186
|
+
error?: number | undefined;
|
|
179
187
|
} | undefined, {
|
|
180
188
|
gasless: import("@metamask/superstruct").Struct<number, null>;
|
|
181
189
|
normal: import("@metamask/superstruct").Struct<number, null>;
|
|
190
|
+
warning: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
191
|
+
error: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
182
192
|
}>;
|
|
183
193
|
quoteRequestOverrides: import("@metamask/superstruct").Struct<Record<FeatureId, {
|
|
184
194
|
aggIds?: string[] | undefined;
|
|
@@ -265,6 +275,8 @@ export declare const validateFeatureFlagsResponse: (data: unknown) => data is {
|
|
|
265
275
|
priceImpactThreshold?: {
|
|
266
276
|
gasless: number;
|
|
267
277
|
normal: number;
|
|
278
|
+
warning?: number | undefined;
|
|
279
|
+
error?: number | undefined;
|
|
268
280
|
} | undefined;
|
|
269
281
|
quoteRequestOverrides?: Record<FeatureId, {
|
|
270
282
|
aggIds?: string[] | undefined;
|
|
@@ -596,8 +608,16 @@ export declare const IntentSchema: import("@metamask/superstruct").Struct<{
|
|
|
596
608
|
buyAmount?: string | undefined;
|
|
597
609
|
from?: string | undefined;
|
|
598
610
|
};
|
|
611
|
+
typedData: {
|
|
612
|
+
types: Record<string, {
|
|
613
|
+
name: string;
|
|
614
|
+
type: string;
|
|
615
|
+
}[]>;
|
|
616
|
+
primaryType: string;
|
|
617
|
+
domain: Record<string, any>;
|
|
618
|
+
message: Record<string, any>;
|
|
619
|
+
};
|
|
599
620
|
settlementContract?: string | undefined;
|
|
600
|
-
relayer?: string | undefined;
|
|
601
621
|
}, {
|
|
602
622
|
/**
|
|
603
623
|
* Identifier of the intent protocol used to interpret the order.
|
|
@@ -690,9 +710,26 @@ export declare const IntentSchema: import("@metamask/superstruct").Struct<{
|
|
|
690
710
|
*/
|
|
691
711
|
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
692
712
|
/**
|
|
693
|
-
* Optional
|
|
713
|
+
* Optional EIP-712 typed data payload for signing.
|
|
714
|
+
* Must be JSON-serializable and include required EIP-712 fields.
|
|
694
715
|
*/
|
|
695
|
-
|
|
716
|
+
typedData: import("@metamask/superstruct").Struct<{
|
|
717
|
+
types: Record<string, {
|
|
718
|
+
name: string;
|
|
719
|
+
type: string;
|
|
720
|
+
}[]>;
|
|
721
|
+
primaryType: string;
|
|
722
|
+
domain: Record<string, any>;
|
|
723
|
+
message: Record<string, any>;
|
|
724
|
+
}, {
|
|
725
|
+
types: import("@metamask/superstruct").Struct<Record<string, {
|
|
726
|
+
name: string;
|
|
727
|
+
type: string;
|
|
728
|
+
}[]>, null>;
|
|
729
|
+
primaryType: import("@metamask/superstruct").Struct<string, null>;
|
|
730
|
+
domain: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
731
|
+
message: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
732
|
+
}>;
|
|
696
733
|
}>;
|
|
697
734
|
export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
698
735
|
srcChainId: number;
|
|
@@ -842,8 +879,16 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
842
879
|
buyAmount?: string | undefined;
|
|
843
880
|
from?: string | undefined;
|
|
844
881
|
};
|
|
882
|
+
typedData: {
|
|
883
|
+
types: Record<string, {
|
|
884
|
+
name: string;
|
|
885
|
+
type: string;
|
|
886
|
+
}[]>;
|
|
887
|
+
primaryType: string;
|
|
888
|
+
domain: Record<string, any>;
|
|
889
|
+
message: Record<string, any>;
|
|
890
|
+
};
|
|
845
891
|
settlementContract?: string | undefined;
|
|
846
|
-
relayer?: string | undefined;
|
|
847
892
|
} | undefined;
|
|
848
893
|
gasSponsored?: boolean | undefined;
|
|
849
894
|
}, {
|
|
@@ -1377,8 +1422,16 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
1377
1422
|
buyAmount?: string | undefined;
|
|
1378
1423
|
from?: string | undefined;
|
|
1379
1424
|
};
|
|
1425
|
+
typedData: {
|
|
1426
|
+
types: Record<string, {
|
|
1427
|
+
name: string;
|
|
1428
|
+
type: string;
|
|
1429
|
+
}[]>;
|
|
1430
|
+
primaryType: string;
|
|
1431
|
+
domain: Record<string, any>;
|
|
1432
|
+
message: Record<string, any>;
|
|
1433
|
+
};
|
|
1380
1434
|
settlementContract?: string | undefined;
|
|
1381
|
-
relayer?: string | undefined;
|
|
1382
1435
|
} | undefined, {
|
|
1383
1436
|
/**
|
|
1384
1437
|
* Identifier of the intent protocol used to interpret the order.
|
|
@@ -1471,9 +1524,26 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
1471
1524
|
*/
|
|
1472
1525
|
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1473
1526
|
/**
|
|
1474
|
-
* Optional
|
|
1527
|
+
* Optional EIP-712 typed data payload for signing.
|
|
1528
|
+
* Must be JSON-serializable and include required EIP-712 fields.
|
|
1475
1529
|
*/
|
|
1476
|
-
|
|
1530
|
+
typedData: import("@metamask/superstruct").Struct<{
|
|
1531
|
+
types: Record<string, {
|
|
1532
|
+
name: string;
|
|
1533
|
+
type: string;
|
|
1534
|
+
}[]>;
|
|
1535
|
+
primaryType: string;
|
|
1536
|
+
domain: Record<string, any>;
|
|
1537
|
+
message: Record<string, any>;
|
|
1538
|
+
}, {
|
|
1539
|
+
types: import("@metamask/superstruct").Struct<Record<string, {
|
|
1540
|
+
name: string;
|
|
1541
|
+
type: string;
|
|
1542
|
+
}[]>, null>;
|
|
1543
|
+
primaryType: import("@metamask/superstruct").Struct<string, null>;
|
|
1544
|
+
domain: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
1545
|
+
message: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
1546
|
+
}>;
|
|
1477
1547
|
}>;
|
|
1478
1548
|
/**
|
|
1479
1549
|
* A third party sponsors the gas. If true, then gasIncluded7702 is also true.
|
|
@@ -1681,8 +1751,16 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
1681
1751
|
buyAmount?: string | undefined;
|
|
1682
1752
|
from?: string | undefined;
|
|
1683
1753
|
};
|
|
1754
|
+
typedData: {
|
|
1755
|
+
types: Record<string, {
|
|
1756
|
+
name: string;
|
|
1757
|
+
type: string;
|
|
1758
|
+
}[]>;
|
|
1759
|
+
primaryType: string;
|
|
1760
|
+
domain: Record<string, any>;
|
|
1761
|
+
message: Record<string, any>;
|
|
1762
|
+
};
|
|
1684
1763
|
settlementContract?: string | undefined;
|
|
1685
|
-
relayer?: string | undefined;
|
|
1686
1764
|
} | undefined;
|
|
1687
1765
|
gasSponsored?: boolean | undefined;
|
|
1688
1766
|
};
|
|
@@ -1875,8 +1953,16 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
1875
1953
|
buyAmount?: string | undefined;
|
|
1876
1954
|
from?: string | undefined;
|
|
1877
1955
|
};
|
|
1956
|
+
typedData: {
|
|
1957
|
+
types: Record<string, {
|
|
1958
|
+
name: string;
|
|
1959
|
+
type: string;
|
|
1960
|
+
}[]>;
|
|
1961
|
+
primaryType: string;
|
|
1962
|
+
domain: Record<string, any>;
|
|
1963
|
+
message: Record<string, any>;
|
|
1964
|
+
};
|
|
1878
1965
|
settlementContract?: string | undefined;
|
|
1879
|
-
relayer?: string | undefined;
|
|
1880
1966
|
} | undefined;
|
|
1881
1967
|
gasSponsored?: boolean | undefined;
|
|
1882
1968
|
}, {
|
|
@@ -2410,8 +2496,16 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
2410
2496
|
buyAmount?: string | undefined;
|
|
2411
2497
|
from?: string | undefined;
|
|
2412
2498
|
};
|
|
2499
|
+
typedData: {
|
|
2500
|
+
types: Record<string, {
|
|
2501
|
+
name: string;
|
|
2502
|
+
type: string;
|
|
2503
|
+
}[]>;
|
|
2504
|
+
primaryType: string;
|
|
2505
|
+
domain: Record<string, any>;
|
|
2506
|
+
message: Record<string, any>;
|
|
2507
|
+
};
|
|
2413
2508
|
settlementContract?: string | undefined;
|
|
2414
|
-
relayer?: string | undefined;
|
|
2415
2509
|
} | undefined, {
|
|
2416
2510
|
/**
|
|
2417
2511
|
* Identifier of the intent protocol used to interpret the order.
|
|
@@ -2504,9 +2598,26 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
2504
2598
|
*/
|
|
2505
2599
|
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2506
2600
|
/**
|
|
2507
|
-
* Optional
|
|
2601
|
+
* Optional EIP-712 typed data payload for signing.
|
|
2602
|
+
* Must be JSON-serializable and include required EIP-712 fields.
|
|
2508
2603
|
*/
|
|
2509
|
-
|
|
2604
|
+
typedData: import("@metamask/superstruct").Struct<{
|
|
2605
|
+
types: Record<string, {
|
|
2606
|
+
name: string;
|
|
2607
|
+
type: string;
|
|
2608
|
+
}[]>;
|
|
2609
|
+
primaryType: string;
|
|
2610
|
+
domain: Record<string, any>;
|
|
2611
|
+
message: Record<string, any>;
|
|
2612
|
+
}, {
|
|
2613
|
+
types: import("@metamask/superstruct").Struct<Record<string, {
|
|
2614
|
+
name: string;
|
|
2615
|
+
type: string;
|
|
2616
|
+
}[]>, null>;
|
|
2617
|
+
primaryType: import("@metamask/superstruct").Struct<string, null>;
|
|
2618
|
+
domain: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
2619
|
+
message: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
2620
|
+
}>;
|
|
2510
2621
|
}>;
|
|
2511
2622
|
/**
|
|
2512
2623
|
* A third party sponsors the gas. If true, then gasIncluded7702 is also true.
|
|
@@ -2703,8 +2814,16 @@ export declare const validateQuoteResponse: (data: unknown) => data is {
|
|
|
2703
2814
|
buyAmount?: string | undefined;
|
|
2704
2815
|
from?: string | undefined;
|
|
2705
2816
|
};
|
|
2817
|
+
typedData: {
|
|
2818
|
+
types: Record<string, {
|
|
2819
|
+
name: string;
|
|
2820
|
+
type: string;
|
|
2821
|
+
}[]>;
|
|
2822
|
+
primaryType: string;
|
|
2823
|
+
domain: Record<string, any>;
|
|
2824
|
+
message: Record<string, any>;
|
|
2825
|
+
};
|
|
2706
2826
|
settlementContract?: string | undefined;
|
|
2707
|
-
relayer?: string | undefined;
|
|
2708
2827
|
} | undefined;
|
|
2709
2828
|
gasSponsored?: boolean | undefined;
|
|
2710
2829
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.cts","sourceRoot":"","sources":["../../src/utils/validators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validators.d.cts","sourceRoot":"","sources":["../../src/utils/validators.ts"],"names":[],"mappings":"AA0BA,oBAAY,OAAO;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,UAAU;CACjB;AAED,oBAAY,SAAS;IACnB,KAAK,UAAU;CAChB;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW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,qBAAqB,SAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAId,CAAC"}
|
|
@@ -124,9 +124,13 @@ export declare const ChainConfigurationSchema: import("@metamask/superstruct").S
|
|
|
124
124
|
export declare const PriceImpactThresholdSchema: import("@metamask/superstruct").Struct<{
|
|
125
125
|
gasless: number;
|
|
126
126
|
normal: number;
|
|
127
|
+
warning?: number | undefined;
|
|
128
|
+
error?: number | undefined;
|
|
127
129
|
}, {
|
|
128
130
|
gasless: import("@metamask/superstruct").Struct<number, null>;
|
|
129
131
|
normal: import("@metamask/superstruct").Struct<number, null>;
|
|
132
|
+
warning: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
133
|
+
error: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
130
134
|
}>;
|
|
131
135
|
/**
|
|
132
136
|
* This is the schema for the feature flags response from the RemoteFeatureFlagController
|
|
@@ -154,6 +158,8 @@ export declare const PlatformConfigSchema: import("@metamask/superstruct").Struc
|
|
|
154
158
|
priceImpactThreshold?: {
|
|
155
159
|
gasless: number;
|
|
156
160
|
normal: number;
|
|
161
|
+
warning?: number | undefined;
|
|
162
|
+
error?: number | undefined;
|
|
157
163
|
} | undefined;
|
|
158
164
|
quoteRequestOverrides?: Record<FeatureId, {
|
|
159
165
|
aggIds?: string[] | undefined;
|
|
@@ -176,9 +182,13 @@ export declare const PlatformConfigSchema: import("@metamask/superstruct").Struc
|
|
|
176
182
|
priceImpactThreshold: import("@metamask/superstruct").Struct<{
|
|
177
183
|
gasless: number;
|
|
178
184
|
normal: number;
|
|
185
|
+
warning?: number | undefined;
|
|
186
|
+
error?: number | undefined;
|
|
179
187
|
} | undefined, {
|
|
180
188
|
gasless: import("@metamask/superstruct").Struct<number, null>;
|
|
181
189
|
normal: import("@metamask/superstruct").Struct<number, null>;
|
|
190
|
+
warning: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
191
|
+
error: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
182
192
|
}>;
|
|
183
193
|
quoteRequestOverrides: import("@metamask/superstruct").Struct<Record<FeatureId, {
|
|
184
194
|
aggIds?: string[] | undefined;
|
|
@@ -265,6 +275,8 @@ export declare const validateFeatureFlagsResponse: (data: unknown) => data is {
|
|
|
265
275
|
priceImpactThreshold?: {
|
|
266
276
|
gasless: number;
|
|
267
277
|
normal: number;
|
|
278
|
+
warning?: number | undefined;
|
|
279
|
+
error?: number | undefined;
|
|
268
280
|
} | undefined;
|
|
269
281
|
quoteRequestOverrides?: Record<FeatureId, {
|
|
270
282
|
aggIds?: string[] | undefined;
|
|
@@ -596,8 +608,16 @@ export declare const IntentSchema: import("@metamask/superstruct").Struct<{
|
|
|
596
608
|
buyAmount?: string | undefined;
|
|
597
609
|
from?: string | undefined;
|
|
598
610
|
};
|
|
611
|
+
typedData: {
|
|
612
|
+
types: Record<string, {
|
|
613
|
+
name: string;
|
|
614
|
+
type: string;
|
|
615
|
+
}[]>;
|
|
616
|
+
primaryType: string;
|
|
617
|
+
domain: Record<string, any>;
|
|
618
|
+
message: Record<string, any>;
|
|
619
|
+
};
|
|
599
620
|
settlementContract?: string | undefined;
|
|
600
|
-
relayer?: string | undefined;
|
|
601
621
|
}, {
|
|
602
622
|
/**
|
|
603
623
|
* Identifier of the intent protocol used to interpret the order.
|
|
@@ -690,9 +710,26 @@ export declare const IntentSchema: import("@metamask/superstruct").Struct<{
|
|
|
690
710
|
*/
|
|
691
711
|
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
692
712
|
/**
|
|
693
|
-
* Optional
|
|
713
|
+
* Optional EIP-712 typed data payload for signing.
|
|
714
|
+
* Must be JSON-serializable and include required EIP-712 fields.
|
|
694
715
|
*/
|
|
695
|
-
|
|
716
|
+
typedData: import("@metamask/superstruct").Struct<{
|
|
717
|
+
types: Record<string, {
|
|
718
|
+
name: string;
|
|
719
|
+
type: string;
|
|
720
|
+
}[]>;
|
|
721
|
+
primaryType: string;
|
|
722
|
+
domain: Record<string, any>;
|
|
723
|
+
message: Record<string, any>;
|
|
724
|
+
}, {
|
|
725
|
+
types: import("@metamask/superstruct").Struct<Record<string, {
|
|
726
|
+
name: string;
|
|
727
|
+
type: string;
|
|
728
|
+
}[]>, null>;
|
|
729
|
+
primaryType: import("@metamask/superstruct").Struct<string, null>;
|
|
730
|
+
domain: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
731
|
+
message: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
732
|
+
}>;
|
|
696
733
|
}>;
|
|
697
734
|
export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
698
735
|
srcChainId: number;
|
|
@@ -842,8 +879,16 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
842
879
|
buyAmount?: string | undefined;
|
|
843
880
|
from?: string | undefined;
|
|
844
881
|
};
|
|
882
|
+
typedData: {
|
|
883
|
+
types: Record<string, {
|
|
884
|
+
name: string;
|
|
885
|
+
type: string;
|
|
886
|
+
}[]>;
|
|
887
|
+
primaryType: string;
|
|
888
|
+
domain: Record<string, any>;
|
|
889
|
+
message: Record<string, any>;
|
|
890
|
+
};
|
|
845
891
|
settlementContract?: string | undefined;
|
|
846
|
-
relayer?: string | undefined;
|
|
847
892
|
} | undefined;
|
|
848
893
|
gasSponsored?: boolean | undefined;
|
|
849
894
|
}, {
|
|
@@ -1377,8 +1422,16 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
1377
1422
|
buyAmount?: string | undefined;
|
|
1378
1423
|
from?: string | undefined;
|
|
1379
1424
|
};
|
|
1425
|
+
typedData: {
|
|
1426
|
+
types: Record<string, {
|
|
1427
|
+
name: string;
|
|
1428
|
+
type: string;
|
|
1429
|
+
}[]>;
|
|
1430
|
+
primaryType: string;
|
|
1431
|
+
domain: Record<string, any>;
|
|
1432
|
+
message: Record<string, any>;
|
|
1433
|
+
};
|
|
1380
1434
|
settlementContract?: string | undefined;
|
|
1381
|
-
relayer?: string | undefined;
|
|
1382
1435
|
} | undefined, {
|
|
1383
1436
|
/**
|
|
1384
1437
|
* Identifier of the intent protocol used to interpret the order.
|
|
@@ -1471,9 +1524,26 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
1471
1524
|
*/
|
|
1472
1525
|
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1473
1526
|
/**
|
|
1474
|
-
* Optional
|
|
1527
|
+
* Optional EIP-712 typed data payload for signing.
|
|
1528
|
+
* Must be JSON-serializable and include required EIP-712 fields.
|
|
1475
1529
|
*/
|
|
1476
|
-
|
|
1530
|
+
typedData: import("@metamask/superstruct").Struct<{
|
|
1531
|
+
types: Record<string, {
|
|
1532
|
+
name: string;
|
|
1533
|
+
type: string;
|
|
1534
|
+
}[]>;
|
|
1535
|
+
primaryType: string;
|
|
1536
|
+
domain: Record<string, any>;
|
|
1537
|
+
message: Record<string, any>;
|
|
1538
|
+
}, {
|
|
1539
|
+
types: import("@metamask/superstruct").Struct<Record<string, {
|
|
1540
|
+
name: string;
|
|
1541
|
+
type: string;
|
|
1542
|
+
}[]>, null>;
|
|
1543
|
+
primaryType: import("@metamask/superstruct").Struct<string, null>;
|
|
1544
|
+
domain: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
1545
|
+
message: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
1546
|
+
}>;
|
|
1477
1547
|
}>;
|
|
1478
1548
|
/**
|
|
1479
1549
|
* A third party sponsors the gas. If true, then gasIncluded7702 is also true.
|
|
@@ -1681,8 +1751,16 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
1681
1751
|
buyAmount?: string | undefined;
|
|
1682
1752
|
from?: string | undefined;
|
|
1683
1753
|
};
|
|
1754
|
+
typedData: {
|
|
1755
|
+
types: Record<string, {
|
|
1756
|
+
name: string;
|
|
1757
|
+
type: string;
|
|
1758
|
+
}[]>;
|
|
1759
|
+
primaryType: string;
|
|
1760
|
+
domain: Record<string, any>;
|
|
1761
|
+
message: Record<string, any>;
|
|
1762
|
+
};
|
|
1684
1763
|
settlementContract?: string | undefined;
|
|
1685
|
-
relayer?: string | undefined;
|
|
1686
1764
|
} | undefined;
|
|
1687
1765
|
gasSponsored?: boolean | undefined;
|
|
1688
1766
|
};
|
|
@@ -1875,8 +1953,16 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
1875
1953
|
buyAmount?: string | undefined;
|
|
1876
1954
|
from?: string | undefined;
|
|
1877
1955
|
};
|
|
1956
|
+
typedData: {
|
|
1957
|
+
types: Record<string, {
|
|
1958
|
+
name: string;
|
|
1959
|
+
type: string;
|
|
1960
|
+
}[]>;
|
|
1961
|
+
primaryType: string;
|
|
1962
|
+
domain: Record<string, any>;
|
|
1963
|
+
message: Record<string, any>;
|
|
1964
|
+
};
|
|
1878
1965
|
settlementContract?: string | undefined;
|
|
1879
|
-
relayer?: string | undefined;
|
|
1880
1966
|
} | undefined;
|
|
1881
1967
|
gasSponsored?: boolean | undefined;
|
|
1882
1968
|
}, {
|
|
@@ -2410,8 +2496,16 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
2410
2496
|
buyAmount?: string | undefined;
|
|
2411
2497
|
from?: string | undefined;
|
|
2412
2498
|
};
|
|
2499
|
+
typedData: {
|
|
2500
|
+
types: Record<string, {
|
|
2501
|
+
name: string;
|
|
2502
|
+
type: string;
|
|
2503
|
+
}[]>;
|
|
2504
|
+
primaryType: string;
|
|
2505
|
+
domain: Record<string, any>;
|
|
2506
|
+
message: Record<string, any>;
|
|
2507
|
+
};
|
|
2413
2508
|
settlementContract?: string | undefined;
|
|
2414
|
-
relayer?: string | undefined;
|
|
2415
2509
|
} | undefined, {
|
|
2416
2510
|
/**
|
|
2417
2511
|
* Identifier of the intent protocol used to interpret the order.
|
|
@@ -2504,9 +2598,26 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
2504
2598
|
*/
|
|
2505
2599
|
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2506
2600
|
/**
|
|
2507
|
-
* Optional
|
|
2601
|
+
* Optional EIP-712 typed data payload for signing.
|
|
2602
|
+
* Must be JSON-serializable and include required EIP-712 fields.
|
|
2508
2603
|
*/
|
|
2509
|
-
|
|
2604
|
+
typedData: import("@metamask/superstruct").Struct<{
|
|
2605
|
+
types: Record<string, {
|
|
2606
|
+
name: string;
|
|
2607
|
+
type: string;
|
|
2608
|
+
}[]>;
|
|
2609
|
+
primaryType: string;
|
|
2610
|
+
domain: Record<string, any>;
|
|
2611
|
+
message: Record<string, any>;
|
|
2612
|
+
}, {
|
|
2613
|
+
types: import("@metamask/superstruct").Struct<Record<string, {
|
|
2614
|
+
name: string;
|
|
2615
|
+
type: string;
|
|
2616
|
+
}[]>, null>;
|
|
2617
|
+
primaryType: import("@metamask/superstruct").Struct<string, null>;
|
|
2618
|
+
domain: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
2619
|
+
message: import("@metamask/superstruct").Struct<Record<string, any>, null>;
|
|
2620
|
+
}>;
|
|
2510
2621
|
}>;
|
|
2511
2622
|
/**
|
|
2512
2623
|
* A third party sponsors the gas. If true, then gasIncluded7702 is also true.
|
|
@@ -2703,8 +2814,16 @@ export declare const validateQuoteResponse: (data: unknown) => data is {
|
|
|
2703
2814
|
buyAmount?: string | undefined;
|
|
2704
2815
|
from?: string | undefined;
|
|
2705
2816
|
};
|
|
2817
|
+
typedData: {
|
|
2818
|
+
types: Record<string, {
|
|
2819
|
+
name: string;
|
|
2820
|
+
type: string;
|
|
2821
|
+
}[]>;
|
|
2822
|
+
primaryType: string;
|
|
2823
|
+
domain: Record<string, any>;
|
|
2824
|
+
message: Record<string, any>;
|
|
2825
|
+
};
|
|
2706
2826
|
settlementContract?: string | undefined;
|
|
2707
|
-
relayer?: string | undefined;
|
|
2708
2827
|
} | undefined;
|
|
2709
2828
|
gasSponsored?: boolean | undefined;
|
|
2710
2829
|
};
|