# @ocap/wallet

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

Latest version **1.30.24** (published 2026-05-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ocap/wallet
pnpm add @ocap/wallet
yarn add @ocap/wallet
bun add @ocap/wallet
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.30.24 |
| Published | 2026-05-14 |
| First published | 2021-03-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 24.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wangshijun |
| Maintainers | wangshijun, polunzh, mave99a |
| Keywords | crypto, arcblock, wallet |

## Links

- npm: https://www.npmjs.com/package/@ocap/wallet
- Repository: https://github.com/ArcBlock/blockchain
- Homepage: https://www.arcblock.io/docs/blockchain-utils
- Issues: https://github.com/ArcBlock/blockchain/issues
- npm.io page: https://npm.io/package/@ocap/wallet

## Dependencies (4)

- [@ocap/util](https://npm.io/package/@ocap/util.md) 1.30.24
- [@arcblock/did](https://npm.io/package/@arcblock/did.md) 1.30.24
- [@arcblock/jwt](https://npm.io/package/@arcblock/jwt.md) 1.30.24
- [@ocap/mcrypto](https://npm.io/package/@ocap/mcrypto.md) 1.30.24

## 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.30.24 (latest) — 2026-05-14
- 1.30.23 — 2026-05-13
- 1.30.22 — 2026-05-13
- 1.30.21 — 2026-05-12
- 1.30.20 — 2026-05-12
- 1.30.19 — 2026-05-12
- 1.30.18 — 2026-05-11
- 1.30.17 — 2026-05-11
- 1.30.16 — 2026-05-10
- 1.30.15 — 2026-05-08
- 1.30.14 — 2026-05-08
- 1.30.13 — 2026-05-08
- 1.30.12 — 2026-05-05
- 1.30.11 — 2026-05-03
- 1.30.10 — 2026-04-22
- … 598 more at https://npm.io/package/@ocap/wallet/versions

## README

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

[![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
bun install @ocap/wallet
# OR
npm i @ocap/wallet -S
```

```javascript
const assert = require('assert');
const { fromSecretKey, WalletType, fromJSON } = require('@ocap/wallet');
const { types } = require('@ocap/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 = await wallet.sign(message);
assert.equal(signature, sig, 'signature should match');
assert.ok(await wallet.verify(message, signature), 'signature should be verified');

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

## Documentation

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

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