Skip to content

Official client-side JavaScript library for the MediBloc platform.

Notifications You must be signed in to change notification settings

medibloc/panacea-js

Repository files navigation

Panacea Javascript SDK

The panacea-js is the official Panacea Javascript SDK written in Typescript, powered by CosmJS.

The panacea-js extends the CosmJS in order to provide Panacea-specific features (AOL, DID, PNFT). So, it exposes CosmJS basic functions as they are, such as connectWithSigner and sendTokens.

Usage

Installation

yarn add @medibloc/panacea-js \
  @cosmjs/proto-signing@0.32.3 \
  @cosmjs/stargate@0.32.3 \
  cosmjs-types@0.9.0

Examples

A list of examples can be found at the example.md.

Contribution

Install dependencies and build the project.

yarn install
yarn build

To run simple unit tests,

yarn test

To run integration tests with panacea-core, start a panacea-core daemon first.

docker run --rm -d \
  -e CHAIN_ID="chain-1" \
  -e MNEMONIC="..." \
  -p 26657:26657 \
  -v $(pwd)/scripts:/root/scripts \
  --name core \
  ghcr.io/medibloc/panacea-core:v2.2.0 \
  bash /root/scripts/panacea-core/init.sh

Then, the integration tests can be run with the following environment variables.

PANACEAD_ENABLED=true \
TENDERMINT_URL="http://localhost:26657" \
CHAIN_ID="chain-1" \
MNEMONIC="..." \
yarn test

For more details, please see the CI script.

License

Apache-2.0 License