EOS common library used for Typescript
General purpose library for the DAPP network
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
API
Table of Contents
constructor
Symbol Class
Parameters
Examples
const sym = new Symbol("EOS", 4);
sym.symbol
sym.precision
Returns Symbol Symbol
symbol
Symbol
Parameters
Examples
const sym = symbol("EOS", 4);
sym.symbol
sym.precision
Returns Symbol Symbol
constructor
Asset Class
Parameters
Examples
const quantity = new Asset(10000, new Symbol("EOS", 4));
quantity.toString()
quantity.symbol.symbol
quantity.symbol.precision
Returns Asset Asset
asset
Asset
Parameters
Examples
const quantity = asset(10000, new Symbol("EOS", 4));
quantity.toString()
quantity.symbol.symbol
quantity.symbol.precision
Returns Asset Asset
split
Split quantity string
Parameters
quantity
string Quantity string
Examples
const quantity = split("1.0000 EOS");
quantity.amount
quantity.symbol.precision()
quantity.symbol.symbol()
Returns Asset