@atomiqlabs/base 13.1.15 → 13.3.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.
@@ -86,6 +86,14 @@ export interface ChainInterface<TX = any, SignedTX = any, Signer extends Abstrac
86
86
  * @param feeRate Optional fee rate to use for the transaction (fetched on-demand if not provided)
87
87
  */
88
88
  txsTransfer(signer: string, token: string, amount: bigint, dstAddress: string, feeRate?: string): Promise<TX[]>;
89
+ /**
90
+ * Prepares transaction for signing, by assigning a nonce, or a last valid blockhash
91
+ *
92
+ * @remarks Ensure that all transactions are using the same signer, else this function might throw!
93
+ *
94
+ * @param txs Transactions to prepare
95
+ */
96
+ prepareTxs?(txs: TX[]): Promise<TX[]>;
89
97
  /**
90
98
  * Serializes a given transaction to a string
91
99
  *
@@ -176,4 +176,9 @@ export declare abstract class SwapData implements StorageObject {
176
176
  * Checks whether the escrow contains an execution action (swap+)
177
177
  */
178
178
  hasSuccessAction(): boolean;
179
+ /**
180
+ * Returns the JSON-serialization safe representation of the underlying swap escrow struct committed (or
181
+ * to-be-committed) on-chain
182
+ */
183
+ getEscrowStruct(): any;
179
184
  }
@@ -32,6 +32,13 @@ class SwapData {
32
32
  hasSuccessAction() {
33
33
  return false;
34
34
  }
35
+ /**
36
+ * Returns the JSON-serialization safe representation of the underlying swap escrow struct committed (or
37
+ * to-be-committed) on-chain
38
+ */
39
+ getEscrowStruct() {
40
+ return null;
41
+ }
35
42
  }
36
43
  exports.SwapData = SwapData;
37
44
  /**
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@atomiqlabs/base",
3
- "version": "13.1.15",
3
+ "version": "13.3.0",
4
4
  "description": "Base classes and interfaces for atomiq protocol",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
+ "build": "npx -y -p typescript@4.9 tsc",
9
10
  "build:ts4": "npx -p typescript@4.9 tsc --noEmit",
10
11
  "build:ts5": "npx -p typescript@5.3 tsc --noEmit"
11
12
  },
@@ -105,6 +105,15 @@ export interface ChainInterface<
105
105
  */
106
106
  txsTransfer(signer: string, token: string, amount: bigint, dstAddress: string, feeRate?: string): Promise<TX[]>;
107
107
 
108
+ /**
109
+ * Prepares transaction for signing, by assigning a nonce, or a last valid blockhash
110
+ *
111
+ * @remarks Ensure that all transactions are using the same signer, else this function might throw!
112
+ *
113
+ * @param txs Transactions to prepare
114
+ */
115
+ prepareTxs?(txs: TX[]): Promise<TX[]>;
116
+
108
117
  /**
109
118
  * Serializes a given transaction to a string
110
119
  *
@@ -221,5 +221,13 @@ export abstract class SwapData implements StorageObject {
221
221
  return false;
222
222
  }
223
223
 
224
+ /**
225
+ * Returns the JSON-serialization safe representation of the underlying swap escrow struct committed (or
226
+ * to-be-committed) on-chain
227
+ */
228
+ getEscrowStruct(): any {
229
+ return null;
230
+ }
231
+
224
232
  }
225
233