@@ -31,10 +31,9 @@ import {
3131 TokenOutputInstruction ,
3232 TxTemplateInstruction ,
3333 UtxoSelectInstruction ,
34- FeeInstruction ,
3534 getVariable ,
3635} from './instructions' ;
37- import { TokenBalance , TxTemplateContext } from './context' ;
36+ import { TxTemplateContext } from './context' ;
3837import { ITxTemplateInterpreter , IGetUtxosOptions } from './types' ;
3938import Input from '../../models/input' ;
4039import Output from '../../models/output' ;
@@ -149,7 +148,7 @@ export async function execRawInputInstruction(
149148 // Find the original transaction from the input
150149 const origTx = await interpreter . getTx ( txId ) ;
151150 // Add balance to the ctx.balance
152- await ctx . balance . addBalanceFromUtxo ( interpreter , origTx , index ) ;
151+ await ctx . balance . addBalanceFromUtxo ( origTx , index ) ;
153152
154153 const input = new Input ( txId , index ) ;
155154 ctx . addInputs ( position , input ) ;
@@ -285,11 +284,11 @@ export async function execRawOutputInstruction(
285284 tokenData = ctx . addToken ( token ) ;
286285 if ( authority ) {
287286 ctx . log ( `Creating authority output` ) ;
288- await ctx . balance . addOutputAuthority ( _interpreter , 1 , token , authority ) ;
287+ await ctx . balance . addOutputAuthority ( 1 , token , authority ) ;
289288 } else {
290289 ctx . log ( `Creating token output` ) ;
291290 if ( amount ) {
292- await ctx . balance . addOutput ( _interpreter , amount , token ) ;
291+ await ctx . balance . addOutput ( amount , token ) ;
293292 }
294293 }
295294 }
@@ -345,7 +344,7 @@ export async function execDataOutputInstruction(
345344 ctx . log ( `Using token(${ token } )` ) ;
346345 // Add token to tokens array
347346 tokenData = ctx . addToken ( token ) ;
348- await ctx . balance . addOutput ( _interpreter , 1n , token ) ;
347+ await ctx . balance . addOutput ( 1n , token ) ;
349348 }
350349
351350 const dataScript = new ScriptData ( data ) ;
@@ -391,7 +390,7 @@ export async function execTokenOutputInstruction(
391390 ctx . log ( `Using token(${ token } )` ) ;
392391 // Add token to tokens array
393392 tokenData = ctx . addToken ( token ) ;
394- await ctx . balance . addOutput ( interpreter , amount , token ) ;
393+ await ctx . balance . addOutput ( amount , token ) ;
395394 }
396395
397396 const script = createOutputScriptFromAddress ( address , interpreter . getNetwork ( ) ) ;
@@ -450,7 +449,7 @@ export async function execAuthorityOutputInstruction(
450449 // Add token to tokens array
451450 tokenData = ctx . addToken ( token ) ;
452451 // Add balance to the ctx.balance
453- await ctx . balance . addOutputAuthority ( interpreter , count , token , authority ) ;
452+ await ctx . balance . addOutputAuthority ( count , token , authority ) ;
454453 }
455454
456455 let amount : OutputValueType | undefined = 0n ;
@@ -670,7 +669,7 @@ export async function execCompleteTxInstruction(
670669 ctx . log ( `Creating ${ count } mint outputs / ${ tokenUid } ` ) ;
671670 // Need to create a token output
672671 // Add balance to the ctx.balance
673- await ctx . balance . addOutputAuthority ( interpreter , count , tokenUid , 'mint' ) ;
672+ await ctx . balance . addOutputAuthority ( count , tokenUid , 'mint' ) ;
674673
675674 // Creates an output with the value of the outstanding balance
676675 const output = new Output ( TOKEN_MINT_MASK , changeScript , {
@@ -697,7 +696,7 @@ export async function execCompleteTxInstruction(
697696 // First, update balance
698697 for ( const input of inputs ) {
699698 const origTx = await interpreter . getTx ( input . hash ) ;
700- await ctx . balance . addBalanceFromUtxo ( interpreter , origTx , input . index ) ;
699+ await ctx . balance . addBalanceFromUtxo ( origTx , input . index ) ;
701700 }
702701
703702 // Then add inputs to context
@@ -709,7 +708,7 @@ export async function execCompleteTxInstruction(
709708 ctx . log ( `Creating ${ count } melt outputs / ${ tokenUid } ` ) ;
710709 // Need to create a token output
711710 // Add balance to the ctx.balance
712- await ctx . balance . addOutputAuthority ( interpreter , count , tokenUid , 'melt' ) ;
711+ await ctx . balance . addOutputAuthority ( count , tokenUid , 'melt' ) ;
713712
714713 // Creates an output with the value of the outstanding balance
715714 const output = new Output ( TOKEN_MELT_MASK , changeScript , {
@@ -736,7 +735,7 @@ export async function execCompleteTxInstruction(
736735 // First, update balance
737736 for ( const input of inputs ) {
738737 const origTx = await interpreter . getTx ( input . hash ) ;
739- await ctx . balance . addBalanceFromUtxo ( interpreter , origTx , input . index ) ;
738+ await ctx . balance . addBalanceFromUtxo ( origTx , input . index ) ;
740739 }
741740
742741 // Then add inputs to context
0 commit comments