@bsv/sdk 1.2.12 → 1.2.13

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.
@@ -135,7 +135,7 @@ This interface defines a standard method for broadcasting transactions.
135
135
  ```ts
136
136
  export interface Broadcaster {
137
137
  broadcast: (transaction: Transaction) => Promise<BroadcastResponse | BroadcastFailure>;
138
- broadcastMany?: (txs: Transaction[]) => Promise<Array<object>>;
138
+ broadcastMany?: (txs: Transaction[]) => Promise<object[]>;
139
139
  }
140
140
  ```
141
141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/sdk",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "type": "module",
5
5
  "description": "BSV Blockchain Software Development Kit",
6
6
  "main": "dist/cjs/mod.js",
@@ -11,9 +11,9 @@ describe('PrivateKey', () => {
11
11
  BRC42Private.forEach((vector, index) => {
12
12
  it(`Passes BRC42 private vector #${index + 1}`, () => {
13
13
  const publicKey = PublicKey.fromString(vector.senderPublicKey)
14
- const privateKey = PrivateKey.fromString(vector.recipientPrivateKey, 16)
14
+ const privateKey = PrivateKey.fromString(vector.recipientPrivateKey)
15
15
  const derived = privateKey.deriveChild(publicKey, vector.invoiceNumber)
16
- expect(derived.toHex(32)).toEqual(vector.privateKey)
16
+ expect(derived.toHex()).toEqual(vector.privateKey)
17
17
  })
18
18
  })
19
19
  })
@@ -12,7 +12,7 @@ import Spend from '../script/Spend.js'
12
12
  import ChainTracker from './ChainTracker.js'
13
13
  import { defaultBroadcaster } from './broadcasters/DefaultBroadcaster.js'
14
14
  import { defaultChainTracker } from './chaintrackers/DefaultChainTracker.js'
15
- import { BEEF_MAGIC } from './Beef.js'
15
+ import { ATOMIC_BEEF, BEEF_MAGIC } from './Beef.js'
16
16
 
17
17
  /**
18
18
  * Represents a complete Bitcoin transaction. This class encapsulates all the details
@@ -119,8 +119,8 @@ export default class Transaction {
119
119
  const reader = new Reader(beef)
120
120
  // Read the Atomic BEEF prefix
121
121
  const prefix = reader.readUInt32LE()
122
- if (prefix !== 0x01010101) {
123
- throw new Error(`Invalid Atomic BEEF prefix. Expected 0x01010101, received ${prefix.toString(16)}.`)
122
+ if (prefix !== ATOMIC_BEEF) {
123
+ throw new Error(`Invalid Atomic BEEF prefix. Expected 0x01010101, received 0x${prefix.toString(16)}.`)
124
124
  }
125
125
 
126
126
  // Read the subject TXID