@aurigami/sdk 1.5.0 → 1.5.2
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/Papermill.d.ts +2 -0
- package/dist/SDK.d.ts +5 -4
- package/dist/Staking.d.ts +24 -0
- package/dist/constants.d.ts +2 -2
- package/dist/priceFetcher.d.ts +1 -0
- package/dist/sdk.cjs.development.js +447 -179
- 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 +451 -184
- package/dist/sdk.esm.js.map +1 -1
- package/dist/tokenAmount.d.ts +2 -0
- package/dist/types.d.ts +5 -1
- package/package.json +1 -1
- package/src/Papermill.ts +28 -10
- package/src/SDK.ts +37 -122
- package/src/Staking.ts +193 -0
- package/src/constants.ts +2 -2
- package/src/helpers.ts +3 -5
- package/src/priceFetcher.ts +13 -15
- package/src/tokenAmount.ts +14 -1
- package/src/types.ts +6 -1
package/dist/Papermill.d.ts
CHANGED
|
@@ -16,8 +16,10 @@ export declare class PapermillRead extends BlockchainEntityRead {
|
|
|
16
16
|
getPlyBalance(userAddress: Address): Promise<TokenAmount>;
|
|
17
17
|
getPulpBalance(userAddress: Address): Promise<TokenAmount>;
|
|
18
18
|
getUnclaimedPlyReward(userAddress: Address): Promise<TokenAmount>;
|
|
19
|
+
private getWeek;
|
|
19
20
|
getLockingDetails(userAddress: Address): Promise<UserLockingDetails>;
|
|
20
21
|
getTimestampToUnlock(userAddress: Address, targetUnlockPortion: number): Promise<number>;
|
|
22
|
+
getUnlockPortionAt(userAddress: Address, timestamp: number): Promise<number>;
|
|
21
23
|
}
|
|
22
24
|
export declare class PapermillReadWrite extends PapermillRead {
|
|
23
25
|
constructor(networkConnection: NetworkConnection);
|
package/dist/SDK.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PLYWNEARPoolDetails, NetworkConnection, UserDetails, UserMarketDetails, CurrencyAmount, HypotheticalStats, MarketAction, TokenValuation } from './types';
|
|
1
|
+
import { AuriFairLaunch, AuriLens, Comptroller } from '@aurigami/contracts/typechain';
|
|
3
2
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
4
|
-
import {
|
|
5
|
-
import { TokenAmount } from './tokenAmount';
|
|
3
|
+
import { BlockchainEntity, BlockchainEntityRead } from './BlockchainEntity';
|
|
6
4
|
import { Token } from './token';
|
|
5
|
+
import { TokenAmount } from './tokenAmount';
|
|
6
|
+
import { CurrencyAmount, HypotheticalStats, MarketAction, NetworkConnection, PLYWNEARPoolDetails, TokenValuation, UserDetails, UserMarketDetails } from './types';
|
|
7
7
|
export declare class SdkRead extends BlockchainEntityRead {
|
|
8
8
|
protected _comptroller: Comptroller;
|
|
9
9
|
protected _auriFairLaunch: AuriFairLaunch;
|
|
@@ -14,6 +14,7 @@ export declare class SdkRead extends BlockchainEntityRead {
|
|
|
14
14
|
getTokenPrice(token: Token): Promise<CurrencyAmount>;
|
|
15
15
|
stakeBalanceOf(user: string): Promise<TokenValuation>;
|
|
16
16
|
LpBalanceOf(user: string): Promise<TokenValuation>;
|
|
17
|
+
unclaimedRewardsOf(user: string): Promise<TokenAmount[]>;
|
|
17
18
|
calcHypotheticalStats({ userMarketDetail, currentBorrowLimit, currentBorrowValuation, action, tokenAmount, }: {
|
|
18
19
|
userMarketDetail: UserMarketDetails;
|
|
19
20
|
currentBorrowLimit: CurrencyAmount;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AuriFairLaunch, AuriLens, Comptroller } from '@aurigami/contracts/typechain';
|
|
2
|
+
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
3
|
+
import { BlockchainEntity, BlockchainEntityRead } from './BlockchainEntity';
|
|
4
|
+
import { TokenAmount } from './tokenAmount';
|
|
5
|
+
import { NetworkConnection, PLYWNEARPoolDetails, TokenValuation } from './types';
|
|
6
|
+
export declare class StakingRead extends BlockchainEntityRead {
|
|
7
|
+
protected _comptroller: Comptroller;
|
|
8
|
+
protected _auriFairLaunch: AuriFairLaunch;
|
|
9
|
+
protected _auriLens: AuriLens;
|
|
10
|
+
constructor(networkConnection: NetworkConnection);
|
|
11
|
+
getPLYWNEARPoolDetails(): Promise<PLYWNEARPoolDetails>;
|
|
12
|
+
stakeBalanceOf(user: string): Promise<TokenValuation>;
|
|
13
|
+
LpBalanceOf(user: string): Promise<TokenValuation>;
|
|
14
|
+
unclaimedRewardsOf(user: string): Promise<TokenAmount[]>;
|
|
15
|
+
}
|
|
16
|
+
export declare class StakingReadWrite extends StakingRead {
|
|
17
|
+
stake(amount: TokenAmount): Promise<TransactionResponse>;
|
|
18
|
+
unstake(amount: TokenAmount): Promise<TransactionResponse>;
|
|
19
|
+
}
|
|
20
|
+
export declare class Staking extends BlockchainEntity {
|
|
21
|
+
constructor();
|
|
22
|
+
read(networkConnection: NetworkConnection): StakingRead;
|
|
23
|
+
readWrite(networkConnection: NetworkConnection): StakingReadWrite;
|
|
24
|
+
}
|
package/dist/constants.d.ts
CHANGED
|
@@ -15,14 +15,14 @@ export declare type NetworkAddresses = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const networkAddresses: NetworkAddresses;
|
|
17
17
|
export declare const PRICE_WHITELISTED: Set<string>;
|
|
18
|
-
export declare const REWARD_CLAIM_START =
|
|
18
|
+
export declare const REWARD_CLAIM_START = 1651748400;
|
|
19
19
|
export declare const BORROW_LIMIT_BUFFER: BigNumber;
|
|
20
20
|
export declare const ONE_DAY = 86400;
|
|
21
21
|
export declare const ONE_WEEK: number;
|
|
22
22
|
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
|
-
export declare const ALL_STAKING_POOLS:
|
|
25
|
+
export declare const ALL_STAKING_POOLS: number[];
|
|
26
26
|
export declare const INF: ethers.BigNumber;
|
|
27
27
|
export declare const AIRDROP_START_TIMESTAMP = 1649858400;
|
|
28
28
|
export declare const AIRDROP_END_TIMESTAMP = 1651068000;
|
package/dist/priceFetcher.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare function fetchUnderlyingTokensPrices(provider: providers.Provider
|
|
|
20
20
|
export declare function fetchStNEARPrice(): Promise<BigNumber>;
|
|
21
21
|
export declare function fetchPrice(address: Address, provider: providers.Provider): Promise<BigNumber>;
|
|
22
22
|
export declare function fetchPLYPrice(provider: providers.Provider): Promise<BigNumber>;
|
|
23
|
+
export declare function fetchToken0PriceByLP(LP: Address, provider: providers.Provider): Promise<BigNumber>;
|
|
23
24
|
export declare function fetchValuation(tokenAmount: TokenAmount, provider: providers.Provider): Promise<BigNumber>;
|
|
24
25
|
export declare function calcValuation(tokenAmount: TokenAmount, price: BigNumber): BigNumber;
|
|
25
26
|
export declare function valuateToken(tokenAmount: TokenAmount, provider: providers.Provider): Promise<TokenValuation>;
|