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

@burstjs/util

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@burstjs/util

Useful utilities and tools for building Burstcoin applications

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
decreased by-28%
Maintainers
2
Weekly downloads
 
Created
Source

@burstjs/util

Useful utilities and tools for building Burstcoin applications

Installation

Install using npm:

npm install @burstjs/util

or using yarn:

yarn add @burstjs/util

API Reference

Modules

util

Members

isValidboolean

Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)

Constants

initialCodeword

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Functions

constructBurstAddress(parts)

Construct a Burst address from a string array

convertAddressToNumericId(address)

Converts BURST-XXXX-XXXX-XXXX-XXXXX into numeric Id

convertNQTStringToNumber(amount)

Helper method to convert a String to number

convertNumberToNQTString(n)

Helper method to Number to String(8 decimals) representation

convertNumericIdToAddress(numericId)

Encode a numeric id into BURST-XXXX-XXXX-XXXX-XXXXX

isValid(address)boolean

Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)

splitBurstAddress(address)

Split the Burst address string into an array of 4 parts

util

util~burstAddressPattern

A useful regex for matching burst addresses

Kind: inner constant of util

isValid ⇒ boolean

Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)

Kind: global variable
Returns: boolean -

true, if is a valid address, else false


Note: This is with prior quick check

ParamTypeDescription
addressstring

The address

initialCodeword

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: global constant

constructBurstAddress(parts)

Construct a Burst address from a string array

Kind: global function

ParamDescription
parts

4 parts string array

convertAddressToNumericId(address) ⇒

Converts BURST-XXXX-XXXX-XXXX-XXXXX into numeric Id

Kind: global function
Returns:

The numeric id, or undefined if address is invalid

ParamDescription
address

The BURST address

convertNQTStringToNumber(amount) ⇒

Helper method to convert a String to number

Kind: global function
Returns:

A number expressed in Burst (not NQT)


Throws:

  • exception if argument is invalid

ParamDescription
amount

The amount in NQT

convertNumberToNQTString(n) ⇒

Helper method to Number to String(8 decimals) representation

Kind: global function
Returns:

a NQT number string

ParamDescription
n

the number

convertNumericIdToAddress(numericId) ⇒

Encode a numeric id into BURST-XXXX-XXXX-XXXX-XXXXX

Kind: global function
Returns:

the BURST address in Reed-Solomon encoding, or undefined if passed null, undefined

ParamDescription
numericId

The numeric Id

isValid(address) ⇒ boolean

Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)

Kind: global function
Returns: boolean -

true, if is a valid address, else false

ParamTypeDescription
addressstring

The address

splitBurstAddress(address)

Split the Burst address string into an array of 4 parts

Kind: global function

ParamDescription
address

A valid Burst address

Keywords

FAQs

Package last updated on 11 Jun 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