# @oasisprotocol/client

> Users of this package, see [this getting started guide](docs/getting-started.md).

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

## Install

```sh
npm install @oasisprotocol/client
pnpm add @oasisprotocol/client
yarn add @oasisprotocol/client
bun add @oasisprotocol/client
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2025-08-08 |
| First published | 2021-03-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 340.1 KB |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 90 |
| Maintainers | kostko, oasisprotocol-bot, pro-wh, cedarmist, luka_oasisprotocol, tjanez |

## Links

- npm: https://www.npmjs.com/package/@oasisprotocol/client
- Repository: https://github.com/oasisprotocol/oasis-sdk
- Homepage: https://github.com/oasisprotocol/oasis-sdk/tree/main/client-sdk/ts-web/core
- Issues: https://github.com/oasisprotocol/oasis-sdk/issues
- npm.io page: https://npm.io/package/@oasisprotocol/client

## Dependencies (7)

- [bip39](https://npm.io/package/bip39.md) ^3.1.0
- [cborg](https://npm.io/package/cborg.md) ^2.0.3
- [bech32](https://npm.io/package/bech32.md) ^2.0.0
- [grpc-web](https://npm.io/package/grpc-web.md) ^1.5.0
- [tweetnacl](https://npm.io/package/tweetnacl.md) ^1.0.3
- [protobufjs](https://npm.io/package/protobufjs.md) ~7.4.0
- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^1.5.0

## Recent versions

- 1.3.0 (latest) — 2025-08-08
- 1.2.0 — 2025-05-13
- 1.1.0 — 2024-05-01
- 1.0.0 — 2023-12-08
- 0.1.1-alpha.2 — 2022-10-12
- 0.1.1-alpha.1 — 2022-05-25
- 0.1.0-alpha9 — 2022-05-18
- 0.1.0-alpha8 — 2022-01-10
- 0.1.0-alpha7 — 2021-10-22
- 0.1.0-alpha6 — 2021-10-12
- 0.1.0-alpha5 — 2021-06-24
- 0.1.0-alpha4 — 2021-06-11
- 0.1.0-alpha3 — 2021-06-11
- 0.1.0-alpha2 — 2021-06-01
- 0.1.0-alpha1 — 2021-03-30

## README

# An oasis-core SDK for TypeScript

Users of this package, see [this getting started guide](docs/getting-started.md).

## Philosophy

Prioritize exposing an unopinionated binding to
[`oasis-node`](https://github.com/oasisprotocol/oasis-core/tree/master/go/oasis-node)'s gRPC
services.
Mostly leave the protocol and formats be, and don't create too much abstraction over it.
Aim to create a library that will take less work to maintain when oasis-core changes.
The target audience is developers who are already familiar with oasis-core.

## Inventory of what's here

1. A layer over [`grpc-web`](https://github.com/grpc/grpc-web) to hook up CBOR-based message
serialization.
1. Method definitions and wrappers to represent the node's gRPC methods.
1. A heuristic to convert structures from CBOR maps to JavaScript objects.
1. Type definitions for structures.
1. Helpers for operating on a few kinds of data.
1. Constants.
1. JSDoc copied from Godoc.
1. Wrappers for consensus transactions.

## Design notes

1. There is no conversion layer between deserialized messages and further object model.
1. Non-structure types, e.g. specialized byte arrays such as `Quantity` and `PublicKey` don't have
dedicated names in the type system.
1. Types are only interfaces (where possible), and helpers are standalone functions.

## Caveats

1. `oasis-node`'s gRPC interface is not desigend to be secure against untrusted clients. We suggest
using this SDK with an additional access control component.
1. Native gRPC is not accessible over the web. The `grpc-web` project suggests setting up an
[Envoy](https://www.envoyproxy.io/) proxy to allow browsers to connect.
1. Empty structures are deserialized into an empty `Map`, due to a limitation in the heuristic that
converts structures to objets.
1. Go prefers to use `nil` instead of some empty values and to serialize them as `null` or missing
structure fields. This behavior is not modeled in this library's type system.

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