@aurigami/sdk 1.5.6 → 1.5.7
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.d.ts +3 -3
- package/dist/Staking.d.ts +3 -3
- package/dist/sdk.cjs.development.js +5 -12
- 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 +5 -12
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/SDK.ts +4 -5
- package/src/Staking.ts +9 -28
- package/src/types.ts +1 -1
package/dist/SDK.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { BlockchainEntity, BlockchainEntityRead } from './BlockchainEntity';
|
|
|
4
4
|
import { StakingRead } from './Staking';
|
|
5
5
|
import { Token } from './token';
|
|
6
6
|
import { TokenAmount } from './tokenAmount';
|
|
7
|
-
import { CurrencyAmount, HypotheticalStats, MarketAction, NetworkConnection, PLYWNEARPoolDetails,
|
|
7
|
+
import { CurrencyAmount, HypotheticalStats, MarketAction, NetworkConnection, PLYWNEARPoolDetails, UserDetails, UserMarketDetails } from './types';
|
|
8
8
|
export declare class SdkRead extends BlockchainEntityRead {
|
|
9
9
|
protected _comptroller: Comptroller;
|
|
10
10
|
protected _auriFairLaunch: AuriFairLaunch;
|
|
@@ -14,8 +14,8 @@ export declare class SdkRead extends BlockchainEntityRead {
|
|
|
14
14
|
getUserDetails(userAddress: string): Promise<UserDetails>;
|
|
15
15
|
getPLYWNEARPoolDetails(): Promise<PLYWNEARPoolDetails>;
|
|
16
16
|
getTokenPrice(token: Token): Promise<CurrencyAmount>;
|
|
17
|
-
stakeBalanceOf(user: string): Promise<
|
|
18
|
-
LpBalanceOf(user: string): Promise<
|
|
17
|
+
stakeBalanceOf(user: string): Promise<TokenAmount>;
|
|
18
|
+
LpBalanceOf(user: string): Promise<TokenAmount>;
|
|
19
19
|
unclaimedRewardsOf(user: string): Promise<TokenAmount[]>;
|
|
20
20
|
calcHypotheticalStats({ userMarketDetail, currentBorrowLimit, currentBorrowValuation, action, tokenAmount, }: {
|
|
21
21
|
userMarketDetail: UserMarketDetails;
|
package/dist/Staking.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { AuriFairLaunch, AuriLens, Comptroller } from '@aurigami/contracts/typec
|
|
|
2
2
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
3
3
|
import { BlockchainEntity, BlockchainEntityRead } from './BlockchainEntity';
|
|
4
4
|
import { TokenAmount } from './tokenAmount';
|
|
5
|
-
import { NetworkConnection, PLYWNEARPoolDetails
|
|
5
|
+
import { NetworkConnection, PLYWNEARPoolDetails } from './types';
|
|
6
6
|
export declare class StakingRead extends BlockchainEntityRead {
|
|
7
7
|
protected _comptroller: Comptroller;
|
|
8
8
|
protected _auriFairLaunch: AuriFairLaunch;
|
|
9
9
|
protected _auriLens: AuriLens;
|
|
10
10
|
constructor(networkConnection: NetworkConnection);
|
|
11
11
|
getPLYWNEARPoolDetails(): Promise<PLYWNEARPoolDetails>;
|
|
12
|
-
stakeBalanceOf(user: string): Promise<
|
|
13
|
-
LpBalanceOf(user: string): Promise<
|
|
12
|
+
stakeBalanceOf(user: string): Promise<TokenAmount>;
|
|
13
|
+
LpBalanceOf(user: string): Promise<TokenAmount>;
|
|
14
14
|
unclaimedRewardsOf(user: string): Promise<TokenAmount[]>;
|
|
15
15
|
}
|
|
16
16
|
export declare class StakingReadWrite extends StakingRead {
|
|
@@ -3832,13 +3832,7 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3832
3832
|
});
|
|
3833
3833
|
|
|
3834
3834
|
return _context.abrupt("return", {
|
|
3835
|
-
totalStakedLiquidity:
|
|
3836
|
-
tokenAmount: stakedLiquidityAmount,
|
|
3837
|
-
currencyAmount: {
|
|
3838
|
-
currency: 'USD',
|
|
3839
|
-
amount: totalStakeValuation.toFixed(DECIMAL_PRECISION)
|
|
3840
|
-
}
|
|
3841
|
-
},
|
|
3835
|
+
totalStakedLiquidity: stakedLiquidityAmount,
|
|
3842
3836
|
APYs: APYs
|
|
3843
3837
|
});
|
|
3844
3838
|
|
|
@@ -3859,7 +3853,7 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3859
3853
|
|
|
3860
3854
|
_proto.stakeBalanceOf = /*#__PURE__*/function () {
|
|
3861
3855
|
var _stakeBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(user) {
|
|
3862
|
-
var userInfo
|
|
3856
|
+
var userInfo;
|
|
3863
3857
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
3864
3858
|
while (1) {
|
|
3865
3859
|
switch (_context2.prev = _context2.next) {
|
|
@@ -3869,10 +3863,9 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3869
3863
|
|
|
3870
3864
|
case 2:
|
|
3871
3865
|
userInfo = _context2.sent;
|
|
3872
|
-
|
|
3873
|
-
return _context2.abrupt("return", valuateToken(stakeAmount, this._networkConnection.provider));
|
|
3866
|
+
return _context2.abrupt("return", new TokenAmount(PLYWNEARToken, userInfo.amount.toString()));
|
|
3874
3867
|
|
|
3875
|
-
case
|
|
3868
|
+
case 4:
|
|
3876
3869
|
case "end":
|
|
3877
3870
|
return _context2.stop();
|
|
3878
3871
|
}
|
|
@@ -3900,7 +3893,7 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3900
3893
|
|
|
3901
3894
|
case 3:
|
|
3902
3895
|
balance = _context3.sent;
|
|
3903
|
-
return _context3.abrupt("return",
|
|
3896
|
+
return _context3.abrupt("return", new TokenAmount(PLYWNEARToken, balance.toString()));
|
|
3904
3897
|
|
|
3905
3898
|
case 5:
|
|
3906
3899
|
case "end":
|