@atomiqlabs/base 13.3.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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/base",
3
- "version": "13.3.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
  }