Farms

The Farms system provides functionality for managing staking pools and staked positions on the Sui network, allowing users to stake tokens and earn rewards.

Initialization

const afSdk = new Aftermath("MAINNET");
await afSdk.init(); // initialize provider

const farms = afSdk.Farms();

Constants

Farms.constants = {
	minimalRewardsToClaim: BigInt("1000000"), // Minimum rewards that can be claimed
};

Farms Class Methods

Staking Pool Management

// Get single staking pool
const pool = await farms.getStakingPool({
	objectId: "0x...",
});

// Get multiple staking pools
const pools = await farms.getStakingPools({
	objectIds: ["0x...", "0x..."],
});

// Get all staking pools
const allPools = await farms.getAllStakingPools();

Staked Positions

Create Staking Pool

FarmsStakedPosition Class

Represents and manages an individual staked position.

Position Information

Position Transactions

FarmsStakingPool Class

Manages a staking pool and its associated functionality.

Pool Information

Pool Transactions

Types

Farm Types

Example Usage

Last updated