Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cosmos-client

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cosmos-client

REST API Client for Cosmos SDK Blockchain

  • 0.5.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cosmos-client-ts

JavaScript / TypeScript client for Cosmos SDK blockchain.

Install

npm install --save cosmos-client

Example

import { CosmosSDK, AccAddress, PrivKeyEd25519 } from "cosmos-client";
import { auth, StdTx } from "cosmos-client/x/auth";
import { bank } from "cosmos-client/x/bank";

const sdk = new CosmosSDK(hostURL, chainID);

// get account info
let fromAddress: AccAddress;
let privKey: PrivKeyEd25519;
const account = await auth
  .accountsAddressGet(sdk, fromAddress)
  .then((res) => res.data);

// get unsigned tx
let toAddress: AccAddress;

const unsignedStdTx = await bank
  .accountsAddressTransfersPost(sdk, toAddress, { ... })
  .then((res) => res.data);

// sign
const signedStdTx = auth.signStdTx(
  sdk,
  privKey,
  unsignedStdTx,
  account.account_number,
  account.sequence + 1,
);

// broadcast
await auth.txsPost(sdk, signedStdTx, "sync");

For library developlers

swagger.yml

openapi-generator generate -g typescript-axios -i swagger.yaml -o ./src

Keywords

FAQs

Package last updated on 04 May 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc