@aurigami/sdk 1.15.0 → 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.
- package/ChangeLog.md +8 -0
- package/dist/SDK.d.ts +1 -0
- package/dist/sdk.cjs.development.js +53 -21
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +53 -21
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/index.d.ts +9 -0
- package/package.json +2 -2
- package/src/SDK.ts +10 -0
- package/src/interactors/misc.ts +2 -1
- package/src/types/index.ts +10 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -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.
|
|
2
|
+
"version": "1.15.2",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"typescript": "^4.5.4"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@aurigami/contracts": "3.
|
|
65
|
+
"@aurigami/contracts": "3.16.0",
|
|
66
66
|
"axios": "^0.26.1",
|
|
67
67
|
"bignumber.js": "^9.0.2",
|
|
68
68
|
"cache-decorator": "^0.1.6",
|
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 {
|
package/src/interactors/misc.ts
CHANGED
|
@@ -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 =
|
|
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);
|
package/src/types/index.ts
CHANGED
|
@@ -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
|
+
};
|