@atomiqlabs/base 13.1.14 → 13.2.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.
@@ -4,8 +4,24 @@
4
4
  * @category Bitcoin
5
5
  */
6
6
  export declare enum BitcoinNetwork {
7
+ /**
8
+ * Bitcoin mainnet network
9
+ */
7
10
  MAINNET = 0,
11
+ /**
12
+ * Bitcoin testnet3 network (older test network)
13
+ */
8
14
  TESTNET = 1,
15
+ /**
16
+ * Bitcoin testnet3 network (older test network), alias for {@link BitcoinNetwork.TESTNET}
17
+ */
18
+ TESTNET3 = 1,
19
+ /**
20
+ * Bitcoin testnet4 network (newer test network)
21
+ */
9
22
  TESTNET4 = 2,
23
+ /**
24
+ * Bitcoin regtest network, for local regression test modes
25
+ */
10
26
  REGTEST = 3
11
27
  }
@@ -8,8 +8,24 @@ exports.BitcoinNetwork = void 0;
8
8
  */
9
9
  var BitcoinNetwork;
10
10
  (function (BitcoinNetwork) {
11
+ /**
12
+ * Bitcoin mainnet network
13
+ */
11
14
  BitcoinNetwork[BitcoinNetwork["MAINNET"] = 0] = "MAINNET";
15
+ /**
16
+ * Bitcoin testnet3 network (older test network)
17
+ */
12
18
  BitcoinNetwork[BitcoinNetwork["TESTNET"] = 1] = "TESTNET";
19
+ /**
20
+ * Bitcoin testnet3 network (older test network), alias for {@link BitcoinNetwork.TESTNET}
21
+ */
22
+ BitcoinNetwork[BitcoinNetwork["TESTNET3"] = 1] = "TESTNET3";
23
+ /**
24
+ * Bitcoin testnet4 network (newer test network)
25
+ */
13
26
  BitcoinNetwork[BitcoinNetwork["TESTNET4"] = 2] = "TESTNET4";
27
+ /**
28
+ * Bitcoin regtest network, for local regression test modes
29
+ */
14
30
  BitcoinNetwork[BitcoinNetwork["REGTEST"] = 3] = "REGTEST";
15
31
  })(BitcoinNetwork = exports.BitcoinNetwork || (exports.BitcoinNetwork = {}));
@@ -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
  *
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@atomiqlabs/base",
3
- "version": "13.1.14",
3
+ "version": "13.2.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
  },
@@ -4,8 +4,24 @@
4
4
  * @category Bitcoin
5
5
  */
6
6
  export enum BitcoinNetwork {
7
+ /**
8
+ * Bitcoin mainnet network
9
+ */
7
10
  MAINNET=0,
11
+ /**
12
+ * Bitcoin testnet3 network (older test network)
13
+ */
8
14
  TESTNET=1,
15
+ /**
16
+ * Bitcoin testnet3 network (older test network), alias for {@link BitcoinNetwork.TESTNET}
17
+ */
18
+ TESTNET3=1,
19
+ /**
20
+ * Bitcoin testnet4 network (newer test network)
21
+ */
9
22
  TESTNET4=2,
23
+ /**
24
+ * Bitcoin regtest network, for local regression test modes
25
+ */
10
26
  REGTEST=3
11
- }
27
+ }
@@ -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
  *