@metamask-previews/bridge-controller 77.3.2-preview-bbd2df29f → 77.3.2-preview-34f2bcbf7
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 +4 -0
- package/dist/bridge-controller.cjs.map +1 -1
- package/dist/bridge-controller.d.cts +3 -2
- package/dist/bridge-controller.d.cts.map +1 -1
- package/dist/bridge-controller.d.mts +3 -2
- 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 +36 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +14 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +5971 -6520
- package/dist/selectors.d.cts.map +1 -1
- package/dist/selectors.d.mts +5971 -6520
- package/dist/selectors.d.mts.map +1 -1
- package/dist/selectors.mjs.map +1 -1
- package/dist/types.cjs +1 -12
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +21 -41
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +21 -41
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +0 -11
- package/dist/types.mjs.map +1 -1
- package/dist/utils/bridge.cjs +1 -0
- package/dist/utils/bridge.cjs.map +1 -1
- package/dist/utils/bridge.d.cts +4 -3
- package/dist/utils/bridge.d.cts.map +1 -1
- package/dist/utils/bridge.d.mts +4 -3
- package/dist/utils/bridge.d.mts.map +1 -1
- package/dist/utils/bridge.mjs +1 -0
- 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 +16 -11
- package/dist/utils/fetch.cjs.map +1 -1
- package/dist/utils/fetch.d.cts +3 -1
- package/dist/utils/fetch.d.cts.map +1 -1
- package/dist/utils/fetch.d.mts +3 -1
- package/dist/utils/fetch.d.mts.map +1 -1
- package/dist/utils/fetch.mjs +9 -4
- 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 +4 -2
- package/dist/utils/metrics/properties.d.cts.map +1 -1
- package/dist/utils/metrics/properties.d.mts +4 -2
- 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 +2 -1
- package/dist/utils/metrics/types.d.cts.map +1 -1
- package/dist/utils/metrics/types.d.mts +2 -1
- 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 +2 -1
- package/dist/utils/quote-fees.cjs.map +1 -1
- package/dist/utils/quote-fees.d.cts +2 -1
- package/dist/utils/quote-fees.d.cts.map +1 -1
- package/dist/utils/quote-fees.d.mts +2 -1
- package/dist/utils/quote-fees.d.mts.map +1 -1
- package/dist/utils/quote-fees.mjs +2 -1
- 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 +5 -2
- package/dist/utils/quote.d.cts.map +1 -1
- package/dist/utils/quote.d.mts +5 -2
- 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/struct-error.cjs +16 -0
- package/dist/utils/struct-error.cjs.map +1 -0
- package/dist/utils/struct-error.d.cts +11 -0
- package/dist/utils/struct-error.d.cts.map +1 -0
- package/dist/utils/struct-error.d.mts +11 -0
- package/dist/utils/struct-error.d.mts.map +1 -0
- package/dist/utils/struct-error.mjs +12 -0
- package/dist/utils/struct-error.mjs.map +1 -0
- package/dist/utils/trade-utils.cjs +7 -66
- package/dist/utils/trade-utils.cjs.map +1 -1
- package/dist/utils/trade-utils.d.cts +1 -54
- package/dist/utils/trade-utils.d.cts.map +1 -1
- package/dist/utils/trade-utils.d.mts +1 -54
- package/dist/utils/trade-utils.d.mts.map +1 -1
- package/dist/utils/trade-utils.mjs +1 -56
- package/dist/utils/trade-utils.mjs.map +1 -1
- package/dist/validators/batch-sell.cjs +39 -0
- package/dist/validators/batch-sell.cjs.map +1 -0
- package/dist/validators/batch-sell.d.cts +79 -0
- package/dist/validators/batch-sell.d.cts.map +1 -0
- package/dist/validators/batch-sell.d.mts +79 -0
- package/dist/validators/batch-sell.d.mts.map +1 -0
- package/dist/validators/batch-sell.mjs +35 -0
- package/dist/validators/batch-sell.mjs.map +1 -0
- package/dist/validators/bridge-asset.cjs +42 -0
- package/dist/validators/bridge-asset.cjs.map +1 -0
- package/dist/validators/bridge-asset.d.cts +52 -0
- package/dist/validators/bridge-asset.d.cts.map +1 -0
- package/dist/validators/bridge-asset.d.mts +52 -0
- package/dist/validators/bridge-asset.d.mts.map +1 -0
- package/dist/validators/bridge-asset.mjs +38 -0
- package/dist/validators/bridge-asset.mjs.map +1 -0
- package/dist/validators/feature-flags.cjs +110 -0
- package/dist/validators/feature-flags.cjs.map +1 -0
- package/dist/validators/feature-flags.d.cts +264 -0
- package/dist/validators/feature-flags.d.cts.map +1 -0
- package/dist/validators/feature-flags.d.mts +264 -0
- package/dist/validators/feature-flags.d.mts.map +1 -0
- package/dist/validators/feature-flags.mjs +106 -0
- package/dist/validators/feature-flags.mjs.map +1 -0
- package/dist/validators/intent.cjs +122 -0
- package/dist/validators/intent.cjs.map +1 -0
- package/dist/validators/intent.d.cts +231 -0
- package/dist/validators/intent.d.cts.map +1 -0
- package/dist/validators/intent.d.mts +231 -0
- package/dist/validators/intent.d.mts.map +1 -0
- package/dist/validators/intent.mjs +119 -0
- package/dist/validators/intent.mjs.map +1 -0
- package/dist/validators/number.cjs +8 -0
- package/dist/validators/number.cjs.map +1 -0
- package/dist/validators/number.d.cts +4 -0
- package/dist/validators/number.d.cts.map +1 -0
- package/dist/validators/number.d.mts +4 -0
- package/dist/validators/number.d.mts.map +1 -0
- package/dist/validators/number.mjs +5 -0
- package/dist/validators/number.mjs.map +1 -0
- package/dist/validators/quote-response-v1.cjs +31 -0
- package/dist/validators/quote-response-v1.cjs.map +1 -0
- package/dist/validators/quote-response-v1.d.cts +658 -0
- package/dist/validators/quote-response-v1.d.cts.map +1 -0
- package/dist/validators/quote-response-v1.d.mts +658 -0
- package/dist/validators/quote-response-v1.d.mts.map +1 -0
- package/dist/validators/quote-response-v1.mjs +27 -0
- package/dist/validators/quote-response-v1.mjs.map +1 -0
- package/dist/validators/quote-stream-complete.cjs +29 -0
- package/dist/validators/quote-stream-complete.cjs.map +1 -0
- package/dist/validators/quote-stream-complete.d.cts +39 -0
- package/dist/validators/quote-stream-complete.d.cts.map +1 -0
- package/dist/validators/quote-stream-complete.d.mts +39 -0
- package/dist/validators/quote-stream-complete.d.mts.map +1 -0
- package/dist/validators/quote-stream-complete.mjs +25 -0
- package/dist/validators/quote-stream-complete.mjs.map +1 -0
- package/dist/validators/quote.cjs +96 -0
- package/dist/validators/quote.cjs.map +1 -0
- package/dist/validators/quote.d.cts +230 -0
- package/dist/validators/quote.d.cts.map +1 -0
- package/dist/validators/quote.d.mts +230 -0
- package/dist/validators/quote.d.mts.map +1 -0
- package/dist/validators/quote.mjs +93 -0
- package/dist/validators/quote.mjs.map +1 -0
- package/dist/validators/step.cjs +20 -0
- package/dist/validators/step.cjs.map +1 -0
- package/dist/validators/step.d.cts +148 -0
- package/dist/validators/step.d.cts.map +1 -0
- package/dist/validators/step.d.mts +148 -0
- package/dist/validators/step.d.mts.map +1 -0
- package/dist/validators/step.mjs +17 -0
- package/dist/validators/step.mjs.map +1 -0
- package/dist/validators/token-feature.cjs +22 -0
- package/dist/validators/token-feature.cjs.map +1 -0
- package/dist/validators/token-feature.d.cts +26 -0
- package/dist/validators/token-feature.d.cts.map +1 -0
- package/dist/validators/token-feature.d.mts +26 -0
- package/dist/validators/token-feature.d.mts.map +1 -0
- package/dist/validators/token-feature.mjs +18 -0
- package/dist/validators/token-feature.mjs.map +1 -0
- package/dist/validators/trade.cjs +94 -0
- package/dist/validators/trade.cjs.map +1 -0
- package/dist/validators/trade.d.cts +121 -0
- package/dist/validators/trade.d.cts.map +1 -0
- package/dist/validators/trade.d.mts +121 -0
- package/dist/validators/trade.d.mts.map +1 -0
- package/dist/validators/trade.mjs +86 -0
- package/dist/validators/trade.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/utils/validators.cjs +0 -471
- package/dist/utils/validators.cjs.map +0 -1
- package/dist/utils/validators.d.cts +0 -1765
- package/dist/utils/validators.d.cts.map +0 -1
- package/dist/utils/validators.d.mts +0 -1765
- package/dist/utils/validators.d.mts.map +0 -1
- package/dist/utils/validators.mjs +0 -461
- package/dist/utils/validators.mjs.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateQuoteResponseV1 = exports.QuoteResponseSchemaV1 = void 0;
|
|
4
|
+
const superstruct_1 = require("@metamask/superstruct");
|
|
5
|
+
const utils_1 = require("@metamask/utils");
|
|
6
|
+
const feature_flags_1 = require("./feature-flags.cjs");
|
|
7
|
+
const number_1 = require("./number.cjs");
|
|
8
|
+
const quote_1 = require("./quote.cjs");
|
|
9
|
+
const trade_1 = require("./trade.cjs");
|
|
10
|
+
exports.QuoteResponseSchemaV1 = (0, superstruct_1.type)({
|
|
11
|
+
featureId: (0, superstruct_1.optional)((0, superstruct_1.enums)(Object.values(feature_flags_1.FeatureId))),
|
|
12
|
+
quoteId: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
13
|
+
quote: quote_1.QuoteSchema,
|
|
14
|
+
estimatedProcessingTimeInSeconds: (0, superstruct_1.number)(),
|
|
15
|
+
approval: (0, superstruct_1.optional)((0, superstruct_1.union)([trade_1.TxDataSchema, trade_1.TronTradeDataSchema])),
|
|
16
|
+
trade: (0, superstruct_1.union)([
|
|
17
|
+
trade_1.TxDataSchema,
|
|
18
|
+
trade_1.BitcoinTradeDataSchema,
|
|
19
|
+
trade_1.TronTradeDataSchema,
|
|
20
|
+
trade_1.StellarTradeDataSchema,
|
|
21
|
+
(0, superstruct_1.string)(),
|
|
22
|
+
]),
|
|
23
|
+
l1GasFeesInHexWei: (0, superstruct_1.optional)(utils_1.StrictHexStruct),
|
|
24
|
+
nonEvmFeesInNative: (0, superstruct_1.optional)(number_1.FloatStringSchema),
|
|
25
|
+
});
|
|
26
|
+
const validateQuoteResponseV1 = (data) => {
|
|
27
|
+
(0, superstruct_1.assert)(data, exports.QuoteResponseSchemaV1);
|
|
28
|
+
return true;
|
|
29
|
+
};
|
|
30
|
+
exports.validateQuoteResponseV1 = validateQuoteResponseV1;
|
|
31
|
+
//# sourceMappingURL=quote-response-v1.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote-response-v1.cjs","sourceRoot":"","sources":["../../src/validators/quote-response-v1.ts"],"names":[],"mappings":";;;AACA,uDAQ+B;AAC/B,2CAAkD;AAElD,uDAA4C;AAC5C,yCAA6C;AAC7C,uCAAsC;AACtC,uCAKiB;AAQJ,QAAA,qBAAqB,GAAG,IAAA,kBAAI,EAAC;IACxC,SAAS,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,MAAM,CAAC,MAAM,CAAC,yBAAS,CAAC,CAAC,CAAC;IACpD,OAAO,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC3B,KAAK,EAAE,mBAAW;IAClB,gCAAgC,EAAE,IAAA,oBAAM,GAAE;IAC1C,QAAQ,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,CAAC,oBAAY,EAAE,2BAAmB,CAAC,CAAC,CAAC;IAC9D,KAAK,EAAE,IAAA,mBAAK,EAAC;QACX,oBAAY;QACZ,8BAAsB;QACtB,2BAAmB;QACnB,8BAAsB;QACtB,IAAA,oBAAM,GAAE;KACT,CAAC;IACF,iBAAiB,EAAE,IAAA,sBAAQ,EAAC,uBAAe,CAAC;IAC5C,kBAAkB,EAAE,IAAA,sBAAQ,EAAC,0BAAiB,CAAC;CAChD,CAAC,CAAC;AAEI,MAAM,uBAAuB,GAAG,CACrC,IAAa,EACgC,EAAE;IAC/C,IAAA,oBAAM,EAAC,IAAI,EAAE,6BAAqB,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n string,\n number,\n type,\n optional,\n enums,\n union,\n assert,\n} from '@metamask/superstruct';\nimport { StrictHexStruct } from '@metamask/utils';\n\nimport { FeatureId } from './feature-flags';\nimport { FloatStringSchema } from './number';\nimport { QuoteSchema } from './quote';\nimport {\n TxDataSchema,\n TronTradeDataSchema,\n BitcoinTradeDataSchema,\n StellarTradeDataSchema,\n} from './trade';\nimport type {\n BitcoinTradeData,\n StellarTradeData,\n TronTradeData,\n TxData,\n} from './trade';\n\nexport const QuoteResponseSchemaV1 = type({\n featureId: optional(enums(Object.values(FeatureId))),\n quoteId: optional(string()),\n quote: QuoteSchema,\n estimatedProcessingTimeInSeconds: number(),\n approval: optional(union([TxDataSchema, TronTradeDataSchema])),\n trade: union([\n TxDataSchema,\n BitcoinTradeDataSchema,\n TronTradeDataSchema,\n StellarTradeDataSchema,\n string(),\n ]),\n l1GasFeesInHexWei: optional(StrictHexStruct),\n nonEvmFeesInNative: optional(FloatStringSchema),\n});\n\nexport const validateQuoteResponseV1 = (\n data: unknown,\n): data is Infer<typeof QuoteResponseSchemaV1> => {\n assert(data, QuoteResponseSchemaV1);\n return true;\n};\n\n/**\n * This is the type for the quote response from the bridge-api\n * TxDataType can be overriden to be a string when the quote is non-evm\n * ApprovalType can be overriden when you know the specific approval type (e.g., TxData for EVM-only contexts)\n *\n * @deprecated Use `QuoteResponseV2` instead\n */\nexport type QuoteResponseV1<\n TxDataType =\n | TxData\n | string\n | BitcoinTradeData\n | TronTradeData\n | StellarTradeData,\n ApprovalType = TxData | TronTradeData,\n> = Infer<typeof QuoteResponseSchemaV1> & {\n trade: TxDataType;\n approval?: ApprovalType;\n /**\n * Appended to the quote response based on the quote request\n */\n featureId?: FeatureId;\n /**\n * Appended to the quote response based on the quote request resetApproval flag\n * If defined, the quote's total network fee will include the reset approval's gas limit.\n */\n resetApproval?: TxData;\n /**\n * Appended to the quote if there are multiple quote requests in a batch. This\n * indicates which quoteRequest the quote is for\n */\n quoteRequestIndex?: number;\n};\n"]}
|
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
|
2
|
+
import { FeatureId } from "./feature-flags.cjs";
|
|
3
|
+
import type { BitcoinTradeData, StellarTradeData, TronTradeData, TxData } from "./trade.cjs";
|
|
4
|
+
export declare const QuoteResponseSchemaV1: import("@metamask/superstruct").Struct<{
|
|
5
|
+
trade: string | {
|
|
6
|
+
chainId: number;
|
|
7
|
+
to: `0x${string}`;
|
|
8
|
+
from: `0x${string}`;
|
|
9
|
+
value: `0x${string}`;
|
|
10
|
+
data: `0x${string}`;
|
|
11
|
+
gasLimit: number | null;
|
|
12
|
+
effectiveGas?: number | undefined;
|
|
13
|
+
} | {
|
|
14
|
+
unsignedPsbtBase64: string;
|
|
15
|
+
inputsToSign: {}[] | null;
|
|
16
|
+
} | {
|
|
17
|
+
raw_data_hex: string;
|
|
18
|
+
visible?: boolean | undefined;
|
|
19
|
+
raw_data?: {
|
|
20
|
+
contract?: {
|
|
21
|
+
type?: string | undefined;
|
|
22
|
+
}[] | undefined;
|
|
23
|
+
fee_limit?: number | undefined;
|
|
24
|
+
} | null | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
xdrBase64: string;
|
|
27
|
+
} | {
|
|
28
|
+
xdr: string;
|
|
29
|
+
};
|
|
30
|
+
quote: {
|
|
31
|
+
gasIncluded?: boolean | undefined;
|
|
32
|
+
gasIncluded7702?: boolean | undefined;
|
|
33
|
+
gasSponsored?: boolean | undefined;
|
|
34
|
+
} & {
|
|
35
|
+
srcChainId: number;
|
|
36
|
+
destChainId: number;
|
|
37
|
+
srcAsset: {
|
|
38
|
+
symbol: string;
|
|
39
|
+
chainId: number;
|
|
40
|
+
address: string;
|
|
41
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
42
|
+
name: string;
|
|
43
|
+
decimals: number;
|
|
44
|
+
icon?: string | null | undefined;
|
|
45
|
+
iconUrl?: string | null | undefined;
|
|
46
|
+
};
|
|
47
|
+
destAsset: {
|
|
48
|
+
symbol: string;
|
|
49
|
+
chainId: number;
|
|
50
|
+
address: string;
|
|
51
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
52
|
+
name: string;
|
|
53
|
+
decimals: number;
|
|
54
|
+
icon?: string | null | undefined;
|
|
55
|
+
iconUrl?: string | null | undefined;
|
|
56
|
+
};
|
|
57
|
+
requestId: string;
|
|
58
|
+
srcTokenAmount: string;
|
|
59
|
+
destTokenAmount: string;
|
|
60
|
+
minDestTokenAmount: string;
|
|
61
|
+
feeData: {
|
|
62
|
+
metabridge: {
|
|
63
|
+
amount: string;
|
|
64
|
+
asset: {
|
|
65
|
+
symbol: string;
|
|
66
|
+
chainId: number;
|
|
67
|
+
address: string;
|
|
68
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
69
|
+
name: string;
|
|
70
|
+
decimals: number;
|
|
71
|
+
icon?: string | null | undefined;
|
|
72
|
+
iconUrl?: string | null | undefined;
|
|
73
|
+
};
|
|
74
|
+
discountType?: string | null | undefined;
|
|
75
|
+
} & {
|
|
76
|
+
quoteBpsFee?: number | undefined;
|
|
77
|
+
baseBpsFee?: number | undefined;
|
|
78
|
+
};
|
|
79
|
+
txFee?: ({
|
|
80
|
+
amount: string;
|
|
81
|
+
asset: {
|
|
82
|
+
symbol: string;
|
|
83
|
+
chainId: number;
|
|
84
|
+
address: string;
|
|
85
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
86
|
+
name: string;
|
|
87
|
+
decimals: number;
|
|
88
|
+
icon?: string | null | undefined;
|
|
89
|
+
iconUrl?: string | null | undefined;
|
|
90
|
+
};
|
|
91
|
+
discountType?: string | null | undefined;
|
|
92
|
+
} & {
|
|
93
|
+
maxFeePerGas: string;
|
|
94
|
+
maxPriorityFeePerGas: string;
|
|
95
|
+
}) | undefined;
|
|
96
|
+
};
|
|
97
|
+
bridgeId: string;
|
|
98
|
+
bridges: string[];
|
|
99
|
+
steps: {
|
|
100
|
+
action: import("./step.cjs").ActionTypes;
|
|
101
|
+
srcChainId: number;
|
|
102
|
+
destChainId?: number | undefined;
|
|
103
|
+
srcAsset?: {
|
|
104
|
+
symbol: string;
|
|
105
|
+
chainId: number;
|
|
106
|
+
address: string;
|
|
107
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
108
|
+
name: string;
|
|
109
|
+
decimals: number;
|
|
110
|
+
icon?: string | null | undefined;
|
|
111
|
+
iconUrl?: string | null | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
destAsset?: {
|
|
114
|
+
symbol: string;
|
|
115
|
+
chainId: number;
|
|
116
|
+
address: string;
|
|
117
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
118
|
+
name: string;
|
|
119
|
+
decimals: number;
|
|
120
|
+
icon?: string | null | undefined;
|
|
121
|
+
iconUrl?: string | null | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
}[];
|
|
124
|
+
refuel?: {
|
|
125
|
+
action: import("./step.cjs").ActionTypes;
|
|
126
|
+
srcChainId: number;
|
|
127
|
+
destChainId?: number | undefined;
|
|
128
|
+
srcAsset?: {
|
|
129
|
+
symbol: string;
|
|
130
|
+
chainId: number;
|
|
131
|
+
address: string;
|
|
132
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
133
|
+
name: string;
|
|
134
|
+
decimals: number;
|
|
135
|
+
icon?: string | null | undefined;
|
|
136
|
+
iconUrl?: string | null | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
destAsset?: {
|
|
139
|
+
symbol: string;
|
|
140
|
+
chainId: number;
|
|
141
|
+
address: string;
|
|
142
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
143
|
+
name: string;
|
|
144
|
+
decimals: number;
|
|
145
|
+
icon?: string | null | undefined;
|
|
146
|
+
iconUrl?: string | null | undefined;
|
|
147
|
+
} | undefined;
|
|
148
|
+
} | undefined;
|
|
149
|
+
priceData?: {
|
|
150
|
+
totalFromAmountUsd?: string | undefined;
|
|
151
|
+
totalToAmountUsd?: string | undefined;
|
|
152
|
+
priceImpact?: string | undefined;
|
|
153
|
+
totalFeeAmountUsd?: string | undefined;
|
|
154
|
+
} | undefined;
|
|
155
|
+
intent?: {
|
|
156
|
+
protocol: string;
|
|
157
|
+
order: {
|
|
158
|
+
sellToken: `0x${string}`;
|
|
159
|
+
buyToken: `0x${string}`;
|
|
160
|
+
validTo: string | number;
|
|
161
|
+
appData: string;
|
|
162
|
+
appDataHash: `0x${string}`;
|
|
163
|
+
feeAmount: string;
|
|
164
|
+
kind: "sell" | "buy";
|
|
165
|
+
partiallyFillable: boolean;
|
|
166
|
+
from?: `0x${string}` | undefined;
|
|
167
|
+
receiver?: `0x${string}` | undefined;
|
|
168
|
+
sellAmount?: string | undefined;
|
|
169
|
+
buyAmount?: string | undefined;
|
|
170
|
+
};
|
|
171
|
+
typedData: {
|
|
172
|
+
types: Record<string, {
|
|
173
|
+
name: string;
|
|
174
|
+
type: string;
|
|
175
|
+
}[]>;
|
|
176
|
+
primaryType: string;
|
|
177
|
+
domain: Record<string, any>;
|
|
178
|
+
message: Record<string, any>;
|
|
179
|
+
};
|
|
180
|
+
settlementContract?: `0x${string}` | undefined;
|
|
181
|
+
} | undefined;
|
|
182
|
+
walletAddress?: string | undefined;
|
|
183
|
+
destWalletAddress?: string | undefined;
|
|
184
|
+
slippage?: number | undefined;
|
|
185
|
+
protocols?: string[] | undefined;
|
|
186
|
+
};
|
|
187
|
+
estimatedProcessingTimeInSeconds: number;
|
|
188
|
+
approval?: {
|
|
189
|
+
chainId: number;
|
|
190
|
+
to: `0x${string}`;
|
|
191
|
+
from: `0x${string}`;
|
|
192
|
+
value: `0x${string}`;
|
|
193
|
+
data: `0x${string}`;
|
|
194
|
+
gasLimit: number | null;
|
|
195
|
+
effectiveGas?: number | undefined;
|
|
196
|
+
} | {
|
|
197
|
+
raw_data_hex: string;
|
|
198
|
+
visible?: boolean | undefined;
|
|
199
|
+
raw_data?: {
|
|
200
|
+
contract?: {
|
|
201
|
+
type?: string | undefined;
|
|
202
|
+
}[] | undefined;
|
|
203
|
+
fee_limit?: number | undefined;
|
|
204
|
+
} | null | undefined;
|
|
205
|
+
} | undefined;
|
|
206
|
+
featureId?: FeatureId | undefined;
|
|
207
|
+
quoteId?: string | undefined;
|
|
208
|
+
l1GasFeesInHexWei?: `0x${string}` | undefined;
|
|
209
|
+
nonEvmFeesInNative?: string | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
featureId: import("@metamask/superstruct").Struct<FeatureId | undefined, {
|
|
212
|
+
unknown: FeatureId.UNKNOWN;
|
|
213
|
+
perps: FeatureId.PERPS;
|
|
214
|
+
quick_buy_follow_trading: FeatureId.QUICK_BUY_FOLLOW_TRADING;
|
|
215
|
+
quick_buy_token_details: FeatureId.QUICK_BUY_TOKEN_DETAILS;
|
|
216
|
+
quick_buy_explore: FeatureId.QUICK_BUY_EXPLORE;
|
|
217
|
+
dapp_swap: FeatureId.DAPP_SWAP;
|
|
218
|
+
batch_sell: FeatureId.BATCH_SELL;
|
|
219
|
+
unified_swap_bridge: FeatureId.UNIFIED_SWAP_BRIDGE;
|
|
220
|
+
}>;
|
|
221
|
+
quoteId: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
222
|
+
quote: import("@metamask/superstruct").Struct<{
|
|
223
|
+
gasIncluded?: boolean | undefined;
|
|
224
|
+
gasIncluded7702?: boolean | undefined;
|
|
225
|
+
gasSponsored?: boolean | undefined;
|
|
226
|
+
} & {
|
|
227
|
+
srcChainId: number;
|
|
228
|
+
destChainId: number;
|
|
229
|
+
srcAsset: {
|
|
230
|
+
symbol: string;
|
|
231
|
+
chainId: number;
|
|
232
|
+
address: string;
|
|
233
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
234
|
+
name: string;
|
|
235
|
+
decimals: number;
|
|
236
|
+
icon?: string | null | undefined;
|
|
237
|
+
iconUrl?: string | null | undefined;
|
|
238
|
+
};
|
|
239
|
+
destAsset: {
|
|
240
|
+
symbol: string;
|
|
241
|
+
chainId: number;
|
|
242
|
+
address: string;
|
|
243
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
244
|
+
name: string;
|
|
245
|
+
decimals: number;
|
|
246
|
+
icon?: string | null | undefined;
|
|
247
|
+
iconUrl?: string | null | undefined;
|
|
248
|
+
};
|
|
249
|
+
requestId: string;
|
|
250
|
+
srcTokenAmount: string;
|
|
251
|
+
destTokenAmount: string;
|
|
252
|
+
minDestTokenAmount: string;
|
|
253
|
+
feeData: {
|
|
254
|
+
metabridge: {
|
|
255
|
+
amount: string;
|
|
256
|
+
asset: {
|
|
257
|
+
symbol: string;
|
|
258
|
+
chainId: number;
|
|
259
|
+
address: string;
|
|
260
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
261
|
+
name: string;
|
|
262
|
+
decimals: number;
|
|
263
|
+
icon?: string | null | undefined;
|
|
264
|
+
iconUrl?: string | null | undefined;
|
|
265
|
+
};
|
|
266
|
+
discountType?: string | null | undefined;
|
|
267
|
+
} & {
|
|
268
|
+
quoteBpsFee?: number | undefined;
|
|
269
|
+
baseBpsFee?: number | undefined;
|
|
270
|
+
};
|
|
271
|
+
txFee?: ({
|
|
272
|
+
amount: string;
|
|
273
|
+
asset: {
|
|
274
|
+
symbol: string;
|
|
275
|
+
chainId: number;
|
|
276
|
+
address: string;
|
|
277
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
278
|
+
name: string;
|
|
279
|
+
decimals: number;
|
|
280
|
+
icon?: string | null | undefined;
|
|
281
|
+
iconUrl?: string | null | undefined;
|
|
282
|
+
};
|
|
283
|
+
discountType?: string | null | undefined;
|
|
284
|
+
} & {
|
|
285
|
+
maxFeePerGas: string;
|
|
286
|
+
maxPriorityFeePerGas: string;
|
|
287
|
+
}) | undefined;
|
|
288
|
+
};
|
|
289
|
+
bridgeId: string;
|
|
290
|
+
bridges: string[];
|
|
291
|
+
steps: {
|
|
292
|
+
action: import("./step.cjs").ActionTypes;
|
|
293
|
+
srcChainId: number;
|
|
294
|
+
destChainId?: number | undefined;
|
|
295
|
+
srcAsset?: {
|
|
296
|
+
symbol: string;
|
|
297
|
+
chainId: number;
|
|
298
|
+
address: string;
|
|
299
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
300
|
+
name: string;
|
|
301
|
+
decimals: number;
|
|
302
|
+
icon?: string | null | undefined;
|
|
303
|
+
iconUrl?: string | null | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
destAsset?: {
|
|
306
|
+
symbol: string;
|
|
307
|
+
chainId: number;
|
|
308
|
+
address: string;
|
|
309
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
310
|
+
name: string;
|
|
311
|
+
decimals: number;
|
|
312
|
+
icon?: string | null | undefined;
|
|
313
|
+
iconUrl?: string | null | undefined;
|
|
314
|
+
} | undefined;
|
|
315
|
+
}[];
|
|
316
|
+
refuel?: {
|
|
317
|
+
action: import("./step.cjs").ActionTypes;
|
|
318
|
+
srcChainId: number;
|
|
319
|
+
destChainId?: number | undefined;
|
|
320
|
+
srcAsset?: {
|
|
321
|
+
symbol: string;
|
|
322
|
+
chainId: number;
|
|
323
|
+
address: string;
|
|
324
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
325
|
+
name: string;
|
|
326
|
+
decimals: number;
|
|
327
|
+
icon?: string | null | undefined;
|
|
328
|
+
iconUrl?: string | null | undefined;
|
|
329
|
+
} | undefined;
|
|
330
|
+
destAsset?: {
|
|
331
|
+
symbol: string;
|
|
332
|
+
chainId: number;
|
|
333
|
+
address: string;
|
|
334
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
335
|
+
name: string;
|
|
336
|
+
decimals: number;
|
|
337
|
+
icon?: string | null | undefined;
|
|
338
|
+
iconUrl?: string | null | undefined;
|
|
339
|
+
} | undefined;
|
|
340
|
+
} | undefined;
|
|
341
|
+
priceData?: {
|
|
342
|
+
totalFromAmountUsd?: string | undefined;
|
|
343
|
+
totalToAmountUsd?: string | undefined;
|
|
344
|
+
priceImpact?: string | undefined;
|
|
345
|
+
totalFeeAmountUsd?: string | undefined;
|
|
346
|
+
} | undefined;
|
|
347
|
+
intent?: {
|
|
348
|
+
protocol: string;
|
|
349
|
+
order: {
|
|
350
|
+
sellToken: `0x${string}`;
|
|
351
|
+
buyToken: `0x${string}`;
|
|
352
|
+
validTo: string | number;
|
|
353
|
+
appData: string;
|
|
354
|
+
appDataHash: `0x${string}`;
|
|
355
|
+
feeAmount: string;
|
|
356
|
+
kind: "sell" | "buy";
|
|
357
|
+
partiallyFillable: boolean;
|
|
358
|
+
from?: `0x${string}` | undefined;
|
|
359
|
+
receiver?: `0x${string}` | undefined;
|
|
360
|
+
sellAmount?: string | undefined;
|
|
361
|
+
buyAmount?: string | undefined;
|
|
362
|
+
};
|
|
363
|
+
typedData: {
|
|
364
|
+
types: Record<string, {
|
|
365
|
+
name: string;
|
|
366
|
+
type: string;
|
|
367
|
+
}[]>;
|
|
368
|
+
primaryType: string;
|
|
369
|
+
domain: Record<string, any>;
|
|
370
|
+
message: Record<string, any>;
|
|
371
|
+
};
|
|
372
|
+
settlementContract?: `0x${string}` | undefined;
|
|
373
|
+
} | undefined;
|
|
374
|
+
walletAddress?: string | undefined;
|
|
375
|
+
destWalletAddress?: string | undefined;
|
|
376
|
+
slippage?: number | undefined;
|
|
377
|
+
protocols?: string[] | undefined;
|
|
378
|
+
}, null>;
|
|
379
|
+
estimatedProcessingTimeInSeconds: import("@metamask/superstruct").Struct<number, null>;
|
|
380
|
+
approval: import("@metamask/superstruct").Struct<{
|
|
381
|
+
chainId: number;
|
|
382
|
+
to: `0x${string}`;
|
|
383
|
+
from: `0x${string}`;
|
|
384
|
+
value: `0x${string}`;
|
|
385
|
+
data: `0x${string}`;
|
|
386
|
+
gasLimit: number | null;
|
|
387
|
+
effectiveGas?: number | undefined;
|
|
388
|
+
} | {
|
|
389
|
+
raw_data_hex: string;
|
|
390
|
+
visible?: boolean | undefined;
|
|
391
|
+
raw_data?: {
|
|
392
|
+
contract?: {
|
|
393
|
+
type?: string | undefined;
|
|
394
|
+
}[] | undefined;
|
|
395
|
+
fee_limit?: number | undefined;
|
|
396
|
+
} | null | undefined;
|
|
397
|
+
} | undefined, null>;
|
|
398
|
+
trade: import("@metamask/superstruct").Struct<string | {
|
|
399
|
+
chainId: number;
|
|
400
|
+
to: `0x${string}`;
|
|
401
|
+
from: `0x${string}`;
|
|
402
|
+
value: `0x${string}`;
|
|
403
|
+
data: `0x${string}`;
|
|
404
|
+
gasLimit: number | null;
|
|
405
|
+
effectiveGas?: number | undefined;
|
|
406
|
+
} | {
|
|
407
|
+
unsignedPsbtBase64: string;
|
|
408
|
+
inputsToSign: {}[] | null;
|
|
409
|
+
} | {
|
|
410
|
+
raw_data_hex: string;
|
|
411
|
+
visible?: boolean | undefined;
|
|
412
|
+
raw_data?: {
|
|
413
|
+
contract?: {
|
|
414
|
+
type?: string | undefined;
|
|
415
|
+
}[] | undefined;
|
|
416
|
+
fee_limit?: number | undefined;
|
|
417
|
+
} | null | undefined;
|
|
418
|
+
} | {
|
|
419
|
+
xdrBase64: string;
|
|
420
|
+
} | {
|
|
421
|
+
xdr: string;
|
|
422
|
+
}, null>;
|
|
423
|
+
l1GasFeesInHexWei: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
|
|
424
|
+
nonEvmFeesInNative: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
425
|
+
}>;
|
|
426
|
+
export declare const validateQuoteResponseV1: (data: unknown) => data is {
|
|
427
|
+
trade: string | {
|
|
428
|
+
chainId: number;
|
|
429
|
+
to: `0x${string}`;
|
|
430
|
+
from: `0x${string}`;
|
|
431
|
+
value: `0x${string}`;
|
|
432
|
+
data: `0x${string}`;
|
|
433
|
+
gasLimit: number | null;
|
|
434
|
+
effectiveGas?: number | undefined;
|
|
435
|
+
} | {
|
|
436
|
+
unsignedPsbtBase64: string;
|
|
437
|
+
inputsToSign: {}[] | null;
|
|
438
|
+
} | {
|
|
439
|
+
raw_data_hex: string;
|
|
440
|
+
visible?: boolean | undefined;
|
|
441
|
+
raw_data?: {
|
|
442
|
+
contract?: {
|
|
443
|
+
type?: string | undefined;
|
|
444
|
+
}[] | undefined;
|
|
445
|
+
fee_limit?: number | undefined;
|
|
446
|
+
} | null | undefined;
|
|
447
|
+
} | {
|
|
448
|
+
xdrBase64: string;
|
|
449
|
+
} | {
|
|
450
|
+
xdr: string;
|
|
451
|
+
};
|
|
452
|
+
quote: {
|
|
453
|
+
gasIncluded?: boolean | undefined;
|
|
454
|
+
gasIncluded7702?: boolean | undefined;
|
|
455
|
+
gasSponsored?: boolean | undefined;
|
|
456
|
+
} & {
|
|
457
|
+
srcChainId: number;
|
|
458
|
+
destChainId: number;
|
|
459
|
+
srcAsset: {
|
|
460
|
+
symbol: string;
|
|
461
|
+
chainId: number;
|
|
462
|
+
address: string;
|
|
463
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
464
|
+
name: string;
|
|
465
|
+
decimals: number;
|
|
466
|
+
icon?: string | null | undefined;
|
|
467
|
+
iconUrl?: string | null | undefined;
|
|
468
|
+
};
|
|
469
|
+
destAsset: {
|
|
470
|
+
symbol: string;
|
|
471
|
+
chainId: number;
|
|
472
|
+
address: string;
|
|
473
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
474
|
+
name: string;
|
|
475
|
+
decimals: number;
|
|
476
|
+
icon?: string | null | undefined;
|
|
477
|
+
iconUrl?: string | null | undefined;
|
|
478
|
+
};
|
|
479
|
+
requestId: string;
|
|
480
|
+
srcTokenAmount: string;
|
|
481
|
+
destTokenAmount: string;
|
|
482
|
+
minDestTokenAmount: string;
|
|
483
|
+
feeData: {
|
|
484
|
+
metabridge: {
|
|
485
|
+
amount: string;
|
|
486
|
+
asset: {
|
|
487
|
+
symbol: string;
|
|
488
|
+
chainId: number;
|
|
489
|
+
address: string;
|
|
490
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
491
|
+
name: string;
|
|
492
|
+
decimals: number;
|
|
493
|
+
icon?: string | null | undefined;
|
|
494
|
+
iconUrl?: string | null | undefined;
|
|
495
|
+
};
|
|
496
|
+
discountType?: string | null | undefined;
|
|
497
|
+
} & {
|
|
498
|
+
quoteBpsFee?: number | undefined;
|
|
499
|
+
baseBpsFee?: number | undefined;
|
|
500
|
+
};
|
|
501
|
+
txFee?: ({
|
|
502
|
+
amount: string;
|
|
503
|
+
asset: {
|
|
504
|
+
symbol: string;
|
|
505
|
+
chainId: number;
|
|
506
|
+
address: string;
|
|
507
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
508
|
+
name: string;
|
|
509
|
+
decimals: number;
|
|
510
|
+
icon?: string | null | undefined;
|
|
511
|
+
iconUrl?: string | null | undefined;
|
|
512
|
+
};
|
|
513
|
+
discountType?: string | null | undefined;
|
|
514
|
+
} & {
|
|
515
|
+
maxFeePerGas: string;
|
|
516
|
+
maxPriorityFeePerGas: string;
|
|
517
|
+
}) | undefined;
|
|
518
|
+
};
|
|
519
|
+
bridgeId: string;
|
|
520
|
+
bridges: string[];
|
|
521
|
+
steps: {
|
|
522
|
+
action: import("./step.cjs").ActionTypes;
|
|
523
|
+
srcChainId: number;
|
|
524
|
+
destChainId?: number | undefined;
|
|
525
|
+
srcAsset?: {
|
|
526
|
+
symbol: string;
|
|
527
|
+
chainId: number;
|
|
528
|
+
address: string;
|
|
529
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
530
|
+
name: string;
|
|
531
|
+
decimals: number;
|
|
532
|
+
icon?: string | null | undefined;
|
|
533
|
+
iconUrl?: string | null | undefined;
|
|
534
|
+
} | undefined;
|
|
535
|
+
destAsset?: {
|
|
536
|
+
symbol: string;
|
|
537
|
+
chainId: number;
|
|
538
|
+
address: string;
|
|
539
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
540
|
+
name: string;
|
|
541
|
+
decimals: number;
|
|
542
|
+
icon?: string | null | undefined;
|
|
543
|
+
iconUrl?: string | null | undefined;
|
|
544
|
+
} | undefined;
|
|
545
|
+
}[];
|
|
546
|
+
refuel?: {
|
|
547
|
+
action: import("./step.cjs").ActionTypes;
|
|
548
|
+
srcChainId: number;
|
|
549
|
+
destChainId?: number | undefined;
|
|
550
|
+
srcAsset?: {
|
|
551
|
+
symbol: string;
|
|
552
|
+
chainId: number;
|
|
553
|
+
address: string;
|
|
554
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
555
|
+
name: string;
|
|
556
|
+
decimals: number;
|
|
557
|
+
icon?: string | null | undefined;
|
|
558
|
+
iconUrl?: string | null | undefined;
|
|
559
|
+
} | undefined;
|
|
560
|
+
destAsset?: {
|
|
561
|
+
symbol: string;
|
|
562
|
+
chainId: number;
|
|
563
|
+
address: string;
|
|
564
|
+
assetId: `${string}:${string}/${string}:${string}`;
|
|
565
|
+
name: string;
|
|
566
|
+
decimals: number;
|
|
567
|
+
icon?: string | null | undefined;
|
|
568
|
+
iconUrl?: string | null | undefined;
|
|
569
|
+
} | undefined;
|
|
570
|
+
} | undefined;
|
|
571
|
+
priceData?: {
|
|
572
|
+
totalFromAmountUsd?: string | undefined;
|
|
573
|
+
totalToAmountUsd?: string | undefined;
|
|
574
|
+
priceImpact?: string | undefined;
|
|
575
|
+
totalFeeAmountUsd?: string | undefined;
|
|
576
|
+
} | undefined;
|
|
577
|
+
intent?: {
|
|
578
|
+
protocol: string;
|
|
579
|
+
order: {
|
|
580
|
+
sellToken: `0x${string}`;
|
|
581
|
+
buyToken: `0x${string}`;
|
|
582
|
+
validTo: string | number;
|
|
583
|
+
appData: string;
|
|
584
|
+
appDataHash: `0x${string}`;
|
|
585
|
+
feeAmount: string;
|
|
586
|
+
kind: "sell" | "buy";
|
|
587
|
+
partiallyFillable: boolean;
|
|
588
|
+
from?: `0x${string}` | undefined;
|
|
589
|
+
receiver?: `0x${string}` | undefined;
|
|
590
|
+
sellAmount?: string | undefined;
|
|
591
|
+
buyAmount?: string | undefined;
|
|
592
|
+
};
|
|
593
|
+
typedData: {
|
|
594
|
+
types: Record<string, {
|
|
595
|
+
name: string;
|
|
596
|
+
type: string;
|
|
597
|
+
}[]>;
|
|
598
|
+
primaryType: string;
|
|
599
|
+
domain: Record<string, any>;
|
|
600
|
+
message: Record<string, any>;
|
|
601
|
+
};
|
|
602
|
+
settlementContract?: `0x${string}` | undefined;
|
|
603
|
+
} | undefined;
|
|
604
|
+
walletAddress?: string | undefined;
|
|
605
|
+
destWalletAddress?: string | undefined;
|
|
606
|
+
slippage?: number | undefined;
|
|
607
|
+
protocols?: string[] | undefined;
|
|
608
|
+
};
|
|
609
|
+
estimatedProcessingTimeInSeconds: number;
|
|
610
|
+
approval?: {
|
|
611
|
+
chainId: number;
|
|
612
|
+
to: `0x${string}`;
|
|
613
|
+
from: `0x${string}`;
|
|
614
|
+
value: `0x${string}`;
|
|
615
|
+
data: `0x${string}`;
|
|
616
|
+
gasLimit: number | null;
|
|
617
|
+
effectiveGas?: number | undefined;
|
|
618
|
+
} | {
|
|
619
|
+
raw_data_hex: string;
|
|
620
|
+
visible?: boolean | undefined;
|
|
621
|
+
raw_data?: {
|
|
622
|
+
contract?: {
|
|
623
|
+
type?: string | undefined;
|
|
624
|
+
}[] | undefined;
|
|
625
|
+
fee_limit?: number | undefined;
|
|
626
|
+
} | null | undefined;
|
|
627
|
+
} | undefined;
|
|
628
|
+
featureId?: FeatureId | undefined;
|
|
629
|
+
quoteId?: string | undefined;
|
|
630
|
+
l1GasFeesInHexWei?: `0x${string}` | undefined;
|
|
631
|
+
nonEvmFeesInNative?: string | undefined;
|
|
632
|
+
};
|
|
633
|
+
/**
|
|
634
|
+
* This is the type for the quote response from the bridge-api
|
|
635
|
+
* TxDataType can be overriden to be a string when the quote is non-evm
|
|
636
|
+
* ApprovalType can be overriden when you know the specific approval type (e.g., TxData for EVM-only contexts)
|
|
637
|
+
*
|
|
638
|
+
* @deprecated Use `QuoteResponseV2` instead
|
|
639
|
+
*/
|
|
640
|
+
export type QuoteResponseV1<TxDataType = TxData | string | BitcoinTradeData | TronTradeData | StellarTradeData, ApprovalType = TxData | TronTradeData> = Infer<typeof QuoteResponseSchemaV1> & {
|
|
641
|
+
trade: TxDataType;
|
|
642
|
+
approval?: ApprovalType;
|
|
643
|
+
/**
|
|
644
|
+
* Appended to the quote response based on the quote request
|
|
645
|
+
*/
|
|
646
|
+
featureId?: FeatureId;
|
|
647
|
+
/**
|
|
648
|
+
* Appended to the quote response based on the quote request resetApproval flag
|
|
649
|
+
* If defined, the quote's total network fee will include the reset approval's gas limit.
|
|
650
|
+
*/
|
|
651
|
+
resetApproval?: TxData;
|
|
652
|
+
/**
|
|
653
|
+
* Appended to the quote if there are multiple quote requests in a batch. This
|
|
654
|
+
* indicates which quoteRequest the quote is for
|
|
655
|
+
*/
|
|
656
|
+
quoteRequestIndex?: number;
|
|
657
|
+
};
|
|
658
|
+
//# sourceMappingURL=quote-response-v1.d.cts.map
|
|
@@ -0,0 +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,4BAAwB;AAS5C,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,MAAM,EACP,oBAAgB;AAEjB,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"}
|