aftermath-ts-sdk 2.1.0-perps.1 → 2.1.0-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/dist/index.d.ts CHANGED
@@ -1862,10 +1862,10 @@ interface PerpetualsMarketParams {
1862
1862
  marginRatioMaintenance: number;
1863
1863
  /** Symbol of the underlying asset. */
1864
1864
  baseAssetSymbol: CoinSymbol;
1865
- /** On-chain ID of the oracle providing the base asset price. */
1866
- basePriceFeedId: ObjectId;
1867
- /** On-chain ID of the oracle providing the collateral asset price. */
1868
- collateralPriceFeedId: ObjectId;
1865
+ /** Numeric price-feed storage id of the base asset's oracle feed. */
1866
+ basePriceFeedId: number;
1867
+ /** Numeric price-feed storage id of the collateral asset's oracle feed. */
1868
+ collateralPriceFeedId: number;
1869
1869
  /** Funding interval duration in milliseconds. */
1870
1870
  fundingFrequencyMs: bigint;
1871
1871
  /** Funding period used for calculations in milliseconds. */
@@ -2253,17 +2253,16 @@ interface PerpetualsVaultObject {
2253
2253
  */
2254
2254
  forceWithdrawDelayMs: bigint;
2255
2255
  /**
2256
- * Price feed storage id idetifying the oracle price for `C`
2256
+ * Numeric price-feed storage id identifying the oracle price for `C`.
2257
2257
  */
2258
- collateralPriceFeedStorageId: ObjectId;
2258
+ collateralPriceFeedStorageId: number;
2259
2259
  /**
2260
- * Source object ID for the collateral price feed storage.
2261
- *
2262
- * Some oracle integrations separate the "storage object" from the "source"
2263
- * (e.g., an aggregator or publisher object). This field identifies the
2264
- * upstream source used to populate `collateralPriceFeedStorageId`.
2260
+ * Numeric source id of the collateral price feed (the oracle
2261
+ * provider/source: pyth, stork, etc.). Together with
2262
+ * `collateralPriceFeedStorageId` it identifies the feed in the oracle
2263
+ * aggregator registry.
2265
2264
  */
2266
- collateralPriceFeedStorageSourceId: ObjectId;
2265
+ collateralPriceFeedStorageSourceId: number;
2267
2266
  /**
2268
2267
  * Maximum tolerated deviation for the collateral oracle price.
2269
2268
  *
@@ -3376,7 +3375,7 @@ interface PerpetualsTwapOrderDetails {
3376
3375
  /** Market (clearing house) ID this TWAP order targets. */
3377
3376
  marketId: PerpetualsMarketId;
3378
3377
  /** Position side: `0` for bid (long), `1` for ask (short). */
3379
- side: 0 | 1;
3378
+ side: PerpetualsOrderSide;
3380
3379
  /** Total base-asset size to execute across all chunks (scaled base units). */
3381
3380
  size: bigint;
3382
3381
  /** Whether the order may only reduce an existing position. */
@@ -7956,6 +7955,24 @@ declare class FarmsStakingPool extends Caller {
7956
7955
  minStakeAmount: bigint;
7957
7956
  walletAddress: SuiAddress;
7958
7957
  }): Promise<_mysten_sui_transactions.Transaction>;
7958
+ /**
7959
+ * Builds a transaction to set the pool's minimum lock duration (ms).
7960
+ * Owner-cap only. V2 pools only — V1 vaults do not expose this entry.
7961
+ */
7962
+ getSetMinLockDurationMsTransaction(inputs: {
7963
+ ownerCapId: ObjectId;
7964
+ lockDurationMs: bigint;
7965
+ walletAddress: SuiAddress;
7966
+ }): _mysten_sui_transactions.Transaction;
7967
+ /**
7968
+ * Builds a transaction to set the pool's maximum lock duration (ms).
7969
+ * Owner-cap only. V2 pools only.
7970
+ */
7971
+ getSetMaxLockDurationMsTransaction(inputs: {
7972
+ ownerCapId: ObjectId;
7973
+ lockDurationMs: bigint;
7974
+ walletAddress: SuiAddress;
7975
+ }): _mysten_sui_transactions.Transaction;
7959
7976
  /**
7960
7977
  * Builds a transaction granting a one-time admin cap to another address, allowing them to perform specific
7961
7978
  * one-time administrative actions (like initializing a reward).
@@ -15734,6 +15751,29 @@ declare class FarmsApi implements MoveErrorsInterface {
15734
15751
  minStakeAmount: bigint;
15735
15752
  stakeCoinType: CoinType;
15736
15753
  }) => _mysten_sui_transactions.TransactionResult;
15754
+ /**
15755
+ * Creates a transaction command to set the minimum lock duration (ms) for a
15756
+ * staking pool. Owner-cap only; V2 vault module. Mirrors
15757
+ * `setStakingPoolMinStakeAmountTxV2`.
15758
+ */
15759
+ setStakingPoolMinLockDurationMsTxV2: (inputs: {
15760
+ tx: Transaction;
15761
+ ownerCapId: ObjectId;
15762
+ stakingPoolId: ObjectId;
15763
+ lockDurationMs: bigint;
15764
+ stakeCoinType: CoinType;
15765
+ }) => _mysten_sui_transactions.TransactionResult;
15766
+ /**
15767
+ * Creates a transaction command to set the maximum lock duration (ms) for a
15768
+ * staking pool. Owner-cap only; V2 vault module.
15769
+ */
15770
+ setStakingPoolMaxLockDurationMsTxV2: (inputs: {
15771
+ tx: Transaction;
15772
+ ownerCapId: ObjectId;
15773
+ stakingPoolId: ObjectId;
15774
+ lockDurationMs: bigint;
15775
+ stakeCoinType: CoinType;
15776
+ }) => _mysten_sui_transactions.TransactionResult;
15737
15777
  /**
15738
15778
  * Creates a Move call (V1) to **remove undistributed reward coins** from a staking pool.
15739
15779
  * Only callable by the pool **owner** (validated via `ownerCapId`). This does not claw back
@@ -16071,6 +16111,24 @@ declare class FarmsApi implements MoveErrorsInterface {
16071
16111
  minStakeAmount: bigint;
16072
16112
  stakeCoinType: CoinType;
16073
16113
  }, "tx">) => Transaction;
16114
+ buildSetStakingPoolMinLockDurationMsTxV2: (inputs: {
16115
+ walletAddress: SuiAddress;
16116
+ } & Omit<{
16117
+ tx: Transaction;
16118
+ ownerCapId: ObjectId;
16119
+ stakingPoolId: ObjectId;
16120
+ lockDurationMs: bigint;
16121
+ stakeCoinType: CoinType;
16122
+ }, "tx">) => Transaction;
16123
+ buildSetStakingPoolMaxLockDurationMsTxV2: (inputs: {
16124
+ walletAddress: SuiAddress;
16125
+ } & Omit<{
16126
+ tx: Transaction;
16127
+ ownerCapId: ObjectId;
16128
+ stakingPoolId: ObjectId;
16129
+ lockDurationMs: bigint;
16130
+ stakeCoinType: CoinType;
16131
+ }, "tx">) => Transaction;
16074
16132
  /**
16075
16133
  * Builds a transaction for **removing undistributed reward coins** from a staking pool (V1).
16076
16134
  * Requires the pool **OwnerCap**. The removal is specific to a `rewardCoinType`.
package/dist/index.js CHANGED
@@ -4991,6 +4991,38 @@ var init_farmsStakingPool = __esm({
4991
4991
  };
4992
4992
  return this.version() === 1 ? this.farmsApi().buildSetStakingPoolMinStakeAmountTxV1(args) : this.farmsApi().buildSetStakingPoolMinStakeAmountTxV2(args);
4993
4993
  }
4994
+ /**
4995
+ * Builds a transaction to set the pool's minimum lock duration (ms).
4996
+ * Owner-cap only. V2 pools only — V1 vaults do not expose this entry.
4997
+ */
4998
+ getSetMinLockDurationMsTransaction(inputs) {
4999
+ if (this.version() === 1) {
5000
+ throw new Error(
5001
+ "set_min_lock_duration_ms is not supported on V1 staking pools"
5002
+ );
5003
+ }
5004
+ return this.farmsApi().buildSetStakingPoolMinLockDurationMsTxV2({
5005
+ ...inputs,
5006
+ stakeCoinType: this.stakingPool.stakeCoinType,
5007
+ stakingPoolId: this.stakingPool.objectId
5008
+ });
5009
+ }
5010
+ /**
5011
+ * Builds a transaction to set the pool's maximum lock duration (ms).
5012
+ * Owner-cap only. V2 pools only.
5013
+ */
5014
+ getSetMaxLockDurationMsTransaction(inputs) {
5015
+ if (this.version() === 1) {
5016
+ throw new Error(
5017
+ "set_max_lock_duration_ms is not supported on V1 staking pools"
5018
+ );
5019
+ }
5020
+ return this.farmsApi().buildSetStakingPoolMaxLockDurationMsTxV2({
5021
+ ...inputs,
5022
+ stakeCoinType: this.stakingPool.stakeCoinType,
5023
+ stakingPoolId: this.stakingPool.objectId
5024
+ });
5025
+ }
4994
5026
  /**
4995
5027
  * Builds a transaction granting a one-time admin cap to another address, allowing them to perform specific
4996
5028
  * one-time administrative actions (like initializing a reward).
@@ -16538,6 +16570,49 @@ var init_farmsApi = __esm({
16538
16570
  ]
16539
16571
  });
16540
16572
  };
16573
+ /**
16574
+ * Creates a transaction command to set the minimum lock duration (ms) for a
16575
+ * staking pool. Owner-cap only; V2 vault module. Mirrors
16576
+ * `setStakingPoolMinStakeAmountTxV2`.
16577
+ */
16578
+ this.setStakingPoolMinLockDurationMsTxV2 = (inputs) => {
16579
+ const { tx } = inputs;
16580
+ return tx.moveCall({
16581
+ target: Helpers.transactions.createTxTarget(
16582
+ this.addresses.packages.vaultsV2,
16583
+ _FarmsApi.constants.moduleNames.vaultV2,
16584
+ "set_min_lock_duration_ms"
16585
+ ),
16586
+ typeArguments: [inputs.stakeCoinType],
16587
+ arguments: [
16588
+ tx.object(inputs.ownerCapId),
16589
+ tx.object(inputs.stakingPoolId),
16590
+ tx.object(this.addresses.objects.version),
16591
+ tx.pure.u64(inputs.lockDurationMs)
16592
+ ]
16593
+ });
16594
+ };
16595
+ /**
16596
+ * Creates a transaction command to set the maximum lock duration (ms) for a
16597
+ * staking pool. Owner-cap only; V2 vault module.
16598
+ */
16599
+ this.setStakingPoolMaxLockDurationMsTxV2 = (inputs) => {
16600
+ const { tx } = inputs;
16601
+ return tx.moveCall({
16602
+ target: Helpers.transactions.createTxTarget(
16603
+ this.addresses.packages.vaultsV2,
16604
+ _FarmsApi.constants.moduleNames.vaultV2,
16605
+ "set_max_lock_duration_ms"
16606
+ ),
16607
+ typeArguments: [inputs.stakeCoinType],
16608
+ arguments: [
16609
+ tx.object(inputs.ownerCapId),
16610
+ tx.object(inputs.stakingPoolId),
16611
+ tx.object(this.addresses.objects.version),
16612
+ tx.pure.u64(inputs.lockDurationMs)
16613
+ ]
16614
+ });
16615
+ };
16541
16616
  /**
16542
16617
  * Creates a Move call (V1) to **remove undistributed reward coins** from a staking pool.
16543
16618
  * Only callable by the pool **owner** (validated via `ownerCapId`). This does not claw back
@@ -17222,6 +17297,12 @@ var init_farmsApi = __esm({
17222
17297
  this.buildSetStakingPoolMinStakeAmountTxV2 = Helpers.transactions.createBuildTxFunc(
17223
17298
  this.setStakingPoolMinStakeAmountTxV2
17224
17299
  );
17300
+ this.buildSetStakingPoolMinLockDurationMsTxV2 = Helpers.transactions.createBuildTxFunc(
17301
+ this.setStakingPoolMinLockDurationMsTxV2
17302
+ );
17303
+ this.buildSetStakingPoolMaxLockDurationMsTxV2 = Helpers.transactions.createBuildTxFunc(
17304
+ this.setStakingPoolMaxLockDurationMsTxV2
17305
+ );
17225
17306
  /**
17226
17307
  * Builds a transaction for **removing undistributed reward coins** from a staking pool (V1).
17227
17308
  * Requires the pool **OwnerCap**. The removal is specific to a `rewardCoinType`.