@glif/filecoin-address
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.0.0343latest

Version History

VersionDownloads (Last 7 Days)Published
4.0.0343
3.0.12500
3.0.7147
3.0.6303
3.0.542
3.0.435
3.0.20
3.0.10
3.0.00
2.0.431,099
2.0.420
2.0.373
2.0.360
2.0.350
2.0.202
2.0.20-alpha.00
2.0.180
2.0.170
2.0.160
2.0.130
2.0.120
2.0.10
2.0.00
2.0.0-beta.163
2.0.0-beta.3103
2.0.0-beta.011
2.0.0-alpha.13298
2.0.0-alpha.110
2.0.0-alpha.100
2.0.0-alpha.50
2.0.0-alpha.40
2.0.0-alpha.10
1.1.0864
1.1.0-beta.190
1.1.0-beta.180
1.1.0-beta.171
1.1.0-beta.160
1.1.0-beta.150
1.1.0-beta.140
1.1.0-beta.1019
1.1.0-beta.90
1.1.0-beta.70
1.1.0-beta.40
1.1.0-beta.30
1.1.0-beta.20
1.1.0-beta.10
1.1.0-beta.00
1.0.0-beta.525
1.0.0-beta.17
1.0.0-lerna.47
1.0.0-lerna.20

Package Sidebar

Install

npm i @glif/filecoin-address

Weekly Downloads

3,812

Version

4.0.0

License

(Apache-2.0 OR MIT)

Unpacked Size

250 kB

Total Files

43

Last publish

Collaborators

  • schwartzz8990
  • bret
  • glifbot