Skip to content

Commit b45b95a

Browse files
committed
Merge remote-tracking branch 'origin/master' into WP-5443-express-migrate-api-v2-ofc-signPayload-to-typed-routes
TICKET: WP-5443
2 parents f146ef7 + ef19b16 commit b45b95a

File tree

330 files changed

+8328
-3219
lines changed

Some content is hidden

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

330 files changed

+8328
-3219
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,15 @@ jobs:
5454
path: |
5555
node_modules
5656
modules/*/node_modules
57-
key: ${{ runner.os }}-node${{matrix.node-version}}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('package.json') }}
57+
key: ${{ runner.os }}-node${{matrix.node-version}}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('**/package.json') }}
5858

5959
- name: Install Packages
6060
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
6161
run: yarn install --with-frozen-lockfile --ignore-scripts
6262

63+
- name: Check In-Repo Package Versions
64+
run: yarn run check-versions
65+
6366
- name: build packages
6467
env:
6568
# Workaround for https://github.com/nodejs/node/issues/51555
@@ -103,7 +106,7 @@ jobs:
103106
path: |
104107
node_modules
105108
modules/*/node_modules
106-
key: ${{ runner.os }}-node20-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('package.json') }}
109+
key: ${{ runner.os }}-node20-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('**/package.json') }}
107110

108111
- name: Install Packages
109112
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
@@ -149,7 +152,7 @@ jobs:
149152
path: |
150153
node_modules
151154
modules/*/node_modules
152-
key: ${{ runner.os }}-node22-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('package.json') }}
155+
key: ${{ runner.os }}-node22-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('**/package.json') }}
153156

154157
- name: Install Packages
155158
if: steps.lerna-cache.outputs.cache-hit != 'true'
@@ -242,7 +245,7 @@ jobs:
242245
node_modules
243246
modules/*/node_modules
244247
/home/runner/.cache/Cypress
245-
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json')}}-${{ hashFiles('package.json') }}
248+
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json')}}-${{ hashFiles('**/package.json') }}
246249

247250
- name: Install Packages
248251
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
@@ -267,5 +270,44 @@ jobs:
267270
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
268271
with:
269272
ref: ${{ github.event.pull_request.head.sha }}
273+
274+
- name: Setup Docker compatibility with Podman
275+
run: sudo ln -sf /usr/bin/podman /usr/local/bin/docker
276+
270277
- name: Build BitGoJS Express Docker Image
271-
run: podman build .
278+
run: ./scripts/build-docker-express.sh
279+
280+
dockerfile-check:
281+
runs-on: ubuntu-latest
282+
283+
steps:
284+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
285+
with:
286+
ref: ${{ github.event.pull_request.head.sha }}
287+
288+
- name: Setup node 22
289+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
290+
with:
291+
node-version: 22
292+
293+
- name: restore lerna dependencies
294+
id: lerna-cache
295+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
296+
with:
297+
path: |
298+
node_modules
299+
modules/*/node_modules
300+
key: ${{ runner.os }}-node22-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('package.json') }}
301+
302+
- name: Install Packages
303+
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
304+
run: yarn install --with-frozen-lockfile --ignore-scripts
305+
306+
- name: Check Dockerfile is up to date
307+
run: |
308+
yarn update-dockerfile
309+
if ! git diff --quiet; then
310+
echo "Dockerfile is not up to date. Please run 'yarn update-dockerfile' and commit the changes."
311+
git diff
312+
exit 1
313+
fi

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
node-version-file: .nvmrc
2727

2828
- name: Install BitGoJS
29-
run: yarn install --with-frozen-lockfile --ignore-scripts
29+
run: yarn install --with-frozen-lockfile
3030

3131
- name: Set Environment Variable for Alpha
3232
if: github.ref != 'refs/heads/master' # only publish changes if on feature branches

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ modules/**/pack-scoped/
1818
coverage
1919
/.direnv/
2020
.claude/
21-
scripts/cache/

.iyarc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
GHSA-3gc7-fjrx-p6mg

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-icp /var/modules/sdk-coin-icp/
8888
COPY --from=builder /tmp/bitgo/modules/sdk-coin-initia /var/modules/sdk-coin-initia/
8989
COPY --from=builder /tmp/bitgo/modules/sdk-coin-injective /var/modules/sdk-coin-injective/
9090
COPY --from=builder /tmp/bitgo/modules/sdk-coin-islm /var/modules/sdk-coin-islm/
91-
COPY --from=builder /tmp/bitgo/modules/sdk-coin-mantra /var/modules/sdk-coin-mantra/
9291
COPY --from=builder /tmp/bitgo/modules/sdk-coin-mon /var/modules/sdk-coin-mon/
9392
COPY --from=builder /tmp/bitgo/modules/sdk-coin-near /var/modules/sdk-coin-near/
9493
COPY --from=builder /tmp/bitgo/modules/sdk-coin-oas /var/modules/sdk-coin-oas/
@@ -185,7 +184,6 @@ cd /var/modules/sdk-coin-icp && yarn link && \
185184
cd /var/modules/sdk-coin-initia && yarn link && \
186185
cd /var/modules/sdk-coin-injective && yarn link && \
187186
cd /var/modules/sdk-coin-islm && yarn link && \
188-
cd /var/modules/sdk-coin-mantra && yarn link && \
189187
cd /var/modules/sdk-coin-mon && yarn link && \
190188
cd /var/modules/sdk-coin-near && yarn link && \
191189
cd /var/modules/sdk-coin-oas && yarn link && \
@@ -285,7 +283,6 @@ RUN cd /var/bitgo-express && \
285283
yarn link @bitgo/sdk-coin-initia && \
286284
yarn link @bitgo/sdk-coin-injective && \
287285
yarn link @bitgo/sdk-coin-islm && \
288-
yarn link @bitgo/sdk-coin-mantra && \
289286
yarn link @bitgo/sdk-coin-mon && \
290287
yarn link @bitgo/sdk-coin-near && \
291288
yarn link @bitgo/sdk-coin-oas && \
@@ -333,14 +330,16 @@ RUN cd /var/bitgo-express && \
333330
yarn link @bitgo/sdk-coin-zec
334331
#LINK_END
335332

336-
#LABEL_START
337-
LABEL created="Thu, 04 Sep 2025 18:59:30 GMT"
338-
LABEL version=15.0.0
339-
LABEL git_hash=bbdf6e60b720b25e3212f3a4c5bdc81732a505e8
340-
#LABEL_END
333+
ARG BUILD_DATE
334+
ARG VERSION
335+
ARG GIT_HASH
336+
337+
LABEL created=${BUILD_DATE}
338+
LABEL version=${VERSION}
339+
LABEL git_hash=${GIT_HASH}
341340

342341
USER node
343-
ENV NODE_ENV production
344-
ENV BITGO_BIND 0.0.0.0
342+
ENV NODE_ENV=production
343+
ENV BITGO_BIND=0.0.0.0
345344
EXPOSE 3080
346345
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/node", "/var/bitgo-express/bin/bitgo-express"]

check-package-versions.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#!/usr/bin/env node
2+
3+
// Check versions of in-repo packages to make sure they match with the package.json version.
4+
// This is to prevent inadvertent updates of dependency versions for packages which are symlinked
5+
// by lerna. The dependency versions of these packages should only ever be updated in the release branch.
6+
7+
const execa = require('execa');
8+
const path = require('path');
9+
10+
/**
11+
* Create a function which can run lerna commands
12+
* @param lernaPath {string} path to lerna binary
13+
* @returns {function(string, string[], Object.<string, string>): Promise<string>}
14+
*/
15+
function getLernaRunner(lernaPath) {
16+
return async (command, args = [], options = {}) => {
17+
const { stdout } = await execa(lernaPath, [command, ...args], options);
18+
return stdout;
19+
};
20+
}
21+
22+
/**
23+
* Get information on the modules in this repo that are managed by lerna.
24+
* @param lerna {function}
25+
* @returns {Promise<{path: *, name: *, deps: *, version: *}[]>}
26+
*/
27+
async function getLernaManagedModules(lerna) {
28+
const depGraph = JSON.parse(await lerna('list', ['--loglevel', 'silent', '--graph', '--all']));
29+
const managedModules = JSON.parse(await lerna('list', ['--loglevel', 'silent', '--json', '--all']));
30+
const managedModuleNames = managedModules.map(({ name }) => name);
31+
return Object.entries(depGraph).map(([name, deps]) => {
32+
const mod = managedModules.find((mod) => mod.name === name);
33+
return {
34+
name,
35+
deps: deps.filter((d) => managedModuleNames.includes(d)),
36+
path: mod.location,
37+
version: mod.version,
38+
};
39+
});
40+
}
41+
42+
/**
43+
* Build a dictionary from package name to the expected version of that package.
44+
* @param modules
45+
* @returns {Object.<string, string>}
46+
*/
47+
function getExpectedVersions(modules) {
48+
return Object.values(modules).reduce((acc, mod) => {
49+
return Object.assign(acc, { [mod.name]: mod.version });
50+
}, {});
51+
}
52+
53+
/**
54+
* For the module at `modPath`, get the version of the dependency `depName`.
55+
* If the version is prefixed with a carat or tilde, it will be stripped.
56+
* @param modPath {string}
57+
* @param depName {string}
58+
* @returns {string | undefined}
59+
*/
60+
function getDependencyVersion(modPath, depName) {
61+
const packageJsonPath = path.join(modPath, 'package.json');
62+
const {
63+
dependencies = {},
64+
devDependencies = {},
65+
optionalDependencies = {},
66+
peerDependencies = {},
67+
} = require(packageJsonPath);
68+
69+
const deps = { ...dependencies, ...devDependencies, ...optionalDependencies, ...peerDependencies };
70+
if (deps[depName]) {
71+
const matches = deps[depName].match(/^([^~])?(.*)$/);
72+
return matches[matches.length - 1];
73+
}
74+
}
75+
76+
async function main() {
77+
const { stdout: lernaBinary } = await execa('yarn', ['bin', 'lerna'], { cwd: process.cwd() });
78+
79+
const lerna = getLernaRunner(lernaBinary);
80+
81+
const modules = await getLernaManagedModules(lerna);
82+
const expectedVersions = getExpectedVersions(modules);
83+
84+
let exitCode = 0;
85+
86+
for (const mod of modules) {
87+
for (const dep of mod.deps) {
88+
const depVersion = getDependencyVersion(mod.path, dep);
89+
if (depVersion && depVersion !== expectedVersions[dep]) {
90+
// Handle pre-release versions by checking if the base version matches
91+
const baseDepVersion = depVersion.split('-')[0];
92+
const baseExpectedVersion = expectedVersions[dep].split('-')[0];
93+
94+
if (baseDepVersion !== baseExpectedVersion) {
95+
console.log(
96+
`error: expected lerna-managed module ${mod.name} to depend on package ${dep} using version ${expectedVersions[dep]}, but found version ${depVersion} instead`
97+
);
98+
exitCode = 1;
99+
}
100+
}
101+
}
102+
}
103+
104+
return exitCode;
105+
}
106+
107+
main()
108+
.then(process.exit)
109+
.catch((e) => console.error(e));

examples/ts/btc/lightning/list-transactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async function main(): Promise<void> {
6666
if (endDate) queryParams.endDate = endDate;
6767

6868
// List transactions with the provided filters
69-
const transactions = await lightning.listTransactions(queryParams);
69+
const { transactions } = await lightning.listTransactions(queryParams);
7070

7171
// Display transaction summary
7272
console.log(`\nFound ${transactions.length} transactions:`);

lerna.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44
"useWorkspaces": true,
55
"command": {
66
"version": {
7-
"message": "chore(root): publish modules",
8-
"allowBranch": "master",
9-
"skipGit": true
10-
},
11-
"publish": {
12-
"skipGit": true,
13-
"allowBranch": "master"
7+
"message": "chore(root): publish modules"
148
}
159
},
1610
"$schema": "node_modules/lerna/schemas/lerna-schema.json",

modules/abstract-cosmos/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
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.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/[email protected]...@bitgo/[email protected]) (2025-09-29)
7+
8+
**Note:** Version bump only for package @bitgo/abstract-cosmos
9+
10+
# [11.15.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/[email protected]...@bitgo/[email protected]) (2025-09-25)
11+
12+
### Features
13+
14+
- configure learn to skip git operations ([ee3a622](https://github.com/BitGo/BitGoJS/commit/ee3a6220496476aa7f4545b5f4a9a3bf97d9bdb9))
15+
616
## [11.14.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/[email protected]...@bitgo/[email protected]) (2025-09-03)
717

818
### Bug Fixes

0 commit comments

Comments
 (0)