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

eos-common

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eos-common

EOSIO Smart Contract common library used for Typescript

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
151
increased by619.05%
Maintainers
1
Weekly downloads
 
Created
Source

eos-common

Build Status npm version MIT licensed

EOSIO Smart Contract common library used for Typescript

Installation

Using Yarn:

yarn add eos-common

or using NPM:

npm install --save eos-common

Quick Start

import { split } from "eos-common"

const { amount } = split("1.0000 EOS");
amount //=> 10000

API

Table of Contents

constructor

Symbol Class

Parameters
Examples
const sym = new Symbol("EOS", 4);
sym.symbol //=> "EOS"
sym.precision //=> 4

Returns Symbol Symbol

symbol

Symbol

Parameters
Examples
const sym = symbol("EOS", 4);
sym.symbol //=> "EOS"
sym.precision //=> 4

Returns Symbol Symbol

constructor

Asset Class

Parameters
Examples
const quantity = new Asset(10000, new Symbol("EOS", 4));
quantity.toString() //=> "1.0000 EOS";
quantity.symbol.symbol //=> "EOS"
quantity.symbol.precision //=> 4

Returns Asset Asset

asset

Asset

Parameters
Examples
const quantity = asset(10000, new Symbol("EOS", 4));
quantity.toString() //=> "1.0000 EOS";
quantity.symbol.symbol //=> "EOS"
quantity.symbol.precision //=> 4

Returns Asset Asset

split

Split quantity string

Parameters
  • quantity string Quantity string
Examples
const quantity = split("1.0000 EOS");
quantity.amount //=> 10000
quantity.symbol.precision() //=> 4
quantity.symbol.symbol() //=> "EOS"

Returns Asset

FAQs

Package last updated on 19 Oct 2019

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