arkon-address-converter
v1.0.2
Published
Converter between ETH, Ethermint, Arkon addresses
Downloads
3
Maintainers
Readme
Arkon address converter
A simple converter between ETH
address and Arkon
addresses.
Installation
npm install arkon-address-converter
Usage
Converter
import {ethToEthermint, ethermintToEth} from "arkon-address-converter"
let address = ethToEthermint("0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71")
// "ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048"
let address = ethermintToEth("ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048")
// "0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71"
Decoders
import {ETH, ETHERMINT} from "arkon-address-converter"
let hex = ETH.decoder("0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71")
// hex.toString('hex') === "e2d61e49ff8a9d724cc54d338d8076f878ac6b71"
hex = ETHERMINT.decoder("ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048")
// hex.toString('hex') === "e2d61e49ff8a9d724cc54d338d8076f878ac6b71"
Encoders
import {ETH, ETHERMINT} from "arkon-address-converter"
let address = ETH.encoder(Buffer.from("e2d61e49ff8a9d724cc54d338d8076f878ac6b71","hex"))
// address === "0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71"
address = ETHERMINT.encoder(Buffer.from("e2d61e49ff8a9d724cc54d338d8076f878ac6b71","hex"))
// address === "ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048"
EVMOS support
import {ethToEvmos, evmosToEth} from "arkon-address-converter"
let address = ethToEvmos("0x14574a6DFF2Ddf9e07828b4345d3040919AF5652")
// "evmos1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw"
let address = evmosToEth("evmos1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw")
// "0x14574a6DFF2Ddf9e07828b4345d3040919AF5652"
ARKON support
import {ethToArkon, arkonToEth} from "arkon-address-converter"
let address = ethToArkon("0x5c26513E2b8aF3a43A8F62a6B31ddF8B9afd6A22")
// "arkon1tsn9z03t3te6gw50v2ntx8wl3wd0663zalj7rt"
let address = arkonToEth("arkon1tsn9z03t3te6gw50v2ntx8wl3wd0663zalj7rt")
// "0x5c26513E2b8aF3a43A8F62a6B31ddF8B9afd6A22"
Build locally
yarn install
yarn test
yarn build