Skip to content

Put mask for the symbols similar to the one in Binance "ETH/BTC",

License

Notifications You must be signed in to change notification settings

brokerse/binance-format

Repository files navigation

Latest Version GitHub last commit npm downloads

NPM

Build Status Coverage Status CodeCov Codacy Badge Codacy Badge

Binance Format

This project was developed to assist in formatting the binance symbols to better represent values in both the backend and front end. No api is used to query and perform the formatting, it is purely done with string manipulation to have more performance and availability.

Installation

NPM
npm install @clubinvestbr/format --save
YARN
yarn add @clubinvestbr/format

Getting started

Format
const { format } = require('@clubinvestbr/binance-format');

format("BTCETH");
// "BTC/ETH"

format("BTCUSDT");
// "BTC/USDT"

format("BTCWAVES");
// "BTC/WAVES"
Unformat
const { unformat } = require('@clubinvestbr/binance-format');

unformat("BTC/ETH");
// "BTCETH"

unformat("BTC/USDT");
// "BTCUSDT"

unformat("BTC/WAVES");
// "BTCWAVES"