Skip to content

Commit 4eac321

Browse files
Merge pull request #5189 from BitGo/BTC-1450.bump-typescript
feat: bump typescript to 5.7
2 parents 8bd274d + d44568e commit 4eac321

File tree

21 files changed

+35
-20
lines changed

21 files changed

+35
-20
lines changed

modules/abstract-eth/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"superagent": "^9.0.1"
5959
},
6060
"devDependencies": {
61+
"@types/keccak": "^3.0.5",
6162
"@bitgo/sdk-api": "^1.56.7",
6263
"@bitgo/sdk-test": "^8.0.54"
6364
}

modules/abstract-eth/src/lib/transferBuilder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ export class TransferBuilder {
155155

156156
if (this._coinUsesNonPackedEncodingForTxData) {
157157
const types: string[] = operationData[0] as string[];
158-
const values: string[] = operationData[1].map((item) =>
159-
item instanceof Buffer ? '0x' + item.toString('hex') : item
158+
const values: (string | number)[] = operationData[1].map((item) =>
159+
typeof item === 'string' || typeof item === 'number' ? item : '0x' + item.toString('hex')
160160
);
161161
operationHash = keccak256(defaultAbiCoder.encode(types, values));
162162
} else {
@@ -166,7 +166,7 @@ export class TransferBuilder {
166166
return operationHash;
167167
}
168168

169-
protected getOperationData(): (string | Buffer)[][] {
169+
protected getOperationData(): (string | number | Buffer)[][] {
170170
let operationData;
171171
const prefix = this.getOperationHashPrefix();
172172
if (this._tokenContractAddress !== undefined) {

modules/account-lib/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"devDependencies": {
7676
"@solana/web3.js": "1.92.1",
7777
"@types/bs58": "^4.0.1",
78+
"@types/keccak": "^3.0.5",
7879
"keccak": "3.0.3",
7980
"paillier-bigint": "3.3.0",
8081
"shx": "^0.3.4"

modules/account-lib/test/unit/mpc/tss/ecdsa/ecdsa.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ describe('TSS ECDSA TESTS', function () {
340340
// and delta share received from the other signer
341341

342342
const hashGenerator = (hashType?: string): Hash | undefined => {
343-
return hashType === 'keccak256' ? createKeccakHash('keccak256') : undefined;
343+
return hashType === 'keccak256' ? (createKeccakHash('keccak256') as Hash) : undefined;
344344
};
345345
const [signA, signB] = [
346346
MPC.sign(

modules/account-lib/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"esModuleInterop": true,
88
"typeRoots": ["../../types", "./node_modules/@types", "../../node_modules/@types"]
99
},
10-
"include": ["src/**/*", "resources/**/*"],
10+
"include": ["src/**/*", "test/**/*", "resources/**/*"],
1111
"exclude": ["node_modules"],
1212
"references": [
1313
{

modules/sdk-api/src/v1/wallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ Wallet.prototype.consolidateUnspents = function (params, callback) {
21732173
return consolidationTransactions;
21742174
});
21752175

2176-
return runNextConsolidation(this, target)
2176+
return runNextConsolidation()
21772177
.catch(function (err) {
21782178
if (err.message === 'Done') {
21792179
return;

modules/sdk-api/test/unit/v1/wallet.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ const TestBitGo = {
2323
TEST_WALLET1_PASSCODE: 'iVWeATjqLS1jJShrPpETti0b',
2424
};
2525
const originalFetchConstants = BitGoAPI.prototype.fetchConstants;
26-
BitGoAPI.prototype.fetchConstants = function () {
27-
// @ts-expect-error - no implicit this
26+
BitGoAPI.prototype.fetchConstants = function (this: any) {
2827
nock(this._baseUrl).get('/api/v1/client/constants').reply(200, { ttl: 3600, constants: {} });
2928

3029
// force client constants reload

modules/sdk-coin-ada/src/ada.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class Ada extends BaseCoin {
161161
/** @inheritDoc */
162162
async signMessage(key: KeyPair, message: string | Buffer): Promise<Buffer> {
163163
const adaKeypair = new AdaKeyPair({ prv: key.prv });
164-
const messageHex = message instanceof Buffer ? message.toString('hex') : message;
164+
const messageHex = typeof message === 'string' ? message : message.toString('hex');
165165

166166
return Buffer.from(adaKeypair.signMessage(messageHex));
167167
}

modules/sdk-coin-avaxc/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"devDependencies": {
5959
"@bitgo/sdk-api": "^1.56.7",
6060
"@bitgo/sdk-test": "^8.0.54",
61+
"@types/keccak": "^3.0.5",
6162
"ethers": "^5.1.3"
6263
}
6364
}

modules/sdk-coin-cspr/src/cspr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export class Cspr extends BaseCoin {
247247
*/
248248
async signMessage(key: KeyPair, message: string | Buffer): Promise<Buffer> {
249249
const keyPair = new CsprLib.KeyPair({ prv: key.prv });
250-
const messageHex = message instanceof Buffer ? message.toString('hex') : message;
250+
const messageHex = typeof message === 'string' ? message : message.toString('hex');
251251
const signatureData = CsprLib.Utils.signMessage(keyPair, messageHex);
252252
return Buffer.from(signatureData.signature);
253253
}

0 commit comments

Comments
 (0)