@chainflip/sdk 1.6.0-alpha.4 → 1.6.0-alpha.6

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.d.mts CHANGED
@@ -64,6 +64,7 @@ type Fee<T> = {
64
64
  };
65
65
  type SwapFee = Fee<'NETWORK' | 'INGRESS' | 'EGRESS' | 'BROKER' | 'BOOST'>;
66
66
  type PoolFee = Fee<'LIQUIDITY'>;
67
+ type PaidFee = SwapFee | PoolFee;
67
68
  type PoolInfo = {
68
69
  baseAsset: AssetAndChain;
69
70
  quoteAsset: AssetAndChain;
@@ -338,7 +339,7 @@ interface Ccm {
338
339
  }
339
340
  interface Failure {
340
341
  failedAt: number;
341
- failedAtBlockIndex: string;
342
+ failedBlockIndex: string;
342
343
  mode: FailureMode;
343
344
  reason: {
344
345
  code: string;
@@ -354,6 +355,7 @@ interface Boost {
354
355
  skippedBlockIndex: string | undefined;
355
356
  }
356
357
  interface DepositChannelFields {
358
+ id: string;
357
359
  createdAt: number;
358
360
  brokerCommissionBps: number;
359
361
  depositAddress: string;
@@ -365,15 +367,16 @@ interface DepositChannelFields {
365
367
  affiliateBrokers: AffiliateBroker[];
366
368
  fillOrKillParams: FillOrKillParams | undefined;
367
369
  dcaParams: DcaParameters | undefined;
368
- srcChainRequiredBlockConfirmations: number | null | undefined;
369
370
  }
370
371
  interface DepositFields {
371
- amount: string | undefined;
372
+ amount: string;
372
373
  txRef: string | undefined;
373
374
  txConfirmations: number | undefined;
374
375
  receivedAt: number | undefined;
375
376
  receivedBlockIndex: string | undefined;
376
377
  failure: Failure | undefined;
378
+ failedAt: number | undefined;
379
+ failedBlockIndex: string | undefined;
377
380
  }
378
381
  interface SwapChunk {
379
382
  swapInputAmount: string;
@@ -385,27 +388,30 @@ interface SwapChunk {
385
388
  retryCount: number;
386
389
  latestSwapRescheduledAt: number | undefined;
387
390
  latestSwapRescheduledBlockIndex: number | undefined;
388
- fees: SwapFee[];
391
+ fees: PaidFee[];
392
+ isDca: false;
389
393
  }
390
394
  interface SwapFields {
391
395
  totalInputAmountSwapped: string | undefined;
392
396
  totalOutputAmountSwapped: string | undefined;
393
397
  totalChunksExecuted: number;
394
- isDcaSwap: boolean;
398
+ isDca: true;
395
399
  lastExecutedChunk: SwapChunk | undefined;
396
400
  currentChunk: SwapChunk;
397
401
  type: SwapType;
398
- fees: SwapFee[];
402
+ fees: PaidFee[];
399
403
  }
400
404
  interface EgressFields {
401
405
  amount: string;
402
406
  scheduledAt: number;
403
407
  scheduledBlockIndex: string;
404
- sentTxRef: string | undefined;
405
- sentAt: number | undefined;
406
- sentAtBlockIndex: string | undefined;
408
+ txRef: string | undefined;
409
+ confirmedAt: number | undefined;
410
+ confirmedBlockIndex: string | undefined;
407
411
  ignoredAmount: string | undefined;
408
412
  failure: Failure | undefined;
413
+ failedAt: number | undefined;
414
+ failedBlockIndex: string | undefined;
409
415
  }
410
416
  interface SwapStatusResponseCommonFields extends ChainsAndAssets {
411
417
  swapId: string;
@@ -413,11 +419,12 @@ interface SwapStatusResponseCommonFields extends ChainsAndAssets {
413
419
  ccm: Ccm | undefined;
414
420
  boost: Boost | undefined;
415
421
  estimatedDurationSeconds: number | null | undefined;
422
+ srcChainRequiredBlockConfirmations: number | null;
416
423
  }
417
424
  interface VaultSwapCommonFields extends Exclude<SwapStatusResponseCommonFields, 'boost'> {
418
425
  }
419
426
  interface ReceivingVaultSwap extends VaultSwapCommonFields {
420
- deposit: Pick<DepositFields, 'amount' | 'txRef'>;
427
+ deposit: DepositFields;
421
428
  }
422
429
  interface SwappingVaultSwap extends ReceivingVaultSwap {
423
430
  swap: Exclude<SwapChunk, 'latestSwapRescheduledAt' | 'latestSwapRescheduledBlockIndex'> | undefined;
@@ -441,6 +448,8 @@ interface Sending extends Receiving {
441
448
  refundEgress: EgressFields | undefined;
442
449
  }
443
450
  type SwapState = ({
451
+ state: 'WAITING';
452
+ } & DepositChannel) | ({
444
453
  state: 'RECEIVING';
445
454
  } & Receiving) | ({
446
455
  state: 'SWAPPING';
package/dist/swap.d.ts CHANGED
@@ -64,6 +64,7 @@ type Fee<T> = {
64
64
  };
65
65
  type SwapFee = Fee<'NETWORK' | 'INGRESS' | 'EGRESS' | 'BROKER' | 'BOOST'>;
66
66
  type PoolFee = Fee<'LIQUIDITY'>;
67
+ type PaidFee = SwapFee | PoolFee;
67
68
  type PoolInfo = {
68
69
  baseAsset: AssetAndChain;
69
70
  quoteAsset: AssetAndChain;
@@ -338,7 +339,7 @@ interface Ccm {
338
339
  }
339
340
  interface Failure {
340
341
  failedAt: number;
341
- failedAtBlockIndex: string;
342
+ failedBlockIndex: string;
342
343
  mode: FailureMode;
343
344
  reason: {
344
345
  code: string;
@@ -354,6 +355,7 @@ interface Boost {
354
355
  skippedBlockIndex: string | undefined;
355
356
  }
356
357
  interface DepositChannelFields {
358
+ id: string;
357
359
  createdAt: number;
358
360
  brokerCommissionBps: number;
359
361
  depositAddress: string;
@@ -365,15 +367,16 @@ interface DepositChannelFields {
365
367
  affiliateBrokers: AffiliateBroker[];
366
368
  fillOrKillParams: FillOrKillParams | undefined;
367
369
  dcaParams: DcaParameters | undefined;
368
- srcChainRequiredBlockConfirmations: number | null | undefined;
369
370
  }
370
371
  interface DepositFields {
371
- amount: string | undefined;
372
+ amount: string;
372
373
  txRef: string | undefined;
373
374
  txConfirmations: number | undefined;
374
375
  receivedAt: number | undefined;
375
376
  receivedBlockIndex: string | undefined;
376
377
  failure: Failure | undefined;
378
+ failedAt: number | undefined;
379
+ failedBlockIndex: string | undefined;
377
380
  }
378
381
  interface SwapChunk {
379
382
  swapInputAmount: string;
@@ -385,27 +388,30 @@ interface SwapChunk {
385
388
  retryCount: number;
386
389
  latestSwapRescheduledAt: number | undefined;
387
390
  latestSwapRescheduledBlockIndex: number | undefined;
388
- fees: SwapFee[];
391
+ fees: PaidFee[];
392
+ isDca: false;
389
393
  }
390
394
  interface SwapFields {
391
395
  totalInputAmountSwapped: string | undefined;
392
396
  totalOutputAmountSwapped: string | undefined;
393
397
  totalChunksExecuted: number;
394
- isDcaSwap: boolean;
398
+ isDca: true;
395
399
  lastExecutedChunk: SwapChunk | undefined;
396
400
  currentChunk: SwapChunk;
397
401
  type: SwapType;
398
- fees: SwapFee[];
402
+ fees: PaidFee[];
399
403
  }
400
404
  interface EgressFields {
401
405
  amount: string;
402
406
  scheduledAt: number;
403
407
  scheduledBlockIndex: string;
404
- sentTxRef: string | undefined;
405
- sentAt: number | undefined;
406
- sentAtBlockIndex: string | undefined;
408
+ txRef: string | undefined;
409
+ confirmedAt: number | undefined;
410
+ confirmedBlockIndex: string | undefined;
407
411
  ignoredAmount: string | undefined;
408
412
  failure: Failure | undefined;
413
+ failedAt: number | undefined;
414
+ failedBlockIndex: string | undefined;
409
415
  }
410
416
  interface SwapStatusResponseCommonFields extends ChainsAndAssets {
411
417
  swapId: string;
@@ -413,11 +419,12 @@ interface SwapStatusResponseCommonFields extends ChainsAndAssets {
413
419
  ccm: Ccm | undefined;
414
420
  boost: Boost | undefined;
415
421
  estimatedDurationSeconds: number | null | undefined;
422
+ srcChainRequiredBlockConfirmations: number | null;
416
423
  }
417
424
  interface VaultSwapCommonFields extends Exclude<SwapStatusResponseCommonFields, 'boost'> {
418
425
  }
419
426
  interface ReceivingVaultSwap extends VaultSwapCommonFields {
420
- deposit: Pick<DepositFields, 'amount' | 'txRef'>;
427
+ deposit: DepositFields;
421
428
  }
422
429
  interface SwappingVaultSwap extends ReceivingVaultSwap {
423
430
  swap: Exclude<SwapChunk, 'latestSwapRescheduledAt' | 'latestSwapRescheduledBlockIndex'> | undefined;
@@ -441,6 +448,8 @@ interface Sending extends Receiving {
441
448
  refundEgress: EgressFields | undefined;
442
449
  }
443
450
  type SwapState = ({
451
+ state: 'WAITING';
452
+ } & DepositChannel) | ({
444
453
  state: 'RECEIVING';
445
454
  } & Receiving) | ({
446
455
  state: 'SWAPPING';
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.4";
10032
+ var version = "1.6.0-alpha.6";
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.4";
8310
+ var version = "1.6.0-alpha.6";
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.4",
3
+ "version": "1.6.0-alpha.6",
4
4
  "description": "",
5
5
  "exports": {
6
6
  "./swap": {