@mantrachain/sdk
v14.1.0
Published
SDK for MantraCHain blockchain interactions
Downloads
72
Keywords
Readme
Mantrachain SDK 
Pre-requisites
Installation
Using npm:
npm i --save @mantrachain/sdkDevelopment
Clone the source:
git clone https://github.com/MANTRA-Finance/mantrachain-sdk.gitChange directory:
cd mantrachain-sdkInstall the dependencies:
npm iParse 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.shBuild:
npm run buildUsage
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
);
})();