@chainflip/sdk 1.6.0-alpha.3 → 1.6.0-alpha.5

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.
@@ -75,4 +75,4 @@ type TransactionOptions = {
75
75
  wait?: number;
76
76
  };
77
77
 
78
- export { type Asset as A, type Chain as C, type InternalAsset as I, type TransactionOptions as T, type UncheckedAssetAndChain as U, type AssetAndChain as a, type AssetOfChain as b, type ChainflipNetwork as c, type ChainAssetMap as d, type ChainMap as e, Chains as f, Assets as g, InternalAssets as h, ChainflipNetworks as i, getInternalAsset as j };
78
+ export { type AssetAndChain as A, type Chain as C, type InternalAsset as I, type TransactionOptions as T, type UncheckedAssetAndChain as U, type Asset as a, type AssetOfChain as b, type ChainflipNetwork as c, type ChainAssetMap as d, type ChainMap as e, Chains as f, Assets as g, InternalAssets as h, ChainflipNetworks as i, getInternalAsset as j };
@@ -75,4 +75,4 @@ type TransactionOptions = {
75
75
  wait?: number;
76
76
  };
77
77
 
78
- export { type Asset as A, type Chain as C, type InternalAsset as I, type TransactionOptions as T, type UncheckedAssetAndChain as U, type AssetAndChain as a, type AssetOfChain as b, type ChainflipNetwork as c, type ChainAssetMap as d, type ChainMap as e, Chains as f, Assets as g, InternalAssets as h, ChainflipNetworks as i, getInternalAsset as j };
78
+ export { type AssetAndChain as A, type Chain as C, type InternalAsset as I, type TransactionOptions as T, type UncheckedAssetAndChain as U, type Asset as a, type AssetOfChain as b, type ChainflipNetwork as c, type ChainAssetMap as d, type ChainMap as e, Chains as f, Assets as g, InternalAssets as h, ChainflipNetworks as i, getInternalAsset as j };
@@ -1,5 +1,5 @@
1
1
  import { Signer } from 'ethers';
2
- import { c as ChainflipNetwork, T as TransactionOptions } from './contracts-50KY1eSc.mjs';
2
+ import { c as ChainflipNetwork, T as TransactionOptions } from './contracts-DmShvHR7.mjs';
3
3
 
4
4
  type PendingRedemption = {
5
5
  amount: bigint;
package/dist/funding.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Signer } from 'ethers';
2
- import { c as ChainflipNetwork, T as TransactionOptions } from './contracts-50KY1eSc.js';
2
+ import { c as ChainflipNetwork, T as TransactionOptions } from './contracts-DmShvHR7.js';
3
3
 
4
4
  type PendingRedemption = {
5
5
  amount: bigint;
package/dist/swap.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Signer } from 'ethers';
2
- import { C as Chain, A as Asset, a as AssetAndChain, I as InternalAsset, b as AssetOfChain, c as ChainflipNetwork, T as TransactionOptions, d as ChainAssetMap, e as ChainMap } from './contracts-50KY1eSc.mjs';
3
- export { g as Assets, h as ChainflipIds, i as ChainflipNetworks, f as Chains, U as UncheckedAssetAndChain, j as getChainflipId } from './contracts-50KY1eSc.mjs';
2
+ import { A as AssetAndChain, C as Chain, a as Asset, I as InternalAsset, b as AssetOfChain, c as ChainflipNetwork, T as TransactionOptions, d as ChainAssetMap, e as ChainMap } from './contracts-DmShvHR7.mjs';
3
+ export { g as Assets, h as ChainflipIds, i as ChainflipNetworks, f as Chains, U as UncheckedAssetAndChain, j as getChainflipId } from './contracts-DmShvHR7.mjs';
4
4
  import { z } from 'zod';
5
5
  import { SwapType } from '.prisma/client';
6
6
 
@@ -154,7 +154,7 @@ interface DepositAddressResponse extends DepositAddressRequest {
154
154
  interface SwapStatusRequest {
155
155
  id: string;
156
156
  }
157
- interface SwapStatusResponseCommonFields extends ChainsAndAssets {
157
+ interface SwapStatusResponseCommonFields$1 extends ChainsAndAssets {
158
158
  destAddress: string;
159
159
  ccmDepositReceivedBlockIndex: string | undefined;
160
160
  ccmParams: CcmParams | undefined;
@@ -167,7 +167,7 @@ interface SwapStatusResponseCommonFields extends ChainsAndAssets {
167
167
  depositTransactionHash: string | undefined;
168
168
  ccmMetadata?: CcmParams;
169
169
  }
170
- interface DepositAddressFields extends SwapStatusResponseCommonFields {
170
+ interface DepositAddressFields extends SwapStatusResponseCommonFields$1 {
171
171
  depositAddress: string;
172
172
  depositChannelCreatedAt: number;
173
173
  depositChannelBrokerCommissionBps: number;
@@ -205,7 +205,7 @@ type EgressScheduled = {
205
205
  type CopyFields<T, U> = {
206
206
  [K in Exclude<keyof T, keyof U>]: undefined;
207
207
  } & U;
208
- type VaultSwapFields = CopyFields<DepositAddressFields, SwapStatusResponseCommonFields>;
208
+ type VaultSwapFields = CopyFields<DepositAddressFields, SwapStatusResponseCommonFields$1>;
209
209
  type FailedVaultSwapStatusResponse = CopyFields<DepositAddressFields, {
210
210
  depositAmount: string;
211
211
  destAddress: string;
@@ -222,7 +222,7 @@ type FailedVaultSwapStatusResponse = CopyFields<DepositAddressFields, {
222
222
  state: 'FAILED';
223
223
  depositAddress: undefined;
224
224
  }>;
225
- type SwapState = {
225
+ type SwapState$1 = {
226
226
  state: 'AWAITING_DEPOSIT';
227
227
  depositAmount: string | undefined;
228
228
  depositTransactionConfirmations: number | undefined;
@@ -309,8 +309,8 @@ type SwapState = {
309
309
  egressIgnoredAt: number;
310
310
  egressIgnoredBlockIndex: string;
311
311
  };
312
- type DepositAddressStatusResponse = DepositAddressFields & SwapState;
313
- type VaultSwapStatusResponse = VaultSwapFields & SwapState;
312
+ type DepositAddressStatusResponse = DepositAddressFields & SwapState$1;
313
+ type VaultSwapStatusResponse = VaultSwapFields & SwapState$1;
314
314
  type SwapStatusResponse = DepositAddressStatusResponse | VaultSwapStatusResponse | FailedVaultSwapStatusResponse;
315
315
  type BoostPoolDepth = {
316
316
  feeTierBps: number;
@@ -326,140 +326,139 @@ declare enum FailureMode {
326
326
  BroadcastAborted = "SENDING_FAILED"
327
327
  }
328
328
 
329
- declare namespace SwapV2 {
330
- interface DcaParameters {
331
- numberOfChunks: number;
332
- chunkIntervalBlocks: string;
333
- }
334
- interface Ccm {
329
+ interface DcaParameters {
330
+ numberOfChunks: number;
331
+ chunkIntervalBlocks: string;
332
+ }
333
+ interface Ccm {
334
+ message: string;
335
+ gasBudget: string;
336
+ cfParameters: string | undefined;
337
+ ccmDepositReceivedBlockIndex: string | undefined;
338
+ }
339
+ interface Failure {
340
+ failedAt: number;
341
+ failedBlockIndex: string;
342
+ mode: FailureMode;
343
+ reason: {
344
+ code: string;
335
345
  message: string;
336
- gasBudget: string;
337
- cfParameters: string | undefined;
338
- ccmDepositReceivedBlockIndex: string | undefined;
339
- }
340
- interface Failure {
341
- failedAt: number;
342
- failedAtBlockIndex: string;
343
- mode: FailureMode;
344
- reason: {
345
- code: string;
346
- message: string;
347
- };
348
- }
349
- interface Boost {
350
- maxBoostFeeBps: number;
351
- effectiveBoostFeeBps: number | undefined;
352
- boostedAt: number | undefined;
353
- boostedBlockIndex: string | undefined;
354
- skippedAt: number | undefined;
355
- skippedBlockIndex: string | undefined;
356
- }
357
- interface DepositChannelFields {
358
- createdAt: number;
359
- brokerCommissionBps: number;
360
- depositAddress: string;
361
- srcChainExpiryBlock: string;
362
- estimatedExpiryTime: number;
363
- expectedDepositAmount: string;
364
- isExpired: boolean;
365
- openedThroughBackend: boolean;
366
- affiliateBrokers: AffiliateBroker[];
367
- fillOrKillParams: FillOrKillParams | undefined;
368
- dcaParams: DcaParameters | undefined;
369
- srcChainRequiredBlockConfirmations: number | null | undefined;
370
- }
371
- interface DepositFields {
372
- amount: string | undefined;
373
- txRef: string | undefined;
374
- txConfirmations: number | undefined;
375
- receivedAt: number | undefined;
376
- receivedBlockIndex: string | undefined;
377
- failure: Failure | undefined;
378
- }
379
- interface SwapChunk {
380
- swapInputAmount: string;
381
- swapOutputAmount: string | undefined;
382
- scheduledAt: number;
383
- scheduledBlockIndex: string;
384
- executedAt: number | undefined;
385
- executedBlockIndex: string | undefined;
386
- retryCount: number;
387
- latestSwapRescheduledAt: number | undefined;
388
- latestSwapRescheduledBlockIndex: number | undefined;
389
- fees: SwapFee[];
390
- }
391
- interface SwapFields {
392
- totalInputAmountSwapped: string | undefined;
393
- totalOutputAmountSwapped: string | undefined;
394
- totalChunksExecuted: number;
395
- isDcaSwap: boolean;
396
- lastExecutedChunk: SwapChunk | undefined;
397
- currentChunk: SwapChunk;
398
- type: SwapType;
399
- fees: SwapFee[];
400
- }
401
- interface EgressFields {
402
- amount: string;
403
- scheduledAt: number;
404
- scheduledBlockIndex: string;
405
- sentTxRef: string | undefined;
406
- sentAt: number | undefined;
407
- sentAtBlockIndex: string | undefined;
408
- ignoredAmount: string | undefined;
409
- failure: Failure | undefined;
410
- }
411
- interface SwapStatusResponseCommonFields extends ChainsAndAssets {
412
- swapId: string;
413
- destAddress: string;
414
- depositChannel: DepositChannelFields;
415
- ccm: Ccm | undefined;
416
- boost: Boost | undefined;
417
- estimatedDurationSeconds: number | null | undefined;
418
- }
419
- interface VaultSwapCommonFields extends Exclude<SwapStatusResponseCommonFields, 'depositChannel' | 'boost'> {
420
- }
421
- interface ReceivingVaultSwap extends VaultSwapCommonFields {
422
- deposit: Pick<DepositFields, 'amount' | 'txRef'>;
423
- }
424
- interface SwappingVaultSwap extends ReceivingVaultSwap {
425
- swap: Exclude<SwapChunk, 'latestSwapRescheduledAt' | 'latestSwapRescheduledBlockIndex'> | undefined;
426
- swapEgress: EgressFields | undefined;
427
- }
428
- interface SendingVaultSwap extends SwappingVaultSwap {
429
- swapEgress: EgressFields | undefined;
430
- }
431
- interface DepositChannel extends SwapStatusResponseCommonFields {
432
- depositChannel: DepositChannelFields;
433
- }
434
- interface Receiving extends DepositChannel {
435
- deposit: DepositFields;
436
- }
437
- interface Swapping extends Receiving {
438
- swap: SwapFields;
439
- }
440
- interface Sending extends Receiving {
441
- swap: SwapFields;
442
- swapEgress: EgressFields | undefined;
443
- refundEgress: EgressFields | undefined;
444
- }
445
- type SwapState = ({
446
- state: 'RECEIVING';
447
- } & Receiving) | ({
448
- state: 'SWAPPING';
449
- } & Swapping) | ({
450
- state: 'SENDING';
451
- } & Sending) | ({
452
- state: 'SENT';
453
- } & Sending) | ({
454
- state: 'COMPLETED';
455
- } & Sending) | ({
456
- state: 'FAILED';
457
- } & Sending);
458
- export type DepositAddressStatusResponse = SwapState;
459
- export type VaultSwapStatusResponse = SwapState & SendingVaultSwap;
460
- export type SwapStatusResponse = DepositAddressStatusResponse | VaultSwapStatusResponse;
461
- export { };
346
+ };
347
+ }
348
+ interface Boost {
349
+ maxBoostFeeBps: number;
350
+ effectiveBoostFeeBps: number | undefined;
351
+ boostedAt: number | undefined;
352
+ boostedBlockIndex: string | undefined;
353
+ skippedAt: number | undefined;
354
+ skippedBlockIndex: string | undefined;
355
+ }
356
+ interface DepositChannelFields {
357
+ createdAt: number;
358
+ brokerCommissionBps: number;
359
+ depositAddress: string;
360
+ srcChainExpiryBlock: string;
361
+ estimatedExpiryTime: number;
362
+ expectedDepositAmount: string;
363
+ isExpired: boolean;
364
+ openedThroughBackend: boolean;
365
+ affiliateBrokers: AffiliateBroker[];
366
+ fillOrKillParams: FillOrKillParams | undefined;
367
+ dcaParams: DcaParameters | undefined;
368
+ }
369
+ interface DepositFields {
370
+ amount: string | undefined;
371
+ txRef: string | undefined;
372
+ txConfirmations: number | undefined;
373
+ receivedAt: number | undefined;
374
+ receivedBlockIndex: string | undefined;
375
+ failure: Failure | undefined;
376
+ }
377
+ interface SwapChunk {
378
+ swapInputAmount: string;
379
+ swapOutputAmount: string | undefined;
380
+ scheduledAt: number;
381
+ scheduledBlockIndex: string;
382
+ executedAt: number | undefined;
383
+ executedBlockIndex: string | undefined;
384
+ retryCount: number;
385
+ latestSwapRescheduledAt: number | undefined;
386
+ latestSwapRescheduledBlockIndex: number | undefined;
387
+ fees: SwapFee[];
388
+ isDca: false;
462
389
  }
390
+ interface SwapFields {
391
+ totalInputAmountSwapped: string | undefined;
392
+ totalOutputAmountSwapped: string | undefined;
393
+ totalChunksExecuted: number;
394
+ isDca: true;
395
+ lastExecutedChunk: SwapChunk | undefined;
396
+ currentChunk: SwapChunk;
397
+ type: SwapType;
398
+ fees: SwapFee[];
399
+ }
400
+ interface EgressFields {
401
+ amount: string;
402
+ scheduledAt: number;
403
+ scheduledBlockIndex: string;
404
+ txRef: string | undefined;
405
+ confirmedAt: number | undefined;
406
+ confirmedBlockIndex: string | undefined;
407
+ ignoredAmount: string | undefined;
408
+ failure: Failure | undefined;
409
+ failedAt: number | undefined;
410
+ failedBlockIndex: string | undefined;
411
+ }
412
+ interface SwapStatusResponseCommonFields extends ChainsAndAssets {
413
+ swapId: string;
414
+ destAddress: string;
415
+ ccm: Ccm | undefined;
416
+ boost: Boost | undefined;
417
+ estimatedDurationSeconds: number | null | undefined;
418
+ srcChainRequiredBlockConfirmations: number | null;
419
+ }
420
+ interface VaultSwapCommonFields extends Exclude<SwapStatusResponseCommonFields, 'boost'> {
421
+ }
422
+ interface ReceivingVaultSwap extends VaultSwapCommonFields {
423
+ deposit: Pick<DepositFields, 'amount' | 'txRef'>;
424
+ }
425
+ interface SwappingVaultSwap extends ReceivingVaultSwap {
426
+ swap: Exclude<SwapChunk, 'latestSwapRescheduledAt' | 'latestSwapRescheduledBlockIndex'> | undefined;
427
+ swapEgress: EgressFields | undefined;
428
+ }
429
+ interface SendingVaultSwap extends SwappingVaultSwap {
430
+ swapEgress: EgressFields | undefined;
431
+ }
432
+ interface DepositChannel extends SwapStatusResponseCommonFields {
433
+ depositChannel: DepositChannelFields;
434
+ }
435
+ interface Receiving extends DepositChannel {
436
+ deposit: DepositFields;
437
+ }
438
+ interface Swapping extends Receiving {
439
+ swap: SwapFields;
440
+ }
441
+ interface Sending extends Receiving {
442
+ swap: SwapFields;
443
+ swapEgress: EgressFields | undefined;
444
+ refundEgress: EgressFields | undefined;
445
+ }
446
+ type SwapState = ({
447
+ state: 'RECEIVING';
448
+ } & Receiving) | ({
449
+ state: 'SWAPPING';
450
+ } & Swapping) | ({
451
+ state: 'SENDING';
452
+ } & Sending) | ({
453
+ state: 'SENT';
454
+ } & Sending) | ({
455
+ state: 'COMPLETED';
456
+ } & Sending) | ({
457
+ state: 'FAILED';
458
+ } & Sending);
459
+ type DepositAddressStatusResponseV2 = SwapState;
460
+ type VaultSwapStatusResponseV2 = SwapState & SendingVaultSwap;
461
+ type SwapStatusResponseV2 = DepositAddressStatusResponseV2 | VaultSwapStatusResponseV2;
463
462
 
464
463
  type RequestOptions = {
465
464
  signal?: AbortSignal;
@@ -491,7 +490,7 @@ declare class SwapSDK {
491
490
  getQuote(quoteRequest: QuoteRequest, options?: RequestOptions): Promise<QuoteResponse>;
492
491
  requestDepositAddress(depositAddressRequest: DepositAddressRequest): Promise<DepositAddressResponse>;
493
492
  getStatus(swapStatusRequest: SwapStatusRequest, options?: RequestOptions): Promise<SwapStatusResponse>;
494
- getStatusV2(swapStatusRequest: SwapStatusRequest, options?: RequestOptions): Promise<SwapV2.SwapStatusResponse>;
493
+ getStatusV2(swapStatusRequest: SwapStatusRequest, options?: RequestOptions): Promise<SwapStatusResponseV2>;
495
494
  executeSwap(params: ExecuteSwapParams, txOpts?: TransactionOptions & {
496
495
  signer?: Signer;
497
496
  }): Promise<TransactionHash>;
@@ -514,4 +513,4 @@ declare class SwapSDK {
514
513
  }): Promise<BoostPoolDepth[]>;
515
514
  }
516
515
 
517
- export { Asset, type AssetData, type BoostPoolDepth, Chain, type ChainData, InternalAsset as ChainflipId, ChainflipNetwork, type ChainsAndAssets, type DepositAddressRequest, type DepositAddressResponse, type DepositAddressStatusResponse, type FailedVaultSwapStatusResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, SwapV2, type VaultSwapStatusResponse };
516
+ export { Asset, type AssetData, type BoostPoolDepth, Chain, type ChainData, InternalAsset as ChainflipId, ChainflipNetwork, type ChainsAndAssets, type DepositAddressRequest, type DepositAddressResponse, type DepositAddressStatusResponse, type DepositAddressStatusResponseV2, type FailedVaultSwapStatusResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, type SwapStatusResponseV2, type VaultSwapStatusResponse, type VaultSwapStatusResponseV2 };
package/dist/swap.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Signer } from 'ethers';
2
- import { C as Chain, A as Asset, a as AssetAndChain, I as InternalAsset, b as AssetOfChain, c as ChainflipNetwork, T as TransactionOptions, d as ChainAssetMap, e as ChainMap } from './contracts-50KY1eSc.js';
3
- export { g as Assets, h as ChainflipIds, i as ChainflipNetworks, f as Chains, U as UncheckedAssetAndChain, j as getChainflipId } from './contracts-50KY1eSc.js';
2
+ import { A as AssetAndChain, C as Chain, a as Asset, I as InternalAsset, b as AssetOfChain, c as ChainflipNetwork, T as TransactionOptions, d as ChainAssetMap, e as ChainMap } from './contracts-DmShvHR7.js';
3
+ export { g as Assets, h as ChainflipIds, i as ChainflipNetworks, f as Chains, U as UncheckedAssetAndChain, j as getChainflipId } from './contracts-DmShvHR7.js';
4
4
  import { z } from 'zod';
5
5
  import { SwapType } from '.prisma/client';
6
6
 
@@ -154,7 +154,7 @@ interface DepositAddressResponse extends DepositAddressRequest {
154
154
  interface SwapStatusRequest {
155
155
  id: string;
156
156
  }
157
- interface SwapStatusResponseCommonFields extends ChainsAndAssets {
157
+ interface SwapStatusResponseCommonFields$1 extends ChainsAndAssets {
158
158
  destAddress: string;
159
159
  ccmDepositReceivedBlockIndex: string | undefined;
160
160
  ccmParams: CcmParams | undefined;
@@ -167,7 +167,7 @@ interface SwapStatusResponseCommonFields extends ChainsAndAssets {
167
167
  depositTransactionHash: string | undefined;
168
168
  ccmMetadata?: CcmParams;
169
169
  }
170
- interface DepositAddressFields extends SwapStatusResponseCommonFields {
170
+ interface DepositAddressFields extends SwapStatusResponseCommonFields$1 {
171
171
  depositAddress: string;
172
172
  depositChannelCreatedAt: number;
173
173
  depositChannelBrokerCommissionBps: number;
@@ -205,7 +205,7 @@ type EgressScheduled = {
205
205
  type CopyFields<T, U> = {
206
206
  [K in Exclude<keyof T, keyof U>]: undefined;
207
207
  } & U;
208
- type VaultSwapFields = CopyFields<DepositAddressFields, SwapStatusResponseCommonFields>;
208
+ type VaultSwapFields = CopyFields<DepositAddressFields, SwapStatusResponseCommonFields$1>;
209
209
  type FailedVaultSwapStatusResponse = CopyFields<DepositAddressFields, {
210
210
  depositAmount: string;
211
211
  destAddress: string;
@@ -222,7 +222,7 @@ type FailedVaultSwapStatusResponse = CopyFields<DepositAddressFields, {
222
222
  state: 'FAILED';
223
223
  depositAddress: undefined;
224
224
  }>;
225
- type SwapState = {
225
+ type SwapState$1 = {
226
226
  state: 'AWAITING_DEPOSIT';
227
227
  depositAmount: string | undefined;
228
228
  depositTransactionConfirmations: number | undefined;
@@ -309,8 +309,8 @@ type SwapState = {
309
309
  egressIgnoredAt: number;
310
310
  egressIgnoredBlockIndex: string;
311
311
  };
312
- type DepositAddressStatusResponse = DepositAddressFields & SwapState;
313
- type VaultSwapStatusResponse = VaultSwapFields & SwapState;
312
+ type DepositAddressStatusResponse = DepositAddressFields & SwapState$1;
313
+ type VaultSwapStatusResponse = VaultSwapFields & SwapState$1;
314
314
  type SwapStatusResponse = DepositAddressStatusResponse | VaultSwapStatusResponse | FailedVaultSwapStatusResponse;
315
315
  type BoostPoolDepth = {
316
316
  feeTierBps: number;
@@ -326,140 +326,139 @@ declare enum FailureMode {
326
326
  BroadcastAborted = "SENDING_FAILED"
327
327
  }
328
328
 
329
- declare namespace SwapV2 {
330
- interface DcaParameters {
331
- numberOfChunks: number;
332
- chunkIntervalBlocks: string;
333
- }
334
- interface Ccm {
329
+ interface DcaParameters {
330
+ numberOfChunks: number;
331
+ chunkIntervalBlocks: string;
332
+ }
333
+ interface Ccm {
334
+ message: string;
335
+ gasBudget: string;
336
+ cfParameters: string | undefined;
337
+ ccmDepositReceivedBlockIndex: string | undefined;
338
+ }
339
+ interface Failure {
340
+ failedAt: number;
341
+ failedBlockIndex: string;
342
+ mode: FailureMode;
343
+ reason: {
344
+ code: string;
335
345
  message: string;
336
- gasBudget: string;
337
- cfParameters: string | undefined;
338
- ccmDepositReceivedBlockIndex: string | undefined;
339
- }
340
- interface Failure {
341
- failedAt: number;
342
- failedAtBlockIndex: string;
343
- mode: FailureMode;
344
- reason: {
345
- code: string;
346
- message: string;
347
- };
348
- }
349
- interface Boost {
350
- maxBoostFeeBps: number;
351
- effectiveBoostFeeBps: number | undefined;
352
- boostedAt: number | undefined;
353
- boostedBlockIndex: string | undefined;
354
- skippedAt: number | undefined;
355
- skippedBlockIndex: string | undefined;
356
- }
357
- interface DepositChannelFields {
358
- createdAt: number;
359
- brokerCommissionBps: number;
360
- depositAddress: string;
361
- srcChainExpiryBlock: string;
362
- estimatedExpiryTime: number;
363
- expectedDepositAmount: string;
364
- isExpired: boolean;
365
- openedThroughBackend: boolean;
366
- affiliateBrokers: AffiliateBroker[];
367
- fillOrKillParams: FillOrKillParams | undefined;
368
- dcaParams: DcaParameters | undefined;
369
- srcChainRequiredBlockConfirmations: number | null | undefined;
370
- }
371
- interface DepositFields {
372
- amount: string | undefined;
373
- txRef: string | undefined;
374
- txConfirmations: number | undefined;
375
- receivedAt: number | undefined;
376
- receivedBlockIndex: string | undefined;
377
- failure: Failure | undefined;
378
- }
379
- interface SwapChunk {
380
- swapInputAmount: string;
381
- swapOutputAmount: string | undefined;
382
- scheduledAt: number;
383
- scheduledBlockIndex: string;
384
- executedAt: number | undefined;
385
- executedBlockIndex: string | undefined;
386
- retryCount: number;
387
- latestSwapRescheduledAt: number | undefined;
388
- latestSwapRescheduledBlockIndex: number | undefined;
389
- fees: SwapFee[];
390
- }
391
- interface SwapFields {
392
- totalInputAmountSwapped: string | undefined;
393
- totalOutputAmountSwapped: string | undefined;
394
- totalChunksExecuted: number;
395
- isDcaSwap: boolean;
396
- lastExecutedChunk: SwapChunk | undefined;
397
- currentChunk: SwapChunk;
398
- type: SwapType;
399
- fees: SwapFee[];
400
- }
401
- interface EgressFields {
402
- amount: string;
403
- scheduledAt: number;
404
- scheduledBlockIndex: string;
405
- sentTxRef: string | undefined;
406
- sentAt: number | undefined;
407
- sentAtBlockIndex: string | undefined;
408
- ignoredAmount: string | undefined;
409
- failure: Failure | undefined;
410
- }
411
- interface SwapStatusResponseCommonFields extends ChainsAndAssets {
412
- swapId: string;
413
- destAddress: string;
414
- depositChannel: DepositChannelFields;
415
- ccm: Ccm | undefined;
416
- boost: Boost | undefined;
417
- estimatedDurationSeconds: number | null | undefined;
418
- }
419
- interface VaultSwapCommonFields extends Exclude<SwapStatusResponseCommonFields, 'depositChannel' | 'boost'> {
420
- }
421
- interface ReceivingVaultSwap extends VaultSwapCommonFields {
422
- deposit: Pick<DepositFields, 'amount' | 'txRef'>;
423
- }
424
- interface SwappingVaultSwap extends ReceivingVaultSwap {
425
- swap: Exclude<SwapChunk, 'latestSwapRescheduledAt' | 'latestSwapRescheduledBlockIndex'> | undefined;
426
- swapEgress: EgressFields | undefined;
427
- }
428
- interface SendingVaultSwap extends SwappingVaultSwap {
429
- swapEgress: EgressFields | undefined;
430
- }
431
- interface DepositChannel extends SwapStatusResponseCommonFields {
432
- depositChannel: DepositChannelFields;
433
- }
434
- interface Receiving extends DepositChannel {
435
- deposit: DepositFields;
436
- }
437
- interface Swapping extends Receiving {
438
- swap: SwapFields;
439
- }
440
- interface Sending extends Receiving {
441
- swap: SwapFields;
442
- swapEgress: EgressFields | undefined;
443
- refundEgress: EgressFields | undefined;
444
- }
445
- type SwapState = ({
446
- state: 'RECEIVING';
447
- } & Receiving) | ({
448
- state: 'SWAPPING';
449
- } & Swapping) | ({
450
- state: 'SENDING';
451
- } & Sending) | ({
452
- state: 'SENT';
453
- } & Sending) | ({
454
- state: 'COMPLETED';
455
- } & Sending) | ({
456
- state: 'FAILED';
457
- } & Sending);
458
- export type DepositAddressStatusResponse = SwapState;
459
- export type VaultSwapStatusResponse = SwapState & SendingVaultSwap;
460
- export type SwapStatusResponse = DepositAddressStatusResponse | VaultSwapStatusResponse;
461
- export { };
346
+ };
347
+ }
348
+ interface Boost {
349
+ maxBoostFeeBps: number;
350
+ effectiveBoostFeeBps: number | undefined;
351
+ boostedAt: number | undefined;
352
+ boostedBlockIndex: string | undefined;
353
+ skippedAt: number | undefined;
354
+ skippedBlockIndex: string | undefined;
355
+ }
356
+ interface DepositChannelFields {
357
+ createdAt: number;
358
+ brokerCommissionBps: number;
359
+ depositAddress: string;
360
+ srcChainExpiryBlock: string;
361
+ estimatedExpiryTime: number;
362
+ expectedDepositAmount: string;
363
+ isExpired: boolean;
364
+ openedThroughBackend: boolean;
365
+ affiliateBrokers: AffiliateBroker[];
366
+ fillOrKillParams: FillOrKillParams | undefined;
367
+ dcaParams: DcaParameters | undefined;
368
+ }
369
+ interface DepositFields {
370
+ amount: string | undefined;
371
+ txRef: string | undefined;
372
+ txConfirmations: number | undefined;
373
+ receivedAt: number | undefined;
374
+ receivedBlockIndex: string | undefined;
375
+ failure: Failure | undefined;
376
+ }
377
+ interface SwapChunk {
378
+ swapInputAmount: string;
379
+ swapOutputAmount: string | undefined;
380
+ scheduledAt: number;
381
+ scheduledBlockIndex: string;
382
+ executedAt: number | undefined;
383
+ executedBlockIndex: string | undefined;
384
+ retryCount: number;
385
+ latestSwapRescheduledAt: number | undefined;
386
+ latestSwapRescheduledBlockIndex: number | undefined;
387
+ fees: SwapFee[];
388
+ isDca: false;
462
389
  }
390
+ interface SwapFields {
391
+ totalInputAmountSwapped: string | undefined;
392
+ totalOutputAmountSwapped: string | undefined;
393
+ totalChunksExecuted: number;
394
+ isDca: true;
395
+ lastExecutedChunk: SwapChunk | undefined;
396
+ currentChunk: SwapChunk;
397
+ type: SwapType;
398
+ fees: SwapFee[];
399
+ }
400
+ interface EgressFields {
401
+ amount: string;
402
+ scheduledAt: number;
403
+ scheduledBlockIndex: string;
404
+ txRef: string | undefined;
405
+ confirmedAt: number | undefined;
406
+ confirmedBlockIndex: string | undefined;
407
+ ignoredAmount: string | undefined;
408
+ failure: Failure | undefined;
409
+ failedAt: number | undefined;
410
+ failedBlockIndex: string | undefined;
411
+ }
412
+ interface SwapStatusResponseCommonFields extends ChainsAndAssets {
413
+ swapId: string;
414
+ destAddress: string;
415
+ ccm: Ccm | undefined;
416
+ boost: Boost | undefined;
417
+ estimatedDurationSeconds: number | null | undefined;
418
+ srcChainRequiredBlockConfirmations: number | null;
419
+ }
420
+ interface VaultSwapCommonFields extends Exclude<SwapStatusResponseCommonFields, 'boost'> {
421
+ }
422
+ interface ReceivingVaultSwap extends VaultSwapCommonFields {
423
+ deposit: Pick<DepositFields, 'amount' | 'txRef'>;
424
+ }
425
+ interface SwappingVaultSwap extends ReceivingVaultSwap {
426
+ swap: Exclude<SwapChunk, 'latestSwapRescheduledAt' | 'latestSwapRescheduledBlockIndex'> | undefined;
427
+ swapEgress: EgressFields | undefined;
428
+ }
429
+ interface SendingVaultSwap extends SwappingVaultSwap {
430
+ swapEgress: EgressFields | undefined;
431
+ }
432
+ interface DepositChannel extends SwapStatusResponseCommonFields {
433
+ depositChannel: DepositChannelFields;
434
+ }
435
+ interface Receiving extends DepositChannel {
436
+ deposit: DepositFields;
437
+ }
438
+ interface Swapping extends Receiving {
439
+ swap: SwapFields;
440
+ }
441
+ interface Sending extends Receiving {
442
+ swap: SwapFields;
443
+ swapEgress: EgressFields | undefined;
444
+ refundEgress: EgressFields | undefined;
445
+ }
446
+ type SwapState = ({
447
+ state: 'RECEIVING';
448
+ } & Receiving) | ({
449
+ state: 'SWAPPING';
450
+ } & Swapping) | ({
451
+ state: 'SENDING';
452
+ } & Sending) | ({
453
+ state: 'SENT';
454
+ } & Sending) | ({
455
+ state: 'COMPLETED';
456
+ } & Sending) | ({
457
+ state: 'FAILED';
458
+ } & Sending);
459
+ type DepositAddressStatusResponseV2 = SwapState;
460
+ type VaultSwapStatusResponseV2 = SwapState & SendingVaultSwap;
461
+ type SwapStatusResponseV2 = DepositAddressStatusResponseV2 | VaultSwapStatusResponseV2;
463
462
 
464
463
  type RequestOptions = {
465
464
  signal?: AbortSignal;
@@ -491,7 +490,7 @@ declare class SwapSDK {
491
490
  getQuote(quoteRequest: QuoteRequest, options?: RequestOptions): Promise<QuoteResponse>;
492
491
  requestDepositAddress(depositAddressRequest: DepositAddressRequest): Promise<DepositAddressResponse>;
493
492
  getStatus(swapStatusRequest: SwapStatusRequest, options?: RequestOptions): Promise<SwapStatusResponse>;
494
- getStatusV2(swapStatusRequest: SwapStatusRequest, options?: RequestOptions): Promise<SwapV2.SwapStatusResponse>;
493
+ getStatusV2(swapStatusRequest: SwapStatusRequest, options?: RequestOptions): Promise<SwapStatusResponseV2>;
495
494
  executeSwap(params: ExecuteSwapParams, txOpts?: TransactionOptions & {
496
495
  signer?: Signer;
497
496
  }): Promise<TransactionHash>;
@@ -514,4 +513,4 @@ declare class SwapSDK {
514
513
  }): Promise<BoostPoolDepth[]>;
515
514
  }
516
515
 
517
- export { Asset, type AssetData, type BoostPoolDepth, Chain, type ChainData, InternalAsset as ChainflipId, ChainflipNetwork, type ChainsAndAssets, type DepositAddressRequest, type DepositAddressResponse, type DepositAddressStatusResponse, type FailedVaultSwapStatusResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, SwapV2, type VaultSwapStatusResponse };
516
+ export { Asset, type AssetData, type BoostPoolDepth, Chain, type ChainData, InternalAsset as ChainflipId, ChainflipNetwork, type ChainsAndAssets, type DepositAddressRequest, type DepositAddressResponse, type DepositAddressStatusResponse, type DepositAddressStatusResponseV2, type FailedVaultSwapStatusResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, type SwapStatusResponseV2, type VaultSwapStatusResponse, type VaultSwapStatusResponseV2 };
package/dist/swap.js CHANGED
@@ -10029,7 +10029,7 @@ var getChainData = /* @__PURE__ */ __name((chain2, network, env) => ({
10029
10029
  }), "getChainData");
10030
10030
 
10031
10031
  // package.json
10032
- var version = "1.6.0-alpha.3";
10032
+ var version = "1.6.0-alpha.5";
10033
10033
 
10034
10034
  // src/swap/consts.ts
10035
10035
  var CF_SDK_VERSION_HEADERS = {
package/dist/swap.mjs CHANGED
@@ -8307,7 +8307,7 @@ var getChainData = /* @__PURE__ */ __name((chain2, network, env) => ({
8307
8307
  }), "getChainData");
8308
8308
 
8309
8309
  // package.json
8310
- var version = "1.6.0-alpha.3";
8310
+ var version = "1.6.0-alpha.5";
8311
8311
 
8312
8312
  // src/swap/consts.ts
8313
8313
  var CF_SDK_VERSION_HEADERS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/sdk",
3
- "version": "1.6.0-alpha.3",
3
+ "version": "1.6.0-alpha.5",
4
4
  "description": "",
5
5
  "exports": {
6
6
  "./swap": {