@metamask-previews/bridge-controller 77.3.2-preview-0e180da1e → 77.3.2-preview-b3fa32653
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 +0 -4
- package/dist/bridge-controller.cjs.map +1 -1
- package/dist/bridge-controller.d.cts +2 -3
- package/dist/bridge-controller.d.cts.map +1 -1
- package/dist/bridge-controller.d.mts +2 -3
- package/dist/bridge-controller.d.mts.map +1 -1
- package/dist/bridge-controller.mjs +1 -1
- package/dist/bridge-controller.mjs.map +1 -1
- package/dist/index.cjs +30 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -14
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +5 -14
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -10
- package/dist/index.mjs.map +1 -1
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +6483 -5934
- package/dist/selectors.d.cts.map +1 -1
- package/dist/selectors.d.mts +6483 -5934
- package/dist/selectors.d.mts.map +1 -1
- package/dist/selectors.mjs.map +1 -1
- package/dist/types.cjs +12 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +41 -21
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +41 -21
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +11 -0
- package/dist/types.mjs.map +1 -1
- package/dist/utils/bridge.cjs +0 -1
- package/dist/utils/bridge.cjs.map +1 -1
- package/dist/utils/bridge.d.cts +3 -4
- package/dist/utils/bridge.d.cts.map +1 -1
- package/dist/utils/bridge.d.mts +3 -4
- package/dist/utils/bridge.d.mts.map +1 -1
- package/dist/utils/bridge.mjs +0 -1
- package/dist/utils/bridge.mjs.map +1 -1
- package/dist/utils/feature-flags.cjs +2 -2
- package/dist/utils/feature-flags.cjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +1 -1
- package/dist/utils/feature-flags.d.mts +1 -1
- package/dist/utils/feature-flags.mjs +1 -1
- package/dist/utils/feature-flags.mjs.map +1 -1
- package/dist/utils/fetch.cjs +11 -16
- package/dist/utils/fetch.cjs.map +1 -1
- package/dist/utils/fetch.d.cts +1 -3
- package/dist/utils/fetch.d.cts.map +1 -1
- package/dist/utils/fetch.d.mts +1 -3
- package/dist/utils/fetch.d.mts.map +1 -1
- package/dist/utils/fetch.mjs +4 -9
- package/dist/utils/fetch.mjs.map +1 -1
- package/dist/utils/metrics/properties.cjs +2 -2
- package/dist/utils/metrics/properties.cjs.map +1 -1
- package/dist/utils/metrics/properties.d.cts +2 -4
- package/dist/utils/metrics/properties.d.cts.map +1 -1
- package/dist/utils/metrics/properties.d.mts +2 -4
- package/dist/utils/metrics/properties.d.mts.map +1 -1
- package/dist/utils/metrics/properties.mjs +1 -1
- package/dist/utils/metrics/properties.mjs.map +1 -1
- package/dist/utils/metrics/types.cjs.map +1 -1
- package/dist/utils/metrics/types.d.cts +1 -2
- package/dist/utils/metrics/types.d.cts.map +1 -1
- package/dist/utils/metrics/types.d.mts +1 -2
- package/dist/utils/metrics/types.d.mts.map +1 -1
- package/dist/utils/metrics/types.mjs.map +1 -1
- package/dist/utils/quote-fees.cjs +1 -2
- package/dist/utils/quote-fees.cjs.map +1 -1
- package/dist/utils/quote-fees.d.cts +1 -2
- package/dist/utils/quote-fees.d.cts.map +1 -1
- package/dist/utils/quote-fees.d.mts +1 -2
- package/dist/utils/quote-fees.d.mts.map +1 -1
- package/dist/utils/quote-fees.mjs +1 -2
- package/dist/utils/quote-fees.mjs.map +1 -1
- package/dist/utils/quote.cjs +3 -3
- package/dist/utils/quote.cjs.map +1 -1
- package/dist/utils/quote.d.cts +2 -5
- package/dist/utils/quote.d.cts.map +1 -1
- package/dist/utils/quote.d.mts +2 -5
- package/dist/utils/quote.d.mts.map +1 -1
- package/dist/utils/quote.mjs +2 -2
- package/dist/utils/quote.mjs.map +1 -1
- package/dist/utils/trade-utils.cjs +66 -7
- package/dist/utils/trade-utils.cjs.map +1 -1
- package/dist/utils/trade-utils.d.cts +54 -1
- package/dist/utils/trade-utils.d.cts.map +1 -1
- package/dist/utils/trade-utils.d.mts +54 -1
- package/dist/utils/trade-utils.d.mts.map +1 -1
- package/dist/utils/trade-utils.mjs +56 -1
- package/dist/utils/trade-utils.mjs.map +1 -1
- package/dist/utils/validators.cjs +471 -0
- package/dist/utils/validators.cjs.map +1 -0
- package/dist/utils/validators.d.cts +1765 -0
- package/dist/utils/validators.d.cts.map +1 -0
- package/dist/utils/validators.d.mts +1765 -0
- package/dist/utils/validators.d.mts.map +1 -0
- package/dist/utils/validators.mjs +461 -0
- package/dist/utils/validators.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/utils/struct-error.cjs +0 -16
- package/dist/utils/struct-error.cjs.map +0 -1
- package/dist/utils/struct-error.d.cts +0 -11
- package/dist/utils/struct-error.d.cts.map +0 -1
- package/dist/utils/struct-error.d.mts +0 -11
- package/dist/utils/struct-error.d.mts.map +0 -1
- package/dist/utils/struct-error.mjs +0 -12
- package/dist/utils/struct-error.mjs.map +0 -1
- package/dist/validators/batch-sell.cjs +0 -39
- package/dist/validators/batch-sell.cjs.map +0 -1
- package/dist/validators/batch-sell.d.cts +0 -79
- package/dist/validators/batch-sell.d.cts.map +0 -1
- package/dist/validators/batch-sell.d.mts +0 -79
- package/dist/validators/batch-sell.d.mts.map +0 -1
- package/dist/validators/batch-sell.mjs +0 -35
- package/dist/validators/batch-sell.mjs.map +0 -1
- package/dist/validators/bridge-asset.cjs +0 -42
- package/dist/validators/bridge-asset.cjs.map +0 -1
- package/dist/validators/bridge-asset.d.cts +0 -52
- package/dist/validators/bridge-asset.d.cts.map +0 -1
- package/dist/validators/bridge-asset.d.mts +0 -52
- package/dist/validators/bridge-asset.d.mts.map +0 -1
- package/dist/validators/bridge-asset.mjs +0 -38
- package/dist/validators/bridge-asset.mjs.map +0 -1
- package/dist/validators/feature-flags.cjs +0 -110
- package/dist/validators/feature-flags.cjs.map +0 -1
- package/dist/validators/feature-flags.d.cts +0 -264
- package/dist/validators/feature-flags.d.cts.map +0 -1
- package/dist/validators/feature-flags.d.mts +0 -264
- package/dist/validators/feature-flags.d.mts.map +0 -1
- package/dist/validators/feature-flags.mjs +0 -106
- package/dist/validators/feature-flags.mjs.map +0 -1
- package/dist/validators/intent.cjs +0 -122
- package/dist/validators/intent.cjs.map +0 -1
- package/dist/validators/intent.d.cts +0 -231
- package/dist/validators/intent.d.cts.map +0 -1
- package/dist/validators/intent.d.mts +0 -231
- package/dist/validators/intent.d.mts.map +0 -1
- package/dist/validators/intent.mjs +0 -119
- package/dist/validators/intent.mjs.map +0 -1
- package/dist/validators/number.cjs +0 -8
- package/dist/validators/number.cjs.map +0 -1
- package/dist/validators/number.d.cts +0 -4
- package/dist/validators/number.d.cts.map +0 -1
- package/dist/validators/number.d.mts +0 -4
- package/dist/validators/number.d.mts.map +0 -1
- package/dist/validators/number.mjs +0 -5
- package/dist/validators/number.mjs.map +0 -1
- package/dist/validators/quote-response-v1.cjs +0 -31
- package/dist/validators/quote-response-v1.cjs.map +0 -1
- package/dist/validators/quote-response-v1.d.cts +0 -658
- package/dist/validators/quote-response-v1.d.cts.map +0 -1
- package/dist/validators/quote-response-v1.d.mts +0 -658
- package/dist/validators/quote-response-v1.d.mts.map +0 -1
- package/dist/validators/quote-response-v1.mjs +0 -27
- package/dist/validators/quote-response-v1.mjs.map +0 -1
- package/dist/validators/quote-stream-complete.cjs +0 -29
- package/dist/validators/quote-stream-complete.cjs.map +0 -1
- package/dist/validators/quote-stream-complete.d.cts +0 -39
- package/dist/validators/quote-stream-complete.d.cts.map +0 -1
- package/dist/validators/quote-stream-complete.d.mts +0 -39
- package/dist/validators/quote-stream-complete.d.mts.map +0 -1
- package/dist/validators/quote-stream-complete.mjs +0 -25
- package/dist/validators/quote-stream-complete.mjs.map +0 -1
- package/dist/validators/quote.cjs +0 -96
- package/dist/validators/quote.cjs.map +0 -1
- package/dist/validators/quote.d.cts +0 -230
- package/dist/validators/quote.d.cts.map +0 -1
- package/dist/validators/quote.d.mts +0 -230
- package/dist/validators/quote.d.mts.map +0 -1
- package/dist/validators/quote.mjs +0 -93
- package/dist/validators/quote.mjs.map +0 -1
- package/dist/validators/step.cjs +0 -20
- package/dist/validators/step.cjs.map +0 -1
- package/dist/validators/step.d.cts +0 -148
- package/dist/validators/step.d.cts.map +0 -1
- package/dist/validators/step.d.mts +0 -148
- package/dist/validators/step.d.mts.map +0 -1
- package/dist/validators/step.mjs +0 -17
- package/dist/validators/step.mjs.map +0 -1
- package/dist/validators/token-feature.cjs +0 -22
- package/dist/validators/token-feature.cjs.map +0 -1
- package/dist/validators/token-feature.d.cts +0 -26
- package/dist/validators/token-feature.d.cts.map +0 -1
- package/dist/validators/token-feature.d.mts +0 -26
- package/dist/validators/token-feature.d.mts.map +0 -1
- package/dist/validators/token-feature.mjs +0 -18
- package/dist/validators/token-feature.mjs.map +0 -1
- package/dist/validators/trade.cjs +0 -94
- package/dist/validators/trade.cjs.map +0 -1
- package/dist/validators/trade.d.cts +0 -121
- package/dist/validators/trade.d.cts.map +0 -1
- package/dist/validators/trade.d.mts +0 -121
- package/dist/validators/trade.d.mts.map +0 -1
- package/dist/validators/trade.mjs +0 -86
- package/dist/validators/trade.mjs.map +0 -1
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
export declare enum FeatureId {
|
|
2
|
-
UNKNOWN = "unknown",
|
|
3
|
-
PERPS = "perps",
|
|
4
|
-
QUICK_BUY_FOLLOW_TRADING = "quick_buy_follow_trading",
|
|
5
|
-
QUICK_BUY_TOKEN_DETAILS = "quick_buy_token_details",
|
|
6
|
-
QUICK_BUY_EXPLORE = "quick_buy_explore",
|
|
7
|
-
DAPP_SWAP = "dapp_swap",
|
|
8
|
-
BATCH_SELL = "batch_sell",
|
|
9
|
-
UNIFIED_SWAP_BRIDGE = "unified_swap_bridge"
|
|
10
|
-
}
|
|
11
|
-
export declare const VersionStringSchema: import("@metamask/superstruct").Struct<string, null>;
|
|
12
|
-
export declare const ChainRankingItemSchema: import("@metamask/superstruct").Struct<{
|
|
13
|
-
chainId: `${string}:${string}`;
|
|
14
|
-
name: string;
|
|
15
|
-
}, {
|
|
16
|
-
/**
|
|
17
|
-
* The CAIP-2 chain identifier (e.g., "eip155:1" for Ethereum mainnet)
|
|
18
|
-
*/
|
|
19
|
-
chainId: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
|
20
|
-
/**
|
|
21
|
-
* The display name of the chain (e.g., "Ethereum")
|
|
22
|
-
*/
|
|
23
|
-
name: import("@metamask/superstruct").Struct<string, null>;
|
|
24
|
-
}>;
|
|
25
|
-
export declare const ChainRankingSchema: import("@metamask/superstruct").Struct<{
|
|
26
|
-
chainId: `${string}:${string}`;
|
|
27
|
-
name: string;
|
|
28
|
-
}[] | undefined, import("@metamask/superstruct").Struct<{
|
|
29
|
-
chainId: `${string}:${string}`;
|
|
30
|
-
name: string;
|
|
31
|
-
}, {
|
|
32
|
-
/**
|
|
33
|
-
* The CAIP-2 chain identifier (e.g., "eip155:1" for Ethereum mainnet)
|
|
34
|
-
*/
|
|
35
|
-
chainId: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
|
36
|
-
/**
|
|
37
|
-
* The display name of the chain (e.g., "Ethereum")
|
|
38
|
-
*/
|
|
39
|
-
name: import("@metamask/superstruct").Struct<string, null>;
|
|
40
|
-
}>>;
|
|
41
|
-
export declare const ChainConfigurationSchema: import("@metamask/superstruct").Struct<{
|
|
42
|
-
isActiveSrc: boolean;
|
|
43
|
-
isActiveDest: boolean;
|
|
44
|
-
refreshRate?: number | undefined;
|
|
45
|
-
topAssets?: string[] | undefined;
|
|
46
|
-
stablecoins?: string[] | undefined;
|
|
47
|
-
batchSellDestStablecoins?: `${string}:${string}/${string}:${string}`[] | undefined;
|
|
48
|
-
isUnifiedUIEnabled?: boolean | undefined;
|
|
49
|
-
isSingleSwapBridgeButtonEnabled?: boolean | undefined;
|
|
50
|
-
isGaslessSwapEnabled?: boolean | undefined;
|
|
51
|
-
noFeeAssets?: string[] | undefined;
|
|
52
|
-
defaultPairs?: {
|
|
53
|
-
standard: Record<string, string>;
|
|
54
|
-
other: Record<string, string>;
|
|
55
|
-
} | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
isActiveSrc: import("@metamask/superstruct").Struct<boolean, null>;
|
|
58
|
-
isActiveDest: import("@metamask/superstruct").Struct<boolean, null>;
|
|
59
|
-
refreshRate: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
60
|
-
topAssets: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
61
|
-
stablecoins: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
62
|
-
batchSellDestStablecoins: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`[] | undefined, import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`, null>>;
|
|
63
|
-
isUnifiedUIEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
64
|
-
isSingleSwapBridgeButtonEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
65
|
-
isGaslessSwapEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
66
|
-
noFeeAssets: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
67
|
-
defaultPairs: import("@metamask/superstruct").Struct<{
|
|
68
|
-
standard: Record<string, string>;
|
|
69
|
-
other: Record<string, string>;
|
|
70
|
-
} | undefined, {
|
|
71
|
-
/**
|
|
72
|
-
* The standard default pairs. Use this if the pair is only set once.
|
|
73
|
-
* The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.
|
|
74
|
-
*/
|
|
75
|
-
standard: import("@metamask/superstruct").Struct<Record<string, string>, null>;
|
|
76
|
-
/**
|
|
77
|
-
* The other default pairs. Use this if the dest token depends on the src token and can be set multiple times.
|
|
78
|
-
* The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.
|
|
79
|
-
*/
|
|
80
|
-
other: import("@metamask/superstruct").Struct<Record<string, string>, null>;
|
|
81
|
-
}>;
|
|
82
|
-
}>;
|
|
83
|
-
export declare const PriceImpactThresholdSchema: import("@metamask/superstruct").Struct<{
|
|
84
|
-
gasless: number;
|
|
85
|
-
normal: number;
|
|
86
|
-
warning?: number | undefined;
|
|
87
|
-
error?: number | undefined;
|
|
88
|
-
}, {
|
|
89
|
-
gasless: import("@metamask/superstruct").Struct<number, null>;
|
|
90
|
-
normal: import("@metamask/superstruct").Struct<number, null>;
|
|
91
|
-
warning: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
92
|
-
error: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* This is the schema for the feature flags response from the RemoteFeatureFlagController
|
|
96
|
-
*/
|
|
97
|
-
export declare const PlatformConfigSchema: import("@metamask/superstruct").Struct<{
|
|
98
|
-
refreshRate: number;
|
|
99
|
-
minimumVersion: string;
|
|
100
|
-
maxRefreshCount: number;
|
|
101
|
-
support: boolean;
|
|
102
|
-
chains: Record<string, {
|
|
103
|
-
isActiveSrc: boolean;
|
|
104
|
-
isActiveDest: boolean;
|
|
105
|
-
refreshRate?: number | undefined;
|
|
106
|
-
topAssets?: string[] | undefined;
|
|
107
|
-
stablecoins?: string[] | undefined;
|
|
108
|
-
batchSellDestStablecoins?: `${string}:${string}/${string}:${string}`[] | undefined;
|
|
109
|
-
isUnifiedUIEnabled?: boolean | undefined;
|
|
110
|
-
isSingleSwapBridgeButtonEnabled?: boolean | undefined;
|
|
111
|
-
isGaslessSwapEnabled?: boolean | undefined;
|
|
112
|
-
noFeeAssets?: string[] | undefined;
|
|
113
|
-
defaultPairs?: {
|
|
114
|
-
standard: Record<string, string>;
|
|
115
|
-
other: Record<string, string>;
|
|
116
|
-
} | undefined;
|
|
117
|
-
}>;
|
|
118
|
-
priceImpactThreshold?: {
|
|
119
|
-
gasless: number;
|
|
120
|
-
normal: number;
|
|
121
|
-
warning?: number | undefined;
|
|
122
|
-
error?: number | undefined;
|
|
123
|
-
} | undefined;
|
|
124
|
-
quoteRequestOverrides?: Record<string, {
|
|
125
|
-
fee?: number | undefined;
|
|
126
|
-
aggIds?: string[] | undefined;
|
|
127
|
-
bridgeIds?: string[] | undefined;
|
|
128
|
-
} | undefined> | undefined;
|
|
129
|
-
bip44DefaultPairs?: Record<string, {
|
|
130
|
-
standard: Record<string, string>;
|
|
131
|
-
other: Record<string, string>;
|
|
132
|
-
} | undefined> | undefined;
|
|
133
|
-
sse?: {
|
|
134
|
-
minimumVersion: string;
|
|
135
|
-
enabled: boolean;
|
|
136
|
-
} | undefined;
|
|
137
|
-
chainRanking?: {
|
|
138
|
-
chainId: `${string}:${string}`;
|
|
139
|
-
name: string;
|
|
140
|
-
}[] | undefined;
|
|
141
|
-
maxPendingHistoryItemAgeMs?: number | undefined;
|
|
142
|
-
}, {
|
|
143
|
-
priceImpactThreshold: import("@metamask/superstruct").Struct<{
|
|
144
|
-
gasless: number;
|
|
145
|
-
normal: number;
|
|
146
|
-
warning?: number | undefined;
|
|
147
|
-
error?: number | undefined;
|
|
148
|
-
} | undefined, {
|
|
149
|
-
gasless: import("@metamask/superstruct").Struct<number, null>;
|
|
150
|
-
normal: import("@metamask/superstruct").Struct<number, null>;
|
|
151
|
-
warning: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
152
|
-
error: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
153
|
-
}>;
|
|
154
|
-
quoteRequestOverrides: import("@metamask/superstruct").Struct<Record<string, {
|
|
155
|
-
fee?: number | undefined;
|
|
156
|
-
aggIds?: string[] | undefined;
|
|
157
|
-
bridgeIds?: string[] | undefined;
|
|
158
|
-
} | undefined> | undefined, null>;
|
|
159
|
-
minimumVersion: import("@metamask/superstruct").Struct<string, null>;
|
|
160
|
-
refreshRate: import("@metamask/superstruct").Struct<number, null>;
|
|
161
|
-
maxRefreshCount: import("@metamask/superstruct").Struct<number, null>;
|
|
162
|
-
support: import("@metamask/superstruct").Struct<boolean, null>;
|
|
163
|
-
chains: import("@metamask/superstruct").Struct<Record<string, {
|
|
164
|
-
isActiveSrc: boolean;
|
|
165
|
-
isActiveDest: boolean;
|
|
166
|
-
refreshRate?: number | undefined;
|
|
167
|
-
topAssets?: string[] | undefined;
|
|
168
|
-
stablecoins?: string[] | undefined;
|
|
169
|
-
batchSellDestStablecoins?: `${string}:${string}/${string}:${string}`[] | undefined;
|
|
170
|
-
isUnifiedUIEnabled?: boolean | undefined;
|
|
171
|
-
isSingleSwapBridgeButtonEnabled?: boolean | undefined;
|
|
172
|
-
isGaslessSwapEnabled?: boolean | undefined;
|
|
173
|
-
noFeeAssets?: string[] | undefined;
|
|
174
|
-
defaultPairs?: {
|
|
175
|
-
standard: Record<string, string>;
|
|
176
|
-
other: Record<string, string>;
|
|
177
|
-
} | undefined;
|
|
178
|
-
}>, null>;
|
|
179
|
-
/**
|
|
180
|
-
* The bip44 default pairs for the chains
|
|
181
|
-
* Key is the CAIP chainId namespace
|
|
182
|
-
*/
|
|
183
|
-
bip44DefaultPairs: import("@metamask/superstruct").Struct<Record<string, {
|
|
184
|
-
standard: Record<string, string>;
|
|
185
|
-
other: Record<string, string>;
|
|
186
|
-
} | undefined> | undefined, null>;
|
|
187
|
-
sse: import("@metamask/superstruct").Struct<{
|
|
188
|
-
minimumVersion: string;
|
|
189
|
-
enabled: boolean;
|
|
190
|
-
} | undefined, {
|
|
191
|
-
enabled: import("@metamask/superstruct").Struct<boolean, null>;
|
|
192
|
-
/**
|
|
193
|
-
* The minimum version of the client required to enable SSE, for example 13.8.0
|
|
194
|
-
*/
|
|
195
|
-
minimumVersion: import("@metamask/superstruct").Struct<string, null>;
|
|
196
|
-
}>;
|
|
197
|
-
/**
|
|
198
|
-
* Array of chain objects ordered by preference/ranking
|
|
199
|
-
*/
|
|
200
|
-
chainRanking: import("@metamask/superstruct").Struct<{
|
|
201
|
-
chainId: `${string}:${string}`;
|
|
202
|
-
name: string;
|
|
203
|
-
}[] | undefined, import("@metamask/superstruct").Struct<{
|
|
204
|
-
chainId: `${string}:${string}`;
|
|
205
|
-
name: string;
|
|
206
|
-
}, {
|
|
207
|
-
/**
|
|
208
|
-
* The CAIP-2 chain identifier (e.g., "eip155:1" for Ethereum mainnet)
|
|
209
|
-
*/
|
|
210
|
-
chainId: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
|
211
|
-
/**
|
|
212
|
-
* The display name of the chain (e.g., "Ethereum")
|
|
213
|
-
*/
|
|
214
|
-
name: import("@metamask/superstruct").Struct<string, null>;
|
|
215
|
-
}>>;
|
|
216
|
-
maxPendingHistoryItemAgeMs: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
217
|
-
}>;
|
|
218
|
-
export declare const validateFeatureFlagsResponse: (data: unknown) => data is {
|
|
219
|
-
refreshRate: number;
|
|
220
|
-
minimumVersion: string;
|
|
221
|
-
maxRefreshCount: number;
|
|
222
|
-
support: boolean;
|
|
223
|
-
chains: Record<string, {
|
|
224
|
-
isActiveSrc: boolean;
|
|
225
|
-
isActiveDest: boolean;
|
|
226
|
-
refreshRate?: number | undefined;
|
|
227
|
-
topAssets?: string[] | undefined;
|
|
228
|
-
stablecoins?: string[] | undefined;
|
|
229
|
-
batchSellDestStablecoins?: `${string}:${string}/${string}:${string}`[] | undefined;
|
|
230
|
-
isUnifiedUIEnabled?: boolean | undefined;
|
|
231
|
-
isSingleSwapBridgeButtonEnabled?: boolean | undefined;
|
|
232
|
-
isGaslessSwapEnabled?: boolean | undefined;
|
|
233
|
-
noFeeAssets?: string[] | undefined;
|
|
234
|
-
defaultPairs?: {
|
|
235
|
-
standard: Record<string, string>;
|
|
236
|
-
other: Record<string, string>;
|
|
237
|
-
} | undefined;
|
|
238
|
-
}>;
|
|
239
|
-
priceImpactThreshold?: {
|
|
240
|
-
gasless: number;
|
|
241
|
-
normal: number;
|
|
242
|
-
warning?: number | undefined;
|
|
243
|
-
error?: number | undefined;
|
|
244
|
-
} | undefined;
|
|
245
|
-
quoteRequestOverrides?: Record<string, {
|
|
246
|
-
fee?: number | undefined;
|
|
247
|
-
aggIds?: string[] | undefined;
|
|
248
|
-
bridgeIds?: string[] | undefined;
|
|
249
|
-
} | undefined> | undefined;
|
|
250
|
-
bip44DefaultPairs?: Record<string, {
|
|
251
|
-
standard: Record<string, string>;
|
|
252
|
-
other: Record<string, string>;
|
|
253
|
-
} | undefined> | undefined;
|
|
254
|
-
sse?: {
|
|
255
|
-
minimumVersion: string;
|
|
256
|
-
enabled: boolean;
|
|
257
|
-
} | undefined;
|
|
258
|
-
chainRanking?: {
|
|
259
|
-
chainId: `${string}:${string}`;
|
|
260
|
-
name: string;
|
|
261
|
-
}[] | undefined;
|
|
262
|
-
maxPendingHistoryItemAgeMs?: number | undefined;
|
|
263
|
-
};
|
|
264
|
-
//# sourceMappingURL=feature-flags.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;CAC5C;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"}
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
export declare enum FeatureId {
|
|
2
|
-
UNKNOWN = "unknown",
|
|
3
|
-
PERPS = "perps",
|
|
4
|
-
QUICK_BUY_FOLLOW_TRADING = "quick_buy_follow_trading",
|
|
5
|
-
QUICK_BUY_TOKEN_DETAILS = "quick_buy_token_details",
|
|
6
|
-
QUICK_BUY_EXPLORE = "quick_buy_explore",
|
|
7
|
-
DAPP_SWAP = "dapp_swap",
|
|
8
|
-
BATCH_SELL = "batch_sell",
|
|
9
|
-
UNIFIED_SWAP_BRIDGE = "unified_swap_bridge"
|
|
10
|
-
}
|
|
11
|
-
export declare const VersionStringSchema: import("@metamask/superstruct").Struct<string, null>;
|
|
12
|
-
export declare const ChainRankingItemSchema: import("@metamask/superstruct").Struct<{
|
|
13
|
-
chainId: `${string}:${string}`;
|
|
14
|
-
name: string;
|
|
15
|
-
}, {
|
|
16
|
-
/**
|
|
17
|
-
* The CAIP-2 chain identifier (e.g., "eip155:1" for Ethereum mainnet)
|
|
18
|
-
*/
|
|
19
|
-
chainId: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
|
20
|
-
/**
|
|
21
|
-
* The display name of the chain (e.g., "Ethereum")
|
|
22
|
-
*/
|
|
23
|
-
name: import("@metamask/superstruct").Struct<string, null>;
|
|
24
|
-
}>;
|
|
25
|
-
export declare const ChainRankingSchema: import("@metamask/superstruct").Struct<{
|
|
26
|
-
chainId: `${string}:${string}`;
|
|
27
|
-
name: string;
|
|
28
|
-
}[] | undefined, import("@metamask/superstruct").Struct<{
|
|
29
|
-
chainId: `${string}:${string}`;
|
|
30
|
-
name: string;
|
|
31
|
-
}, {
|
|
32
|
-
/**
|
|
33
|
-
* The CAIP-2 chain identifier (e.g., "eip155:1" for Ethereum mainnet)
|
|
34
|
-
*/
|
|
35
|
-
chainId: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
|
36
|
-
/**
|
|
37
|
-
* The display name of the chain (e.g., "Ethereum")
|
|
38
|
-
*/
|
|
39
|
-
name: import("@metamask/superstruct").Struct<string, null>;
|
|
40
|
-
}>>;
|
|
41
|
-
export declare const ChainConfigurationSchema: import("@metamask/superstruct").Struct<{
|
|
42
|
-
isActiveSrc: boolean;
|
|
43
|
-
isActiveDest: boolean;
|
|
44
|
-
refreshRate?: number | undefined;
|
|
45
|
-
topAssets?: string[] | undefined;
|
|
46
|
-
stablecoins?: string[] | undefined;
|
|
47
|
-
batchSellDestStablecoins?: `${string}:${string}/${string}:${string}`[] | undefined;
|
|
48
|
-
isUnifiedUIEnabled?: boolean | undefined;
|
|
49
|
-
isSingleSwapBridgeButtonEnabled?: boolean | undefined;
|
|
50
|
-
isGaslessSwapEnabled?: boolean | undefined;
|
|
51
|
-
noFeeAssets?: string[] | undefined;
|
|
52
|
-
defaultPairs?: {
|
|
53
|
-
standard: Record<string, string>;
|
|
54
|
-
other: Record<string, string>;
|
|
55
|
-
} | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
isActiveSrc: import("@metamask/superstruct").Struct<boolean, null>;
|
|
58
|
-
isActiveDest: import("@metamask/superstruct").Struct<boolean, null>;
|
|
59
|
-
refreshRate: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
60
|
-
topAssets: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
61
|
-
stablecoins: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
62
|
-
batchSellDestStablecoins: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`[] | undefined, import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`, null>>;
|
|
63
|
-
isUnifiedUIEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
64
|
-
isSingleSwapBridgeButtonEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
65
|
-
isGaslessSwapEnabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
66
|
-
noFeeAssets: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
67
|
-
defaultPairs: import("@metamask/superstruct").Struct<{
|
|
68
|
-
standard: Record<string, string>;
|
|
69
|
-
other: Record<string, string>;
|
|
70
|
-
} | undefined, {
|
|
71
|
-
/**
|
|
72
|
-
* The standard default pairs. Use this if the pair is only set once.
|
|
73
|
-
* The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.
|
|
74
|
-
*/
|
|
75
|
-
standard: import("@metamask/superstruct").Struct<Record<string, string>, null>;
|
|
76
|
-
/**
|
|
77
|
-
* The other default pairs. Use this if the dest token depends on the src token and can be set multiple times.
|
|
78
|
-
* The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.
|
|
79
|
-
*/
|
|
80
|
-
other: import("@metamask/superstruct").Struct<Record<string, string>, null>;
|
|
81
|
-
}>;
|
|
82
|
-
}>;
|
|
83
|
-
export declare const PriceImpactThresholdSchema: import("@metamask/superstruct").Struct<{
|
|
84
|
-
gasless: number;
|
|
85
|
-
normal: number;
|
|
86
|
-
warning?: number | undefined;
|
|
87
|
-
error?: number | undefined;
|
|
88
|
-
}, {
|
|
89
|
-
gasless: import("@metamask/superstruct").Struct<number, null>;
|
|
90
|
-
normal: import("@metamask/superstruct").Struct<number, null>;
|
|
91
|
-
warning: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
92
|
-
error: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* This is the schema for the feature flags response from the RemoteFeatureFlagController
|
|
96
|
-
*/
|
|
97
|
-
export declare const PlatformConfigSchema: import("@metamask/superstruct").Struct<{
|
|
98
|
-
refreshRate: number;
|
|
99
|
-
minimumVersion: string;
|
|
100
|
-
maxRefreshCount: number;
|
|
101
|
-
support: boolean;
|
|
102
|
-
chains: Record<string, {
|
|
103
|
-
isActiveSrc: boolean;
|
|
104
|
-
isActiveDest: boolean;
|
|
105
|
-
refreshRate?: number | undefined;
|
|
106
|
-
topAssets?: string[] | undefined;
|
|
107
|
-
stablecoins?: string[] | undefined;
|
|
108
|
-
batchSellDestStablecoins?: `${string}:${string}/${string}:${string}`[] | undefined;
|
|
109
|
-
isUnifiedUIEnabled?: boolean | undefined;
|
|
110
|
-
isSingleSwapBridgeButtonEnabled?: boolean | undefined;
|
|
111
|
-
isGaslessSwapEnabled?: boolean | undefined;
|
|
112
|
-
noFeeAssets?: string[] | undefined;
|
|
113
|
-
defaultPairs?: {
|
|
114
|
-
standard: Record<string, string>;
|
|
115
|
-
other: Record<string, string>;
|
|
116
|
-
} | undefined;
|
|
117
|
-
}>;
|
|
118
|
-
priceImpactThreshold?: {
|
|
119
|
-
gasless: number;
|
|
120
|
-
normal: number;
|
|
121
|
-
warning?: number | undefined;
|
|
122
|
-
error?: number | undefined;
|
|
123
|
-
} | undefined;
|
|
124
|
-
quoteRequestOverrides?: Record<string, {
|
|
125
|
-
fee?: number | undefined;
|
|
126
|
-
aggIds?: string[] | undefined;
|
|
127
|
-
bridgeIds?: string[] | undefined;
|
|
128
|
-
} | undefined> | undefined;
|
|
129
|
-
bip44DefaultPairs?: Record<string, {
|
|
130
|
-
standard: Record<string, string>;
|
|
131
|
-
other: Record<string, string>;
|
|
132
|
-
} | undefined> | undefined;
|
|
133
|
-
sse?: {
|
|
134
|
-
minimumVersion: string;
|
|
135
|
-
enabled: boolean;
|
|
136
|
-
} | undefined;
|
|
137
|
-
chainRanking?: {
|
|
138
|
-
chainId: `${string}:${string}`;
|
|
139
|
-
name: string;
|
|
140
|
-
}[] | undefined;
|
|
141
|
-
maxPendingHistoryItemAgeMs?: number | undefined;
|
|
142
|
-
}, {
|
|
143
|
-
priceImpactThreshold: import("@metamask/superstruct").Struct<{
|
|
144
|
-
gasless: number;
|
|
145
|
-
normal: number;
|
|
146
|
-
warning?: number | undefined;
|
|
147
|
-
error?: number | undefined;
|
|
148
|
-
} | undefined, {
|
|
149
|
-
gasless: import("@metamask/superstruct").Struct<number, null>;
|
|
150
|
-
normal: import("@metamask/superstruct").Struct<number, null>;
|
|
151
|
-
warning: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
152
|
-
error: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
153
|
-
}>;
|
|
154
|
-
quoteRequestOverrides: import("@metamask/superstruct").Struct<Record<string, {
|
|
155
|
-
fee?: number | undefined;
|
|
156
|
-
aggIds?: string[] | undefined;
|
|
157
|
-
bridgeIds?: string[] | undefined;
|
|
158
|
-
} | undefined> | undefined, null>;
|
|
159
|
-
minimumVersion: import("@metamask/superstruct").Struct<string, null>;
|
|
160
|
-
refreshRate: import("@metamask/superstruct").Struct<number, null>;
|
|
161
|
-
maxRefreshCount: import("@metamask/superstruct").Struct<number, null>;
|
|
162
|
-
support: import("@metamask/superstruct").Struct<boolean, null>;
|
|
163
|
-
chains: import("@metamask/superstruct").Struct<Record<string, {
|
|
164
|
-
isActiveSrc: boolean;
|
|
165
|
-
isActiveDest: boolean;
|
|
166
|
-
refreshRate?: number | undefined;
|
|
167
|
-
topAssets?: string[] | undefined;
|
|
168
|
-
stablecoins?: string[] | undefined;
|
|
169
|
-
batchSellDestStablecoins?: `${string}:${string}/${string}:${string}`[] | undefined;
|
|
170
|
-
isUnifiedUIEnabled?: boolean | undefined;
|
|
171
|
-
isSingleSwapBridgeButtonEnabled?: boolean | undefined;
|
|
172
|
-
isGaslessSwapEnabled?: boolean | undefined;
|
|
173
|
-
noFeeAssets?: string[] | undefined;
|
|
174
|
-
defaultPairs?: {
|
|
175
|
-
standard: Record<string, string>;
|
|
176
|
-
other: Record<string, string>;
|
|
177
|
-
} | undefined;
|
|
178
|
-
}>, null>;
|
|
179
|
-
/**
|
|
180
|
-
* The bip44 default pairs for the chains
|
|
181
|
-
* Key is the CAIP chainId namespace
|
|
182
|
-
*/
|
|
183
|
-
bip44DefaultPairs: import("@metamask/superstruct").Struct<Record<string, {
|
|
184
|
-
standard: Record<string, string>;
|
|
185
|
-
other: Record<string, string>;
|
|
186
|
-
} | undefined> | undefined, null>;
|
|
187
|
-
sse: import("@metamask/superstruct").Struct<{
|
|
188
|
-
minimumVersion: string;
|
|
189
|
-
enabled: boolean;
|
|
190
|
-
} | undefined, {
|
|
191
|
-
enabled: import("@metamask/superstruct").Struct<boolean, null>;
|
|
192
|
-
/**
|
|
193
|
-
* The minimum version of the client required to enable SSE, for example 13.8.0
|
|
194
|
-
*/
|
|
195
|
-
minimumVersion: import("@metamask/superstruct").Struct<string, null>;
|
|
196
|
-
}>;
|
|
197
|
-
/**
|
|
198
|
-
* Array of chain objects ordered by preference/ranking
|
|
199
|
-
*/
|
|
200
|
-
chainRanking: import("@metamask/superstruct").Struct<{
|
|
201
|
-
chainId: `${string}:${string}`;
|
|
202
|
-
name: string;
|
|
203
|
-
}[] | undefined, import("@metamask/superstruct").Struct<{
|
|
204
|
-
chainId: `${string}:${string}`;
|
|
205
|
-
name: string;
|
|
206
|
-
}, {
|
|
207
|
-
/**
|
|
208
|
-
* The CAIP-2 chain identifier (e.g., "eip155:1" for Ethereum mainnet)
|
|
209
|
-
*/
|
|
210
|
-
chainId: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
|
211
|
-
/**
|
|
212
|
-
* The display name of the chain (e.g., "Ethereum")
|
|
213
|
-
*/
|
|
214
|
-
name: import("@metamask/superstruct").Struct<string, null>;
|
|
215
|
-
}>>;
|
|
216
|
-
maxPendingHistoryItemAgeMs: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
217
|
-
}>;
|
|
218
|
-
export declare const validateFeatureFlagsResponse: (data: unknown) => data is {
|
|
219
|
-
refreshRate: number;
|
|
220
|
-
minimumVersion: string;
|
|
221
|
-
maxRefreshCount: number;
|
|
222
|
-
support: boolean;
|
|
223
|
-
chains: Record<string, {
|
|
224
|
-
isActiveSrc: boolean;
|
|
225
|
-
isActiveDest: boolean;
|
|
226
|
-
refreshRate?: number | undefined;
|
|
227
|
-
topAssets?: string[] | undefined;
|
|
228
|
-
stablecoins?: string[] | undefined;
|
|
229
|
-
batchSellDestStablecoins?: `${string}:${string}/${string}:${string}`[] | undefined;
|
|
230
|
-
isUnifiedUIEnabled?: boolean | undefined;
|
|
231
|
-
isSingleSwapBridgeButtonEnabled?: boolean | undefined;
|
|
232
|
-
isGaslessSwapEnabled?: boolean | undefined;
|
|
233
|
-
noFeeAssets?: string[] | undefined;
|
|
234
|
-
defaultPairs?: {
|
|
235
|
-
standard: Record<string, string>;
|
|
236
|
-
other: Record<string, string>;
|
|
237
|
-
} | undefined;
|
|
238
|
-
}>;
|
|
239
|
-
priceImpactThreshold?: {
|
|
240
|
-
gasless: number;
|
|
241
|
-
normal: number;
|
|
242
|
-
warning?: number | undefined;
|
|
243
|
-
error?: number | undefined;
|
|
244
|
-
} | undefined;
|
|
245
|
-
quoteRequestOverrides?: Record<string, {
|
|
246
|
-
fee?: number | undefined;
|
|
247
|
-
aggIds?: string[] | undefined;
|
|
248
|
-
bridgeIds?: string[] | undefined;
|
|
249
|
-
} | undefined> | undefined;
|
|
250
|
-
bip44DefaultPairs?: Record<string, {
|
|
251
|
-
standard: Record<string, string>;
|
|
252
|
-
other: Record<string, string>;
|
|
253
|
-
} | undefined> | undefined;
|
|
254
|
-
sse?: {
|
|
255
|
-
minimumVersion: string;
|
|
256
|
-
enabled: boolean;
|
|
257
|
-
} | undefined;
|
|
258
|
-
chainRanking?: {
|
|
259
|
-
chainId: `${string}:${string}`;
|
|
260
|
-
name: string;
|
|
261
|
-
}[] | undefined;
|
|
262
|
-
maxPendingHistoryItemAgeMs?: number | undefined;
|
|
263
|
-
};
|
|
264
|
-
//# sourceMappingURL=feature-flags.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;CAC5C;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"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import { type, record, string, optional, array, boolean, number, is, define } from "@metamask/superstruct";
|
|
3
|
-
import { CaipChainIdStruct, CaipAssetTypeStruct } from "@metamask/utils";
|
|
4
|
-
export var FeatureId;
|
|
5
|
-
(function (FeatureId) {
|
|
6
|
-
FeatureId["UNKNOWN"] = "unknown";
|
|
7
|
-
FeatureId["PERPS"] = "perps";
|
|
8
|
-
FeatureId["QUICK_BUY_FOLLOW_TRADING"] = "quick_buy_follow_trading";
|
|
9
|
-
FeatureId["QUICK_BUY_TOKEN_DETAILS"] = "quick_buy_token_details";
|
|
10
|
-
FeatureId["QUICK_BUY_EXPLORE"] = "quick_buy_explore";
|
|
11
|
-
FeatureId["DAPP_SWAP"] = "dapp_swap";
|
|
12
|
-
FeatureId["BATCH_SELL"] = "batch_sell";
|
|
13
|
-
FeatureId["UNIFIED_SWAP_BRIDGE"] = "unified_swap_bridge";
|
|
14
|
-
})(FeatureId || (FeatureId = {}));
|
|
15
|
-
export const VersionStringSchema = define('VersionString', (value) => typeof value === 'string' &&
|
|
16
|
-
/^(\d+\.*){2}\d+$/u.test(value) &&
|
|
17
|
-
value.split('.').length === 3);
|
|
18
|
-
const DefaultPairSchema = type({
|
|
19
|
-
/**
|
|
20
|
-
* The standard default pairs. Use this if the pair is only set once.
|
|
21
|
-
* The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.
|
|
22
|
-
*/
|
|
23
|
-
standard: record(string(), string()),
|
|
24
|
-
/**
|
|
25
|
-
* The other default pairs. Use this if the dest token depends on the src token and can be set multiple times.
|
|
26
|
-
* The key is the CAIP asset type of the src token and the value is the CAIP asset type of the dest token.
|
|
27
|
-
*/
|
|
28
|
-
other: record(string(), string()),
|
|
29
|
-
});
|
|
30
|
-
export const ChainRankingItemSchema = type({
|
|
31
|
-
/**
|
|
32
|
-
* The CAIP-2 chain identifier (e.g., "eip155:1" for Ethereum mainnet)
|
|
33
|
-
*/
|
|
34
|
-
chainId: CaipChainIdStruct,
|
|
35
|
-
/**
|
|
36
|
-
* The display name of the chain (e.g., "Ethereum")
|
|
37
|
-
*/
|
|
38
|
-
name: string(),
|
|
39
|
-
});
|
|
40
|
-
export const ChainRankingSchema = optional(array(ChainRankingItemSchema));
|
|
41
|
-
export const ChainConfigurationSchema = type({
|
|
42
|
-
isActiveSrc: boolean(),
|
|
43
|
-
isActiveDest: boolean(),
|
|
44
|
-
refreshRate: optional(number()),
|
|
45
|
-
topAssets: optional(array(string())),
|
|
46
|
-
stablecoins: optional(array(string())),
|
|
47
|
-
batchSellDestStablecoins: optional(array(CaipAssetTypeStruct)),
|
|
48
|
-
isUnifiedUIEnabled: optional(boolean()),
|
|
49
|
-
isSingleSwapBridgeButtonEnabled: optional(boolean()),
|
|
50
|
-
isGaslessSwapEnabled: optional(boolean()),
|
|
51
|
-
noFeeAssets: optional(array(string())),
|
|
52
|
-
defaultPairs: optional(DefaultPairSchema),
|
|
53
|
-
});
|
|
54
|
-
export const PriceImpactThresholdSchema = type({
|
|
55
|
-
// We are moving into a unified approach where
|
|
56
|
-
// price impact thresholds will be segmented by
|
|
57
|
-
// importance rather than transaction type.
|
|
58
|
-
// The introduction of warning/danger will first be handled
|
|
59
|
-
// by mobile, followed by extension and then removal of gasless/normal
|
|
60
|
-
// from LD configs.
|
|
61
|
-
// To make the migration easier, we define all fields as optional for now.
|
|
62
|
-
// After the migration takes place, gasless/normal will be removed
|
|
63
|
-
// and warning/danger will be set as required fields.
|
|
64
|
-
gasless: number(), // Percentage value in decimal format (eg 0.02 is 2%)
|
|
65
|
-
normal: number(), // Percentage value in decimal format
|
|
66
|
-
warning: optional(number()), // Percentage value in decimal format
|
|
67
|
-
error: optional(number()), // Percentage value in decimal format
|
|
68
|
-
});
|
|
69
|
-
const GenericQuoteRequestSchema = type({
|
|
70
|
-
aggIds: optional(array(string())),
|
|
71
|
-
bridgeIds: optional(array(string())),
|
|
72
|
-
fee: optional(number()),
|
|
73
|
-
});
|
|
74
|
-
/**
|
|
75
|
-
* This is the schema for the feature flags response from the RemoteFeatureFlagController
|
|
76
|
-
*/
|
|
77
|
-
export const PlatformConfigSchema = type({
|
|
78
|
-
priceImpactThreshold: optional(PriceImpactThresholdSchema),
|
|
79
|
-
quoteRequestOverrides: optional(record(string(), optional(GenericQuoteRequestSchema))),
|
|
80
|
-
minimumVersion: string(),
|
|
81
|
-
refreshRate: number(),
|
|
82
|
-
maxRefreshCount: number(),
|
|
83
|
-
support: boolean(),
|
|
84
|
-
chains: record(string(), ChainConfigurationSchema),
|
|
85
|
-
/**
|
|
86
|
-
* The bip44 default pairs for the chains
|
|
87
|
-
* Key is the CAIP chainId namespace
|
|
88
|
-
*/
|
|
89
|
-
bip44DefaultPairs: optional(record(string(), optional(DefaultPairSchema))),
|
|
90
|
-
sse: optional(type({
|
|
91
|
-
enabled: boolean(),
|
|
92
|
-
/**
|
|
93
|
-
* The minimum version of the client required to enable SSE, for example 13.8.0
|
|
94
|
-
*/
|
|
95
|
-
minimumVersion: VersionStringSchema,
|
|
96
|
-
})),
|
|
97
|
-
/**
|
|
98
|
-
* Array of chain objects ordered by preference/ranking
|
|
99
|
-
*/
|
|
100
|
-
chainRanking: ChainRankingSchema,
|
|
101
|
-
maxPendingHistoryItemAgeMs: optional(number()),
|
|
102
|
-
});
|
|
103
|
-
export const validateFeatureFlagsResponse = (data) => {
|
|
104
|
-
return is(data, PlatformConfigSchema);
|
|
105
|
-
};
|
|
106
|
-
//# sourceMappingURL=feature-flags.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,SASX;AATD,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;AAC7C,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CACvC,eAAe,EACf,CAAC,KAAc,EAAE,EAAE,CACjB,OAAO,KAAK,KAAK,QAAQ;IACzB,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAChC,CAAC;AAEF,MAAM,iBAAiB,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC;IACpC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;IACzC;;OAEG;IACH,OAAO,EAAE,iBAAiB;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;IAC3C,WAAW,EAAE,OAAO,EAAE;IACtB,YAAY,EAAE,OAAO,EAAE;IACvB,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC/B,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACpC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACtC,wBAAwB,EAAE,QAAQ,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC9D,kBAAkB,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACvC,+BAA+B,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACpD,oBAAoB,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACzC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACtC,YAAY,EAAE,QAAQ,CAAC,iBAAiB,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC;IAC7C,8CAA8C;IAC9C,+CAA+C;IAC/C,2CAA2C;IAC3C,2DAA2D;IAC3D,sEAAsE;IACtE,mBAAmB;IACnB,0EAA0E;IAC1E,kEAAkE;IAClE,qDAAqD;IACrD,OAAO,EAAE,MAAM,EAAE,EAAE,qDAAqD;IACxE,MAAM,EAAE,MAAM,EAAE,EAAE,qCAAqC;IACvD,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,qCAAqC;IAClE,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,qCAAqC;CACjE,CAAC,CAAC;AAEH,MAAM,yBAAyB,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACjC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,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}\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"]}
|