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.
Files changed (216) hide show
  1. package/README.md +61 -27
  2. package/dist/general/apiHelpers/eventsApiHelpers.d.ts +1 -1
  3. package/dist/general/apiHelpers/eventsApiHelpers.d.ts.map +1 -1
  4. package/dist/general/apiHelpers/eventsApiHelpers.js +4 -1
  5. package/dist/general/apiHelpers/transactionsApiHelpers.d.ts +6 -0
  6. package/dist/general/apiHelpers/transactionsApiHelpers.d.ts.map +1 -1
  7. package/dist/general/apiHelpers/transactionsApiHelpers.js +46 -0
  8. package/dist/general/dynamicGas/dynamicGas.d.ts +34 -0
  9. package/dist/general/dynamicGas/dynamicGas.d.ts.map +1 -1
  10. package/dist/general/dynamicGas/dynamicGas.js +34 -0
  11. package/dist/general/dynamicGas/dynamicGasTypes.d.ts +25 -0
  12. package/dist/general/dynamicGas/dynamicGasTypes.d.ts.map +1 -1
  13. package/dist/general/prices/coinGeckoTypes.d.ts +2 -0
  14. package/dist/general/prices/coinGeckoTypes.d.ts.map +1 -1
  15. package/dist/general/prices/prices.d.ts +73 -0
  16. package/dist/general/prices/prices.d.ts.map +1 -1
  17. package/dist/general/prices/prices.js +73 -0
  18. package/dist/general/providers/aftermath.d.ts +107 -27
  19. package/dist/general/providers/aftermath.d.ts.map +1 -1
  20. package/dist/general/providers/aftermath.js +110 -30
  21. package/dist/general/providers/aftermathApi.d.ts +128 -10
  22. package/dist/general/providers/aftermathApi.d.ts.map +1 -1
  23. package/dist/general/providers/aftermathApi.js +133 -14
  24. package/dist/general/types/castingTypes.d.ts +15 -7
  25. package/dist/general/types/castingTypes.d.ts.map +1 -1
  26. package/dist/general/types/castingTypes.js +6 -0
  27. package/dist/general/types/configTypes.d.ts +14 -9
  28. package/dist/general/types/configTypes.d.ts.map +1 -1
  29. package/dist/general/types/generalTypes.d.ts +229 -7
  30. package/dist/general/types/generalTypes.d.ts.map +1 -1
  31. package/dist/general/types/moveErrorsInterface.d.ts +1 -1
  32. package/dist/general/types/moveErrorsInterface.d.ts.map +1 -1
  33. package/dist/general/types/suiTypes.d.ts +0 -16
  34. package/dist/general/types/suiTypes.d.ts.map +1 -1
  35. package/dist/general/types/suiTypes.js +3 -25
  36. package/dist/general/utils/caller.d.ts +5 -2
  37. package/dist/general/utils/caller.d.ts.map +1 -1
  38. package/dist/general/utils/caller.js +9 -1
  39. package/dist/general/utils/casting.d.ts +156 -7
  40. package/dist/general/utils/casting.d.ts.map +1 -1
  41. package/dist/general/utils/casting.js +159 -20
  42. package/dist/general/utils/fixedUtils.d.ts +89 -2
  43. package/dist/general/utils/fixedUtils.d.ts.map +1 -1
  44. package/dist/general/utils/fixedUtils.js +81 -4
  45. package/dist/general/utils/helpers.d.ts +327 -10
  46. package/dist/general/utils/helpers.d.ts.map +1 -1
  47. package/dist/general/utils/helpers.js +409 -91
  48. package/dist/general/utils/iFixedUtils.d.ts +64 -0
  49. package/dist/general/utils/iFixedUtils.d.ts.map +1 -1
  50. package/dist/general/utils/iFixedUtils.js +64 -0
  51. package/dist/general/wallet/wallet.d.ts +76 -1
  52. package/dist/general/wallet/wallet.d.ts.map +1 -1
  53. package/dist/general/wallet/wallet.js +75 -5
  54. package/dist/packages/auth/auth.d.ts +113 -4
  55. package/dist/packages/auth/auth.d.ts.map +1 -1
  56. package/dist/packages/auth/auth.js +190 -59
  57. package/dist/packages/auth/authTypes.d.ts +66 -0
  58. package/dist/packages/auth/authTypes.d.ts.map +1 -1
  59. package/dist/packages/coin/api/coinApi.d.ts.map +1 -1
  60. package/dist/packages/coin/api/coinApi.js +29 -20
  61. package/dist/packages/coin/coin.d.ts +256 -1
  62. package/dist/packages/coin/coin.d.ts.map +1 -1
  63. package/dist/packages/coin/coin.js +246 -15
  64. package/dist/packages/coin/coinTypes.d.ts +95 -0
  65. package/dist/packages/coin/coinTypes.d.ts.map +1 -1
  66. package/dist/packages/dca/api/dcaApi.d.ts +2 -0
  67. package/dist/packages/dca/api/dcaApi.d.ts.map +1 -1
  68. package/dist/packages/dca/api/dcaApi.js +6 -3
  69. package/dist/packages/dca/dca.d.ts +125 -35
  70. package/dist/packages/dca/dca.d.ts.map +1 -1
  71. package/dist/packages/dca/dca.js +135 -43
  72. package/dist/packages/dca/dcaTypes.d.ts +217 -42
  73. package/dist/packages/dca/dcaTypes.d.ts.map +1 -1
  74. package/dist/packages/farms/api/farmsApi.d.ts +725 -58
  75. package/dist/packages/farms/api/farmsApi.d.ts.map +1 -1
  76. package/dist/packages/farms/api/farmsApi.js +1149 -153
  77. package/dist/packages/farms/api/farmsApiCasting.d.ts +34 -18
  78. package/dist/packages/farms/api/farmsApiCasting.d.ts.map +1 -1
  79. package/dist/packages/farms/api/farmsApiCasting.js +218 -17
  80. package/dist/packages/farms/api/farmsApiCastingTypes.d.ts +117 -21
  81. package/dist/packages/farms/api/farmsApiCastingTypes.d.ts.map +1 -1
  82. package/dist/packages/farms/farms.d.ts +188 -3
  83. package/dist/packages/farms/farms.d.ts.map +1 -1
  84. package/dist/packages/farms/farms.js +192 -12
  85. package/dist/packages/farms/farmsStakedPosition.d.ts +143 -8
  86. package/dist/packages/farms/farmsStakedPosition.d.ts.map +1 -1
  87. package/dist/packages/farms/farmsStakedPosition.js +243 -137
  88. package/dist/packages/farms/farmsStakingPool.d.ts +169 -3
  89. package/dist/packages/farms/farmsStakingPool.d.ts.map +1 -1
  90. package/dist/packages/farms/farmsStakingPool.js +212 -70
  91. package/dist/packages/farms/farmsTypes.d.ts +302 -2
  92. package/dist/packages/farms/farmsTypes.d.ts.map +1 -1
  93. package/dist/packages/farms/farmsTypes.js +18 -0
  94. package/dist/packages/faucet/api/faucetApi.d.ts +9 -17
  95. package/dist/packages/faucet/api/faucetApi.d.ts.map +1 -1
  96. package/dist/packages/faucet/api/faucetApi.js +44 -49
  97. package/dist/packages/faucet/api/faucetApiCasting.d.ts.map +1 -1
  98. package/dist/packages/faucet/api/faucetApiCasting.js +8 -5
  99. package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts +1 -4
  100. package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts.map +1 -1
  101. package/dist/packages/faucet/faucet.d.ts +1 -1
  102. package/dist/packages/faucet/faucet.d.ts.map +1 -1
  103. package/dist/packages/faucet/faucet.js +1 -1
  104. package/dist/packages/faucet/faucetTypes.d.ts +2 -3
  105. package/dist/packages/faucet/faucetTypes.d.ts.map +1 -1
  106. package/dist/packages/limitOrders/api/limitOrdersApi.d.ts +12 -0
  107. package/dist/packages/limitOrders/api/limitOrdersApi.d.ts.map +1 -0
  108. package/dist/packages/limitOrders/api/limitOrdersApi.js +25 -0
  109. package/dist/packages/limitOrders/index.d.ts +2 -0
  110. package/dist/packages/limitOrders/index.d.ts.map +1 -0
  111. package/dist/packages/limitOrders/index.js +17 -0
  112. package/dist/packages/limitOrders/limitOrders.d.ts +143 -0
  113. package/dist/packages/limitOrders/limitOrders.d.ts.map +1 -0
  114. package/dist/packages/limitOrders/limitOrders.js +190 -0
  115. package/dist/packages/limitOrders/limitOrdersTypes.d.ts +211 -0
  116. package/dist/packages/limitOrders/limitOrdersTypes.d.ts.map +1 -0
  117. package/dist/packages/multisig/multisig.d.ts +34 -5
  118. package/dist/packages/multisig/multisig.d.ts.map +1 -1
  119. package/dist/packages/multisig/multisig.js +33 -4
  120. package/dist/packages/multisig/multisigTypes.d.ts +17 -0
  121. package/dist/packages/multisig/multisigTypes.d.ts.map +1 -1
  122. package/dist/packages/nftAmm/nftAmm.d.ts +1 -1
  123. package/dist/packages/nftAmm/nftAmm.d.ts.map +1 -1
  124. package/dist/packages/perpetuals/api/perpetualsApi.d.ts +7 -16
  125. package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +1 -1
  126. package/dist/packages/perpetuals/api/perpetualsApi.js +318 -276
  127. package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts +7 -7
  128. package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts.map +1 -1
  129. package/dist/packages/perpetuals/api/perpetualsApiCasting.js +71 -84
  130. package/dist/packages/perpetuals/perpetuals.d.ts +33 -4
  131. package/dist/packages/perpetuals/perpetuals.d.ts.map +1 -1
  132. package/dist/packages/perpetuals/perpetuals.js +105 -18
  133. package/dist/packages/perpetuals/perpetualsAccount.d.ts +87 -52
  134. package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +1 -1
  135. package/dist/packages/perpetuals/perpetualsAccount.js +544 -91
  136. package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts +55 -26
  137. package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts.map +1 -1
  138. package/dist/packages/perpetuals/perpetualsMarket.d.ts +28 -4
  139. package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +1 -1
  140. package/dist/packages/perpetuals/perpetualsMarket.js +75 -13
  141. package/dist/packages/perpetuals/perpetualsTypes.d.ts +263 -213
  142. package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +1 -1
  143. package/dist/packages/perpetuals/perpetualsTypes.js +24 -77
  144. package/dist/packages/pools/pool.d.ts +328 -86
  145. package/dist/packages/pools/pool.d.ts.map +1 -1
  146. package/dist/packages/pools/pool.js +333 -91
  147. package/dist/packages/pools/pools.d.ts +300 -38
  148. package/dist/packages/pools/pools.d.ts.map +1 -1
  149. package/dist/packages/pools/pools.js +306 -52
  150. package/dist/packages/pools/poolsTypes.d.ts +267 -2
  151. package/dist/packages/pools/poolsTypes.d.ts.map +1 -1
  152. package/dist/packages/referralVault/referralVault.d.ts +38 -1
  153. package/dist/packages/referralVault/referralVault.d.ts.map +1 -1
  154. package/dist/packages/referralVault/referralVault.js +37 -0
  155. package/dist/packages/router/router.d.ts +213 -17
  156. package/dist/packages/router/router.d.ts.map +1 -1
  157. package/dist/packages/router/router.js +214 -18
  158. package/dist/packages/router/routerTypes.d.ts +199 -15
  159. package/dist/packages/router/routerTypes.d.ts.map +1 -1
  160. package/dist/packages/staking/staking.d.ts +302 -44
  161. package/dist/packages/staking/staking.d.ts.map +1 -1
  162. package/dist/packages/staking/staking.js +308 -51
  163. package/dist/packages/staking/stakingTypes.d.ts +426 -6
  164. package/dist/packages/staking/stakingTypes.d.ts.map +1 -1
  165. package/dist/packages/staking/stakingTypes.js +19 -0
  166. package/dist/packages/sui/sui.d.ts +40 -1
  167. package/dist/packages/sui/sui.d.ts.map +1 -1
  168. package/dist/packages/sui/sui.js +39 -0
  169. package/dist/packages/suiFrens/stakedSuiFren.d.ts +1 -1
  170. package/dist/packages/suiFrens/stakedSuiFren.d.ts.map +1 -1
  171. package/dist/packages/suiFrens/suiFren.d.ts +1 -1
  172. package/dist/packages/suiFrens/suiFren.d.ts.map +1 -1
  173. package/dist/packages/suiFrens/suiFrens.d.ts +1 -1
  174. package/dist/packages/suiFrens/suiFrens.d.ts.map +1 -1
  175. package/dist/packages/userData/api/userDataApi.d.ts +6 -0
  176. package/dist/packages/userData/api/userDataApi.d.ts.map +1 -0
  177. package/dist/packages/userData/api/userDataApi.js +12 -0
  178. package/dist/packages/userData/index.d.ts +2 -0
  179. package/dist/packages/userData/index.d.ts.map +1 -0
  180. package/dist/packages/userData/index.js +17 -0
  181. package/dist/packages/userData/userData.d.ts +89 -0
  182. package/dist/packages/userData/userData.d.ts.map +1 -0
  183. package/dist/packages/userData/userData.js +119 -0
  184. package/dist/packages/userData/userDataTypes.d.ts +29 -0
  185. package/dist/packages/userData/userDataTypes.d.ts.map +1 -0
  186. package/dist/types.d.ts +0 -1
  187. package/dist/types.d.ts.map +1 -1
  188. package/dist/types.js +0 -2
  189. package/package.json +1 -1
  190. package/dist/general/historicalData/historicalData.d.ts +0 -15
  191. package/dist/general/historicalData/historicalData.d.ts.map +0 -1
  192. package/dist/general/historicalData/historicalData.js +0 -45
  193. package/dist/general/historicalData/historicalDataTypes.d.ts +0 -10
  194. package/dist/general/historicalData/historicalDataTypes.d.ts.map +0 -1
  195. package/dist/packages/dca/api/dcaApiCasting.d.ts +0 -11
  196. package/dist/packages/dca/api/dcaApiCasting.d.ts.map +0 -1
  197. package/dist/packages/dca/api/dcaApiCasting.js +0 -186
  198. package/dist/packages/dca/api/dcaApiCastingTypes.d.ts +0 -142
  199. package/dist/packages/dca/api/dcaApiCastingTypes.d.ts.map +0 -1
  200. package/dist/packages/oracle/api/oracleApi.d.ts +0 -21
  201. package/dist/packages/oracle/api/oracleApi.d.ts.map +0 -1
  202. package/dist/packages/oracle/api/oracleApi.js +0 -76
  203. package/dist/packages/oracle/api/oracleApiCasting.d.ts +0 -6
  204. package/dist/packages/oracle/api/oracleApiCasting.d.ts.map +0 -1
  205. package/dist/packages/oracle/api/oracleApiCasting.js +0 -25
  206. package/dist/packages/oracle/oracle.d.ts +0 -15
  207. package/dist/packages/oracle/oracle.d.ts.map +0 -1
  208. package/dist/packages/oracle/oracle.js +0 -46
  209. package/dist/packages/oracle/oracleCastingTypes.d.ts +0 -11
  210. package/dist/packages/oracle/oracleCastingTypes.d.ts.map +0 -1
  211. package/dist/packages/oracle/oracleCastingTypes.js +0 -2
  212. package/dist/packages/oracle/oracleTypes.d.ts +0 -10
  213. package/dist/packages/oracle/oracleTypes.d.ts.map +0 -1
  214. package/dist/packages/oracle/oracleTypes.js +0 -2
  215. /package/dist/{general/historicalData/historicalDataTypes.js → packages/limitOrders/limitOrdersTypes.js} +0 -0
  216. /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
- private readonly Provider?;
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
- }) => bigint;
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
- calcTotalRewardsFromTimeT0(inputs: {
61
- rewardsAccumulatedPerShare: Balance;
62
- multiplierRewardsDebt: Balance;
63
- emissionEndTimestamp: Timestamp;
64
- }): [Balance, Balance];
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;AAMtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,qBAAa,mBAAoB,SAAQ,MAAM;IAYtC,cAAc,EAAE,yBAAyB;IAGhD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAV3B,SAAgB,+BAA+B,EAAE,SAAS,CAAC;gBAOnD,cAAc,EAAE,yBAAyB,EAChD,+BAA+B,GAAE,SAAS,GAAG,SAAqB,EAClE,MAAM,CAAC,EAAE,YAAY,EACJ,QAAQ,CAAC,0BAAc;IAiBlC,QAAQ,WAAY;QAAE,WAAW,EAAE,gBAAgB,CAAA;KAAE,KAAG,OAAO,CAEpE;IAEK,cAAc,QAAO,OAAO,CAEjC;IAEK,eAAe,QAAO,MAAM,CAKjC;IAEK,6BAA6B,WAAY;QAC/C,WAAW,EAAE,gBAAgB,CAAC;KAC9B,KAAG,cAAc,CAWhB;IAEK,eAAe,QAAO,QAAQ,EAAE,CAErC;IAEK,sBAAsB,WAAY;QACxC,WAAW,EAAE,gBAAgB,CAAC;KAC9B,KAAG,QAAQ,EAAE,CAIZ;IAEK,UAAU,WAAY;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,0DAOjD;IAEK,mBAAmB,WAAY;QACrC,WAAW,EAAE,gBAAgB,CAAC;KAC9B,KAAG,OAAO,CAaT;IAMK,aAAa,WAAY;QAC/B,QAAQ,EAAE,QAA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