@atomiqlabs/base 13.4.0 → 13.5.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.
Files changed (37) hide show
  1. package/dist/chains/ChainData.d.ts +11 -0
  2. package/dist/chains/ChainInterface.d.ts +6 -0
  3. package/dist/events/types/ChainEvent.d.ts +5 -0
  4. package/dist/events/types/ChainEvent.js +3 -0
  5. package/dist/events/types/spv_vault/SpvVaultClaimEvent.d.ts +1 -1
  6. package/dist/events/types/spv_vault/SpvVaultClaimEvent.js +2 -2
  7. package/dist/events/types/spv_vault/SpvVaultCloseEvent.d.ts +1 -1
  8. package/dist/events/types/spv_vault/SpvVaultCloseEvent.js +2 -2
  9. package/dist/events/types/spv_vault/SpvVaultDepositEvent.d.ts +1 -1
  10. package/dist/events/types/spv_vault/SpvVaultDepositEvent.js +2 -2
  11. package/dist/events/types/spv_vault/SpvVaultEvent.d.ts +1 -1
  12. package/dist/events/types/spv_vault/SpvVaultEvent.js +2 -2
  13. package/dist/events/types/spv_vault/SpvVaultFrontEvent.d.ts +1 -1
  14. package/dist/events/types/spv_vault/SpvVaultFrontEvent.js +2 -2
  15. package/dist/events/types/spv_vault/SpvVaultOpenEvent.d.ts +1 -1
  16. package/dist/events/types/spv_vault/SpvVaultOpenEvent.js +2 -2
  17. package/dist/events/types/swap/ClaimEvent.d.ts +1 -1
  18. package/dist/events/types/swap/ClaimEvent.js +2 -2
  19. package/dist/events/types/swap/InitializeEvent.d.ts +1 -1
  20. package/dist/events/types/swap/InitializeEvent.js +2 -2
  21. package/dist/events/types/swap/SwapEvent.d.ts +1 -1
  22. package/dist/events/types/swap/SwapEvent.js +2 -2
  23. package/dist/swaps/SwapCommitState.d.ts +5 -0
  24. package/package.json +1 -1
  25. package/src/chains/ChainData.ts +13 -1
  26. package/src/chains/ChainInterface.ts +7 -0
  27. package/src/events/types/ChainEvent.ts +9 -0
  28. package/src/events/types/spv_vault/SpvVaultClaimEvent.ts +3 -2
  29. package/src/events/types/spv_vault/SpvVaultCloseEvent.ts +2 -2
  30. package/src/events/types/spv_vault/SpvVaultDepositEvent.ts +2 -2
  31. package/src/events/types/spv_vault/SpvVaultEvent.ts +2 -2
  32. package/src/events/types/spv_vault/SpvVaultFrontEvent.ts +2 -2
  33. package/src/events/types/spv_vault/SpvVaultOpenEvent.ts +2 -2
  34. package/src/events/types/swap/ClaimEvent.ts +2 -2
  35. package/src/events/types/swap/InitializeEvent.ts +2 -2
  36. package/src/events/types/swap/SwapEvent.ts +2 -2
  37. package/src/swaps/SwapCommitState.ts +7 -2
@@ -30,6 +30,17 @@ export type ChainData<T extends ChainType> = {
30
30
  spvVaultContract: T["SpvVaultContract"];
31
31
  spvVaultDataConstructor: new (data: any) => T["SpvVaultData"];
32
32
  spvVaultWithdrawalDataConstructor: new (data: any) => T["SpvVaultWithdrawalData"];
33
+ defaultVersion?: string;
34
+ versions?: {
35
+ [contractVersion: string]: {
36
+ btcRelay: T["BtcRelay"];
37
+ swapContract: T["Contract"];
38
+ swapDataConstructor: new (data: any) => T["Data"];
39
+ spvVaultContract: T["SpvVaultContract"];
40
+ spvVaultDataConstructor: new (data: any) => T["SpvVaultData"];
41
+ spvVaultWithdrawalDataConstructor: new (data: any) => T["SpvVaultWithdrawalData"];
42
+ };
43
+ };
33
44
  };
34
45
  /**
35
46
  * An initializer function that returns populated {@link ChainData} for a given chain based on the passed
@@ -119,6 +119,12 @@ export interface ChainInterface<TX = any, SignedTX = any, Signer extends Abstrac
119
119
  * @param txData Serialized transaction data string
120
120
  */
121
121
  deserializeSignedTx(txData: string): Promise<SignedTX>;
122
+ /**
123
+ * Returns the transaction ID of the signed transaction
124
+ *
125
+ * @param signedTX Signed transaction to get the transaction ID of
126
+ */
127
+ getTxId?(signedTX: SignedTX): Promise<string>;
122
128
  /**
123
129
  * Returns the status of the given serialized transaction
124
130
  *
@@ -12,4 +12,9 @@ export declare class ChainEvent<T extends SwapData> {
12
12
  blockTime: number;
13
13
  txId: string;
14
14
  };
15
+ /**
16
+ * Version of the contract that emitted the event
17
+ */
18
+ contractVersion?: string;
19
+ constructor(contractVersion?: string);
15
20
  }
@@ -7,5 +7,8 @@ exports.ChainEvent = void 0;
7
7
  * @category Events
8
8
  */
9
9
  class ChainEvent {
10
+ constructor(contractVersion) {
11
+ this.contractVersion = contractVersion;
12
+ }
10
13
  }
11
14
  exports.ChainEvent = ChainEvent;
@@ -37,5 +37,5 @@ export declare class SpvVaultClaimEvent extends SpvVaultEvent<SpvVaultEventType.
37
37
  * The sequence of this claim (withdrawal) - i.e. the total number of deposits done before this one
38
38
  */
39
39
  withdrawCount: number;
40
- constructor(owner: string, vaultId: bigint, btcTxId: string, recipient: string, executionHash: string, amounts: bigint[], caller: string, frontingAddress: string, withdrawCount: number);
40
+ constructor(owner: string, vaultId: bigint, btcTxId: string, recipient: string, executionHash: string, amounts: bigint[], caller: string, frontingAddress: string, withdrawCount: number, contractVersion?: string);
41
41
  }
@@ -8,8 +8,8 @@ const SpvVaultEvent_1 = require("./SpvVaultEvent");
8
8
  * @category Events
9
9
  */
10
10
  class SpvVaultClaimEvent extends SpvVaultEvent_1.SpvVaultEvent {
11
- constructor(owner, vaultId, btcTxId, recipient, executionHash, amounts, caller, frontingAddress, withdrawCount) {
12
- super(owner, vaultId);
11
+ constructor(owner, vaultId, btcTxId, recipient, executionHash, amounts, caller, frontingAddress, withdrawCount, contractVersion) {
12
+ super(owner, vaultId, contractVersion);
13
13
  this.eventType = SpvVaultEvent_1.SpvVaultEventType.CLAIM;
14
14
  this.btcTxId = btcTxId;
15
15
  this.recipient = recipient;
@@ -16,5 +16,5 @@ export declare class SpvVaultCloseEvent extends SpvVaultEvent<SpvVaultEventType.
16
16
  * A representation of the actual error that has happened
17
17
  */
18
18
  error: string;
19
- constructor(owner: string, vaultId: bigint, btcTxId: string, error: string);
19
+ constructor(owner: string, vaultId: bigint, btcTxId: string, error: string, contractVersion?: string);
20
20
  }
@@ -10,8 +10,8 @@ const SpvVaultEvent_1 = require("./SpvVaultEvent");
10
10
  * @category Events
11
11
  */
12
12
  class SpvVaultCloseEvent extends SpvVaultEvent_1.SpvVaultEvent {
13
- constructor(owner, vaultId, btcTxId, error) {
14
- super(owner, vaultId);
13
+ constructor(owner, vaultId, btcTxId, error, contractVersion) {
14
+ super(owner, vaultId, contractVersion);
15
15
  this.eventType = SpvVaultEvent_1.SpvVaultEventType.CLOSE;
16
16
  this.btcTxId = btcTxId;
17
17
  this.error = error;
@@ -15,5 +15,5 @@ export declare class SpvVaultDepositEvent extends SpvVaultEvent<SpvVaultEventTyp
15
15
  * The sequence of this deposit - i.e. the total number of deposits done before this one
16
16
  */
17
17
  depositCount: number;
18
- constructor(owner: string, vaultId: bigint, amounts: bigint[], depositCount: number);
18
+ constructor(owner: string, vaultId: bigint, amounts: bigint[], depositCount: number, contractVersion?: string);
19
19
  }
@@ -8,8 +8,8 @@ const SpvVaultEvent_1 = require("./SpvVaultEvent");
8
8
  * @category Events
9
9
  */
10
10
  class SpvVaultDepositEvent extends SpvVaultEvent_1.SpvVaultEvent {
11
- constructor(owner, vaultId, amounts, depositCount) {
12
- super(owner, vaultId);
11
+ constructor(owner, vaultId, amounts, depositCount, contractVersion) {
12
+ super(owner, vaultId, contractVersion);
13
13
  this.eventType = SpvVaultEvent_1.SpvVaultEventType.DEPOSIT;
14
14
  this.amounts = amounts;
15
15
  this.depositCount = depositCount;
@@ -27,5 +27,5 @@ export declare abstract class SpvVaultEvent<C extends SpvVaultEventType = SpvVau
27
27
  * ID of the SPV vault (UTXO-controlled vault)
28
28
  */
29
29
  vaultId: bigint;
30
- constructor(owner: string, vaultId: bigint);
30
+ constructor(owner: string, vaultId: bigint, contractVersion?: string);
31
31
  }
@@ -21,8 +21,8 @@ var SpvVaultEventType;
21
21
  * @category Events
22
22
  */
23
23
  class SpvVaultEvent extends ChainEvent_1.ChainEvent {
24
- constructor(owner, vaultId) {
25
- super();
24
+ constructor(owner, vaultId, contractVersion) {
25
+ super(contractVersion);
26
26
  this.owner = owner;
27
27
  this.vaultId = vaultId;
28
28
  }
@@ -28,5 +28,5 @@ export declare class SpvVaultFrontEvent extends SpvVaultEvent<SpvVaultEventType.
28
28
  * Address of the party which fronted the withdrawal
29
29
  */
30
30
  frontingAddress: string;
31
- constructor(owner: string, vaultId: bigint, btcTxId: string, recipient: string, executionHash: string, amounts: bigint[], frontingAddress: string);
31
+ constructor(owner: string, vaultId: bigint, btcTxId: string, recipient: string, executionHash: string, amounts: bigint[], frontingAddress: string, contractVersion?: string);
32
32
  }
@@ -8,8 +8,8 @@ const SpvVaultEvent_1 = require("./SpvVaultEvent");
8
8
  * @category Events
9
9
  */
10
10
  class SpvVaultFrontEvent extends SpvVaultEvent_1.SpvVaultEvent {
11
- constructor(owner, vaultId, btcTxId, recipient, executionHash, amounts, frontingAddress) {
12
- super(owner, vaultId);
11
+ constructor(owner, vaultId, btcTxId, recipient, executionHash, amounts, frontingAddress, contractVersion) {
12
+ super(owner, vaultId, contractVersion);
13
13
  this.eventType = SpvVaultEvent_1.SpvVaultEventType.FRONT;
14
14
  this.btcTxId = btcTxId;
15
15
  this.recipient = recipient;
@@ -14,5 +14,5 @@ export declare class SpvVaultOpenEvent extends SpvVaultEvent<SpvVaultEventType.O
14
14
  * Vault ownership utxo transaction vout
15
15
  */
16
16
  vout: number;
17
- constructor(owner: string, vaultId: bigint, btcTxId: string, vout: number);
17
+ constructor(owner: string, vaultId: bigint, btcTxId: string, vout: number, contractVersion?: string);
18
18
  }
@@ -8,8 +8,8 @@ const SpvVaultEvent_1 = require("./SpvVaultEvent");
8
8
  * @category Events
9
9
  */
10
10
  class SpvVaultOpenEvent extends SpvVaultEvent_1.SpvVaultEvent {
11
- constructor(owner, vaultId, btcTxId, vout) {
12
- super(owner, vaultId);
11
+ constructor(owner, vaultId, btcTxId, vout, contractVersion) {
12
+ super(owner, vaultId, contractVersion);
13
13
  this.eventType = SpvVaultEvent_1.SpvVaultEventType.OPEN;
14
14
  this.btcTxId = btcTxId;
15
15
  this.vout = vout;
@@ -11,5 +11,5 @@ export declare class ClaimEvent<T extends SwapData> extends SwapEvent<T, SwapEve
11
11
  * The result of the Claim event, usually either a secret pre-image or transaction hash
12
12
  */
13
13
  result: string;
14
- constructor(escrowHash: string, result: string);
14
+ constructor(escrowHash: string, result: string, contractVersion?: string);
15
15
  }
@@ -8,8 +8,8 @@ const SwapEvent_1 = require("./SwapEvent");
8
8
  * @category Events
9
9
  */
10
10
  class ClaimEvent extends SwapEvent_1.SwapEvent {
11
- constructor(escrowHash, result) {
12
- super(escrowHash);
11
+ constructor(escrowHash, result, contractVersion) {
12
+ super(escrowHash, contractVersion);
13
13
  this.eventType = SwapEvent_1.SwapEventType.CLAIM;
14
14
  this.result = result;
15
15
  }
@@ -16,5 +16,5 @@ export declare class InitializeEvent<T extends SwapData> extends SwapEvent<T, Sw
16
16
  * A getter for the actual full swap data that was used to initialize the escrow swap
17
17
  */
18
18
  swapData: () => Promise<T | null>;
19
- constructor(escrowHash: string, swapType: ChainSwapType, swapData: () => Promise<T | null>);
19
+ constructor(escrowHash: string, swapType: ChainSwapType, swapData: () => Promise<T | null>, contractVersion?: string);
20
20
  }
@@ -8,8 +8,8 @@ const SwapEvent_1 = require("./SwapEvent");
8
8
  * @category Events
9
9
  */
10
10
  class InitializeEvent extends SwapEvent_1.SwapEvent {
11
- constructor(escrowHash, swapType, swapData) {
12
- super(escrowHash);
11
+ constructor(escrowHash, swapType, swapData, contractVersion) {
12
+ super(escrowHash, contractVersion);
13
13
  this.eventType = SwapEvent_1.SwapEventType.INITIALIZE;
14
14
  this.swapType = swapType;
15
15
  this.swapData = swapData;
@@ -21,5 +21,5 @@ export declare abstract class SwapEvent<T extends SwapData, C extends SwapEventT
21
21
  * Identifier of the escrow, usually a hash of the full escrow swap data
22
22
  */
23
23
  escrowHash: string;
24
- constructor(escrowHash: string);
24
+ constructor(escrowHash: string, contractVersion?: string);
25
25
  }
@@ -19,8 +19,8 @@ var SwapEventType;
19
19
  * @category Events
20
20
  */
21
21
  class SwapEvent extends ChainEvent_1.ChainEvent {
22
- constructor(escrowHash) {
23
- super();
22
+ constructor(escrowHash, contractVersion) {
23
+ super(contractVersion);
24
24
  this.escrowHash = escrowHash;
25
25
  }
26
26
  }
@@ -32,6 +32,7 @@ export declare enum SwapCommitStateType {
32
32
  */
33
33
  export type SwapNotCommitedState = {
34
34
  type: SwapCommitStateType.NOT_COMMITED;
35
+ getInitTxId?: () => Promise<string>;
35
36
  getRefundTxId?: () => Promise<string>;
36
37
  getTxBlock?: () => Promise<{
37
38
  blockHeight: number;
@@ -45,6 +46,7 @@ export type SwapNotCommitedState = {
45
46
  */
46
47
  export type SwapExpiredState = {
47
48
  type: SwapCommitStateType.EXPIRED;
49
+ getInitTxId?: () => Promise<string>;
48
50
  getRefundTxId?: () => Promise<string>;
49
51
  getTxBlock?: () => Promise<{
50
52
  blockHeight: number;
@@ -58,6 +60,7 @@ export type SwapExpiredState = {
58
60
  */
59
61
  export type SwapRefundableState = {
60
62
  type: SwapCommitStateType.REFUNDABLE;
63
+ getInitTxId?: () => Promise<string>;
61
64
  };
62
65
  /**
63
66
  * The escrow is active on-chain and can be claimed
@@ -66,6 +69,7 @@ export type SwapRefundableState = {
66
69
  */
67
70
  export type SwapCommitedState = {
68
71
  type: SwapCommitStateType.COMMITED;
72
+ getInitTxId?: () => Promise<string>;
69
73
  };
70
74
  /**
71
75
  * The escrow has been finalized and funds claimed by the claimer
@@ -74,6 +78,7 @@ export type SwapCommitedState = {
74
78
  */
75
79
  export type SwapPaidState = {
76
80
  type: SwapCommitStateType.PAID;
81
+ getInitTxId?: () => Promise<string>;
77
82
  getClaimTxId: () => Promise<string>;
78
83
  getClaimResult: () => Promise<string>;
79
84
  getTxBlock: () => Promise<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/base",
3
- "version": "13.4.0",
3
+ "version": "13.5.0",
4
4
  "description": "Base classes and interfaces for atomiq protocol",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -31,7 +31,19 @@ export type ChainData<T extends ChainType> = {
31
31
  swapDataConstructor: new (data: any) => T["Data"],
32
32
  spvVaultContract: T["SpvVaultContract"],
33
33
  spvVaultDataConstructor: new (data: any) => T["SpvVaultData"],
34
- spvVaultWithdrawalDataConstructor: new (data: any) => T["SpvVaultWithdrawalData"]
34
+ spvVaultWithdrawalDataConstructor: new (data: any) => T["SpvVaultWithdrawalData"],
35
+
36
+ defaultVersion?: string,
37
+ versions?: {
38
+ [contractVersion: string]: {
39
+ btcRelay: T["BtcRelay"],
40
+ swapContract: T["Contract"],
41
+ swapDataConstructor: new (data: any) => T["Data"],
42
+ spvVaultContract: T["SpvVaultContract"],
43
+ spvVaultDataConstructor: new (data: any) => T["SpvVaultData"],
44
+ spvVaultWithdrawalDataConstructor: new (data: any) => T["SpvVaultWithdrawalData"],
45
+ }
46
+ }
35
47
  };
36
48
 
37
49
  /**
@@ -144,6 +144,13 @@ export interface ChainInterface<
144
144
  */
145
145
  deserializeSignedTx(txData: string): Promise<SignedTX>;
146
146
 
147
+ /**
148
+ * Returns the transaction ID of the signed transaction
149
+ *
150
+ * @param signedTX Signed transaction to get the transaction ID of
151
+ */
152
+ getTxId?(signedTX: SignedTX): Promise<string>;
153
+
147
154
  /**
148
155
  * Returns the status of the given serialized transaction
149
156
  *
@@ -15,4 +15,13 @@ export class ChainEvent<T extends SwapData> {
15
15
  txId: string
16
16
  };
17
17
 
18
+ /**
19
+ * Version of the contract that emitted the event
20
+ */
21
+ contractVersion?: string;
22
+
23
+ constructor(contractVersion?: string) {
24
+ this.contractVersion = contractVersion;
25
+ }
26
+
18
27
  }
@@ -45,9 +45,10 @@ export class SpvVaultClaimEvent extends SpvVaultEvent<SpvVaultEventType.CLAIM> {
45
45
  constructor(
46
46
  owner: string, vaultId: bigint,
47
47
  btcTxId: string, recipient: string, executionHash: string, amounts: bigint[],
48
- caller: string, frontingAddress: string, withdrawCount: number
48
+ caller: string, frontingAddress: string, withdrawCount: number,
49
+ contractVersion?: string
49
50
  ) {
50
- super(owner, vaultId);
51
+ super(owner, vaultId, contractVersion);
51
52
  this.btcTxId = btcTxId;
52
53
  this.recipient = recipient;
53
54
  this.executionHash = executionHash;
@@ -21,8 +21,8 @@ export class SpvVaultCloseEvent extends SpvVaultEvent<SpvVaultEventType.CLOSE> {
21
21
  */
22
22
  error: string;
23
23
 
24
- constructor(owner: string, vaultId: bigint, btcTxId: string, error: string) {
25
- super(owner, vaultId);
24
+ constructor(owner: string, vaultId: bigint, btcTxId: string, error: string, contractVersion?: string) {
25
+ super(owner, vaultId, contractVersion);
26
26
  this.btcTxId = btcTxId;
27
27
  this.error = error;
28
28
  }
@@ -21,8 +21,8 @@ export class SpvVaultDepositEvent extends SpvVaultEvent<SpvVaultEventType.DEPOSI
21
21
  */
22
22
  depositCount: number;
23
23
 
24
- constructor(owner: string, vaultId: bigint, amounts: bigint[], depositCount: number) {
25
- super(owner, vaultId);
24
+ constructor(owner: string, vaultId: bigint, amounts: bigint[], depositCount: number, contractVersion?: string) {
25
+ super(owner, vaultId, contractVersion);
26
26
  this.amounts = amounts;
27
27
  this.depositCount = depositCount;
28
28
  }
@@ -31,8 +31,8 @@ export abstract class SpvVaultEvent<C extends SpvVaultEventType = SpvVaultEventT
31
31
  */
32
32
  vaultId: bigint;
33
33
 
34
- constructor(owner: string, vaultId: bigint) {
35
- super();
34
+ constructor(owner: string, vaultId: bigint, contractVersion?: string) {
35
+ super(contractVersion);
36
36
  this.owner = owner;
37
37
  this.vaultId = vaultId;
38
38
  }
@@ -36,9 +36,9 @@ export class SpvVaultFrontEvent extends SpvVaultEvent<SpvVaultEventType.FRONT> {
36
36
  constructor(
37
37
  owner: string, vaultId: bigint,
38
38
  btcTxId: string, recipient: string, executionHash: string, amounts: bigint[],
39
- frontingAddress: string
39
+ frontingAddress: string, contractVersion?: string
40
40
  ) {
41
- super(owner, vaultId);
41
+ super(owner, vaultId, contractVersion);
42
42
  this.btcTxId = btcTxId;
43
43
  this.recipient = recipient;
44
44
  this.executionHash = executionHash;
@@ -19,8 +19,8 @@ export class SpvVaultOpenEvent extends SpvVaultEvent<SpvVaultEventType.OPEN> {
19
19
  */
20
20
  vout: number;
21
21
 
22
- constructor(owner: string, vaultId: bigint, btcTxId: string, vout: number) {
23
- super(owner, vaultId);
22
+ constructor(owner: string, vaultId: bigint, btcTxId: string, vout: number, contractVersion?: string) {
23
+ super(owner, vaultId, contractVersion);
24
24
  this.btcTxId = btcTxId;
25
25
  this.vout = vout;
26
26
  }
@@ -14,8 +14,8 @@ export class ClaimEvent<T extends SwapData> extends SwapEvent<T, SwapEventType.C
14
14
  */
15
15
  result: string;
16
16
 
17
- constructor(escrowHash: string, result: string) {
18
- super(escrowHash);
17
+ constructor(escrowHash: string, result: string, contractVersion?: string) {
18
+ super(escrowHash, contractVersion);
19
19
  this.result = result;
20
20
  }
21
21
 
@@ -19,8 +19,8 @@ export class InitializeEvent<T extends SwapData> extends SwapEvent<T, SwapEventT
19
19
  */
20
20
  swapData: () => Promise<T | null>;
21
21
 
22
- constructor(escrowHash: string, swapType: ChainSwapType, swapData: () => Promise<T | null>) {
23
- super(escrowHash);
22
+ constructor(escrowHash: string, swapType: ChainSwapType, swapData: () => Promise<T | null>, contractVersion?: string) {
23
+ super(escrowHash, contractVersion);
24
24
  this.swapType = swapType;
25
25
  this.swapData = swapData;
26
26
  }
@@ -25,8 +25,8 @@ export abstract class SwapEvent<T extends SwapData, C extends SwapEventType = Sw
25
25
  */
26
26
  escrowHash: string;
27
27
 
28
- constructor(escrowHash: string) {
29
- super();
28
+ constructor(escrowHash: string, contractVersion?: string) {
29
+ super(contractVersion);
30
30
  this.escrowHash = escrowHash;
31
31
  }
32
32
 
@@ -33,6 +33,7 @@ export enum SwapCommitStateType {
33
33
  */
34
34
  export type SwapNotCommitedState = {
35
35
  type: SwapCommitStateType.NOT_COMMITED,
36
+ getInitTxId?: () => Promise<string>,
36
37
  getRefundTxId?: () => Promise<string>,
37
38
  getTxBlock?: () => Promise<{blockHeight: number, blockTime: number}>
38
39
  };
@@ -44,6 +45,7 @@ export type SwapNotCommitedState = {
44
45
  */
45
46
  export type SwapExpiredState = {
46
47
  type: SwapCommitStateType.EXPIRED,
48
+ getInitTxId?: () => Promise<string>,
47
49
  getRefundTxId?: () => Promise<string>,
48
50
  getTxBlock?: () => Promise<{blockHeight: number, blockTime: number}>
49
51
  };
@@ -54,7 +56,8 @@ export type SwapExpiredState = {
54
56
  * @category Swaps
55
57
  */
56
58
  export type SwapRefundableState = {
57
- type: SwapCommitStateType.REFUNDABLE
59
+ type: SwapCommitStateType.REFUNDABLE,
60
+ getInitTxId?: () => Promise<string>
58
61
  };
59
62
 
60
63
  /**
@@ -63,7 +66,8 @@ export type SwapRefundableState = {
63
66
  * @category Swaps
64
67
  */
65
68
  export type SwapCommitedState = {
66
- type: SwapCommitStateType.COMMITED
69
+ type: SwapCommitStateType.COMMITED,
70
+ getInitTxId?: () => Promise<string>
67
71
  };
68
72
 
69
73
  /**
@@ -73,6 +77,7 @@ export type SwapCommitedState = {
73
77
  */
74
78
  export type SwapPaidState = {
75
79
  type: SwapCommitStateType.PAID,
80
+ getInitTxId?: () => Promise<string>,
76
81
  getClaimTxId: () => Promise<string>,
77
82
  getClaimResult: () => Promise<string>,
78
83
  getTxBlock: () => Promise<{blockHeight: number, blockTime: number}>