@chainflip/sdk 2.1.0-dev.0 → 2.1.1
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/{chunk-IXOXOHVV.js → chunk-S46ZA3IE.js} +24 -89
- package/dist/funding.cjs +10 -10
- package/dist/funding.js +1 -1
- package/dist/swap.cjs +99 -174
- package/dist/swap.d.cts +26 -46
- package/dist/swap.d.ts +26 -46
- package/dist/swap.js +78 -91
- package/package.json +5 -6
package/dist/swap.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
+
import { ChainflipNetwork, AssetAndChain, UncheckedAssetAndChain, ChainflipChain, ChainflipAsset, AssetOfChain, AssetSymbol, AnyChainflipChain, ChainAssetMap, ChainMap } from '@chainflip/utils/chainflip';
|
|
3
3
|
export { AssetSymbol as Asset, ChainflipNetwork, UncheckedAssetAndChain, getInternalAsset as getChainflipId } from '@chainflip/utils/chainflip';
|
|
4
4
|
import { HexString } from '@chainflip/utils/types';
|
|
5
5
|
import { z } from 'zod';
|
|
@@ -144,18 +144,14 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
144
144
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
145
145
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
146
146
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
147
|
-
/** @deprecated DEPRECATED(1.12) pass additionalData instead */
|
|
148
|
-
cfParameters: z.ZodOptional<z.ZodNever>;
|
|
149
147
|
}, "strip", z.ZodTypeAny, {
|
|
150
148
|
message: `0x${string}`;
|
|
151
149
|
gasBudget: `0x${string}`;
|
|
152
150
|
ccmAdditionalData?: `0x${string}` | undefined;
|
|
153
|
-
cfParameters?: undefined;
|
|
154
151
|
}, {
|
|
155
152
|
message: string;
|
|
156
153
|
gasBudget: string;
|
|
157
154
|
ccmAdditionalData?: string | undefined;
|
|
158
|
-
cfParameters?: undefined;
|
|
159
155
|
}>, {
|
|
160
156
|
gasBudget: `0x${string}`;
|
|
161
157
|
message: `0x${string}`;
|
|
@@ -164,9 +160,8 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
164
160
|
message: string;
|
|
165
161
|
gasBudget: string;
|
|
166
162
|
ccmAdditionalData?: string | undefined;
|
|
167
|
-
cfParameters?: undefined;
|
|
168
163
|
}>;
|
|
169
|
-
type CcmParams =
|
|
164
|
+
type CcmParams = z.input<typeof ccmParamsSchema>;
|
|
170
165
|
declare const affiliateBroker: z.ZodEffects<z.ZodObject<{
|
|
171
166
|
account: z.ZodEffects<z.ZodString, string, string>;
|
|
172
167
|
commissionBps: z.ZodNumber;
|
|
@@ -204,18 +199,14 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
204
199
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
205
200
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
206
201
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
207
|
-
/** @deprecated DEPRECATED(1.12) pass additionalData instead */
|
|
208
|
-
cfParameters: z.ZodOptional<z.ZodNever>;
|
|
209
202
|
}, "strip", z.ZodTypeAny, {
|
|
210
203
|
message: `0x${string}`;
|
|
211
204
|
gasBudget: `0x${string}`;
|
|
212
205
|
ccmAdditionalData?: `0x${string}` | undefined;
|
|
213
|
-
cfParameters?: undefined;
|
|
214
206
|
}, {
|
|
215
207
|
message: string;
|
|
216
208
|
gasBudget: string;
|
|
217
209
|
ccmAdditionalData?: string | undefined;
|
|
218
|
-
cfParameters?: undefined;
|
|
219
210
|
}>, {
|
|
220
211
|
gasBudget: `0x${string}`;
|
|
221
212
|
message: `0x${string}`;
|
|
@@ -224,7 +215,6 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
224
215
|
message: string;
|
|
225
216
|
gasBudget: string;
|
|
226
217
|
ccmAdditionalData?: string | undefined;
|
|
227
|
-
cfParameters?: undefined;
|
|
228
218
|
}>>>>>;
|
|
229
219
|
}, "strip", z.ZodTypeAny, {
|
|
230
220
|
refundAddress: string;
|
|
@@ -245,7 +235,6 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
245
235
|
message: string;
|
|
246
236
|
gasBudget: string;
|
|
247
237
|
ccmAdditionalData?: string | undefined;
|
|
248
|
-
cfParameters?: undefined;
|
|
249
238
|
} | null | undefined;
|
|
250
239
|
}>;
|
|
251
240
|
type FillOrKillParamsX128 = z.input<typeof fillOrKillParams>;
|
|
@@ -260,12 +249,8 @@ type SwapFee = Fee<'NETWORK' | 'INGRESS' | 'EGRESS' | 'BROKER' | 'BOOST' | 'REFU
|
|
|
260
249
|
type PoolFee = Fee<'LIQUIDITY'>;
|
|
261
250
|
type PaidFee = SwapFee | PoolFee;
|
|
262
251
|
type PoolInfo = {
|
|
263
|
-
baseAsset:
|
|
264
|
-
|
|
265
|
-
}>;
|
|
266
|
-
quoteAsset: Exclude<AssetAndChain, {
|
|
267
|
-
chain: 'Polkadot';
|
|
268
|
-
}>;
|
|
252
|
+
baseAsset: AssetAndChain;
|
|
253
|
+
quoteAsset: AssetAndChain;
|
|
269
254
|
fee: Omit<PoolFee, 'type'>;
|
|
270
255
|
};
|
|
271
256
|
type BoostedQuoteDetails = {
|
|
@@ -273,12 +258,8 @@ type BoostedQuoteDetails = {
|
|
|
273
258
|
maxBoostFeeBps: number;
|
|
274
259
|
};
|
|
275
260
|
interface BaseQuoteDetails {
|
|
276
|
-
srcAsset:
|
|
277
|
-
|
|
278
|
-
}>;
|
|
279
|
-
destAsset: Exclude<AssetAndChain, {
|
|
280
|
-
chain: 'Polkadot';
|
|
281
|
-
}>;
|
|
261
|
+
srcAsset: AssetAndChain;
|
|
262
|
+
destAsset: AssetAndChain;
|
|
282
263
|
isVaultSwap: boolean;
|
|
283
264
|
isOnChain: boolean;
|
|
284
265
|
ccmParams?: {
|
|
@@ -317,7 +298,7 @@ type DCABoostQuote = NonNullable<DCAQuote['boostQuote']>;
|
|
|
317
298
|
type RegularBoostQuote = NonNullable<RegularQuote['boostQuote']>;
|
|
318
299
|
type BoostQuote = RegularBoostQuote | DCABoostQuote;
|
|
319
300
|
type FillOrKillParams = {
|
|
320
|
-
livePriceSlippageTolerancePercent?: string | number
|
|
301
|
+
livePriceSlippageTolerancePercent?: string | number;
|
|
321
302
|
refundAddress: string;
|
|
322
303
|
refundCcmMetadata?: CcmParams | null;
|
|
323
304
|
} & ({
|
|
@@ -335,7 +316,7 @@ type FillOrKillParams = {
|
|
|
335
316
|
});
|
|
336
317
|
|
|
337
318
|
interface ChainData {
|
|
338
|
-
chain:
|
|
319
|
+
chain: ChainflipChain;
|
|
339
320
|
name: string;
|
|
340
321
|
evmChainId: number | undefined;
|
|
341
322
|
isMainnet: boolean;
|
|
@@ -343,8 +324,8 @@ interface ChainData {
|
|
|
343
324
|
maxRetryDurationBlocks: number | undefined;
|
|
344
325
|
}
|
|
345
326
|
type AssetData = {
|
|
346
|
-
[C in
|
|
347
|
-
chainflipId:
|
|
327
|
+
[C in ChainflipChain]: {
|
|
328
|
+
chainflipId: ChainflipAsset;
|
|
348
329
|
asset: AssetOfChain<C>;
|
|
349
330
|
chain: C;
|
|
350
331
|
contractAddress: string | undefined;
|
|
@@ -356,11 +337,11 @@ type AssetData = {
|
|
|
356
337
|
maximumSwapAmount: string | null;
|
|
357
338
|
minimumEgressAmount: string;
|
|
358
339
|
};
|
|
359
|
-
}[
|
|
340
|
+
}[ChainflipChain];
|
|
360
341
|
interface ChainsAndAssets {
|
|
361
|
-
srcChain:
|
|
342
|
+
srcChain: ChainflipChain;
|
|
362
343
|
srcAsset: AssetSymbol;
|
|
363
|
-
destChain:
|
|
344
|
+
destChain: ChainflipChain;
|
|
364
345
|
destAsset: AssetSymbol;
|
|
365
346
|
}
|
|
366
347
|
interface QuoteRequest extends ChainsAndAssets {
|
|
@@ -387,7 +368,7 @@ type BoostPoolDepth = {
|
|
|
387
368
|
feeTierBps: number;
|
|
388
369
|
availableAmount: bigint;
|
|
389
370
|
asset: AssetSymbol;
|
|
390
|
-
chain:
|
|
371
|
+
chain: ChainflipChain;
|
|
391
372
|
};
|
|
392
373
|
|
|
393
374
|
type ChunkFailureReason = 'PriceImpactLimit' | 'MinPriceViolation' | 'OraclePriceSlippageExceeded' | 'OraclePriceStale' | 'PredecessorSwapFailure' | 'SafeModeActive';
|
|
@@ -510,7 +491,11 @@ interface EgressFields {
|
|
|
510
491
|
data: `0x${string}`;
|
|
511
492
|
} | undefined;
|
|
512
493
|
}
|
|
513
|
-
interface SwapStatusResponseCommonFields
|
|
494
|
+
interface SwapStatusResponseCommonFields {
|
|
495
|
+
srcChain: AnyChainflipChain;
|
|
496
|
+
srcAsset: AssetSymbol;
|
|
497
|
+
destChain: AnyChainflipChain;
|
|
498
|
+
destAsset: AssetSymbol;
|
|
514
499
|
swapId: string;
|
|
515
500
|
destAddress: string;
|
|
516
501
|
depositChannel: DepositChannelFields | undefined;
|
|
@@ -646,8 +631,6 @@ type SwapSDKOptions = {
|
|
|
646
631
|
backendUrl?: string;
|
|
647
632
|
broker?: {
|
|
648
633
|
url: string;
|
|
649
|
-
/** @deprecated DEPRECATED(1.12) set the brokerCommissionBps param of the requestDepositAddress and encodeVaultSwapData method instead */
|
|
650
|
-
commissionBps?: never;
|
|
651
634
|
};
|
|
652
635
|
rpcUrl?: string;
|
|
653
636
|
enabledFeatures?: {
|
|
@@ -664,7 +647,6 @@ declare class SwapSDK {
|
|
|
664
647
|
private cache;
|
|
665
648
|
private dcaEnabled;
|
|
666
649
|
private dcaV2Enabled;
|
|
667
|
-
private blackListedAssets;
|
|
668
650
|
constructor(options?: SwapSDKOptions);
|
|
669
651
|
getChains(sourceChain?: ChainflipChain, type?: AssetState): Promise<ChainData[]>;
|
|
670
652
|
private getStateChainEnvironment;
|
|
@@ -701,8 +683,6 @@ declare class SwapSDK {
|
|
|
701
683
|
channelOpeningFee: string;
|
|
702
684
|
estimatedExpiryTime?: number | undefined;
|
|
703
685
|
}>;
|
|
704
|
-
private checkLivePriceProtectionRequirement;
|
|
705
|
-
calculateLivePriceSlippageTolerancePercent(slippageTolerancePercent: number, brokerCommissionBpsInput: number | undefined, quote: Pick<Quote | BoostQuote, 'srcAsset' | 'destAsset' | 'isOnChain'>): Promise<number | false>;
|
|
706
686
|
}
|
|
707
687
|
|
|
708
688
|
/**
|
|
@@ -741,16 +721,16 @@ declare const Chains: {
|
|
|
741
721
|
Assethub: "Assethub";
|
|
742
722
|
};
|
|
743
723
|
declare const Assets: {
|
|
744
|
-
|
|
745
|
-
USDT: "USDT";
|
|
746
|
-
WBTC: "WBTC";
|
|
747
|
-
FLIP: "FLIP";
|
|
724
|
+
BTC: "BTC";
|
|
748
725
|
DOT: "DOT";
|
|
749
726
|
ETH: "ETH";
|
|
750
|
-
|
|
727
|
+
FLIP: "FLIP";
|
|
751
728
|
SOL: "SOL";
|
|
729
|
+
USDC: "USDC";
|
|
730
|
+
USDT: "USDT";
|
|
731
|
+
WBTC: "WBTC";
|
|
752
732
|
};
|
|
753
|
-
type Chain =
|
|
754
|
-
type InternalAsset =
|
|
733
|
+
type Chain = ChainflipChain;
|
|
734
|
+
type InternalAsset = ChainflipAsset;
|
|
755
735
|
|
|
756
736
|
export { type AssetData, Assets, type BoostPoolDepth, type BoostQuote, type Chain, type ChainData, type InternalAsset as ChainflipId, InternalAssets as ChainflipIds, ChainflipNetworks, Chains, type ChainsAndAssets, type DCABoostQuote, type DCAQuote, type DepositAddressRequestV2, type DepositAddressResponseV2, type EncodeCfParametersRequest, type FillOrKillParamsWithSlippage, type Quote, type QuoteRequest, type QuoteResponseV2, type RegularQuote, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponseV2, type VaultSwapRequest, type VaultSwapResponse };
|
package/dist/swap.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
+
import { ChainflipNetwork, AssetAndChain, UncheckedAssetAndChain, ChainflipChain, ChainflipAsset, AssetOfChain, AssetSymbol, AnyChainflipChain, ChainAssetMap, ChainMap } from '@chainflip/utils/chainflip';
|
|
3
3
|
export { AssetSymbol as Asset, ChainflipNetwork, UncheckedAssetAndChain, getInternalAsset as getChainflipId } from '@chainflip/utils/chainflip';
|
|
4
4
|
import { HexString } from '@chainflip/utils/types';
|
|
5
5
|
import { z } from 'zod';
|
|
@@ -144,18 +144,14 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
144
144
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
145
145
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
146
146
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
147
|
-
/** @deprecated DEPRECATED(1.12) pass additionalData instead */
|
|
148
|
-
cfParameters: z.ZodOptional<z.ZodNever>;
|
|
149
147
|
}, "strip", z.ZodTypeAny, {
|
|
150
148
|
message: `0x${string}`;
|
|
151
149
|
gasBudget: `0x${string}`;
|
|
152
150
|
ccmAdditionalData?: `0x${string}` | undefined;
|
|
153
|
-
cfParameters?: undefined;
|
|
154
151
|
}, {
|
|
155
152
|
message: string;
|
|
156
153
|
gasBudget: string;
|
|
157
154
|
ccmAdditionalData?: string | undefined;
|
|
158
|
-
cfParameters?: undefined;
|
|
159
155
|
}>, {
|
|
160
156
|
gasBudget: `0x${string}`;
|
|
161
157
|
message: `0x${string}`;
|
|
@@ -164,9 +160,8 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
164
160
|
message: string;
|
|
165
161
|
gasBudget: string;
|
|
166
162
|
ccmAdditionalData?: string | undefined;
|
|
167
|
-
cfParameters?: undefined;
|
|
168
163
|
}>;
|
|
169
|
-
type CcmParams =
|
|
164
|
+
type CcmParams = z.input<typeof ccmParamsSchema>;
|
|
170
165
|
declare const affiliateBroker: z.ZodEffects<z.ZodObject<{
|
|
171
166
|
account: z.ZodEffects<z.ZodString, string, string>;
|
|
172
167
|
commissionBps: z.ZodNumber;
|
|
@@ -204,18 +199,14 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
204
199
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
205
200
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
206
201
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
207
|
-
/** @deprecated DEPRECATED(1.12) pass additionalData instead */
|
|
208
|
-
cfParameters: z.ZodOptional<z.ZodNever>;
|
|
209
202
|
}, "strip", z.ZodTypeAny, {
|
|
210
203
|
message: `0x${string}`;
|
|
211
204
|
gasBudget: `0x${string}`;
|
|
212
205
|
ccmAdditionalData?: `0x${string}` | undefined;
|
|
213
|
-
cfParameters?: undefined;
|
|
214
206
|
}, {
|
|
215
207
|
message: string;
|
|
216
208
|
gasBudget: string;
|
|
217
209
|
ccmAdditionalData?: string | undefined;
|
|
218
|
-
cfParameters?: undefined;
|
|
219
210
|
}>, {
|
|
220
211
|
gasBudget: `0x${string}`;
|
|
221
212
|
message: `0x${string}`;
|
|
@@ -224,7 +215,6 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
224
215
|
message: string;
|
|
225
216
|
gasBudget: string;
|
|
226
217
|
ccmAdditionalData?: string | undefined;
|
|
227
|
-
cfParameters?: undefined;
|
|
228
218
|
}>>>>>;
|
|
229
219
|
}, "strip", z.ZodTypeAny, {
|
|
230
220
|
refundAddress: string;
|
|
@@ -245,7 +235,6 @@ declare const fillOrKillParams: z.ZodObject<{
|
|
|
245
235
|
message: string;
|
|
246
236
|
gasBudget: string;
|
|
247
237
|
ccmAdditionalData?: string | undefined;
|
|
248
|
-
cfParameters?: undefined;
|
|
249
238
|
} | null | undefined;
|
|
250
239
|
}>;
|
|
251
240
|
type FillOrKillParamsX128 = z.input<typeof fillOrKillParams>;
|
|
@@ -260,12 +249,8 @@ type SwapFee = Fee<'NETWORK' | 'INGRESS' | 'EGRESS' | 'BROKER' | 'BOOST' | 'REFU
|
|
|
260
249
|
type PoolFee = Fee<'LIQUIDITY'>;
|
|
261
250
|
type PaidFee = SwapFee | PoolFee;
|
|
262
251
|
type PoolInfo = {
|
|
263
|
-
baseAsset:
|
|
264
|
-
|
|
265
|
-
}>;
|
|
266
|
-
quoteAsset: Exclude<AssetAndChain, {
|
|
267
|
-
chain: 'Polkadot';
|
|
268
|
-
}>;
|
|
252
|
+
baseAsset: AssetAndChain;
|
|
253
|
+
quoteAsset: AssetAndChain;
|
|
269
254
|
fee: Omit<PoolFee, 'type'>;
|
|
270
255
|
};
|
|
271
256
|
type BoostedQuoteDetails = {
|
|
@@ -273,12 +258,8 @@ type BoostedQuoteDetails = {
|
|
|
273
258
|
maxBoostFeeBps: number;
|
|
274
259
|
};
|
|
275
260
|
interface BaseQuoteDetails {
|
|
276
|
-
srcAsset:
|
|
277
|
-
|
|
278
|
-
}>;
|
|
279
|
-
destAsset: Exclude<AssetAndChain, {
|
|
280
|
-
chain: 'Polkadot';
|
|
281
|
-
}>;
|
|
261
|
+
srcAsset: AssetAndChain;
|
|
262
|
+
destAsset: AssetAndChain;
|
|
282
263
|
isVaultSwap: boolean;
|
|
283
264
|
isOnChain: boolean;
|
|
284
265
|
ccmParams?: {
|
|
@@ -317,7 +298,7 @@ type DCABoostQuote = NonNullable<DCAQuote['boostQuote']>;
|
|
|
317
298
|
type RegularBoostQuote = NonNullable<RegularQuote['boostQuote']>;
|
|
318
299
|
type BoostQuote = RegularBoostQuote | DCABoostQuote;
|
|
319
300
|
type FillOrKillParams = {
|
|
320
|
-
livePriceSlippageTolerancePercent?: string | number
|
|
301
|
+
livePriceSlippageTolerancePercent?: string | number;
|
|
321
302
|
refundAddress: string;
|
|
322
303
|
refundCcmMetadata?: CcmParams | null;
|
|
323
304
|
} & ({
|
|
@@ -335,7 +316,7 @@ type FillOrKillParams = {
|
|
|
335
316
|
});
|
|
336
317
|
|
|
337
318
|
interface ChainData {
|
|
338
|
-
chain:
|
|
319
|
+
chain: ChainflipChain;
|
|
339
320
|
name: string;
|
|
340
321
|
evmChainId: number | undefined;
|
|
341
322
|
isMainnet: boolean;
|
|
@@ -343,8 +324,8 @@ interface ChainData {
|
|
|
343
324
|
maxRetryDurationBlocks: number | undefined;
|
|
344
325
|
}
|
|
345
326
|
type AssetData = {
|
|
346
|
-
[C in
|
|
347
|
-
chainflipId:
|
|
327
|
+
[C in ChainflipChain]: {
|
|
328
|
+
chainflipId: ChainflipAsset;
|
|
348
329
|
asset: AssetOfChain<C>;
|
|
349
330
|
chain: C;
|
|
350
331
|
contractAddress: string | undefined;
|
|
@@ -356,11 +337,11 @@ type AssetData = {
|
|
|
356
337
|
maximumSwapAmount: string | null;
|
|
357
338
|
minimumEgressAmount: string;
|
|
358
339
|
};
|
|
359
|
-
}[
|
|
340
|
+
}[ChainflipChain];
|
|
360
341
|
interface ChainsAndAssets {
|
|
361
|
-
srcChain:
|
|
342
|
+
srcChain: ChainflipChain;
|
|
362
343
|
srcAsset: AssetSymbol;
|
|
363
|
-
destChain:
|
|
344
|
+
destChain: ChainflipChain;
|
|
364
345
|
destAsset: AssetSymbol;
|
|
365
346
|
}
|
|
366
347
|
interface QuoteRequest extends ChainsAndAssets {
|
|
@@ -387,7 +368,7 @@ type BoostPoolDepth = {
|
|
|
387
368
|
feeTierBps: number;
|
|
388
369
|
availableAmount: bigint;
|
|
389
370
|
asset: AssetSymbol;
|
|
390
|
-
chain:
|
|
371
|
+
chain: ChainflipChain;
|
|
391
372
|
};
|
|
392
373
|
|
|
393
374
|
type ChunkFailureReason = 'PriceImpactLimit' | 'MinPriceViolation' | 'OraclePriceSlippageExceeded' | 'OraclePriceStale' | 'PredecessorSwapFailure' | 'SafeModeActive';
|
|
@@ -510,7 +491,11 @@ interface EgressFields {
|
|
|
510
491
|
data: `0x${string}`;
|
|
511
492
|
} | undefined;
|
|
512
493
|
}
|
|
513
|
-
interface SwapStatusResponseCommonFields
|
|
494
|
+
interface SwapStatusResponseCommonFields {
|
|
495
|
+
srcChain: AnyChainflipChain;
|
|
496
|
+
srcAsset: AssetSymbol;
|
|
497
|
+
destChain: AnyChainflipChain;
|
|
498
|
+
destAsset: AssetSymbol;
|
|
514
499
|
swapId: string;
|
|
515
500
|
destAddress: string;
|
|
516
501
|
depositChannel: DepositChannelFields | undefined;
|
|
@@ -646,8 +631,6 @@ type SwapSDKOptions = {
|
|
|
646
631
|
backendUrl?: string;
|
|
647
632
|
broker?: {
|
|
648
633
|
url: string;
|
|
649
|
-
/** @deprecated DEPRECATED(1.12) set the brokerCommissionBps param of the requestDepositAddress and encodeVaultSwapData method instead */
|
|
650
|
-
commissionBps?: never;
|
|
651
634
|
};
|
|
652
635
|
rpcUrl?: string;
|
|
653
636
|
enabledFeatures?: {
|
|
@@ -664,7 +647,6 @@ declare class SwapSDK {
|
|
|
664
647
|
private cache;
|
|
665
648
|
private dcaEnabled;
|
|
666
649
|
private dcaV2Enabled;
|
|
667
|
-
private blackListedAssets;
|
|
668
650
|
constructor(options?: SwapSDKOptions);
|
|
669
651
|
getChains(sourceChain?: ChainflipChain, type?: AssetState): Promise<ChainData[]>;
|
|
670
652
|
private getStateChainEnvironment;
|
|
@@ -701,8 +683,6 @@ declare class SwapSDK {
|
|
|
701
683
|
channelOpeningFee: string;
|
|
702
684
|
estimatedExpiryTime?: number | undefined;
|
|
703
685
|
}>;
|
|
704
|
-
private checkLivePriceProtectionRequirement;
|
|
705
|
-
calculateLivePriceSlippageTolerancePercent(slippageTolerancePercent: number, brokerCommissionBpsInput: number | undefined, quote: Pick<Quote | BoostQuote, 'srcAsset' | 'destAsset' | 'isOnChain'>): Promise<number | false>;
|
|
706
686
|
}
|
|
707
687
|
|
|
708
688
|
/**
|
|
@@ -741,16 +721,16 @@ declare const Chains: {
|
|
|
741
721
|
Assethub: "Assethub";
|
|
742
722
|
};
|
|
743
723
|
declare const Assets: {
|
|
744
|
-
|
|
745
|
-
USDT: "USDT";
|
|
746
|
-
WBTC: "WBTC";
|
|
747
|
-
FLIP: "FLIP";
|
|
724
|
+
BTC: "BTC";
|
|
748
725
|
DOT: "DOT";
|
|
749
726
|
ETH: "ETH";
|
|
750
|
-
|
|
727
|
+
FLIP: "FLIP";
|
|
751
728
|
SOL: "SOL";
|
|
729
|
+
USDC: "USDC";
|
|
730
|
+
USDT: "USDT";
|
|
731
|
+
WBTC: "WBTC";
|
|
752
732
|
};
|
|
753
|
-
type Chain =
|
|
754
|
-
type InternalAsset =
|
|
733
|
+
type Chain = ChainflipChain;
|
|
734
|
+
type InternalAsset = ChainflipAsset;
|
|
755
735
|
|
|
756
736
|
export { type AssetData, Assets, type BoostPoolDepth, type BoostQuote, type Chain, type ChainData, type InternalAsset as ChainflipId, InternalAssets as ChainflipIds, ChainflipNetworks, Chains, type ChainsAndAssets, type DCABoostQuote, type DCAQuote, type DepositAddressRequestV2, type DepositAddressResponseV2, type EncodeCfParametersRequest, type FillOrKillParamsWithSlippage, type Quote, type QuoteRequest, type QuoteResponseV2, type RegularQuote, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponseV2, type VaultSwapRequest, type VaultSwapResponse };
|