This package provides a javascript SDK to interact with the yLaunch contracts.
npm install @pryzm-finance/ylaunch-js
import { contracts } from "@pryzm-finance/ylaunch-js";
const signingClient = await SigningCosmWasmClient.connectWithSigner(rpc, signer);
const factoryMsgClient = new contracts.YlaunchFactory.YlaunchFactoryClient(signingClient, walletAddress, contractAddress);
await factoryMsgClient.instantiateLaunch({..}, "auto", memo, []);
await factoryMsgClient.updateStakingContractCodeInfo({..}, "auto", memo, []);
const stakingMsgClient = new contracts.YlaunchStaking.YlaunchStakingClient(signingClient, walletAddress, contractAddress);
await stakingMsgClient.bond({..}, "auto", memo, []);
await stakingMsgClient.unbond({..}, "auto", memo, []);
await stakingMsgClient.exit({..}, "auto", memo, []);
await stakingMsgClient.claimReward({..}, "auto", memo, []);
await stakingMsgClient.claimYStakingYield({..}, "auto", memo, []);
const cosmWasmClient = await CosmWasmClient.connect(rpc);
const factoryQueryClient = new contracts.YlaunchFactory.YlaunchFactoryQueryClient(cosmWasmClient, contractAddress)
await factoryQueryClient.contracts({ .. })
await factoryQueryClient.stakingContractCodeInfo({ .. })
const stakingQueryClient = new contracts.YlaunchStaking.YlaunchStakingQueryClient(cosmWasmClient, contractAddress)
await stakingQueryClient.pools({ .. })
await stakingQueryClient.positions({ .. })
await stakingQueryClient.claimableYStakingYield()
This project uses @cosmwasm/ts-codegen
tool to generate the typescript code from the contract schema files. The schema
json files are located in the schema
directory. To generate the typescript code from the schema files, follow this:
- Install the dependencies:
pnpm install
- Run the codegen script:
pnpm run codegen