@aurigami/sdk 1.16.1 → 1.17.0

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.16.1",
2
+ "version": "1.17.0",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
package/src/SDK.ts CHANGED
@@ -5,6 +5,7 @@ import { AuriEnv, BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } f
5
5
  import { MiscRead, StakingRead, StakingReadWrite } from './interactors';
6
6
  import * as types from './types';
7
7
  import * as NotificationApi from './helpers/notification-api';
8
+ import { BigNumber as BN } from 'ethers';
8
9
 
9
10
  export class SdkRead extends BlockchainEntityRead {
10
11
  protected env: AuriEnv;
@@ -196,7 +196,7 @@ export class MoneyMarketRead extends BlockchainEntityRead {
196
196
 
197
197
  @cache({ ttl: CACHE_TIMEOUT, type: CacheType.MEMO })
198
198
  public async getDepositStaderAPY(): Promise<BigNumber> {
199
- const rewardStartTime = 1675371600;
199
+ const rewardStartTime = 1675346400;
200
200
  const currentTime = helpers.getCurrentTimestamp();
201
201
  if (currentTime < rewardStartTime) {
202
202
  return new BigNumber(0);
@@ -0,0 +1,39 @@
1
+ import { TransactionResponse } from '@ethersproject/abstract-provider';
2
+ import { BigNumber as BN } from 'ethers';
3
+ import { AuriEnv, BlockchainEntity, BlockchainEntityRead, TokenAmount } from '../entities';
4
+ import { Address, NetworkConnection } from '../types';
5
+
6
+ export class PulpRead extends BlockchainEntityRead {
7
+ public readonly env: AuriEnv;
8
+
9
+ public constructor(networkConnection: NetworkConnection) {
10
+ super(networkConnection);
11
+ this.env = new AuriEnv(networkConnection);
12
+ }
13
+
14
+ public async remainingEarlyUnlockPulp(user: Address): Promise<BN> {
15
+ return this.env.pulp.getMaxAmountRedeemable(user);
16
+ }
17
+ }
18
+
19
+ export class PulpReadWrite extends PulpRead {
20
+ public async convertEarlyPulp(
21
+ recipient: Address,
22
+ amount: TokenAmount
23
+ ): Promise<TransactionResponse> {
24
+ const amountToRedeem = BN.from(amount.rawAmount);
25
+ return this.env.pulp.redeem(recipient, amountToRedeem);
26
+ }
27
+ }
28
+
29
+ export class Pulp extends BlockchainEntity {
30
+ constructor() {
31
+ super();
32
+ }
33
+ public read(networkConnection: NetworkConnection): PulpRead {
34
+ return new PulpRead(networkConnection);
35
+ }
36
+ public readWrite(networkConnection: NetworkConnection): PulpReadWrite {
37
+ return new PulpReadWrite(networkConnection);
38
+ }
39
+ }