🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

gotabit

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

gotabit

Javascript SDK for GotaBit Chain

unpublished
Source
npmnpm
Version
1.0.14
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

GotaBit JS

npm

About

GotaBit.js was created to help new developers get started with their first dApps. It is just a wrapper package to easily import needed features from CosmJS.

Get started

Installation

NPM

npm install gotabit

Yarn

yarn add gotabit

Usage

Get a read-only cosmwasm client

import { CosmWasmClient } from "gotabit";

// This is your rpc endpoint
const rpcEndpoint = "https://rpc.test.gotabit.dev:443/";

async function main() {
  const client = await CosmWasmClient.connect(rpcEndpoint);
  console.log(client);
}

main();

Create a wallet and a signing stargate client

import { SigningCosmWasmClient, Secp256k1HdWallet } from "gotabit";

// This is your rpc endpoint
const rpcEndpoint = "https://rpc.test.gotabit.dev:443/";

// Using a random generated mnemonic
const mnemonic =
  "rifle same bitter control garage duck grab spare mountain doctor rubber cook";

async function main() {
  // Create a wallet
  const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic);

  // Using
  const client = await SigningCosmWasmClient.connectWithSigner(
    rpcEndpoint,
    wallet,
  );
  console.log(client);
}

main();

Connect with keplr and get a signing starget client

import { setupWebKeplr } from "gotabit";

const config = {
  chainId: "gotabit-test-1",
  rpcEndpoint: "https://rpc.testnet.gotabit.dev:443/",
  prefix: "gio",
};

async function main() {
  const client = await setupWebKeplr(config);
  console.log(client);
}

main();

Interacting with contracts

import { CosmWasmClient } from "gotabit";

// This is your rpc endpoint
const rpcEndpoint = "https://rpc.test.gotabit.dev:443/";

// This is your contract address
const contractAddr =
  "gio1pvrwmjuusn9wh34j7y520g8gumuy9xtl3gvprlljfdpwju3x7ucsex5hqy";

async function main() {
  const client = await CosmWasmClient.connect(rpcEndpoint);
  const config = await client.queryContractSmart(contractAddr, { balance: { address: '' } });

  console.log(config);
}

main();

License

This is a fork from CosmWasmJS

This software is licensed under the Apache 2.0 license.

© 2022 GotaBit Limited

FAQs

Package last updated on 06 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts