Skip to content

Caas 325 cleanup #6512

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 4 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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x, 24.x]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -94,10 +94,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node 18
- name: Setup node 24
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 18
node-version: 24

- name: restore lerna dependencies
id: lerna-cache
Expand All @@ -106,7 +106,7 @@ jobs:
path: |
node_modules
modules/*/node_modules
key: ${{ runner.os }}-node18-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('package.json') }}
key: ${{ runner.os }}-node24-${{ hashFiles('yarn.lock') }}-${{ hashFiles('tsconfig.packages.json') }}-${{ hashFiles('package.json') }}

- name: Install Packages
if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE')
Expand Down Expand Up @@ -142,10 +142,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node 18
- name: Setup node 24
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 18 # this just needs to pass our lock file requirement for compilation
node-version: 24 # this just needs to pass our lock file requirement for compilation

- name: Build Info
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 18
node-version: 24

- name: Install BitGoJS
run: yarn install --with-frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.16.0
v24.3.0
2 changes: 1 addition & 1 deletion DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Engines should be set to the following:
```json
{
"engines": {
"node": ">=18 <23",
"node": ">=18 < 25",
"npm": ">=3.10.10"
}
}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# An elaborated scheme to build all the dependencies of all packages first in a cached layer
# https://stackoverflow.com/a/63142468/134409
# https://medium.com/@emilefugulin/building-a-sane-docker-image-for-typescript-lerna-and-prisma-2-76d8ff9926e4
FROM node:22.16.0-bookworm-slim@sha256:2f3571619daafc6b53232ebf2fcc0817c1e64795e92de317c1684a915d13f1a5 AS filter-packages-json
FROM node:24.3.0-bookworm-slim@sha256:dd773e49e639dafc0b425bf9ac1d74705086b9aebac960706ab146c5dfa0b32d AS filter-packages-json
LABEL maintainer="Developer Relations <[email protected]>"

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

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


FROM node:22.16.0-bookworm-slim@sha256:2f3571619daafc6b53232ebf2fcc0817c1e64795e92de317c1684a915d13f1a5
FROM node:24.3.0-bookworm-slim@sha256:dd773e49e639dafc0b425bf9ac1d74705086b9aebac960706ab146c5dfa0b32d
RUN apt-get update && apt-get install -y tini
# copy the root node_modules to the bitgo-express parent node_modules
COPY --from=builder /tmp/bitgo/node_modules /var/node_modules/
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ BitGoJS currently provides support for the following Node versions per package.j

```
"engines": {
"node": ">=18 <23",
"node": ">=18 <24",
"npm": ">=3.10.10"
}
```
Expand All @@ -62,6 +62,8 @@ As each Node LTS version reaches its end-of-life we will exclude that version fr

- `18`
- `20`
- `22`
- `24`

JavaScript package managers should allow you to install this package with any version of Node, with, at most, a warning if your version of Node does not fall within the range specified by our node engines property. If you encounter issues installing this package on a supported version of Node, please report the issue to us.

Expand Down
2 changes: 1 addition & 1 deletion examples/js/sui/custom-tx/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.16.0
v24.3.0
2 changes: 1 addition & 1 deletion examples/ts/proxy/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.16.0
v24.3.0
2 changes: 1 addition & 1 deletion examples/ts/tss-recovery/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.16.0
v24.3.0
2 changes: 1 addition & 1 deletion examples/ts/tss-smc/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.16.0
v24.3.0
2 changes: 1 addition & 1 deletion modules/abstract-cosmos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "BitGo SDK Team <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=18 <23"
"node": ">=18 < 25"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion modules/abstract-eth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "BitGo SDK Team <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=18 <23"
"node": ">=18 < 25"
},
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion modules/abstract-eth/test/unit/token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test';
import * as sdkTest from '@bitgo/sdk-test';
import type { TestBitGoAPI } from '@bitgo/sdk-test';

import { BitGoAPI } from '@bitgo/sdk-api';

const { TestBitGo } = sdkTest;

export function runTokenTestInitialization(
currentCoinToken,
coinName: string,
Expand Down
2 changes: 1 addition & 1 deletion modules/abstract-lightning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "BitGo SDK Team <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=18 <23"
"node": ">=18 < 25"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion modules/abstract-substrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "BitGo SDK Team <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=14 <23"
"node": ">=14 < 25"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion modules/abstract-utxo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"author": "BitGo SDK Team <[email protected]>",
"license": "MIT",
"engines": {
"node": ">=18 <23"
"node": ">=18 < 25"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion modules/account-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"author": "BitGo SDK Team <[email protected]>",
"license": "ISC",
"engines": {
"node": ">=18 <23"
"node": ">=18 < 25"
},
"dependencies": {
"@bitgo/sdk-coin-ada": "^4.12.1",
Expand Down
18 changes: 7 additions & 11 deletions modules/account-lib/test/unit/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
import { BaseCoin } from '@bitgo/statics';
import {
BaseMessage,
BaseMessageBuilder,
BaseMessageBuilderFactory,
IMessage,
IMessageBuilder,
MessageOptions,
MessageStandardType,
} from '@bitgo/sdk-core';
import * as sdkCore from '@bitgo/sdk-core';
import type { IMessage, IMessageBuilder, MessageOptions } from '@bitgo/sdk-core';
const { BaseMessage, BaseMessageBuilder, BaseMessageBuilderFactory, MessageStandardType } = sdkCore;

type MessageStandardTypeValue = (typeof MessageStandardType)[keyof typeof MessageStandardType];

export class MockMessageBuilderFactory extends BaseMessageBuilderFactory {
constructor(coinConfig: Readonly<BaseCoin>) {
super(coinConfig);
}

getMessageBuilder(type: MessageStandardType): IMessageBuilder {
getMessageBuilder(type: MessageStandardTypeValue): IMessageBuilder {
return new MockMessageBuilder(this.coinConfig, type);
}
}

export class MockMessageBuilder extends BaseMessageBuilder {
constructor(coinConfig: Readonly<BaseCoin>, type: MessageStandardType = MessageStandardType.UNKNOWN) {
constructor(coinConfig: Readonly<BaseCoin>, type: MessageStandardTypeValue = MessageStandardType.UNKNOWN) {
super(coinConfig, type);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/babylonlabs-io-btc-staking-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"btc-staking"
],
"engines": {
"node": ">=18 < 23"
"node": ">=18 < 25"
},
"author": "Babylon Labs Ltd.",
"license": "SEE LICENSE IN LICENSE",
Expand Down
7 changes: 4 additions & 3 deletions modules/bitgo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"license": "Apache-2.0",
"engines": {
"node": ">=18 <23",
"node": ">=18 < 25",
"npm": ">=3.10.10"
},
"scripts": {
Expand All @@ -26,14 +26,14 @@
"webpack-dev": "cross-env NODE_ENV=development webpack",
"webpack-prod": "NODE_OPTIONS=--max-old-space-size=4096 cross-env NODE_ENV=production webpack",
"test": "npm run coverage",
"unit-test": "mocha 'test/v2/unit/**/*.ts' 'test/unit/**/*.ts'",
"unit-test": "mocha 'dist/test/v2/unit/**/*.js' 'dist/test/unit/**/*.js'",
"coverage": "nyc -- npm run unit-test",
"integration-test": "nyc -- mocha \"test/v2/integration/**/*.ts\"",
"browser-test": "karma start karma.conf.js",
"lint": "eslint --quiet .",
"audit": "if [ \"$(npm --version | cut -d. -f1)\" -ge \"6\" ]; then npm audit; else echo \"npm >= 6 required to perform audit. skipping...\"; fi",
"clean": "rm -r dist/*",
"build": "yarn tsc --build --incremental --verbose .",
"build": "yarn tsc --build --incremental --verbose . && cpx \"test/v2/unit/internal/tssUtils/ecdsaMPCv2/fixtures/**/*\" dist/test/v2/unit/internal/tssUtils/ecdsaMPCv2/fixtures",
"prepare": "npm run build",
"prepublishOnly": "npm run compile",
"upload-artifacts": "node scripts/upload-test-reports.js",
Expand Down Expand Up @@ -145,6 +145,7 @@
"@types/jasmine": "^3.5.12",
"@types/lodash": "^4.14.121",
"aws-sdk": "^2.1155.0",
"cpx": "^1.5.0",
"io-ts-types": "^0.5.16",
"karma": "^5.1.1",
"karma-chrome-launcher": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/ecdh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as utxolib from '@bitgo/utxo-lib';

import { getSharedSecret, signMessageWithDerivedEcdhKey, verifyEcdhSignature } from '@bitgo/sdk-core';
import { TestBitGo } from '@bitgo/sdk-test';
import * as assert from 'assert';
import assert from 'assert';
import { BitGo } from '../src/bitgo';

describe('ECDH utils', () => {
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/integration/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const TestBitGo = require('../lib/test_bitgo');
import * as utxolib from '@bitgo/utxo-lib';
import { getAddressP2PKH, getNetwork } from '../../src/bitcoin';
import { common } from '@bitgo/sdk-core';
import * as nock from 'nock';
import nock from 'nock';

const TEST_WALLET_LABEL = 'wallet management test';

Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/unit/bip32path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @prettier
*/
import 'should';
import { bip32, BIP32Interface } from '@bitgo/utxo-lib';
import { bip32, type BIP32Interface } from '@bitgo/utxo-lib';
import { sanitizeLegacyPath, bitcoin } from '@bitgo/sdk-core';
import { getSeed } from '@bitgo/sdk-test';
const { HDNode, hdPath } = bitcoin;
Expand Down
4 changes: 2 additions & 2 deletions modules/bitgo/test/unit/bitgo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
//

import * as crypto from 'crypto';
import * as nock from 'nock';
import nock from 'nock';
import * as should from 'should';
import assert = require('assert');
import assert from 'assert';

import { common, generateGPGKeyPair } from '@bitgo/sdk-core';
import { bip32, ECPair } from '@bitgo/utxo-lib';
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/unit/decryptKeychain.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'should';
import { decryptKeychainPrivateKey, OptionalKeychainEncryptedKey } from '@bitgo/sdk-core';
import { decryptKeychainPrivateKey, type OptionalKeychainEncryptedKey } from '@bitgo/sdk-core';
import { BitGoAPI } from '@bitgo/sdk-api';

describe('decryptKeychainPrivateKey', () => {
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/unit/keychains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

import * as _ from 'lodash';
import * as nock from 'nock';
import nock from 'nock';
import 'should';

import { common } from '@bitgo/sdk-core';
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/v2/integration/coins/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as should from 'should';
import 'should-http';

import { TestBitGo } from '../../../lib/test_bitgo';
import * as nock from 'nock';
import nock from 'nock';
nock.restore();

describe('ETH:', function () {
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/v2/integration/coins/xlm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BaseCoin } from '../../../../src/v2';

import { TestBitGo } from '../../../lib/test_bitgo';

import * as nock from 'nock';
import nock from 'nock';

describe('XLM:', function () {
let bitgo: typeof TestBitGo;
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/v2/integration/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import * as should from 'should';
import * as _ from 'lodash';
import * as nock from 'nock';
import nock from 'nock';

import { TestBitGo } from '../../lib/test_bitgo';

Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/v2/lib/recovery-nocks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @prettier
*/
import * as nock from 'nock';
import nock from 'nock';
import { Environments } from '@bitgo/sdk-core';

module.exports.nockXrpRecovery = function nockXrpRecovery() {
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/v2/unit/PrebuildAndSign.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as sinon from 'sinon';
import * as nock from 'nock';
import nock from 'nock';

import { Environments, Wallet } from '@bitgo/sdk-core';
import { TestableBG, TestBitGo } from '@bitgo/sdk-test';
Expand Down
4 changes: 2 additions & 2 deletions modules/bitgo/test/v2/unit/accountConsolidations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import * as sinon from 'sinon';
require('should-sinon');

import '../lib/asserts';
import * as nock from 'nock';
import nock from 'nock';

import { common, Wallet } from '@bitgo/sdk-core';

import { TestBitGo } from '@bitgo/sdk-test';
import { BitGo } from '../../../src/bitgo';
const algoFixtures = require('../../../../sdk-coin-algo/test/fixtures/algo');
const algoFixtures = require('../../../../../sdk-coin-algo/test/fixtures/algo');

nock.disableNetConnect();

Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/v2/unit/ams/ams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as should from 'should';
import * as nock from 'nock';
import nock from 'nock';

import { Environments } from '@bitgo/sdk-core';
import { TestBitGo } from '@bitgo/sdk-test';
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/v2/unit/apiNocks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as nock from 'nock';
import nock from 'nock';

export async function nockGetSigningKey(params: {
userId: string;
Expand Down
2 changes: 1 addition & 1 deletion modules/bitgo/test/v2/unit/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as nock from 'nock';
import nock from 'nock';
import 'should';
import * as sinon from 'sinon';

Expand Down
Loading
Loading