JSPM

eosjs

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 189697
  • Score
    100M100P100Q160924F
  • License ISC

General purpose library for the EOS blockchain.

Package Exports

  • eosjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eosjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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: [
    //... TODO
  ],
  sign: ['5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'],
  permissions: [],
}, callback)

Related Libraries

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

Used from this package

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

Used Separately

npm install eosjs-api
npm install eosjs-ecc
npm install eosjs-json
npm install Fcbuffer
# etc

About

  • eosjs-api

    • 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

    • 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

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

    • 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 {api, ecc, json, Fcbuffer} = Eos.modules

structs = Fcbuffer(json.schema, {defaults: true}).structs
var {Message, newaccount, transfer} = structs

// Example Transactions (print the returned object)
Message.toObject()

transfer.toObject()

Environment

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