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

@cosmology/cosmjs

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmology/cosmjs

Wrapper of @uni-sign/auth and @uni-sign/cosmos to fit corresponding interfaces in @cosmjs

  • 0.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-88.89%
Maintainers
3
Weekly downloads
 
Created
Source

Cosmjs

Wrapper of @uni-sign/auth and @uni-sign/cosmos to fit corresponding interfaces in @cosmjs

Usage

npm install @cosmology/cosmjs

To sign messages (taking stargate signing client as example)

// import * from "@cosmology/cosmjs"; // Error: use sub-imports, to ensure small app size
import { StargateSigningClient } from "@cosmology/cosmjs/stargate";

const client = StargateSigningClient.connectWithSigner(<rpc-endpoint>, <offline signer>);
const result = await client.signAndBroadcast(<ADDRESS>, <MESSAGE>[], "auto");
// or you can use helper functions to do `signAndBroadcast`. taking send tokens as example
const result = await client.helpers.send(<ADDRESS>, <MsgSend message>, "auto", "");

console.log(result.transactionHash); // the hash of TxRaw

To construct an offline signer (taking direct signer as example)

import { Secp256k1Wallet } from "@cosmology/cosmjs/wallets/secp256k1";

const wallet = Secp256k1Wallet.fromMnemonic("<MNEMONIC_WORDS>", { prefix: "<prefix>" });
const directOfflineSigner = wallet.toOfflineDirectSigner();

Implementations

  • signing client
    • signing client from @cosmology/cosmjs/signing-client
    • stargate signing client from @cosmology/cosmjs/stargate
    • cosmwasm signing client from @cosmology/cosmjs/cosmwasm-stargate
  • wallet
    • secp256k1 wallet from @cosmology/cosmjs/wallets/secp256k1

License

MIT License (MIT) & Apache License

Copyright (c) 2024 Cosmology (https://cosmology.zone/)

Keywords

FAQs

Package last updated on 01 Apr 2024

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