Persistence Docs
K

Persistence JS

Setup

npm install persistenceonejs

Usage

PersistenceClient consists of a signingStargateClient and a SigningCowsmWasmClient, referred to as core and wasm respectively.

For querying use PersistenceClient.query, this gives you a tmclient. Usage for a tmclient for querying is based on cosmos-sdk i.e. query path is taken from module locations.

import { PersistenceClient } from "persistenceonejs";

const alice = await PersistenceClient.init(...mnemonic);
const codes = await alice.query.cosmwasm.wasm.v1.codes({});
console.log(codes);

Example

import colors from '@/theme/colors' const sendMsg = { typeUrl: "/cosmos.bank.v1beta1.tx.MsgSend", value: cosmos.bank.v1beta1.MsgSend.fromJSON({ fromAddress: from, toAddress: to, amount: amount})}; const res = await alice.core.signAndBroadcast( account.address, [sendMsg], { amount: [{ denom: "uxprt", amount: "10000" }], gas: "100" }, "test send", ); ```

This method gives a lot more flexibility for an application, additional use case can be found in the [helpers](https://github.com/persistenceOne/persistenceJS/blob/master/examples/helpers).

Gov Proposals

This script lets you upload and initiate a contract via Gov proposals.

P

PersistenceJS

github.com

Previous

Uploading a Contract

Next

Persistence SDK