@bsv/sdk 1.3.19 → 1.3.21
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.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/transaction/Beef.js +2 -2
- package/dist/cjs/src/transaction/Beef.js.map +1 -1
- package/dist/cjs/src/transaction/Transaction.js +1 -1
- package/dist/cjs/src/transaction/Transaction.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/transaction/Beef.js +2 -2
- package/dist/esm/src/transaction/Beef.js.map +1 -1
- package/dist/esm/src/transaction/Transaction.js +1 -1
- package/dist/esm/src/transaction/Transaction.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/primitives/Hash.d.ts +1 -1
- package/dist/types/src/primitives/Hash.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/package.json +1 -1
- package/src/primitives/Hash.ts +1 -1
- package/src/transaction/Beef.ts +2 -2
- package/src/transaction/Transaction.ts +1 -1
- package/src/transaction/__tests/Transaction.test.ts +4 -4
package/package.json
CHANGED
package/src/primitives/Hash.ts
CHANGED
package/src/transaction/Beef.ts
CHANGED
|
@@ -504,7 +504,7 @@ export class Beef {
|
|
|
504
504
|
|
|
505
505
|
const writer = new Writer()
|
|
506
506
|
writer.writeUInt32LE(ATOMIC_BEEF)
|
|
507
|
-
writer.
|
|
507
|
+
writer.writeReverse(toArray(txid, 'hex'))
|
|
508
508
|
beef.toWriter(writer)
|
|
509
509
|
|
|
510
510
|
return writer.toArray()
|
|
@@ -523,7 +523,7 @@ export class Beef {
|
|
|
523
523
|
let atomicTxid: string | undefined
|
|
524
524
|
if (version === ATOMIC_BEEF) {
|
|
525
525
|
// Skip the txid and re-read the BEEF version
|
|
526
|
-
atomicTxid = toHex(br.
|
|
526
|
+
atomicTxid = toHex(br.readReverse(32))
|
|
527
527
|
version = br.readUInt32LE()
|
|
528
528
|
}
|
|
529
529
|
if (version !== BEEF_V1 && version !== BEEF_V2) {
|
|
@@ -986,7 +986,7 @@ export default class Transaction {
|
|
|
986
986
|
// Write the Atomic BEEF prefix
|
|
987
987
|
writer.writeUInt32LE(0x01010101)
|
|
988
988
|
// Write the subject TXID (big-endian)
|
|
989
|
-
writer.write(this.
|
|
989
|
+
writer.write(this.hash())
|
|
990
990
|
// Append the BEEF data
|
|
991
991
|
const beefData = this.toBEEF(allowPartial)
|
|
992
992
|
writer.write(beefData)
|
|
@@ -1034,7 +1034,7 @@ describe('Transaction', () => {
|
|
|
1034
1034
|
// Verify that the Atomic BEEF starts with the correct prefix and TXID
|
|
1035
1035
|
const expectedPrefix = [0x01, 0x01, 0x01, 0x01]
|
|
1036
1036
|
expect(atomicBEEF.slice(0, 4)).toEqual(expectedPrefix)
|
|
1037
|
-
const txid = spendTx.
|
|
1037
|
+
const txid = spendTx.hash()
|
|
1038
1038
|
expect(atomicBEEF.slice(4, 36)).toEqual(txid)
|
|
1039
1039
|
|
|
1040
1040
|
// Deserialize from Atomic BEEF
|
|
@@ -1049,7 +1049,7 @@ describe('Transaction', () => {
|
|
|
1049
1049
|
writer.writeUInt32LE(0x01010101)
|
|
1050
1050
|
// Write subject TXID
|
|
1051
1051
|
const fakeTXID = toArray('00'.repeat(32), 'hex')
|
|
1052
|
-
writer.
|
|
1052
|
+
writer.writeReverse(fakeTXID)
|
|
1053
1053
|
// Write empty BEEF data
|
|
1054
1054
|
writer.writeUInt32LE(BEEF_V1) // BEEF version
|
|
1055
1055
|
writer.writeVarIntNum(0) // No BUMPs
|
|
@@ -1198,7 +1198,7 @@ describe('Transaction', () => {
|
|
|
1198
1198
|
// Verify that the Atomic BEEF starts with the correct prefix and TXID
|
|
1199
1199
|
const expectedPrefix = [0x01, 0x01, 0x01, 0x01]
|
|
1200
1200
|
expect(atomicBEEF.slice(0, 4)).toEqual(expectedPrefix)
|
|
1201
|
-
const txid = spendTx.
|
|
1201
|
+
const txid = spendTx.hash()
|
|
1202
1202
|
expect(atomicBEEF.slice(4, 36)).toEqual(txid)
|
|
1203
1203
|
|
|
1204
1204
|
// Deserialize from Atomic BEEF
|
|
@@ -1213,7 +1213,7 @@ describe('Transaction', () => {
|
|
|
1213
1213
|
writer.writeUInt32LE(0x01010101)
|
|
1214
1214
|
// Write subject TXID
|
|
1215
1215
|
const fakeTXID = toArray('00'.repeat(32), 'hex')
|
|
1216
|
-
writer.
|
|
1216
|
+
writer.writeReverse(fakeTXID)
|
|
1217
1217
|
// Write empty BEEF data
|
|
1218
1218
|
writer.writeUInt32LE(BEEF_V1) // BEEF version
|
|
1219
1219
|
writer.writeVarIntNum(0) // No BUMPs
|