99 TRANSACTION_ID_HEX_LENGTH ,
1010 PRIVATE_KEY_HEX_LENGTH ,
1111 SECP256K1_SIGNATURE_LENGTH ,
12- TRANSACTION_ID_PREFIX ,
1312 HEX_PREFIX ,
1413 HEX_PREFIX_LENGTH ,
1514 DECIMAL_RADIX ,
@@ -23,13 +22,10 @@ import {
2322 ERROR_SIGNATURES_ARRAY ,
2423 ERROR_SIGNATURES_EMPTY ,
2524 ERROR_INVALID_PRIVATE_KEY ,
26- ERROR_UTXOS_REQUIRED_BUILD ,
27- ERROR_ENHANCED_BUILD_FAILED ,
2825 ERROR_ENHANCED_PARSE_FAILED ,
2926 ERROR_FLAREJS_SIGNING_FAILED ,
3027 ERROR_CREATE_CREDENTIAL_FAILED ,
3128 ERROR_UNKNOWN ,
32- FLARE_ATOMIC_PREFIX ,
3329 FLARE_ATOMIC_PARSED_PREFIX ,
3430 HEX_ENCODING ,
3531} from './constants' ;
@@ -328,62 +324,62 @@ export abstract class AtomicTransactionBuilder extends TransactionBuilder {
328324 /**
329325 * Build the transaction using FlareJS compatibility
330326 */
331- async build ( ) : Promise < BaseTransaction > {
332- // FlareJS UnsignedTx creation with atomic transaction support
333- try {
334- // Validate transaction requirements
335- if ( ! this . _utxos || this . _utxos . length === 0 ) {
336- throw new BuildTransactionError ( ERROR_UTXOS_REQUIRED_BUILD ) ;
337- }
338-
339- // Create FlareJS transaction structure with atomic support
340- const transaction = {
341- _id : `${ TRANSACTION_ID_PREFIX } ${ Date . now ( ) } ` ,
342- _inputs : [ ] ,
343- _outputs : [ ] ,
344- _type : this . transactionType ,
345- signature : [ ] as string [ ] ,
346-
347- fromAddresses : this . _fromAddresses ,
348- validationErrors : [ ] ,
349-
350- // FlareJS methods with atomic support
351- toBroadcastFormat : ( ) => `${ TRANSACTION_ID_PREFIX } ${ Date . now ( ) } ` ,
352- toJson : ( ) => ( {
353- type : this . transactionType ,
354- } ) ,
355-
356- explainTransaction : ( ) : TransactionExplanation => ( {
357- type : this . transactionType ,
358- inputs : [ ] ,
359- outputs : [ ] ,
360- outputAmount : AMOUNT_STRING_ZERO ,
361- rewardAddresses : [ ] ,
362- id : `${ FLARE_ATOMIC_PREFIX } ${ Date . now ( ) } ` ,
363- changeOutputs : [ ] ,
364- changeAmount : AMOUNT_STRING_ZERO ,
365- fee : { fee : this . _fee . fee } ,
366- } ) ,
367-
368- isTransactionForCChain : false ,
369- loadInputsAndOutputs : ( ) => {
370- /* FlareJS atomic transaction loading */
371- } ,
372- inputs : ( ) => [ ] ,
373- outputs : ( ) => [ ] ,
374- fee : ( ) => ( { fee : this . _fee . fee } ) ,
375- feeRate : ( ) => 0 ,
376- id : ( ) => `${ FLARE_ATOMIC_PREFIX } ${ Date . now ( ) } ` ,
377- type : this . transactionType ,
378- } as unknown as BaseTransaction ;
379-
380- return transaction ;
381- } catch ( error ) {
382- throw new BuildTransactionError (
383- `${ ERROR_ENHANCED_BUILD_FAILED } : ${ error instanceof Error ? error . message : ERROR_UNKNOWN } `
384- ) ;
385- }
386- }
327+ // async build(): Promise<BaseTransaction> {
328+ // // FlareJS UnsignedTx creation with atomic transaction support
329+ // try {
330+ // // Validate transaction requirements
331+ // if (!this._utxos || this._utxos.length === 0) {
332+ // throw new BuildTransactionError(ERROR_UTXOS_REQUIRED_BUILD);
333+ // }
334+
335+ // // Create FlareJS transaction structure with atomic support
336+ // const transaction = {
337+ // _id: `${TRANSACTION_ID_PREFIX}${Date.now()}`,
338+ // _inputs: [],
339+ // _outputs: [],
340+ // _type: this.transactionType,
341+ // signature: [] as string[],
342+
343+ // fromAddresses: this._fromAddresses,
344+ // validationErrors: [],
345+
346+ // // FlareJS methods with atomic support
347+ // toBroadcastFormat: () => `${TRANSACTION_ID_PREFIX}${Date.now()}`,
348+ // toJson: () => ({
349+ // type: this.transactionType,
350+ // }),
351+
352+ // explainTransaction: (): TransactionExplanation => ({
353+ // type: this.transactionType,
354+ // inputs: [],
355+ // outputs: [],
356+ // outputAmount: AMOUNT_STRING_ZERO,
357+ // rewardAddresses: [],
358+ // id: `${FLARE_ATOMIC_PREFIX}${Date.now()}`,
359+ // changeOutputs: [],
360+ // changeAmount: AMOUNT_STRING_ZERO,
361+ // fee: { fee: this._fee.fee },
362+ // }),
363+
364+ // isTransactionForCChain: false,
365+ // loadInputsAndOutputs: () => {
366+ // /* FlareJS atomic transaction loading */
367+ // },
368+ // inputs: () => [],
369+ // outputs: () => [],
370+ // fee: () => ({ fee: this._fee.fee }),
371+ // feeRate: () => 0,
372+ // id: () => `${FLARE_ATOMIC_PREFIX}${Date.now()}`,
373+ // type: this.transactionType,
374+ // } as unknown as BaseTransaction;
375+
376+ // return transaction;
377+ // } catch (error) {
378+ // throw new BuildTransactionError(
379+ // `${ERROR_ENHANCED_BUILD_FAILED}: ${error instanceof Error ? error.message : ERROR_UNKNOWN}`
380+ // );
381+ // }
382+ // }
387383
388384 /**
389385 * Parse and explain a transaction from hex using FlareJS compatibility
@@ -472,4 +468,8 @@ export abstract class AtomicTransactionBuilder extends TransactionBuilder {
472468 validateTransaction ( transaction ?: Transaction ) : void {
473469 // throw new NotImplementedError('validateTransaction not implemented');
474470 }
471+
472+ // setTransaction(tx: any): void {
473+ // this._flrpTransaction = tx;
474+ // }
475475}
0 commit comments