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

@terra-money/core

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@terra-money/core

This package provides Terra Blockchain client side APIs to support building transaction, singing, or querying chain data.

  • 2.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-73.17%
Maintainers
4
Weekly downloads
 
Created
Source

Terra Javascript Library

This project provides Javascript & Node.js SDK library for Core of Terra.

Example

const mnemonic = terra.generateMnemonic()
const masterKey = terra.deriveMasterKeySync(mnemonic)
const keypair = terra.deriveKeypair(masterKey)
const accAddr = terra.getAccAddress(keypair.publicKey)

const msgSend = terra.buildSend([
  {
    "amount": "1000000",
    "denom": "uluna"
  }
], accAddr, "terra1ptdx6akgk7wwemlk5j73artt5t6j8am08ql3qv");


const stdTx = terra.buildStdTx([msgSend], {
  "gas": "200000",
  "amount": [
    {
      "amount": "1000",
      "denom": "uluna"
    }
  ]
}, "library test")
const jsonTx = stdTx.value
const txSignature = terra.sign(jsonTx, keypair, {
  sequence: "0",
  account_number: "167",
  chain_id: "soju-0009"
})
const signedTx = terra.createSignedTx(stdTx.value, txSignature)
const broadcastBody = terra.createBroadcastBody(signedTx, "block")

// get txid
stdTx.value = signedTx
const txbytes = terra.getAminoDecodedTxBytes(stdTx)
const txhash = terra.getTxHash(txbytes)

console.log(accAddr, broadcastBody, txhash)

Functions for building various messages

  • buildExchangeRatePrevote
  • buildExchangeRateVote
  • buildSend
  • buildMultiSend
  • buildSwap
  • buildDelegate
  • buildRedelegate
  • buildSetWithdrawAddress
  • buildUndelegate
  • buildWithdrawDelegatorReward
  • buildDeposit
  • buildVote

Keywords

FAQs

Package last updated on 26 Apr 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