npm i aftermath-ts-sdk
Create an instance of Aftermath
for ease of use to make calls to our server, or create an instance of AftermathApi
for finer control of transaction construction.
const afSdk = new Aftermath("MAINNET"); // "MAINNET" | "TESTNET" | "DEVNET"
const router = afSdk.Router();
const pools = afSdk.Pools();
const staking = afSdk.Staking();
const farms = afSdk.Farms();
const fullnodeEndpoint = "https://fullnode.mainnet.sui.io";
const addresses = {...};
const afApi = new AftermathApi(
new SuiClient({
transport: new SuiHTTPTransport({
url: fullnodeEndpoint,
}),
}),
addresses,
new IndexerCaller("MAINNET"), // "MAINNET" | "TESTNET" | "DEVNET"
);
const poolsApi = afApi.Pools();
const stakinApi = afApi.Staking();
const farmsApi = afApi.Farms();
Find the complete documentation for using our router, AMM pools, liquid staking, and more in our GitBook.