Socket
Socket
Sign inDemoInstall

@terra-money/terra.js

Package Overview
Dependencies
53
Maintainers
4
Versions
230
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @terra-money/terra.js

 


Version published
Maintainers
4
Created

Readme

Source

 

The JavaScript SDK for Terra


diagram

API Docs | NPM Package | GitHub

Installation

Grab the latest version off NPM:

yarn add @terra-money/terra.js

Features

  • Written in TypeScript, includes type definitions for core data objects
  • Cosmos SDK compatible Int and Dec numeric types
  • Includes BIP39 mnemonic key, with support for custom key types
  • Interoperable: Supports JSON-format Terra objects and native JavaScript objects
  • Simple and consistent API for converting to/from blockchain data
  • Works in both Node.js and in the browser

Usage

We highly suggest using Terra.js with TypeScript, or JavaScript in a code editor that has support for type declarations, so you can take advantage of the helpful type hints that are included with the package. Terra.js can be use in Node.js, as well as inside the browser. Currently, React Native is not fully supported, however a version of Terra.js that supports it will soon be made available.

Example

The best way to learn how to use Terra.js is to get started with a quick example and then explore the documentation on your own. Let's create our first transaction by generating a mnemonic, acquiring some testnet tokens, signing a simple transaction, and broadcast it on the network by using just our browser.

You can play with the complete example on JSFiddle here.

Loading Terra.js in the browser

You can access all the objects of the @terra-money/terra.js from the global Terra object if you load Terra.js with a <script> tag.

Include the following in your browser:

<script
  crossorigin
  src="https://unpkg.com/@terra-money/terra.js/dist/bundle.js"
></script>

You can find a small JSFiddle example that refreshes current Oracle votes here.

License

This software is licensed under the MIT license. See LICENSE for full disclosure.

Š 2020 Terraform Labs, PTE.


 

Powering the innovation of money.

FAQs

Last updated on 11 Jun 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc