orca-so / typescript-sdk

The Orca SDK contains a set of simple to use APIs to allow developers to integrate with the Orca platform.
155 stars 49 forks source link

Farm harvest, getHarvestableAmount api #49

Closed ghost closed 3 years ago

ghost commented 3 years ago

Changes

Usage

const farm = orca.getFarm(OrcaFarmConfig.ORCA_SOL_AQ);
const amount = await farm.getHarvestableAmount(owner.publicKey); // <-- NEW API
console.log("Harvestable amount:", amount.toNumber());

const harvestPayload = await farm.harvest(owner); // <-- NEW API
const harvestTxId = await harvestPayload.execute();
console.log("Harvest complete:", harvestTxId);