@pryzm-finance/ylaunch-js
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

yLaunch JS

This package provides a javascript SDK to interact with the yLaunch contracts.

Installation

npm install @pryzm-finance/ylaunch-js

Usage

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()

Development

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:

  1. Install the dependencies:
    pnpm install
  2. Run the codegen script:
    pnpm run codegen

Readme

Keywords

none

Package Sidebar

Install

npm i @pryzm-finance/ylaunch-js

Weekly Downloads

12

Version

0.1.0

License

SEE LICENSE IN LICENSE.md

Unpacked Size

32.8 kB

Total Files

13

Last publish

Collaborators

  • madreza
  • mehrdadpfg
  • aminabs
  • saad.najafi