diff --git a/modules/abstract-lightning/package.json b/modules/abstract-lightning/package.json index 59508ef9c8..39cfb76435 100644 --- a/modules/abstract-lightning/package.json +++ b/modules/abstract-lightning/package.json @@ -39,7 +39,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "6.66.0", + "@bitgo/public-types": "6.70.1", "@bitgo/sdk-core": "^38.15.0", "@bitgo/statics": "^59.15.0", "@bitgo/utxo-lib": "^11.24.4", diff --git a/modules/abstract-utxo/src/abstractUtxoCoin.ts b/modules/abstract-utxo/src/abstractUtxoCoin.ts index efd345ce1e..0b78eaf4c3 100644 --- a/modules/abstract-utxo/src/abstractUtxoCoin.ts +++ b/modules/abstract-utxo/src/abstractUtxoCoin.ts @@ -45,6 +45,7 @@ import { isValidXprv, DeriveAddressOptions, DeriveAddressResult, + UnifiedRecipientPreference, } from '@bitgo/sdk-core'; import { @@ -248,6 +249,8 @@ export interface TransactionParams extends BaseTransactionParams { /** Parameters for bridging intents (e.g. BTC -> sBTC peg-in), present when `type === 'bridging'`. */ bridgingParams?: BridgingParams; qr?: boolean; + /** Zcash-only preference for resolving Unified Address recipients. */ + unifiedRecipientPreference?: UnifiedRecipientPreference; } export interface ParseTransactionOptions extends BaseParseTransactionOptions { diff --git a/modules/abstract-utxo/src/impl/zec/recipients.ts b/modules/abstract-utxo/src/impl/zec/recipients.ts index d56a4f88c9..bbb3b470cd 100644 --- a/modules/abstract-utxo/src/impl/zec/recipients.ts +++ b/modules/abstract-utxo/src/impl/zec/recipients.ts @@ -1,8 +1,9 @@ import { fixedScriptWallet, zcashAddress } from '@bitgo/wasm-utxo'; +import type { UnifiedRecipientPreference } from '@bitgo/sdk-core'; import { getReplayProtectionPubkeys } from '../../transaction/fixedScript/replayProtection'; -import { ZcashCoinName, UnifiedRecipientPreference } from './types'; +import { ZcashCoinName } from './types'; /** * How a recipient parsed from a Zcash PSBT is spent. diff --git a/modules/abstract-utxo/src/impl/zec/types.ts b/modules/abstract-utxo/src/impl/zec/types.ts index 30ea4b3aba..ffb5747a9b 100644 --- a/modules/abstract-utxo/src/impl/zec/types.ts +++ b/modules/abstract-utxo/src/impl/zec/types.ts @@ -1,5 +1,2 @@ /** A Zcash coin name — the only UTXO coins with shielded (Orchard/Ironwood) support. */ export type ZcashCoinName = 'zec' | 'tzec'; - -/** How a Zcash Unified Address recipient should be resolved: to its shielded (Orchard/Ironwood) receiver or its transparent receiver. */ -export type UnifiedRecipientPreference = 'shielded' | 'transparent'; diff --git a/modules/bitgo/package.json b/modules/bitgo/package.json index 849dd5b49a..74f24c6c43 100644 --- a/modules/bitgo/package.json +++ b/modules/bitgo/package.json @@ -144,7 +144,7 @@ "superagent": "^9.0.1" }, "devDependencies": { - "@bitgo/public-types": "6.66.0", + "@bitgo/public-types": "6.70.1", "@bitgo/sdk-opensslbytes": "^2.1.0", "@bitgo/sdk-test": "^9.1.76", "@openpgp/web-stream-tools": "0.0.14", diff --git a/modules/express/package.json b/modules/express/package.json index d902a50540..3eb596b322 100644 --- a/modules/express/package.json +++ b/modules/express/package.json @@ -60,7 +60,7 @@ "superagent": "^9.0.1" }, "devDependencies": { - "@bitgo/public-types": "6.66.0", + "@bitgo/public-types": "6.70.1", "@bitgo/sdk-lib-mpc": "^10.20.0", "@bitgo/sdk-test": "^9.1.76", "@types/argparse": "^1.0.36", diff --git a/modules/passkey-crypto/package.json b/modules/passkey-crypto/package.json index c6db98548d..08ebba4ec9 100644 --- a/modules/passkey-crypto/package.json +++ b/modules/passkey-crypto/package.json @@ -35,7 +35,7 @@ "access": "public" }, "dependencies": { - "@bitgo/public-types": "6.66.0", + "@bitgo/public-types": "6.70.1", "@bitgo/sdk-core": "^38.15.0" }, "devDependencies": { diff --git a/modules/sdk-coin-flrp/package.json b/modules/sdk-coin-flrp/package.json index 1805bc16a1..a8ffd0fd9f 100644 --- a/modules/sdk-coin-flrp/package.json +++ b/modules/sdk-coin-flrp/package.json @@ -48,7 +48,7 @@ "nock": "^13.3.1" }, "dependencies": { - "@bitgo/public-types": "6.66.0", + "@bitgo/public-types": "6.70.1", "@bitgo/sdk-core": "^38.15.0", "@bitgo/secp256k1": "^1.11.1", "@bitgo/statics": "^59.15.0", diff --git a/modules/sdk-coin-sol/package.json b/modules/sdk-coin-sol/package.json index c4feaf54f3..d11691c566 100644 --- a/modules/sdk-coin-sol/package.json +++ b/modules/sdk-coin-sol/package.json @@ -57,7 +57,7 @@ }, "dependencies": { "@bitgo/logger": "^1.4.0", - "@bitgo/public-types": "6.66.0", + "@bitgo/public-types": "6.70.1", "@bitgo/sdk-core": "^38.15.0", "@bitgo/sdk-lib-mpc": "^10.20.0", "@bitgo/statics": "^59.15.0", diff --git a/modules/sdk-core/package.json b/modules/sdk-core/package.json index 0c4ba50950..09abac95ce 100644 --- a/modules/sdk-core/package.json +++ b/modules/sdk-core/package.json @@ -40,7 +40,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "6.66.0", + "@bitgo/public-types": "6.70.1", "@bitgo/sdk-lib-mpc": "^10.20.0", "@bitgo/secp256k1": "^1.11.1", "@bitgo/sjcl": "^1.1.0", diff --git a/modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts b/modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts index 74be73ca27..5bd62a8eeb 100644 --- a/modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts +++ b/modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts @@ -11,7 +11,7 @@ import EddsaUtils, { EddsaMPCv2Utils, PrebuildTransactionWithIntentOptions, TxRe import { RedpallasMPCv2Utils } from '../utils/tss/redpallas'; import { CreateAddressFormat, CustomSigningFunction, IWallet, IWallets, Memo, Wallet, WalletData } from '../wallet'; -import { TokenEnablement } from '@bitgo/public-types'; +import { TokenEnablement, unifiedAddressPreference } from '@bitgo/public-types'; import { Hash } from 'crypto'; import { TransactionType } from '../../account-lib'; import { IInscriptionBuilder } from '../inscriptionBuilder'; @@ -356,8 +356,15 @@ export interface FeeEstimateOptions { type?: keyof typeof TransactionType; } +/** How a Zcash Unified Address recipient should be resolved. */ +export type UnifiedRecipientPreference = unifiedAddressPreference; + // TODO (SDKT-9): reverse engineer and add options export interface ExtraPrebuildParamsOptions { + /** + * how to resolve a Unified Address recipient (`'shielded'` or `'transparent'`). + */ + unifiedRecipientPreference?: UnifiedRecipientPreference; [index: string]: unknown; } diff --git a/modules/sdk-core/src/bitgo/wallet/BuildParams.ts b/modules/sdk-core/src/bitgo/wallet/BuildParams.ts index 1935a05d2c..2543408d7f 100644 --- a/modules/sdk-core/src/bitgo/wallet/BuildParams.ts +++ b/modules/sdk-core/src/bitgo/wallet/BuildParams.ts @@ -1,6 +1,7 @@ /* eslint no-redeclare: off */ import * as t from 'io-ts'; +import { unifiedAddressPreference } from '@bitgo/public-types'; import { getCodecProperties } from '../utils/codecProps'; export const Bip322Message = t.type({ @@ -39,6 +40,10 @@ export const BuildParamsUTXO = t.partial({ isReplaceableByFee: t.boolean, messages: t.array(Bip322Message), qr: t.boolean, + /** + * how to resolve a Unified Address recipient for zec. + */ + unifiedRecipientPreference: unifiedAddressPreference, }); export const BuildParamsStacks = t.partial({ diff --git a/modules/sdk-core/src/bitgo/wallet/iWallet.ts b/modules/sdk-core/src/bitgo/wallet/iWallet.ts index 9741ea9c10..435599da12 100644 --- a/modules/sdk-core/src/bitgo/wallet/iWallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/iWallet.ts @@ -11,6 +11,7 @@ import { VerificationOptions, TypedData, NFTTransferOptions, + UnifiedRecipientPreference, } from '../baseCoin'; import { BitGoBase } from '../bitgoBase'; import { Keychain, KeychainWithEncryptedPrv } from '../keychain'; @@ -230,6 +231,10 @@ export interface PrebuildTransactionOptions { * the legacy format defined by bitcoinjs-lib, or the 'psbt' format, which follows the BIP-174. */ txFormat?: 'legacy' | 'psbt' | 'psbt-lite'; + /** + * how to resolve a Unified Address recipient for zec. + */ + unifiedRecipientPreference?: UnifiedRecipientPreference; /** * Custom Solana instructions to include in the transaction. * Each instruction contains a program ID, accounts array, and data buffer. diff --git a/yarn.lock b/yarn.lock index 41c57b723d..b4ad55ece1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1021,10 +1021,10 @@ "@scure/base" "1.1.5" micro-eth-signer "0.7.2" -"@bitgo/public-types@6.66.0": - version "6.66.0" - resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-6.66.0.tgz#d8ea3da33c22403d9258fe1c760163d18c8d763d" - integrity sha512-7WsFUX7aIB9yTHCP18iLZThp8O1BsMrQUiwzuEgcBApqDlv/9OnGv87ytLNG2jPTyH3soYjjBWziTQJQFEaPXw== +"@bitgo/public-types@6.70.1": + version "6.70.1" + resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-6.70.1.tgz#197f2ecc93b8d8bf144c4985a412d91dc346220d" + integrity sha512-s3LRKnks3RxJYq+U5zZquNol3HqXXoK788JkszKs4HG1lTvINLqPbYHPnl+Qj0ta6mLQ8EvEKEmL2LFlJIC1pw== dependencies: fp-ts "^2.0.0" io-ts "npm:@bitgo-forks/io-ts@2.1.4"