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

eosio-wasm-js

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eosio-wasm-js

A utility tool that serialises EOSIO based blockchain types to WebAssembly hex string.

  • 1.0.0-alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-11.11%
Maintainers
1
Weekly downloads
 
Created
Source

eosio-wasm-js

A utility tool that serialises EOSIO based blockchain types to a WASM hex string.

This tool may be useful for those wanting to serialise actions in JS environments for EOSIO based blockchain actions.

Setup

$ npm i eosio-wasm-js

Support

  • Node.js >= 13
  • Browser list > 0.5%, not OperaMini all, not IE > 0, not dead

Consider a BigInt polyfill library for safari 13.

API

function asset

Serialises EOSIO asset type to WASM hex string.

ParameterTypeDescription
asset_stringstringstring to be serilaised.

Returns: string — Serialised hex string.


function block_time_stamp

Convert date in ISO format to block_timestamp_type (half-seconds since a different epoch)

ParameterTypeDescription
time_StringstringISO date format.

Returns: string — hex string.


function bool

Serialise Boolean.

ParameterTypeDescription
booleanstring | boolean | numbertrue or false.

Returns: string — Hexstring


function bytes

Serilaises byte string to WASM bytes.

ParameterTypeDescription
byte_stringstringThe byte string.

Returns: string — The byte string.


function checksum

Creates a checksum WASM hex string.

ParameterTypeDescription
byte_stringstringHexadecimal string.
bytes20 | 32 | 64For checksum160, checksum256 and checksum512 respectively.

Returns: string — Checksum hex string.


function extended_asset

Serialises an extended asset to WASM hex string.

ParameterTypeDescription
ea_stringstringExtended asset string.

Returns: string — Wasm hex string.


function float128

Validates a little endian float 128 hex string.

ParameterTypeDescription
f128stringHexacecimal representation of the float128.

Returns: string — Hexstring.


function float32

Serialises a float32 to a WASM hex string.

ParameterTypeDescription
f32number | stringFloat32 to be serialised.

Returns: string — Hex string.


function float64

Serialises a float64 to a WASM hex string.

ParameterTypeDescription
f64number | stringfloat64 to be serialised.

Returns: string — Hex string.


function int

Serializes any signed integer (uint) to hexadecimal code.

ParameterTypeDescription
numbernumber | string | bigintA signed integer.
bytesnumbernumber of bytes to place the int into

Returns: string — Hexstring


function name

Serialises a EOS name into a WASM hex string.

ParameterTypeDescription
name_stringstringEOS name string.

Returns: string — hex string.


function string

serialises string into a WASM hex string.

ParameterTypeDescription
strstringString

Returns: string — hex string.


function symbol

Serilaises a symbol string to a WASM hex string.

ParameterTypeDescription
symbol_stringstringTo be serialised.

Returns: string — Hex string.


function symbol_code

Serilaises a symbol code to a WASM hex string.

ParameterTypeDescription
symbol_code_stringstringTo be serialised.

Returns: string — Hex string.


function time_point

Serialises time point into WASM hex string.

ParameterTypeDescription
time_stringstringISO date.

Returns: string — hex string of the time.


function time_point_sec

Convert date in ISO format to time_point_sec (seconds since epoch) WASM string.

ParameterTypeDescription
time_stringstringISO date.

Returns: string — seconds since epoch.


function uint

Serializes any unsigned integer (uint) to hexadecimal string.

ParameterTypeDescription
numbernumber | string | bigintthe uint thta will be serialized
bytesnumberNumber of bytes to place the uint into.

Returns: string — Hex string.


function varint32

varint32

ParameterTypeDescription
numbernumbervariable unsigend integer to sign.

Returns: string — varint32 hex string.


function varuint32

Serialises a varuint32 number to a WASM hex string.

ParameterTypeDescription
numbernumberUnsigned variable-length integer, 32 bits.
bufferArray?Recursion transformation for the LEB128 type.

Returns: string — Varuint32 hexadecimal string.

Keywords

FAQs

Package last updated on 17 Sep 2021

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