aftermath-ts-sdk 1.2.51-temp.0 → 1.2.52-perps.3
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/README.md +61 -27
- package/dist/general/apiHelpers/eventsApiHelpers.d.ts +1 -1
- package/dist/general/apiHelpers/eventsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/eventsApiHelpers.js +4 -1
- package/dist/general/apiHelpers/transactionsApiHelpers.d.ts +6 -0
- package/dist/general/apiHelpers/transactionsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/transactionsApiHelpers.js +46 -0
- package/dist/general/dynamicGas/dynamicGas.d.ts +34 -0
- package/dist/general/dynamicGas/dynamicGas.d.ts.map +1 -1
- package/dist/general/dynamicGas/dynamicGas.js +34 -0
- package/dist/general/dynamicGas/dynamicGasTypes.d.ts +25 -0
- package/dist/general/dynamicGas/dynamicGasTypes.d.ts.map +1 -1
- package/dist/general/prices/coinGeckoTypes.d.ts +2 -0
- package/dist/general/prices/coinGeckoTypes.d.ts.map +1 -1
- package/dist/general/prices/prices.d.ts +73 -0
- package/dist/general/prices/prices.d.ts.map +1 -1
- package/dist/general/prices/prices.js +73 -0
- package/dist/general/providers/aftermath.d.ts +107 -27
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +110 -30
- package/dist/general/providers/aftermathApi.d.ts +128 -10
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +133 -14
- package/dist/general/types/castingTypes.d.ts +15 -7
- package/dist/general/types/castingTypes.d.ts.map +1 -1
- package/dist/general/types/castingTypes.js +6 -0
- package/dist/general/types/configTypes.d.ts +14 -9
- package/dist/general/types/configTypes.d.ts.map +1 -1
- package/dist/general/types/generalTypes.d.ts +229 -7
- package/dist/general/types/generalTypes.d.ts.map +1 -1
- package/dist/general/types/moveErrorsInterface.d.ts +1 -1
- package/dist/general/types/moveErrorsInterface.d.ts.map +1 -1
- package/dist/general/types/suiTypes.d.ts +0 -16
- package/dist/general/types/suiTypes.d.ts.map +1 -1
- package/dist/general/types/suiTypes.js +3 -25
- package/dist/general/utils/caller.d.ts +5 -2
- package/dist/general/utils/caller.d.ts.map +1 -1
- package/dist/general/utils/caller.js +9 -1
- package/dist/general/utils/casting.d.ts +156 -7
- package/dist/general/utils/casting.d.ts.map +1 -1
- package/dist/general/utils/casting.js +159 -20
- package/dist/general/utils/fixedUtils.d.ts +89 -2
- package/dist/general/utils/fixedUtils.d.ts.map +1 -1
- package/dist/general/utils/fixedUtils.js +81 -4
- package/dist/general/utils/helpers.d.ts +327 -10
- package/dist/general/utils/helpers.d.ts.map +1 -1
- package/dist/general/utils/helpers.js +409 -91
- package/dist/general/utils/iFixedUtils.d.ts +64 -0
- package/dist/general/utils/iFixedUtils.d.ts.map +1 -1
- package/dist/general/utils/iFixedUtils.js +64 -0
- package/dist/general/wallet/wallet.d.ts +76 -1
- package/dist/general/wallet/wallet.d.ts.map +1 -1
- package/dist/general/wallet/wallet.js +75 -5
- package/dist/packages/auth/auth.d.ts +113 -4
- package/dist/packages/auth/auth.d.ts.map +1 -1
- package/dist/packages/auth/auth.js +190 -59
- package/dist/packages/auth/authTypes.d.ts +66 -0
- package/dist/packages/auth/authTypes.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApi.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApi.js +29 -20
- package/dist/packages/coin/coin.d.ts +256 -1
- package/dist/packages/coin/coin.d.ts.map +1 -1
- package/dist/packages/coin/coin.js +246 -15
- package/dist/packages/coin/coinTypes.d.ts +95 -0
- package/dist/packages/coin/coinTypes.d.ts.map +1 -1
- package/dist/packages/dca/api/dcaApi.d.ts +2 -0
- package/dist/packages/dca/api/dcaApi.d.ts.map +1 -1
- package/dist/packages/dca/api/dcaApi.js +6 -3
- package/dist/packages/dca/dca.d.ts +125 -35
- package/dist/packages/dca/dca.d.ts.map +1 -1
- package/dist/packages/dca/dca.js +135 -43
- package/dist/packages/dca/dcaTypes.d.ts +217 -42
- package/dist/packages/dca/dcaTypes.d.ts.map +1 -1
- package/dist/packages/farms/api/farmsApi.d.ts +725 -58
- package/dist/packages/farms/api/farmsApi.d.ts.map +1 -1
- package/dist/packages/farms/api/farmsApi.js +1149 -153
- package/dist/packages/farms/api/farmsApiCasting.d.ts +34 -18
- package/dist/packages/farms/api/farmsApiCasting.d.ts.map +1 -1
- package/dist/packages/farms/api/farmsApiCasting.js +218 -17
- package/dist/packages/farms/api/farmsApiCastingTypes.d.ts +117 -21
- package/dist/packages/farms/api/farmsApiCastingTypes.d.ts.map +1 -1
- package/dist/packages/farms/farms.d.ts +188 -3
- package/dist/packages/farms/farms.d.ts.map +1 -1
- package/dist/packages/farms/farms.js +192 -12
- package/dist/packages/farms/farmsStakedPosition.d.ts +143 -8
- package/dist/packages/farms/farmsStakedPosition.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakedPosition.js +243 -137
- package/dist/packages/farms/farmsStakingPool.d.ts +169 -3
- package/dist/packages/farms/farmsStakingPool.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakingPool.js +212 -70
- package/dist/packages/farms/farmsTypes.d.ts +302 -2
- package/dist/packages/farms/farmsTypes.d.ts.map +1 -1
- package/dist/packages/farms/farmsTypes.js +18 -0
- package/dist/packages/faucet/api/faucetApi.d.ts +9 -17
- package/dist/packages/faucet/api/faucetApi.d.ts.map +1 -1
- package/dist/packages/faucet/api/faucetApi.js +44 -49
- package/dist/packages/faucet/api/faucetApiCasting.d.ts.map +1 -1
- package/dist/packages/faucet/api/faucetApiCasting.js +8 -5
- package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts +1 -4
- package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts.map +1 -1
- package/dist/packages/faucet/faucet.d.ts +1 -1
- package/dist/packages/faucet/faucet.d.ts.map +1 -1
- package/dist/packages/faucet/faucet.js +1 -1
- package/dist/packages/faucet/faucetTypes.d.ts +2 -3
- package/dist/packages/faucet/faucetTypes.d.ts.map +1 -1
- package/dist/packages/limitOrders/api/limitOrdersApi.d.ts +12 -0
- package/dist/packages/limitOrders/api/limitOrdersApi.d.ts.map +1 -0
- package/dist/packages/limitOrders/api/limitOrdersApi.js +25 -0
- package/dist/packages/limitOrders/index.d.ts +2 -0
- package/dist/packages/limitOrders/index.d.ts.map +1 -0
- package/dist/packages/limitOrders/index.js +17 -0
- package/dist/packages/limitOrders/limitOrders.d.ts +143 -0
- package/dist/packages/limitOrders/limitOrders.d.ts.map +1 -0
- package/dist/packages/limitOrders/limitOrders.js +190 -0
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts +211 -0
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts.map +1 -0
- package/dist/packages/multisig/multisig.d.ts +34 -5
- package/dist/packages/multisig/multisig.d.ts.map +1 -1
- package/dist/packages/multisig/multisig.js +33 -4
- package/dist/packages/multisig/multisigTypes.d.ts +17 -0
- package/dist/packages/multisig/multisigTypes.d.ts.map +1 -1
- package/dist/packages/nftAmm/nftAmm.d.ts +1 -1
- package/dist/packages/nftAmm/nftAmm.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts +7 -16
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApi.js +318 -276
- package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts +7 -7
- package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApiCasting.js +71 -84
- package/dist/packages/perpetuals/perpetuals.d.ts +33 -4
- package/dist/packages/perpetuals/perpetuals.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetuals.js +105 -18
- package/dist/packages/perpetuals/perpetualsAccount.d.ts +87 -52
- package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsAccount.js +544 -91
- package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts +55 -26
- package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsMarket.d.ts +28 -4
- package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsMarket.js +75 -13
- package/dist/packages/perpetuals/perpetualsTypes.d.ts +263 -213
- package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsTypes.js +24 -77
- package/dist/packages/pools/pool.d.ts +328 -86
- package/dist/packages/pools/pool.d.ts.map +1 -1
- package/dist/packages/pools/pool.js +333 -91
- package/dist/packages/pools/pools.d.ts +300 -38
- package/dist/packages/pools/pools.d.ts.map +1 -1
- package/dist/packages/pools/pools.js +306 -52
- package/dist/packages/pools/poolsTypes.d.ts +267 -2
- package/dist/packages/pools/poolsTypes.d.ts.map +1 -1
- package/dist/packages/referralVault/referralVault.d.ts +38 -1
- package/dist/packages/referralVault/referralVault.d.ts.map +1 -1
- package/dist/packages/referralVault/referralVault.js +37 -0
- package/dist/packages/router/router.d.ts +213 -17
- package/dist/packages/router/router.d.ts.map +1 -1
- package/dist/packages/router/router.js +214 -18
- package/dist/packages/router/routerTypes.d.ts +199 -15
- package/dist/packages/router/routerTypes.d.ts.map +1 -1
- package/dist/packages/staking/staking.d.ts +302 -44
- package/dist/packages/staking/staking.d.ts.map +1 -1
- package/dist/packages/staking/staking.js +308 -51
- package/dist/packages/staking/stakingTypes.d.ts +426 -6
- package/dist/packages/staking/stakingTypes.d.ts.map +1 -1
- package/dist/packages/staking/stakingTypes.js +19 -0
- package/dist/packages/sui/sui.d.ts +40 -1
- package/dist/packages/sui/sui.d.ts.map +1 -1
- package/dist/packages/sui/sui.js +39 -0
- package/dist/packages/suiFrens/stakedSuiFren.d.ts +1 -1
- package/dist/packages/suiFrens/stakedSuiFren.d.ts.map +1 -1
- package/dist/packages/suiFrens/suiFren.d.ts +1 -1
- package/dist/packages/suiFrens/suiFren.d.ts.map +1 -1
- package/dist/packages/suiFrens/suiFrens.d.ts +1 -1
- package/dist/packages/suiFrens/suiFrens.d.ts.map +1 -1
- package/dist/packages/userData/api/userDataApi.d.ts +6 -0
- package/dist/packages/userData/api/userDataApi.d.ts.map +1 -0
- package/dist/packages/userData/api/userDataApi.js +12 -0
- package/dist/packages/userData/index.d.ts +2 -0
- package/dist/packages/userData/index.d.ts.map +1 -0
- package/dist/packages/userData/index.js +17 -0
- package/dist/packages/userData/userData.d.ts +89 -0
- package/dist/packages/userData/userData.d.ts.map +1 -0
- package/dist/packages/userData/userData.js +119 -0
- package/dist/packages/userData/userDataTypes.d.ts +29 -0
- package/dist/packages/userData/userDataTypes.d.ts.map +1 -0
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -2
- package/package.json +1 -1
- package/dist/general/historicalData/historicalData.d.ts +0 -15
- package/dist/general/historicalData/historicalData.d.ts.map +0 -1
- package/dist/general/historicalData/historicalData.js +0 -45
- package/dist/general/historicalData/historicalDataTypes.d.ts +0 -10
- package/dist/general/historicalData/historicalDataTypes.d.ts.map +0 -1
- package/dist/packages/dca/api/dcaApiCasting.d.ts +0 -11
- package/dist/packages/dca/api/dcaApiCasting.d.ts.map +0 -1
- package/dist/packages/dca/api/dcaApiCasting.js +0 -186
- package/dist/packages/dca/api/dcaApiCastingTypes.d.ts +0 -142
- package/dist/packages/dca/api/dcaApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/oracle/api/oracleApi.d.ts +0 -21
- package/dist/packages/oracle/api/oracleApi.d.ts.map +0 -1
- package/dist/packages/oracle/api/oracleApi.js +0 -76
- package/dist/packages/oracle/api/oracleApiCasting.d.ts +0 -6
- package/dist/packages/oracle/api/oracleApiCasting.d.ts.map +0 -1
- package/dist/packages/oracle/api/oracleApiCasting.js +0 -25
- package/dist/packages/oracle/oracle.d.ts +0 -15
- package/dist/packages/oracle/oracle.d.ts.map +0 -1
- package/dist/packages/oracle/oracle.js +0 -46
- package/dist/packages/oracle/oracleCastingTypes.d.ts +0 -11
- package/dist/packages/oracle/oracleCastingTypes.d.ts.map +0 -1
- package/dist/packages/oracle/oracleCastingTypes.js +0 -2
- package/dist/packages/oracle/oracleTypes.d.ts +0 -10
- package/dist/packages/oracle/oracleTypes.d.ts.map +0 -1
- package/dist/packages/oracle/oracleTypes.js +0 -2
- /package/dist/{general/historicalData/historicalDataTypes.js → packages/limitOrders/limitOrdersTypes.js} +0 -0
- /package/dist/packages/{dca/api/dcaApiCastingTypes.js → userData/userDataTypes.js} +0 -0
|
@@ -1,69 +1,204 @@
|
|
|
1
1
|
import { Caller } from "../../general/utils/caller";
|
|
2
|
-
import { Balance, CallerConfig, CoinType, CoinsToBalance, FarmsStakedPositionObject, SuiAddress, Timestamp } from "../../types";
|
|
2
|
+
import { Balance, CallerConfig, CoinType, CoinsToBalance, FarmsStakedPositionObject, FarmsVersion, SuiAddress, Timestamp } from "../../types";
|
|
3
3
|
import { FarmsStakingPool } from "./farmsStakingPool";
|
|
4
4
|
import { AftermathApi } from "../../general/providers";
|
|
5
|
+
/**
|
|
6
|
+
* The `FarmsStakedPosition` class represents a user's individual staked position
|
|
7
|
+
* in a particular staking pool. It provides methods to query position details,
|
|
8
|
+
* calculate potential rewards, lock/unlock stake, and build transactions
|
|
9
|
+
* for depositing, unstaking, or harvesting rewards.
|
|
10
|
+
*/
|
|
5
11
|
export declare class FarmsStakedPosition extends Caller {
|
|
6
12
|
stakedPosition: FarmsStakedPositionObject;
|
|
7
|
-
|
|
13
|
+
readonly Provider?: AftermathApi | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The timestamp (in ms) when rewards were last harvested for this position, possibly overriding the
|
|
16
|
+
* on-chain data if provided in the constructor.
|
|
17
|
+
*/
|
|
8
18
|
readonly trueLastHarvestRewardsTimestamp: Timestamp;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a `FarmsStakedPosition` instance for a user's staked position in a farm.
|
|
21
|
+
*
|
|
22
|
+
* @param stakedPosition - The on-chain data object representing the user's staked position.
|
|
23
|
+
* @param trueLastHarvestRewardsTimestamp - Optionally overrides the last harvest time from the on-chain data.
|
|
24
|
+
* @param config - Optional configuration for the underlying `Caller`.
|
|
25
|
+
* @param Provider - Optional `AftermathApi` instance for transaction building.
|
|
26
|
+
*/
|
|
9
27
|
constructor(stakedPosition: FarmsStakedPositionObject, trueLastHarvestRewardsTimestamp?: Timestamp | undefined, config?: CallerConfig, Provider?: AftermathApi | undefined);
|
|
28
|
+
/**
|
|
29
|
+
* Returns the version of the farm system that this position belongs to (1 or 2).
|
|
30
|
+
*/
|
|
31
|
+
version: () => FarmsVersion;
|
|
32
|
+
/**
|
|
33
|
+
* Checks whether the position is still locked, based on the current time and the lock parameters.
|
|
34
|
+
*
|
|
35
|
+
* @param inputs - Contains a `FarmsStakingPool` instance to check for system constraints.
|
|
36
|
+
* @returns `true` if the position is locked; otherwise, `false`.
|
|
37
|
+
*/
|
|
10
38
|
isLocked: (inputs: {
|
|
11
39
|
stakingPool: FarmsStakingPool;
|
|
12
40
|
}) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Checks whether the position has a non-zero lock duration.
|
|
43
|
+
*
|
|
44
|
+
* @returns `true` if the position was created with a lock duration > 0.
|
|
45
|
+
*/
|
|
13
46
|
isLockDuration: () => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Computes the timestamp (in ms) at which this position's lock will end.
|
|
49
|
+
*
|
|
50
|
+
* @returns The unlock timestamp (lock start + lock duration).
|
|
51
|
+
*/
|
|
14
52
|
unlockTimestamp: () => number;
|
|
53
|
+
/**
|
|
54
|
+
* Computes the user's accrued rewards for each reward coin in this position,
|
|
55
|
+
* returned as a `CoinsToBalance` object keyed by coin type.
|
|
56
|
+
*
|
|
57
|
+
* @param inputs - Contains a reference to the `FarmsStakingPool`.
|
|
58
|
+
* @returns A mapping from `coinType` to the amount of earned rewards.
|
|
59
|
+
*/
|
|
15
60
|
rewardCoinsToClaimableBalance: (inputs: {
|
|
16
61
|
stakingPool: FarmsStakingPool;
|
|
17
62
|
}) => CoinsToBalance;
|
|
63
|
+
/**
|
|
64
|
+
* Lists all reward coin types associated with this position.
|
|
65
|
+
*
|
|
66
|
+
* @returns An array of `CoinType` strings representing the reward coins.
|
|
67
|
+
*/
|
|
18
68
|
rewardCoinTypes: () => CoinType[];
|
|
69
|
+
/**
|
|
70
|
+
* Returns only the reward coin types that currently have a non-zero claimable balance.
|
|
71
|
+
*
|
|
72
|
+
* @param inputs - Contains a reference to the `FarmsStakingPool`.
|
|
73
|
+
* @returns An array of `CoinType` strings that have pending rewards > 0.
|
|
74
|
+
*/
|
|
19
75
|
nonZeroRewardCoinTypes: (inputs: {
|
|
20
76
|
stakingPool: FarmsStakingPool;
|
|
21
77
|
}) => CoinType[];
|
|
78
|
+
/**
|
|
79
|
+
* Retrieves the reward coin record for a specific coin type in this position.
|
|
80
|
+
*
|
|
81
|
+
* @param inputs - Must contain a `coinType` string to look up.
|
|
82
|
+
* @throws If the coin type is not found in this position.
|
|
83
|
+
* @returns The reward coin object from the position.
|
|
84
|
+
*/
|
|
22
85
|
rewardCoin: (inputs: {
|
|
23
86
|
coinType: CoinType;
|
|
24
87
|
}) => import("./farmsTypes").FarmsStakedPositionRewardCoin;
|
|
88
|
+
/**
|
|
89
|
+
* Checks if this position has any claimable rewards across all reward coin types.
|
|
90
|
+
*
|
|
91
|
+
* @param inputs - Contains a reference to the `FarmsStakingPool`.
|
|
92
|
+
* @returns `true` if there are unclaimed rewards; otherwise, `false`.
|
|
93
|
+
*/
|
|
25
94
|
hasClaimableRewards: (inputs: {
|
|
26
95
|
stakingPool: FarmsStakingPool;
|
|
27
96
|
}) => boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Calculates the current amount of earned rewards for a specific coin type,
|
|
99
|
+
* factoring in any emission constraints and the pool's actual reward availability.
|
|
100
|
+
*
|
|
101
|
+
* @param inputs - Contains the `coinType` to check and a reference to the `FarmsStakingPool`.
|
|
102
|
+
* @returns The total `BigInt` amount of rewards earned for the specified coin type.
|
|
103
|
+
*/
|
|
28
104
|
rewardsEarned: (inputs: {
|
|
29
105
|
coinType: CoinType;
|
|
30
106
|
stakingPool: FarmsStakingPool;
|
|
31
|
-
}) =>
|
|
107
|
+
}) => Balance;
|
|
108
|
+
/**
|
|
109
|
+
* Updates the position's reward calculations based on the pool's current
|
|
110
|
+
* emission state, effectively "syncing" the on-chain logic into this local
|
|
111
|
+
* representation. Also checks if the lock duration has elapsed.
|
|
112
|
+
*
|
|
113
|
+
* @param inputs - Contains a reference to the `FarmsStakingPool`.
|
|
114
|
+
* @remarks This method is typically called before computing `rewardsEarned()`.
|
|
115
|
+
*/
|
|
32
116
|
updatePosition: (inputs: {
|
|
33
117
|
stakingPool: FarmsStakingPool;
|
|
34
118
|
}) => void;
|
|
119
|
+
/**
|
|
120
|
+
* Builds a transaction to deposit additional principal into this staked position.
|
|
121
|
+
*
|
|
122
|
+
* @param inputs - Contains `depositAmount`, the `walletAddress` performing the deposit, and optional sponsorship.
|
|
123
|
+
* @returns A transaction object (or bytes) that can be signed and executed to increase stake.
|
|
124
|
+
*/
|
|
35
125
|
getDepositPrincipalTransaction(inputs: {
|
|
36
126
|
depositAmount: Balance;
|
|
37
127
|
walletAddress: SuiAddress;
|
|
38
128
|
isSponsoredTx?: boolean;
|
|
39
129
|
}): Promise<import("@mysten/sui/transactions").Transaction>;
|
|
130
|
+
/**
|
|
131
|
+
* Builds a transaction to unstake this entire position, optionally claiming SUI as afSUI.
|
|
132
|
+
*
|
|
133
|
+
* @param inputs - Contains `walletAddress`, the `FarmsStakingPool` reference, and optional `claimSuiAsAfSui`.
|
|
134
|
+
* @returns A transaction that can be signed and executed to fully withdraw principal and possibly rewards.
|
|
135
|
+
*/
|
|
40
136
|
getUnstakeTransaction(inputs: {
|
|
41
137
|
walletAddress: SuiAddress;
|
|
42
138
|
stakingPool: FarmsStakingPool;
|
|
43
139
|
claimSuiAsAfSui?: boolean;
|
|
44
140
|
}): Promise<import("@mysten/sui/transactions").Transaction>;
|
|
141
|
+
/**
|
|
142
|
+
* Builds a transaction to lock this position for a specified duration, increasing its lock multiplier (if any).
|
|
143
|
+
*
|
|
144
|
+
* @param inputs - Contains the `lockDurationMs` and the `walletAddress`.
|
|
145
|
+
* @returns A transaction that can be signed and executed to lock the position.
|
|
146
|
+
*/
|
|
45
147
|
getLockTransaction(inputs: {
|
|
46
148
|
lockDurationMs: Timestamp;
|
|
47
149
|
walletAddress: SuiAddress;
|
|
48
150
|
}): Promise<import("@mysten/sui/transactions").Transaction>;
|
|
151
|
+
/**
|
|
152
|
+
* Builds a transaction to re-lock this position (renew lock duration) at the current multiplier.
|
|
153
|
+
*
|
|
154
|
+
* @param inputs - Contains the `walletAddress`.
|
|
155
|
+
* @returns A transaction that can be signed and executed to extend or refresh the lock.
|
|
156
|
+
*/
|
|
49
157
|
getRenewLockTransaction(inputs: {
|
|
50
158
|
walletAddress: SuiAddress;
|
|
51
159
|
}): Promise<import("@mysten/sui/transactions").Transaction>;
|
|
160
|
+
/**
|
|
161
|
+
* Builds a transaction to unlock this position, removing any lock-based multiplier.
|
|
162
|
+
*
|
|
163
|
+
* @param inputs - Contains the `walletAddress`.
|
|
164
|
+
* @returns A transaction that can be signed and executed to unlock the position immediately.
|
|
165
|
+
*/
|
|
52
166
|
getUnlockTransaction(inputs: {
|
|
53
167
|
walletAddress: SuiAddress;
|
|
54
168
|
}): Promise<import("@mysten/sui/transactions").Transaction>;
|
|
169
|
+
/**
|
|
170
|
+
* Builds a transaction to harvest (claim) the rewards from this position,
|
|
171
|
+
* optionally receiving SUI as afSUI.
|
|
172
|
+
*
|
|
173
|
+
* @param inputs - Includes the `walletAddress`, the `FarmsStakingPool`, and optional `claimSuiAsAfSui`.
|
|
174
|
+
* @returns A transaction that can be signed and executed to claim accrued rewards.
|
|
175
|
+
*/
|
|
55
176
|
getHarvestRewardsTransaction(inputs: {
|
|
56
177
|
walletAddress: SuiAddress;
|
|
57
178
|
stakingPool: FarmsStakingPool;
|
|
58
179
|
claimSuiAsAfSui?: boolean;
|
|
59
180
|
}): Promise<import("@mysten/sui/transactions").Transaction>;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
181
|
+
/**
|
|
182
|
+
* Calculates the total base + multiplier rewards from time t0 for this position,
|
|
183
|
+
* ensuring that multiplier rewards only apply during the locked period.
|
|
184
|
+
*
|
|
185
|
+
* @param inputs - Contains updated `rewardsAccumulatedPerShare`, the position’s `multiplierRewardsDebt`, and the pool’s `emissionEndTimestamp`.
|
|
186
|
+
* @returns A tuple `[baseRewards, multiplierRewards]`.
|
|
187
|
+
*/
|
|
188
|
+
private calcTotalRewardsFromTimeT0;
|
|
189
|
+
/**
|
|
190
|
+
* Removes the lock multiplier from this position if the current time is beyond the lock duration,
|
|
191
|
+
* reverting `lockMultiplier` to 1.0 (fixedOneB).
|
|
192
|
+
*/
|
|
65
193
|
private unlock;
|
|
194
|
+
/**
|
|
195
|
+
* Determines if this position is unlocked based on the lock end timestamp, the emission end timestamp,
|
|
196
|
+
* or a forced unlock condition in the pool.
|
|
197
|
+
*/
|
|
66
198
|
private isUnlocked;
|
|
199
|
+
/**
|
|
200
|
+
* Provides access to the `Farms` provider in the `AftermathApi`.
|
|
201
|
+
*/
|
|
67
202
|
private useProvider;
|
|
68
203
|
}
|
|
69
204
|
//# sourceMappingURL=farmsStakedPosition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"farmsStakedPosition.d.ts","sourceRoot":"","sources":["../../../src/packages/farms/farmsStakedPosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAQN,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,yBAAyB,EACzB,UAAU,EAEV,SAAS,EAET,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;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