File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1327,15 +1327,10 @@ export class Commands {
13271327 try {
13281328 const balance = await escrow . getUserFunds ( await this . signer . getAddress ( ) , token ) ;
13291329 const decimals = await getTokenDecimals ( this . signer , token ) ;
1330-
1331- const sum = await balance . reduce ( async ( accPromise , curr ) => {
1332- const acc = await accPromise ;
1333- const amount = await unitsToAmount ( this . signer , token , curr , decimals ) ;
1334- return acc + Number ( amount ) ;
1335- } , Promise . resolve ( 0 ) ) ;
1336-
1337- console . log ( `Escrow user funds for token ${ token } : ${ sum } ` ) ;
1338- return sum ;
1330+ const available = balance . available ;
1331+ const amount = await unitsToAmount ( this . signer , token , available , decimals ) ;
1332+ console . log ( `Escrow user funds for token ${ token } : ${ amount } ` ) ;
1333+ return Number ( amount ) ;
13391334 } catch ( error ) {
13401335 console . error ( "Error getting escrow balance:" , error ) ;
13411336 }
You can’t perform that action at this time.
0 commit comments