From e61b0b8fc6f6da2e8913282e2182f1f9c29a6c89 Mon Sep 17 00:00:00 2001 From: Kenny Joseph Date: Fri, 17 Jul 2026 15:40:28 -0400 Subject: [PATCH 1/2] change default number format from hex to number --- packages/bitcore-wallet-client/src/lib/api.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/bitcore-wallet-client/src/lib/api.ts b/packages/bitcore-wallet-client/src/lib/api.ts index b68542eb55..891192e267 100644 --- a/packages/bitcore-wallet-client/src/lib/api.ts +++ b/packages/bitcore-wallet-client/src/lib/api.ts @@ -46,6 +46,8 @@ for (const network in NetworkChar) { // invert NetworkChar NetworkChar[NetworkChar[network]] = network; } +const defaultNumberFormat = 'number'; // 'number' | 'string' | 'hex' + const BASE_URL = 'http://localhost:3232/bws/api'; export class API extends EventEmitter { @@ -1400,7 +1402,7 @@ export class API extends EventEmitter { qs.push(`includeExtendedInfo=${opts.includeExtendedInfo ? '1' : '0'}`); qs.push(`twoStep=${opts.twoStep ? '1' : '0'}`); qs.push('serverMessageArray=1'); - qs.push('numberFormat=hex'); // Only applies to `pendingTxps` in response. TODO apply this to balances as well. + qs.push('numberFormat=' + defaultNumberFormat); // Only applies to `pendingTxps` in response. TODO apply this to balances as well. if (opts.tokenAddress) { qs.push('tokenAddress=' + opts.tokenAddress); @@ -1732,7 +1734,7 @@ export class API extends EventEmitter { const args = { proposalSignature: Utils.signMessage(hash, this.credentials.requestPrivKey) }; - const qs = `numberFormat=${opts.numberFormat || 'hex'}`; + const qs = `numberFormat=${opts.numberFormat || defaultNumberFormat}`; const url = `/v2/txproposals/${opts.txp.id}/publish?${qs}`; const { body: txp } = await this.request.post(url, args); @@ -1937,7 +1939,7 @@ export class API extends EventEmitter { opts = opts || {}; const { doNotVerify, forAirGapped, doNotEncryptPkr } = opts; - const qs = `numberFormat=${opts.numberFormat || 'hex'}`; + const qs = `numberFormat=${opts.numberFormat || defaultNumberFormat}`; const { body: txps } = await this.request.get(`/v2/txproposals?${qs}`); this._processTxps(txps); From 5aa22b50958e8d9f29d8e9a921ed88590291c392 Mon Sep 17 00:00:00 2001 From: Kenny Joseph Date: Fri, 17 Jul 2026 16:32:51 -0400 Subject: [PATCH 2/2] fix test --- packages/bitcore-wallet-client/test/api.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bitcore-wallet-client/test/api.test.ts b/packages/bitcore-wallet-client/test/api.test.ts index 34376acc9b..26bf062266 100644 --- a/packages/bitcore-wallet-client/test/api.test.ts +++ b/packages/bitcore-wallet-client/test/api.test.ts @@ -5451,8 +5451,8 @@ describe('client API', function() { txp.outputs[0].message.should.equal('output 0'); txp.message.should.equal('hello'); txp.txType.should.equal(2); - txp.maxGasFee.should.equal('0x4e20'); // 20000 - txp.priorityGasFee.should.equal('0x1388'); // 5000 + txp.maxGasFee.should.equal(20000); // 0x4e20 + txp.priorityGasFee.should.equal(5000); // 0x1388 const signatures = await keys[0].sign(clients[0].getRootPath(), txp); clients[0].pushSignatures(txp, signatures, (err, txp) => { should.not.exist(err);