Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/abstract-lightning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions modules/abstract-utxo/src/abstractUtxoCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
isValidXprv,
DeriveAddressOptions,
DeriveAddressResult,
UnifiedRecipientPreference,
} from '@bitgo/sdk-core';

import {
Expand Down Expand Up @@ -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<TNumber extends number | bigint = number> extends BaseParseTransactionOptions {
Expand Down
3 changes: 2 additions & 1 deletion modules/abstract-utxo/src/impl/zec/recipients.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 0 additions & 3 deletions modules/abstract-utxo/src/impl/zec/types.ts
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion modules/bitgo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion modules/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion modules/passkey-crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion modules/sdk-coin-flrp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion modules/sdk-coin-sol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion modules/sdk-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 8 additions & 1 deletion modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions modules/sdk-core/src/bitgo/wallet/BuildParams.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -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({
Expand Down
5 changes: 5 additions & 0 deletions modules/sdk-core/src/bitgo/wallet/iWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
VerificationOptions,
TypedData,
NFTTransferOptions,
UnifiedRecipientPreference,
} from '../baseCoin';
import { BitGoBase } from '../bitgoBase';
import { Keychain, KeychainWithEncryptedPrv } from '../keychain';
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading