@argonprotocol/bitcoin 1.3.0 → 1.3.2

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/lib/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
- import { BIP32Interface } from 'bip32';
2
1
  import { networks, Psbt, Transaction } from 'bitcoinjs-lib';
2
+ export { Network, Psbt, Transaction, address, networks } from 'bitcoinjs-lib';
3
+ import { BIP32Interface, BIP32API } from 'bip32';
3
4
  import { IBitcoinLock, ArgonPrimitivesBitcoinBitcoinNetwork, IReleaseRequest } from '@argonprotocol/mainchain';
5
+ import * as bip39 from 'bip39';
6
+ export { bip39 };
4
7
 
5
8
  declare class CosignScript {
6
9
  readonly lock: IBitcoinLock;
@@ -41,6 +44,7 @@ declare class CosignScript {
41
44
  static getBitcoinJsNetwork(network: ArgonPrimitivesBitcoinBitcoinNetwork): networks.Network;
42
45
  }
43
46
 
47
+ declare function getBip32Factory(): BIP32API;
44
48
  declare function getChildXpriv(bip39Seed: Buffer, hdPath: string, network?: networks.Network): BIP32Interface;
45
49
  declare function getBip39Seed(mnemonic: string, passphrase?: string): Buffer;
46
50
  declare function getXpubFromXpriv(xpriv: BIP32Interface): string;
@@ -49,4 +53,4 @@ declare function stripLeadingHexPrefix(hex: string): string;
49
53
  declare function addressBytesHex(addressString: string, network: networks.Network): string;
50
54
  declare function keyToBuffer(key: string | Buffer): Buffer;
51
55
 
52
- export { CosignScript, addressBytesHex, getBip39Seed, getChildXpriv, getCompressedPubkey, getXpubFromXpriv, keyToBuffer, stripLeadingHexPrefix };
56
+ export { CosignScript, addressBytesHex, getBip32Factory, getBip39Seed, getChildXpriv, getCompressedPubkey, getXpubFromXpriv, keyToBuffer, stripLeadingHexPrefix };
package/lib/index.js CHANGED
@@ -4,6 +4,9 @@ var __export = (target, all) => {
4
4
  __defProp(target, name, { get: all[name], enumerable: true });
5
5
  };
6
6
 
7
+ // ts/index.ts
8
+ import { Transaction as Transaction2, Psbt as Psbt2, networks as networks3, Network, address as address2 } from "bitcoinjs-lib";
9
+
7
10
  // ts/CosignScript.ts
8
11
  import { networks as networks2, payments, Psbt, Transaction } from "bitcoinjs-lib";
9
12
 
@@ -12,7 +15,7 @@ var bitcoin_bindings_bg_exports = {};
12
15
  __export(bitcoin_bindings_bg_exports, {
13
16
  default: () => bitcoin_bindings_bg_default
14
17
  });
15
- var bitcoin_bindings_bg_default = "./bitcoin_bindings_bg-7MW5MTH2.wasm";
18
+ var bitcoin_bindings_bg_default = "./bitcoin_bindings_bg-NTNPUTAE.wasm";
16
19
 
17
20
  // ts/wasm/bitcoin_bindings_bg.js
18
21
  var wasm;
@@ -230,6 +233,9 @@ import { address } from "bitcoinjs-lib";
230
233
  import BIP32Factory from "bip32";
231
234
  import * as ecc from "tiny-secp256k1";
232
235
  import * as bip39 from "bip39";
236
+ function getBip32Factory() {
237
+ return BIP32Factory(ecc);
238
+ }
233
239
  function getChildXpriv(bip39Seed, hdPath, network) {
234
240
  const root = BIP32Factory(ecc).fromSeed(bip39Seed, network);
235
241
  return root.derivePath(hdPath);
@@ -443,13 +449,23 @@ function toBitcoinNetwork(network) {
443
449
  }
444
450
  throw new Error("Unsupported network: " + network);
445
451
  }
452
+
453
+ // ts/index.ts
454
+ import * as bip392 from "bip39";
446
455
  export {
447
456
  CosignScript,
457
+ Network,
458
+ Psbt2 as Psbt,
459
+ Transaction2 as Transaction,
460
+ address2 as address,
448
461
  addressBytesHex,
462
+ bip392 as bip39,
463
+ getBip32Factory,
449
464
  getBip39Seed,
450
465
  getChildXpriv,
451
466
  getCompressedPubkey,
452
467
  getXpubFromXpriv,
453
468
  keyToBuffer,
469
+ networks3 as networks,
454
470
  stripLeadingHexPrefix
455
471
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argonprotocol/bitcoin",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "A client for interop with bitcoin in nodejs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "module": "./lib/index.js",
31
31
  "types": "./lib/index.d.ts",
32
32
  "dependencies": {
33
- "@argonprotocol/mainchain": "1.3.0",
33
+ "@argonprotocol/mainchain": "1.3.2",
34
34
  "bignumber.js": "^9.1.2",
35
35
  "bip32": "^4.0.0",
36
36
  "bip39": "^3.1.0",
@@ -38,7 +38,7 @@
38
38
  "tiny-secp256k1": "^2.2.3"
39
39
  },
40
40
  "devDependencies": {
41
- "@argonprotocol/testing": "1.3.0",
41
+ "@argonprotocol/testing": "1.3.2",
42
42
  "tsup": "^8.4.0",
43
43
  "tsx": "^4.19.2",
44
44
  "typescript": "^5.8.3",