@mantrachain/sdk
v14.1.0
Published
SDK for MantraCHain blockchain interactions
Downloads
109
Keywords
Readme
Mantrachain SDK
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
);
})();