@chainflip/sdk 1.11.2 → 2.0.0-beta.0
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/swap.cjs +304 -377
- package/dist/swap.d.cts +164 -69
- package/dist/swap.d.ts +164 -69
- package/dist/swap.js +217 -291
- package/package.json +2 -2
package/dist/swap.d.cts
CHANGED
|
@@ -1,24 +1,161 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _chainflip_utils_chainflip from '@chainflip/utils/chainflip';
|
|
2
|
+
import { ChainflipNetwork, AssetAndChain, UncheckedAssetAndChain, ChainflipChain, ChainflipAsset, AssetOfChain, AssetSymbol, ChainAssetMap, ChainMap } from '@chainflip/utils/chainflip';
|
|
2
3
|
export { AssetSymbol as Asset, ChainflipNetwork, UncheckedAssetAndChain, getInternalAsset as getChainflipId } from '@chainflip/utils/chainflip';
|
|
3
4
|
import { HexString } from '@chainflip/utils/types';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
|
|
7
|
+
type AccountCreationDepositChannelParams = z.input<ReturnType<typeof getAccountCreationDepositChannelSchema>>;
|
|
8
|
+
declare const getAccountCreationDepositChannelSchema: (network: ChainflipNetwork) => z.ZodEffects<z.ZodObject<{
|
|
9
|
+
signatureData: z.ZodObject<{
|
|
10
|
+
Ethereum: z.ZodEffects<z.ZodObject<{
|
|
11
|
+
signature: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
12
|
+
signer: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
13
|
+
sigType: z.ZodLiteral<"Eip712">;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
signer: `0x${string}`;
|
|
16
|
+
signature: `0x${string}`;
|
|
17
|
+
sigType: "Eip712";
|
|
18
|
+
}, {
|
|
19
|
+
signer: string;
|
|
20
|
+
signature: string;
|
|
21
|
+
sigType: "Eip712";
|
|
22
|
+
}>, {
|
|
23
|
+
signer: `0x${string}`;
|
|
24
|
+
signature: `0x${string}`;
|
|
25
|
+
sig_type: "Eip712";
|
|
26
|
+
}, {
|
|
27
|
+
signer: string;
|
|
28
|
+
signature: string;
|
|
29
|
+
sigType: "Eip712";
|
|
30
|
+
}>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
Ethereum: {
|
|
33
|
+
signer: `0x${string}`;
|
|
34
|
+
signature: `0x${string}`;
|
|
35
|
+
sig_type: "Eip712";
|
|
36
|
+
};
|
|
37
|
+
}, {
|
|
38
|
+
Ethereum: {
|
|
39
|
+
signer: string;
|
|
40
|
+
signature: string;
|
|
41
|
+
sigType: "Eip712";
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
transactionMetadata: z.ZodEffects<z.ZodObject<{
|
|
45
|
+
nonce: z.ZodNumber;
|
|
46
|
+
expiryBlock: z.ZodNumber;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
expiryBlock: number;
|
|
49
|
+
nonce: number;
|
|
50
|
+
}, {
|
|
51
|
+
expiryBlock: number;
|
|
52
|
+
nonce: number;
|
|
53
|
+
}>, {
|
|
54
|
+
nonce: number;
|
|
55
|
+
expiry_block: number;
|
|
56
|
+
}, {
|
|
57
|
+
expiryBlock: number;
|
|
58
|
+
nonce: number;
|
|
59
|
+
}>;
|
|
60
|
+
asset: z.ZodEffects<z.ZodObject<{
|
|
61
|
+
asset: z.ZodString;
|
|
62
|
+
chain: z.ZodString;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
asset: string;
|
|
65
|
+
chain: string;
|
|
66
|
+
}, {
|
|
67
|
+
asset: string;
|
|
68
|
+
chain: string;
|
|
69
|
+
}>, _chainflip_utils_chainflip.AssetAndChain, {
|
|
70
|
+
asset: string;
|
|
71
|
+
chain: string;
|
|
72
|
+
}>;
|
|
73
|
+
refundAddress: z.ZodString;
|
|
74
|
+
boostFeeBps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
asset: _chainflip_utils_chainflip.AssetAndChain;
|
|
77
|
+
refundAddress: string;
|
|
78
|
+
signatureData: {
|
|
79
|
+
Ethereum: {
|
|
80
|
+
signer: `0x${string}`;
|
|
81
|
+
signature: `0x${string}`;
|
|
82
|
+
sig_type: "Eip712";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
transactionMetadata: {
|
|
86
|
+
nonce: number;
|
|
87
|
+
expiry_block: number;
|
|
88
|
+
};
|
|
89
|
+
boostFeeBps: number;
|
|
90
|
+
}, {
|
|
91
|
+
asset: {
|
|
92
|
+
asset: string;
|
|
93
|
+
chain: string;
|
|
94
|
+
};
|
|
95
|
+
refundAddress: string;
|
|
96
|
+
signatureData: {
|
|
97
|
+
Ethereum: {
|
|
98
|
+
signer: string;
|
|
99
|
+
signature: string;
|
|
100
|
+
sigType: "Eip712";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
transactionMetadata: {
|
|
104
|
+
expiryBlock: number;
|
|
105
|
+
nonce: number;
|
|
106
|
+
};
|
|
107
|
+
boostFeeBps?: number | undefined;
|
|
108
|
+
}>, {
|
|
109
|
+
asset: _chainflip_utils_chainflip.AssetAndChain;
|
|
110
|
+
refundAddress: string;
|
|
111
|
+
signatureData: {
|
|
112
|
+
Ethereum: {
|
|
113
|
+
signer: `0x${string}`;
|
|
114
|
+
signature: `0x${string}`;
|
|
115
|
+
sig_type: "Eip712";
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
transactionMetadata: {
|
|
119
|
+
nonce: number;
|
|
120
|
+
expiry_block: number;
|
|
121
|
+
};
|
|
122
|
+
boostFeeBps: number;
|
|
123
|
+
}, {
|
|
124
|
+
asset: {
|
|
125
|
+
asset: string;
|
|
126
|
+
chain: string;
|
|
127
|
+
};
|
|
128
|
+
refundAddress: string;
|
|
129
|
+
signatureData: {
|
|
130
|
+
Ethereum: {
|
|
131
|
+
signer: string;
|
|
132
|
+
signature: string;
|
|
133
|
+
sigType: "Eip712";
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
transactionMetadata: {
|
|
137
|
+
expiryBlock: number;
|
|
138
|
+
nonce: number;
|
|
139
|
+
};
|
|
140
|
+
boostFeeBps?: number | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
|
|
6
143
|
declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
7
144
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
8
145
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
9
146
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
10
|
-
/** @deprecated DEPRECATED(1.
|
|
11
|
-
cfParameters: z.ZodOptional<z.
|
|
147
|
+
/** @deprecated DEPRECATED(1.12) pass additionalData instead */
|
|
148
|
+
cfParameters: z.ZodOptional<z.ZodNever>;
|
|
12
149
|
}, "strip", z.ZodTypeAny, {
|
|
13
150
|
message: `0x${string}`;
|
|
14
151
|
gasBudget: `0x${string}`;
|
|
15
152
|
ccmAdditionalData?: `0x${string}` | undefined;
|
|
16
|
-
cfParameters?:
|
|
153
|
+
cfParameters?: undefined;
|
|
17
154
|
}, {
|
|
18
155
|
message: string;
|
|
19
156
|
gasBudget: string;
|
|
20
157
|
ccmAdditionalData?: string | undefined;
|
|
21
|
-
cfParameters?:
|
|
158
|
+
cfParameters?: undefined;
|
|
22
159
|
}>, {
|
|
23
160
|
gasBudget: `0x${string}`;
|
|
24
161
|
message: `0x${string}`;
|
|
@@ -27,12 +164,9 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
27
164
|
message: string;
|
|
28
165
|
gasBudget: string;
|
|
29
166
|
ccmAdditionalData?: string | undefined;
|
|
30
|
-
cfParameters?:
|
|
167
|
+
cfParameters?: undefined;
|
|
31
168
|
}>;
|
|
32
|
-
type CcmParams = Omit<z.input<typeof ccmParamsSchema>, 'cfParameters'
|
|
33
|
-
/** @deprecated DEPRECATED(1.10) pass additionalData instead */
|
|
34
|
-
cfParameters?: string;
|
|
35
|
-
};
|
|
169
|
+
type CcmParams = Omit<z.input<typeof ccmParamsSchema>, 'cfParameters'>;
|
|
36
170
|
declare const affiliateBroker: z.ZodEffects<z.ZodObject<{
|
|
37
171
|
account: z.ZodEffects<z.ZodString, string, string>;
|
|
38
172
|
commissionBps: z.ZodNumber;
|
|
@@ -66,22 +200,22 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
66
200
|
refundAddress: z.ZodString;
|
|
67
201
|
minPriceX128: z.ZodString;
|
|
68
202
|
maxOraclePriceSlippage: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, number | null, number | null | undefined>;
|
|
69
|
-
refundCcmMetadata: z.
|
|
203
|
+
refundCcmMetadata: z.ZodDefault<z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
|
|
70
204
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
71
205
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
72
206
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
73
|
-
/** @deprecated DEPRECATED(1.
|
|
74
|
-
cfParameters: z.ZodOptional<z.
|
|
207
|
+
/** @deprecated DEPRECATED(1.12) pass additionalData instead */
|
|
208
|
+
cfParameters: z.ZodOptional<z.ZodNever>;
|
|
75
209
|
}, "strip", z.ZodTypeAny, {
|
|
76
210
|
message: `0x${string}`;
|
|
77
211
|
gasBudget: `0x${string}`;
|
|
78
212
|
ccmAdditionalData?: `0x${string}` | undefined;
|
|
79
|
-
cfParameters?:
|
|
213
|
+
cfParameters?: undefined;
|
|
80
214
|
}, {
|
|
81
215
|
message: string;
|
|
82
216
|
gasBudget: string;
|
|
83
217
|
ccmAdditionalData?: string | undefined;
|
|
84
|
-
cfParameters?:
|
|
218
|
+
cfParameters?: undefined;
|
|
85
219
|
}>, {
|
|
86
220
|
gasBudget: `0x${string}`;
|
|
87
221
|
message: `0x${string}`;
|
|
@@ -90,25 +224,14 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
90
224
|
message: string;
|
|
91
225
|
gasBudget: string;
|
|
92
226
|
ccmAdditionalData?: string | undefined;
|
|
93
|
-
cfParameters?:
|
|
94
|
-
}
|
|
95
|
-
cfParameters: `0x${string}`;
|
|
96
|
-
gasBudget: `0x${string}`;
|
|
97
|
-
message: `0x${string}`;
|
|
98
|
-
ccmAdditionalData: `0x${string}`;
|
|
99
|
-
} | null, {
|
|
100
|
-
message: string;
|
|
101
|
-
gasBudget: string;
|
|
102
|
-
ccmAdditionalData?: string | undefined;
|
|
103
|
-
cfParameters?: string | undefined;
|
|
104
|
-
} | null | undefined>;
|
|
227
|
+
cfParameters?: undefined;
|
|
228
|
+
}>>>>>;
|
|
105
229
|
}, "strip", z.ZodTypeAny, {
|
|
106
230
|
retryDurationBlocks: number;
|
|
107
231
|
refundAddress: string;
|
|
108
232
|
minPriceX128: string;
|
|
109
233
|
maxOraclePriceSlippage: number | null;
|
|
110
234
|
refundCcmMetadata: {
|
|
111
|
-
cfParameters: `0x${string}`;
|
|
112
235
|
gasBudget: `0x${string}`;
|
|
113
236
|
message: `0x${string}`;
|
|
114
237
|
ccmAdditionalData: `0x${string}`;
|
|
@@ -122,7 +245,7 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
122
245
|
message: string;
|
|
123
246
|
gasBudget: string;
|
|
124
247
|
ccmAdditionalData?: string | undefined;
|
|
125
|
-
cfParameters?:
|
|
248
|
+
cfParameters?: undefined;
|
|
126
249
|
} | null | undefined;
|
|
127
250
|
}>;
|
|
128
251
|
type FillOrKillParamsX128 = z.input<typeof fillOrKillParams>;
|
|
@@ -193,22 +316,6 @@ type Quote = RegularQuote | DCAQuote;
|
|
|
193
316
|
type DCABoostQuote = NonNullable<DCAQuote['boostQuote']>;
|
|
194
317
|
type RegularBoostQuote = NonNullable<RegularQuote['boostQuote']>;
|
|
195
318
|
type BoostQuote = RegularBoostQuote | DCABoostQuote;
|
|
196
|
-
type FillOrKillParamsWithoutRefundAddress = {
|
|
197
|
-
livePriceSlippageTolerancePercent?: string | number | false;
|
|
198
|
-
refundCcmMetadata?: CcmParams | null;
|
|
199
|
-
} & ({
|
|
200
|
-
minPrice: string;
|
|
201
|
-
retryDurationBlocks: number;
|
|
202
|
-
} | {
|
|
203
|
-
minPrice: string;
|
|
204
|
-
retryDurationMinutes: number;
|
|
205
|
-
} | {
|
|
206
|
-
slippageTolerancePercent: string | number;
|
|
207
|
-
retryDurationBlocks: number;
|
|
208
|
-
} | {
|
|
209
|
-
slippageTolerancePercent: string | number;
|
|
210
|
-
retryDurationMinutes: number;
|
|
211
|
-
});
|
|
212
319
|
type FillOrKillParams = {
|
|
213
320
|
livePriceSlippageTolerancePercent?: string | number | false;
|
|
214
321
|
refundAddress: string;
|
|
@@ -314,13 +421,6 @@ interface DepositChannelFields {
|
|
|
314
421
|
expectedDepositAmount: string | undefined;
|
|
315
422
|
isExpired: boolean;
|
|
316
423
|
openedThroughBackend: boolean;
|
|
317
|
-
/** @deprecated DEPRECATED(1.10) use SwapStatusResponseV2['brokers'] instead */
|
|
318
|
-
brokerCommissionBps: number;
|
|
319
|
-
/** @deprecated DEPRECATED(1.10) use SwapStatusResponseV2['brokers'] instead */
|
|
320
|
-
affiliateBrokers: AffiliateBroker[];
|
|
321
|
-
/** @deprecated DEPRECATED(1.10) use SwapStatusResponseV2['fillOrKillParams'] instead */
|
|
322
|
-
fillOrKillParams: FillOrKillParamsWithMinPrice | undefined;
|
|
323
|
-
/** @deprecated DEPRECATED(1.10) use SwapStatusResponseV2['dcaParams'] instead */
|
|
324
424
|
dcaParams: DcaParams | undefined;
|
|
325
425
|
}
|
|
326
426
|
interface DepositFields {
|
|
@@ -546,8 +646,8 @@ type SwapSDKOptions = {
|
|
|
546
646
|
backendUrl?: string;
|
|
547
647
|
broker?: {
|
|
548
648
|
url: string;
|
|
549
|
-
/** @deprecated DEPRECATED(1.
|
|
550
|
-
commissionBps?:
|
|
649
|
+
/** @deprecated DEPRECATED(1.12) set the brokerCommissionBps param of the requestDepositAddress and encodeVaultSwapData method instead */
|
|
650
|
+
commissionBps?: never;
|
|
551
651
|
};
|
|
552
652
|
rpcUrl?: string;
|
|
553
653
|
enabledFeatures?: {
|
|
@@ -587,22 +687,17 @@ declare class SwapSDK {
|
|
|
587
687
|
requestDepositAddressV2({ quote, srcAddress, destAddress, fillOrKillParams: inputFoKParams, affiliateBrokers: affiliates, ccmParams, brokerCommissionBps: brokerCommissionBpsParam, }: DepositAddressRequestV2): Promise<DepositAddressResponseV2>;
|
|
588
688
|
encodeVaultSwapData({ quote, srcAddress, destAddress, fillOrKillParams: inputFoKParams, affiliateBrokers: affiliates, ccmParams, brokerAccount, brokerCommissionBps: brokerCommissionBpsParam, extraParams, }: VaultSwapRequest): Promise<VaultSwapResponse>;
|
|
589
689
|
encodeCfParameters({ quote, srcAddress, destAddress, fillOrKillParams, affiliateBrokers: affiliates, ccmParams, brokerAccount, brokerCommissionBps, }: EncodeCfParametersRequest): Promise<HexString>;
|
|
590
|
-
/** @deprecated DEPRECATED(1.11) removing this method as it appears to not be used */
|
|
591
|
-
getOnChainSwapExtrinsicArgs({ quote, fillOrKillParams, }: {
|
|
592
|
-
quote: Quote;
|
|
593
|
-
fillOrKillParams: FillOrKillParamsWithoutRefundAddress;
|
|
594
|
-
}): [
|
|
595
|
-
amount: string,
|
|
596
|
-
inputAsset: ChainflipAsset,
|
|
597
|
-
outputAsset: ChainflipAsset,
|
|
598
|
-
retryDuration: number,
|
|
599
|
-
minPrice: string,
|
|
600
|
-
dcaParams: {
|
|
601
|
-
number_of_chunks: number;
|
|
602
|
-
chunk_interval: number;
|
|
603
|
-
} | null
|
|
604
|
-
];
|
|
605
690
|
checkBoostEnabled(): Promise<boolean>;
|
|
691
|
+
requestAccountCreationDepositAddress(asset: ChainflipAsset, refundAddress: string, signatureData: AccountCreationDepositChannelParams['signatureData'], transactionMetadata: AccountCreationDepositChannelParams['transactionMetadata'], boostFeeBps?: number): Promise<{
|
|
692
|
+
depositAddress: string;
|
|
693
|
+
brokerCommissionBps: number;
|
|
694
|
+
id: string;
|
|
695
|
+
maxBoostFeeBps: number;
|
|
696
|
+
issuedBlock: number;
|
|
697
|
+
srcChainExpiryBlock: string;
|
|
698
|
+
channelOpeningFee: string;
|
|
699
|
+
estimatedExpiryTime?: number | undefined;
|
|
700
|
+
}>;
|
|
606
701
|
}
|
|
607
702
|
|
|
608
703
|
/**
|
package/dist/swap.d.ts
CHANGED
|
@@ -1,24 +1,161 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _chainflip_utils_chainflip from '@chainflip/utils/chainflip';
|
|
2
|
+
import { ChainflipNetwork, AssetAndChain, UncheckedAssetAndChain, ChainflipChain, ChainflipAsset, AssetOfChain, AssetSymbol, ChainAssetMap, ChainMap } from '@chainflip/utils/chainflip';
|
|
2
3
|
export { AssetSymbol as Asset, ChainflipNetwork, UncheckedAssetAndChain, getInternalAsset as getChainflipId } from '@chainflip/utils/chainflip';
|
|
3
4
|
import { HexString } from '@chainflip/utils/types';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
|
|
7
|
+
type AccountCreationDepositChannelParams = z.input<ReturnType<typeof getAccountCreationDepositChannelSchema>>;
|
|
8
|
+
declare const getAccountCreationDepositChannelSchema: (network: ChainflipNetwork) => z.ZodEffects<z.ZodObject<{
|
|
9
|
+
signatureData: z.ZodObject<{
|
|
10
|
+
Ethereum: z.ZodEffects<z.ZodObject<{
|
|
11
|
+
signature: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
12
|
+
signer: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
13
|
+
sigType: z.ZodLiteral<"Eip712">;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
signer: `0x${string}`;
|
|
16
|
+
signature: `0x${string}`;
|
|
17
|
+
sigType: "Eip712";
|
|
18
|
+
}, {
|
|
19
|
+
signer: string;
|
|
20
|
+
signature: string;
|
|
21
|
+
sigType: "Eip712";
|
|
22
|
+
}>, {
|
|
23
|
+
signer: `0x${string}`;
|
|
24
|
+
signature: `0x${string}`;
|
|
25
|
+
sig_type: "Eip712";
|
|
26
|
+
}, {
|
|
27
|
+
signer: string;
|
|
28
|
+
signature: string;
|
|
29
|
+
sigType: "Eip712";
|
|
30
|
+
}>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
Ethereum: {
|
|
33
|
+
signer: `0x${string}`;
|
|
34
|
+
signature: `0x${string}`;
|
|
35
|
+
sig_type: "Eip712";
|
|
36
|
+
};
|
|
37
|
+
}, {
|
|
38
|
+
Ethereum: {
|
|
39
|
+
signer: string;
|
|
40
|
+
signature: string;
|
|
41
|
+
sigType: "Eip712";
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
transactionMetadata: z.ZodEffects<z.ZodObject<{
|
|
45
|
+
nonce: z.ZodNumber;
|
|
46
|
+
expiryBlock: z.ZodNumber;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
expiryBlock: number;
|
|
49
|
+
nonce: number;
|
|
50
|
+
}, {
|
|
51
|
+
expiryBlock: number;
|
|
52
|
+
nonce: number;
|
|
53
|
+
}>, {
|
|
54
|
+
nonce: number;
|
|
55
|
+
expiry_block: number;
|
|
56
|
+
}, {
|
|
57
|
+
expiryBlock: number;
|
|
58
|
+
nonce: number;
|
|
59
|
+
}>;
|
|
60
|
+
asset: z.ZodEffects<z.ZodObject<{
|
|
61
|
+
asset: z.ZodString;
|
|
62
|
+
chain: z.ZodString;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
asset: string;
|
|
65
|
+
chain: string;
|
|
66
|
+
}, {
|
|
67
|
+
asset: string;
|
|
68
|
+
chain: string;
|
|
69
|
+
}>, _chainflip_utils_chainflip.AssetAndChain, {
|
|
70
|
+
asset: string;
|
|
71
|
+
chain: string;
|
|
72
|
+
}>;
|
|
73
|
+
refundAddress: z.ZodString;
|
|
74
|
+
boostFeeBps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
asset: _chainflip_utils_chainflip.AssetAndChain;
|
|
77
|
+
refundAddress: string;
|
|
78
|
+
signatureData: {
|
|
79
|
+
Ethereum: {
|
|
80
|
+
signer: `0x${string}`;
|
|
81
|
+
signature: `0x${string}`;
|
|
82
|
+
sig_type: "Eip712";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
transactionMetadata: {
|
|
86
|
+
nonce: number;
|
|
87
|
+
expiry_block: number;
|
|
88
|
+
};
|
|
89
|
+
boostFeeBps: number;
|
|
90
|
+
}, {
|
|
91
|
+
asset: {
|
|
92
|
+
asset: string;
|
|
93
|
+
chain: string;
|
|
94
|
+
};
|
|
95
|
+
refundAddress: string;
|
|
96
|
+
signatureData: {
|
|
97
|
+
Ethereum: {
|
|
98
|
+
signer: string;
|
|
99
|
+
signature: string;
|
|
100
|
+
sigType: "Eip712";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
transactionMetadata: {
|
|
104
|
+
expiryBlock: number;
|
|
105
|
+
nonce: number;
|
|
106
|
+
};
|
|
107
|
+
boostFeeBps?: number | undefined;
|
|
108
|
+
}>, {
|
|
109
|
+
asset: _chainflip_utils_chainflip.AssetAndChain;
|
|
110
|
+
refundAddress: string;
|
|
111
|
+
signatureData: {
|
|
112
|
+
Ethereum: {
|
|
113
|
+
signer: `0x${string}`;
|
|
114
|
+
signature: `0x${string}`;
|
|
115
|
+
sig_type: "Eip712";
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
transactionMetadata: {
|
|
119
|
+
nonce: number;
|
|
120
|
+
expiry_block: number;
|
|
121
|
+
};
|
|
122
|
+
boostFeeBps: number;
|
|
123
|
+
}, {
|
|
124
|
+
asset: {
|
|
125
|
+
asset: string;
|
|
126
|
+
chain: string;
|
|
127
|
+
};
|
|
128
|
+
refundAddress: string;
|
|
129
|
+
signatureData: {
|
|
130
|
+
Ethereum: {
|
|
131
|
+
signer: string;
|
|
132
|
+
signature: string;
|
|
133
|
+
sigType: "Eip712";
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
transactionMetadata: {
|
|
137
|
+
expiryBlock: number;
|
|
138
|
+
nonce: number;
|
|
139
|
+
};
|
|
140
|
+
boostFeeBps?: number | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
|
|
6
143
|
declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
7
144
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
8
145
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
9
146
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
10
|
-
/** @deprecated DEPRECATED(1.
|
|
11
|
-
cfParameters: z.ZodOptional<z.
|
|
147
|
+
/** @deprecated DEPRECATED(1.12) pass additionalData instead */
|
|
148
|
+
cfParameters: z.ZodOptional<z.ZodNever>;
|
|
12
149
|
}, "strip", z.ZodTypeAny, {
|
|
13
150
|
message: `0x${string}`;
|
|
14
151
|
gasBudget: `0x${string}`;
|
|
15
152
|
ccmAdditionalData?: `0x${string}` | undefined;
|
|
16
|
-
cfParameters?:
|
|
153
|
+
cfParameters?: undefined;
|
|
17
154
|
}, {
|
|
18
155
|
message: string;
|
|
19
156
|
gasBudget: string;
|
|
20
157
|
ccmAdditionalData?: string | undefined;
|
|
21
|
-
cfParameters?:
|
|
158
|
+
cfParameters?: undefined;
|
|
22
159
|
}>, {
|
|
23
160
|
gasBudget: `0x${string}`;
|
|
24
161
|
message: `0x${string}`;
|
|
@@ -27,12 +164,9 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
27
164
|
message: string;
|
|
28
165
|
gasBudget: string;
|
|
29
166
|
ccmAdditionalData?: string | undefined;
|
|
30
|
-
cfParameters?:
|
|
167
|
+
cfParameters?: undefined;
|
|
31
168
|
}>;
|
|
32
|
-
type CcmParams = Omit<z.input<typeof ccmParamsSchema>, 'cfParameters'
|
|
33
|
-
/** @deprecated DEPRECATED(1.10) pass additionalData instead */
|
|
34
|
-
cfParameters?: string;
|
|
35
|
-
};
|
|
169
|
+
type CcmParams = Omit<z.input<typeof ccmParamsSchema>, 'cfParameters'>;
|
|
36
170
|
declare const affiliateBroker: z.ZodEffects<z.ZodObject<{
|
|
37
171
|
account: z.ZodEffects<z.ZodString, string, string>;
|
|
38
172
|
commissionBps: z.ZodNumber;
|
|
@@ -66,22 +200,22 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
66
200
|
refundAddress: z.ZodString;
|
|
67
201
|
minPriceX128: z.ZodString;
|
|
68
202
|
maxOraclePriceSlippage: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, number | null, number | null | undefined>;
|
|
69
|
-
refundCcmMetadata: z.
|
|
203
|
+
refundCcmMetadata: z.ZodDefault<z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodObject<{
|
|
70
204
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
71
205
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
72
206
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
73
|
-
/** @deprecated DEPRECATED(1.
|
|
74
|
-
cfParameters: z.ZodOptional<z.
|
|
207
|
+
/** @deprecated DEPRECATED(1.12) pass additionalData instead */
|
|
208
|
+
cfParameters: z.ZodOptional<z.ZodNever>;
|
|
75
209
|
}, "strip", z.ZodTypeAny, {
|
|
76
210
|
message: `0x${string}`;
|
|
77
211
|
gasBudget: `0x${string}`;
|
|
78
212
|
ccmAdditionalData?: `0x${string}` | undefined;
|
|
79
|
-
cfParameters?:
|
|
213
|
+
cfParameters?: undefined;
|
|
80
214
|
}, {
|
|
81
215
|
message: string;
|
|
82
216
|
gasBudget: string;
|
|
83
217
|
ccmAdditionalData?: string | undefined;
|
|
84
|
-
cfParameters?:
|
|
218
|
+
cfParameters?: undefined;
|
|
85
219
|
}>, {
|
|
86
220
|
gasBudget: `0x${string}`;
|
|
87
221
|
message: `0x${string}`;
|
|
@@ -90,25 +224,14 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
90
224
|
message: string;
|
|
91
225
|
gasBudget: string;
|
|
92
226
|
ccmAdditionalData?: string | undefined;
|
|
93
|
-
cfParameters?:
|
|
94
|
-
}
|
|
95
|
-
cfParameters: `0x${string}`;
|
|
96
|
-
gasBudget: `0x${string}`;
|
|
97
|
-
message: `0x${string}`;
|
|
98
|
-
ccmAdditionalData: `0x${string}`;
|
|
99
|
-
} | null, {
|
|
100
|
-
message: string;
|
|
101
|
-
gasBudget: string;
|
|
102
|
-
ccmAdditionalData?: string | undefined;
|
|
103
|
-
cfParameters?: string | undefined;
|
|
104
|
-
} | null | undefined>;
|
|
227
|
+
cfParameters?: undefined;
|
|
228
|
+
}>>>>>;
|
|
105
229
|
}, "strip", z.ZodTypeAny, {
|
|
106
230
|
retryDurationBlocks: number;
|
|
107
231
|
refundAddress: string;
|
|
108
232
|
minPriceX128: string;
|
|
109
233
|
maxOraclePriceSlippage: number | null;
|
|
110
234
|
refundCcmMetadata: {
|
|
111
|
-
cfParameters: `0x${string}`;
|
|
112
235
|
gasBudget: `0x${string}`;
|
|
113
236
|
message: `0x${string}`;
|
|
114
237
|
ccmAdditionalData: `0x${string}`;
|
|
@@ -122,7 +245,7 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
122
245
|
message: string;
|
|
123
246
|
gasBudget: string;
|
|
124
247
|
ccmAdditionalData?: string | undefined;
|
|
125
|
-
cfParameters?:
|
|
248
|
+
cfParameters?: undefined;
|
|
126
249
|
} | null | undefined;
|
|
127
250
|
}>;
|
|
128
251
|
type FillOrKillParamsX128 = z.input<typeof fillOrKillParams>;
|
|
@@ -193,22 +316,6 @@ type Quote = RegularQuote | DCAQuote;
|
|
|
193
316
|
type DCABoostQuote = NonNullable<DCAQuote['boostQuote']>;
|
|
194
317
|
type RegularBoostQuote = NonNullable<RegularQuote['boostQuote']>;
|
|
195
318
|
type BoostQuote = RegularBoostQuote | DCABoostQuote;
|
|
196
|
-
type FillOrKillParamsWithoutRefundAddress = {
|
|
197
|
-
livePriceSlippageTolerancePercent?: string | number | false;
|
|
198
|
-
refundCcmMetadata?: CcmParams | null;
|
|
199
|
-
} & ({
|
|
200
|
-
minPrice: string;
|
|
201
|
-
retryDurationBlocks: number;
|
|
202
|
-
} | {
|
|
203
|
-
minPrice: string;
|
|
204
|
-
retryDurationMinutes: number;
|
|
205
|
-
} | {
|
|
206
|
-
slippageTolerancePercent: string | number;
|
|
207
|
-
retryDurationBlocks: number;
|
|
208
|
-
} | {
|
|
209
|
-
slippageTolerancePercent: string | number;
|
|
210
|
-
retryDurationMinutes: number;
|
|
211
|
-
});
|
|
212
319
|
type FillOrKillParams = {
|
|
213
320
|
livePriceSlippageTolerancePercent?: string | number | false;
|
|
214
321
|
refundAddress: string;
|
|
@@ -314,13 +421,6 @@ interface DepositChannelFields {
|
|
|
314
421
|
expectedDepositAmount: string | undefined;
|
|
315
422
|
isExpired: boolean;
|
|
316
423
|
openedThroughBackend: boolean;
|
|
317
|
-
/** @deprecated DEPRECATED(1.10) use SwapStatusResponseV2['brokers'] instead */
|
|
318
|
-
brokerCommissionBps: number;
|
|
319
|
-
/** @deprecated DEPRECATED(1.10) use SwapStatusResponseV2['brokers'] instead */
|
|
320
|
-
affiliateBrokers: AffiliateBroker[];
|
|
321
|
-
/** @deprecated DEPRECATED(1.10) use SwapStatusResponseV2['fillOrKillParams'] instead */
|
|
322
|
-
fillOrKillParams: FillOrKillParamsWithMinPrice | undefined;
|
|
323
|
-
/** @deprecated DEPRECATED(1.10) use SwapStatusResponseV2['dcaParams'] instead */
|
|
324
424
|
dcaParams: DcaParams | undefined;
|
|
325
425
|
}
|
|
326
426
|
interface DepositFields {
|
|
@@ -546,8 +646,8 @@ type SwapSDKOptions = {
|
|
|
546
646
|
backendUrl?: string;
|
|
547
647
|
broker?: {
|
|
548
648
|
url: string;
|
|
549
|
-
/** @deprecated DEPRECATED(1.
|
|
550
|
-
commissionBps?:
|
|
649
|
+
/** @deprecated DEPRECATED(1.12) set the brokerCommissionBps param of the requestDepositAddress and encodeVaultSwapData method instead */
|
|
650
|
+
commissionBps?: never;
|
|
551
651
|
};
|
|
552
652
|
rpcUrl?: string;
|
|
553
653
|
enabledFeatures?: {
|
|
@@ -587,22 +687,17 @@ declare class SwapSDK {
|
|
|
587
687
|
requestDepositAddressV2({ quote, srcAddress, destAddress, fillOrKillParams: inputFoKParams, affiliateBrokers: affiliates, ccmParams, brokerCommissionBps: brokerCommissionBpsParam, }: DepositAddressRequestV2): Promise<DepositAddressResponseV2>;
|
|
588
688
|
encodeVaultSwapData({ quote, srcAddress, destAddress, fillOrKillParams: inputFoKParams, affiliateBrokers: affiliates, ccmParams, brokerAccount, brokerCommissionBps: brokerCommissionBpsParam, extraParams, }: VaultSwapRequest): Promise<VaultSwapResponse>;
|
|
589
689
|
encodeCfParameters({ quote, srcAddress, destAddress, fillOrKillParams, affiliateBrokers: affiliates, ccmParams, brokerAccount, brokerCommissionBps, }: EncodeCfParametersRequest): Promise<HexString>;
|
|
590
|
-
/** @deprecated DEPRECATED(1.11) removing this method as it appears to not be used */
|
|
591
|
-
getOnChainSwapExtrinsicArgs({ quote, fillOrKillParams, }: {
|
|
592
|
-
quote: Quote;
|
|
593
|
-
fillOrKillParams: FillOrKillParamsWithoutRefundAddress;
|
|
594
|
-
}): [
|
|
595
|
-
amount: string,
|
|
596
|
-
inputAsset: ChainflipAsset,
|
|
597
|
-
outputAsset: ChainflipAsset,
|
|
598
|
-
retryDuration: number,
|
|
599
|
-
minPrice: string,
|
|
600
|
-
dcaParams: {
|
|
601
|
-
number_of_chunks: number;
|
|
602
|
-
chunk_interval: number;
|
|
603
|
-
} | null
|
|
604
|
-
];
|
|
605
690
|
checkBoostEnabled(): Promise<boolean>;
|
|
691
|
+
requestAccountCreationDepositAddress(asset: ChainflipAsset, refundAddress: string, signatureData: AccountCreationDepositChannelParams['signatureData'], transactionMetadata: AccountCreationDepositChannelParams['transactionMetadata'], boostFeeBps?: number): Promise<{
|
|
692
|
+
depositAddress: string;
|
|
693
|
+
brokerCommissionBps: number;
|
|
694
|
+
id: string;
|
|
695
|
+
maxBoostFeeBps: number;
|
|
696
|
+
issuedBlock: number;
|
|
697
|
+
srcChainExpiryBlock: string;
|
|
698
|
+
channelOpeningFee: string;
|
|
699
|
+
estimatedExpiryTime?: number | undefined;
|
|
700
|
+
}>;
|
|
606
701
|
}
|
|
607
702
|
|
|
608
703
|
/**
|