@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/types.d.ts CHANGED
@@ -62,7 +62,7 @@ export declare type TokenAPY = {
62
62
  apy: string;
63
63
  };
64
64
  export declare type PLYWNEARPoolDetails = {
65
- totalStakedLiquidity: TokenValuation;
65
+ totalStakedLiquidity: TokenAmount;
66
66
  APYs: TokenAPY[];
67
67
  };
68
68
  export declare enum MarketAction {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.6",
2
+ "version": "1.5.7",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
package/src/SDK.ts CHANGED
@@ -31,7 +31,6 @@ import {
31
31
  MarketAction,
32
32
  NetworkConnection,
33
33
  PLYWNEARPoolDetails,
34
- TokenValuation,
35
34
  UserDetails,
36
35
  UserMarketDetails,
37
36
  } from './types';
@@ -228,16 +227,16 @@ export class SdkRead extends BlockchainEntityRead {
228
227
  }
229
228
 
230
229
  /**
231
- * Get amount and value in $ of staked LP tokens
230
+ * Get amount of staked LP tokens
232
231
  */
233
- public async stakeBalanceOf(user: string): Promise<TokenValuation> {
232
+ public async stakeBalanceOf(user: string): Promise<TokenAmount> {
234
233
  return this._stakingRead.stakeBalanceOf(user);
235
234
  }
236
235
 
237
236
  /**
238
- * Get amount and value in $ of LP token in user wallet
237
+ * Get amount of LP token in user wallet
239
238
  */
240
- public async LpBalanceOf(user: string): Promise<TokenValuation> {
239
+ public async LpBalanceOf(user: string): Promise<TokenAmount> {
241
240
  return this._stakingRead.LpBalanceOf(user);
242
241
  }
243
242
 
package/src/Staking.ts CHANGED
@@ -20,15 +20,10 @@ import {
20
20
  PLYWNEAR_REWARD_TOKENS,
21
21
  } from './constants';
22
22
  import { calcLMRewardApr, getDecimal } from './helpers';
23
- import { fetchValuation, valuateToken } from './priceFetcher';
23
+ import { fetchValuation } from './priceFetcher';
24
24
  import { PLYWNEARToken, Token } from './token';
25
25
  import { TokenAmount } from './tokenAmount';
26
- import {
27
- NetworkConnection,
28
- PLYWNEARPoolDetails,
29
- TokenAPY,
30
- TokenValuation,
31
- } from './types';
26
+ import { NetworkConnection, PLYWNEARPoolDetails, TokenAPY } from './types';
32
27
 
33
28
  export class StakingRead extends BlockchainEntityRead {
34
29
  protected _comptroller: Comptroller;
@@ -104,37 +99,26 @@ export class StakingRead extends BlockchainEntityRead {
104
99
  });
105
100
 
106
101
  return {
107
- totalStakedLiquidity: {
108
- tokenAmount: stakedLiquidityAmount,
109
- currencyAmount: {
110
- currency: 'USD',
111
- amount: totalStakeValuation!.toFixed(DECIMAL_PRECISION),
112
- },
113
- },
102
+ totalStakedLiquidity: stakedLiquidityAmount,
114
103
  APYs: APYs,
115
104
  };
116
105
  }
117
106
 
118
107
  /**
119
- * Get amount and value in $ of staked LP tokens
108
+ * Get amount of staked LP tokens
120
109
  */
121
- public async stakeBalanceOf(user: string): Promise<TokenValuation> {
110
+ public async stakeBalanceOf(user: string): Promise<TokenAmount> {
122
111
  const userInfo = await this._auriFairLaunch.getUserInfo(
123
112
  PLYWNEAR_POOL_ID,
124
113
  user
125
114
  );
126
- let stakeAmount = new TokenAmount(
127
- PLYWNEARToken,
128
- userInfo.amount.toString()
129
- );
130
-
131
- return valuateToken(stakeAmount, this._networkConnection.provider);
115
+ return new TokenAmount(PLYWNEARToken, userInfo.amount.toString());
132
116
  }
133
117
 
134
118
  /**
135
- * Get amount and value in $ of LP token in user wallet
119
+ * Get amount of LP token in user wallet
136
120
  */
137
- public async LpBalanceOf(user: string): Promise<TokenValuation> {
121
+ public async LpBalanceOf(user: string): Promise<TokenAmount> {
138
122
  let lpContract = new Contract(
139
123
  networkAddresses.tokens.PLYWNEAR,
140
124
  EIP20InterfaceABI.abi,
@@ -142,10 +126,7 @@ export class StakingRead extends BlockchainEntityRead {
142
126
  ) as IERC20;
143
127
  let balance = await lpContract.balanceOf(user);
144
128
 
145
- return valuateToken(
146
- new TokenAmount(PLYWNEARToken, balance.toString()),
147
- this._networkConnection.provider
148
- );
129
+ return new TokenAmount(PLYWNEARToken, balance.toString());
149
130
  }
150
131
 
151
132
  public async unclaimedRewardsOf(user: string): Promise<TokenAmount[]> {
package/src/types.ts CHANGED
@@ -87,7 +87,7 @@ export type TokenAPY = {
87
87
  };
88
88
 
89
89
  export type PLYWNEARPoolDetails = {
90
- totalStakedLiquidity: TokenValuation;
90
+ totalStakedLiquidity: TokenAmount;
91
91
  APYs: TokenAPY[];
92
92
  };
93
93