@aurigami/sdk 1.6.4 → 1.6.6
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/ChangeLog.md +163 -0
- package/dist/SDK.d.ts +4 -7
- package/dist/abis/index.d.ts +14 -0
- package/dist/consts/constants.d.ts +2 -2
- package/dist/consts/dummy.d.ts +1 -2
- package/dist/contracts/{airdrop-lottery.d.ts → Airdrop.d.ts} +1 -6
- package/dist/contracts/MoneyMarket.d.ts +3 -4
- package/dist/contracts/Multicall.d.ts +2 -2
- package/dist/contracts/Papermill.d.ts +4 -9
- package/dist/contracts/Referral.d.ts +1 -1
- package/dist/contracts/Staking.d.ts +2 -5
- package/dist/contracts/index.d.ts +2 -1
- package/dist/contracts/misc.d.ts +26 -0
- package/dist/entities/auriEnv.d.ts +13 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/tokenAmount.d.ts +1 -1
- package/dist/helpers/priceFetcher.d.ts +1 -1
- package/dist/helpers/transfer-event-query.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/sdk.cjs.development.js +585 -104422
- 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 +588 -104427
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +7 -6
- package/src/SDK.ts +23 -330
- package/src/abis/index.ts +30 -0
- package/src/consts/constants.ts +15 -16
- package/src/consts/dummy.ts +4 -14
- package/src/contracts/Airdrop.ts +80 -0
- package/src/contracts/MoneyMarket.ts +56 -160
- package/src/contracts/Multicall.ts +8 -13
- package/src/contracts/Papermill.ts +34 -115
- package/src/contracts/Referral.ts +11 -14
- package/src/contracts/Staking.ts +18 -59
- package/src/contracts/index.ts +2 -1
- package/src/contracts/misc.ts +281 -0
- package/src/entities/BlockchainEntity.ts +2 -6
- package/src/entities/auriEnv.ts +39 -0
- package/src/entities/index.ts +1 -0
- package/src/entities/token.ts +1 -1
- package/src/entities/tokenAmount.ts +4 -12
- package/src/helpers/aurora-api-helpers.ts +3 -6
- package/src/helpers/helpers.ts +5 -17
- package/src/helpers/priceFetcher.ts +21 -62
- package/src/helpers/transfer-event-query.ts +4 -6
- package/src/index.ts +1 -1
- package/src/types/index.ts +1 -1
- package/src/abis/Faucet.json +0 -157
- package/src/abis/IUniswapV2Pair.json +0 -663
- package/src/abis/Oracle.json +0 -247
- package/src/abis/dummy.json +0 -3
- package/src/contracts/airdrop-lottery.ts +0 -320
- package/src/misc/airdrop_misc/auTokensInfo.json +0 -34
- package/src/misc/airdrop_misc/whitelist.json +0 -102629
package/ChangeLog.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Change Logs
|
|
2
|
+
|
|
3
|
+
## 1.6.6
|
|
4
|
+
|
|
5
|
+
Use `public readonly` modifier instead of `private/protected` in SDK.
|
|
6
|
+
|
|
7
|
+
## 1.6.5
|
|
8
|
+
|
|
9
|
+
SDK refactor #2, remove support for loterry campaign. Package size reduced from 3MB -> 200KB
|
|
10
|
+
|
|
11
|
+
## 1.6.4
|
|
12
|
+
|
|
13
|
+
Return meaningful result instead of INF in `calcLMRewardApr`
|
|
14
|
+
|
|
15
|
+
## 1.6.3
|
|
16
|
+
|
|
17
|
+
Add USN supports. Hardcoded USN price to $1.
|
|
18
|
+
|
|
19
|
+
## 1.6.2
|
|
20
|
+
|
|
21
|
+
- Add `ReferralRead(...).getUserReferralCode(userAddr: Address): Promise<string>`: Get the referral code for a given address, returns empty string if not found. Called to check if a user has a referral code.
|
|
22
|
+
- Add `ReferralRead(...).getReferralCodeOwner(code: string): Promise<Address>`: Get owner of a referral code, returns zero address if not found.
|
|
23
|
+
- Add `ReferralRead(...).getReferralCodeUsed(userAddr: Address): Promise<string>`: Get referral code that a user was referred by, returns empty string if not found.
|
|
24
|
+
- Add `ReferralReadWrite(...).registerNewReferralCode(): Promise<TransactionResponse>`: Generate a referral code for a given address. Called when an user want to creates his own referral code
|
|
25
|
+
- Add `ReferralReadWrite(...).useReferralCode(code: string): Promise<TransactionResponse>`: Called when an user confirms he is referred by a specified code
|
|
26
|
+
|
|
27
|
+
## 1.6.1
|
|
28
|
+
|
|
29
|
+
Add `PapermillRead(...).getNextWeekTimestamp(): number`: get the start timestamp of next week of the papermill contract.
|
|
30
|
+
|
|
31
|
+
Add `SdkRead(...).getPlyCirculatingSupply(): Promise<TokenAmount>`: get the ply's circulating supply
|
|
32
|
+
|
|
33
|
+
## 1.6.0
|
|
34
|
+
|
|
35
|
+
SDK refactor - Why?:
|
|
36
|
+
|
|
37
|
+
- more modular and less coupled.
|
|
38
|
+
- more testable.
|
|
39
|
+
- more maintainable.
|
|
40
|
+
|
|
41
|
+
Things to do:
|
|
42
|
+
|
|
43
|
+
- [x] Restructure the folder structure.
|
|
44
|
+
- Refactor the code - Use composition pattern to SDK class
|
|
45
|
+
- [x] Use address from contract package instead of hardcoded address.
|
|
46
|
+
|
|
47
|
+
## 1.5.8 + 1.5.9
|
|
48
|
+
|
|
49
|
+
Fix gas error on claim rewards: Instead of claim all the rewards in all market in 1 txns, we will claim rewards in 2 txns.
|
|
50
|
+
|
|
51
|
+
## 1.5.7
|
|
52
|
+
|
|
53
|
+
- Change return type of `SdkRead(...).LpBalanceOf` and `stakeBalanceOf` from `TokenValuation` to `TokenAmount` to match other functions in the SDK.
|
|
54
|
+
- `totalStakedLiquidity` field in `PLYWNEARPoolDetails` is now `TokenAmount` instead of `TokenValuation`.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
export type PLYWNEARPoolDetails = {
|
|
58
|
+
totalStakedLiquidity: TokenAmount;
|
|
59
|
+
APYs: TokenAPY[];
|
|
60
|
+
};
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 1.5.6
|
|
64
|
+
|
|
65
|
+
Add PLYWNEAR pool to ALL_STAKING_POOLS
|
|
66
|
+
|
|
67
|
+
## 1.5.5
|
|
68
|
+
|
|
69
|
+
Add auPLY market, integrate new fair launch contract
|
|
70
|
+
|
|
71
|
+
Hard code PULP price to 0
|
|
72
|
+
|
|
73
|
+
## 1.5.4
|
|
74
|
+
|
|
75
|
+
Use browser-friendly assert
|
|
76
|
+
|
|
77
|
+
## 1.5.2
|
|
78
|
+
|
|
79
|
+
Added `SdkRead(...).unclaimedRewardsOf(userAddress: Address): Promise<TokenAmount[]>` to get unclaimed rewards of a user in LP staking.
|
|
80
|
+
|
|
81
|
+
## 1.5.1
|
|
82
|
+
|
|
83
|
+
Added `PapermillRead(...).getUnlockPortionAt(userAddress: Address, timestamp: number)`
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
export type TokenAPY = {
|
|
87
|
+
address: string;
|
|
88
|
+
apy: string;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type PLYWNEARPoolDetails = {
|
|
92
|
+
totalStakedLiquidity: TokenValuation;
|
|
93
|
+
APYs: TokenAPY[];
|
|
94
|
+
//apy: string; removed
|
|
95
|
+
};
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 1.5.0 For staking PLYWNEAR
|
|
99
|
+
|
|
100
|
+
### Unchanged:
|
|
101
|
+
|
|
102
|
+
- Stake/unstake: Use `SdkReadWrite(...).stake(amount: TokenAmount)` (or `unstake`)
|
|
103
|
+
|
|
104
|
+
### Rename:
|
|
105
|
+
|
|
106
|
+
- `SdkRead(...).getPlyAuroraPoolDetails` -> `SdkRead(...).getPLYWNEARPoolDetails`
|
|
107
|
+
|
|
108
|
+
### Add
|
|
109
|
+
|
|
110
|
+
- Read:
|
|
111
|
+
- `SdkRead(...).LpBalanceOf(user: Address):TokenValuation` => amount and $ value of LP token in wallet. To get amount staked, use the old `stakeBalanceOf()` above
|
|
112
|
+
- Type:
|
|
113
|
+
- `TokenValuation` is a type that contains amount and $ value of token.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
export type TokenValuation = {
|
|
117
|
+
tokenAmount: TokenAmount;
|
|
118
|
+
currencyAmount: CurrencyAmount;
|
|
119
|
+
};
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
export type PLYWNEARPoolDetails = {
|
|
124
|
+
totalStakedLiquidity: TokenValuation;
|
|
125
|
+
apy: string;
|
|
126
|
+
};
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Return type changed:
|
|
130
|
+
|
|
131
|
+
- `SdkRead(...).stakeBalanceOf()` will return `TokenValuation` instead of `TokenAmount`
|
|
132
|
+
|
|
133
|
+
### Remove:
|
|
134
|
+
|
|
135
|
+
- Type `PlyAuroraPoolDetails` removed.
|
|
136
|
+
|
|
137
|
+
## 1.5.0 For Papermill
|
|
138
|
+
|
|
139
|
+
### Add
|
|
140
|
+
|
|
141
|
+
- Read functions:
|
|
142
|
+
|
|
143
|
+
- `new PapermillRead(...).getPlyBalance(address: Address): TokenAmount` => PLY balance in user wallet
|
|
144
|
+
- `new PapermillRead(...).getPulpBalance(address: Address): TokenAmount` => PULP balance in user wallet
|
|
145
|
+
- `new PapermillRead(...).getLockingDetails(address: Address): UserLockingDetails`: Get locking details. This function is for convenience only, because the locking details are already available in the `UserLockingDetails` result (which you can get by calling the old `SdkRead(...).getUserDetails()`)
|
|
146
|
+
|
|
147
|
+
- Write functions:
|
|
148
|
+
|
|
149
|
+
- `new PapermillReadWrite(...).redeem(recipient: Address, amount: TokenAmount)` => Redeem Ply from PULP. Set `amount` to `ethers.constants.MaxUint256` for max redeem.
|
|
150
|
+
- `new PapermillReadWrite(...).selfRedeem(amount: TokenAmount)` => Redeem Ply from PULP to msg.sender. This is just a shortcut for the redeem function above.
|
|
151
|
+
- Collect all PLY reward from all markets + staking pool: No added functions, using the old `SdkReadWrite(...).claim()`
|
|
152
|
+
|
|
153
|
+
- Type:
|
|
154
|
+
- `UserLockingDetails` to store all user locking details
|
|
155
|
+
|
|
156
|
+
### Update
|
|
157
|
+
|
|
158
|
+
- `SdkRead(...).getUserDetails()`: this will include the result from `getLockingDetails`.
|
|
159
|
+
|
|
160
|
+
### Remove
|
|
161
|
+
|
|
162
|
+
- `SdkRead(...).getLockingDetails()`: Use the `getLockingDetails` in papermill instead if needed.
|
|
163
|
+
- Remove `LockingDetails` type
|
package/dist/SDK.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { AuriFairLaunch, AuriLens, Comptroller } from '@aurigami/contracts/typechain';
|
|
2
1
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
3
|
-
import { StakingRead } from './contracts';
|
|
4
|
-
import { BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from './entities';
|
|
2
|
+
import { MiscRead, StakingRead } from './contracts';
|
|
3
|
+
import { AuriEnv, BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from './entities';
|
|
5
4
|
import * as types from './types';
|
|
6
5
|
export declare class SdkRead extends BlockchainEntityRead {
|
|
7
|
-
protected
|
|
8
|
-
protected _auriFairLaunch: AuriFairLaunch;
|
|
9
|
-
protected _auriLens: AuriLens;
|
|
6
|
+
protected env: AuriEnv;
|
|
10
7
|
protected _stakingRead: StakingRead;
|
|
8
|
+
protected _misc: MiscRead;
|
|
11
9
|
constructor(networkConnection: types.NetworkConnection);
|
|
12
10
|
getUserDetails(userAddress: string): Promise<types.UserDetails>;
|
|
13
11
|
getPLYWNEARPoolDetails(): Promise<types.PLYWNEARPoolDetails>;
|
|
@@ -46,7 +44,6 @@ export declare class SdkReadWrite extends SdkRead {
|
|
|
46
44
|
claimLpRewards(): Promise<TransactionResponse>;
|
|
47
45
|
stake(amount: TokenAmount): Promise<TransactionResponse>;
|
|
48
46
|
unstake(amount: TokenAmount): Promise<TransactionResponse>;
|
|
49
|
-
faucetDrip(): Promise<TransactionResponse>;
|
|
50
47
|
}
|
|
51
48
|
export declare class SDK extends BlockchainEntity {
|
|
52
49
|
constructor();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import AuErc20ABI from '@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json';
|
|
2
|
+
import AuETHABI from '@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json';
|
|
3
|
+
import AuriAirdropABI from '@aurigami/contracts/artifacts/contracts/AuriAirdrop.sol/AuriAirdrop.json';
|
|
4
|
+
import AuriFairLaunchABI from '@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json';
|
|
5
|
+
import AuriLensABI from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json';
|
|
6
|
+
import AuriOracleABI from '@aurigami/contracts/artifacts/contracts/AuriOracle.sol/AuriOracle.json';
|
|
7
|
+
import ComptrollerABI from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
|
|
8
|
+
import EthRepayHelperABI from '@aurigami/contracts/artifacts/contracts/EthRepayHelper.sol/EthRepayHelper.json';
|
|
9
|
+
import EIP20InterfaceABI from '@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json';
|
|
10
|
+
import IUniswapV2PairABI from '@aurigami/contracts/artifacts/contracts/mock/IUniswapV2Pair.sol/IUniswapV2Pair.json';
|
|
11
|
+
import Multicall2ABI from '@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json';
|
|
12
|
+
import PulpABI from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
|
|
13
|
+
import ReferralDirectoryABI from '@aurigami/contracts/artifacts/contracts/ReferralDirectory.sol/ReferralDirectory.json';
|
|
14
|
+
export { AuriOracleABI, IUniswapV2PairABI, AuriAirdropABI, AuriFairLaunchABI, AuriLensABI, ComptrollerABI, EIP20InterfaceABI, ReferralDirectoryABI, AuErc20ABI, AuETHABI, EthRepayHelperABI, Multicall2ABI, PulpABI, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
|
-
import {
|
|
2
|
+
import { BigNumber as BN } from 'ethers';
|
|
3
3
|
export declare const dummyAddress: string;
|
|
4
4
|
export declare const ETHAddress: string;
|
|
5
5
|
export declare const AURORA_CHAINID = 1313161554;
|
|
@@ -23,7 +23,7 @@ export declare const ONE_YEAR: number;
|
|
|
23
23
|
export declare const PLYWNEAR_POOL_ID = 0;
|
|
24
24
|
export declare const PLYWNEAR_REWARD_TOKENS: string[];
|
|
25
25
|
export declare const ALL_STAKING_POOLS: number[];
|
|
26
|
-
export declare const INF:
|
|
26
|
+
export declare const INF: BN;
|
|
27
27
|
export declare const AIRDROP_START_TIMESTAMP = 1649858400;
|
|
28
28
|
export declare const AIRDROP_END_TIMESTAMP = 1651068000;
|
|
29
29
|
export declare const AIRDROP_KEEP_THRESHOLD: number;
|
package/dist/consts/dummy.d.ts
CHANGED
|
@@ -3,13 +3,8 @@ import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
|
3
3
|
import { BlockchainEntity, BlockchainEntityRead, TokenAmount } from '../entities';
|
|
4
4
|
import { Address, NetworkConnection } from '../types';
|
|
5
5
|
export declare class AirdropRead extends BlockchainEntityRead {
|
|
6
|
-
|
|
7
|
-
private _whitelistedAddresses;
|
|
8
|
-
private keepTrackers;
|
|
6
|
+
readonly airDrop: AuriAirdrop;
|
|
9
7
|
constructor(networkConnection: NetworkConnection);
|
|
10
|
-
countWhitelistedAddresses(): number;
|
|
11
|
-
isWhitelisted(user: string): boolean;
|
|
12
|
-
hasCompletedChallenge(user: string): Promise<boolean>;
|
|
13
8
|
/**
|
|
14
9
|
* Get redeemable rewards amount of user
|
|
15
10
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AuErc20, AuETH,
|
|
1
|
+
import { AuErc20, AuETH, EthRepayHelper } from '@aurigami/contracts/typechain';
|
|
2
2
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
3
3
|
import BigNumber from 'bignumber.js';
|
|
4
4
|
import { BigNumber as BN } from 'ethers';
|
|
5
|
-
import { BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from '../entities';
|
|
5
|
+
import { AuriEnv, BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from '../entities';
|
|
6
6
|
import { Address, MoneyMarketDetails, NetworkConnection } from '../types';
|
|
7
7
|
declare type RewardSpeeds = {
|
|
8
8
|
plyRewardSupplySpeed: BN;
|
|
@@ -13,8 +13,7 @@ declare type RewardSpeeds = {
|
|
|
13
13
|
export declare class MoneyMarketRead extends BlockchainEntityRead {
|
|
14
14
|
underlying: Token;
|
|
15
15
|
auToken: AuErc20 | AuETH;
|
|
16
|
-
|
|
17
|
-
protected _auriLens: AuriLens;
|
|
16
|
+
readonly env: AuriEnv;
|
|
18
17
|
constructor(networkConnection: NetworkConnection, auToken: Address, underlyingAsset: Address);
|
|
19
18
|
protected getRewardSpeeds(): Promise<RewardSpeeds>;
|
|
20
19
|
getTotalTokenBorrowed(): Promise<TokenAmount>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Multicall2 } from '@aurigami/contracts/typechain';
|
|
2
2
|
import { Contract } from 'ethers';
|
|
3
|
+
import { Result } from 'ethers/lib/utils';
|
|
3
4
|
import { BlockchainEntityRead } from '../entities';
|
|
4
5
|
import { NetworkConnection } from '../types';
|
|
5
|
-
import { Result } from 'ethers/lib/utils';
|
|
6
6
|
export declare class MulticallRead extends BlockchainEntityRead {
|
|
7
|
-
|
|
7
|
+
readonly multicall: Multicall2;
|
|
8
8
|
constructor(networkConnection: NetworkConnection);
|
|
9
9
|
/**
|
|
10
10
|
* Run multiple calls via multicall contract
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { AuriFairLaunch, AuriLens, Comptroller, IERC20, PULP } from '@aurigami/contracts/typechain';
|
|
2
1
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
3
|
-
import { BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from '../entities';
|
|
2
|
+
import { AuriEnv, BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from '../entities';
|
|
4
3
|
import { Address, NetworkConnection, UserLockingDetails } from '../types';
|
|
5
4
|
export declare class PapermillRead extends BlockchainEntityRead {
|
|
6
|
-
plyToken: Token;
|
|
7
|
-
pulpToken: Token;
|
|
8
|
-
|
|
9
|
-
protected _pulp: PULP;
|
|
10
|
-
protected _comptroller: Comptroller;
|
|
11
|
-
protected _auriFairLaunch: AuriFairLaunch;
|
|
12
|
-
protected _auriLens: AuriLens;
|
|
5
|
+
readonly plyToken: Token;
|
|
6
|
+
readonly pulpToken: Token;
|
|
7
|
+
readonly env: AuriEnv;
|
|
13
8
|
constructor(networkConnection: NetworkConnection);
|
|
14
9
|
getPlyBalance(userAddress: Address): Promise<TokenAmount>;
|
|
15
10
|
getPulpBalance(userAddress: Address): Promise<TokenAmount>;
|
|
@@ -3,7 +3,7 @@ import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
|
3
3
|
import { BlockchainEntity, BlockchainEntityRead } from '../entities';
|
|
4
4
|
import { Address, NetworkConnection } from '../types';
|
|
5
5
|
export declare class ReferralRead extends BlockchainEntityRead {
|
|
6
|
-
|
|
6
|
+
readonly referral: ReferralDirectory;
|
|
7
7
|
constructor(networkConnection: NetworkConnection);
|
|
8
8
|
/**
|
|
9
9
|
* Generate a 10-character referral code
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { AuriFairLaunch, AuriLens, Comptroller } from '@aurigami/contracts/typechain';
|
|
2
1
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
3
|
-
import { BlockchainEntity, BlockchainEntityRead, TokenAmount } from '../entities';
|
|
2
|
+
import { AuriEnv, BlockchainEntity, BlockchainEntityRead, TokenAmount } from '../entities';
|
|
4
3
|
import { NetworkConnection, PLYWNEARPoolDetails } from '../types';
|
|
5
4
|
export declare class StakingRead extends BlockchainEntityRead {
|
|
6
|
-
|
|
7
|
-
protected _auriFairLaunch: AuriFairLaunch;
|
|
8
|
-
protected _auriLens: AuriLens;
|
|
5
|
+
readonly env: AuriEnv;
|
|
9
6
|
constructor(networkConnection: NetworkConnection);
|
|
10
7
|
getPLYWNEARPoolDetails(): Promise<PLYWNEARPoolDetails>;
|
|
11
8
|
/**
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StakingRead } from '../contracts';
|
|
2
|
+
import { AuriEnv, BlockchainEntityRead, Token, TokenAmount } from '../entities';
|
|
3
|
+
import * as types from '../types';
|
|
4
|
+
export declare class MiscRead extends BlockchainEntityRead {
|
|
5
|
+
readonly env: AuriEnv;
|
|
6
|
+
readonly stakingRead: StakingRead;
|
|
7
|
+
constructor(networkConnection: types.NetworkConnection);
|
|
8
|
+
getUserDetails(userAddress: string): Promise<types.UserDetails>;
|
|
9
|
+
getTokenPrice(token: Token): Promise<types.CurrencyAmount>;
|
|
10
|
+
calcHypotheticalStats({ userMarketDetail, currentBorrowLimit, currentBorrowValuation, action, tokenAmount, }: {
|
|
11
|
+
userMarketDetail: types.UserMarketDetails;
|
|
12
|
+
currentBorrowLimit: types.CurrencyAmount;
|
|
13
|
+
currentBorrowValuation: types.CurrencyAmount;
|
|
14
|
+
action: types.MarketAction;
|
|
15
|
+
tokenAmount?: TokenAmount;
|
|
16
|
+
}): types.HypotheticalStats;
|
|
17
|
+
/**
|
|
18
|
+
* Get ply circulating supply.
|
|
19
|
+
* It is calculated by the total supply, minus:
|
|
20
|
+
* - Ply in team multisig contract
|
|
21
|
+
* - Ply in comptroller contract
|
|
22
|
+
* - Ply in fairlaunch contract
|
|
23
|
+
* - Ply in vesting contract
|
|
24
|
+
*/
|
|
25
|
+
getPlyCirculatingSupply(): Promise<TokenAmount>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AuriFairLaunch, AuriLens, Comptroller, IERC20, PULP } from '@aurigami/contracts/typechain';
|
|
2
|
+
import { Contract } from 'ethers';
|
|
3
|
+
import { NetworkConnection } from '../types';
|
|
4
|
+
import { BlockchainEntityRead } from './BlockchainEntity';
|
|
5
|
+
export declare class AuriEnv extends BlockchainEntityRead {
|
|
6
|
+
comptroller: Comptroller;
|
|
7
|
+
auriFairLaunch: AuriFairLaunch;
|
|
8
|
+
auriLens: AuriLens;
|
|
9
|
+
ply: IERC20;
|
|
10
|
+
pulp: PULP;
|
|
11
|
+
getContract<CType extends Contract>(address: string, abi: any): CType;
|
|
12
|
+
constructor(networkConnection: NetworkConnection);
|
|
13
|
+
}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
|
-
import {
|
|
2
|
+
import { BigNumber as BN, providers } from 'ethers';
|
|
3
3
|
import { TokenAmount } from '../entities/tokenAmount';
|
|
4
4
|
import { Address, TokenValuation } from '../types';
|
|
5
5
|
export declare function fetchPriceFromCoingeckoAPI(id: string): Promise<BigNumber>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BlockchainEntityRead } from '../entities/BlockchainEntity';
|
|
2
|
-
import { NetworkConnection } from '../types';
|
|
3
1
|
import { AuToken } from '@aurigami/contracts/typechain';
|
|
4
2
|
import { BigNumber as BN } from 'ethers';
|
|
3
|
+
import { BlockchainEntityRead } from '../entities/BlockchainEntity';
|
|
4
|
+
import { NetworkConnection } from '../types';
|
|
5
5
|
declare type SimpleTransfer = {
|
|
6
6
|
from: string;
|
|
7
7
|
to: string;
|