@aurigami/sdk 1.15.1 → 1.15.2

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.
@@ -168,3 +168,12 @@ export declare type Apy = {
168
168
  suppliedValue: BigNumber;
169
169
  borrowedValue: BigNumber;
170
170
  };
171
+ export declare type UserNotification = {
172
+ message: string;
173
+ userSetting: {
174
+ address: Address;
175
+ mail: string;
176
+ utilisation: number;
177
+ liquidation: boolean;
178
+ };
179
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.15.1",
2
+ "version": "1.15.2",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
package/src/SDK.ts CHANGED
@@ -136,6 +136,16 @@ export class SdkRead extends BlockchainEntityRead {
136
136
  const response = await NotificationApi.postApi('alert-setting/set', body);
137
137
  return response;
138
138
  }
139
+
140
+ public async getUserNotificationSettings(
141
+ addresses: types.Address[]
142
+ ): Promise<types.UserNotification> {
143
+ const body = {
144
+ addresses,
145
+ };
146
+ const response = await NotificationApi.postApi('alert-setting/get-user-setting', body);
147
+ return response;
148
+ }
139
149
  }
140
150
 
141
151
  export class SdkReadWrite extends SdkRead {
@@ -113,12 +113,12 @@ export class MiscRead extends BlockchainEntityRead {
113
113
  .div(userMarketDetails[i].underlyingPrice);
114
114
  userMarketDetails[i].maxWithdrawableAmount =
115
115
  userMarketDetails[i].isCollateral &&
116
- maxWithdrawCap.lt(userMarketDetails[i].depositBalance.formattedAmount())
116
+ maxWithdrawCap.lt(userMarketDetails[i].depositBalance.formattedAmount())
117
117
  ? new TokenAmount(moneyMarket.underlying, maxWithdrawCap.toFixed(24), false)
118
118
  : new TokenAmount(
119
- moneyMarket.underlying,
120
- userMarketDetails[i].depositBalance.rawAmount()
121
- );
119
+ moneyMarket.underlying,
120
+ userMarketDetails[i].depositBalance.rawAmount()
121
+ );
122
122
  }
123
123
 
124
124
  return {
@@ -258,7 +258,8 @@ export class MiscRead extends BlockchainEntityRead {
258
258
  }
259
259
 
260
260
  public async getUtilisation(userAddr: types.Address): Promise<BigNumber> {
261
- let accountDetail = await this.env.auriInternalLens.callStatic.getAccountLiquidityAccrueInterest(userAddr);
261
+ let accountDetail =
262
+ await this.env.auriInternalLens.callStatic.getAccountLiquidityAccrueInterest(userAddr);
262
263
  let sumBorrow = new BigNumber(accountDetail.sumBorrowPlusEffects.toString());
263
264
  let sumCol = new BigNumber(accountDetail.sumCollateral.toString());
264
265
  return sumBorrow.dividedBy(sumCol);
@@ -189,3 +189,13 @@ export type Apy = {
189
189
  suppliedValue: BigNumber;
190
190
  borrowedValue: BigNumber;
191
191
  };
192
+
193
+ export type UserNotification = {
194
+ message: string;
195
+ userSetting: {
196
+ address: Address;
197
+ mail: string;
198
+ utilisation: number;
199
+ liquidation: boolean;
200
+ };
201
+ };