Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@glif/filecoin-address

Package Overview
Dependencies
Maintainers
0
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glif/filecoin-address

The Filecoin address type

  • 3.0.7
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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.

FAQs

Package last updated on 25 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc