crypto-address-converter
v1.0.0
Published
Convert cryptocurrency wallet addresses between formats seamlessly. Supports EVM, Tron, BSC, Polygon, XDC (XinFin), and WELUPS.
Maintainers
Readme
Crypto Address Converter
A lightweight, highly accurate NPM package for converting cryptocurrency wallet addresses between various blockchain formats.
Currently supports bi-directional conversion between:
- EVM Chains (Ethereum, Avalanche, Arbitrum, Optimism, Base, etc.)
- Binance Smart Chain (BSC)
- Polygon (MATIC)
- TRON (TRX)
- XDC Network (XinFin)
- WELUPS
Installation
npm i crypto-address-converter --saveUsage
You can use the package with CommonJS (require) or ES6 Modules (import).
const { convertaddress } = require('crypto-address-converter');
// Example 1: EVM to TRON
const evmAddress = "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1";
console.log(convertaddress(evmAddress, "EVM", "TRON"));
// => TPBkHycN1Hmr2bFcfjvp2fjkca1hfPbPka
// Example 2: TRON to EVM
const tronAddress = "TPBkHycN1Hmr2bFcfjvp2fjkca1hfPbPka";
console.log(convertaddress(tronAddress, "TRON", "EVM"));
// => 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1
// Example 3: BSC to XDC Network
console.log(convertaddress(evmAddress, "BSC", "XINFIN"));
// => xdc90f8bf6a479f320ead074411a4b0e7944ea8c9c1
// Example 4: Polygon to WELUPS
console.log(convertaddress(evmAddress, "POLYGON", "WELUPS"));
// => WPBkHycN1Hmr2bFcfjvp2fjkca1hfPbPkaSupported Network Identifiers
When passing the from and to arguments, use the following strings:
"EVM""BSC""POLYGON""TRON"or"TRX""XINFIN"or"XDC""WELUPS"
Support
Happy to add more networks! If you need any updates, do get in touch on my Telegram over @chigovera.
