New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eosjs

Package Overview
Dependencies
Maintainers
1
Versions
292
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eosjs

General purpose library for the EOS blockchain.

  • 1.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51K
decreased by-28.73%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status NPM

Status: Alpha (this is for eosjs library developers)

Eos Js

General purpose library for the EOS blockchain.

Usage

Eos = require('eosjs') // Or Eos = require('.')

// API, note: testnet uses eosd at localhost (until there is a testnet)
testnet = Eos.Testnet()

// For promises instead of callbacks, use something like npmjs 'sb-promisify'
callback = (err, res) => {err ? console.error(err) : console.log(res)}

// All API methods print help when called with no-arguments.
// More docs at https://github.com/eosjs/api
testnet.getBlock()

// Your going to need localhost:8888
testnet.getBlock(1, callback)

// Transaction
testnet.transaction({
  messages: [
    {// work-in-progress - transaction error 'Bad Cast'
      code: 'eos',
      recipients: [ 'inita', 'initb' ],
      authorization: [],
      type: 'transfer',
      data: {
        from: 'inita',
        to: 'initb',
        amount: { amount: '1', symbol: 'EOS' },
        memo: '爱'
      }
    }
  ],
  sign: ['5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'],
  permissions: [],
}, callback)

These lower level libraries are exported from eosjs or may be used separately.

Exported modules

var {json, api, ecc} = Eos.modules

About

  • eosjs-api [Github, NPM]

    • Remote API to an EOS blockchain node (eosd)
    • Use this library directly if you need read-only access to the blockchain (don't need to sign transactions).
  • eosjs-ecc [Github, NPM]

    • Private Key, Public Key, Signature, AES, Encryption / Decryption
    • Validate public or private keys
    • Encrypt or decrypt with EOS compatible checksums
    • Calculate a shared secret
  • eosjs-json [Github, NPM]

    • Blockchain definitions (api method names, blockchain operations, etc)
    • Maybe used by any language that can parse json
    • Kept up-to-date
  • structs [Github, NPM]

    • Binary serialization used by the blockchain
    • Clients sign the binary form of the transaction
    • Essential so the client knows what it is signing

Example Transactions

var {json} = Eos.modules

// The node console will print more documentation and other example messages
json.schema.Message
json.schema.transfer

// Another view of this data, structure oriented
var {structs} = Eos({defaults: true})
structs.newaccount.toObject()
structs.newaccount.toObject().owner

Environment

Node 6+ and browser (browserify, webpack, etc)

Keywords

FAQs

Package last updated on 11 Jul 2017

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