Skip to content

fix(scripts): improve vendoring process and reorganize dependencies #6388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/babylonlabs-io-btc-staking-ts/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BitGo Fork of https://github.com/babylonlabs-io/btc-staking-ts/tree/v0.4.0-rc.2
BitGo Fork of https://github.com/babylonlabs-io/btc-staking-ts/tree/v1.0.3
34 changes: 21 additions & 13 deletions modules/babylonlabs-io-btc-staking-ts/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
export { StakingScriptData, Staking } from './staking';
export type { StakingScripts } from './staking';
export { ObservableStaking, ObservableStakingScriptData } from './staking/observable';
export * from './staking/transactions';
export * from './types';
export * from './utils/btc';
export * from './utils/babylon';
export * from './utils/staking';
export * from './utils/utxo/findInputUTXO';
export * from './utils/utxo/getPsbtInputFields';
export * from './utils/utxo/getScriptType';
export { getBabylonParamByBtcHeight, getBabylonParamByVersion } from './utils/staking/param';
export * from './staking/manager';
export { StakingScriptData, Staking } from "./staking";
export type { StakingScripts } from "./staking";
export {
ObservableStaking,
ObservableStakingScriptData,
} from "./staking/observable";
export * from "./staking/transactions";
export * from "./types";
export * from "./utils/btc";
export * from "./utils/utxo/findInputUTXO";
export * from "./utils/utxo/getPsbtInputFields";
export * from "./utils/utxo/getScriptType";
export {
getBabylonParamByBtcHeight,
getBabylonParamByVersion,
} from "./utils/staking/param";
export * from "./staking/manager";

// BitGo-specific exports
export * from "./utils/babylon";
export * from "./utils/staking";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-jsdoc": "^33.0.0",
"eslint-plugin-prettier": "^3.4.0",
"execa": "^5.0.0",
"execa": "^9.6.0",
"formidable": "3.5.4",
"glob": "^7.1.3",
"html-webpack-plugin": "^5.5.0",
Expand Down
112 changes: 0 additions & 112 deletions scripts/vendor-github-repo.ts

This file was deleted.

9 changes: 9 additions & 0 deletions scripts/vendor-github-repo/VendorConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export type GithubSource = {
org: string;
repo: string;
} & ({ tag: string } | { ref: string });

export type VendorConfig = GithubSource & {
targetDir: string;
postExtract?: (src: GithubSource, targetDir: string) => Promise<void>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 1ffd7fac756de23859d3f1b61c26619c597e5021 Mon Sep 17 00:00:00 2001
From: Otto Allmendinger <[email protected]>
Date: Thu, 3 Jul 2025 11:03:24 +0200
Subject: [PATCH] fix(babylonlabs-io-btc-staking-ts): add BitGo-specific
exports

Add exports for babylon and staking utility functions needed by BitGo
integration code.

Issue: BTC-2143

Co-authored-by: llm-git <[email protected]>
---
modules/babylonlabs-io-btc-staking-ts/src/index.ts | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/babylonlabs-io-btc-staking-ts/src/index.ts b/modules/babylonlabs-io-btc-staking-ts/src/index.ts
index cd14e42be..883c517ce 100644
--- a/modules/babylonlabs-io-btc-staking-ts/src/index.ts
+++ b/modules/babylonlabs-io-btc-staking-ts/src/index.ts
@@ -14,4 +14,8 @@ export {
getBabylonParamByBtcHeight,
getBabylonParamByVersion,
} from "./utils/staking/param";
-export * from "./staking/manager";
\ No newline at end of file
+export * from "./staking/manager";
+
+// BitGo-specific exports
+export * from "./utils/babylon";
+export * from "./utils/staking";
\ No newline at end of file
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From a5f486a9d30209bf2a6d24abee61236d0aae7be9 Mon Sep 17 00:00:00 2001
From: Otto Allmendinger <[email protected]>
Date: Thu, 3 Jul 2025 13:28:38 +0200
Subject: [PATCH] fix(babylonlabs-io-btc-staking-ts): add build dir to
gitignore

Issue: BTC-2143

Co-authored-by: llm-git <[email protected]>
---
modules/babylonlabs-io-btc-staking-ts/.gitignore | 2 ++
1 file changed, 2 insertions(+)

diff --git a/modules/babylonlabs-io-btc-staking-ts/.gitignore b/modules/babylonlabs-io-btc-staking-ts/.gitignore
index 2f621f05c..6b0417d7d 100644
--- a/modules/babylonlabs-io-btc-staking-ts/.gitignore
+++ b/modules/babylonlabs-io-btc-staking-ts/.gitignore
@@ -206,3 +206,5 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows
*.swp
*.swo
+
+build/
\ No newline at end of file
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From 75323a260f5b9031ce9c653ad3fe17755a4e25d0 Mon Sep 17 00:00:00 2001
From: Otto Allmendinger <[email protected]>
Date: Thu, 3 Jul 2025 11:03:39 +0200
Subject: [PATCH] fix(babylonlabs-io-btc-staking-ts): change class fields and
methods visibility

Changed class fields and methods visibility from private to protected or
public to allow better extensibility for subclasses.

Issue: BTC-2143

Co-authored-by: llm-git <[email protected]>
---
.../src/staking/manager.ts | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules/babylonlabs-io-btc-staking-ts/src/staking/manager.ts b/modules/babylonlabs-io-btc-staking-ts/src/staking/manager.ts
index 778f3e700..af3dad5d0 100644
--- a/modules/babylonlabs-io-btc-staking-ts/src/staking/manager.ts
+++ b/modules/babylonlabs-io-btc-staking-ts/src/staking/manager.ts
@@ -93,10 +93,10 @@ interface InclusionProof {
}

export class BabylonBtcStakingManager {
- private stakingParams: VersionedStakingParams[];
- private btcProvider: BtcProvider;
- private network: networks.Network;
- private babylonProvider: BabylonProvider;
+ protected stakingParams: VersionedStakingParams[];
+ protected btcProvider: BtcProvider;
+ protected network: networks.Network;
+ protected babylonProvider: BabylonProvider;

constructor(
network: networks.Network,
@@ -624,7 +624,8 @@ export class BabylonBtcStakingManager {

/**
* Creates a proof of possession for the staker based on ECDSA signature.
- * @param bech32Address - The staker's bech32 address.
+ * @param bech32Address - The staker's bech32 address on the babylon chain
+ * @param stakerBtcAddress - The staker's BTC address.
* @returns The proof of possession.
*/
async createProofOfPossession(
@@ -709,7 +710,7 @@ export class BabylonBtcStakingManager {
* @param inclusionProof - The inclusion proof of the staking transaction.
* @returns The protobuf message.
*/
- private async createBtcDelegationMsg(
+ public async createBtcDelegationMsg(
stakingInstance: Staking,
stakingInput: StakingInputs,
stakingTx: Transaction,
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From fd94e62d8bdb05bbdd742b6b7dddf163f1a7dd35 Mon Sep 17 00:00:00 2001
From: Otto Allmendinger <[email protected]>
Date: Thu, 3 Jul 2025 11:01:15 +0200
Subject: [PATCH] fix(babylonlabs-io-btc-staking-ts): simplify README to
identify as fork

Issue: BTC-2143

Co-authored-by: llm-git <[email protected]>
---
.../babylonlabs-io-btc-staking-ts/README.md | 37 +------------------
1 file changed, 1 insertion(+), 36 deletions(-)

diff --git a/modules/babylonlabs-io-btc-staking-ts/README.md b/modules/babylonlabs-io-btc-staking-ts/README.md
index ed35980ea..cecbcaff7 100644
--- a/modules/babylonlabs-io-btc-staking-ts/README.md
+++ b/modules/babylonlabs-io-btc-staking-ts/README.md
@@ -1,36 +1 @@
-<p align="center">
- <img alt="Babylon Logo" src="https://github.com/user-attachments/assets/dc74271e-90f1-44bd-9122-2b7438ab375c" width="100" />
- <h3 align="center">@babylonlabs-io/btc-staking-ts</h3>
- <p align="center">Babylon Bitcoin Staking Protocol</p>
- <p align="center"><strong>TypeScript</strong> library</p>
- <p align="center">
- <a href="https://www.npmjs.com/package/@babylonlabs-io/btc-staking-ts"><img src="https://badge.fury.io/js/btc-staking-ts.svg" alt="npm version" height="18"></a>
- </p>
-</p>
-<br/>
-
-## Installation
-
-```console
-npm i @babylonlabs-io/btc-staking-ts
-```
-
-## Version Release
-
-### Stable version
-
-Stable release versions are manually released from the main branch.
-
-### Canary version
-
-A canary version is a pre-release version from `dev` branch.
-Make sure all changes are added and committed before running the command below:
-
-```console
-npm run version:canary
-```
-
-## Usage Guide
-
-Details on the usage of the library can be found
-on the [usage guide](./docs/usage.md).
+BitGo Fork of https://github.com/babylonlabs-io/btc-staking-ts/tree/v1.0.3
\ No newline at end of file
--
2.43.0

Loading
Loading