@bitgo-beta/utxo-staking 1.1.1-beta.212 → 1.1.1-beta.213

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/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@bitgo-beta/utxo-staking",
3
- "version": "1.1.1-beta.212",
3
+ "version": "1.1.1-beta.213",
4
4
  "description": "BitGo SDK for build UTXO staking transactions",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
+ "files": [
8
+ "dist/src"
9
+ ],
7
10
  "scripts": {
8
11
  "build": "yarn tsc --build --incremental --verbose .",
9
12
  "fmt": "prettier --write .",
@@ -40,10 +43,10 @@
40
43
  },
41
44
  "dependencies": {
42
45
  "@babylonlabs-io/babylon-proto-ts": "1.0.0",
43
- "@bitgo-beta/babylonlabs-io-btc-staking-ts": "0.4.0-beta.16",
44
- "@bitgo-beta/unspents": "0.13.2-beta.771",
45
- "@bitgo-beta/utxo-core": "1.0.0-beta.82",
46
- "@bitgo-beta/utxo-lib": "8.0.3-beta.772",
46
+ "@bitgo-beta/babylonlabs-io-btc-staking-ts": "0.4.0-beta.17",
47
+ "@bitgo-beta/unspents": "0.13.2-beta.772",
48
+ "@bitgo-beta/utxo-core": "1.0.0-beta.83",
49
+ "@bitgo-beta/utxo-lib": "8.0.3-beta.773",
47
50
  "@bitgo/wasm-miniscript": "2.0.0-beta.7",
48
51
  "bitcoinjs-lib": "^6.1.7",
49
52
  "fp-ts": "^2.16.2",
@@ -53,5 +56,5 @@
53
56
  "devDependencies": {
54
57
  "yargs": "^17.7.2"
55
58
  },
56
- "gitHead": "da34a9ebc0fab32f43697e4dd5e3f496a0ac9afd"
59
+ "gitHead": "2ade959ee2bcb8e0e094648581ce89f7d20decb2"
57
60
  }
package/.eslintignore DELETED
@@ -1,5 +0,0 @@
1
- node_modules
2
- .idea
3
- public
4
- dist
5
- test/unit/babylon/vendor/btc-staking-ts
package/.eslintrc.js DELETED
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- extends: ['../../.eslintrc.json'],
3
- rules: {
4
- 'import/order': ['error', { 'newlines-between': 'always' }],
5
- 'import/no-internal-modules': 'off',
6
- },
7
- };
package/CHANGELOG.md DELETED
@@ -1,120 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [1.10.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.9.0...@bitgo/utxo-staking@1.10.0) (2025-03-18)
7
-
8
- ### Features
9
-
10
- - **deps:** add babylonlabs package as dev dependency ([65e31bf](https://github.com/BitGo/BitGoJS/commit/65e31bff9e43f9f5401ca3dd334bf01085855128))
11
- - **utxo-staking:** add test for babylon delegation message ([d1bf8c3](https://github.com/BitGo/BitGoJS/commit/d1bf8c3083b6f3f5f7f629b56c60e548608cdbbe))
12
- - **utxo-staking:** add unsigned delegation message creation ([7fb9d68](https://github.com/BitGo/BitGoJS/commit/7fb9d68c6e7d2ac8f19c2f416807acb589c86f02))
13
- - **utxo-staking:** add utils for creating unsigned delegation messages ([071f7e4](https://github.com/BitGo/BitGoJS/commit/071f7e40a0c50cf90d4c185c3e5e7f3bdca90f35))
14
- - **utxo-staking:** bump babylon-proto-ts to 1.0.0 ([889b1c7](https://github.com/BitGo/BitGoJS/commit/889b1c7c8323db918d459117683c46afabfe83a6))
15
-
16
- # [1.9.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.8.0...@bitgo/utxo-staking@1.9.0) (2025-03-06)
17
-
18
- ### Features
19
-
20
- - **utxo-staking:** add normalize helper for test fixtures ([b2266d8](https://github.com/BitGo/BitGoJS/commit/b2266d8264b7579ebd505cb7c723389439f65849))
21
-
22
- # [1.8.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.6.0...@bitgo/utxo-staking@1.8.0) (2025-03-04)
23
-
24
- ### Bug Fixes
25
-
26
- - **utxo-staking:** avoid mutating input array in sortedKeys ([17f6e5d](https://github.com/BitGo/BitGoJS/commit/17f6e5de5f16d0356075816ba3f204b8612ce641))
27
-
28
- ### Features
29
-
30
- - **utxo-core:** simplify module exports ([ea7cd0f](https://github.com/BitGo/BitGoJS/commit/ea7cd0f90977894c25fc0734386b9e8d27465fd5))
31
- - **utxo-staking:** add single key finality provider script generation ([0fe5393](https://github.com/BitGo/BitGoJS/commit/0fe539359f01c204d34cfe86f208cdc2697bcb7d))
32
- - **utxo-staking:** exclude test fixtures from prettier formatting ([7cf7bdc](https://github.com/BitGo/BitGoJS/commit/7cf7bdcc57bc5ee09be387abcf5ae119889f44db))
33
- - **utxo-staking:** update CoreDAO output type to use utxo-core Output ([30902d6](https://github.com/BitGo/BitGoJS/commit/30902d6e152581651806a86aa3d1b2f56a1a9830))
34
-
35
- # [1.7.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.6.0...@bitgo/utxo-staking@1.7.0) (2025-02-26)
36
-
37
- ### Bug Fixes
38
-
39
- - **utxo-staking:** avoid mutating input array in sortedKeys ([17f6e5d](https://github.com/BitGo/BitGoJS/commit/17f6e5de5f16d0356075816ba3f204b8612ce641))
40
-
41
- ### Features
42
-
43
- - **utxo-staking:** add single key finality provider script generation ([0fe5393](https://github.com/BitGo/BitGoJS/commit/0fe539359f01c204d34cfe86f208cdc2697bcb7d))
44
- - **utxo-staking:** exclude test fixtures from prettier formatting ([7cf7bdc](https://github.com/BitGo/BitGoJS/commit/7cf7bdcc57bc5ee09be387abcf5ae119889f44db))
45
-
46
- ## [1.6.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.6.0...@bitgo/utxo-staking@1.6.1) (2025-02-20)
47
-
48
- **Note:** Version bump only for package @bitgo/utxo-staking
49
-
50
- # [1.6.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.5.0...@bitgo/utxo-staking@1.6.0) (2025-02-19)
51
-
52
- ### Features
53
-
54
- - **utxo-staking:** add testnet params and descriptor builder for Babylon ([b0764bb](https://github.com/BitGo/BitGoJS/commit/b0764bb644ad2313ac19ddd4210f340fbf9b60f1))
55
- - **utxo-staking:** add vendored btc-staking-ts 0.4.0-rc.2 ([607fd3e](https://github.com/BitGo/BitGoJS/commit/607fd3eaea6508668ae42dbe9c5d2444d12ec245))
56
- - **utxo-staking:** enable import ordering rule ([0f8b127](https://github.com/BitGo/BitGoJS/commit/0f8b1273a6e5683610a7131de828d6e21a5a4bc4))
57
- - **utxo-staking:** export babylon staking module ([4e86a2c](https://github.com/BitGo/BitGoJS/commit/4e86a2c06fe68a5592aa937399a0e5aa6648e24e))
58
- - **utxo-staking:** migrate test utils to utxo-core ([4395971](https://github.com/BitGo/BitGoJS/commit/4395971fcc21afaf55727f6badb26335c91cde19))
59
- - **utxo-staking:** simplify mocha config and test scripts ([44b3d7c](https://github.com/BitGo/BitGoJS/commit/44b3d7c0ae0cc1d0c4b49f5fcbeabc21cfb7effa))
60
- - **utxo-staking:** use miniscript AST for descriptor creation ([bc0fb09](https://github.com/BitGo/BitGoJS/commit/bc0fb096ce29dae1e6cde984f3d54f9a292d4996))
61
- - **utxo-staking:** use TapTreeNode type for Babylon descriptor ([79f9c5c](https://github.com/BitGo/BitGoJS/commit/79f9c5c8e8650b494ec1afa2fa215328d3d1facb))
62
-
63
- # [1.5.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.3.5...@bitgo/utxo-staking@1.5.0) (2024-12-17)
64
-
65
- ### Features
66
-
67
- - **utxo-staking:** add support for wsh script type ([c3632a4](https://github.com/BitGo/BitGoJS/commit/c3632a456a92953ee52340c79740bcd9e6f66215))
68
-
69
- # [1.4.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.3.5...@bitgo/utxo-staking@1.4.0) (2024-12-17)
70
-
71
- ### Features
72
-
73
- - **utxo-staking:** add support for wsh script type ([c3632a4](https://github.com/BitGo/BitGoJS/commit/c3632a456a92953ee52340c79740bcd9e6f66215))
74
-
75
- ## [1.3.5](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.3.4...@bitgo/utxo-staking@1.3.5) (2024-12-12)
76
-
77
- **Note:** Version bump only for package @bitgo/utxo-staking
78
-
79
- ## [1.3.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.3.3...@bitgo/utxo-staking@1.3.4) (2024-12-11)
80
-
81
- **Note:** Version bump only for package @bitgo/utxo-staking
82
-
83
- ## [1.3.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.3.2...@bitgo/utxo-staking@1.3.3) (2024-12-03)
84
-
85
- **Note:** Version bump only for package @bitgo/utxo-staking
86
-
87
- ## [1.3.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.3.1...@bitgo/utxo-staking@1.3.2) (2024-11-26)
88
-
89
- **Note:** Version bump only for package @bitgo/utxo-staking
90
-
91
- ## [1.3.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/utxo-staking@1.3.0...@bitgo/utxo-staking@1.3.1) (2024-11-21)
92
-
93
- **Note:** Version bump only for package @bitgo/utxo-staking
94
-
95
- # 1.3.0 (2024-11-19)
96
-
97
- ### Features
98
-
99
- - **utxo-staking:** build staking transaction ([73b33bc](https://github.com/BitGo/BitGoJS/commit/73b33bc93e46934fe5e6002c52c0b1443a3d0d8d))
100
- - **utxo-staking:** create coredao staking outputs ([6b5ca4b](https://github.com/BitGo/BitGoJS/commit/6b5ca4b7c726fb6a4380526391416f6db356e0b7))
101
-
102
- # 1.2.0 (2024-11-14)
103
-
104
- ### Features
105
-
106
- - **utxo-staking:** build staking transaction ([73b33bc](https://github.com/BitGo/BitGoJS/commit/73b33bc93e46934fe5e6002c52c0b1443a3d0d8d))
107
- - **utxo-staking:** create coredao staking outputs ([6b5ca4b](https://github.com/BitGo/BitGoJS/commit/6b5ca4b7c726fb6a4380526391416f6db356e0b7))
108
-
109
- # 1.1.0 (2024-11-01)
110
-
111
- ### Bug Fixes
112
-
113
- - **utxo-coredao:** clarifications from the coredao team ([56157b3](https://github.com/BitGo/BitGoJS/commit/56157b34e6802895489928d8e7a87f8f5c8129ed))
114
- - **utxo-coredao:** fix json encoding to add newline ([bb5be2f](https://github.com/BitGo/BitGoJS/commit/bb5be2f91e0e7f1d59d94a1786fdd2cccc4ebad6))
115
-
116
- ### Features
117
-
118
- - **utxo-coredao:** descriptor for CoreDao ([791f9e4](https://github.com/BitGo/BitGoJS/commit/791f9e47033a8224759d98f0483f5b0bb9bbc524))
119
- - **utxo-coredao:** init repo and op-return ([60fa058](https://github.com/BitGo/BitGoJS/commit/60fa058f693cf722db8d5e7507539a5ec1c8b1a5))
120
- - **utxo-coredao:** parse and verify op-return ([32dc7c4](https://github.com/BitGo/BitGoJS/commit/32dc7c49f0ff5baeb0db4a20853f70745f71c02b))
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=babylon-params.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"babylon-params.d.ts","sourceRoot":"","sources":["../../scripts/babylon-params.ts"],"names":[],"mappings":""}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- const fs = __importStar(require("fs/promises"));
40
- const yargs_1 = __importDefault(require("yargs"));
41
- const helpers_1 = require("yargs/helpers");
42
- function getBaseUrl(network) {
43
- if (network === 'mainnet') {
44
- throw new Error('Mainnet not supported');
45
- }
46
- return 'https://babylon-testnet-api.nodes.guru';
47
- }
48
- async function getParams(network, version) {
49
- const url = `${getBaseUrl(network)}/babylon/btcstaking/v1/params/${version}`;
50
- const resp = await fetch(url);
51
- if (!resp.ok) {
52
- throw new Error(`Failed to fetch ${url}: ${resp.statusText}`);
53
- }
54
- return await resp.json();
55
- }
56
- async function getAllParams(network) {
57
- const params = [];
58
- for (let i = 0;; i++) {
59
- try {
60
- const p = await getParams(network, i);
61
- params.push(p);
62
- }
63
- catch (e) {
64
- console.error(`error fetching ${network} params version ${i}: ${e.message}`);
65
- break;
66
- }
67
- }
68
- return params;
69
- }
70
- async function syncParams(network) {
71
- if (network === undefined) {
72
- await syncParams('testnet');
73
- await syncParams('mainnet');
74
- return;
75
- }
76
- const allParams = await getAllParams(network);
77
- const filename = __dirname + `/../src/babylon/params.${network}.json`;
78
- await fs.writeFile(filename, JSON.stringify(allParams, null, 2) + '\n');
79
- console.log(`Wrote ${allParams.length} params to ${filename}`);
80
- }
81
- (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
82
- .command({
83
- command: 'sync-babylon-params',
84
- describe: 'Sync Babylon params',
85
- builder(b) {
86
- return b.option('network', {
87
- choices: ['mainnet', 'testnet'],
88
- description: 'Network',
89
- });
90
- },
91
- async handler(argv) {
92
- await syncParams(argv.network);
93
- },
94
- })
95
- .demandCommand()
96
- .help()
97
- .strict().argv;
98
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFieWxvbi1wYXJhbXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zY3JpcHRzL2JhYnlsb24tcGFyYW1zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsZ0RBQWtDO0FBRWxDLGtEQUEwQjtBQUMxQiwyQ0FBd0M7QUFFeEMsU0FBUyxVQUFVLENBQUMsT0FBOEI7SUFDaEQsSUFBSSxPQUFPLEtBQUssU0FBUyxFQUFFLENBQUM7UUFDMUIsTUFBTSxJQUFJLEtBQUssQ0FBQyx1QkFBdUIsQ0FBQyxDQUFDO0lBQzNDLENBQUM7SUFDRCxPQUFPLHdDQUF3QyxDQUFDO0FBQ2xELENBQUM7QUFJRCxLQUFLLFVBQVUsU0FBUyxDQUFDLE9BQXVCLEVBQUUsT0FBZTtJQUMvRCxNQUFNLEdBQUcsR0FBRyxHQUFHLFVBQVUsQ0FBQyxPQUFPLENBQUMsaUNBQWlDLE9BQU8sRUFBRSxDQUFDO0lBQzdFLE1BQU0sSUFBSSxHQUFHLE1BQU0sS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQzlCLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFLENBQUM7UUFDYixNQUFNLElBQUksS0FBSyxDQUFDLG1CQUFtQixHQUFHLEtBQUssSUFBSSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUM7SUFDaEUsQ0FBQztJQUNELE9BQU8sTU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