@@ -74,8 +74,8 @@ import {
7474import { assertDescriptorWalletAddress , getDescriptorMapFromWallet , isDescriptorWallet } from './descriptor' ;
7575import { getChainFromNetwork , getFamilyFromNetwork , getFullNameFromNetwork } from './names' ;
7676import { assertFixedScriptWalletAddress } from './address/fixedScript' ;
77- import { CustomChangeOptions } from './transaction/fixedScript ' ;
78- import { toBip32Triple , UtxoKeychain , UtxoNamedKeychains } from './keychains' ;
77+ import { ParsedTransaction } from './transaction/types ' ;
78+ import { toBip32Triple , UtxoKeychain } from './keychains' ;
7979import { verifyKeySignature , verifyUserPublicKey } from './verifyKey' ;
8080import { getPolicyForEnv } from './descriptor/validatePolicy' ;
8181import { signTransaction } from './transaction/signTransaction' ;
@@ -186,33 +186,11 @@ export interface VerifyAddressOptions<TCoinSpecific extends UtxoCoinSpecific> ex
186186 coinSpecific ?: TCoinSpecific ;
187187}
188188
189- export interface BaseOutput < TAmount = string | number > {
190- address : string ;
191- amount : TAmount ;
192- // Even though this external flag is redundant with the chain property, it is necessary for backwards compatibility
193- // with legacy transaction format.
194- external ?: boolean ;
195- }
196-
197- export interface FixedScriptWalletOutput < TAmount = string | number > extends BaseOutput < TAmount > {
198- needsCustomChangeKeySignatureVerification ?: boolean ;
199- chain : number ;
200- index : number ;
201- }
202-
203- export type Output < TAmount = string | number > = BaseOutput < TAmount > | FixedScriptWalletOutput < TAmount > ;
204-
205189export type Bip322Message = {
206190 address : string ;
207191 message : string ;
208192} ;
209193
210- export function isWalletOutput ( output : Output ) : output is FixedScriptWalletOutput {
211- return (
212- ( output as FixedScriptWalletOutput ) . chain !== undefined && ( output as FixedScriptWalletOutput ) . index !== undefined
213- ) ;
214- }
215-
216194export interface TransactionInfo < TNumber extends number | bigint = number > {
217195 /** Maps txid to txhex. Required for offline signing. */
218196 txHexes ?: Record < string , string > ;
@@ -255,42 +233,6 @@ export interface ParseTransactionOptions<TNumber extends number | bigint = numbe
255233 reqId ?: IRequestTracer ;
256234}
257235
258- export type BaseParsedTransactionOutputs < TNumber extends number | bigint , TOutput > = {
259- /** all transaction outputs */
260- outputs : TOutput [ ] ;
261- /** transaction outputs that were specified as recipients but are missing from the transaction */
262- missingOutputs : TOutput [ ] ;
263- /** transaction outputs that were specified as recipients and are present in the transaction */
264- explicitExternalOutputs : TOutput [ ] ;
265- /** transaction outputs that were not specified as recipients but are present in the transaction */
266- implicitExternalOutputs : TOutput [ ] ;
267- /** transaction outputs that are change outputs */
268- changeOutputs : TOutput [ ] ;
269- /** sum of all explicit external outputs */
270- explicitExternalSpendAmount : TNumber ;
271- /** sum of all implicit external outputs */
272- implicitExternalSpendAmount : TNumber ;
273- } ;
274-
275- export type BaseParsedTransaction < TNumber extends number | bigint , TOutput > = BaseParsedTransactionOutputs <
276- TNumber ,
277- TOutput
278- > /** Some extra properties that have nothing to do with an individual transaction */ & {
279- keychains : UtxoNamedKeychains ;
280- keySignatures : {
281- backupPub ?: string ;
282- bitgoPub ?: string ;
283- } ;
284- needsCustomChangeKeySignatureVerification : boolean ;
285- customChange ?: CustomChangeOptions ;
286- } ;
287-
288- /**
289- * This type is a bit silly because it allows the type for the aggregate amounts to be different from the type of
290- * individual amounts.
291- */
292- export type ParsedTransaction < TNumber extends number | bigint = number > = BaseParsedTransaction < TNumber , Output > ;
293-
294236export interface GenerateAddressOptions {
295237 addressType ?: ScriptType2Of3 ;
296238 threshold ?: number ;
0 commit comments