@atomiqlabs/base 12.0.1 → 12.0.3

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.
@@ -201,6 +201,21 @@ export interface SwapContract<T extends SwapData = SwapData, TX = any, PreFetchD
201
201
  }[]): Promise<{
202
202
  [escrowHash: string]: SwapCommitState;
203
203
  }>;
204
+ /**
205
+ * Returns the full history as fetched from the chain for a specific signer
206
+ *
207
+ * @param signer
208
+ * @param startBlockheight
209
+ */
210
+ getHistoricalSwaps?(signer: string, startBlockheight?: number): Promise<{
211
+ swaps: {
212
+ [escrowHash: string]: {
213
+ data?: T;
214
+ state: SwapCommitState;
215
+ };
216
+ };
217
+ latestBlockheight: number;
218
+ }>;
204
219
  /**
205
220
  * Checks whether a given swap is refundable by us, i.e. it is already expired, we are offerer & swap is committed on-chain
206
221
  *
@@ -26,6 +26,7 @@ export declare abstract class SwapData implements StorageObject {
26
26
  abstract getConfirmationsHint(): number;
27
27
  abstract getNonceHint(): bigint;
28
28
  abstract getTxoHashHint(): string;
29
+ getHTLCHashHint(): string;
29
30
  abstract setExtraData(extraData: string): void;
30
31
  abstract getSecurityDeposit(): bigint;
31
32
  abstract getClaimerBounty(): bigint;
@@ -9,6 +9,9 @@ class SwapData {
9
9
  }
10
10
  throw new Error(`No deserializer found for swap data type: ${data.type}`);
11
11
  }
12
+ getHTLCHashHint() {
13
+ return null;
14
+ }
12
15
  hasSuccessAction() {
13
16
  return false;
14
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/base",
3
- "version": "12.0.1",
3
+ "version": "12.0.3",
4
4
  "description": "Base classes and interfaces for atomiq protocol",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -245,6 +245,17 @@ export interface SwapContract<
245
245
  */
246
246
  getCommitStatuses(request: {signer: string, swapData: T}[]): Promise<{[escrowHash: string]: SwapCommitState}>;
247
247
 
248
+ /**
249
+ * Returns the full history as fetched from the chain for a specific signer
250
+ *
251
+ * @param signer
252
+ * @param startBlockheight
253
+ */
254
+ getHistoricalSwaps?(signer: string, startBlockheight?: number): Promise<{
255
+ swaps: {[escrowHash: string]: {data?: T, state: SwapCommitState}},
256
+ latestBlockheight: number
257
+ }>;
258
+
248
259
  /**
249
260
  * Checks whether a given swap is refundable by us, i.e. it is already expired, we are offerer & swap is committed on-chain
250
261
  *
@@ -48,6 +48,9 @@ export abstract class SwapData implements StorageObject {
48
48
  abstract getConfirmationsHint(): number;
49
49
  abstract getNonceHint(): bigint;
50
50
  abstract getTxoHashHint(): string;
51
+ getHTLCHashHint(): string {
52
+ return null;
53
+ }
51
54
  abstract setExtraData(extraData: string): void;
52
55
 
53
56
  abstract getSecurityDeposit(): bigint;