aftermath-ts-sdk 1.3.1 → 1.3.12-perps.1
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/general/apiHelpers/dynamicFieldsApiHelpers.d.ts +10 -10
- package/dist/general/apiHelpers/dynamicFieldsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/dynamicFieldsApiHelpers.js +2 -2
- package/dist/general/apiHelpers/eventsApiHelpers.d.ts +3 -3
- package/dist/general/apiHelpers/eventsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/eventsApiHelpers.js +5 -5
- package/dist/general/apiHelpers/inspectionsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/objectsApiHelpers.d.ts +6 -6
- package/dist/general/apiHelpers/objectsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/objectsApiHelpers.js +6 -6
- package/dist/general/apiHelpers/transactionsApiHelpers.d.ts +5 -2
- package/dist/general/apiHelpers/transactionsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/transactionsApiHelpers.js +13 -1
- package/dist/general/nfts/nftsApi.d.ts.map +1 -1
- package/dist/general/nfts/nftsApiCasting.d.ts.map +1 -1
- package/dist/general/nfts/nftsApiCasting.js +1 -1
- package/dist/general/providers/aftermath.d.ts +0 -5
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +2 -7
- package/dist/general/providers/aftermathApi.d.ts +0 -6
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +0 -5
- package/dist/general/types/configTypes.d.ts +0 -10
- package/dist/general/types/configTypes.d.ts.map +1 -1
- package/dist/general/types/generalTypes.d.ts +1 -0
- 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/utils/caller.d.ts +5 -2
- package/dist/general/utils/caller.d.ts.map +1 -1
- package/dist/general/utils/caller.js +10 -2
- package/dist/general/utils/casting.d.ts +5 -6
- package/dist/general/utils/casting.d.ts.map +1 -1
- package/dist/general/utils/casting.js +4 -5
- package/dist/general/utils/fixedUtils.d.ts.map +1 -1
- package/dist/general/utils/helpers.d.ts +1 -0
- package/dist/general/utils/helpers.d.ts.map +1 -1
- package/dist/general/utils/helpers.js +49 -16
- package/dist/general/utils/iFixedUtils.d.ts.map +1 -1
- package/dist/general/wallet/wallet.d.ts +1 -1
- package/dist/general/wallet/wallet.d.ts.map +1 -1
- package/dist/general/wallet/walletApi.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApi.d.ts.map +1 -1
- package/dist/packages/coin/coin.d.ts +1 -1
- package/dist/packages/coin/coin.d.ts.map +1 -1
- package/dist/packages/coin/coin.js +5 -3
- package/dist/packages/dca/api/dcaApi.d.ts.map +1 -1
- package/dist/packages/dca/api/dcaApi.js +3 -1
- package/dist/packages/farms/api/farmsApi.d.ts +33 -29
- package/dist/packages/farms/api/farmsApi.d.ts.map +1 -1
- package/dist/packages/farms/api/farmsApi.js +116 -114
- package/dist/packages/farms/api/farmsApiCasting.d.ts.map +1 -1
- package/dist/packages/farms/farms.d.ts +1 -1
- package/dist/packages/farms/farms.d.ts.map +1 -1
- package/dist/packages/farms/farms.js +2 -2
- package/dist/packages/farms/farmsStakedPosition.d.ts +1 -1
- package/dist/packages/farms/farmsStakedPosition.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakedPosition.js +4 -4
- package/dist/packages/farms/farmsStakingPool.d.ts +1 -1
- package/dist/packages/farms/farmsStakingPool.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakingPool.js +4 -4
- package/dist/packages/farms/farmsTypes.d.ts.map +1 -1
- 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 +46 -51
- 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/leveragedStaking/api/leveragedStakingApi.d.ts +1 -1
- package/dist/packages/leveragedStaking/api/leveragedStakingApi.d.ts.map +1 -1
- package/dist/packages/leveragedStaking/api/leveragedStakingApi.js +42 -42
- package/dist/packages/leveragedStaking/api/leveragedStakingApiCasting.d.ts.map +1 -1
- package/dist/packages/leveragedStaking/leveragedStaking.d.ts.map +1 -1
- package/dist/packages/leveragedStaking/leveragedStakingTypes.d.ts.map +1 -1
- package/dist/packages/multisig/multisig.d.ts +1 -1
- package/dist/packages/multisig/multisig.d.ts.map +1 -1
- package/dist/packages/nftAmm/api/nftAmmApi.d.ts.map +1 -1
- package/dist/packages/nftAmm/api/nftAmmApiCasting.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/nftAmm/nftAmmMarket.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts +11 -204
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApi.js +923 -614
- package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts +11 -18
- package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApiCasting.js +199 -190
- package/dist/packages/perpetuals/perpetuals.d.ts +39 -5
- package/dist/packages/perpetuals/perpetuals.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetuals.js +100 -19
- package/dist/packages/perpetuals/perpetualsAccount.d.ts +108 -79
- package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsAccount.js +332 -119
- package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts +78 -148
- package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsMarket.d.ts +29 -6
- package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsMarket.js +78 -16
- package/dist/packages/perpetuals/perpetualsTypes.d.ts +341 -260
- package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsTypes.js +17 -77
- package/dist/packages/perpetuals/utils/perpetualsOrderUtils.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApi.d.ts +2 -2
- package/dist/packages/pools/api/poolsApi.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApi.js +8 -8
- package/dist/packages/pools/api/poolsApiCasting.d.ts.map +1 -1
- package/dist/packages/pools/pool.d.ts +1 -1
- package/dist/packages/pools/pool.d.ts.map +1 -1
- package/dist/packages/pools/pool.js +2 -2
- package/dist/packages/pools/pools.d.ts +1 -1
- package/dist/packages/pools/pools.d.ts.map +1 -1
- package/dist/packages/pools/utils/cmmmCalculations.d.ts.map +1 -1
- package/dist/packages/pools/utils/cmmmCalculations.js +60 -60
- package/dist/packages/referralVault/api/referralVaultApi.d.ts.map +1 -1
- package/dist/packages/referralVault/referralVault.d.ts +1 -1
- package/dist/packages/referralVault/referralVault.d.ts.map +1 -1
- package/dist/packages/router/api/routerApiCasting.d.ts.map +1 -1
- package/dist/packages/router/router.d.ts.map +1 -1
- package/dist/packages/staking/api/stakingApi.d.ts +1 -1
- package/dist/packages/staking/api/stakingApi.d.ts.map +1 -1
- package/dist/packages/staking/api/stakingApi.js +50 -50
- package/dist/packages/staking/api/stakingApiCasting.d.ts.map +1 -1
- package/dist/packages/staking/staking.d.ts +1 -1
- package/dist/packages/staking/staking.d.ts.map +1 -1
- package/dist/packages/staking/staking.js +2 -2
- package/dist/packages/staking/stakingTypes.d.ts +1 -1
- package/dist/packages/staking/stakingTypes.d.ts.map +1 -1
- package/dist/packages/sui/api/suiApi.d.ts.map +1 -1
- package/dist/packages/sui/sui.d.ts +1 -1
- package/dist/packages/sui/sui.d.ts.map +1 -1
- package/dist/packages/suiFrens/api/suiFrensApi.d.ts +2 -2
- package/dist/packages/suiFrens/api/suiFrensApi.d.ts.map +1 -1
- package/dist/packages/suiFrens/api/suiFrensApi.js +35 -35
- package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts.map +1 -1
- 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/suiFrens/suiFrens.js +3 -3
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -1
- package/package.json +7 -8
- 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
|
@@ -125,11 +125,11 @@ class FarmsApi {
|
|
|
125
125
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "stake"),
|
|
126
126
|
typeArguments: [inputs.stakeCoinType],
|
|
127
127
|
arguments: [
|
|
128
|
-
tx.object(inputs.stakingPoolId),
|
|
129
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
128
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
129
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
130
130
|
typeof stakeCoinId === "string"
|
|
131
131
|
? tx.object(stakeCoinId)
|
|
132
|
-
: stakeCoinId,
|
|
132
|
+
: stakeCoinId, // Coin
|
|
133
133
|
tx.pure.u64(inputs.lockDurationMs),
|
|
134
134
|
],
|
|
135
135
|
});
|
|
@@ -145,13 +145,13 @@ class FarmsApi {
|
|
|
145
145
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "stake"),
|
|
146
146
|
typeArguments: [inputs.stakeCoinType],
|
|
147
147
|
arguments: [
|
|
148
|
-
tx.object(inputs.stakingPoolId),
|
|
149
|
-
tx.object(this.addresses.objects.version),
|
|
150
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
148
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
149
|
+
tx.object(this.addresses.objects.version), // Version
|
|
150
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
151
151
|
typeof stakeCoinId === "string"
|
|
152
152
|
? tx.object(stakeCoinId)
|
|
153
|
-
: stakeCoinId,
|
|
154
|
-
tx.pure.u8(inputs.lockEnforcement === "Strict" ? 0 : 1),
|
|
153
|
+
: stakeCoinId, // Coin
|
|
154
|
+
tx.pure.u8(inputs.lockEnforcement === "Strict" ? 0 : 1), // lock_enforcement
|
|
155
155
|
tx.pure.u64(inputs.lockDurationMs), // lock_duration_ms
|
|
156
156
|
],
|
|
157
157
|
});
|
|
@@ -168,9 +168,9 @@ class FarmsApi {
|
|
|
168
168
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "deposit_principal"),
|
|
169
169
|
typeArguments: [inputs.stakeCoinType],
|
|
170
170
|
arguments: [
|
|
171
|
-
tx.object(inputs.stakedPositionId),
|
|
172
|
-
tx.object(inputs.stakingPoolId),
|
|
173
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
171
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
172
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
173
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
174
174
|
typeof stakeCoinId === "string"
|
|
175
175
|
? tx.object(stakeCoinId)
|
|
176
176
|
: stakeCoinId, // Coin
|
|
@@ -188,10 +188,10 @@ class FarmsApi {
|
|
|
188
188
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "deposit_principal"),
|
|
189
189
|
typeArguments: [inputs.stakeCoinType],
|
|
190
190
|
arguments: [
|
|
191
|
-
tx.object(inputs.stakedPositionId),
|
|
192
|
-
tx.object(inputs.stakingPoolId),
|
|
193
|
-
tx.object(this.addresses.objects.version),
|
|
194
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
191
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
192
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
193
|
+
tx.object(this.addresses.objects.version), // Version
|
|
194
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
195
195
|
typeof stakeCoinId === "string"
|
|
196
196
|
? tx.object(stakeCoinId)
|
|
197
197
|
: stakeCoinId, // Coin
|
|
@@ -210,9 +210,9 @@ class FarmsApi {
|
|
|
210
210
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "withdraw_principal"),
|
|
211
211
|
typeArguments: [inputs.stakeCoinType],
|
|
212
212
|
arguments: [
|
|
213
|
-
tx.object(inputs.stakedPositionId),
|
|
214
|
-
tx.object(inputs.stakingPoolId),
|
|
215
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
213
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
214
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
215
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
216
216
|
tx.pure.u64(inputs.withdrawAmount),
|
|
217
217
|
],
|
|
218
218
|
});
|
|
@@ -228,10 +228,10 @@ class FarmsApi {
|
|
|
228
228
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "withdraw_principal"),
|
|
229
229
|
typeArguments: [inputs.stakeCoinType],
|
|
230
230
|
arguments: [
|
|
231
|
-
tx.object(inputs.stakedPositionId),
|
|
232
|
-
tx.object(inputs.stakingPoolId),
|
|
233
|
-
tx.object(this.addresses.objects.version),
|
|
234
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
231
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
232
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
233
|
+
tx.object(this.addresses.objects.version), // Version
|
|
234
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
235
235
|
tx.pure.u64(inputs.withdrawAmount),
|
|
236
236
|
],
|
|
237
237
|
});
|
|
@@ -248,8 +248,8 @@ class FarmsApi {
|
|
|
248
248
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "destroy"),
|
|
249
249
|
typeArguments: [inputs.stakeCoinType],
|
|
250
250
|
arguments: [
|
|
251
|
-
tx.object(inputs.stakedPositionId),
|
|
252
|
-
tx.object(inputs.stakingPoolId),
|
|
251
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
252
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
253
253
|
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
254
254
|
],
|
|
255
255
|
});
|
|
@@ -265,7 +265,7 @@ class FarmsApi {
|
|
|
265
265
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "destroy"),
|
|
266
266
|
typeArguments: [inputs.stakeCoinType],
|
|
267
267
|
arguments: [
|
|
268
|
-
tx.object(inputs.stakedPositionId),
|
|
268
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
269
269
|
tx.object(this.addresses.objects.version), // Version
|
|
270
270
|
],
|
|
271
271
|
});
|
|
@@ -282,8 +282,8 @@ class FarmsApi {
|
|
|
282
282
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "update_position"),
|
|
283
283
|
typeArguments: [inputs.stakeCoinType],
|
|
284
284
|
arguments: [
|
|
285
|
-
tx.object(inputs.stakedPositionId),
|
|
286
|
-
tx.object(inputs.stakingPoolId),
|
|
285
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
286
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
287
287
|
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
288
288
|
],
|
|
289
289
|
});
|
|
@@ -299,9 +299,9 @@ class FarmsApi {
|
|
|
299
299
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "update_position"),
|
|
300
300
|
typeArguments: [inputs.stakeCoinType],
|
|
301
301
|
arguments: [
|
|
302
|
-
tx.object(inputs.stakedPositionId),
|
|
303
|
-
tx.object(inputs.stakingPoolId),
|
|
304
|
-
tx.object(this.addresses.objects.version),
|
|
302
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
303
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
304
|
+
tx.object(this.addresses.objects.version), // Version
|
|
305
305
|
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
306
306
|
],
|
|
307
307
|
});
|
|
@@ -321,9 +321,9 @@ class FarmsApi {
|
|
|
321
321
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "lock"),
|
|
322
322
|
typeArguments: [inputs.stakeCoinType],
|
|
323
323
|
arguments: [
|
|
324
|
-
tx.object(inputs.stakedPositionId),
|
|
325
|
-
tx.object(inputs.stakingPoolId),
|
|
326
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
324
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
325
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
326
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
327
327
|
tx.pure.u64(inputs.lockDurationMs),
|
|
328
328
|
],
|
|
329
329
|
});
|
|
@@ -339,10 +339,10 @@ class FarmsApi {
|
|
|
339
339
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "lock"),
|
|
340
340
|
typeArguments: [inputs.stakeCoinType],
|
|
341
341
|
arguments: [
|
|
342
|
-
tx.object(inputs.stakedPositionId),
|
|
343
|
-
tx.object(inputs.stakingPoolId),
|
|
344
|
-
tx.object(this.addresses.objects.version),
|
|
345
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
342
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
343
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
344
|
+
tx.object(this.addresses.objects.version), // Version
|
|
345
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
346
346
|
tx.pure.u64(inputs.lockDurationMs),
|
|
347
347
|
],
|
|
348
348
|
});
|
|
@@ -359,8 +359,8 @@ class FarmsApi {
|
|
|
359
359
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "renew_lock"),
|
|
360
360
|
typeArguments: [inputs.stakeCoinType],
|
|
361
361
|
arguments: [
|
|
362
|
-
tx.object(inputs.stakedPositionId),
|
|
363
|
-
tx.object(inputs.stakingPoolId),
|
|
362
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
363
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
364
364
|
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
365
365
|
],
|
|
366
366
|
});
|
|
@@ -376,9 +376,9 @@ class FarmsApi {
|
|
|
376
376
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "renew_lock"),
|
|
377
377
|
typeArguments: [inputs.stakeCoinType],
|
|
378
378
|
arguments: [
|
|
379
|
-
tx.object(inputs.stakedPositionId),
|
|
380
|
-
tx.object(inputs.stakingPoolId),
|
|
381
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
379
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
380
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
381
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
382
382
|
tx.object(this.addresses.objects.version), // Version
|
|
383
383
|
],
|
|
384
384
|
});
|
|
@@ -395,8 +395,8 @@ class FarmsApi {
|
|
|
395
395
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "unlock"),
|
|
396
396
|
typeArguments: [inputs.stakeCoinType],
|
|
397
397
|
arguments: [
|
|
398
|
-
tx.object(inputs.stakedPositionId),
|
|
399
|
-
tx.object(inputs.stakingPoolId),
|
|
398
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
399
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
400
400
|
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
401
401
|
],
|
|
402
402
|
});
|
|
@@ -412,9 +412,9 @@ class FarmsApi {
|
|
|
412
412
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "unlock"),
|
|
413
413
|
typeArguments: [inputs.stakeCoinType],
|
|
414
414
|
arguments: [
|
|
415
|
-
tx.object(inputs.stakedPositionId),
|
|
416
|
-
tx.object(inputs.stakingPoolId),
|
|
417
|
-
tx.object(this.addresses.objects.version),
|
|
415
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
416
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
417
|
+
tx.object(this.addresses.objects.version), // Version
|
|
418
418
|
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
419
419
|
],
|
|
420
420
|
});
|
|
@@ -449,8 +449,8 @@ class FarmsApi {
|
|
|
449
449
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.stakedPosition, "begin_harvest_tx"),
|
|
450
450
|
typeArguments: [inputs.stakeCoinType],
|
|
451
451
|
arguments: [
|
|
452
|
-
tx.object(inputs.stakedPositionId),
|
|
453
|
-
tx.object(inputs.stakingPoolId),
|
|
452
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
453
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
454
454
|
tx.object(this.addresses.objects.version), // Version
|
|
455
455
|
],
|
|
456
456
|
});
|
|
@@ -467,11 +467,11 @@ class FarmsApi {
|
|
|
467
467
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.stakedPosition, "harvest_rewards"),
|
|
468
468
|
typeArguments: [inputs.stakeCoinType, inputs.rewardCoinType],
|
|
469
469
|
arguments: [
|
|
470
|
-
tx.object(inputs.stakedPositionId),
|
|
471
|
-
tx.object(inputs.stakingPoolId),
|
|
470
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
471
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
472
472
|
typeof harvestedRewardsEventMetadataId === "string"
|
|
473
473
|
? tx.object(harvestedRewardsEventMetadataId)
|
|
474
|
-
: harvestedRewardsEventMetadataId,
|
|
474
|
+
: harvestedRewardsEventMetadataId, // HarvestedRewardsEventMetadata
|
|
475
475
|
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
476
476
|
],
|
|
477
477
|
});
|
|
@@ -489,10 +489,10 @@ class FarmsApi {
|
|
|
489
489
|
arguments: [
|
|
490
490
|
typeof harvestRewardsCap === "string"
|
|
491
491
|
? tx.object(harvestRewardsCap)
|
|
492
|
-
: harvestRewardsCap,
|
|
493
|
-
tx.object(inputs.stakedPositionId),
|
|
494
|
-
tx.object(inputs.stakingPoolId),
|
|
495
|
-
tx.object(this.addresses.objects.version),
|
|
492
|
+
: harvestRewardsCap, // HarvestRewardsCap
|
|
493
|
+
tx.object(inputs.stakedPositionId), // StakedPosition
|
|
494
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
495
|
+
tx.object(this.addresses.objects.version), // Version
|
|
496
496
|
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
497
497
|
],
|
|
498
498
|
});
|
|
@@ -528,7 +528,7 @@ class FarmsApi {
|
|
|
528
528
|
arguments: [
|
|
529
529
|
typeof harvestRewardsCap === "string"
|
|
530
530
|
? tx.object(harvestRewardsCap)
|
|
531
|
-
: harvestRewardsCap,
|
|
531
|
+
: harvestRewardsCap, // HarvestRewardsCap
|
|
532
532
|
tx.object(this.addresses.objects.version), // Version
|
|
533
533
|
],
|
|
534
534
|
});
|
|
@@ -625,7 +625,7 @@ class FarmsApi {
|
|
|
625
625
|
arguments: [
|
|
626
626
|
typeof ownerCapId === "string"
|
|
627
627
|
? tx.object(ownerCapId)
|
|
628
|
-
: ownerCapId,
|
|
628
|
+
: ownerCapId, // OwnerCap
|
|
629
629
|
tx.pure.address(inputs.recipientAddress),
|
|
630
630
|
],
|
|
631
631
|
});
|
|
@@ -644,7 +644,7 @@ class FarmsApi {
|
|
|
644
644
|
arguments: [
|
|
645
645
|
typeof ownerCapId === "string"
|
|
646
646
|
? tx.object(ownerCapId)
|
|
647
|
-
: ownerCapId,
|
|
647
|
+
: ownerCapId, // OwnerCap
|
|
648
648
|
tx.pure.address(inputs.recipientAddress),
|
|
649
649
|
],
|
|
650
650
|
});
|
|
@@ -662,8 +662,8 @@ class FarmsApi {
|
|
|
662
662
|
arguments: [
|
|
663
663
|
typeof ownerCapId === "string"
|
|
664
664
|
? tx.object(ownerCapId)
|
|
665
|
-
: ownerCapId,
|
|
666
|
-
tx.object(this.addresses.objects.version),
|
|
665
|
+
: ownerCapId, // OwnerCap
|
|
666
|
+
tx.object(this.addresses.objects.version), // Version
|
|
667
667
|
tx.pure.address(inputs.recipientAddress),
|
|
668
668
|
],
|
|
669
669
|
});
|
|
@@ -687,12 +687,12 @@ class FarmsApi {
|
|
|
687
687
|
: "initialize_reward"),
|
|
688
688
|
typeArguments: [inputs.stakeCoinType, inputs.rewardCoinType],
|
|
689
689
|
arguments: [
|
|
690
|
-
tx.object(capId),
|
|
691
|
-
tx.object(inputs.stakingPoolId),
|
|
692
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
690
|
+
tx.object(capId), // OwnerCap / OneTimeAdminCap
|
|
691
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
692
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
693
693
|
typeof rewardCoinId === "string"
|
|
694
694
|
? tx.object(rewardCoinId)
|
|
695
|
-
: rewardCoinId,
|
|
695
|
+
: rewardCoinId, // Coin
|
|
696
696
|
tx.pure.u64(inputs.emissionScheduleMs),
|
|
697
697
|
tx.pure.u64(inputs.emissionRate),
|
|
698
698
|
tx.pure.u64(inputs.emissionDelayTimestampMs),
|
|
@@ -714,13 +714,13 @@ class FarmsApi {
|
|
|
714
714
|
: "initialize_reward"),
|
|
715
715
|
typeArguments: [inputs.stakeCoinType, inputs.rewardCoinType],
|
|
716
716
|
arguments: [
|
|
717
|
-
tx.object(capId),
|
|
718
|
-
tx.object(inputs.stakingPoolId),
|
|
719
|
-
tx.object(this.addresses.objects.version),
|
|
720
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
717
|
+
tx.object(capId), // OwnerCap / OneTimeAdminCap
|
|
718
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
719
|
+
tx.object(this.addresses.objects.version), // Version
|
|
720
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
721
721
|
typeof rewardCoinId === "string"
|
|
722
722
|
? tx.object(rewardCoinId)
|
|
723
|
-
: rewardCoinId,
|
|
723
|
+
: rewardCoinId, // Coin
|
|
724
724
|
tx.pure.u64(inputs.emissionScheduleMs),
|
|
725
725
|
tx.pure.u64(inputs.emissionRate),
|
|
726
726
|
tx.pure.u64(inputs.emissionDelayTimestampMs),
|
|
@@ -743,8 +743,8 @@ class FarmsApi {
|
|
|
743
743
|
: "add_reward"),
|
|
744
744
|
typeArguments: [inputs.stakeCoinType, inputs.rewardCoinType],
|
|
745
745
|
arguments: [
|
|
746
|
-
tx.object(capId),
|
|
747
|
-
tx.object(inputs.stakingPoolId),
|
|
746
|
+
tx.object(capId), // OwnerCap / OneTimeAdminCap
|
|
747
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
748
748
|
typeof rewardCoinId === "string"
|
|
749
749
|
? tx.object(rewardCoinId)
|
|
750
750
|
: rewardCoinId, // Coin
|
|
@@ -766,9 +766,9 @@ class FarmsApi {
|
|
|
766
766
|
: "add_reward"),
|
|
767
767
|
typeArguments: [inputs.stakeCoinType, inputs.rewardCoinType],
|
|
768
768
|
arguments: [
|
|
769
|
-
tx.object(capId),
|
|
770
|
-
tx.object(inputs.stakingPoolId),
|
|
771
|
-
tx.object(this.addresses.objects.version),
|
|
769
|
+
tx.object(capId), // OwnerCap / OneTimeAdminCap
|
|
770
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
771
|
+
tx.object(this.addresses.objects.version), // Version
|
|
772
772
|
typeof rewardCoinId === "string"
|
|
773
773
|
? tx.object(rewardCoinId)
|
|
774
774
|
: rewardCoinId, // Coin
|
|
@@ -787,9 +787,9 @@ class FarmsApi {
|
|
|
787
787
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.vaultV1, "update_emissions_for"),
|
|
788
788
|
typeArguments: [inputs.stakeCoinType, inputs.rewardCoinType],
|
|
789
789
|
arguments: [
|
|
790
|
-
tx.object(inputs.ownerCapId),
|
|
791
|
-
tx.object(inputs.stakingPoolId),
|
|
792
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
790
|
+
tx.object(inputs.ownerCapId), // OwnerCap
|
|
791
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
792
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
793
793
|
tx.pure.u64(inputs.emissionScheduleMs),
|
|
794
794
|
tx.pure.u64(inputs.emissionRate),
|
|
795
795
|
],
|
|
@@ -806,10 +806,10 @@ class FarmsApi {
|
|
|
806
806
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.vaultV2, "update_emission_schedule"),
|
|
807
807
|
typeArguments: [inputs.stakeCoinType, inputs.rewardCoinType],
|
|
808
808
|
arguments: [
|
|
809
|
-
tx.object(inputs.ownerCapId),
|
|
810
|
-
tx.object(inputs.stakingPoolId),
|
|
811
|
-
tx.object(this.addresses.objects.version),
|
|
812
|
-
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
809
|
+
tx.object(inputs.ownerCapId), // OwnerCap
|
|
810
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
811
|
+
tx.object(this.addresses.objects.version), // Version
|
|
812
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId), // Clock
|
|
813
813
|
tx.pure.u64(inputs.emissionScheduleMs),
|
|
814
814
|
tx.pure.u64(inputs.emissionRate),
|
|
815
815
|
],
|
|
@@ -827,8 +827,8 @@ class FarmsApi {
|
|
|
827
827
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaults, FarmsApi.constants.moduleNames.vaultV1, "set_min_stake_amount"),
|
|
828
828
|
typeArguments: [inputs.stakeCoinType],
|
|
829
829
|
arguments: [
|
|
830
|
-
tx.object(inputs.ownerCapId),
|
|
831
|
-
tx.object(inputs.stakingPoolId),
|
|
830
|
+
tx.object(inputs.ownerCapId), // OwnerCap
|
|
831
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
832
832
|
tx.pure.u64(inputs.minStakeAmount),
|
|
833
833
|
],
|
|
834
834
|
});
|
|
@@ -844,9 +844,9 @@ class FarmsApi {
|
|
|
844
844
|
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.packages.vaultsV2, FarmsApi.constants.moduleNames.vaultV2, "set_min_stake_amount"),
|
|
845
845
|
typeArguments: [inputs.stakeCoinType],
|
|
846
846
|
arguments: [
|
|
847
|
-
tx.object(inputs.ownerCapId),
|
|
848
|
-
tx.object(inputs.stakingPoolId),
|
|
849
|
-
tx.object(this.addresses.objects.version),
|
|
847
|
+
tx.object(inputs.ownerCapId), // OwnerCap
|
|
848
|
+
tx.object(inputs.stakingPoolId), // AfterburnerVault
|
|
849
|
+
tx.object(this.addresses.objects.version), // Version
|
|
850
850
|
tx.pure.u64(inputs.minStakeAmount),
|
|
851
851
|
],
|
|
852
852
|
});
|
|
@@ -975,44 +975,44 @@ class FarmsApi {
|
|
|
975
975
|
return tx;
|
|
976
976
|
});
|
|
977
977
|
/**
|
|
978
|
-
* @deprecated use
|
|
978
|
+
* @deprecated use buildWithdrawPrincipalTxV2 instead
|
|
979
979
|
* Builds a complete transaction for withdrawing principal from a staked position
|
|
980
980
|
* @param inputs Withdraw parameters including wallet address, position ID, pool ID, withdraw amount, and coin type
|
|
981
981
|
* @returns Complete transaction ready for signing and execution
|
|
982
982
|
*/
|
|
983
|
-
this.
|
|
983
|
+
this.buildWithdrawPrincipalTxV1 = (inputs) => {
|
|
984
984
|
const { walletAddress } = inputs;
|
|
985
985
|
const tx = new transactions_1.Transaction();
|
|
986
986
|
tx.setSender(walletAddress);
|
|
987
987
|
const withdrawnCoin = this.withdrawPrincipalTxV1(Object.assign(Object.assign({}, inputs), { tx }));
|
|
988
988
|
tx.transferObjects([withdrawnCoin], walletAddress);
|
|
989
989
|
return tx;
|
|
990
|
-
}
|
|
990
|
+
};
|
|
991
991
|
/**
|
|
992
992
|
* Builds a complete transaction for withdrawing principal from a staked position
|
|
993
993
|
* @param inputs Withdraw parameters including wallet address, position ID, pool ID, withdraw amount, and coin type
|
|
994
994
|
* @returns Complete transaction ready for signing and execution
|
|
995
995
|
*/
|
|
996
|
-
this.
|
|
996
|
+
this.buildWithdrawPrincipalTxV2 = (inputs) => {
|
|
997
997
|
const { walletAddress } = inputs;
|
|
998
998
|
const tx = new transactions_1.Transaction();
|
|
999
999
|
tx.setSender(walletAddress);
|
|
1000
1000
|
const withdrawnCoin = this.withdrawPrincipalTxV2(Object.assign(Object.assign({}, inputs), { tx }));
|
|
1001
1001
|
tx.transferObjects([withdrawnCoin], walletAddress);
|
|
1002
1002
|
return tx;
|
|
1003
|
-
}
|
|
1003
|
+
};
|
|
1004
1004
|
/**
|
|
1005
|
-
* @deprecated use
|
|
1005
|
+
* @deprecated use buildUnstakeTxV2 instead
|
|
1006
1006
|
* Builds a complete transaction for unstaking (withdrawing and destroying a position)
|
|
1007
1007
|
* @param inputs Unstake parameters including wallet address, position ID, pool ID, reward coin types, and coin type
|
|
1008
1008
|
* @returns Complete transaction ready for signing and execution
|
|
1009
1009
|
*/
|
|
1010
|
-
this.
|
|
1010
|
+
this.buildUnstakeTxV1 = (inputs) => {
|
|
1011
1011
|
const { walletAddress } = inputs;
|
|
1012
1012
|
let tx;
|
|
1013
1013
|
if (inputs.rewardCoinTypes.length > 0) {
|
|
1014
1014
|
// harvest rewards
|
|
1015
|
-
tx =
|
|
1015
|
+
tx = this.buildHarvestRewardsTxV1(Object.assign(Object.assign({}, inputs), { stakedPositionIds: [inputs.stakedPositionId] }));
|
|
1016
1016
|
}
|
|
1017
1017
|
else {
|
|
1018
1018
|
// no rewards to harvest
|
|
@@ -1030,18 +1030,18 @@ class FarmsApi {
|
|
|
1030
1030
|
stakeCoinType: inputs.stakeCoinType,
|
|
1031
1031
|
});
|
|
1032
1032
|
return tx;
|
|
1033
|
-
}
|
|
1033
|
+
};
|
|
1034
1034
|
/**
|
|
1035
1035
|
* Builds a complete transaction for unstaking (withdrawing and destroying a position)
|
|
1036
1036
|
* @param inputs Unstake parameters including wallet address, position ID, pool ID, reward coin types, and coin type
|
|
1037
1037
|
* @returns Complete transaction ready for signing and execution
|
|
1038
1038
|
*/
|
|
1039
|
-
this.
|
|
1039
|
+
this.buildUnstakeTxV2 = (inputs) => {
|
|
1040
1040
|
const { walletAddress } = inputs;
|
|
1041
1041
|
let tx;
|
|
1042
1042
|
if (inputs.rewardCoinTypes.length > 0) {
|
|
1043
1043
|
// harvest rewards
|
|
1044
|
-
tx =
|
|
1044
|
+
tx = this.buildHarvestRewardsTxV2(Object.assign(Object.assign({}, inputs), { stakedPositionIds: [inputs.stakedPositionId] }));
|
|
1045
1045
|
}
|
|
1046
1046
|
else {
|
|
1047
1047
|
// no rewards to harvest
|
|
@@ -1058,7 +1058,7 @@ class FarmsApi {
|
|
|
1058
1058
|
stakeCoinType: inputs.stakeCoinType,
|
|
1059
1059
|
});
|
|
1060
1060
|
return tx;
|
|
1061
|
-
}
|
|
1061
|
+
};
|
|
1062
1062
|
/**
|
|
1063
1063
|
* @deprecated use buildUpdatePositionTxV2 instead
|
|
1064
1064
|
* Builds a transaction for updating a staked position
|
|
@@ -1118,14 +1118,15 @@ class FarmsApi {
|
|
|
1118
1118
|
// Reward Harvesting Transactions
|
|
1119
1119
|
// =========================================================================
|
|
1120
1120
|
/**
|
|
1121
|
-
* @deprecated use
|
|
1121
|
+
* @deprecated use buildHarvestRewardsTxV2 instead
|
|
1122
1122
|
* Builds a complete transaction for harvesting rewards from staked positions
|
|
1123
1123
|
* @param inputs Harvest parameters including wallet address, position IDs, pool ID, reward coin types, and optional claim as AfSui flag
|
|
1124
1124
|
* @returns Complete transaction ready for signing and execution
|
|
1125
1125
|
*/
|
|
1126
|
-
this.
|
|
1126
|
+
this.buildHarvestRewardsTxV1 = (inputs) => {
|
|
1127
|
+
var _a;
|
|
1127
1128
|
const { walletAddress, stakedPositionIds } = inputs;
|
|
1128
|
-
const tx = new transactions_1.Transaction();
|
|
1129
|
+
const tx = (_a = inputs.tx) !== null && _a !== void 0 ? _a : new transactions_1.Transaction();
|
|
1129
1130
|
tx.setSender(walletAddress);
|
|
1130
1131
|
const harvestRewardsCap = this.beginHarvestTxV1(Object.assign(Object.assign({}, inputs), { tx }));
|
|
1131
1132
|
let harvestedCoins = {};
|
|
@@ -1164,15 +1165,16 @@ class FarmsApi {
|
|
|
1164
1165
|
}
|
|
1165
1166
|
}
|
|
1166
1167
|
return tx;
|
|
1167
|
-
}
|
|
1168
|
+
};
|
|
1168
1169
|
/**
|
|
1169
1170
|
* Builds a complete transaction for harvesting rewards from staked positions
|
|
1170
1171
|
* @param inputs Harvest parameters including wallet address, position IDs, pool ID, reward coin types, and optional claim as AfSui flag
|
|
1171
1172
|
* @returns Complete transaction ready for signing and execution
|
|
1172
1173
|
*/
|
|
1173
|
-
this.
|
|
1174
|
+
this.buildHarvestRewardsTxV2 = (inputs) => {
|
|
1175
|
+
var _a;
|
|
1174
1176
|
const { walletAddress, stakedPositionIds } = inputs;
|
|
1175
|
-
const tx = new transactions_1.Transaction();
|
|
1177
|
+
const tx = (_a = inputs.tx) !== null && _a !== void 0 ? _a : new transactions_1.Transaction();
|
|
1176
1178
|
tx.setSender(walletAddress);
|
|
1177
1179
|
// For the first position, begin harvest
|
|
1178
1180
|
const firstPositionId = stakedPositionIds[0];
|
|
@@ -1211,7 +1213,7 @@ class FarmsApi {
|
|
|
1211
1213
|
}
|
|
1212
1214
|
}
|
|
1213
1215
|
return tx;
|
|
1214
|
-
}
|
|
1216
|
+
};
|
|
1215
1217
|
// =========================================================================
|
|
1216
1218
|
// Staking Pool Transactions
|
|
1217
1219
|
// =========================================================================
|
|
@@ -1219,12 +1221,12 @@ class FarmsApi {
|
|
|
1219
1221
|
// Staking Pool Creation Transactions
|
|
1220
1222
|
// =========================================================================
|
|
1221
1223
|
/**
|
|
1222
|
-
* @deprecated use
|
|
1224
|
+
* @deprecated use buildCreateStakingPoolTxV2 instead
|
|
1223
1225
|
* Builds a complete transaction for creating a new staking pool
|
|
1224
1226
|
* @param inputs Pool creation parameters including wallet address, lock enforcements, durations, multiplier, stake amount, and coin type
|
|
1225
1227
|
* @returns Complete transaction ready for signing and execution
|
|
1226
1228
|
*/
|
|
1227
|
-
this.
|
|
1229
|
+
this.buildCreateStakingPoolTxV1 = (inputs) => {
|
|
1228
1230
|
const { walletAddress } = inputs;
|
|
1229
1231
|
const tx = new transactions_1.Transaction();
|
|
1230
1232
|
tx.setSender(walletAddress);
|
|
@@ -1240,13 +1242,13 @@ class FarmsApi {
|
|
|
1240
1242
|
recipientAddress: walletAddress,
|
|
1241
1243
|
});
|
|
1242
1244
|
return tx;
|
|
1243
|
-
}
|
|
1245
|
+
};
|
|
1244
1246
|
/**
|
|
1245
1247
|
* Builds a complete transaction for creating a new staking pool
|
|
1246
1248
|
* @param inputs Pool creation parameters including wallet address, lock enforcements, durations, multiplier, stake amount, and coin type
|
|
1247
1249
|
* @returns Complete transaction ready for signing and execution
|
|
1248
1250
|
*/
|
|
1249
|
-
this.
|
|
1251
|
+
this.buildCreateStakingPoolTxV2 = (inputs) => {
|
|
1250
1252
|
const { walletAddress } = inputs;
|
|
1251
1253
|
const tx = new transactions_1.Transaction();
|
|
1252
1254
|
tx.setSender(walletAddress);
|
|
@@ -1258,7 +1260,7 @@ class FarmsApi {
|
|
|
1258
1260
|
});
|
|
1259
1261
|
tx.transferObjects([ownerCapId], walletAddress);
|
|
1260
1262
|
return tx;
|
|
1261
|
-
}
|
|
1263
|
+
};
|
|
1262
1264
|
// =========================================================================
|
|
1263
1265
|
// Staking Pool Mutation Transactions
|
|
1264
1266
|
// =========================================================================
|
|
@@ -1347,12 +1349,12 @@ class FarmsApi {
|
|
|
1347
1349
|
return tx;
|
|
1348
1350
|
});
|
|
1349
1351
|
/**
|
|
1350
|
-
* @deprecated use
|
|
1352
|
+
* @deprecated use buildIncreaseStakingPoolRewardsEmissionsTxV2 instead
|
|
1351
1353
|
* Builds a complete transaction for increasing the emission rate of rewards for a staking pool
|
|
1352
1354
|
* @param inputs Increase emissions parameters including wallet address, owner cap ID, pool ID, rewards array with emission parameters and coin types, and stake coin type
|
|
1353
1355
|
* @returns Complete transaction ready for signing and execution
|
|
1354
1356
|
*/
|
|
1355
|
-
this.
|
|
1357
|
+
this.buildIncreaseStakingPoolRewardsEmissionsTxV1 = (inputs) => {
|
|
1356
1358
|
const { walletAddress } = inputs;
|
|
1357
1359
|
const tx = new transactions_1.Transaction();
|
|
1358
1360
|
tx.setSender(walletAddress);
|
|
@@ -1366,7 +1368,7 @@ class FarmsApi {
|
|
|
1366
1368
|
* @param inputs Increase emissions parameters including wallet address, owner cap ID, pool ID, rewards array with emission parameters and coin types, and stake coin type
|
|
1367
1369
|
* @returns Complete transaction ready for signing and execution
|
|
1368
1370
|
*/
|
|
1369
|
-
this.
|
|
1371
|
+
this.buildIncreaseStakingPoolRewardsEmissionsTxV2 = (inputs) => {
|
|
1370
1372
|
const { walletAddress } = inputs;
|
|
1371
1373
|
const tx = new transactions_1.Transaction();
|
|
1372
1374
|
tx.setSender(walletAddress);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"farmsApiCasting.d.ts","sourceRoot":"","sources":["../../../../src/packages/farms/api/farmsApiCasting.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,8BAA8B,EAE9B,+BAA+B,EAC/B,qCAAqC,EACrC,0CAA0C,EAC1C,mCAAmC,EACnC,qCAAqC,EACrC,oCAAoC,EACpC,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAGhC,2BAA2B,EAC3B,oCAAoC,EAKpC,yBAAyB,EACzB,oCAAoC,EACpC,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,oCAAoC,EACpC,mCAAmC,EACnC,mCAAmC,EACnC,0CAA0C,EAC1C,qCAAqC,EACrC,+BAA+B,EAC/B,8BAA8B,EAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,iCAAiC,EAEjC,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,gCAAgC,EAChC,gCAAgC,EAChC,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,qBAAa,eAAe;IAK3B,OAAc,kDAAkD,
|
|
1
|
+
{"version":3,"file":"farmsApiCasting.d.ts","sourceRoot":"","sources":["../../../../src/packages/farms/api/farmsApiCasting.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,8BAA8B,EAE9B,+BAA+B,EAC/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AAc,wBAAwB,GACrC,cAAc,yBAAyB,KACrC,gBAAgB,CAiBjB;IAEF,OAAc,+BAA+B,GAC5C,cAAc,gCAAgC,KAC5C,uBAAuB,CAexB;IAEF,OAAc,0BAA0B,GACvC,cAAc,2BAA2B,KACvC,kBAAkB,CAanB;IAEF,OAAc,0BAA0B,GACvC,cAAc,2BAA2B,KACvC,kBAAkB,CAanB;IAEF,OAAc,mCAAmC,GAChD,cAAc,oCAAoC,KAChD,2BAA2B,CAW5B;IAEF,OAAc,mCAAmC,GAChD,cAAc,oCAAoC,KAChD,2BAA2B,CAW5B;CACF"}
|
|
@@ -12,7 +12,7 @@ import { AftermathApi } from "../../general/providers";
|
|
|
12
12
|
* with the farming system.
|
|
13
13
|
*/
|
|
14
14
|
export declare class Farms extends Caller {
|
|
15
|
-
|
|
15
|
+
readonly Provider?: AftermathApi | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* Contains constants relevant to farming, including minimum rewards to claim
|
|
18
18
|
* and maximum lock multipliers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"farms.d.ts","sourceRoot":"","sources":["../../../src/packages/farms/farms.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,QAAQ,EACR,UAAU,EACV,oBAAoB,EACpB,YAAY,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EACN,6BAA6B,EAC7B,+BAA+B,EAC/B,gCAAgC,EAChC,4CAA4C,EAC5C,qCAAqC,EAUrC,aAAa,EACb,gCAAgC,EAChC,yBAAyB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;GAMG;AACH,qBAAa,KAAM,SAAQ,MAAM;
|
|
1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ACU,mCAAmC,CAC/C,MAAM,EAAE,4CAA4C;IASrD;;;;;;;;;;;;;;OAcG;IACU,MAAM,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvE;;;;;;;;;;;;;;OAcG;IACU,aAAa,CAAC,MAAM,CAAC,EAAE;QACnC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;KACrB,GAAG,OAAO,CAAC,MAAM,CAAC;IAQnB;;;;;;;;;OASG;IACU,iCAAiC,CAC7C,MAAM,EAAE,+BAA+B;IAKxC;;;;;;;;;;;;;;;;;;OAkBG;IACU,iCAAiC,CAC7C,MAAM,EAAE,6BAA6B;IAStC;;;;;;;;;;;;;;;OAeG;IACU,oBAAoB,CAChC,MAAM,EAAE,oBAAoB,GAAG;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;IAcF;;;OAGG;IACH,OAAO,CAAC,WAAW,CAIjB;CACF"}
|
|
@@ -231,7 +231,7 @@ class Farms extends caller_1.Caller {
|
|
|
231
231
|
*/
|
|
232
232
|
getCreateStakingPoolTransactionV1(inputs) {
|
|
233
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
-
return this.useProvider().
|
|
234
|
+
return this.useProvider().buildCreateStakingPoolTxV1(inputs);
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
@@ -255,7 +255,7 @@ class Farms extends caller_1.Caller {
|
|
|
255
255
|
*/
|
|
256
256
|
getCreateStakingPoolTransactionV2(inputs) {
|
|
257
257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
-
return this.useProvider().
|
|
258
|
+
return this.useProvider().buildCreateStakingPoolTxV2(inputs);
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
261
|
// =========================================================================
|