brk-client 0.3.0-alpha.3 → 0.3.0-alpha.5

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.
Files changed (2) hide show
  1. package/index.js +22 -13
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -139,6 +139,8 @@
139
139
  * @property {number} utxoSetSize - Total UTXO set size at this height
140
140
  * @property {Sats} totalInputAmt - Total input amount in satoshis
141
141
  * @property {number} virtualSize - Virtual size in vbytes
142
+ * @property {?number=} firstSeen - Timestamp when the block was first seen (always null, not yet supported)
143
+ * @property {string[]} orphans - Orphaned blocks (always empty)
142
144
  * @property {Dollars} price - USD price at block height
143
145
  */
144
146
  /**
@@ -177,15 +179,15 @@
177
179
  * @property {Height} height - Block height
178
180
  * @property {number} version - Block version
179
181
  * @property {Timestamp} timestamp - Block timestamp (Unix time)
182
+ * @property {number} bits - Compact target (bits)
183
+ * @property {number} nonce - Nonce
184
+ * @property {number} difficulty - Block difficulty
185
+ * @property {string} merkleRoot - Merkle root of the transaction tree
180
186
  * @property {number} txCount - Number of transactions
181
187
  * @property {number} size - Block size in bytes
182
188
  * @property {Weight} weight - Block weight in weight units
183
- * @property {string} merkleRoot - Merkle root of the transaction tree
184
189
  * @property {BlockHash} previousblockhash - Previous block hash
185
190
  * @property {Timestamp} mediantime - Median time of the last 11 blocks
186
- * @property {number} nonce - Nonce
187
- * @property {number} bits - Compact target (bits)
188
- * @property {number} difficulty - Block difficulty
189
191
  */
190
192
  /**
191
193
  * Block information with extras, matching mempool.space /api/v1/blocks
@@ -195,15 +197,15 @@
195
197
  * @property {Height} height - Block height
196
198
  * @property {number} version - Block version
197
199
  * @property {Timestamp} timestamp - Block timestamp (Unix time)
200
+ * @property {number} bits - Compact target (bits)
201
+ * @property {number} nonce - Nonce
202
+ * @property {number} difficulty - Block difficulty
203
+ * @property {string} merkleRoot - Merkle root of the transaction tree
198
204
  * @property {number} txCount - Number of transactions
199
205
  * @property {number} size - Block size in bytes
200
206
  * @property {Weight} weight - Block weight in weight units
201
- * @property {string} merkleRoot - Merkle root of the transaction tree
202
207
  * @property {BlockHash} previousblockhash - Previous block hash
203
208
  * @property {Timestamp} mediantime - Median time of the last 11 blocks
204
- * @property {number} nonce - Nonce
205
- * @property {number} bits - Compact target (bits)
206
- * @property {number} difficulty - Block difficulty
207
209
  * @property {BlockExtras} extras - Extended block data
208
210
  */
209
211
  /**
@@ -213,7 +215,7 @@
213
215
  * @property {number} id - Unique pool identifier
214
216
  * @property {string} name - Pool name
215
217
  * @property {PoolSlug} slug - URL-friendly pool identifier
216
- * @property {?string=} minerNames - Alternative miner names (if identified)
218
+ * @property {?string[]=} minerNames - Miner name tags found in coinbase scriptsig
217
219
  */
218
220
  /**
219
221
  * A single block rewards data point.
@@ -672,7 +674,7 @@
672
674
  /**
673
675
  * Type (P2PKH, P2WPKH, P2SH, P2TR, etc.)
674
676
  *
675
- * @typedef {("p2pk65"|"p2pk33"|"p2pkh"|"p2ms"|"p2sh"|"opreturn"|"p2wpkh"|"p2wsh"|"p2tr"|"p2a"|"empty"|"unknown")} OutputType
677
+ * @typedef {("p2pk"|"p2pk"|"p2pkh"|"multisig"|"p2sh"|"op_return"|"v0_p2wpkh"|"v0_p2wsh"|"v1_p2tr"|"p2a"|"empty"|"unknown")} OutputType
676
678
  */
677
679
  /** @typedef {TypeIndex} P2AAddrIndex */
678
680
  /** @typedef {U8x2} P2ABytes */
@@ -1002,7 +1004,7 @@
1002
1004
  * @typedef {Object} Transaction
1003
1005
  * @property {(TxIndex|null)=} index - Internal transaction index (brk-specific, not in mempool.space)
1004
1006
  * @property {Txid} txid - Transaction ID
1005
- * @property {TxVersion} version - Transaction version
1007
+ * @property {TxVersionRaw} version - Transaction version (raw i32 from Bitcoin protocol, may contain non-standard values in coinbase txs)
1006
1008
  * @property {RawLockTime} locktime - Transaction lock time
1007
1009
  * @property {TxIn[]} vin - Transaction inputs
1008
1010
  * @property {TxOut[]} vout - Transaction outputs
@@ -1022,7 +1024,7 @@
1022
1024
  *
1023
1025
  * @typedef {Object} TxIn
1024
1026
  * @property {Txid} txid - Transaction ID of the output being spent
1025
- * @property {Vout} vout - Output index being spent
1027
+ * @property {Vout} vout - Output index being spent (u16: coinbase is 65535, mempool.space uses u32: 4294967295)
1026
1028
  * @property {(TxOut|null)=} prevout - Information about the previous output being spent
1027
1029
  * @property {string} scriptsig - Signature script (hex, for non-SegWit inputs)
1028
1030
  * @property {string} scriptsigAsm - Signature script in assembly format
@@ -1065,6 +1067,13 @@
1065
1067
  *
1066
1068
  * @typedef {number} TxVersion
1067
1069
  */
1070
+ /**
1071
+ * Raw transaction version (i32) from Bitcoin protocol.
1072
+ * Unlike TxVersion (u8, indexed), this preserves non-standard values
1073
+ * used in coinbase txs for miner signaling/branding.
1074
+ *
1075
+ * @typedef {number} TxVersionRaw
1076
+ */
1068
1077
  /**
1069
1078
  * Transaction ID (hash)
1070
1079
  *
@@ -6564,7 +6573,7 @@ function createTransferPattern(client, acc) {
6564
6573
  * @extends BrkClientBase
6565
6574
  */
6566
6575
  class BrkClient extends BrkClientBase {
6567
- VERSION = "v0.3.0-alpha.3";
6576
+ VERSION = "v0.3.0-alpha.5";
6568
6577
 
6569
6578
  INDEXES = /** @type {const} */ ([
6570
6579
  "minute10",
package/package.json CHANGED
@@ -40,5 +40,5 @@
40
40
  "url": "git+https://github.com/bitcoinresearchkit/brk.git"
41
41
  },
42
42
  "type": "module",
43
- "version": "0.3.0-alpha.3"
43
+ "version": "0.3.0-alpha.5"
44
44
  }