From f3dec74befc76bb305a4f9ac72975e4de43787ff Mon Sep 17 00:00:00 2001 From: Mohammad Al Faiyaz Date: Wed, 22 Oct 2025 15:44:16 -0400 Subject: [PATCH] feat(sdk-core): add typing on fetch addresses - Update @bitgo/public-types from 5.31.0 to 5.34.0 across all packages - sdk-core - sdk-coin-sol - express - bitgo - abstract-lightning - Import and apply AddressQueryResult type to addresses() method in Wallet class and IWallet interface - Update addresses() return type from Promise to Promise This change improves type safety for the /api/v2/{coin}/wallet/{walletId}/addresses endpoint and ensures proper typing for address query responses across the SDK. TICKET: WP-6403 --- modules/abstract-lightning/package.json | 2 +- modules/bitgo/package.json | 2 +- modules/express/package.json | 2 +- modules/sdk-coin-sol/package.json | 2 +- modules/sdk-core/package.json | 2 +- modules/sdk-core/src/bitgo/wallet/iWallet.ts | 4 ++-- modules/sdk-core/src/bitgo/wallet/wallet.ts | 4 ++-- yarn.lock | 8 ++++---- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/abstract-lightning/package.json b/modules/abstract-lightning/package.json index 3f81cdc4fc..d08297cf98 100644 --- a/modules/abstract-lightning/package.json +++ b/modules/abstract-lightning/package.json @@ -39,7 +39,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "5.31.0", + "@bitgo/public-types": "5.34.0", "@bitgo/sdk-core": "^36.15.0", "@bitgo/statics": "^58.7.0", "@bitgo/utxo-lib": "^11.13.0", diff --git a/modules/bitgo/package.json b/modules/bitgo/package.json index b978cb7fcf..a3ad604380 100644 --- a/modules/bitgo/package.json +++ b/modules/bitgo/package.json @@ -138,7 +138,7 @@ "superagent": "^9.0.1" }, "devDependencies": { - "@bitgo/public-types": "5.31.0", + "@bitgo/public-types": "5.34.0", "@bitgo/sdk-opensslbytes": "^2.1.0", "@bitgo/sdk-test": "^9.1.7", "@openpgp/web-stream-tools": "0.0.14", diff --git a/modules/express/package.json b/modules/express/package.json index eb9ae10183..3b978c5d78 100644 --- a/modules/express/package.json +++ b/modules/express/package.json @@ -58,7 +58,7 @@ "superagent": "^9.0.1" }, "devDependencies": { - "@bitgo/public-types": "5.31.0", + "@bitgo/public-types": "5.34.0", "@bitgo/sdk-lib-mpc": "^10.8.1", "@bitgo/sdk-test": "^9.1.7", "@types/argparse": "^1.0.36", diff --git a/modules/sdk-coin-sol/package.json b/modules/sdk-coin-sol/package.json index 59d7aa1fb8..d045b49a5b 100644 --- a/modules/sdk-coin-sol/package.json +++ b/modules/sdk-coin-sol/package.json @@ -40,7 +40,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "5.31.0", + "@bitgo/public-types": "5.34.0", "@bitgo/sdk-core": "^36.15.0", "@bitgo/sdk-lib-mpc": "^10.8.1", "@bitgo/statics": "^58.7.0", diff --git a/modules/sdk-core/package.json b/modules/sdk-core/package.json index 0c89ab044e..6f6369ff73 100644 --- a/modules/sdk-core/package.json +++ b/modules/sdk-core/package.json @@ -40,7 +40,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "5.31.0", + "@bitgo/public-types": "5.34.0", "@bitgo/sdk-lib-mpc": "^10.8.1", "@bitgo/secp256k1": "^1.6.0", "@bitgo/sjcl": "^1.0.1", diff --git a/modules/sdk-core/src/bitgo/wallet/iWallet.ts b/modules/sdk-core/src/bitgo/wallet/iWallet.ts index 735d4408a6..0fd04806da 100644 --- a/modules/sdk-core/src/bitgo/wallet/iWallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/iWallet.ts @@ -31,7 +31,7 @@ import { } from '../utils'; import { SerializedNtilde } from '../../account-lib/mpc/tss/ecdsa/types'; import { IAddressBook } from '../address-book'; -import { WalletUser } from '@bitgo/public-types'; +import { WalletUser, AddressQueryResult } from '@bitgo/public-types'; import { SubmitTransactionResponse } from '../inscriptionBuilder'; export interface MaximumSpendableOptions { @@ -939,7 +939,7 @@ export interface IWallet { sweep(params?: SweepOptions): Promise; freeze(params?: FreezeOptions): Promise; transferComment(params?: TransferCommentOptions): Promise; - addresses(params?: AddressesOptions): Promise; + addresses(params?: AddressesOptions): Promise; getAddress(params?: GetAddressOptions): Promise; createAddress(params?: CreateAddressOptions): Promise; updateAddress(params?: UpdateAddressOptions): Promise; diff --git a/modules/sdk-core/src/bitgo/wallet/wallet.ts b/modules/sdk-core/src/bitgo/wallet/wallet.ts index bec6a9c890..2dd9f8c00f 100644 --- a/modules/sdk-core/src/bitgo/wallet/wallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/wallet.ts @@ -1,7 +1,7 @@ /** * @prettier */ -import { TxSendBody } from '@bitgo/public-types'; +import { TxSendBody, type AddressQueryResult } from '@bitgo/public-types'; import { CoinFamily } from '@bitgo/statics'; import assert from 'assert'; import BigNumber from 'bignumber.js'; @@ -1077,7 +1077,7 @@ export class Wallet implements IWallet { * @param params * @returns {*} */ - async addresses(params: AddressesOptions = {}): Promise { + async addresses(params: AddressesOptions = {}): Promise { common.validateParams(params, [], []); const query: AddressesOptions = {}; diff --git a/yarn.lock b/yarn.lock index 8cf443687f..5bc578c7ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -944,10 +944,10 @@ "@scure/base" "1.1.5" micro-eth-signer "0.7.2" -"@bitgo/public-types@5.31.0": - version "5.31.0" - resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-5.31.0.tgz#1af37545bdaaf6bb65de6a9c47cb38817d16472c" - integrity sha512-4uiFZHcwVPwfDKLG/lNPy8zIfp8esVxAjXLWrx5LUHZBKguphWWgmx6RzP2LwFr6H4GZ7pxDO3xr7AF0RRL3Ug== +"@bitgo/public-types@5.34.0": + version "5.34.0" + resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-5.34.0.tgz#ffd7b8ac438ca70901ce904583c9a504dc5c5b4b" + integrity sha512-HnCf9Mpoy3BoIDsaZvRQACBYbmLyt3tyWFIuR10T1Q3/LZnUeJYuYLIdprVp8vRAztqKwr9NRn3/V4Gg3gLccw== dependencies: fp-ts "^2.0.0" io-ts "npm:@bitgo-forks/io-ts@2.1.4"