Skip to content

Commit e8b797c

Browse files
authored
Merge branch 'master' into WP-7457-sdk-Support-Node-24
2 parents 6a199b3 + 9b284f3 commit e8b797c

279 files changed

Lines changed: 9014 additions & 1728 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.iyarc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Excluded because:
2+
# - Lerna requires tar v6, but no patched v6 exists (fix only in v7.5.3)
3+
# - Forcing tar v7.5.3 breaks lerna's packDirectory API
4+
# - This CVE affects archive EXTRACTION (unpacking malicious symlinks/hardlinks)
5+
# - Lerna only uses tar for PACKING
6+
GHSA-8qq5-rm4j-mr97
7+
8+
# Excluded because:
9+
# - Transitive dependency through lerna and yeoman-generator, which currently pin tar to a
10+
# < 7.5.4 range; We only use their tar integration for
11+
# archive PACKING, not extraction,
12+
GHSA-r6q2-hw4h-h46w
13+

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ yarn compile
6565
# Build for development
6666
yarn compile-dbg
6767
```
68+
69+
## Dual ESM/CJS Builds
70+
71+
For modules that need browser support (especially those using `@bitgo/wasm-utxo`), see [docs/esm.md](docs/esm.md) for the dual ESM/CJS build pattern.
72+
6873
## Code Style
6974

7075
### Commits

CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
/modules/sdk-coin-baby/ @BitGo/ethalt-team
6161
/modules/sdk-coin-bera/ @BitGo/ethalt-team
6262
/modules/sdk-coin-bsc/ @BitGo/ethalt-team
63-
/module/sdk-coin-canton/ @BitGo/ethalt-team
63+
/modules/sdk-coin-canton/ @BitGo/ethalt-team
6464
/modules/sdk-coin-coredao/ @BitGo/ethalt-team
6565
/modules/sdk-coin-cosmos/ @BitGo/ethalt-team
6666
/modules/sdk-coin-cronos/ @BitGo/ethalt-team
@@ -104,7 +104,7 @@
104104
# Examples
105105
/examples/ @BitGo/ethalt-team
106106
/examples/ts/btc/ @BitGo/btc-team
107-
/examples/ts/stablecoin @Bitgo/gousd-team
107+
/examples/ts/stablecoin @Bitgo/stablecoins
108108

109109
# Trade
110110
/modules/sdk-core/src/bitgo/address-book/ @BitGo/prime

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# An elaborated scheme to build all the dependencies of all packages first in a cached layer
33
# https://stackoverflow.com/a/63142468/134409
44
# https://medium.com/@emilefugulin/building-a-sane-docker-image-for-typescript-lerna-and-prisma-2-76d8ff9926e4
5-
FROM node:22.16.0-bookworm-slim@sha256:2f3571619daafc6b53232ebf2fcc0817c1e64795e92de317c1684a915d13f1a5 AS filter-packages-json
5+
FROM node:22.22.0-bookworm-slim@sha256:f86be15afa9a8277608e141ce2a8aa55d3d9c40845921b8511f4fb7897be2554 AS filter-packages-json
66
LABEL maintainer="Developer Relations <developer-relations-team@bitgo.com>"
77

88
COPY package.json yarn.lock lerna.json ./
@@ -12,7 +12,7 @@ COPY modules ./modules
1212
# delete all the non package.json files under `./modules/`
1313
RUN find modules \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf
1414

15-
FROM node:22.16.0-bookworm-slim@sha256:2f3571619daafc6b53232ebf2fcc0817c1e64795e92de317c1684a915d13f1a5 AS builder
15+
FROM node:22.22.0-bookworm-slim@sha256:f86be15afa9a8277608e141ce2a8aa55d3d9c40845921b8511f4fb7897be2554 AS builder
1616
RUN apt-get update && apt-get install -y git python3 make g++ libtool autoconf automake
1717
WORKDIR /tmp/bitgo
1818
COPY --from=filter-packages-json /tmp/bitgo .
@@ -31,7 +31,7 @@ RUN \
3131
rm -r modules/*/src
3232

3333

34-
FROM node:22.16.0-bookworm-slim@sha256:2f3571619daafc6b53232ebf2fcc0817c1e64795e92de317c1684a915d13f1a5
34+
FROM node:22.22.0-bookworm-slim@sha256:f86be15afa9a8277608e141ce2a8aa55d3d9c40845921b8511f4fb7897be2554
3535
RUN apt-get update && apt-get install -y tini
3636
# copy the root node_modules to the bitgo-express parent node_modules
3737
COPY --from=builder /tmp/bitgo/node_modules /var/node_modules/

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
'scope-enum': async () => [
1313
2,
1414
'always',
15-
(await readdir('modules')).concat('root', 'deps', 'scripts', 'examples'),
15+
(await readdir('modules')).concat('root', 'deps', 'scripts', 'examples', 'webpack'),
1616
],
1717
'footer-max-line-length': [0, 'always', Infinity],
1818
'references-empty': [2, 'never'],

docs/esm.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Dual ESM/CJS Module Pattern
2+
3+
Modules that need to work in the browser (especially those importing `@bitgo/wasm-utxo`) must provide both ESM and CJS builds. The browser webpack build uses ESM to properly handle async WASM initialization.
4+
5+
## When to Use
6+
7+
Add dual builds to a module if:
8+
- It imports `@bitgo/wasm-utxo` (required for browser WASM support)
9+
- It's imported by other modules that need browser support
10+
- It needs to be bundled for browser use
11+
12+
## How to Convert a Module
13+
14+
### 1. Update package.json
15+
16+
```json
17+
{
18+
"main": "./dist/cjs/src/index.js",
19+
"module": "./dist/esm/index.js",
20+
"browser": "./dist/esm/index.js",
21+
"types": "./dist/cjs/src/index.d.ts",
22+
"exports": {
23+
".": {
24+
"import": {
25+
"types": "./dist/esm/index.d.ts",
26+
"default": "./dist/esm/index.js"
27+
},
28+
"require": {
29+
"types": "./dist/cjs/src/index.d.ts",
30+
"default": "./dist/cjs/src/index.js"
31+
}
32+
}
33+
},
34+
"files": ["dist/cjs", "dist/esm"],
35+
"scripts": {
36+
"build": "npm run build:cjs && npm run build:esm",
37+
"build:cjs": "yarn tsc --build --incremental --verbose .",
38+
"build:esm": "yarn tsc --project tsconfig.esm.json"
39+
}
40+
}
41+
```
42+
43+
### 2. Update tsconfig.json
44+
45+
Change output directory to `dist/cjs`:
46+
47+
```json
48+
{
49+
"compilerOptions": {
50+
"outDir": "./dist/cjs",
51+
"rootDir": "."
52+
}
53+
}
54+
```
55+
56+
### 3. Create tsconfig.esm.json
57+
58+
```json
59+
{
60+
"extends": "./tsconfig.json",
61+
"compilerOptions": {
62+
"outDir": "./dist/esm",
63+
"rootDir": "./src",
64+
"module": "ES2020",
65+
"target": "ES2020",
66+
"moduleResolution": "bundler",
67+
"lib": ["ES2020", "DOM"],
68+
"declaration": true,
69+
"declarationMap": true,
70+
"skipLibCheck": true
71+
},
72+
"include": ["src/**/*"],
73+
"exclude": ["node_modules", "test", "dist"],
74+
"references": []
75+
}
76+
```
77+
78+
### 4. Add Webpack Alias (if needed for browser bundle)
79+
80+
If your module is imported in the browser bundle and uses `@bitgo/wasm-utxo`, you must add a webpack alias in [`webpack/bitgojs.config.js`](../webpack/bitgojs.config.js):
81+
82+
```javascript
83+
resolve: {
84+
alias: {
85+
'@bitgo/your-module': path.resolve('../your-module/dist/esm/index.js'),
86+
}
87+
}
88+
```
89+
90+
**Why aliases are required:** Webpack doesn't automatically use the `browser` or `module` fields when resolving imports from CJS code. While we could use `resolve.conditionNames: ['browser', 'import', ...]` to prioritize ESM, this breaks third-party packages like `@solana/spl-token` and `@bufbuild/protobuf` that have broken ESM builds. The explicit aliases target only our packages.
91+
92+
## Reference Implementations
93+
94+
- [`modules/utxo-core`](../modules/utxo-core) - Full dual build setup
95+
- [`modules/abstract-utxo`](../modules/abstract-utxo) - Full dual build setup
96+
- [`modules/utxo-staking`](../modules/utxo-staking) - Full dual build setup
97+
- [`modules/utxo-ord`](../modules/utxo-ord) - Full dual build setup

modules/abstract-cosmos/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [11.15.24](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.15.23...@bitgo/abstract-cosmos@11.15.24) (2026-01-22)
7+
8+
**Note:** Version bump only for package @bitgo/abstract-cosmos
9+
10+
11+
12+
13+
14+
## [11.15.23](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.15.22...@bitgo/abstract-cosmos@11.15.23) (2026-01-19)
15+
16+
**Note:** Version bump only for package @bitgo/abstract-cosmos
17+
18+
19+
20+
21+
622
## [11.15.22](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-cosmos@11.15.21...@bitgo/abstract-cosmos@11.15.22) (2026-01-14)
723

824
**Note:** Version bump only for package @bitgo/abstract-cosmos

modules/abstract-cosmos/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitgo/abstract-cosmos",
3-
"version": "11.15.22",
3+
"version": "11.15.24",
44
"description": "BitGo SDK coin library for COSMOS base implementation",
55
"main": "./dist/src/index.js",
66
"types": "./dist/src/index.d.ts",
@@ -38,10 +38,10 @@
3838
]
3939
},
4040
"dependencies": {
41-
"@bitgo/sdk-core": "^36.27.0",
41+
"@bitgo/sdk-core": "^36.29.0",
4242
"@bitgo/sdk-lib-mpc": "^10.8.1",
4343
"@bitgo/secp256k1": "^1.9.0",
44-
"@bitgo/statics": "^58.21.0",
44+
"@bitgo/statics": "^58.23.0",
4545
"@cosmjs/amino": "^0.29.5",
4646
"@cosmjs/crypto": "^0.30.1",
4747
"@cosmjs/encoding": "^0.29.5",

modules/abstract-eth/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [24.19.8](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-eth@24.19.7...@bitgo/abstract-eth@24.19.8) (2026-01-22)
7+
8+
**Note:** Version bump only for package @bitgo/abstract-eth
9+
10+
11+
12+
13+
14+
## [24.19.7](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-eth@24.19.6...@bitgo/abstract-eth@24.19.7) (2026-01-19)
15+
16+
**Note:** Version bump only for package @bitgo/abstract-eth
17+
18+
19+
20+
21+
622
## [24.19.6](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-eth@24.19.5...@bitgo/abstract-eth@24.19.6) (2026-01-14)
723

824
**Note:** Version bump only for package @bitgo/abstract-eth

modules/abstract-eth/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitgo/abstract-eth",
3-
"version": "24.19.6",
3+
"version": "24.19.8",
44
"description": "BitGo SDK coin library for ETH base implementation",
55
"main": "./dist/src/index.js",
66
"types": "./dist/src/index.d.ts",
@@ -40,10 +40,10 @@
4040
]
4141
},
4242
"dependencies": {
43-
"@bitgo/sdk-core": "^36.27.0",
43+
"@bitgo/sdk-core": "^36.29.0",
4444
"@bitgo/sdk-lib-mpc": "^10.8.1",
4545
"@bitgo/secp256k1": "^1.9.0",
46-
"@bitgo/statics": "^58.21.0",
46+
"@bitgo/statics": "^58.23.0",
4747
"@ethereumjs/common": "^2.6.5",
4848
"@ethereumjs/rlp": "^4.0.0",
4949
"@ethereumjs/tx": "^3.3.0",
@@ -60,8 +60,8 @@
6060
"superagent": "^9.0.1"
6161
},
6262
"devDependencies": {
63-
"@bitgo/sdk-api": "^1.73.1",
64-
"@bitgo/sdk-test": "^9.1.22",
63+
"@bitgo/sdk-api": "^1.73.3",
64+
"@bitgo/sdk-test": "^9.1.24",
6565
"@types/keccak": "^3.0.5"
6666
},
6767
"gitHead": "18e460ddf02de2dbf13c2aa243478188fb539f0c",

0 commit comments

Comments
 (0)