expose underlying property

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2023-04-20 09:59:21 +02:00
parent ba333e736b
commit 793bd08ffd
1 changed files with 10 additions and 4 deletions

View File

@ -161,8 +161,7 @@ export class Bank implements BankForHealth {
obj.netBorrowsInWindow,
obj.borrowWeightScaleStartQuote,
obj.depositWeightScaleStartQuote,
obj.reduceOnly == 1,
obj.reduceOnly == 1 || obj.reduceOnly == 2,
obj.reduceOnly,
obj.forceClose == 1,
);
}
@ -210,8 +209,7 @@ export class Bank implements BankForHealth {
public netBorrowsInWindow: BN,
public borrowWeightScaleStartQuote: number,
public depositWeightScaleStartQuote: number,
public depositsReduceOnly: boolean,
public borrowsReduceOnly: boolean,
public reduceOnly: number,
public forceClose: boolean,
) {
this.name = utf8.decode(new Uint8Array(name)).split('\x00')[0];
@ -315,6 +313,14 @@ export class Bank implements BankForHealth {
);
}
areDepositsReduceOnly(): boolean {
return this.reduceOnly == 1;
}
areBorrowsReduceOnly(): boolean {
return this.reduceOnly == 1 || this.reduceOnly == 2;
}
scaledInitAssetWeight(price: I80F48): I80F48 {
const depositsQuote = this.nativeDeposits().mul(price);
if (