brk-client 0.3.0-alpha.2 → 0.3.0-alpha.4

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