@btc-vision/transaction 1.8.0-alpha.2 → 1.8.0-beta.1

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.
@@ -2,6 +2,7 @@ import { BIP32API, BIP32Interface, MLDSAKeyPair, MLDSASecurityLevel } from '../.
2
2
  import { Network, Signer } from '../../node_modules/@btc-vision/bitcoin/build/index.js';
3
3
  import { ECPairAPI, ECPairInterface } from 'ecpair';
4
4
  import { IWallet } from './interfaces/IWallet.js';
5
+ import { Buffer } from '../../buffer';
5
6
  export declare class EcKeyPair {
6
7
  static BIP32: BIP32API;
7
8
  static ECPair: ECPairAPI;
@@ -1647,8 +1647,8 @@ export {
1647
1647
  ys as a,
1648
1648
  Pe as b,
1649
1649
  gs as c,
1650
- It as d,
1651
- ws as e,
1650
+ ws as d,
1651
+ It as e,
1652
1652
  _s as f,
1653
1653
  Ss as g,
1654
1654
  Is as h,
@@ -1,4 +1,4 @@
1
- import { s as fn, r as th, a as kn, b as nh, c as hf, d as ar, e as ah, f as ts, i as oh, g as ih, h as sr, j as ns, k as sh, p as ch, l as uh, m as lh } from "./noble-hashes.js";
1
+ import { s as fn, r as th, a as kn, b as nh, c as hf, d as ah, e as ar, f as ts, i as oh, g as ih, h as sr, j as ns, k as sh, p as ch, l as uh, m as lh } from "./noble-hashes.js";
2
2
  import { r as fh, a as dh, b as hh, F as Rs, c as ph, d as gh } from "./noble-curves.js";
3
3
  import { r as as } from "./valibot.js";
4
4
  function bh(e, t) {
@@ -12021,10 +12021,10 @@ export {
12021
12021
  cv as d,
12022
12022
  fv as e,
12023
12023
  sv as f,
12024
- mv as g,
12024
+ bv as g,
12025
12025
  _m as h,
12026
12026
  uv as i,
12027
- bv as j,
12027
+ mv as j,
12028
12028
  jd as k,
12029
12029
  nd as l,
12030
12030
  _v as m,
@@ -1 +1 @@
1
- export declare const version = "1.8.0-alpha.2";
1
+ export declare const version = "1.8.0-beta.1";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.8.0-alpha.2';
1
+ export const version = '1.8.0-beta.1';
@@ -2,6 +2,7 @@ import { BIP32API, BIP32Interface, MLDSAKeyPair, MLDSASecurityLevel } from '@btc
2
2
  import { Network, Signer } from '@btc-vision/bitcoin';
3
3
  import { ECPairAPI, ECPairInterface } from 'ecpair';
4
4
  import { IWallet } from './interfaces/IWallet.js';
5
+ import { Buffer } from 'buffer';
5
6
  export declare class EcKeyPair {
6
7
  static BIP32: BIP32API;
7
8
  static ECPair: ECPairAPI;
@@ -6,6 +6,7 @@ import { secp256k1 } from '@noble/curves/secp256k1';
6
6
  import { mod } from '@noble/curves/abstract/modular';
7
7
  import { sha256 } from '@noble/hashes/sha2';
8
8
  import { bytesToNumberBE, concatBytes, randomBytes, utf8ToBytes } from '@noble/curves/utils.js';
9
+ import { Buffer } from 'buffer';
9
10
  initEccLib(ecc);
10
11
  const BIP32factory = typeof bip32 === 'function' ? bip32 : BIP32Factory;
11
12
  if (!BIP32factory) {
@@ -131,6 +132,10 @@ export class EcKeyPair {
131
132
  static generateWallet(network = networks.bitcoin, securityLevel = MLDSASecurityLevel.LEVEL2) {
132
133
  const keyPair = this.ECPair.makeRandom({
133
134
  network: network,
135
+ rng: (size) => {
136
+ const bytes = randomBytes(size);
137
+ return Buffer.from(bytes);
138
+ },
134
139
  });
135
140
  const wallet = this.getP2WPKHAddress(keyPair, network);
136
141
  if (!wallet) {
@@ -193,6 +198,10 @@ export class EcKeyPair {
193
198
  static generateRandomKeyPair(network = networks.bitcoin) {
194
199
  return this.ECPair.makeRandom({
195
200
  network: network,
201
+ rng: (size) => {
202
+ const bytes = randomBytes(size);
203
+ return Buffer.from(bytes);
204
+ },
196
205
  });
197
206
  }
198
207
  static fromSeed(seed, network = networks.bitcoin) {