/crypto-pair

Normalize cryptocurrency exchange pairs.

Primary LanguageTypeScriptApache License 2.0Apache-2.0

crypto-pair

Normalize cryptocurrency trade pairs.

Quick start

npx crypto-pair ADABUSD --exchange Binance

How to use

/* eslint-disable import/no-unresolved,no-console,import/no-extraneous-dependencies */
const { normalizePair } = require('crypto-pair');

console.info(normalizePair('ADABUSD', 'Binance'));

API Manual

There are only two APIs in this library:

/**
 * Normalize a symbol.
 *
 * @param symbol The original symbol from an exchange
 * @param exchange The normalized symbol
 */
export declare function normalizeSymbol(symbol: string, exchange: string): string;
/**
 * Normalize a cryptocurrency trade pair.
 *
 * @param rawPair The original pair of an exchange
 * @param exchange The exchange name
 */
export declare function normalizePair(rawPair: string, exchange: string): string;