# @glif/filecoin-address

> The Filecoin address type

Latest version **4.0.0** (published 2025-04-25) · (Apache-2.0 OR MIT) license · 0 weekly downloads

## Install

```sh
npm install @glif/filecoin-address
pnpm add @glif/filecoin-address
yarn add @glif/filecoin-address
bun add @glif/filecoin-address
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2025-04-25 |
| First published | 2020-10-05 |
| Weekly downloads | 0 |
| License | (Apache-2.0 OR MIT) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 244.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Infinite Scroll <squad@infinitescroll.org> (https://infinitescroll.org) |
| Maintainers | schwartzz8990, bret, glifbot |

## Links

- npm: https://www.npmjs.com/package/@glif/filecoin-address
- Repository: https://github.com/glifio/modules/tree/primary/packages/filecoin-address
- npm.io page: https://npm.io/package/@glif/filecoin-address

## Dependencies (5)

- [borc](https://npm.io/package/borc.md) 3.0.0
- [ethers](https://npm.io/package/ethers.md) 6.13.2
- [leb128](https://npm.io/package/leb128.md) 0.0.5
- [blakejs](https://npm.io/package/blakejs.md) 1.2.1
- [uint8arrays](https://npm.io/package/uint8arrays.md) 3.1.0

## Recent versions

- 4.0.0 (latest) — 2025-04-25
- 3.0.12 — 2024-08-22
- 3.0.7 — 2024-06-25
- 3.0.6 — 2024-06-13
- 3.0.5 — 2024-05-09
- 3.0.4 — 2024-02-29
- 3.0.2 — 2024-02-06
- 3.0.1 — 2024-02-06
- 3.0.0 — 2024-01-15
- 2.0.43 — 2023-03-11
- 2.0.42 — 2023-03-11
- 2.0.37 — 2023-02-14
- 2.0.36 — 2023-02-13
- 2.0.35 — 2023-02-09
- 2.0.20 — 2022-11-16
- … 36 more at https://npm.io/package/@glif/filecoin-address/versions

## README

# filecoin-address

This is a JS implementation of the Filecoin address type, inspired by [go-address](https://github.com/filecoin-project/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

```js
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`<br/>
`npm test`

## License

This repository is dual-licensed under Apache 2.0 and MIT terms.

---
_Source: https://npm.io/package/@glif/filecoin-address · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
