@aurigami/sdk 0.5.4 → 0.5.5
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/dist/sdk.cjs.development.js +6 -176
- 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 +6 -176
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/SDK.ts +3 -3
- package/src/index.ts +5 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.5.
|
|
2
|
+
"version": "0.5.5",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"typescript": "^4.5.4"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@aurigami/contracts": "^
|
|
60
|
+
"@aurigami/contracts": "^2.0.0",
|
|
61
61
|
"axios": "^0.24.0",
|
|
62
62
|
"bignumber.js": "^9.0.2",
|
|
63
63
|
"dotenv": "^16.0.0",
|
package/src/SDK.ts
CHANGED
|
@@ -24,7 +24,7 @@ import AuriLensABI from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/Au
|
|
|
24
24
|
import ComptrollerABI from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
|
|
25
25
|
import TokenLockABI from "@aurigami/contracts/artifacts/contracts/TokenLock.sol/TokenLock.json";
|
|
26
26
|
import AuriFairLaunchABI from "@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json";
|
|
27
|
-
import FaucetABI from "
|
|
27
|
+
import FaucetABI from "@aurigami/contracts/artifacts/contracts/mock/Faucet.sol/Faucet.json";
|
|
28
28
|
|
|
29
29
|
export class SdkRead extends BlockchainEntityRead {
|
|
30
30
|
|
|
@@ -98,7 +98,7 @@ export class SdkRead extends BlockchainEntityRead {
|
|
|
98
98
|
}, new BigNumber(0))
|
|
99
99
|
|
|
100
100
|
promises = [];
|
|
101
|
-
var accountLiquidity: [BN, BN
|
|
101
|
+
var accountLiquidity: [BN, BN], rewardBalancesMetadata, lockedAmount: BN;
|
|
102
102
|
promises.push(this._comptroller.getAccountLiquidity(userAddress));
|
|
103
103
|
promises.push(this._auriLens.callStatic.getRewardBalancesMetadata(this._comptroller.address, this._auriFairLaunch.address, userAddress, [AurPlyPid]).catch((err: any) => {
|
|
104
104
|
return {
|
|
@@ -108,7 +108,7 @@ export class SdkRead extends BlockchainEntityRead {
|
|
|
108
108
|
promises.push(this._tokenLock.lockedAmounts(userAddress));
|
|
109
109
|
var values = await Promise.all(promises);
|
|
110
110
|
accountLiquidity = values[0]; rewardBalancesMetadata = values[1]; lockedAmount = values[2];
|
|
111
|
-
var borrowedvaluation: BigNumber = totalBorrowLimit.minus(new BigNumber(accountLiquidity[
|
|
111
|
+
var borrowedvaluation: BigNumber = totalBorrowLimit.minus(new BigNumber(accountLiquidity[0].toString()).div(decimalFactor(18)));
|
|
112
112
|
|
|
113
113
|
if (borrowedvaluation.lt("0.00001")) { // Igore dust, dust could be the result of network delay causing collateral valuation calc to be different on vs off chain
|
|
114
114
|
borrowedvaluation = new BigNumber(0);
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
import { Logger } from 'ethers/lib/utils';
|
|
3
|
+
|
|
4
|
+
ethers.utils.Logger.setLogLevel(Logger.levels.ERROR);
|
|
2
5
|
|
|
6
|
+
export * from './SDK';
|
|
3
7
|
export * from './MoneyMarket';
|
|
4
8
|
export * from './BlockchainEntity';
|
|
5
9
|
export * from './helpers';
|