@mantrachain/sdk
TypeScript icon, indicating that this package has built-in type declarations

14.1.0 • Public • Published

Mantrachain SDK License: MIT

Pre-requisites

Installation

Using npm:

npm i --save @mantrachain/sdk

Development

Clone the source:

git clone https://github.com/MANTRA-Finance/mantrachain-sdk.git

Change directory:

cd mantrachain-sdk

Install the dependencies:

npm i

Parse the proto files:

./scripts/sdk.gen.sh {branch}
  • {branch}: mantrachain's branch name of the proto files (default: develop)

Update the generated files:

./scripts/update-signer.sh

Build:

npm run build

Usage

import { Client, utils } from "@mantrachain/sdk";
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";

(async () => {
  const mnemonic = "..."; // MNEMONIC
  const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
    prefix: "mantra",
  });

  const creator = (await wallet.getAccounts())[0].address;

  const client = new Client(
    {
      apiURL: "http://127.0.0.1:1317",
      rpcURL: "http://127.0.0.1:26657",
      prefix: "mantra",
    },
    wallet
  );
})();

Modules Docs

For pull requests

Readme

Keywords

none

Package Sidebar

Install

npm i @mantrachain/sdk

Weekly Downloads

12

Version

14.1.0

License

MIT

Unpacked Size

128 MB

Total Files

1542

Last publish

Collaborators

  • vlad_ivanov
  • vladimir.trifonov
  • aaronforce1
  • alex-stmr
  • mantramatt
  • mantra_chiu