diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc58f390d9..4f7ca8f60f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [16.x, 18.x] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/test_package_updates.yml b/.github/workflows/test_package_updates.yml index 2a6035616c..6eccf00248 100644 --- a/.github/workflows/test_package_updates.yml +++ b/.github/workflows/test_package_updates.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [16.x, 18.x] steps: - uses: actions/checkout@v3 diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 190a0bfd56..5b34e9c91c 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -1,7 +1,7 @@ # Requirements - yarn version 1 (classic) -- node version >=16 and <17 +- node version >=16 and <19 # Installing @@ -180,7 +180,7 @@ Engines should be set to the following: ```json { "engines": { - "node": ">=16 <17", + "node": ">=16 <19", "npm": ">=3.10.10" } } diff --git a/README.md b/README.md index b2377d585b..d9aa4dad50 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ BitGoJS currently provides support for the following Node versions per package.j ``` "engines": { - "node": ">=16 <17", + "node": ">=16 <19", "npm": ">=3.10.10" } ``` diff --git a/modules/abstract-cosmos/package.json b/modules/abstract-cosmos/package.json index a33925532d..399d5b332c 100644 --- a/modules/abstract-cosmos/package.json +++ b/modules/abstract-cosmos/package.json @@ -15,7 +15,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/abstract-eth/package.json b/modules/abstract-eth/package.json index ed3e3fba0a..33b48b6fc0 100644 --- a/modules/abstract-eth/package.json +++ b/modules/abstract-eth/package.json @@ -15,7 +15,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/abstract-utxo/package.json b/modules/abstract-utxo/package.json index 4fb632f21d..5f8ddd894b 100644 --- a/modules/abstract-utxo/package.json +++ b/modules/abstract-utxo/package.json @@ -15,7 +15,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/account-lib/package.json b/modules/account-lib/package.json index 93388cc37f..c22a681df6 100644 --- a/modules/account-lib/package.json +++ b/modules/account-lib/package.json @@ -24,7 +24,7 @@ "author": "BitGo SDK Team ", "license": "ISC", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "dependencies": { "@bitgo/sdk-coin-algo": "^1.3.27", diff --git a/modules/bitgo/package.json b/modules/bitgo/package.json index b35c48639a..04651185a0 100644 --- a/modules/bitgo/package.json +++ b/modules/bitgo/package.json @@ -16,7 +16,7 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=16 <17", + "node": ">=16 <19", "npm": ">=3.10.10" }, "scripts": { diff --git a/modules/bitgo/test/v2/unit/internal/blsUtils.ts b/modules/bitgo/test/v2/unit/internal/blsUtils.ts index dff756d37b..c605d07fad 100644 --- a/modules/bitgo/test/v2/unit/internal/blsUtils.ts +++ b/modules/bitgo/test/v2/unit/internal/blsUtils.ts @@ -3,15 +3,16 @@ import * as nock from 'nock'; import * as should from 'should'; import * as openpgp from 'openpgp'; -import { TestBitGo } from '@bitgo/sdk-test'; -import { BitGo } from '../../../../src/bitgo'; +import { TestableBG, TestBitGo } from '@bitgo/sdk-test'; +import { BitGo } from '../../../../src'; import { BlsUtils, common, IBlsKeyPair, Keychain } from '@bitgo/sdk-core'; import assert = require('assert'); +import { Eth2 } from '@bitgo/sdk-coin-eth2'; describe('BLS Utils:', async function () { - const bitgo: any = TestBitGo.decorate(BitGo, { env: 'mock' }); + const bitgo: TestableBG & BitGo = TestBitGo.decorate(BitGo, { env: 'mock' }); bitgo.initializeTestVars(); - const eth2 = bitgo.coin('eth2'); + const eth2: Eth2 = bitgo.coin('eth2') as Eth2; let bgUrl: string; let blsUtils: BlsUtils; let bitgoKeyShare; @@ -35,15 +36,22 @@ describe('BLS Utils:', async function () { }, }; - nock('https://bitgo.fakeurl').persist().get('/api/v1/client/constants').reply(200, { ttl: 3600, constants }); + // TODO(WP-346): sdk-test mocks conflict so we can't use persist + nock(bitgo.microservicesUrl('')).get('/api/v1/client/constants').times(3).reply(200, { ttl: 3600, constants }); bgUrl = common.Environments[bitgo.getEnv()].uri; blsUtils = new BlsUtils(bitgo, eth2); }); it('should generate BLS-DKG key chains', async function () { - const userKeyShare = eth2.generateKeyPair(); - const backupKeyShare = eth2.generateKeyPair(); + const userKeyShare: IBlsKeyPair = { + ...eth2.generateKeyPair(), + chaincode: '0', + }; + const backupKeyShare: IBlsKeyPair = { + ...eth2.generateKeyPair(), + chaincode: '0', + }; const userGpgKey = await openpgp.generateKey({ userIDs: [ { @@ -94,12 +102,12 @@ describe('BLS Utils:', async function () { const backupSigningMaterial = { userShare: { pub: userKeyShare.pub, - priv: userKeyShare.secretShares[1], + priv: userKeyShare.secretShares![1], chaincode: userKeyShare.chaincode, }, backupShare: { pub: backupKeyShare.pub, - priv: backupKeyShare.secretShares[1], + priv: backupKeyShare.secretShares![1], chaincode: backupKeyShare.chaincode, seed: backupKeyShare.seed, }, @@ -118,8 +126,8 @@ describe('BLS Utils:', async function () { const enterprise = 'enterprise'; const originalPasscodeEncryptionCode = 'originalPasscodeEncryptionCode'; - const userKeyShare = eth2.generateKeyPair(); - const backupKeyShare = eth2.generateKeyPair(); + const userKeyShare: IBlsKeyPair = { ...eth2.generateKeyPair(), chaincode: '0' }; + const backupKeyShare: IBlsKeyPair = { ...eth2.generateKeyPair(), chaincode: '0' }; const userGpgKey = await openpgp.generateKey({ userIDs: [ { @@ -177,12 +185,12 @@ describe('BLS Utils:', async function () { const backupSigningMaterial = { userShare: { pub: userKeyShare.pub, - priv: userKeyShare.secretShares[1], + priv: userKeyShare.secretShares![1], chaincode: userKeyShare.chaincode, }, backupShare: { pub: backupKeyShare.pub, - priv: backupKeyShare.secretShares[1], + priv: backupKeyShare.secretShares![1], chaincode: backupKeyShare.chaincode, seed: backupKeyShare.seed, }, @@ -198,8 +206,8 @@ describe('BLS Utils:', async function () { }); it('should fail to generate BLS-DKG key chains', async function () { - const userKeyShare = eth2.generateKeyPair(); - const backupKeyShare = eth2.generateKeyPair(); + const userKeyShare: IBlsKeyPair = { ...eth2.generateKeyPair(), chaincode: '0' }; + const backupKeyShare: IBlsKeyPair = { ...eth2.generateKeyPair(), chaincode: '0' }; const userGpgKey = await openpgp.generateKey({ userIDs: [ { @@ -228,17 +236,41 @@ describe('BLS Utils:', async function () { bitgoKeychain.should.deepEqual(nockedBitGoKeychain); await blsUtils - .createUserKeychain(userGpgKey, userKeyShare, eth2.generateKeyPair(), bitgoKeychain, 'passphrase') + .createUserKeychain( + userGpgKey, + userKeyShare, + { ...eth2.generateKeyPair(), chaincode: '0' }, + bitgoKeychain, + 'passphrase' + ) .should.be.rejectedWith('Failed to create user keychain - commonKeychains do not match.'); await blsUtils - .createUserKeychain(userGpgKey, eth2.generateKeyPair(), backupKeyShare, bitgoKeychain, 'passphrase') + .createUserKeychain( + userGpgKey, + { ...eth2.generateKeyPair(), chaincode: '0' }, + backupKeyShare, + bitgoKeychain, + 'passphrase' + ) .should.be.rejectedWith('Failed to create user keychain - commonKeychains do not match.'); await blsUtils - .createBackupKeychain(backupGpgKey, eth2.generateKeyPair(), backupKeyShare, bitgoKeychain, 'passphrase') + .createBackupKeychain( + backupGpgKey, + { ...eth2.generateKeyPair(), chaincode: '0' }, + backupKeyShare, + bitgoKeychain, + 'passphrase' + ) .should.be.rejectedWith('Failed to create backup keychain - commonKeychains do not match.'); await blsUtils - .createBackupKeychain(backupGpgKey, userKeyShare, eth2.generateKeyPair(), bitgoKeychain, 'passphrase') + .createBackupKeychain( + backupGpgKey, + userKeyShare, + { ...eth2.generateKeyPair(), chaincode: '0' }, + bitgoKeychain, + 'passphrase' + ) .should.be.rejectedWith('Failed to create backup keychain - commonKeychains do not match.'); }); diff --git a/modules/bitgo/test/v2/unit/internal/tssUtils/common.ts b/modules/bitgo/test/v2/unit/internal/tssUtils/common.ts index 01180942c4..85fcaa5471 100644 --- a/modules/bitgo/test/v2/unit/internal/tssUtils/common.ts +++ b/modules/bitgo/test/v2/unit/internal/tssUtils/common.ts @@ -1,5 +1,6 @@ import { ExchangeCommitmentResponse, SignatureShareRecord } from '@bitgo/sdk-core'; import * as nock from 'nock'; +import * as _ from 'lodash'; export async function nockSendTxRequest(params: { coin: string; @@ -25,7 +26,7 @@ export async function nockSendSignatureShare( return nock('https://bitgo.fakeurl') .persist(true) .post(`/api/v2/wallet/${params.walletId}/txrequests/${params.txRequestId + transactions}/signatureshares`) - .reply(status, status === 200 ? params.signatureShare : { error: 'some error' }); + .reply(status, status === 200 ? (params.signatureShare as nock.Body) : ({ error: 'some error' } as nock.Body)); } export async function nockSendSignatureShareWithResponse( @@ -41,7 +42,7 @@ export async function nockSendSignatureShareWithResponse( const transactions = getRoute(params.tssType); return nock('https://bitgo.fakeurl') .post(`/api/v2/wallet/${params.walletId}/txrequests/${params.txRequestId + transactions}/signatureshares`) - .reply(status, status === 200 ? params.response : { error: 'some error' }); + .reply(status, status === 200 ? (params.response as Body) : ({ error: 'some error' } as nock.Body)); } export async function nockDeleteSignatureShare( @@ -60,8 +61,10 @@ export async function nockCreateTxRequest(params: { response: unknown; }): Promise { return nock('https://bitgo.fakeurl') - .post(`/api/v2/wallet/${params.walletId}/txrequests`, params.requestBody) - .reply(200, params.response); + .post(`/api/v2/wallet/${params.walletId}/txrequests`, (body) => { + return _.isEqual(body, params.requestBody); + }) + .reply(200, params.response as nock.Body); } export async function nockGetTxRequest(params: { @@ -73,7 +76,7 @@ export async function nockGetTxRequest(params: { return nock('https://bitgo.fakeurl') .persist(true) .get(`/api/v2/wallet/${params.walletId}/txrequests?txRequestIds=${params.txRequestId}&latest=true`) - .reply(200, params.response); + .reply(200, params.response as nock.Body); } export async function nockExchangeCommitments(params: { diff --git a/modules/bitgo/test/v2/unit/internal/tssUtils/ecdsa.ts b/modules/bitgo/test/v2/unit/internal/tssUtils/ecdsa.ts index 4fcd8ebe45..da3c57e7dd 100644 --- a/modules/bitgo/test/v2/unit/internal/tssUtils/ecdsa.ts +++ b/modules/bitgo/test/v2/unit/internal/tssUtils/ecdsa.ts @@ -150,7 +150,8 @@ describe('TSS Ecdsa Utils:', async function () { bgUrl = common.Environments[bitgo.getEnv()].uri; - nock(bgUrl).persist().get('/api/v1/client/constants').reply(200, { ttl: 3600, constants }); + // TODO(WP-346): sdk-test mocks conflict so we can't use persist + nock(bgUrl).get('/api/v1/client/constants').times(15).reply(200, { ttl: 3600, constants }); const nockPromises = [ nockBitgoKeychain({ @@ -1236,7 +1237,10 @@ describe('TSS Ecdsa Utils:', async function () { }); function nockGetBitgoChallenges(response: unknown): nock.Scope { - return nock(bgUrl).get(`/api/v2/tss/ecdsa/challenges`).times(1).reply(200, response); + return nock(bgUrl) + .get(`/api/v2/tss/ecdsa/challenges`) + .times(1) + .reply(() => [200, response]); } it('succeeds for valid bitgo proofs', async function () { diff --git a/modules/bitgo/test/v2/unit/internal/tssUtils/eddsa.ts b/modules/bitgo/test/v2/unit/internal/tssUtils/eddsa.ts index 997ee328d6..28b49137cc 100644 --- a/modules/bitgo/test/v2/unit/internal/tssUtils/eddsa.ts +++ b/modules/bitgo/test/v2/unit/internal/tssUtils/eddsa.ts @@ -189,7 +189,8 @@ describe('TSS Utils:', async function () { bgUrl = common.Environments[bitgo.getEnv()].uri; - nock(bgUrl).persist().get('/api/v1/client/constants').reply(200, { ttl: 3600, constants }); + // TODO(WP-346): sdk-test mocks conflict so we can't use persist + nock(bgUrl).get('/api/v1/client/constants').times(23).reply(200, { ttl: 3600, constants }); const walletData = { id: '5b34252f1bf349930e34020a00000000', diff --git a/modules/bitgo/test/v2/unit/unspents.ts b/modules/bitgo/test/v2/unit/unspents.ts index 069c5a3000..52b73d1348 100644 --- a/modules/bitgo/test/v2/unit/unspents.ts +++ b/modules/bitgo/test/v2/unit/unspents.ts @@ -21,6 +21,11 @@ describe('Verify string type is used for value of unspent', function () { function matchMinMaxValue(minValue: string, maxValue: string): boolean { return minValue === '1' && maxValue === highPrecisionBigInt.toString(); } + function assertIsString(val: unknown): asserts val is string { + if (typeof val !== 'string') { + throw new Error('Expected string'); + } + } describe('unspents APIs with string type minValue and maxValue', function () { after(function () { @@ -78,6 +83,8 @@ describe('Verify string type is used for value of unspent', function () { const maximumSpendableScope = nock(bgUrl) .get(`/api/v2/${wallet.coin()}/wallet/${wallet.id()}/maximumSpendable`) .query((queryParams) => { + assertIsString(queryParams.minValue); + assertIsString(queryParams.maxValue); return matchMinMaxValue(queryParams.minValue, queryParams.maxValue); }) .reply(200, {}); @@ -97,7 +104,9 @@ describe('Verify string type is used for value of unspent', function () { const unspentsScope = nock(bgUrl) .get(`/api/v2/${wallet.coin()}/wallet/${wallet.id()}/unspents`) .query((queryParams) => { - return matchMinMaxValue(queryParams.minValue, queryParams.maxValue); + assertIsString(queryParams.minValue); + assertIsString(queryParams.maxValue); + return matchMinMaxValue(queryParams.minValue as string, queryParams.maxValue); }) .reply(200, {}); diff --git a/modules/bitgo/test/v2/unit/wallet.ts b/modules/bitgo/test/v2/unit/wallet.ts index 2481b3238d..90a7665ff3 100644 --- a/modules/bitgo/test/v2/unit/wallet.ts +++ b/modules/bitgo/test/v2/unit/wallet.ts @@ -1107,12 +1107,12 @@ describe('V2 Wallet:', function () { const txRequestNock = nock(bgUrl) .post(`/api/v2/${hbarWallet.coin()}/wallet/${hbarWallet.id()}/tx/build`) .reply((uri, body) => { - const params = JSON.parse(body); + const params = body as any; params.recipients.length.should.equal(1); params.recipients[0].tokenName.should.equal('thbar:usdc'); params.type.should.equal('enabletoken'); should.not.exist(params.enableTokens); - return params; + return [200, params]; }); await hbarWallet.buildTokenEnablements(params); txRequestNock.isDone().should.equal(true); @@ -1242,21 +1242,24 @@ describe('V2 Wallet:', function () { const txRequestNock = nock(bgUrl) .post(`/api/v2/wallet/${solWallet.id()}/txrequests`) .reply((url, body) => { - const bodyParams = JSON.parse(body); + const bodyParams = body as any; bodyParams.intent.intentType.should.equal('enableToken'); bodyParams.intent.recipients.length.should.equal(0); bodyParams.intent.enableTokens.should.deepEqual(params.enableTokens); - return { - apiVersion: 'full', - transactions: [ - { - unsignedTx: { - serializedTxHex: 'fake transaction', - feeInfo: 'fake fee info', + return [ + 200, + { + apiVersion: 'full', + transactions: [ + { + unsignedTx: { + serializedTxHex: 'fake transaction', + feeInfo: 'fake fee info', + }, }, - }, - ], - }; + ], + }, + ]; }); await solWallet.buildTokenEnablements(params); txRequestNock.isDone().should.equal(true); diff --git a/modules/blake2b-wasm/blake2b.js b/modules/blake2b-wasm/blake2b.js index db63f4cd1c..606642b63d 100644 --- a/modules/blake2b-wasm/blake2b.js +++ b/modules/blake2b-wasm/blake2b.js @@ -1,8 +1,6 @@ module.exports = loadWebAssembly; -// turning off support for WebAssembly, -// chrome 69 has issues with loading webassembly in the main thread if the module size >4k -loadWebAssembly.supported = false; +loadWebAssembly.supported = true; function loadWebAssembly(opts) { if (!loadWebAssembly.supported) return null; diff --git a/modules/blake2b-wasm/index.js b/modules/blake2b-wasm/index.js index 3bb19b43c1..42b6bdd787 100644 --- a/modules/blake2b-wasm/index.js +++ b/modules/blake2b-wasm/index.js @@ -1,18 +1,20 @@ -var assert = require('nanoassert'); -var wasm = require('./blake2b')(); +const assert = require('nanoassert'); +const wasm = require('./blake2b')(); -var head = 64; -var freeList = []; +let head = 64; +const freeList = []; module.exports = Blake2b; -var BYTES_MIN = (module.exports.BYTES_MIN = 16); -var BYTES_MAX = (module.exports.BYTES_MAX = 64); -var BYTES = (module.exports.BYTES = 32); -var KEYBYTES_MIN = (module.exports.KEYBYTES_MIN = 16); -var KEYBYTES_MAX = (module.exports.KEYBYTES_MAX = 64); -var KEYBYTES = (module.exports.KEYBYTES = 32); -var SALTBYTES = (module.exports.SALTBYTES = 16); -var PERSONALBYTES = (module.exports.PERSONALBYTES = 16); +const BYTES_MIN = (module.exports.BYTES_MIN = 16); +const BYTES_MAX = (module.exports.BYTES_MAX = 64); +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const BYTES = (module.exports.BYTES = 32); +const KEYBYTES_MIN = (module.exports.KEYBYTES_MIN = 16); +const KEYBYTES_MAX = (module.exports.KEYBYTES_MAX = 64); +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const KEYBYTES = (module.exports.KEYBYTES = 32); +const SALTBYTES = (module.exports.SALTBYTES = 16); +const PERSONALBYTES = (module.exports.PERSONALBYTES = 16); function Blake2b(digestLength, key, salt, personal, noAssert) { if (!(this instanceof Blake2b)) return new Blake2b(digestLength, key, salt, personal, noAssert); @@ -94,7 +96,7 @@ Blake2b.prototype.digest = function (enc) { } assert(enc instanceof Uint8Array && enc.length >= this.digestLength, 'input must be Uint8Array or Buffer'); - for (var i = 0; i < this.digestLength; i++) { + for (let i = 0; i < this.digestLength; i++) { enc[i] = wasm.memory[this.pointer + 128 + i]; } @@ -112,7 +114,7 @@ Blake2b.ready = function (cb) { if (!wasm) return cb(new Error('WebAssembly not supported')); // backwards compat, can be removed in a new major - var p = new Promise(function (reject, resolve) { + const p = new Promise(function (reject, resolve) { wasm.onload(function (err) { if (err) resolve(); else reject(); @@ -125,11 +127,12 @@ Blake2b.ready = function (cb) { Blake2b.prototype.ready = Blake2b.ready; +// eslint-disable-next-line @typescript-eslint/no-empty-function function noop() {} function hexSlice(buf, start, len) { - var str = ''; - for (var i = 0; i < len; i++) str += toHex(buf[start + i]); + let str = ''; + for (let i = 0; i < len; i++) str += toHex(buf[start + i]); return str; } diff --git a/modules/blake2b-wasm/test.js b/modules/blake2b-wasm/test.js index ed404fcc14..0604b8e26f 100644 --- a/modules/blake2b-wasm/test.js +++ b/modules/blake2b-wasm/test.js @@ -1,17 +1,15 @@ -var tape = require('tape'); -var blake2b = require('./'); -var vectors = require('blake2b/test-vectors.json'); +const tape = require('tape'); +const blake2b = require('./'); +const vectors = require('../blake2b/test-vectors.json'); -var readyCalled = false; +let readyCalled = false; process.on('exit', function () { if (!readyCalled) throw new Error('ready not called'); }); -blake2b.ready(function () { - readyCalled = true; - +function test(b2b) { tape('hello world', function (t) { - var hash = blake2b() + const hash = blake2b() .update(Buffer.from('hello')) .update(Buffer.from(' ')) .update(Buffer.from('world')) @@ -22,7 +20,7 @@ blake2b.ready(function () { }); tape('hello world', function (t) { - var hash = blake2b(64) + const hash = blake2b(64) .update(Buffer.from('hello')) .update(Buffer.from(' ')) .update(Buffer.from('world')) @@ -36,14 +34,14 @@ blake2b.ready(function () { }); tape('both at the same time', function (t) { - var a = blake2b(); - var b = blake2b(64); + const a = blake2b(); + const b = blake2b(64); - var hash = a.update(Buffer.from('hello')).update(Buffer.from(' ')).update(Buffer.from('world')).digest('hex'); + let hash = a.update(Buffer.from('hello')).update(Buffer.from(' ')).update(Buffer.from('world')).digest('hex'); t.same(hash, '256c83b297114d201b30179f3f0ef0cace9783622da5974326b436178aeef610'); - var hash = b.update(Buffer.from('hello')).update(Buffer.from(' ')).update(Buffer.from('world')).digest('hex'); + hash = b.update(Buffer.from('hello')).update(Buffer.from(' ')).update(Buffer.from('world')).digest('hex'); t.same( hash, @@ -54,11 +52,11 @@ blake2b.ready(function () { vectors.forEach(function (vector, i) { tape('test-vectors.json #' + i, function (t) { - var key = vector.key && Buffer.from(vector.key, 'hex'); - var salt = vector.salt && Buffer.from(vector.salt, 'hex'); - var personal = vector.personal && Buffer.from(vector.personal, 'hex'); + const key = vector.key && Buffer.from(vector.key, 'hex'); + const salt = vector.salt && Buffer.from(vector.salt, 'hex'); + const personal = vector.personal && Buffer.from(vector.personal, 'hex'); - var hash = blake2b(vector.outlen, key, salt, personal, true) + const hash = blake2b(vector.outlen, key, salt, personal, true) .update(Buffer.from(vector.input, 'hex')) .digest('hex'); @@ -66,12 +64,16 @@ blake2b.ready(function () { t.end(); }); }); -}); +} tape('.ready()', function (t) { - var invokeCount = 0; + let invokeCount = 0; blake2b .ready() + .then(() => { + readyCalled = true; + }) + .then(test) .then(function () { invokeCount++; throw new Error(); diff --git a/modules/blake2b/index.js b/modules/blake2b/index.js index 77103a0749..2777222d8b 100644 --- a/modules/blake2b/index.js +++ b/modules/blake2b/index.js @@ -1,12 +1,23 @@ -var assert = require('nanoassert'); -var b2wasm = require('@bitgo/blake2b-wasm'); +const assert = require('nanoassert'); +const b2wasm = require('@bitgo/blake2b-wasm'); + +const BYTES_MIN = (module.exports.BYTES_MIN = 16); +const BYTES_MAX = (module.exports.BYTES_MAX = 64); +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const BYTES = (module.exports.BYTES = 32); +const KEYBYTES_MIN = (module.exports.KEYBYTES_MIN = 16); +const KEYBYTES_MAX = (module.exports.KEYBYTES_MAX = 64); +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const KEYBYTES = (module.exports.KEYBYTES = 32); +const SALTBYTES = (module.exports.SALTBYTES = 16); +const PERSONALBYTES = (module.exports.PERSONALBYTES = 16); // 64-bit unsigned addition // Sets v[a,a+1] += v[b,b+1] // v should be a Uint32Array function ADD64AA(v, a, b) { - var o0 = v[a] + v[b]; - var o1 = v[a + 1] + v[b + 1]; + const o0 = v[a] + v[b]; + let o1 = v[a + 1] + v[b + 1]; if (o0 >= 0x100000000) { o1++; } @@ -18,11 +29,11 @@ function ADD64AA(v, a, b) { // Sets v[a,a+1] += b // b0 is the low 32 bits of b, b1 represents the high 32 bits function ADD64AC(v, a, b0, b1) { - var o0 = v[a] + b0; + let o0 = v[a] + b0; if (b0 < 0) { o0 += 0x100000000; } - var o1 = v[a + 1] + b1; + let o1 = v[a + 1] + b1; if (o0 >= 0x100000000) { o1++; } @@ -38,17 +49,17 @@ function B2B_GET32(arr, i) { // G Mixing function // The ROTRs are inlined for speed function B2B_G(a, b, c, d, ix, iy) { - var x0 = m[ix]; - var x1 = m[ix + 1]; - var y0 = m[iy]; - var y1 = m[iy + 1]; + const x0 = m[ix]; + const x1 = m[ix + 1]; + const y0 = m[iy]; + const y1 = m[iy + 1]; ADD64AA(v, a, b); // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s ADD64AC(v, a, x0, x1); // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits - var xor0 = v[d] ^ v[a]; - var xor1 = v[d + 1] ^ v[a + 1]; + let xor0 = v[d] ^ v[a]; + let xor1 = v[d + 1] ^ v[a + 1]; v[d] = xor1; v[d + 1] = xor0; @@ -79,12 +90,12 @@ function B2B_G(a, b, c, d, ix, iy) { } // Initialization Vector -var BLAKE2B_IV32 = new Uint32Array([ +const BLAKE2B_IV32 = new Uint32Array([ 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, ]); -var SIGMA8 = [ +const SIGMA8 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, 12, 5, 1, 15, 14, 13, 4, 10, 0, @@ -96,7 +107,7 @@ var SIGMA8 = [ // These are offsets into a uint64 buffer. // Multiply them all by 2 to make them offsets into a uint32 buffer, // because this is JavaScript and we don't have uint64s -var SIGMA82 = new Uint8Array( +const SIGMA82 = new Uint8Array( SIGMA8.map(function (x) { return x * 2; }) @@ -104,12 +115,12 @@ var SIGMA82 = new Uint8Array( // Compression function. 'last' flag indicates last block. // Note we're representing 16 uint64s as 32 uint32s -var v = new Uint32Array(32); -var m = new Uint32Array(32); +const v = new Uint32Array(32); +const m = new Uint32Array(32); function blake2bCompress(ctx, last) { - var i = 0; + let i = 0; - // init work variables + // init work letiables for (i = 0; i < 16; i++) { v[i] = ctx.h[i]; v[i + 16] = BLAKE2B_IV32[i]; @@ -149,7 +160,7 @@ function blake2bCompress(ctx, last) { } // reusable parameter_block -var parameter_block = new Uint8Array([ +const parameter_block = new Uint8Array([ 0, 0, 0, @@ -239,7 +250,7 @@ function Blake2b(outlen, key, salt, personal) { if (personal) parameter_block.set(personal, 48); // initialize hash state - for (var i = 0; i < 16; i++) { + for (let i = 0; i < 16; i++) { this.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameter_block, i * 4); } @@ -258,7 +269,7 @@ Blake2b.prototype.update = function (input) { }; Blake2b.prototype.digest = function (out) { - var buf = !out || out === 'binary' || out === 'hex' ? new Uint8Array(this.outlen) : out; + const buf = !out || out === 'binary' || out === 'hex' ? new Uint8Array(this.outlen) : out; assert(buf instanceof Uint8Array, 'out must be "binary", "hex", Uint8Array, or Buffer'); assert(buf.length >= this.outlen, 'out must have at least outlen bytes of space'); blake2bFinal(this, buf); @@ -277,7 +288,7 @@ Blake2b.ready = function (cb) { // Updates a BLAKE2b streaming hash // Requires hash context and Uint8Array (byte array) function blake2bUpdate(ctx, input) { - for (var i = 0; i < input.length; i++) { + for (let i = 0; i < input.length; i++) { if (ctx.c === 128) { // buffer full ? ctx.t += ctx.c; // add counters @@ -299,15 +310,15 @@ function blake2bFinal(ctx, out) { } blake2bCompress(ctx, true); // final block flag = 1 - for (var i = 0; i < ctx.outlen; i++) { + for (let i = 0; i < ctx.outlen; i++) { out[i] = ctx.h[i >> 2] >> (8 * (i & 3)); } return out; } function hexSlice(buf) { - var str = ''; - for (var i = 0; i < buf.length; i++) str += toHex(buf[i]); + let str = ''; + for (let i = 0; i < buf.length; i++) str += toHex(buf[i]); return str; } @@ -316,7 +327,7 @@ function toHex(n) { return n.toString(16); } -var Proto = Blake2b; +const Proto = Blake2b; module.exports = function createHash(outlen, key, salt, personal, noAssert) { if (noAssert !== true) { @@ -353,15 +364,6 @@ module.exports.ready = function (cb) { module.exports.WASM_SUPPORTED = b2wasm.SUPPORTED; module.exports.WASM_LOADED = false; -var BYTES_MIN = (module.exports.BYTES_MIN = 16); -var BYTES_MAX = (module.exports.BYTES_MAX = 64); -var BYTES = (module.exports.BYTES = 32); -var KEYBYTES_MIN = (module.exports.KEYBYTES_MIN = 16); -var KEYBYTES_MAX = (module.exports.KEYBYTES_MAX = 64); -var KEYBYTES = (module.exports.KEYBYTES = 32); -var SALTBYTES = (module.exports.SALTBYTES = 16); -var PERSONALBYTES = (module.exports.PERSONALBYTES = 16); - b2wasm.ready(function (err) { if (!err) { module.exports.WASM_LOADED = true; diff --git a/modules/express/package.json b/modules/express/package.json index 59a211591a..a8da629b8d 100644 --- a/modules/express/package.json +++ b/modules/express/package.json @@ -58,12 +58,11 @@ "@types/express": "^4.16.1", "@types/lodash": "^4.14.121", "@types/morgan": "^1.7.35", - "@types/nock": "^9.3.1", "@types/node": "^11.11.4", "@types/sinon": "^10.0.11", "@types/supertest": "^2.0.11", "bignumber.js": "^8.0.1", - "nock": "^13.0.0", + "nock": "^13.3.1", "nyc": "^15.0.0", "should": "^13.2.3", "should-http": "^0.1.1", diff --git a/modules/express/test/unit/clientRoutes/externalSign.ts b/modules/express/test/unit/clientRoutes/externalSign.ts index 456f5907d6..2097ae452c 100644 --- a/modules/express/test/unit/clientRoutes/externalSign.ts +++ b/modules/express/test/unit/clientRoutes/externalSign.ts @@ -56,7 +56,7 @@ describe('External signer', () => { }, }; - nock(bgUrl).persist().get('/api/v1/client/constants').reply(200, { ttl: 3600, constants }); + nock(bgUrl).get('/api/v1/client/constants').times(3).reply(200, { ttl: 3600, constants }); }); after(() => { @@ -91,12 +91,14 @@ describe('External signer', () => { await handleV2Sign(req); - readFileStub.should.be.calledOnceWith('signerFileSystemPath'); - signTransactionStub.should.be.calledOnceWith( - sinon.match({ - prv: secret, - }) - ); + readFileStub.calledOnceWith('signerFileSystemPath').should.be.true(); + signTransactionStub + .calledOnceWith( + sinon.match({ + prv: secret, + }) + ) + .should.be.true(); readFileStub.restore(); signTransactionStub.restore(); envStub.restore(); diff --git a/modules/sdk-api/test/unit/v1/wallet.ts b/modules/sdk-api/test/unit/v1/wallet.ts index 8b1e4c4910..7fbb580a5e 100644 --- a/modules/sdk-api/test/unit/v1/wallet.ts +++ b/modules/sdk-api/test/unit/v1/wallet.ts @@ -920,7 +920,7 @@ describe('Wallet Prototype Methods', function () { }) .reply(200, function (_, body) { return { - transaction: JSON.parse(body as string).tx, + transaction: (body as any).tx, }; }); @@ -1020,7 +1020,7 @@ describe('Wallet Prototype Methods', function () { }) .reply(200, function (_, body) { return { - transaction: JSON.parse(body as string).tx, + transaction: (body as any).tx, }; }); @@ -1139,7 +1139,7 @@ describe('Wallet Prototype Methods', function () { }) .reply(200, function (_, body) { return { - transaction: JSON.parse(body as string).tx, + transaction: (body as any).tx, }; }); @@ -1266,7 +1266,7 @@ describe('Wallet Prototype Methods', function () { }) .reply(200, function (_, body) { return { - transaction: JSON.parse(body as string).tx, + transaction: (body as any).tx, }; }); diff --git a/modules/sdk-coin-ada/package.json b/modules/sdk-coin-ada/package.json index c6288767e9..0ec7936ee8 100644 --- a/modules/sdk-coin-ada/package.json +++ b/modules/sdk-coin-ada/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-algo/package.json b/modules/sdk-coin-algo/package.json index a368b73cbf..4d14d27fe6 100644 --- a/modules/sdk-coin-algo/package.json +++ b/modules/sdk-coin-algo/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-atom/package.json b/modules/sdk-coin-atom/package.json index eb6ead0002..0bc3dad3b6 100644 --- a/modules/sdk-coin-atom/package.json +++ b/modules/sdk-coin-atom/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-avaxc/package.json b/modules/sdk-coin-avaxc/package.json index d09c3a6cb2..2876bdc3ac 100644 --- a/modules/sdk-coin-avaxc/package.json +++ b/modules/sdk-coin-avaxc/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-avaxp/package.json b/modules/sdk-coin-avaxp/package.json index be49981f5f..db97e8a012 100644 --- a/modules/sdk-coin-avaxp/package.json +++ b/modules/sdk-coin-avaxp/package.json @@ -26,7 +26,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "lint-staged": { "*.{js,ts}": [ diff --git a/modules/sdk-coin-bch/package.json b/modules/sdk-coin-bch/package.json index 886273f0c8..8a85c01633 100644 --- a/modules/sdk-coin-bch/package.json +++ b/modules/sdk-coin-bch/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-bcha/package.json b/modules/sdk-coin-bcha/package.json index cf8cd7994e..910923fd98 100644 --- a/modules/sdk-coin-bcha/package.json +++ b/modules/sdk-coin-bcha/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-bld/package.json b/modules/sdk-coin-bld/package.json index 6de8cc90e3..2962030b5e 100644 --- a/modules/sdk-coin-bld/package.json +++ b/modules/sdk-coin-bld/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-bsc/package.json b/modules/sdk-coin-bsc/package.json index 9a2ae38201..200ecda95d 100644 --- a/modules/sdk-coin-bsc/package.json +++ b/modules/sdk-coin-bsc/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-bsv/package.json b/modules/sdk-coin-bsv/package.json index afe37960b0..3033b3ee13 100644 --- a/modules/sdk-coin-bsv/package.json +++ b/modules/sdk-coin-bsv/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-btc/package.json b/modules/sdk-coin-btc/package.json index c5b0304515..f3adc7b2e2 100644 --- a/modules/sdk-coin-btc/package.json +++ b/modules/sdk-coin-btc/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-btg/package.json b/modules/sdk-coin-btg/package.json index 3178a7d9c2..bd4f7ca87f 100644 --- a/modules/sdk-coin-btg/package.json +++ b/modules/sdk-coin-btg/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-celo/package.json b/modules/sdk-coin-celo/package.json index d47dcdb4cb..0b93973f6f 100644 --- a/modules/sdk-coin-celo/package.json +++ b/modules/sdk-coin-celo/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-cspr/package.json b/modules/sdk-coin-cspr/package.json index 42bf6a9055..b157159233 100644 --- a/modules/sdk-coin-cspr/package.json +++ b/modules/sdk-coin-cspr/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-dash/package.json b/modules/sdk-coin-dash/package.json index 31e005e3bd..5084ab01c5 100644 --- a/modules/sdk-coin-dash/package.json +++ b/modules/sdk-coin-dash/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-doge/package.json b/modules/sdk-coin-doge/package.json index 4dd88ed63b..9dc49b582a 100644 --- a/modules/sdk-coin-doge/package.json +++ b/modules/sdk-coin-doge/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-dot/package.json b/modules/sdk-coin-dot/package.json index 808d77e793..fb1d2856d2 100644 --- a/modules/sdk-coin-dot/package.json +++ b/modules/sdk-coin-dot/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-eos/package.json b/modules/sdk-coin-eos/package.json index e1fff5801c..dc2f51488a 100644 --- a/modules/sdk-coin-eos/package.json +++ b/modules/sdk-coin-eos/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-etc/package.json b/modules/sdk-coin-etc/package.json index 65987fa002..225d97d04a 100644 --- a/modules/sdk-coin-etc/package.json +++ b/modules/sdk-coin-etc/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-eth/package.json b/modules/sdk-coin-eth/package.json index 7f6ab0a0a0..e88c17ebcb 100644 --- a/modules/sdk-coin-eth/package.json +++ b/modules/sdk-coin-eth/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-eth2/package.json b/modules/sdk-coin-eth2/package.json index 443cb63079..7e608fc63a 100644 --- a/modules/sdk-coin-eth2/package.json +++ b/modules/sdk-coin-eth2/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-ethw/package.json b/modules/sdk-coin-ethw/package.json index f884f5fc4c..d8064f9b2d 100644 --- a/modules/sdk-coin-ethw/package.json +++ b/modules/sdk-coin-ethw/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-hash/package.json b/modules/sdk-coin-hash/package.json index 8ae5c0d7eb..f20ed02058 100644 --- a/modules/sdk-coin-hash/package.json +++ b/modules/sdk-coin-hash/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-hbar/package.json b/modules/sdk-coin-hbar/package.json index 7b5d31549a..98b63cf190 100644 --- a/modules/sdk-coin-hbar/package.json +++ b/modules/sdk-coin-hbar/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-injective/package.json b/modules/sdk-coin-injective/package.json index c507693f73..a06733a8b4 100644 --- a/modules/sdk-coin-injective/package.json +++ b/modules/sdk-coin-injective/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-ltc/package.json b/modules/sdk-coin-ltc/package.json index 318a51fc10..a47aea5b0c 100644 --- a/modules/sdk-coin-ltc/package.json +++ b/modules/sdk-coin-ltc/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-near/package.json b/modules/sdk-coin-near/package.json index 4f468a4b91..cfb2b8c174 100644 --- a/modules/sdk-coin-near/package.json +++ b/modules/sdk-coin-near/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-osmo/package.json b/modules/sdk-coin-osmo/package.json index 8da4cb910e..8eda56518a 100644 --- a/modules/sdk-coin-osmo/package.json +++ b/modules/sdk-coin-osmo/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-polygon/package.json b/modules/sdk-coin-polygon/package.json index 7f6764c5d5..2d5fe1048d 100644 --- a/modules/sdk-coin-polygon/package.json +++ b/modules/sdk-coin-polygon/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-rbtc/package.json b/modules/sdk-coin-rbtc/package.json index a82405caf3..eb72d19049 100644 --- a/modules/sdk-coin-rbtc/package.json +++ b/modules/sdk-coin-rbtc/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-sei/package.json b/modules/sdk-coin-sei/package.json index a7e62d06d6..e5558b8ad9 100644 --- a/modules/sdk-coin-sei/package.json +++ b/modules/sdk-coin-sei/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-sol/package.json b/modules/sdk-coin-sol/package.json index bf1e71c26c..b6419926c9 100644 --- a/modules/sdk-coin-sol/package.json +++ b/modules/sdk-coin-sol/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-stx/package.json b/modules/sdk-coin-stx/package.json index f4531f9e8f..48f245e3f9 100644 --- a/modules/sdk-coin-stx/package.json +++ b/modules/sdk-coin-stx/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-sui/package.json b/modules/sdk-coin-sui/package.json index 89cde7ca01..b62534faec 100644 --- a/modules/sdk-coin-sui/package.json +++ b/modules/sdk-coin-sui/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-tia/package.json b/modules/sdk-coin-tia/package.json index f80b8c6ce6..8004068488 100644 --- a/modules/sdk-coin-tia/package.json +++ b/modules/sdk-coin-tia/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-trx/package.json b/modules/sdk-coin-trx/package.json index 9fd52e2567..18ec62ae3a 100644 --- a/modules/sdk-coin-trx/package.json +++ b/modules/sdk-coin-trx/package.json @@ -21,7 +21,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-xlm/package.json b/modules/sdk-coin-xlm/package.json index ebf9a72a8f..a16fe73667 100644 --- a/modules/sdk-coin-xlm/package.json +++ b/modules/sdk-coin-xlm/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-xrp/package.json b/modules/sdk-coin-xrp/package.json index afb9034cfc..b2a21d05d2 100644 --- a/modules/sdk-coin-xrp/package.json +++ b/modules/sdk-coin-xrp/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-xtz/package.json b/modules/sdk-coin-xtz/package.json index 784f50cd93..eb74e3267b 100644 --- a/modules/sdk-coin-xtz/package.json +++ b/modules/sdk-coin-xtz/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-coin-zec/package.json b/modules/sdk-coin-zec/package.json index e45f5011fa..f8e897779b 100644 --- a/modules/sdk-coin-zec/package.json +++ b/modules/sdk-coin-zec/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", @@ -45,7 +45,6 @@ "@bitgo/utxo-lib": "^9.2.0" }, "devDependencies": { - "@bitgo/sdk-api": "^1.11.2", - "@bitgo/sdk-test": "^1.2.27" + "@bitgo/sdk-api": "^1.11.2" } } diff --git a/modules/sdk-coin-zec/test/unit/index.ts b/modules/sdk-coin-zec/test/unit/index.ts index bf486a687a..bbb07e7a0a 100644 --- a/modules/sdk-coin-zec/test/unit/index.ts +++ b/modules/sdk-coin-zec/test/unit/index.ts @@ -1,19 +1,16 @@ +import 'should'; import { BitGoAPI } from '@bitgo/sdk-api'; -import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test'; import { Zec, Tzec } from '../../src'; describe('Zec', function () { const coinName = 'tzec'; - let bitgo: TestBitGoAPI; + let bitgo: BitGoAPI; let basecoin; before(function () { - bitgo = TestBitGo.decorate(BitGoAPI, { - env: 'mock', - }); - bitgo.initializeTestVars(); - bitgo.safeRegister('zec', Zec.createInstance); - bitgo.safeRegister('tzec', Tzec.createInstance); + bitgo = new BitGoAPI({ env: 'mock' }); + bitgo.register('zec', Zec.createInstance); + bitgo.register('tzec', Tzec.createInstance); basecoin = bitgo.coin(coinName); }); diff --git a/modules/sdk-coin-zec/tsconfig.json b/modules/sdk-coin-zec/tsconfig.json index 2e0a0616c5..f2068fb8d7 100644 --- a/modules/sdk-coin-zec/tsconfig.json +++ b/modules/sdk-coin-zec/tsconfig.json @@ -19,9 +19,6 @@ { "path": "../sdk-core" }, - { - "path": "../sdk-test" - }, { "path": "../utxo-lib" } diff --git a/modules/sdk-core/src/bitgo/utils/tss/ecdsa/ecdsa.ts b/modules/sdk-core/src/bitgo/utils/tss/ecdsa/ecdsa.ts index 35d5750c80..66895941c0 100644 --- a/modules/sdk-core/src/bitgo/utils/tss/ecdsa/ecdsa.ts +++ b/modules/sdk-core/src/bitgo/utils/tss/ecdsa/ecdsa.ts @@ -1183,7 +1183,7 @@ export class EcdsaUtils extends baseTSSUtils { .result(); } - static publicKeyFromCommonKeychain(commonKeychain: string) { + static publicKeyFromCommonKeychain(commonKeychain: string): string { const pub = EcdsaUtils.getPublicKeyFromCommonKeychain(commonKeychain); const secp256k1 = new ec('secp256k1'); const key = secp256k1.keyFromPublic(pub, 'hex'); diff --git a/modules/sdk-rpc-wrapper/package.json b/modules/sdk-rpc-wrapper/package.json index cc6172b913..15e3b8e9b9 100644 --- a/modules/sdk-rpc-wrapper/package.json +++ b/modules/sdk-rpc-wrapper/package.json @@ -23,7 +23,7 @@ "author": "Bitgo DEFI Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/sdk-unified-wallet/package.json b/modules/sdk-unified-wallet/package.json index 1311ccfd36..2f8e8b0d2c 100644 --- a/modules/sdk-unified-wallet/package.json +++ b/modules/sdk-unified-wallet/package.json @@ -10,7 +10,10 @@ "clean": "rm -r ./dist", "lint": "eslint --quiet .", "prepare": "npm run build", - "fmt": "prettier --write '{src,test}/**/*.{ts,js,json}'" + "fmt": "prettier --write '{src,test}/**/*.{ts,js,json}'", + "test": "npm run coverage", + "coverage": "nyc -- npm run unit-test", + "unit-test": "mocha" }, "dependencies": { "@bitgo/sdk-core": "^8.10.0", @@ -26,7 +29,7 @@ "author": "Bitgo DEFI Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/modules/secp256k1/package.json b/modules/secp256k1/package.json index 600cae563d..4ab4b4c14f 100644 --- a/modules/secp256k1/package.json +++ b/modules/secp256k1/package.json @@ -4,7 +4,7 @@ "description": "Low-level cryptographic methods used in BitGo packages for the secp256k1 curve", "main": "./dist/src/index.js", "engines": { - "node": ">=10.22.0 <17", + "node": ">=10.22.0 <19", "npm": ">=3.10.10" }, "keywords": [ diff --git a/modules/utxo-lib/package.json b/modules/utxo-lib/package.json index 8194399a67..1a9e687381 100644 --- a/modules/utxo-lib/package.json +++ b/modules/utxo-lib/package.json @@ -4,7 +4,7 @@ "description": "Client-side Bitcoin JavaScript library", "main": "./dist/src/index.js", "engines": { - "node": ">=10.22.0 <17", + "node": ">=10.22.0 <19", "npm": ">=3.10.10" }, "keywords": [ diff --git a/package.json b/package.json index 1106612338..359fe93f27 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "@commitlint/config-conventional": "^11.0.0", "@types/lodash": "^4.14.151", "@types/mocha": "^9.1.0", - "@types/nock": "^9.3.1", "@types/node": "^11.11.4", "@types/semver": "^7.3.12", "@types/sinon": "^7.0.6", @@ -35,7 +34,7 @@ "lint-staged": "^12.4.1", "make-dir": "^3.1.0", "mocha": "^9.2.0", - "nock": "=9.0.28", + "nock": "^13.3.1", "nyc": "^15.1.0", "parse-url": "^8.1.0", "prettier": "^2.3.0", diff --git a/scripts/sdk-coin-generator/template/base/package.json b/scripts/sdk-coin-generator/template/base/package.json index aa0d8e88ab..c75987ade9 100644 --- a/scripts/sdk-coin-generator/template/base/package.json +++ b/scripts/sdk-coin-generator/template/base/package.json @@ -18,7 +18,7 @@ "author": "BitGo SDK Team ", "license": "MIT", "engines": { - "node": ">=16 <17" + "node": ">=16 <19" }, "repository": { "type": "git", diff --git a/yarn.lock b/yarn.lock index bd0ebde2e6..c3ca91fa25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4817,13 +4817,6 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== -"@types/nock@^9.3.1": - version "9.3.1" - resolved "https://registry.yarnpkg.com/@types/nock/-/nock-9.3.1.tgz#7d761a43a10aebc7ec6bae29d89afc6cbffa5d30" - integrity sha512-eOVHXS5RnWOjTVhu3deCM/ruy9E6JCgeix2g7wpFiekQh3AaEAK1cz43tZDukKmtSmQnwvSySq7ubijCA32I7Q== - dependencies: - "@types/node" "*" - "@types/node-fetch@^2.6.2": version "2.6.3" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.3.tgz#175d977f5e24d93ad0f57602693c435c57ad7e80" @@ -6061,7 +6054,7 @@ assert@^1.4.0: object-assign "^4.1.1" util "0.10.3" -assertion-error@^1.0.1, assertion-error@^1.1.0: +assertion-error@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== @@ -7273,15 +7266,6 @@ catharsis@^0.9.0: dependencies: lodash "^4.17.15" -"chai@>=1.9.2 <4.0.0": - version "3.5.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247" - integrity sha512-eRYY0vPS2a9zt5w5Z0aCeWbrXTEyvk7u/Xf71EzNObrjSCPgMm1Nku/D/u2tiqHBX5j40wWhj54YJLtgn8g55A== - dependencies: - assertion-error "^1.0.1" - deep-eql "^0.1.3" - type-detect "^1.0.0" - chai@^4.3.6: version "4.3.7" resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" @@ -8435,13 +8419,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -deep-eql@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" - integrity sha512-6sEotTRGBFiNcqVoeHwnfopbSpi5NbH1VWJmYCVkmxMmaVTT0bUTrNaGyBwhgP4MZL012W/mkzIn3Da+iDYweg== - dependencies: - type-detect "0.1.1" - deep-eql@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" @@ -8449,18 +8426,6 @@ deep-eql@^4.1.2: dependencies: type-detect "^4.0.0" -deep-equal@^1.0.0, deep-equal@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" - integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== - dependencies: - is-arguments "^1.0.4" - is-date-object "^1.0.1" - is-regex "^1.0.4" - object-is "^1.0.1" - object-keys "^1.1.1" - regexp.prototype.flags "^1.2.0" - deep-equal@^2.0.5: version "2.2.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.1.tgz#c72ab22f3a7d3503a4ca87dde976fe9978816739" @@ -8485,6 +8450,18 @@ deep-equal@^2.0.5: which-collection "^1.0.1" which-typed-array "^1.1.9" +deep-equal@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" + integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== + dependencies: + is-arguments "^1.0.4" + is-date-object "^1.0.1" + is-regex "^1.0.4" + object-is "^1.0.1" + object-keys "^1.1.1" + regexp.prototype.flags "^1.2.0" + deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -12977,7 +12954,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.2, lodash@~4.17.21: +lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -13558,7 +13535,7 @@ mkdirp@*: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== -mkdirp@^0.5.0, mkdirp@^0.5.4, mkdirp@^0.5.5: +mkdirp@^0.5.4, mkdirp@^0.5.5: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== @@ -13870,22 +13847,7 @@ noble-bls12-381@0.7.2, noble-bls12-381@^0.7.2: resolved "https://registry.yarnpkg.com/noble-bls12-381/-/noble-bls12-381-0.7.2.tgz#9a9384891569ba32785d6e4ff8588b783487eae4" integrity sha512-Z5isbU6opuWPL3dxsGqO5BdOE8WP1XUM7HFIn/xeE5pATTnml/PEIy4MFQQrktHiitkuJdsCDtzEOnS9eIpC3Q== -nock@=9.0.28: - version "9.0.28" - resolved "https://registry.yarnpkg.com/nock/-/nock-9.0.28.tgz#99b879ce0e4827f421e42e47356287d6b4c2b58c" - integrity sha512-MXGP3NA+I8BpwF8r2LnK9N1Dwz69N82peP9Ht3G9EMUAKHK73relYI8Pjik9AwvGSVV0kAo6KA20IbKsCjNyIA== - dependencies: - chai ">=1.9.2 <4.0.0" - debug "^2.2.0" - deep-equal "^1.0.0" - json-stringify-safe "^5.0.1" - lodash "~4.17.2" - mkdirp "^0.5.0" - propagate "0.4.0" - qs "^6.0.2" - semver "^5.3.0" - -nock@^13.0.0, nock@^13.2.9: +nock@^13.2.9: version "13.3.1" resolved "https://registry.yarnpkg.com/nock/-/nock-13.3.1.tgz#f22d4d661f7a05ebd9368edae1b5dc0a62d758fc" integrity sha512-vHnopocZuI93p2ccivFyGuUfzjq2fxNyNurp7816mlT5V5HF4SzXu8lvLrVzBbNqzs+ODooZ6OksuSUNM7Njkw== @@ -13895,6 +13857,16 @@ nock@^13.0.0, nock@^13.2.9: lodash "^4.17.21" propagate "^2.0.0" +nock@^13.3.1: + version "13.3.2" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.3.2.tgz#bfa6be92d37f744b1b758ea89b1105cdaf5c8b3f" + integrity sha512-CwbljitiWJhF1gL83NbanhoKs1l23TDlRioNraPTZrzZIEooPemrHRj5m0FZCPkB1ecdYCSWWGcHysJgX/ngnQ== + dependencies: + debug "^4.1.0" + json-stringify-safe "^5.0.1" + lodash "^4.17.21" + propagate "^2.0.0" + node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" @@ -15413,11 +15385,6 @@ promzard@^0.3.0: dependencies: read "1" -propagate@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/propagate/-/propagate-0.4.0.tgz#f3fcca0a6fe06736a7ba572966069617c130b481" - integrity sha512-B2oM5/8COVRM/gc/3slgBtaRO1h/ZiGwEi+zyB5FcZa3lpb0UBc3ncH4O0BxANHLUsuFUG1F+LWFREJ0/WuTFg== - propagate@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" @@ -15592,7 +15559,7 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" -qs@^6.0.2, qs@^6.10.3, qs@^6.11.0, qs@^6.5.1, qs@^6.9.4: +qs@^6.10.3, qs@^6.11.0, qs@^6.5.1, qs@^6.9.4: version "6.11.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.1.tgz#6c29dff97f0c0060765911ba65cbc9764186109f" integrity sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ== @@ -16604,7 +16571,7 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -18186,21 +18153,11 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" - integrity sha512-5rqszGVwYgBoDkIm2oUtvkfZMQ0vk29iDMU0W2qCa3rG0vPDNczCMT4hV/bLBgLg8k8ri6+u3Zbt+S/14eMzlA== - type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-detect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" - integrity sha512-f9Uv6ezcpvCQjJU0Zqbg+65qdcszv3qUQsZfjdRbWiZ7AMenrX1u0lNk9EoWWX6e1F+NULyg27mtdeZ5WhpljA== - type-fest@^0.18.0: version "0.18.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f"