@aurigami/sdk 1.6.9 → 1.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,3 +96,7 @@ export declare type AccountAuTokenInfo = {
96
96
  deposit: number;
97
97
  borrow: number;
98
98
  };
99
+ export declare type AccountAuTokensInfo = {
100
+ address: string;
101
+ tokens: AccountAuTokenInfo[];
102
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.9",
2
+ "version": "1.6.10",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
package/src/SDK.ts CHANGED
@@ -80,14 +80,14 @@ export class SdkRead extends BlockchainEntityRead {
80
80
  return this._misc.getPlyCirculatingSupply();
81
81
  }
82
82
 
83
- public async getUltilizations(userAddr: types.Address): Promise<BigNumber> {
84
- return this._misc.getUltilizations(userAddr);
83
+ public async getUtilisation(userAddr: types.Address): Promise<BigNumber> {
84
+ return this._misc.getUtilisation(userAddr);
85
85
  }
86
86
 
87
87
  public async sneakAccounts(
88
88
  accounts: string[],
89
89
  tokenAddresses: string[]
90
- ): Promise<types.AccountAuTokenInfo[][]> {
90
+ ): Promise<types.AccountAuTokensInfo[]> {
91
91
  return this._misc.sneakAccounts(accounts, tokenAddresses);
92
92
  }
93
93
  }
@@ -283,7 +283,7 @@ export class MiscRead extends BlockchainEntityRead {
283
283
  return new TokenAmount(PLYToken, circulatingSupply.toString());
284
284
  }
285
285
 
286
- public async getUltilizations(userAddr: types.Address): Promise<BigNumber> {
286
+ public async getUtilisation(userAddr: types.Address): Promise<BigNumber> {
287
287
  let accountDetail = await this.env.auriInternalLens.getAccountLiquidity(userAddr);
288
288
  let sumBorrow = new BigNumber(accountDetail.sumBorrowPlusEffects.toString());
289
289
  let sumCol = new BigNumber(accountDetail.sumCollateral.toString());
@@ -293,7 +293,7 @@ export class MiscRead extends BlockchainEntityRead {
293
293
  public async sneakAccounts(
294
294
  accounts: string[],
295
295
  tokenAddresses: string[]
296
- ): Promise<types.AccountAuTokenInfo[][]> {
296
+ ): Promise<types.AccountAuTokensInfo[]> {
297
297
  const _1E18 = BN.from(10).pow(18);
298
298
  const _1E9 = BN.from(10).pow(9);
299
299
  const oracle = this.env.getContract<PriceOracle>(
@@ -306,7 +306,7 @@ export class MiscRead extends BlockchainEntityRead {
306
306
  const prices = await oracle.getUnderlyingPrices(tokenAddresses);
307
307
  const exrate = await this.env.auriInternalLens.callStatic.getExchangeRates(tokenAddresses);
308
308
 
309
- const res: types.AccountAuTokenInfo[][] = [];
309
+ const res: types.AccountAuTokensInfo[] = [];
310
310
 
311
311
  for (let addr of accounts) {
312
312
  const infos: types.AccountAuTokenInfo[] = [];
@@ -326,7 +326,10 @@ export class MiscRead extends BlockchainEntityRead {
326
326
  borrow: borR,
327
327
  });
328
328
  }
329
- res.push(infos);
329
+ res.push({
330
+ address: addr,
331
+ tokens: infos,
332
+ });
330
333
  }
331
334
  return res;
332
335
  }
@@ -110,3 +110,8 @@ export type AccountAuTokenInfo = {
110
110
  deposit: number;
111
111
  borrow: number;
112
112
  };
113
+
114
+ export type AccountAuTokensInfo = {
115
+ address: string;
116
+ tokens: AccountAuTokenInfo[];
117
+ };