@bitgo/wasm-utxo 1.2.0 → 1.4.0

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 (51) hide show
  1. package/dist/{browser/js → cjs}/address.d.ts +1 -1
  2. package/dist/{node/js → cjs}/address.js +3 -3
  3. package/dist/{browser/js → cjs}/ast/fromWasmNode.d.ts +2 -2
  4. package/dist/cjs/ast/index.d.ts +2 -0
  5. package/dist/{node/js → cjs}/ast/index.js +2 -2
  6. package/dist/{node/js → cjs}/fixedScriptWallet.d.ts +4 -4
  7. package/dist/{node/js → cjs}/fixedScriptWallet.js +5 -5
  8. package/dist/{node/js → cjs}/index.d.ts +11 -11
  9. package/dist/{node/js → cjs}/index.js +11 -11
  10. package/dist/cjs/package.json +1 -0
  11. package/dist/{browser/js → cjs}/utxolibCompat.d.ts +2 -2
  12. package/dist/{node/js → cjs}/utxolibCompat.js +3 -3
  13. package/dist/{browser/js → cjs}/wasm/wasm_utxo_bg.wasm +0 -0
  14. package/dist/{node/js → esm}/address.d.ts +1 -1
  15. package/dist/{browser/js → esm}/address.js +1 -1
  16. package/dist/{node/js → esm}/ast/fromWasmNode.d.ts +2 -2
  17. package/dist/esm/ast/index.d.ts +2 -0
  18. package/dist/esm/ast/index.js +2 -0
  19. package/dist/{browser/js → esm}/fixedScriptWallet.d.ts +4 -4
  20. package/dist/{browser/js → esm}/fixedScriptWallet.js +3 -2
  21. package/dist/{browser/js → esm}/index.d.ts +11 -11
  22. package/dist/esm/index.js +11 -0
  23. package/dist/{node/js → esm}/utxolibCompat.d.ts +2 -2
  24. package/dist/{browser/js → esm}/utxolibCompat.js +1 -1
  25. package/dist/{node/js → esm}/wasm/wasm_utxo_bg.wasm +0 -0
  26. package/package.json +27 -53
  27. package/dist/browser/js/ast/index.d.ts +0 -2
  28. package/dist/browser/js/ast/index.js +0 -2
  29. package/dist/browser/js/index.js +0 -11
  30. package/dist/node/js/ast/index.d.ts +0 -2
  31. /package/dist/{browser/js → cjs}/ast/formatNode.d.ts +0 -0
  32. /package/dist/{node/js → cjs}/ast/formatNode.js +0 -0
  33. /package/dist/{node/js → cjs}/ast/fromWasmNode.js +0 -0
  34. /package/dist/{browser/js → cjs}/coinName.d.ts +0 -0
  35. /package/dist/{node/js → cjs}/coinName.js +0 -0
  36. /package/dist/{browser/js → cjs}/triple.d.ts +0 -0
  37. /package/dist/{node/js → cjs}/triple.js +0 -0
  38. /package/dist/{browser/js → cjs}/wasm/wasm_utxo.d.ts +0 -0
  39. /package/dist/{node/js → cjs}/wasm/wasm_utxo.js +0 -0
  40. /package/dist/{browser/js → cjs}/wasm/wasm_utxo_bg.wasm.d.ts +0 -0
  41. /package/dist/{node/js → esm}/ast/formatNode.d.ts +0 -0
  42. /package/dist/{browser/js → esm}/ast/formatNode.js +0 -0
  43. /package/dist/{browser/js → esm}/ast/fromWasmNode.js +0 -0
  44. /package/dist/{node/js → esm}/coinName.d.ts +0 -0
  45. /package/dist/{browser/js → esm}/coinName.js +0 -0
  46. /package/dist/{node/js → esm}/triple.d.ts +0 -0
  47. /package/dist/{browser/js → esm}/triple.js +0 -0
  48. /package/dist/{node/js → esm}/wasm/wasm_utxo.d.ts +0 -0
  49. /package/dist/{browser/js → esm}/wasm/wasm_utxo.js +0 -0
  50. /package/dist/{browser/js → esm}/wasm/wasm_utxo_bg.js +0 -0
  51. /package/dist/{node/js → esm}/wasm/wasm_utxo_bg.wasm.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import type { CoinName } from "./coinName";
1
+ import type { CoinName } from "./coinName.js";
2
2
  /**
3
3
  * Most coins only have one unambiguous address format (base58check and bech32/bech32m)
4
4
  * For Bitcoin Cash and eCash, we can select between base58check and cashaddr.
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toOutputScriptWithCoin = toOutputScriptWithCoin;
4
4
  exports.fromOutputScriptWithCoin = fromOutputScriptWithCoin;
5
- const wasm_utxo_1 = require("./wasm/wasm_utxo");
5
+ const wasm_utxo_js_1 = require("./wasm/wasm_utxo.js");
6
6
  function toOutputScriptWithCoin(address, coin) {
7
- return wasm_utxo_1.AddressNamespace.to_output_script_with_coin(address, coin);
7
+ return wasm_utxo_js_1.AddressNamespace.to_output_script_with_coin(address, coin);
8
8
  }
9
9
  function fromOutputScriptWithCoin(script, coin, format) {
10
- return wasm_utxo_1.AddressNamespace.from_output_script_with_coin(script, coin, format);
10
+ return wasm_utxo_js_1.AddressNamespace.from_output_script_with_coin(script, coin, format);
11
11
  }
@@ -1,4 +1,4 @@
1
- import { DescriptorNode, MiniscriptNode } from "./formatNode";
2
- import { Descriptor, Miniscript } from "../index";
1
+ import { DescriptorNode, MiniscriptNode } from "./formatNode.js";
2
+ import { Descriptor, Miniscript } from "../index.js";
3
3
  export declare function fromDescriptor(d: Descriptor): DescriptorNode;
4
4
  export declare function fromMiniscript(m: Miniscript): MiniscriptNode;
@@ -0,0 +1,2 @@
1
+ export * from "./formatNode.js";
2
+ export * from "./fromWasmNode.js";
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./formatNode"), exports);
18
- __exportStar(require("./fromWasmNode"), exports);
17
+ __exportStar(require("./formatNode.js"), exports);
18
+ __exportStar(require("./fromWasmNode.js"), exports);
@@ -1,7 +1,7 @@
1
- import type { UtxolibName, UtxolibNetwork, UtxolibRootWalletKeys } from "./utxolibCompat";
2
- import type { CoinName } from "./coinName";
3
- import { Triple } from "./triple";
4
- import { AddressFormat } from "./address";
1
+ import type { UtxolibName, UtxolibNetwork, UtxolibRootWalletKeys } from "./utxolibCompat.js";
2
+ import type { CoinName } from "./coinName.js";
3
+ import { Triple } from "./triple.js";
4
+ import { AddressFormat } from "./address.js";
5
5
  export type NetworkName = UtxolibName | CoinName;
6
6
  export type WalletKeys =
7
7
  /** Just an xpub triple, will assume default derivation prefixes */
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BitGoPsbt = void 0;
4
4
  exports.outputScript = outputScript;
5
5
  exports.address = address;
6
- const wasm_utxo_1 = require("./wasm/wasm_utxo");
6
+ const wasm_utxo_js_1 = require("./wasm/wasm_utxo.js");
7
7
  /**
8
8
  * Create the output script for a given wallet keys and chain and index
9
9
  */
10
10
  function outputScript(keys, chain, index, network) {
11
- return wasm_utxo_1.FixedScriptWalletNamespace.output_script(keys, chain, index, network);
11
+ return wasm_utxo_js_1.FixedScriptWalletNamespace.output_script(keys, chain, index, network);
12
12
  }
13
13
  /**
14
14
  * Create the address for a given wallet keys and chain and index and network.
@@ -23,9 +23,9 @@ function outputScript(keys, chain, index, network) {
23
23
  * - "cashaddr" means cashaddr.
24
24
  */
25
25
  function address(keys, chain, index, network, addressFormat) {
26
- return wasm_utxo_1.FixedScriptWalletNamespace.address(keys, chain, index, network, addressFormat);
26
+ return wasm_utxo_js_1.FixedScriptWalletNamespace.address(keys, chain, index, network, addressFormat);
27
27
  }
28
- const wasm_utxo_2 = require("./wasm/wasm_utxo");
28
+ const wasm_utxo_js_2 = require("./wasm/wasm_utxo.js");
29
29
  class BitGoPsbt {
30
30
  wasm;
31
31
  constructor(wasm) {
@@ -38,7 +38,7 @@ class BitGoPsbt {
38
38
  * @returns A BitGoPsbt instance
39
39
  */
40
40
  static fromBytes(bytes, network) {
41
- const wasm = wasm_utxo_2.BitGoPsbt.from_bytes(bytes, network);
41
+ const wasm = wasm_utxo_js_2.BitGoPsbt.from_bytes(bytes, network);
42
42
  return new BitGoPsbt(wasm);
43
43
  }
44
44
  /**
@@ -1,16 +1,16 @@
1
- export * as address from "./address";
2
- export * as ast from "./ast";
3
- export * as utxolibCompat from "./utxolibCompat";
4
- export * as fixedScriptWallet from "./fixedScriptWallet";
5
- export type { CoinName } from "./coinName";
6
- export type { Triple } from "./triple";
7
- export type { AddressFormat } from "./address";
1
+ export * as address from "./address.js";
2
+ export * as ast from "./ast/index.js";
3
+ export * as utxolibCompat from "./utxolibCompat.js";
4
+ export * as fixedScriptWallet from "./fixedScriptWallet.js";
5
+ export type { CoinName } from "./coinName.js";
6
+ export type { Triple } from "./triple.js";
7
+ export type { AddressFormat } from "./address.js";
8
8
  export type DescriptorPkType = "derivable" | "definite" | "string";
9
9
  export type ScriptContext = "tap" | "segwitv0" | "legacy";
10
10
  export type SignPsbtResult = {
11
11
  [inputIndex: number]: [pubkey: string][];
12
12
  };
13
- declare module "./wasm/wasm_utxo" {
13
+ declare module "./wasm/wasm_utxo.js" {
14
14
  interface WrapDescriptor {
15
15
  /** These are not the same types of nodes as in the ast module */
16
16
  node(): unknown;
@@ -32,6 +32,6 @@ declare module "./wasm/wasm_utxo" {
32
32
  signWithPrv(this: WrapPsbt, prv: Uint8Array): SignPsbtResult;
33
33
  }
34
34
  }
35
- export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo";
36
- export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo";
37
- export { WrapPsbt as Psbt } from "./wasm/wasm_utxo";
35
+ export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo.js";
36
+ export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo.js";
37
+ export { WrapPsbt as Psbt } from "./wasm/wasm_utxo.js";
@@ -34,17 +34,17 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Psbt = exports.Miniscript = exports.Descriptor = exports.fixedScriptWallet = exports.utxolibCompat = exports.ast = exports.address = void 0;
37
- const wasm = __importStar(require("./wasm/wasm_utxo"));
37
+ const wasm = __importStar(require("./wasm/wasm_utxo.js"));
38
38
  // we need to access the wasm module here, otherwise webpack gets all weird
39
39
  // and forgets to include it in the bundle
40
40
  void wasm;
41
- exports.address = __importStar(require("./address"));
42
- exports.ast = __importStar(require("./ast"));
43
- exports.utxolibCompat = __importStar(require("./utxolibCompat"));
44
- exports.fixedScriptWallet = __importStar(require("./fixedScriptWallet"));
45
- var wasm_utxo_1 = require("./wasm/wasm_utxo");
46
- Object.defineProperty(exports, "Descriptor", { enumerable: true, get: function () { return wasm_utxo_1.WrapDescriptor; } });
47
- var wasm_utxo_2 = require("./wasm/wasm_utxo");
48
- Object.defineProperty(exports, "Miniscript", { enumerable: true, get: function () { return wasm_utxo_2.WrapMiniscript; } });
49
- var wasm_utxo_3 = require("./wasm/wasm_utxo");
50
- Object.defineProperty(exports, "Psbt", { enumerable: true, get: function () { return wasm_utxo_3.WrapPsbt; } });
41
+ exports.address = __importStar(require("./address.js"));
42
+ exports.ast = __importStar(require("./ast/index.js"));
43
+ exports.utxolibCompat = __importStar(require("./utxolibCompat.js"));
44
+ exports.fixedScriptWallet = __importStar(require("./fixedScriptWallet.js"));
45
+ var wasm_utxo_js_1 = require("./wasm/wasm_utxo.js");
46
+ Object.defineProperty(exports, "Descriptor", { enumerable: true, get: function () { return wasm_utxo_js_1.WrapDescriptor; } });
47
+ var wasm_utxo_js_2 = require("./wasm/wasm_utxo.js");
48
+ Object.defineProperty(exports, "Miniscript", { enumerable: true, get: function () { return wasm_utxo_js_2.WrapMiniscript; } });
49
+ var wasm_utxo_js_3 = require("./wasm/wasm_utxo.js");
50
+ Object.defineProperty(exports, "Psbt", { enumerable: true, get: function () { return wasm_utxo_js_3.WrapPsbt; } });
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -1,5 +1,5 @@
1
- import type { AddressFormat } from "./address";
2
- import { Triple } from "./triple";
1
+ import type { AddressFormat } from "./address.js";
2
+ import { Triple } from "./triple.js";
3
3
  export type UtxolibName = "bitcoin" | "testnet" | "bitcoinTestnet4" | "bitcoinPublicSignet" | "bitcoinBitGoSignet" | "bitcoincash" | "bitcoincashTestnet" | "ecash" | "ecashTest" | "bitcoingold" | "bitcoingoldTestnet" | "bitcoinsv" | "bitcoinsvTestnet" | "dash" | "dashTest" | "dogecoin" | "dogecoinTest" | "litecoin" | "litecoinTest" | "zcash" | "zcashTest";
4
4
  export type BIP32Interface = {
5
5
  network: {
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fromOutputScript = fromOutputScript;
4
4
  exports.toOutputScript = toOutputScript;
5
- const wasm_utxo_1 = require("./wasm/wasm_utxo");
5
+ const wasm_utxo_js_1 = require("./wasm/wasm_utxo.js");
6
6
  function fromOutputScript(script, network, format) {
7
- return wasm_utxo_1.UtxolibCompatNamespace.from_output_script(script, network, format);
7
+ return wasm_utxo_js_1.UtxolibCompatNamespace.from_output_script(script, network, format);
8
8
  }
9
9
  function toOutputScript(address, network, format) {
10
- return wasm_utxo_1.UtxolibCompatNamespace.to_output_script(address, network, format);
10
+ return wasm_utxo_js_1.UtxolibCompatNamespace.to_output_script(address, network, format);
11
11
  }
@@ -1,4 +1,4 @@
1
- import type { CoinName } from "./coinName";
1
+ import type { CoinName } from "./coinName.js";
2
2
  /**
3
3
  * Most coins only have one unambiguous address format (base58check and bech32/bech32m)
4
4
  * For Bitcoin Cash and eCash, we can select between base58check and cashaddr.
@@ -1,4 +1,4 @@
1
- import { AddressNamespace } from "./wasm/wasm_utxo";
1
+ import { AddressNamespace } from "./wasm/wasm_utxo.js";
2
2
  export function toOutputScriptWithCoin(address, coin) {
3
3
  return AddressNamespace.to_output_script_with_coin(address, coin);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { DescriptorNode, MiniscriptNode } from "./formatNode";
2
- import { Descriptor, Miniscript } from "../index";
1
+ import { DescriptorNode, MiniscriptNode } from "./formatNode.js";
2
+ import { Descriptor, Miniscript } from "../index.js";
3
3
  export declare function fromDescriptor(d: Descriptor): DescriptorNode;
4
4
  export declare function fromMiniscript(m: Miniscript): MiniscriptNode;
@@ -0,0 +1,2 @@
1
+ export * from "./formatNode.js";
2
+ export * from "./fromWasmNode.js";
@@ -0,0 +1,2 @@
1
+ export * from "./formatNode.js";
2
+ export * from "./fromWasmNode.js";
@@ -1,7 +1,7 @@
1
- import type { UtxolibName, UtxolibNetwork, UtxolibRootWalletKeys } from "./utxolibCompat";
2
- import type { CoinName } from "./coinName";
3
- import { Triple } from "./triple";
4
- import { AddressFormat } from "./address";
1
+ import type { UtxolibName, UtxolibNetwork, UtxolibRootWalletKeys } from "./utxolibCompat.js";
2
+ import type { CoinName } from "./coinName.js";
3
+ import { Triple } from "./triple.js";
4
+ import { AddressFormat } from "./address.js";
5
5
  export type NetworkName = UtxolibName | CoinName;
6
6
  export type WalletKeys =
7
7
  /** Just an xpub triple, will assume default derivation prefixes */
@@ -1,4 +1,4 @@
1
- import { FixedScriptWalletNamespace } from "./wasm/wasm_utxo";
1
+ import { FixedScriptWalletNamespace } from "./wasm/wasm_utxo.js";
2
2
  /**
3
3
  * Create the output script for a given wallet keys and chain and index
4
4
  */
@@ -20,8 +20,9 @@ export function outputScript(keys, chain, index, network) {
20
20
  export function address(keys, chain, index, network, addressFormat) {
21
21
  return FixedScriptWalletNamespace.address(keys, chain, index, network, addressFormat);
22
22
  }
23
- import { BitGoPsbt as WasmBitGoPsbt } from "./wasm/wasm_utxo";
23
+ import { BitGoPsbt as WasmBitGoPsbt } from "./wasm/wasm_utxo.js";
24
24
  export class BitGoPsbt {
25
+ wasm;
25
26
  constructor(wasm) {
26
27
  this.wasm = wasm;
27
28
  }
@@ -1,16 +1,16 @@
1
- export * as address from "./address";
2
- export * as ast from "./ast";
3
- export * as utxolibCompat from "./utxolibCompat";
4
- export * as fixedScriptWallet from "./fixedScriptWallet";
5
- export type { CoinName } from "./coinName";
6
- export type { Triple } from "./triple";
7
- export type { AddressFormat } from "./address";
1
+ export * as address from "./address.js";
2
+ export * as ast from "./ast/index.js";
3
+ export * as utxolibCompat from "./utxolibCompat.js";
4
+ export * as fixedScriptWallet from "./fixedScriptWallet.js";
5
+ export type { CoinName } from "./coinName.js";
6
+ export type { Triple } from "./triple.js";
7
+ export type { AddressFormat } from "./address.js";
8
8
  export type DescriptorPkType = "derivable" | "definite" | "string";
9
9
  export type ScriptContext = "tap" | "segwitv0" | "legacy";
10
10
  export type SignPsbtResult = {
11
11
  [inputIndex: number]: [pubkey: string][];
12
12
  };
13
- declare module "./wasm/wasm_utxo" {
13
+ declare module "./wasm/wasm_utxo.js" {
14
14
  interface WrapDescriptor {
15
15
  /** These are not the same types of nodes as in the ast module */
16
16
  node(): unknown;
@@ -32,6 +32,6 @@ declare module "./wasm/wasm_utxo" {
32
32
  signWithPrv(this: WrapPsbt, prv: Uint8Array): SignPsbtResult;
33
33
  }
34
34
  }
35
- export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo";
36
- export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo";
37
- export { WrapPsbt as Psbt } from "./wasm/wasm_utxo";
35
+ export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo.js";
36
+ export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo.js";
37
+ export { WrapPsbt as Psbt } from "./wasm/wasm_utxo.js";
@@ -0,0 +1,11 @@
1
+ import * as wasm from "./wasm/wasm_utxo.js";
2
+ // we need to access the wasm module here, otherwise webpack gets all weird
3
+ // and forgets to include it in the bundle
4
+ void wasm;
5
+ export * as address from "./address.js";
6
+ export * as ast from "./ast/index.js";
7
+ export * as utxolibCompat from "./utxolibCompat.js";
8
+ export * as fixedScriptWallet from "./fixedScriptWallet.js";
9
+ export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo.js";
10
+ export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo.js";
11
+ export { WrapPsbt as Psbt } from "./wasm/wasm_utxo.js";
@@ -1,5 +1,5 @@
1
- import type { AddressFormat } from "./address";
2
- import { Triple } from "./triple";
1
+ import type { AddressFormat } from "./address.js";
2
+ import { Triple } from "./triple.js";
3
3
  export type UtxolibName = "bitcoin" | "testnet" | "bitcoinTestnet4" | "bitcoinPublicSignet" | "bitcoinBitGoSignet" | "bitcoincash" | "bitcoincashTestnet" | "ecash" | "ecashTest" | "bitcoingold" | "bitcoingoldTestnet" | "bitcoinsv" | "bitcoinsvTestnet" | "dash" | "dashTest" | "dogecoin" | "dogecoinTest" | "litecoin" | "litecoinTest" | "zcash" | "zcashTest";
4
4
  export type BIP32Interface = {
5
5
  network: {
@@ -1,4 +1,4 @@
1
- import { UtxolibCompatNamespace } from "./wasm/wasm_utxo";
1
+ import { UtxolibCompatNamespace } from "./wasm/wasm_utxo.js";
2
2
  export function fromOutputScript(script, network, format) {
3
3
  return UtxolibCompatNamespace.from_output_script(script, network, format);
4
4
  }
package/package.json CHANGED
@@ -1,77 +1,51 @@
1
1
  {
2
2
  "name": "@bitgo/wasm-utxo",
3
3
  "description": "WebAssembly wrapper for rust-bitcoin (beta)",
4
- "version": "1.2.0",
4
+ "version": "1.4.0",
5
+ "type": "module",
5
6
  "repository": {
6
7
  "type": "git",
7
8
  "url": "git+https://github.com/BitGo/BitGoWASM"
8
9
  },
9
10
  "license": "MIT",
10
11
  "files": [
11
- "dist/*/js/wasm/wasm_utxo.d.ts",
12
- "dist/*/js/wasm/wasm_utxo.js",
13
- "dist/*/js/wasm/wasm_utxo_bg.js",
14
- "dist/*/js/wasm/wasm_utxo_bg.wasm",
15
- "dist/*/js/wasm/wasm_utxo_bg.wasm.d.ts",
16
- "dist/*/js/ast/*",
17
- "dist/*/js/index.*",
18
- "dist/*/js/address.*",
19
- "dist/*/js/utxolibCompat.*",
20
- "dist/*/js/fixedScriptWallet.*",
21
- "dist/*/js/coinName.*",
22
- "dist/*/js/triple.*"
12
+ "dist/esm/**/*",
13
+ "dist/cjs/**/*"
23
14
  ],
24
- "main": "dist/node/js/index.js",
25
- "types": "dist/node/js/index.d.ts",
26
15
  "exports": {
27
16
  ".": {
28
- "types": "./dist/node/js/index.d.ts",
29
- "browser": "./dist/browser/js/index.js",
30
- "default": "./dist/node/js/index.js"
31
- },
32
- "./address": {
33
- "types": "./dist/node/js/address.d.ts",
34
- "browser": "./dist/browser/js/address.js",
35
- "default": "./dist/node/js/address.js"
36
- },
37
- "./ast": {
38
- "types": "./dist/node/js/ast/index.d.ts",
39
- "browser": "./dist/browser/js/ast/index.js",
40
- "default": "./dist/node/js/ast/index.js"
41
- },
42
- "./fixedScriptWallet": {
43
- "types": "./dist/node/js/fixedScriptWallet.d.ts",
44
- "browser": "./dist/browser/js/fixedScriptWallet.js",
45
- "default": "./dist/node/js/fixedScriptWallet.js"
46
- },
47
- "./utxolibCompat": {
48
- "types": "./dist/node/js/utxolibCompat.d.ts",
49
- "browser": "./dist/browser/js/utxolibCompat.js",
50
- "default": "./dist/node/js/utxolibCompat.js"
51
- },
52
- "./dist/browser/js/wasm/wasm_utxo_bg.js": "./dist/browser/js/wasm/wasm_utxo_bg.js",
53
- "./dist/browser/js/wasm/wasm_utxo_bg.wasm": "./dist/browser/js/wasm/wasm_utxo_bg.wasm",
54
- "./dist/node/js/wasm/wasm_utxo_bg.js": "./dist/node/js/wasm/wasm_utxo_bg.js",
55
- "./dist/node/js/wasm/wasm_utxo_bg.wasm": "./dist/node/js/wasm/wasm_utxo_bg.wasm"
17
+ "import": {
18
+ "types": "./dist/esm/index.d.ts",
19
+ "default": "./dist/esm/index.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/cjs/index.d.ts",
23
+ "default": "./dist/cjs/index.js"
24
+ }
25
+ }
56
26
  },
27
+ "main": "./dist/cjs/index.js",
28
+ "module": "./dist/esm/index.js",
29
+ "types": "./dist/esm/index.d.ts",
57
30
  "sideEffects": [
58
- "./dist/node/js/wasm/wasm_utxo.js",
59
- "./dist/browser/js/wasm/wasm_utxo.js"
31
+ "./dist/esm/wasm/wasm_utxo.js",
32
+ "./dist/cjs/wasm/wasm_utxo.js"
60
33
  ],
61
- "browser": {
62
- "./dist/node/js/index.js": "./dist/browser/js/index.js"
63
- },
64
34
  "scripts": {
65
35
  "test": "npm run test:mocha && npm run test:wasm-pack",
66
36
  "test:mocha": "mocha --recursive test",
67
37
  "test:wasm-pack": "npm run test:wasm-pack-node && npm run test:wasm-pack-chrome",
68
38
  "test:wasm-pack-node": "wasm-pack test --node",
69
39
  "test:wasm-pack-chrome": "wasm-pack test --headless --chrome",
70
- "build:wasm": "make js/wasm/ && make dist/node/js/wasm/ && make dist/browser/js/wasm/",
71
- "build:ts-browser": "tsc --noEmit false --module es2020 --target es2020 --outDir dist/browser",
72
- "build:ts-node": "tsc --noEmit false --outDir dist/node",
73
- "build:ts": "npm run build:ts-browser && npm run build:ts-node",
74
- "build": "npm run build:wasm && npm run build:ts",
40
+ "test:esm-import": "node --experimental-wasm-modules bundler-test/test-esm-import.mjs",
41
+ "test:cjs-import": "node bundler-test/test-cjs-import.cjs",
42
+ "test:imports": "npm run test:esm-import && npm run test:cjs-import",
43
+ "build:wasm": "make js/wasm/ && make dist/esm/wasm/ && make dist/cjs/wasm/",
44
+ "build:ts-esm": "tsc",
45
+ "build:ts-cjs": "tsc --project tsconfig.cjs.json",
46
+ "build:ts": "npm run build:ts-esm && npm run build:ts-cjs",
47
+ "build:package-json": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
48
+ "build": "npm run build:wasm && npm run build:ts && npm run build:package-json",
75
49
  "check-fmt": "prettier --check . && cargo fmt -- --check"
76
50
  },
77
51
  "devDependencies": {
@@ -1,2 +0,0 @@
1
- export * from "./formatNode";
2
- export * from "./fromWasmNode";
@@ -1,2 +0,0 @@
1
- export * from "./formatNode";
2
- export * from "./fromWasmNode";
@@ -1,11 +0,0 @@
1
- import * as wasm from "./wasm/wasm_utxo";
2
- // we need to access the wasm module here, otherwise webpack gets all weird
3
- // and forgets to include it in the bundle
4
- void wasm;
5
- export * as address from "./address";
6
- export * as ast from "./ast";
7
- export * as utxolibCompat from "./utxolibCompat";
8
- export * as fixedScriptWallet from "./fixedScriptWallet";
9
- export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo";
10
- export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo";
11
- export { WrapPsbt as Psbt } from "./wasm/wasm_utxo";
@@ -1,2 +0,0 @@
1
- export * from "./formatNode";
2
- export * from "./fromWasmNode";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes