@aladas-org/cryptocalc
Version:
Crypto Calculator
225 lines (195 loc) • 7.77 kB
JavaScript
// =====================================================================================
// ================================ const_blockchain.js ================================
// =====================================================================================
"use strict";
// up to 100 (coinmarketcap)
// ETC : Ethereum Classic
// XLM: Stellar
// VET: VeChain
// 79 BSV: Bitcoin SV
// 98 EOS: EOS
// cf. capitalization order on https://coinmarketcap.com/
// BUT Ethereum in First place because of the "ecosystem popularity"l
const NULL_COIN = "Null-COIN";
const COIN = "coin";
const COIN_TYPE = "coin_type";
const MAINNET = "mainnet";
const TESTNET = "testnet";
const TESTNET_COIN = "Testnet";
const BITCOIN = "Bitcoin";
const ETHEREUM = "Ethereum";
const BINANCE = "Binance";
const SOLANA = "Solana";
const RIPPLE = "Ripple";
const CARDANO = "Cardano";
const ADA_PURPOSE = "1852";
const AVALANCHE = "Avalanche";
const DOGECOIN = "DogeCoin";
const TRON = "TRON";
const BITCOIN_CASH = "Bitcoin Cash";
const POLKADOT = "Polkadot";
const POLYGON = "Polygon";
const LITECOIN = "LiteCoin";
const FILECOIN = "Filecoin";
const EOS = "EOS";
const FIRO = "Firo";
// Monero mnemonic library (https://github.com/pywallet-cli/bip-utils)
// If you use the official Monero wallet, you'll probably notice that Monero generates
// mnemonic in its own way, which is different from BIP-0039. In fact, it uses different
// words lists (with 1626 words instead of 2048) and a different algorithm for
// encoding/decoding the mnemonic string
const MONERO = "Monero";
const TEZOS = "Tezos";
const DASH = "Dash";
const ZILLIQA = "Zilliqa";
const KUSAMA = "Kusama";
const ZCASH = "ZCASH";
const NAMECOIN = "Namecoin";
// NB: [NULL_COIN] syntax means NULL_COIN const is interpreted as its value ("None")
// else it would be interpreted as the const name "NULL_COIN" 8((
const COIN_ABBREVIATIONS = {
[] : "Null-Coin",
[] : "Testnet-Coin",
// ------------ https://coinmarketcap.com/ ------------
[] : "BTC",
[] : "ETH",
[] : "BNB",
[] : "SOL",
[] : "XRP",
[] : "ADA",
[] : "AVAX",
[] : "DOGE",
[] : "TRX",
[] : "BCH",
[] : "DOT",
[] : "MATIC",
[] : "LTC",
[] : "FIL",
[] : "XMR",
[] : "XTZ",
[] : "ZIL",
[] : "ZEC",
[] : "KSM",
[] : "DASH",
[] : "EOS",
[] : "FIRO",
[] : "ZEC",
// ------------ https://coinmarketcap.com/
[] : "NMC"
}; // COIN_ABBREVIATIONS
// coin_types: https://github.com/satoshilabs/slips/blob/master/slip-0044.md
const COIN_TYPES = {
[] : -1,
[] : 0,
[] : 1,
[] : 2,
[] : 3,
[] : 5,
[] : 7,
[] : 60,
[] : 128,
[] : 133,
[] : 136,
[] : 144,
[] : 145,
[] : 194,
[] : 195,
[] : 313,
[] : 434,
[] : 461,
[] : 501,
[] : 714,
[] : 966,
[] : 1729,
[] : 1815,
[] : 9000
}; // COIN_TYPES
const FAUCET_URLs = {
[] : "Null-URL",
[] : "https://mumbaifaucet.com/",
[] : "https://coinfaucet.eu/en/btc-testnet/",
[] : "https://solfaucet.com/",
[] : "https://docs.cardano.org/cardano-testnet/tools/faucet/",
[] : "https://testnet-faucet.com/doge-testnet/",
[] : "Null-URL",
[] : "Null-URL",
[] : "Null-URL",
[] : "Null-URL",
[] : "Null-URL",
[] : "Null-URL",
[] : "https://litecointf.salmen.website/"
}; // FAUCET_URLs
// https://shardeum.org/blog/best-blockchain-explorers/
// 1. Blockchain
// 1. BlockCypher
const MAINNET_EXPLORER_URLs = {
[]: "Null-URL",
[]: "https://etherscan.io/address/",
[]: "https://www.blockchain.com/explorer/addresses/btc/",
[]: "https://explorer.solana.com/address/",
[]: "https://blockchair.com/fr/cardano/address/",
[]: "https://dogechain.info/address/",
[]: "https://snowtrace.io/address/",
[]: "https://tronscan.org/#/address/",
[]: "https://explorer.btc.com/bch/address/",
[]: "https://explorer.dash.org/insight/address/",
[]: "https://livenet.xrpl.org/accounts/",
[]: "Null-URL",
[]: "https://explorer.firo.org/address/",
[]: "Null-URL",
[]: "https://live.blockcypher.com/ltc/address/"
}; // MAINNET_EXPLORER_URLs
const TESTNET_EXPLORER_URLs = {
[]: "Null-URL",
[]: "https://sepolia.etherscan.io/address/%ADDRESS%",
[]: "https://live.blockcypher.com/btc-testnet/address/%ADDRESS%",
[]: "https://explorer.solana.com/%ADDRESS%/?cluster=testnet",
[]: "https://preprod.cardanoscan.io/address/%ADDRESS%",
[]: "Null-URL",
[]: "https://sochain.com/address/DOGETEST/%ADDRESS%",
[]: "Null-URL",
[]: "Null-URL",
[]: "Null-URL",
[]: "Null-URL",
[]: "Null-URL",
[]: "Null-URL",
[]: "Null-URL",
[]: "https://sochain.com/address/LTCTEST/%ADDRESS%"
}; // TESTNET_EXPLORER_URLs
if (typeof exports === 'object') {
exports.NULL_COIN = NULL_COIN
exports.COIN = COIN
exports.COIN_TYPE = COIN_TYPE
exports.TESTNET_COIN = TESTNET_COIN
exports.COIN_ABBREVIATIONS = COIN_ABBREVIATIONS
exports.COIN_TYPES = COIN_TYPES
exports.BITCOIN = BITCOIN
exports.ETHEREUM = ETHEREUM
exports.BINANCE = BINANCE
exports.SOLANA = SOLANA
exports.RIPPLE = RIPPLE
exports.CARDANO = CARDANO
exports.ADA_PURPOSE = ADA_PURPOSE
exports.AVALANCHE = AVALANCHE
exports.DOGECOIN = DOGECOIN
exports.TRON = TRON
exports.BITCOIN_CASH = BITCOIN_CASH
exports.POLKADOT = POLKADOT
exports.POLYGON = POLYGON
exports.LITECOIN = LITECOIN
exports.FILECOIN = FILECOIN
exports.MONERO = MONERO
exports.TEZOS = TEZOS
exports.ZILLIQA = ZILLIQA
exports.KUSAMA = KUSAMA
exports.DASH = DASH
exports.EOS = EOS
exports.FIRO = FIRO
exports.ZCASH = ZCASH
exports.NAMECOIN = NAMECOIN
exports.MAINNET = MAINNET
exports.TESTNET = TESTNET
exports.FAUCET_URLs = FAUCET_URLs
exports.MAINNET_EXPLORER_URLs = MAINNET_EXPLORER_URLs
exports.TESTNET_EXPLORER_URLs = TESTNET_EXPLORER_URLs
} // exports of const_blockchains.js