https://github.com/iotexproject/iotex-address-ts
https://github.com/iotexproject/iotex-address-ts
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/iotexproject/iotex-address-ts
- Owner: iotexproject
- Created: 2021-06-10T01:33:50.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-23T02:57:55.000Z (almost 4 years ago)
- Last Synced: 2025-06-25T23:02:51.162Z (12 months ago)
- Language: TypeScript
- Size: 79.1 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iotex-address
Converting between Web3 Address (ETH format) and IoTeX Address (ioXXXXX).
### Install
```js
$ npm i @iotexproject/iotex-address-ts
$ yarn add @iotexproject/iotex-address-ts
```
### Usage
```js
import { from } from "@iotexproject/iotex-address-ts";
// for webpack support
// import { from } from '@iotexproject/iotex-address-ts/dist/index.js';
const addr = from("0xb8744ae4032be5e5ef9fab94ee9c3bf38d5d2ae0");
console.log(addr.string());
// io1hp6y4eqr90j7tmul4w2wa8pm7wx462hq0mg4tw
console.log(addr.stringEth());
// 0xb8744ae4032be5e5ef9fab94ee9c3bf38d5d2ae0
const addr2 = from("io1hp6y4eqr90j7tmul4w2wa8pm7wx462hq0mg4tw");
console.log(addr2.string());
// io1hp6y4eqr90j7tmul4w2wa8pm7wx462hq0mg4tw
console.log(addr2.stringEth());
// 0xb8744ae4032be5e5ef9fab94ee9c3bf38d5d2ae0
```