@pryzm-finance/pryzm-orderbook-js
v0.0.2
Published
Javascript SDK for Pryzm Orderbook Contract
Downloads
6
Readme
PRYZM OrderBook JS
This package provides a javascript SDK to interact with the PRYZM orderbook contract.
Installation
npm install @pryzm-finance/pryzm-orderbook-js Usage
import { contracts } from "@pryzm-finance/pryzm-orderbook-js";
const signingClient = await SigningCosmWasmClient.connectWithSigner(rpc, signer);
const msgClient = new contracts.PryzmOrderbook.PryzmOrderbookClient(signingClient, walletAddress, contractAddress);
await msgClient.submitOrder({...})
const cosmWasmClient = await CosmWasmClient.connect(rpc);
const queryClient = new contracts.PryzmOrderbook.PryzmOrderbookQueryClient(cosmWasmClient, contractAddress)
await queryClient.params()
await queryClient.admin()
await queryClient.paused()Examples
You can find some examples in the sample project that depends on this library. Follow this for running the examples:
- Compile pryzm-orderbook-js locally:
pnpm install && pnpm run compile - Switch to examples directory and install the dependencies:
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