improve logging
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
5c34b60105
commit
cfdd59379e
|
@ -353,7 +353,11 @@ export class MangoAccount {
|
|||
? res +
|
||||
'\n tokens:' +
|
||||
JSON.stringify(
|
||||
this.tokensActive().map((token) => token.toString(group)),
|
||||
this.tokens.map((token, i) =>
|
||||
token.isActive()
|
||||
? token.toString(group, i)
|
||||
: `index: ${i} - empty slot`,
|
||||
),
|
||||
null,
|
||||
4,
|
||||
)
|
||||
|
@ -419,7 +423,7 @@ export class TokenPosition {
|
|||
).toNumber();
|
||||
}
|
||||
|
||||
public toString(group?: Group): string {
|
||||
public toString(group?: Group, index?: number): string {
|
||||
let extra = '';
|
||||
if (group) {
|
||||
const bank = group.findBank(this.tokenIndex);
|
||||
|
@ -432,7 +436,8 @@ export class TokenPosition {
|
|||
}
|
||||
|
||||
return (
|
||||
'tokenIndex: ' +
|
||||
(index !== undefined ? 'index: ' + index : '') +
|
||||
', tokenIndex: ' +
|
||||
this.tokenIndex +
|
||||
', inUseCount: ' +
|
||||
this.inUseCount +
|
||||
|
|
|
@ -9,7 +9,16 @@ import { toUiDecimals } from '../utils';
|
|||
async function debugUser(client, group, mangoAccount) {
|
||||
console.log(mangoAccount.toString(group));
|
||||
await mangoAccount.reload(client, group);
|
||||
|
||||
console.log(
|
||||
'buildFixedAccountRetrieverHealthAccounts ' +
|
||||
client
|
||||
.buildFixedAccountRetrieverHealthAccounts(group, mangoAccount, [
|
||||
group.banksMap.get('BTC'),
|
||||
group.banksMap.get('USDC'),
|
||||
])
|
||||
.map((pk) => pk.toBase58())
|
||||
.join(', '),
|
||||
);
|
||||
console.log(
|
||||
'mangoAccount.getEquity() ' +
|
||||
toUiDecimals(mangoAccount.getEquity().toNumber()),
|
||||
|
|
Loading…
Reference in New Issue