Persistence JS

https://github.com/persistenceOne/persistenceJS#readme

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.

Example

  • Send Tokens Use persistenceClient.wasm to send contracts via CW20 contract, persistenceClient.wasm is a SigningWasmClient so most of the functionalities are similar to @cosmjs/cosmwasm-stargate. The Signer for this example is a mnemonic wallet.

    Query Balance

    Please refer to cowmwasm for more information on how to use CosmWasm.

  • MsgSend A more flexible way to send transaction is by creating a Msg and brodcasting it. This is the preferd way for building large scale applications with multiple components.

    This method gives a lot more flexibility for an application, additional use case can be found in the helpers.

Gov Proposals

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

NOTE: It is the default method for uploading your own contract to the persistence chain.

Last updated

Was this helpful?