@chainflip/sdk 1.1.1 → 1.1.2
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/dist/{broker-BDXRD56F.mjs → broker-IPTE3R72.mjs} +13 -13
- package/dist/{chunk-UTZ4VKAX.mjs → chunk-4PQXI2DE.mjs} +1 -1
- package/dist/{chunk-EQSMT5US.mjs → chunk-Q7HQVR3T.mjs} +25 -1
- package/dist/chunk-Z4OL2TKA.mjs +603 -0
- package/dist/{contracts-rsXvYw7v.d.mts → contracts-ss509umD.d.mts} +1 -1
- package/dist/{contracts-rsXvYw7v.d.ts → contracts-ss509umD.d.ts} +1 -1
- package/dist/funding.d.mts +1 -1
- package/dist/funding.d.ts +1 -1
- package/dist/funding.mjs +2 -2
- package/dist/swap.d.mts +36 -36
- package/dist/swap.d.ts +36 -36
- package/dist/swap.js +471 -214
- package/dist/swap.mjs +23 -22
- package/package.json +1 -1
- package/dist/chunk-KUNN7I5S.mjs +0 -371
package/dist/swap.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { C as Chain, A as Asset, c as chainAssets,
|
|
3
|
-
export { d as Assets, e as ChainflipNetworks, b as Chains, f as assetChains, h as assetContractIds, g as assetDecimals, i as chainContractIds } from './contracts-
|
|
2
|
+
import { C as ChainflipNetwork, a as Chain, A as Asset, c as chainAssets, T as TransactionOptions } from './contracts-ss509umD.mjs';
|
|
3
|
+
export { d as Assets, e as ChainflipNetworks, b as Chains, f as assetChains, h as assetContractIds, g as assetDecimals, i as chainContractIds } from './contracts-ss509umD.mjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
type ChainAssetMap<T> = {
|
|
@@ -17,11 +17,11 @@ type ChainAssetMap<T> = {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
20
|
+
declare const tokenSwapParamsSchema: (network: ChainflipNetwork) => z.ZodUnion<[z.ZodObject<{
|
|
21
21
|
amount: z.ZodString;
|
|
22
22
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
23
23
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
24
|
-
destAddress: z.ZodEffects<z.
|
|
24
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
25
25
|
srcAsset: z.ZodLiteral<"FLIP">;
|
|
26
26
|
destAsset: z.ZodUnion<[z.ZodLiteral<"USDC">, z.ZodLiteral<"ETH">]>;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -37,12 +37,12 @@ declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
37
37
|
srcAsset: "FLIP";
|
|
38
38
|
destAsset: "USDC" | "ETH";
|
|
39
39
|
destChain: "Ethereum";
|
|
40
|
-
destAddress:
|
|
40
|
+
destAddress: string;
|
|
41
41
|
}>, z.ZodObject<{
|
|
42
42
|
amount: z.ZodString;
|
|
43
43
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
44
44
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
45
|
-
destAddress: z.ZodEffects<z.
|
|
45
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
46
46
|
srcAsset: z.ZodLiteral<"USDC">;
|
|
47
47
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"ETH">]>;
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -58,13 +58,13 @@ declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
58
58
|
srcAsset: "USDC";
|
|
59
59
|
destAsset: "FLIP" | "ETH";
|
|
60
60
|
destChain: "Ethereum";
|
|
61
|
-
destAddress:
|
|
61
|
+
destAddress: string;
|
|
62
62
|
}>, z.ZodObject<{
|
|
63
63
|
amount: z.ZodString;
|
|
64
64
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
65
65
|
destAsset: z.ZodLiteral<"DOT">;
|
|
66
66
|
destChain: z.ZodLiteral<"Polkadot">;
|
|
67
|
-
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.
|
|
67
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, string | null, string>, string, string>, string, string>;
|
|
68
68
|
srcAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"USDC">]>;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
70
|
amount: string;
|
|
@@ -102,21 +102,21 @@ declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
102
102
|
destChain: "Bitcoin";
|
|
103
103
|
destAddress: string;
|
|
104
104
|
}>]>;
|
|
105
|
-
declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
105
|
+
declare const executeSwapParamsSchema: (network: ChainflipNetwork) => z.ZodUnion<[z.ZodObject<{
|
|
106
106
|
amount: z.ZodString;
|
|
107
107
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
108
108
|
srcAsset: z.ZodLiteral<"ETH">;
|
|
109
109
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"USDC">]>;
|
|
110
110
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
111
|
-
destAddress: z.ZodEffects<z.
|
|
111
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
112
112
|
ccmMetadata: z.ZodObject<{
|
|
113
113
|
gasBudget: z.ZodString;
|
|
114
|
-
message: z.ZodEffects<z.
|
|
114
|
+
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
115
115
|
}, "strip", z.ZodTypeAny, {
|
|
116
116
|
message: `0x${string}`;
|
|
117
117
|
gasBudget: string;
|
|
118
118
|
}, {
|
|
119
|
-
message:
|
|
119
|
+
message: string;
|
|
120
120
|
gasBudget: string;
|
|
121
121
|
}>;
|
|
122
122
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -136,9 +136,9 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
136
136
|
srcAsset: "ETH";
|
|
137
137
|
destAsset: "FLIP" | "USDC";
|
|
138
138
|
destChain: "Ethereum";
|
|
139
|
-
destAddress:
|
|
139
|
+
destAddress: string;
|
|
140
140
|
ccmMetadata: {
|
|
141
|
-
message:
|
|
141
|
+
message: string;
|
|
142
142
|
gasBudget: string;
|
|
143
143
|
};
|
|
144
144
|
}>, z.ZodUnion<[z.ZodObject<{
|
|
@@ -147,15 +147,15 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
147
147
|
srcAsset: z.ZodLiteral<"FLIP">;
|
|
148
148
|
destAsset: z.ZodUnion<[z.ZodLiteral<"USDC">, z.ZodLiteral<"ETH">]>;
|
|
149
149
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
150
|
-
destAddress: z.ZodEffects<z.
|
|
150
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
151
151
|
ccmMetadata: z.ZodObject<{
|
|
152
152
|
gasBudget: z.ZodString;
|
|
153
|
-
message: z.ZodEffects<z.
|
|
153
|
+
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
154
154
|
}, "strip", z.ZodTypeAny, {
|
|
155
155
|
message: `0x${string}`;
|
|
156
156
|
gasBudget: string;
|
|
157
157
|
}, {
|
|
158
|
-
message:
|
|
158
|
+
message: string;
|
|
159
159
|
gasBudget: string;
|
|
160
160
|
}>;
|
|
161
161
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -175,9 +175,9 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
175
175
|
srcAsset: "FLIP";
|
|
176
176
|
destAsset: "USDC" | "ETH";
|
|
177
177
|
destChain: "Ethereum";
|
|
178
|
-
destAddress:
|
|
178
|
+
destAddress: string;
|
|
179
179
|
ccmMetadata: {
|
|
180
|
-
message:
|
|
180
|
+
message: string;
|
|
181
181
|
gasBudget: string;
|
|
182
182
|
};
|
|
183
183
|
}>, z.ZodObject<{
|
|
@@ -186,15 +186,15 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
186
186
|
srcAsset: z.ZodLiteral<"USDC">;
|
|
187
187
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"ETH">]>;
|
|
188
188
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
189
|
-
destAddress: z.ZodEffects<z.
|
|
189
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
190
190
|
ccmMetadata: z.ZodObject<{
|
|
191
191
|
gasBudget: z.ZodString;
|
|
192
|
-
message: z.ZodEffects<z.
|
|
192
|
+
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
193
193
|
}, "strip", z.ZodTypeAny, {
|
|
194
194
|
message: `0x${string}`;
|
|
195
195
|
gasBudget: string;
|
|
196
196
|
}, {
|
|
197
|
-
message:
|
|
197
|
+
message: string;
|
|
198
198
|
gasBudget: string;
|
|
199
199
|
}>;
|
|
200
200
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -214,9 +214,9 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
214
214
|
srcAsset: "USDC";
|
|
215
215
|
destAsset: "FLIP" | "ETH";
|
|
216
216
|
destChain: "Ethereum";
|
|
217
|
-
destAddress:
|
|
217
|
+
destAddress: string;
|
|
218
218
|
ccmMetadata: {
|
|
219
|
-
message:
|
|
219
|
+
message: string;
|
|
220
220
|
gasBudget: string;
|
|
221
221
|
};
|
|
222
222
|
}>]>, z.ZodUnion<[z.ZodObject<{
|
|
@@ -224,7 +224,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
224
224
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
225
225
|
srcAsset: z.ZodLiteral<"ETH">;
|
|
226
226
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
227
|
-
destAddress: z.ZodEffects<z.
|
|
227
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
228
228
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"USDC">]>;
|
|
229
229
|
}, "strip", z.ZodTypeAny, {
|
|
230
230
|
amount: string;
|
|
@@ -239,13 +239,13 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
239
239
|
srcAsset: "ETH";
|
|
240
240
|
destAsset: "FLIP" | "USDC";
|
|
241
241
|
destChain: "Ethereum";
|
|
242
|
-
destAddress:
|
|
242
|
+
destAddress: string;
|
|
243
243
|
}>, z.ZodObject<{
|
|
244
244
|
amount: z.ZodString;
|
|
245
245
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
246
246
|
srcAsset: z.ZodLiteral<"ETH">;
|
|
247
247
|
destChain: z.ZodLiteral<"Polkadot">;
|
|
248
|
-
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.
|
|
248
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, string | null, string>, string, string>, string, string>;
|
|
249
249
|
destAsset: z.ZodLiteral<"DOT">;
|
|
250
250
|
}, "strip", z.ZodTypeAny, {
|
|
251
251
|
amount: string;
|
|
@@ -286,7 +286,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
286
286
|
amount: z.ZodString;
|
|
287
287
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
288
288
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
289
|
-
destAddress: z.ZodEffects<z.
|
|
289
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
290
290
|
srcAsset: z.ZodLiteral<"FLIP">;
|
|
291
291
|
destAsset: z.ZodUnion<[z.ZodLiteral<"USDC">, z.ZodLiteral<"ETH">]>;
|
|
292
292
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -302,12 +302,12 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
302
302
|
srcAsset: "FLIP";
|
|
303
303
|
destAsset: "USDC" | "ETH";
|
|
304
304
|
destChain: "Ethereum";
|
|
305
|
-
destAddress:
|
|
305
|
+
destAddress: string;
|
|
306
306
|
}>, z.ZodObject<{
|
|
307
307
|
amount: z.ZodString;
|
|
308
308
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
309
309
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
310
|
-
destAddress: z.ZodEffects<z.
|
|
310
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
311
311
|
srcAsset: z.ZodLiteral<"USDC">;
|
|
312
312
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"ETH">]>;
|
|
313
313
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -323,13 +323,13 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
323
323
|
srcAsset: "USDC";
|
|
324
324
|
destAsset: "FLIP" | "ETH";
|
|
325
325
|
destChain: "Ethereum";
|
|
326
|
-
destAddress:
|
|
326
|
+
destAddress: string;
|
|
327
327
|
}>, z.ZodObject<{
|
|
328
328
|
amount: z.ZodString;
|
|
329
329
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
330
330
|
destAsset: z.ZodLiteral<"DOT">;
|
|
331
331
|
destChain: z.ZodLiteral<"Polkadot">;
|
|
332
|
-
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.
|
|
332
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, string | null, string>, string, string>, string, string>;
|
|
333
333
|
srcAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"USDC">]>;
|
|
334
334
|
}, "strip", z.ZodTypeAny, {
|
|
335
335
|
amount: string;
|
|
@@ -367,17 +367,17 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
367
367
|
destChain: "Bitcoin";
|
|
368
368
|
destAddress: string;
|
|
369
369
|
}>]>]>;
|
|
370
|
-
type ExecuteSwapParams = z.infer<typeof executeSwapParamsSchema
|
|
371
|
-
type TokenSwapParams = z.infer<typeof tokenSwapParamsSchema
|
|
370
|
+
type ExecuteSwapParams = z.infer<ReturnType<typeof executeSwapParamsSchema>>;
|
|
371
|
+
type TokenSwapParams = z.infer<ReturnType<typeof tokenSwapParamsSchema>>;
|
|
372
372
|
|
|
373
373
|
declare const ccmMetadataSchema: z.ZodObject<{
|
|
374
374
|
gasBudget: z.ZodString;
|
|
375
|
-
message: z.ZodEffects<z.
|
|
375
|
+
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
376
376
|
}, "strip", z.ZodTypeAny, {
|
|
377
377
|
message: `0x${string}`;
|
|
378
378
|
gasBudget: string;
|
|
379
379
|
}, {
|
|
380
|
-
message:
|
|
380
|
+
message: string;
|
|
381
381
|
gasBudget: string;
|
|
382
382
|
}>;
|
|
383
383
|
type CcmMetadata = z.infer<typeof ccmMetadataSchema>;
|
package/dist/swap.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { C as Chain, A as Asset, c as chainAssets,
|
|
3
|
-
export { d as Assets, e as ChainflipNetworks, b as Chains, f as assetChains, h as assetContractIds, g as assetDecimals, i as chainContractIds } from './contracts-
|
|
2
|
+
import { C as ChainflipNetwork, a as Chain, A as Asset, c as chainAssets, T as TransactionOptions } from './contracts-ss509umD.js';
|
|
3
|
+
export { d as Assets, e as ChainflipNetworks, b as Chains, f as assetChains, h as assetContractIds, g as assetDecimals, i as chainContractIds } from './contracts-ss509umD.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
type ChainAssetMap<T> = {
|
|
@@ -17,11 +17,11 @@ type ChainAssetMap<T> = {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
20
|
+
declare const tokenSwapParamsSchema: (network: ChainflipNetwork) => z.ZodUnion<[z.ZodObject<{
|
|
21
21
|
amount: z.ZodString;
|
|
22
22
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
23
23
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
24
|
-
destAddress: z.ZodEffects<z.
|
|
24
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
25
25
|
srcAsset: z.ZodLiteral<"FLIP">;
|
|
26
26
|
destAsset: z.ZodUnion<[z.ZodLiteral<"USDC">, z.ZodLiteral<"ETH">]>;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -37,12 +37,12 @@ declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
37
37
|
srcAsset: "FLIP";
|
|
38
38
|
destAsset: "USDC" | "ETH";
|
|
39
39
|
destChain: "Ethereum";
|
|
40
|
-
destAddress:
|
|
40
|
+
destAddress: string;
|
|
41
41
|
}>, z.ZodObject<{
|
|
42
42
|
amount: z.ZodString;
|
|
43
43
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
44
44
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
45
|
-
destAddress: z.ZodEffects<z.
|
|
45
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
46
46
|
srcAsset: z.ZodLiteral<"USDC">;
|
|
47
47
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"ETH">]>;
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -58,13 +58,13 @@ declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
58
58
|
srcAsset: "USDC";
|
|
59
59
|
destAsset: "FLIP" | "ETH";
|
|
60
60
|
destChain: "Ethereum";
|
|
61
|
-
destAddress:
|
|
61
|
+
destAddress: string;
|
|
62
62
|
}>, z.ZodObject<{
|
|
63
63
|
amount: z.ZodString;
|
|
64
64
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
65
65
|
destAsset: z.ZodLiteral<"DOT">;
|
|
66
66
|
destChain: z.ZodLiteral<"Polkadot">;
|
|
67
|
-
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.
|
|
67
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, string | null, string>, string, string>, string, string>;
|
|
68
68
|
srcAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"USDC">]>;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
70
|
amount: string;
|
|
@@ -102,21 +102,21 @@ declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
102
102
|
destChain: "Bitcoin";
|
|
103
103
|
destAddress: string;
|
|
104
104
|
}>]>;
|
|
105
|
-
declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
105
|
+
declare const executeSwapParamsSchema: (network: ChainflipNetwork) => z.ZodUnion<[z.ZodObject<{
|
|
106
106
|
amount: z.ZodString;
|
|
107
107
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
108
108
|
srcAsset: z.ZodLiteral<"ETH">;
|
|
109
109
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"USDC">]>;
|
|
110
110
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
111
|
-
destAddress: z.ZodEffects<z.
|
|
111
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
112
112
|
ccmMetadata: z.ZodObject<{
|
|
113
113
|
gasBudget: z.ZodString;
|
|
114
|
-
message: z.ZodEffects<z.
|
|
114
|
+
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
115
115
|
}, "strip", z.ZodTypeAny, {
|
|
116
116
|
message: `0x${string}`;
|
|
117
117
|
gasBudget: string;
|
|
118
118
|
}, {
|
|
119
|
-
message:
|
|
119
|
+
message: string;
|
|
120
120
|
gasBudget: string;
|
|
121
121
|
}>;
|
|
122
122
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -136,9 +136,9 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
136
136
|
srcAsset: "ETH";
|
|
137
137
|
destAsset: "FLIP" | "USDC";
|
|
138
138
|
destChain: "Ethereum";
|
|
139
|
-
destAddress:
|
|
139
|
+
destAddress: string;
|
|
140
140
|
ccmMetadata: {
|
|
141
|
-
message:
|
|
141
|
+
message: string;
|
|
142
142
|
gasBudget: string;
|
|
143
143
|
};
|
|
144
144
|
}>, z.ZodUnion<[z.ZodObject<{
|
|
@@ -147,15 +147,15 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
147
147
|
srcAsset: z.ZodLiteral<"FLIP">;
|
|
148
148
|
destAsset: z.ZodUnion<[z.ZodLiteral<"USDC">, z.ZodLiteral<"ETH">]>;
|
|
149
149
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
150
|
-
destAddress: z.ZodEffects<z.
|
|
150
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
151
151
|
ccmMetadata: z.ZodObject<{
|
|
152
152
|
gasBudget: z.ZodString;
|
|
153
|
-
message: z.ZodEffects<z.
|
|
153
|
+
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
154
154
|
}, "strip", z.ZodTypeAny, {
|
|
155
155
|
message: `0x${string}`;
|
|
156
156
|
gasBudget: string;
|
|
157
157
|
}, {
|
|
158
|
-
message:
|
|
158
|
+
message: string;
|
|
159
159
|
gasBudget: string;
|
|
160
160
|
}>;
|
|
161
161
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -175,9 +175,9 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
175
175
|
srcAsset: "FLIP";
|
|
176
176
|
destAsset: "USDC" | "ETH";
|
|
177
177
|
destChain: "Ethereum";
|
|
178
|
-
destAddress:
|
|
178
|
+
destAddress: string;
|
|
179
179
|
ccmMetadata: {
|
|
180
|
-
message:
|
|
180
|
+
message: string;
|
|
181
181
|
gasBudget: string;
|
|
182
182
|
};
|
|
183
183
|
}>, z.ZodObject<{
|
|
@@ -186,15 +186,15 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
186
186
|
srcAsset: z.ZodLiteral<"USDC">;
|
|
187
187
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"ETH">]>;
|
|
188
188
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
189
|
-
destAddress: z.ZodEffects<z.
|
|
189
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
190
190
|
ccmMetadata: z.ZodObject<{
|
|
191
191
|
gasBudget: z.ZodString;
|
|
192
|
-
message: z.ZodEffects<z.
|
|
192
|
+
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
193
193
|
}, "strip", z.ZodTypeAny, {
|
|
194
194
|
message: `0x${string}`;
|
|
195
195
|
gasBudget: string;
|
|
196
196
|
}, {
|
|
197
|
-
message:
|
|
197
|
+
message: string;
|
|
198
198
|
gasBudget: string;
|
|
199
199
|
}>;
|
|
200
200
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -214,9 +214,9 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
214
214
|
srcAsset: "USDC";
|
|
215
215
|
destAsset: "FLIP" | "ETH";
|
|
216
216
|
destChain: "Ethereum";
|
|
217
|
-
destAddress:
|
|
217
|
+
destAddress: string;
|
|
218
218
|
ccmMetadata: {
|
|
219
|
-
message:
|
|
219
|
+
message: string;
|
|
220
220
|
gasBudget: string;
|
|
221
221
|
};
|
|
222
222
|
}>]>, z.ZodUnion<[z.ZodObject<{
|
|
@@ -224,7 +224,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
224
224
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
225
225
|
srcAsset: z.ZodLiteral<"ETH">;
|
|
226
226
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
227
|
-
destAddress: z.ZodEffects<z.
|
|
227
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
228
228
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"USDC">]>;
|
|
229
229
|
}, "strip", z.ZodTypeAny, {
|
|
230
230
|
amount: string;
|
|
@@ -239,13 +239,13 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
239
239
|
srcAsset: "ETH";
|
|
240
240
|
destAsset: "FLIP" | "USDC";
|
|
241
241
|
destChain: "Ethereum";
|
|
242
|
-
destAddress:
|
|
242
|
+
destAddress: string;
|
|
243
243
|
}>, z.ZodObject<{
|
|
244
244
|
amount: z.ZodString;
|
|
245
245
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
246
246
|
srcAsset: z.ZodLiteral<"ETH">;
|
|
247
247
|
destChain: z.ZodLiteral<"Polkadot">;
|
|
248
|
-
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.
|
|
248
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, string | null, string>, string, string>, string, string>;
|
|
249
249
|
destAsset: z.ZodLiteral<"DOT">;
|
|
250
250
|
}, "strip", z.ZodTypeAny, {
|
|
251
251
|
amount: string;
|
|
@@ -286,7 +286,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
286
286
|
amount: z.ZodString;
|
|
287
287
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
288
288
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
289
|
-
destAddress: z.ZodEffects<z.
|
|
289
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
290
290
|
srcAsset: z.ZodLiteral<"FLIP">;
|
|
291
291
|
destAsset: z.ZodUnion<[z.ZodLiteral<"USDC">, z.ZodLiteral<"ETH">]>;
|
|
292
292
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -302,12 +302,12 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
302
302
|
srcAsset: "FLIP";
|
|
303
303
|
destAsset: "USDC" | "ETH";
|
|
304
304
|
destChain: "Ethereum";
|
|
305
|
-
destAddress:
|
|
305
|
+
destAddress: string;
|
|
306
306
|
}>, z.ZodObject<{
|
|
307
307
|
amount: z.ZodString;
|
|
308
308
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
309
309
|
destChain: z.ZodLiteral<"Ethereum">;
|
|
310
|
-
destAddress: z.ZodEffects<z.
|
|
310
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
311
311
|
srcAsset: z.ZodLiteral<"USDC">;
|
|
312
312
|
destAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"ETH">]>;
|
|
313
313
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -323,13 +323,13 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
323
323
|
srcAsset: "USDC";
|
|
324
324
|
destAsset: "FLIP" | "ETH";
|
|
325
325
|
destChain: "Ethereum";
|
|
326
|
-
destAddress:
|
|
326
|
+
destAddress: string;
|
|
327
327
|
}>, z.ZodObject<{
|
|
328
328
|
amount: z.ZodString;
|
|
329
329
|
srcChain: z.ZodLiteral<"Ethereum">;
|
|
330
330
|
destAsset: z.ZodLiteral<"DOT">;
|
|
331
331
|
destChain: z.ZodLiteral<"Polkadot">;
|
|
332
|
-
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.
|
|
332
|
+
destAddress: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, string | null, string>, string, string>, string, string>;
|
|
333
333
|
srcAsset: z.ZodUnion<[z.ZodLiteral<"FLIP">, z.ZodLiteral<"USDC">]>;
|
|
334
334
|
}, "strip", z.ZodTypeAny, {
|
|
335
335
|
amount: string;
|
|
@@ -367,17 +367,17 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
367
367
|
destChain: "Bitcoin";
|
|
368
368
|
destAddress: string;
|
|
369
369
|
}>]>]>;
|
|
370
|
-
type ExecuteSwapParams = z.infer<typeof executeSwapParamsSchema
|
|
371
|
-
type TokenSwapParams = z.infer<typeof tokenSwapParamsSchema
|
|
370
|
+
type ExecuteSwapParams = z.infer<ReturnType<typeof executeSwapParamsSchema>>;
|
|
371
|
+
type TokenSwapParams = z.infer<ReturnType<typeof tokenSwapParamsSchema>>;
|
|
372
372
|
|
|
373
373
|
declare const ccmMetadataSchema: z.ZodObject<{
|
|
374
374
|
gasBudget: z.ZodString;
|
|
375
|
-
message: z.ZodEffects<z.
|
|
375
|
+
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
376
376
|
}, "strip", z.ZodTypeAny, {
|
|
377
377
|
message: `0x${string}`;
|
|
378
378
|
gasBudget: string;
|
|
379
379
|
}, {
|
|
380
|
-
message:
|
|
380
|
+
message: string;
|
|
381
381
|
gasBudget: string;
|
|
382
382
|
}>;
|
|
383
383
|
type CcmMetadata = z.infer<typeof ccmMetadataSchema>;
|