@pylon-protocol/sdk
Official Javascript & Typescript SDK to interact with Pylon Protocol.
Getting Started
Installing Pylon Protocol SDK
$ yarn add @pylon-protocol/sdk
Using Pylon SDK
You need to provide a LCDClient instance on Pylon
constructor.
import { LCDClient } from '@terra-money/terra.js';
import { Pylon } from '@pylon-protocol/sdk';
const lcd = new LCDClient({
URL: 'https://columbus-lcd.terra.dev',
chainID: 'columbus-5',
isClassic: true,
});
const pylon = new Pylon(lcd);
Interacting with Pylon Gateway
Listing Projects in Pylon Gateway
const projects = await pylon.gateway.listProjects();
const mine = projects.find((project) => project.symbol === 'MINE');
console.log(mine);
// {
// "type": "token",
// "symbol": "MINE",
// "name": "Pylon Protocol",
// ...
Deposit into Project
const mine = await pylon.gateway.getProject('MINE');
const { transactions } = await mine.pools['A'].deposit(myWallet.address, 10_000 /* UST */);
console.log(await mine.pools['A'].statusOf(myWallet.address)]);
// {
// "stakedUst": 10000,
// "rewardTokens": 1.3233,
// ...
Participating on the Governance
const polls = await pylon.governance.listPolls();
const transactions = await pylon.governance.createPoll(myAddress, '[General] Example poll', ...)