1- import * as NetworkManager from " ../../../e2e/src/helper/NetworkManager" ;
2- import { privateKeyToAccount } from " viem/accounts" ;
3- import { createPublicClient , formatEther , http } from " viem" ;
4- import { createLitClient } from " @lit-protocol/lit-client" ;
5- import * as StateManager from " ./StateManager" ;
6- import { printAligned } from " ../../../e2e/src/helper/utils" ;
1+ import * as NetworkManager from ' ../../../e2e/src/helper/NetworkManager' ;
2+ import { privateKeyToAccount } from ' viem/accounts' ;
3+ import { createPublicClient , formatEther , http } from ' viem' ;
4+ import { createLitClient } from ' @lit-protocol/lit-client' ;
5+ import * as StateManager from ' ./StateManager' ;
6+ import { printAligned } from ' ../../../e2e/src/helper/utils' ;
77
88export const getMasterAccount = async ( ) => {
99 const privateKey = process . env [ 'LIVE_MASTER_ACCOUNT' ] ;
@@ -13,13 +13,13 @@ export const getMasterAccount = async () => {
1313 }
1414
1515 return privateKeyToAccount ( privateKey as `0x${string } `) ;
16- }
16+ } ;
1717
1818export const getAccountDetails = async ( {
1919 account,
2020 publicClient,
2121 litClient,
22- accountLabel = " Account" ,
22+ accountLabel = ' Account' ,
2323} : {
2424 account : any ;
2525 publicClient : any ;
@@ -29,40 +29,44 @@ export const getAccountDetails = async ({
2929 console . log ( `\n========== ${ accountLabel } Details ==========` ) ;
3030
3131 // Get all the data first
32- const ethBalance = formatEther ( await publicClient . getBalance ( {
33- address : account . address ,
34- } ) ) ;
32+ const ethBalance = formatEther (
33+ await publicClient . getBalance ( {
34+ address : account . address ,
35+ } )
36+ ) ;
3537
3638 const paymentManager = await litClient . getPaymentManager ( {
3739 account : account ,
3840 } ) ;
3941
4042 const paymentBalance = await paymentManager . getBalance ( {
41- userAddress : account . address
43+ userAddress : account . address ,
4244 } ) ;
4345
4446 // Determine status
45- let statusLabel = "" ;
46- let statusValue = "" ;
47+ let statusLabel = '' ;
48+ let statusValue = '' ;
4749
4850 if ( Number ( paymentBalance . availableBalance ) < 0 ) {
49- statusLabel = " 🚨 Status:" ;
51+ statusLabel = ' 🚨 Status:' ;
5052 statusValue = `Negative balance (debt): ${ paymentBalance . availableBalance } ` ;
5153 }
5254
5355 // Print all information with consistent alignment
5456 printAligned ( [
55- { label : "🔑 Address:" , value : account . address } ,
56- { label : "💰 ETH Balance:" , value : `${ ethBalance } ETH` } ,
57- { label : "💳 Ledger Total Balance:" , value : paymentBalance . totalBalance } ,
58- { label : "💳 Ledger Available Balance:" , value : paymentBalance . availableBalance } ,
57+ { label : '🔑 Address:' , value : account . address } ,
58+ { label : '💰 ETH Balance:' , value : `${ ethBalance } ETH` } ,
59+ { label : '💳 Ledger Total Balance:' , value : paymentBalance . totalBalance } ,
60+ {
61+ label : '💳 Ledger Available Balance:' ,
62+ value : paymentBalance . availableBalance ,
63+ } ,
5964 { label : statusLabel , value : statusValue } ,
6065 ] ) ;
6166
6267 return {
6368 ethBalance,
6469 ledgerBalance : paymentBalance . availableBalance ,
6570 paymentManager,
66- }
67- }
68-
71+ } ;
72+ } ;
0 commit comments