@pryzm-finance/pryzm-nexus-js
v0.1.4
Published
Javascript SDK for Pryzm Nexus Contract
Downloads
95
Keywords
Readme
PRYZM Nexus JS
This package provides a javascript SDK to interact with the PRYZM Nexus contract.
Installation
npm install @pryzm-finance/pryzm-nexus-js
Usage
import { contracts } from "@pryzm-finance/pryzm-nexus-js";
const signingClient = await SigningCosmWasmClient.connectWithSigner(rpc, signer);
const msgClient = new contracts.PryzmNexus.PryzmNexusClient(signingClient, walletAddress, contractAddress);
await msgClient.zeroImpactJoinAssetToYamm({..}, "auto", memo, []);
await msgClient.zeroImpactJoinAssetToNested({..}, "auto", memo, []);
const cosmWasmClient = await CosmWasmClient.connect(rpc);
const queryClient = new contracts.PryzmNexus.PryzmNexusQueryClient(cosmWasmClient, contractAddress)
await queryClient.simulateZeroImpactJoinAssetToYamm({ .. })
await queryClient.simulateZeroImpactJoinAssetToNested({ .. })
Examples
You can find some examples in the sample project that depends on this library. Follow this for running the examples:
- Compile pryzm-nexus-js locally:
pnpm install && pnpm run compile
- Switch to examples directory and install the depndeencies:
cd examples && pnpm install
- Run the examples:
pnpm run query pnpm run tx
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:
- Install the dependencies:
pnpm install
- Run the codegen script:
pnpm run codegen
Publishing
Compile the project and publish it to npm registry:
pnpm publish