# @arcblock/forge-wallet

> Utility function to create and use an forge compatible crypto wallet

Latest version **1.8.0** (published 2025-08-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @arcblock/forge-wallet
pnpm add @arcblock/forge-wallet
yarn add @arcblock/forge-wallet
bun add @arcblock/forge-wallet
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.8.0 |
| Published | 2025-08-05 |
| First published | 2019-03-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | wangshijun |
| Maintainers | wangshijun, polunzh, mave99a, gxw |
| Keywords | crypto, forge, arcblock, wallet |

## Links

- npm: https://www.npmjs.com/package/@arcblock/forge-wallet
- Repository: https://github.com/ArcBlock/forge-js
- Homepage: https://github.com/ArcBlock/forge-js/tree/master/forge/forge-wallet
- Issues: https://github.com/ArcBlock/forge-js/issues
- npm.io page: https://npm.io/package/@arcblock/forge-wallet

## Dependencies (2)

- [@arcblock/did](https://npm.io/package/@arcblock/did.md) ^1.17.19
- [@arcblock/mcrypto](https://npm.io/package/@arcblock/mcrypto.md) 1.8.0

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.8.0 (latest) — 2025-08-05
- 1.7.1 — 2022-09-07
- 1.7.0 — 2022-09-07
- 1.6.0 — 2021-03-04
- 1.5.8 — 2021-01-19
- 1.5.7 — 2021-01-18
- 1.5.6 — 2021-01-14
- 1.5.5 — 2020-12-31
- 1.5.4 — 2020-12-31
- 1.5.3 — 2020-12-29
- 1.5.2 — 2020-12-27
- 1.5.1 — 2020-12-23
- 1.5.0 — 2020-12-23
- 1.4.8 — 2020-12-17
- 1.4.7 — 2020-12-17
- … 93 more at https://npm.io/package/@arcblock/forge-wallet/versions

## README

![forge-wallet](https://www.arcblock.io/.netlify/functions/badge/?text=forge-wallet)

[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![docs](https://img.shields.io/badge/powered%20by-arcblock-green.svg)](https://docs.arcblock.io)
[![Gitter](https://badges.gitter.im/ArcBlock/community.svg)](https://gitter.im/ArcBlock/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

> Utility function to create and use a forge compatible wallet, the wallet is also DID compatible.


## Usage

```shell
yarn add @arcblock/forge-wallet
# OR
npm i @arcblock/forge-wallet -S
```

```javascript
const assert = require('assert');
const { fromSecretKey, WalletType, fromJSON } = require('@arcblock/forge-wallet');
const { types } = require('@arcblock/mcrypto');

const sk =
  '0xD67C071B6F51D2B61180B9B1AA9BE0DD0704619F0E30453AB4A592B036EDE644E4852B7091317E3622068E62A5127D1FB0D4AE2FC50213295E10652D2F0ABFC7';
const appId = 'zNKtCNqYWLYWYW3gWRA1vnRykfCBZYHZvzKr';
const sig =
  '0x08a102851c38c072e42756c1cc70938b5499c8e9358dfe5f383823f56cdb282ffda60fcd581a02c6c673069e5afc0bf09abbe3639b61b84d64fd58ef9f083003';

const type = WalletType({
  role: types.RoleType.ROLE_APPLICATION,
  pk: types.KeyType.ED25519,
  hash: types.HashType.SHA3,
  address: types.EncodingType.BASE58,
});

const wallet = fromSecretKey(sk, type);
const message = 'data to sign';
const signature = wallet.sign(message);
assert.equal(signature, sig, 'signature should match');
assert.ok(wallet.verify(message, signature), 'signature should be verified');

const wallet2 = fromJSON(wallet.toJSON());
// Do something with wallet 2
```


## Documentation

For full documentation, checkout [https://forge-js.netlify.com](https://forge-js.netlify.com/)

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