Package Exports
- @glif/filecoin-address
- @glif/filecoin-address/dist/index.js
- @glif/filecoin-address/lib/index.js
- @glif/filecoin-address/module/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@glif/filecoin-address) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
filecoin-address
This is a JS implementation of the Filecoin address type, inspired by go-address. It can create new address instances and encode addresses, and it takes care of decoding and validating checksums.
Install
npm i @glif/filecoin-address
Usage
const { newFromString, encode } = require('@glif/filecoin-address')
const address = newFromString('t1hvuzpfdycc6z6mjgbiyaiojikd6wk2vwy7muuei')
const addressProtocol = address.protocol()
const addressPayload = address.payload()
const addressString = address.str // Uint8Array
const networkPrefix = 't'
const encoded = encode(networkPrefix, address)Exported methods
- newAddress
- newIDAddress
- newFromString
- decode
- encode
- equals
- bigintToArray
- getChecksum
- validateChecksum
- validateAddressString
- checkAddressString
Test
npm install
npm test
License
This repository is dual-licensed under Apache 2.0 and MIT terms.