aftermath-ts-sdk - v3.3.3
    Preparing search index...

    Low-level farm API for reading farm-owned objects and composing Move transaction commands for V1 and V2 staking pools.

    • Command methods such as stakeTxV2 append one Move command to a
    • caller-owned Transaction. Methods beginning with build or fetchBuild
    • assemble a complete transaction. The fetchBuild methods may read owned coins through AftermathApi before they append commands. None of these methods submits a transaction to the network.

    Move abort descriptions are exposed through moveErrors. On-chain validation still applies when the completed transaction executes.

    Implements

    Index
    beginHarvestTxV1 beginHarvestTxV2 buildCreateStakingPoolTxV1 buildCreateStakingPoolTxV2 buildHarvestRewardsTxV1 buildHarvestRewardsTxV2 buildIncreaseStakingPoolRewardsEmissionsTxV1 buildIncreaseStakingPoolRewardsEmissionsTxV2 buildRemoveStakingPoolRewardTxV1 buildRemoveStakingPoolRewardTxV2 buildUnstakeTxV1 buildUnstakeTxV2 buildWithdrawPrincipalTxV1 buildWithdrawPrincipalTxV2 depositPrincipalTxV1 depositPrincipalTxV2 destroyStakedPositionTxV1 destroyStakedPositionTxV2 endHarvestTxV1 endHarvestTxV2 fetchBuildDepositPrincipalTxV1 fetchBuildDepositPrincipalTxV2 fetchBuildInitializeStakingPoolRewardTxV1 fetchBuildInitializeStakingPoolRewardTxV2 fetchBuildStakeTxV1 fetchBuildStakeTxV2 fetchBuildTopUpStakingPoolRewardsTxV1 fetchBuildTopUpStakingPoolRewardsTxV2 fetchOwnedPartialStakedPositions fetchOwnedStakingPoolOneTimeAdminCaps fetchOwnedStakingPoolOwnerCaps grantOneTimeAdminCapTxV1 grantOneTimeAdminCapTxV2 harvestRewardsTxV1 harvestRewardsTxV2 increaseStakingPoolRewardEmissionsTxV1 increaseStakingPoolRewardEmissionsTxV2 initializeStakingPoolRewardTxV1 initializeStakingPoolRewardTxV2 isVaultUnlockedTxV1 lockTxV1 lockTxV2 newStakingPoolTxV1 newStakingPoolTxV2 remainingRewardsTxV1 removeStakingPoolRewardTxV1 removeStakingPoolRewardTxV2 renewLockTxV1 renewLockTxV2 setStakingPoolMaxLockDurationMsTxV2 setStakingPoolMinLockDurationMsTxV2 setStakingPoolMinStakeAmountTxV1 setStakingPoolMinStakeAmountTxV2 shareStakingPoolTxV1 shareStakingPoolTxV2 stakeTxV1 stakeTxV2 topUpStakingPoolRewardTxV1 topUpStakingPoolRewardTxV2 transferOwnerCapTxV1 unlockTxV1 unlockTxV2 updatePositionTxV1 updatePositionTxV2 withdrawPrincipalTxV1 withdrawPrincipalTxV2
    addresses: FarmsAddresses

    Package and shared-object addresses used by the farm contracts.

    buildGrantOneTimeAdminCapTxV1: (
        inputs: { walletAddress: string } & Omit<
            {
                ownerCapId: string
                | TransactionArgument;
                recipientAddress: string;
                rewardCoinType: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    ownerCapId: string
                    | TransactionArgument;
                    recipientAddress: string;
                    rewardCoinType: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  ownerCapId: string
                  | TransactionArgument;
                  recipientAddress: string;
                  rewardCoinType: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    use buildGrantOneTimeAdminCapTxV2 instead Builds a transaction for granting a one-time admin capability for a staking pool

    buildGrantOneTimeAdminCapTxV2: (
        inputs: { walletAddress: string } & Omit<
            {
                ownerCapId: string
                | TransactionArgument;
                recipientAddress: string;
                rewardCoinType: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Builds a transaction for granting a one-time admin capability for a staking pool

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    ownerCapId: string
                    | TransactionArgument;
                    recipientAddress: string;
                    rewardCoinType: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  ownerCapId: string
                  | TransactionArgument;
                  recipientAddress: string;
                  rewardCoinType: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    buildLockTxV1: (
        inputs: { walletAddress: string } & Omit<
            {
                lockDurationMs: number;
                stakeCoinType: string;
                stakedPositionId: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    lockDurationMs: number;
                    stakeCoinType: string;
                    stakedPositionId: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  lockDurationMs: number;
                  stakeCoinType: string;
                  stakedPositionId: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    use buildLockTxV2 instead Builds a transaction for locking a staked position

    buildLockTxV2: (
        inputs: { walletAddress: string } & Omit<
            {
                lockDurationMs: number;
                stakeCoinType: string;
                stakedPositionId: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Builds a transaction for locking a staked position

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    lockDurationMs: number;
                    stakeCoinType: string;
                    stakedPositionId: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  lockDurationMs: number;
                  stakeCoinType: string;
                  stakedPositionId: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    buildRenewLockTxV1: (
        inputs: { walletAddress: string } & Omit<
            {
                stakeCoinType: string;
                stakedPositionId: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    stakeCoinType: string;
                    stakedPositionId: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  stakeCoinType: string;
                  stakedPositionId: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    use buildRenewLockTxV2 instead Builds a transaction for renewing the lock on a staked position

    buildRenewLockTxV2: (
        inputs: { walletAddress: string } & Omit<
            {
                stakeCoinType: string;
                stakedPositionId: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Builds a transaction for renewing the lock on a staked position

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    stakeCoinType: string;
                    stakedPositionId: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  stakeCoinType: string;
                  stakedPositionId: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    buildSetStakingPoolMaxLockDurationMsTxV2: (
        inputs: { walletAddress: string } & Omit<
            {
                lockDurationMs: bigint;
                ownerCapId: string;
                stakeCoinType: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Builds a V2 transaction that updates the pool's maximum lock duration in milliseconds.

    buildSetStakingPoolMinLockDurationMsTxV2: (
        inputs: { walletAddress: string } & Omit<
            {
                lockDurationMs: bigint;
                ownerCapId: string;
                stakeCoinType: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Builds a V2 transaction that updates the pool's minimum lock duration in milliseconds.

    buildSetStakingPoolMinStakeAmountTxV1: (
        inputs: { walletAddress: string } & Omit<
            {
                minStakeAmount: bigint;
                ownerCapId: string;
                stakeCoinType: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    minStakeAmount: bigint;
                    ownerCapId: string;
                    stakeCoinType: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  minStakeAmount: bigint;
                  ownerCapId: string;
                  stakeCoinType: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    use buildSetStakingPoolMinStakeAmountTxV2 instead Builds a transaction for setting the minimum stake amount for a staking pool

    buildSetStakingPoolMinStakeAmountTxV2: (
        inputs: { walletAddress: string } & Omit<
            {
                minStakeAmount: bigint;
                ownerCapId: string;
                stakeCoinType: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Builds a transaction for setting the minimum stake amount for a staking pool

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    minStakeAmount: bigint;
                    ownerCapId: string;
                    stakeCoinType: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  minStakeAmount: bigint;
                  ownerCapId: string;
                  stakeCoinType: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    buildUnlockTxV1: (
        inputs: { walletAddress: string } & Omit<
            {
                stakeCoinType: string;
                stakedPositionId: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    stakeCoinType: string;
                    stakedPositionId: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  stakeCoinType: string;
                  stakedPositionId: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    use buildUnlockTxV2 instead Builds a transaction for unlocking a staked position

    buildUnlockTxV2: (
        inputs: { walletAddress: string } & Omit<
            {
                stakeCoinType: string;
                stakedPositionId: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Builds a transaction for unlocking a staked position

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    stakeCoinType: string;
                    stakedPositionId: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  stakeCoinType: string;
                  stakedPositionId: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    buildUpdatePositionTx2: (
        inputs: { walletAddress: string } & Omit<
            {
                stakeCoinType: string;
                stakedPositionId: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Builds a transaction for updating a staked position

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    stakeCoinType: string;
                    stakedPositionId: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  stakeCoinType: string;
                  stakedPositionId: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    buildUpdatePositionTxV1: (
        inputs: { walletAddress: string } & Omit<
            {
                stakeCoinType: string;
                stakedPositionId: string;
                stakingPoolId: string;
                tx: Transaction;
            },
            "tx",
        >,
    ) => Transaction = ...

    Type Declaration

      • (
            inputs: { walletAddress: string } & Omit<
                {
                    stakeCoinType: string;
                    stakedPositionId: string;
                    stakingPoolId: string;
                    tx: Transaction;
                },
                "tx",
            >,
        ): Transaction
      • Parameters

        • inputs: { walletAddress: string } & Omit<
              {
                  stakeCoinType: string;
                  stakedPositionId: string;
                  stakingPoolId: string;
                  tx: Transaction;
              },
              "tx",
          >

        Returns Transaction

        Complete transaction ready for signing and execution

    use buildUpdatePositionTxV2 instead Builds a transaction for updating a staked position

    eventTypes: {
        addedRewardV1: string;
        addedRewardV2: string;
        createdVaultV1: string;
        createdVaultV2: string;
        depositedPrincipalV1: string;
        depositedPrincipalV2: string;
        harvestedRewardsV1: string;
        harvestedRewardsV2: string;
        increasedEmissionsV1: string;
        initializedRewardV1: string;
        initializedRewardV2: string;
        lockedV1: string;
        lockedV2: string;
        stakedRelaxedV1: string;
        stakedV1: string;
        stakedV2: string;
        unlockedV1: string;
        unlockedV2: string;
        updatedEmissionsV2: string;
        withdrewPrincipalV1: string;
        withdrewPrincipalV2: string;
    }

    Fully qualified event types used by the farm event queries.

    Type Declaration

    • addedRewardV1: string

      V1 reward-added event type.

    • addedRewardV2: string

      V2 reward-added event type.

    • createdVaultV1: string

      V1 pool-created event type.

    • createdVaultV2: string

      V2 pool-created event type.

    • depositedPrincipalV1: string

      V1 principal-deposit event type.

    • depositedPrincipalV2: string

      V2 principal-deposit event type.

    • harvestedRewardsV1: string

      V1 reward-harvest event type.

    • harvestedRewardsV2: string

      V2 reward-harvest event type.

    • increasedEmissionsV1: string

      V1 emission-increase event type.

    • initializedRewardV1: string

      V1 reward-initialized event type.

    • initializedRewardV2: string

      V2 reward-initialized event type.

    • lockedV1: string

      V1 lock event type.

    • lockedV2: string

      V2 lock event type.

    • stakedRelaxedV1: string

      V1 relaxed-stake event type.

    • stakedV1: string

      V1 strict-stake event type.

    • stakedV2: string

      V2 strict-stake event type.

    • unlockedV1: string

      V1 unlock event type.

    • unlockedV2: string

      V2 unlock event type.

    • updatedEmissionsV2: string

      V2 emission-update event type.

    • withdrewPrincipalV1: string

      V1 principal-withdrawal event type.

    • withdrewPrincipalV2: string

      V2 principal-withdrawal event type.

    moveErrors: MoveErrors

    Move abort messages keyed by package, module, and numeric error code.

    objectTypes: {
        stakedPositionV1: string;
        stakedPositionV2: string;
        stakingPoolOneTimeAdminCapV1: string;
        stakingPoolOneTimeAdminCapV2: string;
        stakingPoolOwnerCapV1: string;
        stakingPoolOwnerCapV2: string;
    }

    Fully qualified object types used for V1 and V2 ownership reads.

    Type Declaration

    • stakedPositionV1: string

      V1 staked-position object type.

    • stakedPositionV2: string

      V2 staked-position object type.

    • stakingPoolOneTimeAdminCapV1: string

      V1 one-time-admin-cap object type.

    • stakingPoolOneTimeAdminCapV2: string

      V2 one-time-admin-cap object type.

    • stakingPoolOwnerCapV1: string

      V1 owner-cap object type.

    • stakingPoolOwnerCapV2: string

      V2 owner-cap object type, including its authority type arguments.

    • Parameters

      • inputs: { stakeCoinType: string; stakingPoolId: string; tx: Transaction }

        Begin harvest parameters including transaction, pool ID, and coin type

      Returns TransactionResult

      Transaction object argument for the harvest metadata

      use beginHarvestTxV2 instead Creates a transaction to begin the reward harvesting process (original version)

    • Creates a transaction to begin the reward harvesting process

      Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Begin harvest parameters including transaction, position ID, pool ID, and coin type

      Returns TransactionResult

      Transaction object argument for the harvest cap

    • Parameters

      • inputs: ApiHarvestFarmsRewardsBody & { tx?: Transaction }

        Harvest parameters including wallet address, position IDs, pool ID, reward coin types, and optional claim as AfSui flag

      Returns Transaction

      Complete transaction ready for signing and execution

      use buildHarvestRewardsTxV2 instead Builds a complete transaction for harvesting rewards from staked positions

    • Builds a complete transaction for harvesting rewards from staked positions

      Parameters

      • inputs: ApiHarvestFarmsRewardsBody & { tx?: Transaction }

        Harvest parameters including wallet address, position IDs, pool ID, reward coin types, and optional claim as AfSui flag

      Returns Transaction

      Complete transaction ready for signing and execution

    • Builds a transaction for removing undistributed reward coins from a staking pool (V1). Requires the pool OwnerCap. The removal is specific to a rewardCoinType.

      Parameters

      • inputs: {
            ownerCapId: string;
            rewards: { rewardAmount: bigint; rewardCoinType: string }[];
            stakeCoinType: string;
            stakingPoolId: string;
            walletAddress: string;
        }

      Returns Transaction

      Complete transaction ready for signing and execution

    • Builds a transaction for removing undistributed reward coins from a staking pool (V2). Requires the pool OwnerCap and includes the on-chain version object.

      Parameters

      • inputs: {
            ownerCapId: string;
            rewards: { rewardAmount: bigint; rewardCoinType: string }[];
            stakeCoinType: string;
            stakingPoolId: string;
            walletAddress: string;
        }

      Returns Transaction

      Complete transaction ready for signing and execution

    • Parameters

      • inputs: ApiFarmsUnstakeBody

        Unstake parameters including wallet address, position ID, pool ID, reward coin types, and coin type

      Returns Transaction

      Complete transaction ready for signing and execution

      use buildUnstakeTxV2 instead Builds a complete transaction for unstaking (withdrawing and destroying a position)

    • Builds a complete transaction for unstaking (withdrawing and destroying a position)

      Parameters

      • inputs: ApiFarmsUnstakeBody

        Unstake parameters including wallet address, position ID, pool ID, reward coin types, and coin type

      Returns Transaction

      Complete transaction ready for signing and execution

    • Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            walletAddress: string;
            withdrawAmount: bigint;
        }

        Withdraw parameters including wallet address, position ID, pool ID, withdraw amount, and coin type

      Returns Transaction

      Complete transaction ready for signing and execution

      use buildWithdrawPrincipalTxV2 instead Builds a complete transaction for withdrawing principal from a staked position

    • Builds a complete transaction for withdrawing principal from a staked position

      Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            walletAddress: string;
            withdrawAmount: bigint;
        }

        Withdraw parameters including wallet address, position ID, pool ID, withdraw amount, and coin type

      Returns Transaction

      Complete transaction ready for signing and execution

    • Parameters

      • inputs: {
            stakeCoinId: string | TransactionArgument;
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Deposit parameters including transaction, position ID, pool ID, coin ID, and coin type

      Returns TransactionResult

      Transaction command to deposit principal

      use depositPrincipalTxV2 instead Creates a transaction to deposit additional principal to a staked position (original version)

    • Creates a transaction to deposit additional principal to a staked position

      Parameters

      • inputs: {
            stakeCoinId: string | TransactionArgument;
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Deposit parameters including transaction, position ID, pool ID, coin ID, and coin type

      Returns TransactionResult

      Transaction command to deposit principal

    • Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Destroy parameters including transaction, position ID, pool ID, and coin type

      Returns TransactionResult

      Transaction command to destroy the position

      use destroyStakedPositionTxV2 instead Creates a transaction to destroy a staked position (original version)

    • Creates a transaction to destroy a staked position

      Parameters

      • inputs: { stakeCoinType: string; stakedPositionId: string; tx: Transaction }

        Destroy parameters including transaction, position ID, and coin type

      Returns TransactionResult

      Transaction command to destroy the position

    • Parameters

      • inputs: {
            harvestedRewardsEventMetadataId: string | TransactionArgument;
            tx: Transaction;
        }

        End harvest parameters including transaction and harvest metadata

      Returns TransactionResult

      Transaction command to end the harvest

      use endHarvestTxV2 instead Creates a transaction to end the reward harvesting process (original version)

    • Creates a transaction to end the reward harvesting process

      Parameters

      • inputs: { harvestRewardsCap: string | TransactionArgument; tx: Transaction }

        End harvest parameters including transaction and harvest cap

      Returns TransactionResult

      Transaction command to end the harvest

    • Parameters

      Returns Promise<Transaction>

      Complete transaction ready for signing and execution

      use fetchBuildDepositPrincipalTxV2 instead Builds a complete transaction for depositing additional principal to a staked position

    • Builds a complete transaction for depositing additional principal to a staked position

      Parameters

      Returns Promise<Transaction>

      Complete transaction ready for signing and execution

    • Parameters

      • inputs: ApiFarmsInitializeStakingPoolRewardBody

        Initialize rewards parameters including wallet address, owner cap ID, pool ID, reward amount, emission parameters, stake coin type, and reward coin type

      Returns Promise<Transaction>

      Complete transaction ready for signing and execution

      use fetchBuildInitializeStakingPoolRewardTxV2 instead Builds a complete transaction for initializing rewards for a staking pool

    • Parameters

      • inputs: ApiFarmsStakeBodyV1

        Staking parameters including wallet address, lock enforcement, stake amount, pool ID, lock duration, and coin type

      Returns Promise<Transaction>

      Complete transaction ready for signing and execution

      use fetchBuildStakeTxV2 instead Builds a complete transaction for staking coins

    • Builds a complete transaction for staking coins

      Parameters

      • inputs: ApiFarmsStakeBody

        Staking parameters including wallet address, lock enforcement, stake amount, pool ID, lock duration, and coin type

      Returns Promise<Transaction>

      Complete transaction ready for signing and execution

    • Parameters

      • inputs: ApiFarmsTopUpStakingPoolRewardsBody

        Top up rewards parameters including wallet address, owner cap ID, pool ID, rewards array with amounts and coin types, and stake coin type

      Returns Promise<Transaction>

      Complete transaction ready for signing and execution

      use fetchBuildTopUpStakingPoolRewardsTxV2 instead Builds a complete transaction for adding more rewards to a staking pool

    • Parameters

      • inputs: {
            ownerCapId: string | TransactionArgument;
            recipientAddress: string;
            rewardCoinType: string;
            tx: Transaction;
        }

        Grant parameters including transaction, owner cap ID, recipient address, and reward coin type

      Returns TransactionResult

      Transaction command to grant the one-time admin cap

      use grantOneTimeAdminCapTxV2 instead Creates a transaction to grant a one-time admin capability for a staking pool (original version)

    • Creates a transaction to grant a one-time admin capability for a staking pool

      Parameters

      • inputs: {
            ownerCapId: string | TransactionArgument;
            recipientAddress: string;
            rewardCoinType: string;
            tx: Transaction;
        }

        Grant parameters including transaction, owner cap ID, recipient address, and reward coin type

      Returns TransactionResult

      Transaction command to grant the one-time admin cap

    • Parameters

      • inputs: {
            harvestedRewardsEventMetadataId: string | TransactionArgument;
            rewardCoinType: string;
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Harvest parameters including transaction, position ID, pool ID, harvest metadata, stake coin type, and reward coin type

      Returns TransactionResult

      Transaction object argument for the harvested rewards

      use harvestRewardsTxV2 instead Creates a transaction to harvest rewards from a staked position (original version)

    • Creates a transaction to harvest rewards from a staked position

      Parameters

      • inputs: {
            harvestRewardsCap: string | TransactionArgument;
            rewardCoinType: string;
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Harvest parameters including transaction, harvest cap, position ID, pool ID, stake coin type, and reward coin type

      Returns TransactionResult

      Transaction object argument for the harvested rewards

    • Parameters

      • inputs: {
            emissionRate: bigint;
            emissionScheduleMs: number;
            ownerCapId: string;
            rewardCoinType: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Increase emissions parameters including transaction, owner cap ID, pool ID, emission parameters, stake coin type, and reward coin type

      Returns TransactionResult

      Transaction command to update emissions

      use increaseStakingPoolRewardEmissionsTxV2 instead Creates a transaction to increase the emission rate for a staking pool reward (original version)

    • Creates a transaction to increase the emission rate for a staking pool reward

      Parameters

      • inputs: {
            emissionRate: bigint;
            emissionScheduleMs: number;
            ownerCapId: string;
            rewardCoinType: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Increase emissions parameters including transaction, owner cap ID, pool ID, emission parameters, stake coin type, and reward coin type

      Returns TransactionResult

      Transaction command to update emissions

    • Parameters

      • inputs: {
            emissionDelayTimestampMs: number;
            emissionRate: bigint;
            emissionScheduleMs: number;
            rewardCoinId: string | TransactionArgument;
            rewardCoinType: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        } & FarmOwnerOrOneTimeAdminCap

        Initialize reward parameters including transaction, pool ID, reward coin ID, emission parameters, stake coin type, and reward coin type

      Returns TransactionResult

      Transaction command to initialize the reward

      use initializeStakingPoolRewardTxV2 instead Creates a transaction to initialize rewards for a staking pool (original version)

    • Creates a transaction to initialize rewards for a staking pool

      Parameters

      • inputs: {
            emissionDelayTimestampMs: number;
            emissionRate: bigint;
            emissionScheduleMs: number;
            rewardCoinId: string | TransactionArgument;
            rewardCoinType: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        } & FarmOwnerOrOneTimeAdminCap

        Initialize reward parameters including transaction, pool ID, reward coin ID, emission parameters, stake coin type, and reward coin type

      Returns TransactionResult

      Transaction command to initialize the reward

    • Creates a transaction to check if a staking pool is unlocked

      Parameters

      • inputs: { stakeCoinType: string; stakingPoolId: string; tx: Transaction }

        Check parameters including transaction, pool ID, and coin type

      Returns TransactionResult

      Transaction object argument for the boolean result

    • Parameters

      • inputs: {
            lockDurationMs: number;
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Lock parameters including transaction, position ID, pool ID, lock duration, and coin type

      Returns TransactionResult

      Transaction command to lock the position

      use lockTxV2 instead Creates a transaction to lock a staked position for a specific duration (original version)

    • Creates a transaction to lock a staked position for a specific duration

      Parameters

      • inputs: {
            lockDurationMs: number;
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Lock parameters including transaction, position ID, pool ID, lock duration, and coin type

      Returns TransactionResult

      Transaction command to lock the position

    • Parameters

      • inputs: {
            lockEnforcement: FarmsLockEnforcement;
            maxLockDurationMs: number;
            maxLockMultiplier: bigint;
            minLockDurationMs: number;
            minStakeAmount: bigint;
            stakeCoinType: string;
            tx: Transaction;
        }

        Pool creation parameters including transaction, lock enforcement, durations, multiplier, stake amount, and coin type

      Returns TransactionResult

      Transaction objects for the vault and owner cap

      use newStakingPoolTxV2 instead Creates a transaction for the deprecated version of staking pool creation

    • Creates a transaction for the current version of staking pool creation

      Parameters

      • inputs: {
            lockEnforcements: FarmsLockEnforcement[];
            maxLockDurationMs: number;
            maxLockMultiplier: bigint;
            minLockDurationMs: number;
            minStakeAmount: bigint;
            stakeCoinType: string;
            tx: Transaction;
        }

        Pool creation parameters including transaction, lock enforcements array, durations, multiplier, stake amount, and coin type

      Returns TransactionResult

      Transaction objects for the vault and authority cap

    • Creates a transaction to get the remaining rewards for a staking pool

      Parameters

      • inputs: { stakeCoinType: string; stakingPoolId: string; tx: Transaction }

        Remaining rewards parameters including transaction, pool ID, and coin type

      Returns TransactionResult

      Transaction object argument for the vector of remaining rewards

    • Creates a Move call (V1) to remove undistributed reward coins from a staking pool. Only callable by the pool owner (validated via ownerCapId). This does not claw back rewards already accrued/claimed by stakers—only reduces the remaining reward balance for the specified rewardCoinType.

      Parameters

      • inputs: {
            ownerCapId: string;
            rewardAmount: bigint;
            rewardCoinType: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Transaction assembly parameters

        • ownerCapId: string

          OwnerCap object ID authorizing the removal

        • rewardAmount: bigint

          Amount to remove (base units, encoded as u64)

        • rewardCoinType: string

          Reward coin type to be removed

        • stakeCoinType: string

          Stake coin type argument for the vault module

        • stakingPoolId: string

          The staking pool (vault) object ID

        • tx: Transaction

          Transaction instance to append the command to

      Returns TransactionResult

      The transaction command added to tx

    • Creates a Move call (V2) to remove undistributed reward coins from a staking pool. Only callable by the pool owner (validated via ownerCapId). Includes the protocol version object as required by V2 modules.

      Parameters

      • inputs: {
            ownerCapId: string;
            rewardAmount: bigint;
            rewardCoinType: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Transaction assembly parameters

        • ownerCapId: string

          OwnerCap object ID authorizing the removal

        • rewardAmount: bigint

          Amount to remove (base units, encoded as u64)

        • rewardCoinType: string

          Reward coin type to be removed

        • stakeCoinType: string

          Stake coin type argument for the vault module

        • stakingPoolId: string

          The staking pool (vault) object ID

        • tx: Transaction

          Transaction instance to append the command to

      Returns TransactionResult

      The transaction command added to tx

    • Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Renew lock parameters including transaction, position ID, pool ID, and coin type

      Returns TransactionResult

      Transaction command to renew the lock

      use renewLockTxV2 instead Creates a transaction to renew the lock on a staked position (original version)

    • Creates a transaction to renew the lock on a staked position

      Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Renew lock parameters including transaction, position ID, pool ID, and coin type

      Returns TransactionResult

      Transaction command to renew the lock

    • Creates a transaction command to set the maximum lock duration (ms) for a staking pool. Owner-cap only; V2 vault module.

      Parameters

      • inputs: {
            lockDurationMs: bigint;
            ownerCapId: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

      Returns TransactionResult

    • Creates a transaction command to set the minimum lock duration (ms) for a staking pool. Owner-cap only; V2 vault module. Mirrors setStakingPoolMinStakeAmountTxV2.

      Parameters

      • inputs: {
            lockDurationMs: bigint;
            ownerCapId: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

      Returns TransactionResult

    • Parameters

      • inputs: {
            minStakeAmount: bigint;
            ownerCapId: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Min stake amount parameters including transaction, owner cap ID, pool ID, minimum amount, and stake coin type

      Returns TransactionResult

      Transaction command to set the minimum stake amount

      use setStakingPoolMinStakeAmountTxV2 instead Creates a transaction to set the minimum stake amount for a staking pool (original version)

    • Creates a transaction to set the minimum stake amount for a staking pool

      Parameters

      • inputs: {
            minStakeAmount: bigint;
            ownerCapId: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Min stake amount parameters including transaction, owner cap ID, pool ID, minimum amount, and stake coin type

      Returns TransactionResult

      Transaction command to set the minimum stake amount

    • Parameters

      • inputs: {
            stakeCoinType: string;
            stakingPoolId: string | TransactionArgument;
            tx: Transaction;
        }

        Share pool parameters including transaction, pool ID, and coin type

      Returns TransactionResult

      Transaction command to share the pool

      use shareStakingPoolTxV2 instead Creates a transaction to share a staking pool, making it public

    • Creates a transaction to share a staking pool, making it public

      Parameters

      • inputs: {
            stakeCoinType: string;
            stakingPoolId: string | TransactionArgument;
            tx: Transaction;
        }

        Share pool parameters including transaction, pool ID, and coin type

      Returns TransactionResult

      Transaction command to share the pool

    • Parameters

      • inputs: {
            lockDurationMs: number;
            stakeCoinId: string | TransactionArgument;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Staking parameters including transaction, pool ID, coin ID, lock duration, and coin type

      Returns TransactionResult

      Transaction object argument for StakedPosition

      use stakeTxV2 instead Creates a transaction to stake coins in a staking pool (original version)

    • Creates a transaction to stake coins in a staking pool

      Parameters

      • inputs: {
            lockDurationMs: number;
            lockEnforcement: FarmsLockEnforcement;
            stakeCoinId: string | TransactionArgument;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Staking parameters including transaction, pool ID, coin ID, lock duration, lock enforcement, and coin type

      Returns TransactionResult

      Transaction object argument for StakedPosition

    • Parameters

      • inputs: {
            rewardCoinId: string | TransactionArgument;
            rewardCoinType: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        } & FarmOwnerOrOneTimeAdminCap

        Top up parameters including transaction, pool ID, reward coin ID, stake coin type, and reward coin type

      Returns TransactionResult

      Transaction command to add rewards

      use topUpStakingPoolRewardTxV2 instead Creates a transaction to add more rewards to a staking pool (original version)

    • Creates a transaction to add more rewards to a staking pool

      Parameters

      • inputs: {
            rewardCoinId: string | TransactionArgument;
            rewardCoinType: string;
            stakeCoinType: string;
            stakingPoolId: string;
            tx: Transaction;
        } & FarmOwnerOrOneTimeAdminCap

        Top up parameters including transaction, pool ID, reward coin ID, stake coin type, and reward coin type

      Returns TransactionResult

      Transaction command to add rewards

    • Parameters

      • inputs: {
            ownerCapId: string | TransactionArgument;
            recipientAddress: string;
            tx: Transaction;
        }

        Transfer parameters including transaction, owner cap ID, and recipient address

      Returns TransactionResult

      Transaction command to transfer the owner cap

      use transferOwnerCapTxV2 instead Creates a transaction to transfer ownership of a staking pool

    • Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Unlock parameters including transaction, position ID, pool ID, and coin type

      Returns TransactionResult

      Transaction command to unlock the position

      use unlockTxV2 instead Creates a transaction to unlock a staked position (original version)

    • Creates a transaction to unlock a staked position

      Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Unlock parameters including transaction, position ID, pool ID, and coin type

      Returns TransactionResult

      Transaction command to unlock the position

    • Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Update parameters including transaction, position ID, pool ID, and coin type

      Returns TransactionResult

      Transaction command to update the position

      use updatePositionTxV2 instead Creates a transaction to update a staked position, recalculating rewards (original version)

    • Creates a transaction to update a staked position, recalculating rewards

      Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
        }

        Update parameters including transaction, position ID, pool ID, and coin type

      Returns TransactionResult

      Transaction command to update the position

    • Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
            withdrawAmount: bigint;
        }

        Withdrawal parameters including transaction, position ID, pool ID, amount, and coin type

      Returns TransactionResult

      Transaction object argument for the withdrawn Coin

      use withdrawPrincipalTxV2 instead Creates a transaction to withdraw principal from a staked position (original version)

    • Creates a transaction to withdraw principal from a staked position

      Parameters

      • inputs: {
            stakeCoinType: string;
            stakedPositionId: string;
            stakingPoolId: string;
            tx: Transaction;
            withdrawAmount: bigint;
        }

        Withdrawal parameters including transaction, position ID, pool ID, amount, and coin type

      Returns TransactionResult

      Transaction object argument for the withdrawn Coin