aftermath-ts-sdk
Version:
Aftermath TypeScript SDK
914 lines • 42 kB
TypeScript
import { AftermathApi } from "../../../general/providers/aftermathApi";
import { AnyObjectType, FarmsAddresses, Timestamp, CoinType, ApiFarmsStakeBody, ApiHarvestFarmsRewardsBody, ApiFarmsDepositPrincipalBody, Balance, ApiFarmsUnstakeBody, FarmsLockEnforcement, FarmsMultiplier, ApiFarmsCreateStakingPoolBody, ApiFarmsTopUpStakingPoolRewardsBody, ApiFarmsInitializeStakingPoolRewardBody, StakingPoolOwnerCapObject, ApiFarmsOwnedStakingPoolOwnerCapsBody, ApiFarmsIncreaseStakingPoolRewardsEmissionsBody, PartialFarmsStakedPositionObject, StakingPoolOneTimeAdminCapObject, FarmOwnerOrOneTimeAdminCap, ObjectId, SuiAddress, ApiFarmsCreateStakingPoolBodyV1, ApiFarmsStakeBodyV1 } from "../../../types";
import { TransactionArgument, Transaction } from "@mysten/sui/transactions";
import { MoveErrors, MoveErrorsInterface } from "../../../general/types/moveErrorsInterface";
export declare class FarmsApi implements MoveErrorsInterface {
private readonly Provider;
private static readonly constants;
readonly addresses: FarmsAddresses;
readonly objectTypes: {
stakedPositionV1: AnyObjectType;
stakingPoolOwnerCapV1: AnyObjectType;
stakingPoolOneTimeAdminCapV1: AnyObjectType;
stakedPositionV2: AnyObjectType;
stakingPoolOwnerCapV2: AnyObjectType;
stakingPoolOneTimeAdminCapV2: AnyObjectType;
};
readonly eventTypes: {
createdVaultV1: AnyObjectType;
initializedRewardV1: AnyObjectType;
addedRewardV1: AnyObjectType;
increasedEmissionsV1: AnyObjectType;
stakedV1: AnyObjectType;
stakedRelaxedV1: AnyObjectType;
lockedV1: AnyObjectType;
unlockedV1: AnyObjectType;
depositedPrincipalV1: AnyObjectType;
withdrewPrincipalV1: AnyObjectType;
harvestedRewardsV1: AnyObjectType;
createdVaultV2: AnyObjectType;
initializedRewardV2: AnyObjectType;
addedRewardV2: AnyObjectType;
updatedEmissionsV2: AnyObjectType;
stakedV2: AnyObjectType;
lockedV2: AnyObjectType;
unlockedV2: AnyObjectType;
depositedPrincipalV2: AnyObjectType;
withdrewPrincipalV2: AnyObjectType;
harvestedRewardsV2: AnyObjectType;
};
readonly moveErrors: MoveErrors;
/**
* Constructor for FarmsApi
* @param Provider The AftermathApi provider instance
* @throws Error if not all required addresses have been set in provider
*/
constructor(Provider: AftermathApi);
/**
* Fetches the owner caps for staking pools owned by a specific wallet address
* @param inputs Object containing wallet address
* @returns Array of StakingPoolOwnerCapObject
*/
fetchOwnedStakingPoolOwnerCaps: (inputs: ApiFarmsOwnedStakingPoolOwnerCapsBody) => Promise<StakingPoolOwnerCapObject[]>;
/**
* Fetches the one-time admin caps for staking pools owned by a specific wallet address
* @param inputs Object containing wallet address
* @returns Array of StakingPoolOneTimeAdminCapObject
*/
fetchOwnedStakingPoolOneTimeAdminCaps: (inputs: ApiFarmsOwnedStakingPoolOwnerCapsBody) => Promise<StakingPoolOneTimeAdminCapObject[]>;
/**
* Fetches partial staked positions owned by a specific wallet address
* @param inputs Object containing wallet address
* @returns Array of PartialFarmsStakedPositionObject
*/
fetchOwnedPartialStakedPositions: (inputs: {
walletAddress: SuiAddress;
}) => Promise<PartialFarmsStakedPositionObject[]>;
/**
* @deprecated use stakeTxV2 instead
* Creates a transaction to stake coins in a staking pool (original version)
* @param inputs Staking parameters including transaction, pool ID, coin ID, lock duration, and coin type
* @returns Transaction object argument for StakedPosition
*/
stakeTxV1: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
stakeCoinId: ObjectId | TransactionArgument;
lockDurationMs: Timestamp;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to stake coins in a staking pool
* @param inputs Staking parameters including transaction, pool ID, coin ID, lock duration, lock enforcement, and coin type
* @returns Transaction object argument for StakedPosition
*/
stakeTxV2: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
stakeCoinId: ObjectId | TransactionArgument;
lockDurationMs: Timestamp;
lockEnforcement: FarmsLockEnforcement;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use depositPrincipalTxV2 instead
* Creates a transaction to deposit additional principal to a staked position (original version)
* @param inputs Deposit parameters including transaction, position ID, pool ID, coin ID, and coin type
* @returns Transaction command to deposit principal
*/
depositPrincipalTxV1: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinId: ObjectId | TransactionArgument;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to deposit additional principal to a staked position
* @param inputs Deposit parameters including transaction, position ID, pool ID, coin ID, and coin type
* @returns Transaction command to deposit principal
*/
depositPrincipalTxV2: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinId: ObjectId | TransactionArgument;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use withdrawPrincipalTxV2 instead
* Creates a transaction to withdraw principal from a staked position (original version)
* @param inputs Withdrawal parameters including transaction, position ID, pool ID, amount, and coin type
* @returns Transaction object argument for the withdrawn Coin
*/
withdrawPrincipalTxV1: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
withdrawAmount: Balance;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to withdraw principal from a staked position
* @param inputs Withdrawal parameters including transaction, position ID, pool ID, amount, and coin type
* @returns Transaction object argument for the withdrawn Coin
*/
withdrawPrincipalTxV2: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
withdrawAmount: Balance;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use destroyStakedPositionTxV2 instead
* Creates a transaction to destroy a staked position (original version)
* @param inputs Destroy parameters including transaction, position ID, pool ID, and coin type
* @returns Transaction command to destroy the position
*/
destroyStakedPositionTxV1: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to destroy a staked position
* @param inputs Destroy parameters including transaction, position ID, and coin type
* @returns Transaction command to destroy the position
*/
destroyStakedPositionTxV2: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use updatePositionTxV2 instead
* Creates a transaction to update a staked position, recalculating rewards (original version)
* @param inputs Update parameters including transaction, position ID, pool ID, and coin type
* @returns Transaction command to update the position
*/
updatePositionTxV1: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to update a staked position, recalculating rewards
* @param inputs Update parameters including transaction, position ID, pool ID, and coin type
* @returns Transaction command to update the position
*/
updatePositionTxV2: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use lockTxV2 instead
* Creates a transaction to lock a staked position for a specific duration (original version)
* @param inputs Lock parameters including transaction, position ID, pool ID, lock duration, and coin type
* @returns Transaction command to lock the position
*/
lockTxV1: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
lockDurationMs: Timestamp;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to lock a staked position for a specific duration
* @param inputs Lock parameters including transaction, position ID, pool ID, lock duration, and coin type
* @returns Transaction command to lock the position
*/
lockTxV2: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
lockDurationMs: Timestamp;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use renewLockTxV2 instead
* Creates a transaction to renew the lock on a staked position (original version)
* @param inputs Renew lock parameters including transaction, position ID, pool ID, and coin type
* @returns Transaction command to renew the lock
*/
renewLockTxV1: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to renew the lock on a staked position
* @param inputs Renew lock parameters including transaction, position ID, pool ID, and coin type
* @returns Transaction command to renew the lock
*/
renewLockTxV2: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use unlockTxV2 instead
* Creates a transaction to unlock a staked position (original version)
* @param inputs Unlock parameters including transaction, position ID, pool ID, and coin type
* @returns Transaction command to unlock the position
*/
unlockTxV1: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to unlock a staked position
* @param inputs Unlock parameters including transaction, position ID, pool ID, and coin type
* @returns Transaction command to unlock the position
*/
unlockTxV2: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use beginHarvestTxV2 instead
* Creates a transaction to begin the reward harvesting process (original version)
* @param inputs Begin harvest parameters including transaction, pool ID, and coin type
* @returns Transaction object argument for the harvest metadata
*/
beginHarvestTxV1: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to begin the reward harvesting process
* @param inputs Begin harvest parameters including transaction, position ID, pool ID, and coin type
* @returns Transaction object argument for the harvest cap
*/
beginHarvestTxV2: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use harvestRewardsTxV2 instead
* Creates a transaction to harvest rewards from a staked position (original version)
* @param inputs Harvest parameters including transaction, position ID, pool ID, harvest metadata, stake coin type, and reward coin type
* @returns Transaction object argument for the harvested rewards
*/
harvestRewardsTxV1: (inputs: {
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
harvestedRewardsEventMetadataId: ObjectId | TransactionArgument;
stakeCoinType: CoinType;
rewardCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to harvest rewards from a staked position
* @param inputs Harvest parameters including transaction, harvest cap, position ID, pool ID, stake coin type, and reward coin type
* @returns Transaction object argument for the harvested rewards
*/
harvestRewardsTxV2: (inputs: {
tx: Transaction;
harvestRewardsCap: ObjectId | TransactionArgument;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
rewardCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use endHarvestTxV2 instead
* Creates a transaction to end the reward harvesting process (original version)
* @param inputs End harvest parameters including transaction and harvest metadata
* @returns Transaction command to end the harvest
*/
endHarvestTxV1: (inputs: {
tx: Transaction;
harvestedRewardsEventMetadataId: ObjectId | TransactionArgument;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to end the reward harvesting process
* @param inputs End harvest parameters including transaction and harvest cap
* @returns Transaction command to end the harvest
*/
endHarvestTxV2: (inputs: {
tx: Transaction;
harvestRewardsCap: ObjectId | TransactionArgument;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use newStakingPoolTxV2 instead
* Creates a transaction for the deprecated version of staking pool creation
* @param inputs Pool creation parameters including transaction, lock enforcement, durations, multiplier, stake amount, and coin type
* @returns Transaction objects for the vault and owner cap
*/
newStakingPoolTxV1: (inputs: {
tx: Transaction;
lockEnforcement: FarmsLockEnforcement;
minLockDurationMs: Timestamp;
maxLockDurationMs: Timestamp;
maxLockMultiplier: FarmsMultiplier;
minStakeAmount: Balance;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction for the current version of staking pool creation
* @param inputs Pool creation parameters including transaction, lock enforcements array, durations, multiplier, stake amount, and coin type
* @returns Transaction objects for the vault and authority cap
*/
newStakingPoolTxV2: (inputs: {
tx: Transaction;
lockEnforcements: FarmsLockEnforcement[];
minLockDurationMs: Timestamp;
maxLockDurationMs: Timestamp;
maxLockMultiplier: FarmsMultiplier;
minStakeAmount: Balance;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use shareStakingPoolTxV2 instead
* Creates a transaction to share a staking pool, making it public
* @param inputs Share pool parameters including transaction, pool ID, and coin type
* @returns Transaction command to share the pool
*/
shareStakingPoolTxV1: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId | TransactionArgument;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to share a staking pool, making it public
* @param inputs Share pool parameters including transaction, pool ID, and coin type
* @returns Transaction command to share the pool
*/
shareStakingPoolTxV2: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId | TransactionArgument;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use transferOwnerCapTxV2 instead
* Creates a transaction to transfer ownership of a staking pool
* @param inputs Transfer parameters including transaction, owner cap ID, and recipient address
* @returns Transaction command to transfer the owner cap
*/
transferOwnerCapTxV1: (inputs: {
tx: Transaction;
ownerCapId: ObjectId | TransactionArgument;
recipientAddress: SuiAddress;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use grantOneTimeAdminCapTxV2 instead
* Creates a transaction to grant a one-time admin capability for a staking pool (original version)
* @param inputs Grant parameters including transaction, owner cap ID, recipient address, and reward coin type
* @returns Transaction command to grant the one-time admin cap
*/
grantOneTimeAdminCapTxV1: (inputs: {
tx: Transaction;
ownerCapId: ObjectId | TransactionArgument;
recipientAddress: SuiAddress;
rewardCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to grant a one-time admin capability for a staking pool
* @param inputs Grant parameters including transaction, owner cap ID, recipient address, and reward coin type
* @returns Transaction command to grant the one-time admin cap
*/
grantOneTimeAdminCapTxV2: (inputs: {
tx: Transaction;
ownerCapId: ObjectId | TransactionArgument;
recipientAddress: SuiAddress;
rewardCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use initializeStakingPoolRewardTxV2 instead
* Creates a transaction to initialize rewards for a staking pool (original version)
* @param inputs Initialize reward parameters including transaction, pool ID, reward coin ID, emission parameters, stake coin type, and reward coin type
* @returns Transaction command to initialize the reward
*/
initializeStakingPoolRewardTxV1: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
rewardCoinId: ObjectId | TransactionArgument;
emissionScheduleMs: Timestamp;
emissionRate: bigint;
emissionDelayTimestampMs: Timestamp;
stakeCoinType: CoinType;
rewardCoinType: CoinType;
} & FarmOwnerOrOneTimeAdminCap) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to initialize rewards for a staking pool
* @param inputs Initialize reward parameters including transaction, pool ID, reward coin ID, emission parameters, stake coin type, and reward coin type
* @returns Transaction command to initialize the reward
*/
initializeStakingPoolRewardTxV2: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
rewardCoinId: ObjectId | TransactionArgument;
emissionScheduleMs: Timestamp;
emissionRate: bigint;
emissionDelayTimestampMs: Timestamp;
stakeCoinType: CoinType;
rewardCoinType: CoinType;
} & FarmOwnerOrOneTimeAdminCap) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use topUpStakingPoolRewardTxV2 instead
* Creates a transaction to add more rewards to a staking pool (original version)
* @param inputs Top up parameters including transaction, pool ID, reward coin ID, stake coin type, and reward coin type
* @returns Transaction command to add rewards
*/
topUpStakingPoolRewardTxV1: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
rewardCoinId: ObjectId | TransactionArgument;
stakeCoinType: CoinType;
rewardCoinType: CoinType;
} & FarmOwnerOrOneTimeAdminCap) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to add more rewards to a staking pool
* @param inputs Top up parameters including transaction, pool ID, reward coin ID, stake coin type, and reward coin type
* @returns Transaction command to add rewards
*/
topUpStakingPoolRewardTxV2: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
rewardCoinId: ObjectId | TransactionArgument;
stakeCoinType: CoinType;
rewardCoinType: CoinType;
} & FarmOwnerOrOneTimeAdminCap) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use increaseStakingPoolRewardEmissionsTxV2 instead
* Creates a transaction to increase the emission rate for a staking pool reward (original version)
* @param inputs Increase emissions parameters including transaction, owner cap ID, pool ID, emission parameters, stake coin type, and reward coin type
* @returns Transaction command to update emissions
*/
increaseStakingPoolRewardEmissionsTxV1: (inputs: {
tx: Transaction;
ownerCapId: ObjectId;
stakingPoolId: ObjectId;
emissionScheduleMs: Timestamp;
emissionRate: bigint;
stakeCoinType: CoinType;
rewardCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to increase the emission rate for a staking pool reward
* @param inputs Increase emissions parameters including transaction, owner cap ID, pool ID, emission parameters, stake coin type, and reward coin type
* @returns Transaction command to update emissions
*/
increaseStakingPoolRewardEmissionsTxV2: (inputs: {
tx: Transaction;
ownerCapId: ObjectId;
stakingPoolId: ObjectId;
emissionScheduleMs: Timestamp;
emissionRate: bigint;
stakeCoinType: CoinType;
rewardCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use setStakingPoolMinStakeAmountTxV2 instead
* Creates a transaction to set the minimum stake amount for a staking pool (original version)
* @param inputs Min stake amount parameters including transaction, owner cap ID, pool ID, minimum amount, and stake coin type
* @returns Transaction command to set the minimum stake amount
*/
setStakingPoolMinStakeAmountTxV1: (inputs: {
tx: Transaction;
ownerCapId: ObjectId;
stakingPoolId: ObjectId;
minStakeAmount: bigint;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to set the minimum stake amount for a staking pool
* @param inputs Min stake amount parameters including transaction, owner cap ID, pool ID, minimum amount, and stake coin type
* @returns Transaction command to set the minimum stake amount
*/
setStakingPoolMinStakeAmountTxV2: (inputs: {
tx: Transaction;
ownerCapId: ObjectId;
stakingPoolId: ObjectId;
minStakeAmount: bigint;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to check if a staking pool is unlocked
* @param inputs Check parameters including transaction, pool ID, and coin type
* @returns Transaction object argument for the boolean result
*/
isVaultUnlockedTxV1: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* Creates a transaction to get the remaining rewards for a staking pool
* @param inputs Remaining rewards parameters including transaction, pool ID, and coin type
* @returns Transaction object argument for the vector of remaining rewards
*/
remainingRewardsTxV1: (inputs: {
tx: Transaction;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}) => import("@mysten/sui/transactions").TransactionResult;
/**
* @deprecated use fetchBuildStakeTxV2 instead
* Builds a complete transaction for staking coins
* @param inputs Staking parameters including wallet address, lock enforcement, stake amount, pool ID, lock duration, and coin type
* @returns Complete transaction ready for signing and execution
*/
fetchBuildStakeTxV1: (inputs: ApiFarmsStakeBodyV1) => Promise<Transaction>;
/**
* Builds a complete transaction for staking coins
* @param inputs Staking parameters including wallet address, lock enforcement, stake amount, pool ID, lock duration, and coin type
* @returns Complete transaction ready for signing and execution
*/
fetchBuildStakeTxV2: (inputs: ApiFarmsStakeBody) => Promise<Transaction>;
/**
* @deprecated use fetchBuildDepositPrincipalTxV2 instead
* Builds a complete transaction for depositing additional principal to a staked position
* @param inputs Deposit parameters including wallet address, position ID, pool ID, deposit amount, and coin type
* @returns Complete transaction ready for signing and execution
*/
fetchBuildDepositPrincipalTxV1: (inputs: ApiFarmsDepositPrincipalBody) => Promise<Transaction>;
/**
* Builds a complete transaction for depositing additional principal to a staked position
* @param inputs Deposit parameters including wallet address, position ID, pool ID, deposit amount, and coin type
* @returns Complete transaction ready for signing and execution
*/
fetchBuildDepositPrincipalTxV2: (inputs: ApiFarmsDepositPrincipalBody) => Promise<Transaction>;
/**
* @deprecated use buildWithdrawPrincipalTxV2 instead
* Builds a complete transaction for withdrawing principal from a staked position
* @param inputs Withdraw parameters including wallet address, position ID, pool ID, withdraw amount, and coin type
* @returns Complete transaction ready for signing and execution
*/
buildWithdrawPrincipalTxV1: (inputs: {
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
withdrawAmount: Balance;
stakeCoinType: CoinType;
walletAddress: SuiAddress;
}) => Transaction;
/**
* Builds a complete transaction for withdrawing principal from a staked position
* @param inputs Withdraw parameters including wallet address, position ID, pool ID, withdraw amount, and coin type
* @returns Complete transaction ready for signing and execution
*/
buildWithdrawPrincipalTxV2: (inputs: {
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
withdrawAmount: Balance;
stakeCoinType: CoinType;
walletAddress: SuiAddress;
}) => Transaction;
/**
* @deprecated use buildUnstakeTxV2 instead
* Builds a complete transaction for unstaking (withdrawing and destroying a position)
* @param inputs Unstake parameters including wallet address, position ID, pool ID, reward coin types, and coin type
* @returns Complete transaction ready for signing and execution
*/
buildUnstakeTxV1: (inputs: ApiFarmsUnstakeBody) => Transaction;
/**
* Builds a complete transaction for unstaking (withdrawing and destroying a position)
* @param inputs Unstake parameters including wallet address, position ID, pool ID, reward coin types, and coin type
* @returns Complete transaction ready for signing and execution
*/
buildUnstakeTxV2: (inputs: ApiFarmsUnstakeBody) => Transaction;
/**
* @deprecated use buildUpdatePositionTxV2 instead
* Builds a transaction for updating a staked position
* @param parameters for updatePositionTx
* @returns Complete transaction ready for signing and execution
*/
buildUpdatePositionTxV1: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* Builds a transaction for updating a staked position
* @param parameters for updatePositionTx
* @returns Complete transaction ready for signing and execution
*/
buildUpdatePositionTx2: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* @deprecated use buildLockTxV2 instead
* Builds a transaction for locking a staked position
* @param parameters for lockTx
* @returns Complete transaction ready for signing and execution
*/
buildLockTxV1: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
lockDurationMs: Timestamp;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* Builds a transaction for locking a staked position
* @param parameters for lockTx
* @returns Complete transaction ready for signing and execution
*/
buildLockTxV2: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
lockDurationMs: Timestamp;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* @deprecated use buildRenewLockTxV2 instead
* Builds a transaction for renewing the lock on a staked position
* @param parameters for renewLockTx
* @returns Complete transaction ready for signing and execution
*/
buildRenewLockTxV1: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* Builds a transaction for renewing the lock on a staked position
* @param parameters for renewLockTx
* @returns Complete transaction ready for signing and execution
*/
buildRenewLockTxV2: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* @deprecated use buildUnlockTxV2 instead
* Builds a transaction for unlocking a staked position
* @param parameters for unlockTx
* @returns Complete transaction ready for signing and execution
*/
buildUnlockTxV1: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* Builds a transaction for unlocking a staked position
* @param parameters for unlockTx
* @returns Complete transaction ready for signing and execution
*/
buildUnlockTxV2: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
stakedPositionId: ObjectId;
stakingPoolId: ObjectId;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* @deprecated use buildHarvestRewardsTxV2 instead
* Builds a complete transaction for harvesting rewards from staked positions
* @param inputs Harvest parameters including wallet address, position IDs, pool ID, reward coin types, and optional claim as AfSui flag
* @returns Complete transaction ready for signing and execution
*/
buildHarvestRewardsTxV1: (inputs: ApiHarvestFarmsRewardsBody & {
tx?: Transaction;
}) => Transaction;
/**
* Builds a complete transaction for harvesting rewards from staked positions
* @param inputs Harvest parameters including wallet address, position IDs, pool ID, reward coin types, and optional claim as AfSui flag
* @returns Complete transaction ready for signing and execution
*/
buildHarvestRewardsTxV2: (inputs: ApiHarvestFarmsRewardsBody & {
tx?: Transaction;
}) => Transaction;
/**
* @deprecated use buildCreateStakingPoolTxV2 instead
* Builds a complete transaction for creating a new staking pool
* @param inputs Pool creation parameters including wallet address, lock enforcements, durations, multiplier, stake amount, and coin type
* @returns Complete transaction ready for signing and execution
*/
buildCreateStakingPoolTxV1: (inputs: ApiFarmsCreateStakingPoolBodyV1) => Transaction;
/**
* Builds a complete transaction for creating a new staking pool
* @param inputs Pool creation parameters including wallet address, lock enforcements, durations, multiplier, stake amount, and coin type
* @returns Complete transaction ready for signing and execution
*/
buildCreateStakingPoolTxV2: (inputs: ApiFarmsCreateStakingPoolBody) => Transaction;
/**
* @deprecated use fetchBuildInitializeStakingPoolRewardTxV2 instead
* Builds a complete transaction for initializing rewards for a staking pool
* @param inputs Initialize rewards parameters including wallet address, owner cap ID, pool ID, reward amount, emission parameters, stake coin type, and reward coin type
* @returns Complete transaction ready for signing and execution
*/
fetchBuildInitializeStakingPoolRewardTxV1: (inputs: ApiFarmsInitializeStakingPoolRewardBody) => Promise<Transaction>;
/**
* Builds a complete transaction for initializing rewards for a staking pool
* @param inputs Initialize rewards parameters including wallet address, owner cap ID, pool ID, reward amount, emission parameters, stake coin type, and reward coin type
* @returns Complete transaction ready for signing and execution
*/
fetchBuildInitializeStakingPoolRewardTxV2: (inputs: ApiFarmsInitializeStakingPoolRewardBody) => Promise<Transaction>;
/**
* @deprecated use fetchBuildTopUpStakingPoolRewardsTxV2 instead
* Builds a complete transaction for adding more rewards to a staking pool
* @param inputs Top up rewards parameters including wallet address, owner cap ID, pool ID, rewards array with amounts and coin types, and stake coin type
* @returns Complete transaction ready for signing and execution
*/
fetchBuildTopUpStakingPoolRewardsTxV1: (inputs: ApiFarmsTopUpStakingPoolRewardsBody) => Promise<Transaction>;
/**
* Builds a complete transaction for adding more rewards to a staking pool
* @param inputs Top up rewards parameters including wallet address, owner cap ID, pool ID, rewards array with amounts and coin types, and stake coin type
* @returns Complete transaction ready for signing and execution
*/
fetchBuildTopUpStakingPoolRewardsTxV2: (inputs: ApiFarmsTopUpStakingPoolRewardsBody) => Promise<Transaction>;
/**
* @deprecated use buildIncreaseStakingPoolRewardsEmissionsTxV2 instead
* Builds a complete transaction for increasing the emission rate of rewards for a staking pool
* @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
* @returns Complete transaction ready for signing and execution
*/
buildIncreaseStakingPoolRewardsEmissionsTxV1: (inputs: ApiFarmsIncreaseStakingPoolRewardsEmissionsBody) => Transaction;
/**
* Builds a complete transaction for increasing the emission rate of rewards for a staking pool
* @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
* @returns Complete transaction ready for signing and execution
*/
buildIncreaseStakingPoolRewardsEmissionsTxV2: (inputs: ApiFarmsIncreaseStakingPoolRewardsEmissionsBody) => Transaction;
/**
* @deprecated use buildSetStakingPoolMinStakeAmountTxV2 instead
* Builds a transaction for setting the minimum stake amount for a staking pool
* @param parameters for setStakingPoolMinStakeAmountTx
* @returns Complete transaction ready for signing and execution
*/
buildSetStakingPoolMinStakeAmountTxV1: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
ownerCapId: ObjectId;
stakingPoolId: ObjectId;
minStakeAmount: bigint;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* Builds a transaction for setting the minimum stake amount for a staking pool
* @param parameters for setStakingPoolMinStakeAmountTx
* @returns Complete transaction ready for signing and execution
*/
buildSetStakingPoolMinStakeAmountTxV2: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
ownerCapId: ObjectId;
stakingPoolId: ObjectId;
minStakeAmount: bigint;
stakeCoinType: CoinType;
}, "tx">) => Transaction;
/**
* @deprecated use buildGrantOneTimeAdminCapTxV2 instead
* Builds a transaction for granting a one-time admin capability for a staking pool
* @param parameters for grantOneTimeAdminCapTx
* @returns Complete transaction ready for signing and execution
*/
buildGrantOneTimeAdminCapTxV1: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
ownerCapId: ObjectId | TransactionArgument;
recipientAddress: SuiAddress;
rewardCoinType: CoinType;
}, "tx">) => Transaction;
/**
* Builds a transaction for granting a one-time admin capability for a staking pool
* @param parameters for grantOneTimeAdminCapTx
* @returns Complete transaction ready for signing and execution
*/
buildGrantOneTimeAdminCapTxV2: (inputs: {
walletAddress: SuiAddress;
} & Omit<{
tx: Transaction;
ownerCapId: ObjectId | TransactionArgument;
recipientAddress: SuiAddress;
rewardCoinType: CoinType;
}, "tx">) => Transaction;
private eventWrapperType;
/**
* Creates the event type for vault creation events
* @returns Fully qualified event type string
*/
private createdVaultEventType;
/**
* Creates the event type for reward initialization events
* @returns Fully qualified event type string
*/
private initializedRewardEventType;
/**
* Creates the event type for reward addition events
* @returns Fully qualified event type string
*/
private addedRewardEventType;
/**
* Creates the event type for emission increase events
* @returns Fully qualified event type string
*/
private increasedEmissionsEventType;
/**
* Creates the event type for emission update events
* @returns Fully qualified event type string
*/
private updatedEmissionsEventType;
/**
* Creates the event type for strict staking events
* @returns Fully qualified event type string
*/
private stakedEventType;
/**
* Creates the event type for relaxed staking events
* @returns Fully qualified event type string
*/
private stakedRelaxedEventType;
/**
* Creates the event type for position locking events
* @returns Fully qualified event type string
*/
private lockedEventType;
/**
* Creates the event type for position unlocking events
* @returns Fully qualified event type string
*/
private unlockedEventType;
/**
* Creates the event type for principal deposit events
* @returns Fully qualified event type string
*/
private depositedPrincipalEventType;
/**
* Creates the event type for principal withdrawal events
* @returns Fully qualified event type string
*/
private withdrewPrincipalEventType;
/**
* Creates the event type for reward harvesting events
* @returns Fully qualified event type string
*/
private harvestedRewardsEventType;
/**
* Checks if the input contains a one-time admin cap ID
* @param inputs FarmOwnerOrOneTimeAdminCap object
* @returns True if the input contains a one-time admin cap ID
*/
private static isFarmOneTimeAdminCapId;
/**
* Gets the appropriate cap ID from the input
* @param inputs FarmOwnerOrOneTimeAdminCap object
* @returns Either the owner cap ID or one-time admin cap ID
*/
private static farmCapId;
}
//# sourceMappingURL=farmsApi.d.ts.map