@atomiqlabs/base 13.2.0 → 13.4.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.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ import { BitcoinNetwork } from "../btc/BitcoinNetwork";
2
3
  /**
3
4
  * @category Chains
4
5
  */
@@ -185,4 +186,11 @@ export interface ChainInterface<TX = any, SignedTX = any, Signer extends Abstrac
185
186
  * Wraps a native chain signer object to an atomiq-understandable AbstractSigner
186
187
  */
187
188
  wrapSigner(signer: NativeSigner): Promise<Signer>;
189
+ /**
190
+ * Verifies whether the set network of this chain interface matches the passed bitcoin network (i.e. mainnet should
191
+ * use mainnet networks and testnets should use testnet networks)
192
+ *
193
+ * @throws {Error} When the underlying network doesn't match
194
+ */
195
+ verifyNetwork?(bitcoinNetwork: BitcoinNetwork): Promise<void>;
188
196
  }
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/base",
3
- "version": "13.2.0",
3
+ "version": "13.4.0",
4
4
  "description": "Base classes and interfaces for atomiq protocol",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -1,3 +1,5 @@
1
+ import {BitcoinNetwork} from "../btc/BitcoinNetwork";
2
+
1
3
  /**
2
4
  * @category Chains
3
5
  */
@@ -216,4 +218,12 @@ export interface ChainInterface<
216
218
  */
217
219
  wrapSigner(signer: NativeSigner): Promise<Signer>;
218
220
 
221
+ /**
222
+ * Verifies whether the set network of this chain interface matches the passed bitcoin network (i.e. mainnet should
223
+ * use mainnet networks and testnets should use testnet networks)
224
+ *
225
+ * @throws {Error} When the underlying network doesn't match
226
+ */
227
+ verifyNetwork?(bitcoinNetwork: BitcoinNetwork): Promise<void>;
228
+
219
229
  }
@@ -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