@metamask-previews/bridge-controller 77.6.0-preview-68ba7f84e → 77.8.0-preview-5959fe813
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 +42 -7
- package/dist/bridge-controller.cjs +13 -8
- package/dist/bridge-controller.cjs.map +1 -1
- package/dist/bridge-controller.d.cts +2 -1
- package/dist/bridge-controller.d.cts.map +1 -1
- package/dist/bridge-controller.d.mts +2 -1
- package/dist/bridge-controller.d.mts.map +1 -1
- package/dist/bridge-controller.mjs +10 -5
- package/dist/bridge-controller.mjs.map +1 -1
- package/dist/coercers/quote-response-v1-to-v2.cjs +137 -0
- package/dist/coercers/quote-response-v1-to-v2.cjs.map +1 -0
- package/dist/coercers/quote-response-v1-to-v2.d.cts +13 -0
- package/dist/coercers/quote-response-v1-to-v2.d.cts.map +1 -0
- package/dist/coercers/quote-response-v1-to-v2.d.mts +13 -0
- package/dist/coercers/quote-response-v1-to-v2.d.mts.map +1 -0
- package/dist/coercers/quote-response-v1-to-v2.mjs +132 -0
- package/dist/coercers/quote-response-v1-to-v2.mjs.map +1 -0
- package/dist/coercers/quote-response-v2-to-v1.cjs +173 -0
- package/dist/coercers/quote-response-v2-to-v1.cjs.map +1 -0
- package/dist/coercers/quote-response-v2-to-v1.d.cts +13 -0
- package/dist/coercers/quote-response-v2-to-v1.d.cts.map +1 -0
- package/dist/coercers/quote-response-v2-to-v1.d.mts +13 -0
- package/dist/coercers/quote-response-v2-to-v1.d.mts.map +1 -0
- package/dist/coercers/quote-response-v2-to-v1.mjs +169 -0
- package/dist/coercers/quote-response-v2-to-v1.mjs.map +1 -0
- package/dist/constants/bridge.cjs +2 -1
- package/dist/constants/bridge.cjs.map +1 -1
- package/dist/constants/bridge.d.cts +1 -0
- package/dist/constants/bridge.d.cts.map +1 -1
- package/dist/constants/bridge.d.mts +1 -0
- package/dist/constants/bridge.d.mts.map +1 -1
- package/dist/constants/bridge.mjs +1 -0
- package/dist/constants/bridge.mjs.map +1 -1
- package/dist/index.cjs +32 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +17 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/dist/selectors.cjs +52 -100
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +11198 -31552
- package/dist/selectors.d.cts.map +1 -1
- package/dist/selectors.d.mts +11198 -31552
- package/dist/selectors.d.mts.map +1 -1
- package/dist/selectors.mjs +52 -100
- package/dist/selectors.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +4 -87
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +4 -87
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/bridge.cjs +2 -6
- package/dist/utils/bridge.cjs.map +1 -1
- package/dist/utils/bridge.d.cts +2 -19
- package/dist/utils/bridge.d.cts.map +1 -1
- package/dist/utils/bridge.d.mts +2 -19
- package/dist/utils/bridge.d.mts.map +1 -1
- package/dist/utils/bridge.mjs +1 -4
- package/dist/utils/bridge.mjs.map +1 -1
- package/dist/utils/caip-formatters.cjs +0 -3
- package/dist/utils/caip-formatters.cjs.map +1 -1
- package/dist/utils/caip-formatters.d.cts.map +1 -1
- package/dist/utils/caip-formatters.d.mts.map +1 -1
- package/dist/utils/caip-formatters.mjs +0 -3
- package/dist/utils/caip-formatters.mjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +2 -2
- package/dist/utils/feature-flags.d.mts +2 -2
- package/dist/utils/fetch.cjs +37 -40
- package/dist/utils/fetch.cjs.map +1 -1
- package/dist/utils/fetch.d.cts +10 -4
- package/dist/utils/fetch.d.cts.map +1 -1
- package/dist/utils/fetch.d.mts +10 -4
- package/dist/utils/fetch.d.mts.map +1 -1
- package/dist/utils/fetch.mjs +37 -40
- package/dist/utils/fetch.mjs.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 +2 -1
- package/dist/utils/metrics/constants.d.cts.map +1 -1
- package/dist/utils/metrics/constants.d.mts +2 -1
- 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/properties.cjs +6 -6
- package/dist/utils/metrics/properties.cjs.map +1 -1
- package/dist/utils/metrics/properties.d.cts +9 -5
- package/dist/utils/metrics/properties.d.cts.map +1 -1
- package/dist/utils/metrics/properties.d.mts +9 -5
- package/dist/utils/metrics/properties.d.mts.map +1 -1
- package/dist/utils/metrics/properties.mjs +6 -6
- 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 -1
- package/dist/utils/metrics/types.d.cts.map +1 -1
- package/dist/utils/metrics/types.d.mts +1 -1
- package/dist/utils/metrics/types.d.mts.map +1 -1
- package/dist/utils/metrics/types.mjs.map +1 -1
- package/dist/utils/number-formatters.cjs +106 -0
- package/dist/utils/number-formatters.cjs.map +1 -0
- package/dist/utils/number-formatters.d.cts +34 -0
- package/dist/utils/number-formatters.d.cts.map +1 -0
- package/dist/utils/number-formatters.d.mts +34 -0
- package/dist/utils/number-formatters.d.mts.map +1 -0
- package/dist/utils/number-formatters.mjs +99 -0
- package/dist/utils/number-formatters.mjs.map +1 -0
- package/dist/utils/quote-fees.cjs +23 -22
- package/dist/utils/quote-fees.cjs.map +1 -1
- package/dist/utils/quote-fees.d.cts +4 -2
- package/dist/utils/quote-fees.d.cts.map +1 -1
- package/dist/utils/quote-fees.d.mts +4 -2
- package/dist/utils/quote-fees.d.mts.map +1 -1
- package/dist/utils/quote-fees.mjs +24 -23
- package/dist/utils/quote-fees.mjs.map +1 -1
- package/dist/utils/quote-metadata/calculators.cjs +340 -0
- package/dist/utils/quote-metadata/calculators.cjs.map +1 -0
- package/dist/utils/quote-metadata/calculators.d.cts +125 -0
- package/dist/utils/quote-metadata/calculators.d.cts.map +1 -0
- package/dist/utils/quote-metadata/calculators.d.mts +125 -0
- package/dist/utils/quote-metadata/calculators.d.mts.map +1 -0
- package/dist/utils/quote-metadata/calculators.mjs +323 -0
- package/dist/utils/quote-metadata/calculators.mjs.map +1 -0
- package/dist/utils/quote-metadata/merge.cjs +38 -0
- package/dist/utils/quote-metadata/merge.cjs.map +1 -0
- package/dist/utils/quote-metadata/merge.d.cts +12 -0
- package/dist/utils/quote-metadata/merge.d.cts.map +1 -0
- package/dist/utils/quote-metadata/merge.d.mts +12 -0
- package/dist/utils/quote-metadata/merge.d.mts.map +1 -0
- package/dist/utils/quote-metadata/merge.mjs +35 -0
- package/dist/utils/quote-metadata/merge.mjs.map +1 -0
- package/dist/utils/quote-metadata/to-normalized-amounts.cjs +38 -0
- package/dist/utils/quote-metadata/to-normalized-amounts.cjs.map +1 -0
- package/dist/utils/quote-metadata/to-normalized-amounts.d.cts +10 -0
- package/dist/utils/quote-metadata/to-normalized-amounts.d.cts.map +1 -0
- package/dist/utils/quote-metadata/to-normalized-amounts.d.mts +10 -0
- package/dist/utils/quote-metadata/to-normalized-amounts.d.mts.map +1 -0
- package/dist/utils/quote-metadata/to-normalized-amounts.mjs +34 -0
- package/dist/utils/quote-metadata/to-normalized-amounts.mjs.map +1 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v1.cjs +39 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v1.cjs.map +1 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v1.d.cts +13 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v1.d.cts.map +1 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v1.d.mts +13 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v1.d.mts.map +1 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v1.mjs +36 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v1.mjs.map +1 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v2.cjs +94 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v2.cjs.map +1 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v2.d.cts +12 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v2.d.cts.map +1 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v2.d.mts +12 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v2.d.mts.map +1 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v2.mjs +90 -0
- package/dist/utils/quote-metadata/to-quote-metadata-v2.mjs.map +1 -0
- package/dist/utils/quote-metadata/types.cjs +3 -0
- package/dist/utils/quote-metadata/types.cjs.map +1 -0
- package/dist/utils/quote-metadata/types.d.cts +87 -0
- package/dist/utils/quote-metadata/types.d.cts.map +1 -0
- package/dist/utils/quote-metadata/types.d.mts +87 -0
- package/dist/utils/quote-metadata/types.d.mts.map +1 -0
- package/dist/utils/quote-metadata/types.mjs +2 -0
- package/dist/utils/quote-metadata/types.mjs.map +1 -0
- package/dist/utils/slippage.d.cts +1 -1
- package/dist/utils/slippage.d.mts +1 -1
- package/dist/utils/sort-quotes.cjs +16 -0
- package/dist/utils/sort-quotes.cjs.map +1 -0
- package/dist/utils/sort-quotes.d.cts +4 -0
- package/dist/utils/sort-quotes.d.cts.map +1 -0
- package/dist/utils/sort-quotes.d.mts +4 -0
- package/dist/utils/sort-quotes.d.mts.map +1 -0
- package/dist/utils/sort-quotes.mjs +12 -0
- package/dist/utils/sort-quotes.mjs.map +1 -0
- package/dist/validators/amount-and-asset.cjs +27 -0
- package/dist/validators/amount-and-asset.cjs.map +1 -0
- package/dist/validators/amount-and-asset.d.cts +62 -0
- package/dist/validators/amount-and-asset.d.cts.map +1 -0
- package/dist/validators/amount-and-asset.d.mts +62 -0
- package/dist/validators/amount-and-asset.d.mts.map +1 -0
- package/dist/validators/amount-and-asset.mjs +24 -0
- package/dist/validators/amount-and-asset.mjs.map +1 -0
- package/dist/validators/batch-sell.d.cts +8 -8
- package/dist/validators/batch-sell.d.mts +8 -8
- package/dist/validators/bridge-asset.cjs +65 -1
- package/dist/validators/bridge-asset.cjs.map +1 -1
- package/dist/validators/bridge-asset.d.cts +99 -5
- package/dist/validators/bridge-asset.d.cts.map +1 -1
- package/dist/validators/bridge-asset.d.mts +99 -5
- package/dist/validators/bridge-asset.d.mts.map +1 -1
- package/dist/validators/bridge-asset.mjs +64 -1
- package/dist/validators/bridge-asset.mjs.map +1 -1
- package/dist/validators/feature-flags.d.cts +5 -5
- package/dist/validators/feature-flags.d.mts +5 -5
- package/dist/validators/intent.d.cts +3 -3
- package/dist/validators/intent.d.mts +3 -3
- package/dist/validators/quote-request.cjs +57 -0
- package/dist/validators/quote-request.cjs.map +1 -0
- package/dist/validators/quote-request.d.cts +4 -0
- package/dist/validators/quote-request.d.cts.map +1 -0
- package/dist/validators/quote-request.d.mts +4 -0
- package/dist/validators/quote-request.d.mts.map +1 -0
- package/dist/validators/quote-request.mjs +52 -0
- package/dist/validators/quote-request.mjs.map +1 -0
- package/dist/validators/quote-response-v1.d.cts +179 -176
- package/dist/validators/quote-response-v1.d.cts.map +1 -1
- package/dist/validators/quote-response-v1.d.mts +179 -176
- package/dist/validators/quote-response-v1.d.mts.map +1 -1
- package/dist/validators/quote-response.cjs +116 -0
- package/dist/validators/quote-response.cjs.map +1 -0
- package/dist/validators/quote-response.d.cts +1979 -0
- package/dist/validators/quote-response.d.cts.map +1 -0
- package/dist/validators/quote-response.d.mts +1979 -0
- package/dist/validators/quote-response.d.mts.map +1 -0
- package/dist/validators/quote-response.mjs +112 -0
- package/dist/validators/quote-response.mjs.map +1 -0
- package/dist/validators/quote.cjs +75 -2
- package/dist/validators/quote.cjs.map +1 -1
- package/dist/validators/quote.d.cts +407 -44
- package/dist/validators/quote.d.cts.map +1 -1
- package/dist/validators/quote.d.mts +407 -44
- package/dist/validators/quote.d.mts.map +1 -1
- package/dist/validators/quote.mjs +76 -3
- package/dist/validators/quote.mjs.map +1 -1
- package/dist/validators/step.cjs +7 -1
- package/dist/validators/step.cjs.map +1 -1
- package/dist/validators/step.d.cts +197 -26
- package/dist/validators/step.d.cts.map +1 -1
- package/dist/validators/step.d.mts +197 -26
- package/dist/validators/step.d.mts.map +1 -1
- package/dist/validators/step.mjs +7 -1
- package/dist/validators/step.mjs.map +1 -1
- package/dist/validators/token-feature.d.cts +2 -2
- package/dist/validators/token-feature.d.mts +2 -2
- package/dist/validators/trade.d.cts +2 -2
- package/dist/validators/trade.d.mts +2 -2
- package/package.json +8 -8
- package/dist/utils/quote.cjs +0 -368
- package/dist/utils/quote.cjs.map +0 -1
- package/dist/utils/quote.d.cts +0 -98
- package/dist/utils/quote.d.cts.map +0 -1
- package/dist/utils/quote.d.mts +0 -98
- package/dist/utils/quote.d.mts.map +0 -1
- package/dist/utils/quote.mjs +0 -347
- package/dist/utils/quote.mjs.map +0 -1
|
@@ -4,28 +4,28 @@ export declare enum ActionTypes {
|
|
|
4
4
|
REFUEL = "refuel"
|
|
5
5
|
}
|
|
6
6
|
export declare const StepSchema: import("@metamask/superstruct").Struct<{
|
|
7
|
-
action: ActionTypes;
|
|
8
7
|
srcChainId: number;
|
|
8
|
+
action: ActionTypes;
|
|
9
9
|
destChainId?: number | undefined;
|
|
10
10
|
srcAsset?: {
|
|
11
11
|
symbol: string;
|
|
12
12
|
chainId: number;
|
|
13
|
-
address: string;
|
|
14
|
-
assetId: `${string}:${string}/${string}:${string}`;
|
|
15
13
|
name: string;
|
|
14
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
16
15
|
decimals: number;
|
|
17
|
-
|
|
16
|
+
address: string;
|
|
18
17
|
iconUrl?: string | null | undefined;
|
|
18
|
+
icon?: string | null | undefined;
|
|
19
19
|
} | undefined;
|
|
20
20
|
destAsset?: {
|
|
21
21
|
symbol: string;
|
|
22
22
|
chainId: number;
|
|
23
|
-
address: string;
|
|
24
|
-
assetId: `${string}:${string}/${string}:${string}`;
|
|
25
23
|
name: string;
|
|
24
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
26
25
|
decimals: number;
|
|
27
|
-
|
|
26
|
+
address: string;
|
|
28
27
|
iconUrl?: string | null | undefined;
|
|
28
|
+
icon?: string | null | undefined;
|
|
29
29
|
} | undefined;
|
|
30
30
|
}, {
|
|
31
31
|
action: import("@metamask/superstruct").Struct<ActionTypes, {
|
|
@@ -38,12 +38,12 @@ export declare const StepSchema: import("@metamask/superstruct").Struct<{
|
|
|
38
38
|
srcAsset: import("@metamask/superstruct").Struct<{
|
|
39
39
|
symbol: string;
|
|
40
40
|
chainId: number;
|
|
41
|
-
address: string;
|
|
42
|
-
assetId: `${string}:${string}/${string}:${string}`;
|
|
43
41
|
name: string;
|
|
42
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
44
43
|
decimals: number;
|
|
45
|
-
|
|
44
|
+
address: string;
|
|
46
45
|
iconUrl?: string | null | undefined;
|
|
46
|
+
icon?: string | null | undefined;
|
|
47
47
|
} | undefined, {
|
|
48
48
|
chainId: import("@metamask/superstruct").Struct<number, null>;
|
|
49
49
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -57,12 +57,12 @@ export declare const StepSchema: import("@metamask/superstruct").Struct<{
|
|
|
57
57
|
destAsset: import("@metamask/superstruct").Struct<{
|
|
58
58
|
symbol: string;
|
|
59
59
|
chainId: number;
|
|
60
|
-
address: string;
|
|
61
|
-
assetId: `${string}:${string}/${string}:${string}`;
|
|
62
60
|
name: string;
|
|
61
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
63
62
|
decimals: number;
|
|
64
|
-
|
|
63
|
+
address: string;
|
|
65
64
|
iconUrl?: string | null | undefined;
|
|
65
|
+
icon?: string | null | undefined;
|
|
66
66
|
} | undefined, {
|
|
67
67
|
chainId: import("@metamask/superstruct").Struct<number, null>;
|
|
68
68
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -75,28 +75,28 @@ export declare const StepSchema: import("@metamask/superstruct").Struct<{
|
|
|
75
75
|
}>;
|
|
76
76
|
}>;
|
|
77
77
|
export declare const RefuelDataSchema: import("@metamask/superstruct").Struct<{
|
|
78
|
-
action: ActionTypes;
|
|
79
78
|
srcChainId: number;
|
|
79
|
+
action: ActionTypes;
|
|
80
80
|
destChainId?: number | undefined;
|
|
81
81
|
srcAsset?: {
|
|
82
82
|
symbol: string;
|
|
83
83
|
chainId: number;
|
|
84
|
-
address: string;
|
|
85
|
-
assetId: `${string}:${string}/${string}:${string}`;
|
|
86
84
|
name: string;
|
|
85
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
87
86
|
decimals: number;
|
|
88
|
-
|
|
87
|
+
address: string;
|
|
89
88
|
iconUrl?: string | null | undefined;
|
|
89
|
+
icon?: string | null | undefined;
|
|
90
90
|
} | undefined;
|
|
91
91
|
destAsset?: {
|
|
92
92
|
symbol: string;
|
|
93
93
|
chainId: number;
|
|
94
|
-
address: string;
|
|
95
|
-
assetId: `${string}:${string}/${string}:${string}`;
|
|
96
94
|
name: string;
|
|
95
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
97
96
|
decimals: number;
|
|
98
|
-
|
|
97
|
+
address: string;
|
|
99
98
|
iconUrl?: string | null | undefined;
|
|
99
|
+
icon?: string | null | undefined;
|
|
100
100
|
} | undefined;
|
|
101
101
|
}, {
|
|
102
102
|
action: import("@metamask/superstruct").Struct<ActionTypes, {
|
|
@@ -109,12 +109,12 @@ export declare const RefuelDataSchema: import("@metamask/superstruct").Struct<{
|
|
|
109
109
|
srcAsset: import("@metamask/superstruct").Struct<{
|
|
110
110
|
symbol: string;
|
|
111
111
|
chainId: number;
|
|
112
|
-
address: string;
|
|
113
|
-
assetId: `${string}:${string}/${string}:${string}`;
|
|
114
112
|
name: string;
|
|
113
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
115
114
|
decimals: number;
|
|
116
|
-
|
|
115
|
+
address: string;
|
|
117
116
|
iconUrl?: string | null | undefined;
|
|
117
|
+
icon?: string | null | undefined;
|
|
118
118
|
} | undefined, {
|
|
119
119
|
chainId: import("@metamask/superstruct").Struct<number, null>;
|
|
120
120
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -128,12 +128,12 @@ export declare const RefuelDataSchema: import("@metamask/superstruct").Struct<{
|
|
|
128
128
|
destAsset: import("@metamask/superstruct").Struct<{
|
|
129
129
|
symbol: string;
|
|
130
130
|
chainId: number;
|
|
131
|
-
address: string;
|
|
132
|
-
assetId: `${string}:${string}/${string}:${string}`;
|
|
133
131
|
name: string;
|
|
132
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
134
133
|
decimals: number;
|
|
135
|
-
|
|
134
|
+
address: string;
|
|
136
135
|
iconUrl?: string | null | undefined;
|
|
136
|
+
icon?: string | null | undefined;
|
|
137
137
|
} | undefined, {
|
|
138
138
|
chainId: import("@metamask/superstruct").Struct<number, null>;
|
|
139
139
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -145,4 +145,175 @@ export declare const RefuelDataSchema: import("@metamask/superstruct").Struct<{
|
|
|
145
145
|
iconUrl: import("@metamask/superstruct").Struct<string | null | undefined, null>;
|
|
146
146
|
}>;
|
|
147
147
|
}>;
|
|
148
|
+
export declare const StepSchemaV2: import("@metamask/superstruct").Struct<{
|
|
149
|
+
action: ActionTypes;
|
|
150
|
+
src: {
|
|
151
|
+
asset: {
|
|
152
|
+
symbol: string;
|
|
153
|
+
name: string;
|
|
154
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
155
|
+
decimals: number;
|
|
156
|
+
} & {
|
|
157
|
+
isVerified?: boolean | undefined;
|
|
158
|
+
securityData?: {
|
|
159
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
160
|
+
metadata?: {
|
|
161
|
+
features: {
|
|
162
|
+
featureId: string;
|
|
163
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
164
|
+
description: string;
|
|
165
|
+
}[];
|
|
166
|
+
} | undefined;
|
|
167
|
+
} | undefined;
|
|
168
|
+
} & {
|
|
169
|
+
iconUrl?: string | null | undefined;
|
|
170
|
+
noFee?: {
|
|
171
|
+
isDestination?: boolean | null | undefined;
|
|
172
|
+
isSource?: boolean | null | undefined;
|
|
173
|
+
} | undefined;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
dest: {
|
|
177
|
+
asset: {
|
|
178
|
+
symbol: string;
|
|
179
|
+
name: string;
|
|
180
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
181
|
+
decimals: number;
|
|
182
|
+
} & {
|
|
183
|
+
isVerified?: boolean | undefined;
|
|
184
|
+
securityData?: {
|
|
185
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
186
|
+
metadata?: {
|
|
187
|
+
features: {
|
|
188
|
+
featureId: string;
|
|
189
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
190
|
+
description: string;
|
|
191
|
+
}[];
|
|
192
|
+
} | undefined;
|
|
193
|
+
} | undefined;
|
|
194
|
+
} & {
|
|
195
|
+
iconUrl?: string | null | undefined;
|
|
196
|
+
noFee?: {
|
|
197
|
+
isDestination?: boolean | null | undefined;
|
|
198
|
+
isSource?: boolean | null | undefined;
|
|
199
|
+
} | undefined;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
}, {
|
|
203
|
+
action: import("@metamask/superstruct").Struct<ActionTypes, {
|
|
204
|
+
bridge: ActionTypes.BRIDGE;
|
|
205
|
+
swap: ActionTypes.SWAP;
|
|
206
|
+
refuel: ActionTypes.REFUEL;
|
|
207
|
+
}>;
|
|
208
|
+
src: import("@metamask/superstruct").Struct<{
|
|
209
|
+
asset: {
|
|
210
|
+
symbol: string;
|
|
211
|
+
name: string;
|
|
212
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
213
|
+
decimals: number;
|
|
214
|
+
} & {
|
|
215
|
+
isVerified?: boolean | undefined;
|
|
216
|
+
securityData?: {
|
|
217
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
218
|
+
metadata?: {
|
|
219
|
+
features: {
|
|
220
|
+
featureId: string;
|
|
221
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
222
|
+
description: string;
|
|
223
|
+
}[];
|
|
224
|
+
} | undefined;
|
|
225
|
+
} | undefined;
|
|
226
|
+
} & {
|
|
227
|
+
iconUrl?: string | null | undefined;
|
|
228
|
+
noFee?: {
|
|
229
|
+
isDestination?: boolean | null | undefined;
|
|
230
|
+
isSource?: boolean | null | undefined;
|
|
231
|
+
} | undefined;
|
|
232
|
+
};
|
|
233
|
+
}, Pick<{
|
|
234
|
+
amount: import("@metamask/superstruct").Struct<string, null>;
|
|
235
|
+
normalizedAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
236
|
+
asset: import("@metamask/superstruct").Struct<{
|
|
237
|
+
symbol: string;
|
|
238
|
+
name: string;
|
|
239
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
240
|
+
decimals: number;
|
|
241
|
+
} & {
|
|
242
|
+
isVerified?: boolean | undefined;
|
|
243
|
+
securityData?: {
|
|
244
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
245
|
+
metadata?: {
|
|
246
|
+
features: {
|
|
247
|
+
featureId: string;
|
|
248
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
249
|
+
description: string;
|
|
250
|
+
}[];
|
|
251
|
+
} | undefined;
|
|
252
|
+
} | undefined;
|
|
253
|
+
} & {
|
|
254
|
+
iconUrl?: string | null | undefined;
|
|
255
|
+
noFee?: {
|
|
256
|
+
isDestination?: boolean | null | undefined;
|
|
257
|
+
isSource?: boolean | null | undefined;
|
|
258
|
+
} | undefined;
|
|
259
|
+
}, null>;
|
|
260
|
+
usd: import("@metamask/superstruct").Struct<string | null | undefined, null>;
|
|
261
|
+
valueInCurrency: import("@metamask/superstruct").Struct<string | null | undefined, null>;
|
|
262
|
+
}, "asset">>;
|
|
263
|
+
dest: import("@metamask/superstruct").Struct<{
|
|
264
|
+
asset: {
|
|
265
|
+
symbol: string;
|
|
266
|
+
name: string;
|
|
267
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
268
|
+
decimals: number;
|
|
269
|
+
} & {
|
|
270
|
+
isVerified?: boolean | undefined;
|
|
271
|
+
securityData?: {
|
|
272
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
273
|
+
metadata?: {
|
|
274
|
+
features: {
|
|
275
|
+
featureId: string;
|
|
276
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
277
|
+
description: string;
|
|
278
|
+
}[];
|
|
279
|
+
} | undefined;
|
|
280
|
+
} | undefined;
|
|
281
|
+
} & {
|
|
282
|
+
iconUrl?: string | null | undefined;
|
|
283
|
+
noFee?: {
|
|
284
|
+
isDestination?: boolean | null | undefined;
|
|
285
|
+
isSource?: boolean | null | undefined;
|
|
286
|
+
} | undefined;
|
|
287
|
+
};
|
|
288
|
+
}, Pick<{
|
|
289
|
+
amount: import("@metamask/superstruct").Struct<string, null>;
|
|
290
|
+
normalizedAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
291
|
+
asset: import("@metamask/superstruct").Struct<{
|
|
292
|
+
symbol: string;
|
|
293
|
+
name: string;
|
|
294
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
295
|
+
decimals: number;
|
|
296
|
+
} & {
|
|
297
|
+
isVerified?: boolean | undefined;
|
|
298
|
+
securityData?: {
|
|
299
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
300
|
+
metadata?: {
|
|
301
|
+
features: {
|
|
302
|
+
featureId: string;
|
|
303
|
+
type: import("./bridge-asset.mjs").BridgeAssetSecurityDataType;
|
|
304
|
+
description: string;
|
|
305
|
+
}[];
|
|
306
|
+
} | undefined;
|
|
307
|
+
} | undefined;
|
|
308
|
+
} & {
|
|
309
|
+
iconUrl?: string | null | undefined;
|
|
310
|
+
noFee?: {
|
|
311
|
+
isDestination?: boolean | null | undefined;
|
|
312
|
+
isSource?: boolean | null | undefined;
|
|
313
|
+
} | undefined;
|
|
314
|
+
}, null>;
|
|
315
|
+
usd: import("@metamask/superstruct").Struct<string | null | undefined, null>;
|
|
316
|
+
valueInCurrency: import("@metamask/superstruct").Struct<string | null | undefined, null>;
|
|
317
|
+
}, "asset">>;
|
|
318
|
+
}>;
|
|
148
319
|
//# sourceMappingURL=step.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.mts","sourceRoot":"","sources":["../../src/validators/step.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step.d.mts","sourceRoot":"","sources":["../../src/validators/step.ts"],"names":[],"mappings":"AAKA,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAa,CAAC;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvB,CAAC"}
|
package/dist/validators/step.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type, enums, optional } from "@metamask/superstruct";
|
|
1
|
+
import { type, enums, optional, pick } from "@metamask/superstruct";
|
|
2
|
+
import { AmountsAndAssetSchema } from "./amount-and-asset.mjs";
|
|
2
3
|
import { BridgeAssetSchema, ChainIdSchema } from "./bridge-asset.mjs";
|
|
3
4
|
export var ActionTypes;
|
|
4
5
|
(function (ActionTypes) {
|
|
@@ -14,4 +15,9 @@ export const StepSchema = type({
|
|
|
14
15
|
destAsset: optional(BridgeAssetSchema),
|
|
15
16
|
});
|
|
16
17
|
export const RefuelDataSchema = StepSchema;
|
|
18
|
+
export const StepSchemaV2 = type({
|
|
19
|
+
action: enums(Object.values(ActionTypes)),
|
|
20
|
+
src: pick(AmountsAndAssetSchema, ['asset']),
|
|
21
|
+
dest: pick(AmountsAndAssetSchema, ['asset']),
|
|
22
|
+
});
|
|
17
23
|
//# sourceMappingURL=step.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.mjs","sourceRoot":"","sources":["../../src/validators/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"step.mjs","sourceRoot":"","sources":["../../src/validators/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,8BAA8B;AAEpE,OAAO,EAAE,qBAAqB,EAAE,+BAA2B;AAC3D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,2BAAuB;AAElE,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACnB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzC,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC;IACpC,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IACrC,SAAS,EAAE,QAAQ,CAAC,iBAAiB,CAAC;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE3C,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzC,GAAG,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC,OAAO,CAAC,CAAC;CAC7C,CAAC,CAAC","sourcesContent":["import { type, enums, optional, pick } from '@metamask/superstruct';\n\nimport { AmountsAndAssetSchema } from './amount-and-asset';\nimport { BridgeAssetSchema, ChainIdSchema } from './bridge-asset';\n\nexport enum ActionTypes {\n BRIDGE = 'bridge',\n SWAP = 'swap',\n REFUEL = 'refuel',\n}\n\nexport const StepSchema = type({\n action: enums(Object.values(ActionTypes)),\n srcChainId: ChainIdSchema,\n destChainId: optional(ChainIdSchema),\n srcAsset: optional(BridgeAssetSchema),\n destAsset: optional(BridgeAssetSchema),\n});\n\nexport const RefuelDataSchema = StepSchema;\n\nexport const StepSchemaV2 = type({\n action: enums(Object.values(ActionTypes)),\n src: pick(AmountsAndAssetSchema, ['asset']),\n dest: pick(AmountsAndAssetSchema, ['asset']),\n});\n"]}
|
|
@@ -6,8 +6,8 @@ export declare enum TokenFeatureType {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const TokenFeatureSchema: import("@metamask/superstruct").Struct<{
|
|
8
8
|
type: TokenFeatureType;
|
|
9
|
-
feature_id: string;
|
|
10
9
|
description: string;
|
|
10
|
+
feature_id: string;
|
|
11
11
|
}, {
|
|
12
12
|
feature_id: import("@metamask/superstruct").Struct<string, null>;
|
|
13
13
|
type: import("@metamask/superstruct").Struct<TokenFeatureType, {
|
|
@@ -20,7 +20,7 @@ export declare const TokenFeatureSchema: import("@metamask/superstruct").Struct<
|
|
|
20
20
|
}>;
|
|
21
21
|
export declare const validateTokenFeature: (data: unknown) => data is {
|
|
22
22
|
type: TokenFeatureType;
|
|
23
|
-
feature_id: string;
|
|
24
23
|
description: string;
|
|
24
|
+
feature_id: string;
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=token-feature.d.cts.map
|
|
@@ -6,8 +6,8 @@ export declare enum TokenFeatureType {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const TokenFeatureSchema: import("@metamask/superstruct").Struct<{
|
|
8
8
|
type: TokenFeatureType;
|
|
9
|
-
feature_id: string;
|
|
10
9
|
description: string;
|
|
10
|
+
feature_id: string;
|
|
11
11
|
}, {
|
|
12
12
|
feature_id: import("@metamask/superstruct").Struct<string, null>;
|
|
13
13
|
type: import("@metamask/superstruct").Struct<TokenFeatureType, {
|
|
@@ -20,7 +20,7 @@ export declare const TokenFeatureSchema: import("@metamask/superstruct").Struct<
|
|
|
20
20
|
}>;
|
|
21
21
|
export declare const validateTokenFeature: (data: unknown) => data is {
|
|
22
22
|
type: TokenFeatureType;
|
|
23
|
-
feature_id: string;
|
|
24
23
|
description: string;
|
|
24
|
+
feature_id: string;
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=token-feature.d.mts.map
|
|
@@ -2,8 +2,8 @@ import type { Infer } from "@metamask/superstruct";
|
|
|
2
2
|
export declare const HexString: import("@metamask/superstruct").Struct<`0x${string}`, null>;
|
|
3
3
|
export declare const TxDataSchema: import("@metamask/superstruct").Struct<{
|
|
4
4
|
chainId: number;
|
|
5
|
-
to: `0x${string}`;
|
|
6
5
|
from: `0x${string}`;
|
|
6
|
+
to: `0x${string}`;
|
|
7
7
|
value: `0x${string}`;
|
|
8
8
|
data: `0x${string}`;
|
|
9
9
|
gasLimit: number | null;
|
|
@@ -69,8 +69,8 @@ export type Trade = TxData | string | BitcoinTradeData | TronTradeData | Stellar
|
|
|
69
69
|
*/
|
|
70
70
|
export declare const isEvmTxData: (trade: Trade) => trade is {
|
|
71
71
|
chainId: number;
|
|
72
|
-
to: `0x${string}`;
|
|
73
72
|
from: `0x${string}`;
|
|
73
|
+
to: `0x${string}`;
|
|
74
74
|
value: `0x${string}`;
|
|
75
75
|
data: `0x${string}`;
|
|
76
76
|
gasLimit: number | null;
|
|
@@ -2,8 +2,8 @@ import type { Infer } from "@metamask/superstruct";
|
|
|
2
2
|
export declare const HexString: import("@metamask/superstruct").Struct<`0x${string}`, null>;
|
|
3
3
|
export declare const TxDataSchema: import("@metamask/superstruct").Struct<{
|
|
4
4
|
chainId: number;
|
|
5
|
-
to: `0x${string}`;
|
|
6
5
|
from: `0x${string}`;
|
|
6
|
+
to: `0x${string}`;
|
|
7
7
|
value: `0x${string}`;
|
|
8
8
|
data: `0x${string}`;
|
|
9
9
|
gasLimit: number | null;
|
|
@@ -69,8 +69,8 @@ export type Trade = TxData | string | BitcoinTradeData | TronTradeData | Stellar
|
|
|
69
69
|
*/
|
|
70
70
|
export declare const isEvmTxData: (trade: Trade) => trade is {
|
|
71
71
|
chainId: number;
|
|
72
|
-
to: `0x${string}`;
|
|
73
72
|
from: `0x${string}`;
|
|
73
|
+
to: `0x${string}`;
|
|
74
74
|
value: `0x${string}`;
|
|
75
75
|
data: `0x${string}`;
|
|
76
76
|
gasLimit: number | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/bridge-controller",
|
|
3
|
-
"version": "77.
|
|
3
|
+
"version": "77.8.0-preview-5959fe813",
|
|
4
4
|
"description": "Manages bridge-related quote fetching functionality for MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@ethersproject/contracts": "^5.7.0",
|
|
61
61
|
"@ethersproject/providers": "^5.7.0",
|
|
62
62
|
"@metamask/accounts-controller": "^39.0.5",
|
|
63
|
-
"@metamask/assets-controller": "^11.1.
|
|
64
|
-
"@metamask/assets-controllers": "^
|
|
63
|
+
"@metamask/assets-controller": "^11.1.1",
|
|
64
|
+
"@metamask/assets-controllers": "^110.0.0",
|
|
65
65
|
"@metamask/base-controller": "^9.1.0",
|
|
66
66
|
"@metamask/controller-utils": "^12.3.0",
|
|
67
67
|
"@metamask/gas-fee-controller": "^26.2.4",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@metamask/profile-sync-controller": "^28.3.0",
|
|
75
75
|
"@metamask/remote-feature-flag-controller": "^4.2.2",
|
|
76
76
|
"@metamask/snaps-controllers": "^19.0.0",
|
|
77
|
-
"@metamask/transaction-controller": "^69.1
|
|
77
|
+
"@metamask/transaction-controller": "^69.2.1",
|
|
78
78
|
"@metamask/utils": "^11.11.0",
|
|
79
79
|
"bignumber.js": "^9.1.2",
|
|
80
80
|
"reselect": "^5.1.1",
|
|
@@ -85,13 +85,13 @@
|
|
|
85
85
|
"@metamask/eth-json-rpc-provider": "^6.0.1",
|
|
86
86
|
"@metamask/superstruct": "^3.1.0",
|
|
87
87
|
"@ts-bridge/cli": "^0.6.4",
|
|
88
|
-
"@types/jest": "^
|
|
88
|
+
"@types/jest": "^30.0.0",
|
|
89
89
|
"deepmerge": "^4.2.2",
|
|
90
|
-
"jest": "^
|
|
91
|
-
"jest-environment-jsdom": "^
|
|
90
|
+
"jest": "^30.4.2",
|
|
91
|
+
"jest-environment-jsdom": "^30.4.1",
|
|
92
92
|
"lodash": "^4.17.21",
|
|
93
93
|
"nock": "^13.3.1",
|
|
94
|
-
"ts-jest": "^29.
|
|
94
|
+
"ts-jest": "^29.4.11",
|
|
95
95
|
"tsx": "^4.20.5",
|
|
96
96
|
"typedoc": "^0.25.13",
|
|
97
97
|
"typedoc-plugin-missing-exports": "^2.0.0",
|