@metamask-previews/bridge-controller 80.1.1-preview-e12b5ece6 → 80.1.1-preview-2f57247
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 +2 -1
- package/dist/validators/feature-flags.cjs +2 -0
- package/dist/validators/feature-flags.cjs.map +1 -1
- package/dist/validators/feature-flags.d.cts +3 -1
- package/dist/validators/feature-flags.d.cts.map +1 -1
- package/dist/validators/feature-flags.d.mts +3 -1
- package/dist/validators/feature-flags.d.mts.map +1 -1
- package/dist/validators/feature-flags.mjs +2 -0
- package/dist/validators/feature-flags.mjs.map +1 -1
- package/dist/validators/quote-response-v1.d.cts +2 -0
- package/dist/validators/quote-response-v1.d.cts.map +1 -1
- package/dist/validators/quote-response-v1.d.mts +2 -0
- package/dist/validators/quote-response-v1.d.mts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -15,10 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
15
|
- Optional `failure_phase` and `error_code` on Quotes Error and Failed event context types
|
|
16
16
|
- Optional `source_hash_present` and `destination_hash_present` on Failed, Submitted, and Completed event context types
|
|
17
17
|
- Submit and status classifiers live in `@metamask/bridge-status-controller`
|
|
18
|
+
- Add `recurring_buy` and `limit_order` FeatureIds ([#10096](https://github.com/MetaMask/core/pull/10096))
|
|
18
19
|
|
|
19
20
|
### Changed
|
|
20
21
|
|
|
21
|
-
- Bump `@metamask/assets-controller` from `^14.0.2` to `^
|
|
22
|
+
- Bump `@metamask/assets-controller` from `^14.0.2` to `^15.0.0` ([#10042](https://github.com/MetaMask/core/pull/10042), [#10088](https://github.com/MetaMask/core/pull/10088))
|
|
22
23
|
- Bump `@metamask/transaction-controller` from `^69.6.1` to `^69.8.0` ([#10046](https://github.com/MetaMask/core/pull/10046), [#10080](https://github.com/MetaMask/core/pull/10080))
|
|
23
24
|
- Bump `@metamask/utils` from `^11.11.0` to `^11.12.0` ([#10076](https://github.com/MetaMask/core/pull/10076))
|
|
24
25
|
|
|
@@ -14,6 +14,8 @@ var FeatureId;
|
|
|
14
14
|
FeatureId["DAPP_SWAP"] = "dapp_swap";
|
|
15
15
|
FeatureId["BATCH_SELL"] = "batch_sell";
|
|
16
16
|
FeatureId["UNIFIED_SWAP_BRIDGE"] = "unified_swap_bridge";
|
|
17
|
+
FeatureId["LIMIT_ORDER"] = "limit_order";
|
|
18
|
+
FeatureId["RECURRING_BUY"] = "recurring_buy";
|
|
17
19
|
})(FeatureId || (exports.FeatureId = FeatureId = {}));
|
|
18
20
|
exports.VersionStringSchema = (0, superstruct_1.define)('VersionString', (value) => typeof value === 'string' &&
|
|
19
21
|
/^(\d+\.*){2}\d+$/u.test(value) &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.cjs","sourceRoot":"","sources":["../../src/validators/feature-flags.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,uDAU+B;AAE/B,2CAAyE;AAEzE,IAAY,
|
|
1
|
+
{"version":3,"file":"feature-flags.cjs","sourceRoot":"","sources":["../../src/validators/feature-flags.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,uDAU+B;AAE/B,2CAAyE;AAEzE,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,gCAAmB,CAAA;IACnB,4BAAe,CAAA;IACf,kEAAqD,CAAA;IACrD,gEAAmD,CAAA;IACnD,oDAAuC,CAAA;IACvC,oCAAuB,CAAA;IACvB,sCAAyB,CAAA;IACzB,wDAA2C,CAAA;IAC3C,wCAA2B,CAAA;IAC3B,4CAA+B,CAAA;AACjC,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,oBAAM,EACvC,eAAe,EACf,CAAC,KAAc,EAAE,EAAE,CACjB,OAAO,KAAK,KAAK,QAAQ;IACzB,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/B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AA,oBAAM,GAAE;IACrB,eAAe,EAAE,IAAA,oBAAM,GAAE;IACzB,OAAO,EAAE,IAAA,qBAAO,GAAE;IAClB,MAAM,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,gCAAwB,CAAC;IAClD;;;OAGG;IACH,iBAAiB,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,sBAAQ,EAAC,iBAAiB,CAAC,CAAC,CAAC;IAC1E,GAAG,EAAE,IAAA,sBAAQ,EACX,IAAA,kBAAI,EAAC;QACH,OAAO,EAAE,IAAA,qBAAO,GAAE;QAClB;;WAEG;QACH,cAAc,EAAE,2BAAmB;KACpC,CAAC,CACH;IACD;;OAEG;IACH,YAAY,EAAE,0BAAkB;IAChC,0BAA0B,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CAC/C,CAAC,CAAC;AAEI,MAAM,4BAA4B,GAAG,CAC1C,IAAa,EAC+B,EAAE;IAC9C,OAAO,IAAA,gBAAE,EAAC,IAAI,EAAE,4BAAoB,CAAC,CAAC;AACxC,CAAC,CAAC;AAJW,QAAA,4BAA4B,gCAIvC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport {\n type,\n record,\n string,\n optional,\n array,\n boolean,\n number,\n is,\n define,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\nimport { CaipChainIdStruct, CaipAssetTypeStruct } from '@metamask/utils';\n\nexport enum FeatureId {\n UNKNOWN = 'unknown',\n PERPS = 'perps',\n QUICK_BUY_FOLLOW_TRADING = 'quick_buy_follow_trading',\n QUICK_BUY_TOKEN_DETAILS = 'quick_buy_token_details',\n QUICK_BUY_EXPLORE = 'quick_buy_explore',\n DAPP_SWAP = 'dapp_swap',\n BATCH_SELL = 'batch_sell',\n UNIFIED_SWAP_BRIDGE = 'unified_swap_bridge',\n LIMIT_ORDER = 'limit_order',\n RECURRING_BUY = 'recurring_buy',\n}\n\nexport const VersionStringSchema = define<string>(\n 'VersionString',\n (value: unknown) =>\n typeof value === 'string' &&\n /^(\\d+\\.*){2}\\d+$/u.test(value) &&\n value.split('.').length === 3,\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 batchSellDestStablecoins: optional(array(CaipAssetTypeStruct)),\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 // 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\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(string(), 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 maxPendingHistoryItemAgeMs: optional(number()),\n});\n\nexport const validateFeatureFlagsResponse = (\n data: unknown,\n): data is Infer<typeof PlatformConfigSchema> => {\n return is(data, PlatformConfigSchema);\n};\n"]}
|
|
@@ -6,7 +6,9 @@ export declare enum FeatureId {
|
|
|
6
6
|
QUICK_BUY_EXPLORE = "quick_buy_explore",
|
|
7
7
|
DAPP_SWAP = "dapp_swap",
|
|
8
8
|
BATCH_SELL = "batch_sell",
|
|
9
|
-
UNIFIED_SWAP_BRIDGE = "unified_swap_bridge"
|
|
9
|
+
UNIFIED_SWAP_BRIDGE = "unified_swap_bridge",
|
|
10
|
+
LIMIT_ORDER = "limit_order",
|
|
11
|
+
RECURRING_BUY = "recurring_buy"
|
|
10
12
|
}
|
|
11
13
|
export declare const VersionStringSchema: import("@metamask/superstruct").Struct<string, null>;
|
|
12
14
|
export declare const ChainRankingItemSchema: import("@metamask/superstruct").Struct<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.d.cts","sourceRoot":"","sources":["../../src/validators/feature-flags.ts"],"names":[],"mappings":"AAeA,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,wBAAwB,6BAA6B;IACrD,uBAAuB,4BAA4B;IACnD,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,mBAAmB,wBAAwB;
|
|
1
|
+
{"version":3,"file":"feature-flags.d.cts","sourceRoot":"","sources":["../../src/validators/feature-flags.ts"],"names":[],"mappings":"AAeA,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,wBAAwB,6BAA6B;IACrD,uBAAuB,4BAA4B;IACnD,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,mBAAmB,wBAAwB;IAC3C,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;CAChC;AAED,eAAO,MAAM,mBAAmB,sDAM/B,CAAC;AAeF,eAAO,MAAM,sBAAsB;;;;IACjC;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;IAV7B;;OAEG;;IAEH;;OAEG;;GAIoE,CAAC;AAE1E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAzBnC;;;WAGG;;QAEH;;;WAGG;;;EA6BH,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;EAcrC,CAAC;AAQH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAU/B;;;OAGG;;;;;;;;;;QAKC;;WAEG;;;IAIP;;OAEG;;;;;;;;QA7EH;;WAEG;;QAEH;;WAEG;;;;EA0EH,CAAC;AAEH,eAAO,MAAM,4BAA4B,SACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGd,CAAC"}
|
|
@@ -6,7 +6,9 @@ export declare enum FeatureId {
|
|
|
6
6
|
QUICK_BUY_EXPLORE = "quick_buy_explore",
|
|
7
7
|
DAPP_SWAP = "dapp_swap",
|
|
8
8
|
BATCH_SELL = "batch_sell",
|
|
9
|
-
UNIFIED_SWAP_BRIDGE = "unified_swap_bridge"
|
|
9
|
+
UNIFIED_SWAP_BRIDGE = "unified_swap_bridge",
|
|
10
|
+
LIMIT_ORDER = "limit_order",
|
|
11
|
+
RECURRING_BUY = "recurring_buy"
|
|
10
12
|
}
|
|
11
13
|
export declare const VersionStringSchema: import("@metamask/superstruct").Struct<string, null>;
|
|
12
14
|
export declare const ChainRankingItemSchema: import("@metamask/superstruct").Struct<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.d.mts","sourceRoot":"","sources":["../../src/validators/feature-flags.ts"],"names":[],"mappings":"AAeA,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,wBAAwB,6BAA6B;IACrD,uBAAuB,4BAA4B;IACnD,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,mBAAmB,wBAAwB;
|
|
1
|
+
{"version":3,"file":"feature-flags.d.mts","sourceRoot":"","sources":["../../src/validators/feature-flags.ts"],"names":[],"mappings":"AAeA,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,wBAAwB,6BAA6B;IACrD,uBAAuB,4BAA4B;IACnD,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,mBAAmB,wBAAwB;IAC3C,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;CAChC;AAED,eAAO,MAAM,mBAAmB,sDAM/B,CAAC;AAeF,eAAO,MAAM,sBAAsB;;;;IACjC;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;IAV7B;;OAEG;;IAEH;;OAEG;;GAIoE,CAAC;AAE1E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAzBnC;;;WAGG;;QAEH;;;WAGG;;;EA6BH,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;EAcrC,CAAC;AAQH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAU/B;;;OAGG;;;;;;;;;;QAKC;;WAEG;;;IAIP;;OAEG;;;;;;;;QA7EH;;WAEG;;QAEH;;WAEG;;;;EA0EH,CAAC;AAEH,eAAO,MAAM,4BAA4B,SACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGd,CAAC"}
|
|
@@ -11,6 +11,8 @@ export var FeatureId;
|
|
|
11
11
|
FeatureId["DAPP_SWAP"] = "dapp_swap";
|
|
12
12
|
FeatureId["BATCH_SELL"] = "batch_sell";
|
|
13
13
|
FeatureId["UNIFIED_SWAP_BRIDGE"] = "unified_swap_bridge";
|
|
14
|
+
FeatureId["LIMIT_ORDER"] = "limit_order";
|
|
15
|
+
FeatureId["RECURRING_BUY"] = "recurring_buy";
|
|
14
16
|
})(FeatureId || (FeatureId = {}));
|
|
15
17
|
export const VersionStringSchema = define('VersionString', (value) => typeof value === 'string' &&
|
|
16
18
|
/^(\d+\.*){2}\d+$/u.test(value) &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.mjs","sourceRoot":"","sources":["../../src/validators/feature-flags.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EACL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAK,EACL,OAAO,EACP,MAAM,EACN,EAAE,EACF,MAAM,EACP,8BAA8B;AAE/B,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,wBAAwB;AAEzE,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"feature-flags.mjs","sourceRoot":"","sources":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AC,CAAC;IACpC,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CACxB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;IACvC,oBAAoB,EAAE,QAAQ,CAAC,0BAA0B,CAAC;IAC1D,qBAAqB,EAAE,QAAQ,CAC7B,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CACtD;IACD,cAAc,EAAE,MAAM,EAAE;IACxB,WAAW,EAAE,MAAM,EAAE;IACrB,eAAe,EAAE,MAAM,EAAE;IACzB,OAAO,EAAE,OAAO,EAAE;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,wBAAwB,CAAC;IAClD;;;OAGG;IACH,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC1E,GAAG,EAAE,QAAQ,CACX,IAAI,CAAC;QACH,OAAO,EAAE,OAAO,EAAE;QAClB;;WAEG;QACH,cAAc,EAAE,mBAAmB;KACpC,CAAC,CACH;IACD;;OAEG;IACH,YAAY,EAAE,kBAAkB;IAChC,0BAA0B,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CAC/C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,IAAa,EAC+B,EAAE;IAC9C,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport {\n type,\n record,\n string,\n optional,\n array,\n boolean,\n number,\n is,\n define,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\nimport { CaipChainIdStruct, CaipAssetTypeStruct } from '@metamask/utils';\n\nexport enum FeatureId {\n UNKNOWN = 'unknown',\n PERPS = 'perps',\n QUICK_BUY_FOLLOW_TRADING = 'quick_buy_follow_trading',\n QUICK_BUY_TOKEN_DETAILS = 'quick_buy_token_details',\n QUICK_BUY_EXPLORE = 'quick_buy_explore',\n DAPP_SWAP = 'dapp_swap',\n BATCH_SELL = 'batch_sell',\n UNIFIED_SWAP_BRIDGE = 'unified_swap_bridge',\n LIMIT_ORDER = 'limit_order',\n RECURRING_BUY = 'recurring_buy',\n}\n\nexport const VersionStringSchema = define<string>(\n 'VersionString',\n (value: unknown) =>\n typeof value === 'string' &&\n /^(\\d+\\.*){2}\\d+$/u.test(value) &&\n value.split('.').length === 3,\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 batchSellDestStablecoins: optional(array(CaipAssetTypeStruct)),\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 // 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\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(string(), 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 maxPendingHistoryItemAgeMs: optional(number()),\n});\n\nexport const validateFeatureFlagsResponse = (\n data: unknown,\n): data is Infer<typeof PlatformConfigSchema> => {\n return is(data, PlatformConfigSchema);\n};\n"]}
|
|
@@ -218,6 +218,8 @@ export declare const QuoteResponseSchemaV1: import("@metamask/superstruct").Stru
|
|
|
218
218
|
dapp_swap: FeatureId.DAPP_SWAP;
|
|
219
219
|
batch_sell: FeatureId.BATCH_SELL;
|
|
220
220
|
unified_swap_bridge: FeatureId.UNIFIED_SWAP_BRIDGE;
|
|
221
|
+
limit_order: FeatureId.LIMIT_ORDER;
|
|
222
|
+
recurring_buy: FeatureId.RECURRING_BUY;
|
|
221
223
|
}>;
|
|
222
224
|
quoteId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
223
225
|
quote: import("@metamask/superstruct").Struct<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote-response-v1.d.cts","sourceRoot":"","sources":["../../src/validators/quote-response-v1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAYnD,OAAO,EAAE,SAAS,EAAE,4BAA2B;AAS/C,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,MAAM,EACP,oBAAmB;AAEpB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"quote-response-v1.d.cts","sourceRoot":"","sources":["../../src/validators/quote-response-v1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAYnD,OAAO,EAAE,SAAS,EAAE,4BAA2B;AAS/C,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,MAAM,EACP,oBAAmB;AAEpB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAehC,CAAC;AAEH,eAAO,MAAM,uBAAuB,SAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAId,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,CACzB,UAAU,GACN,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,aAAa,GACb,gBAAgB,EACpB,YAAY,GAAG,MAAM,GAAG,aAAa,IACnC,KAAK,CAAC,OAAO,qBAAqB,CAAC,GAAG;IACxC,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
|
|
@@ -218,6 +218,8 @@ export declare const QuoteResponseSchemaV1: import("@metamask/superstruct").Stru
|
|
|
218
218
|
dapp_swap: FeatureId.DAPP_SWAP;
|
|
219
219
|
batch_sell: FeatureId.BATCH_SELL;
|
|
220
220
|
unified_swap_bridge: FeatureId.UNIFIED_SWAP_BRIDGE;
|
|
221
|
+
limit_order: FeatureId.LIMIT_ORDER;
|
|
222
|
+
recurring_buy: FeatureId.RECURRING_BUY;
|
|
221
223
|
}>;
|
|
222
224
|
quoteId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
223
225
|
quote: import("@metamask/superstruct").Struct<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote-response-v1.d.mts","sourceRoot":"","sources":["../../src/validators/quote-response-v1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAYnD,OAAO,EAAE,SAAS,EAAE,4BAA2B;AAS/C,OAAO,KAAK,EACV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Ae,CACzB,UAAU,GACN,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,aAAa,GACb,gBAAgB,EACpB,YAAY,GAAG,MAAM,GAAG,aAAa,IACnC,KAAK,CAAC,OAAO,qBAAqB,CAAC,GAAG;IACxC,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/bridge-controller",
|
|
3
|
-
"version": "80.1.1-preview-
|
|
3
|
+
"version": "80.1.1-preview-2f57247",
|
|
4
4
|
"description": "Manages bridge-related quote fetching functionality for MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@ethersproject/contracts": "^5.7.0",
|
|
61
61
|
"@ethersproject/providers": "^5.7.0",
|
|
62
62
|
"@metamask/accounts-controller": "^39.1.1",
|
|
63
|
-
"@metamask/assets-controller": "^
|
|
63
|
+
"@metamask/assets-controller": "^15.0.0",
|
|
64
64
|
"@metamask/assets-controllers": "^111.1.3",
|
|
65
65
|
"@metamask/base-controller": "^9.1.0",
|
|
66
66
|
"@metamask/controller-utils": "^12.3.0",
|