@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/dist/interactors/Pulp.d.ts +17 -0
- package/dist/sdk.cjs.development.js +2948 -4660
- 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 +2947 -4661
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/SDK.ts +1 -0
- package/src/interactors/MoneyMarket.ts +1 -1
- package/src/interactors/Pulp.ts +39 -0
package/package.json
CHANGED
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 =
|
|
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
|
+
}
|