# @keystonehq/sdk

> Keystone airgaped wallet SDK

Latest version **0.22.1** (published 2024-12-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install @keystonehq/sdk
pnpm add @keystonehq/sdk
yarn add @keystonehq/sdk
bun add @keystonehq/sdk
```

## Health

**Score 45/100 (D)** — status: stable.

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.22.1 |
| Published | 2024-12-17 |
| First published | 2021-07-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 200 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | aaronisme |
| Maintainers | keystoneorg, soralit, liyanlance |

## Links

- npm: https://www.npmjs.com/package/@keystonehq/sdk
- Repository: https://github.com/KeystoneHQ/keystone-airgaped-base
- Homepage: https://github.com/KeystoneHQ/keystone-airgaped-base#readme
- Issues: https://github.com/KeystoneHQ/keystone-airgaped-base/issues
- npm.io page: https://npm.io/package/@keystonehq/sdk

## Dependencies (5)

- [rxjs](https://npm.io/package/rxjs.md) ^6.6.3
- [react-modal](https://npm.io/package/react-modal.md) ^3.16.1
- [qrcode.react](https://npm.io/package/qrcode.react.md) ^3.1.0
- [@ngraveio/bc-ur](https://npm.io/package/@ngraveio/bc-ur.md) ^1.0.0
- [@yudiel/react-qr-scanner](https://npm.io/package/@yudiel/react-qr-scanner.md) 2.0.0-beta.3

## Recent versions

- 0.22.1 (latest) — 2024-12-17
- 0.22.0 — 2024-12-16
- 0.21.3 — 2024-06-03
- 0.21.2 — 2024-05-24
- 0.21.1 — 2024-05-24
- 0.20.1 — 2024-05-23
- 0.20.0 — 2024-05-22
- 0.19.2 — 2023-05-31
- 0.19.1 — 2023-05-30
- 0.19.0 — 2023-05-17
- 0.18.0 — 2023-04-25
- 0.17.0 — 2023-04-25
- 0.16.2 — 2023-03-02
- 0.16.1 — 2023-02-22
- 0.16.0 — 2023-02-22
- … 95 more at https://npm.io/package/@keystonehq/sdk/versions

## README

# `@keystonehq/sdk`

`@keystonehq/sdk` is library for helping developer to do integration with Keystone.

the main purpose is to encode and decode data for QR Code usage.

currently we use UR to encode data. check this for detail info about [UR](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md)

## Install

```bash
yarn add @keystonehq/sdk
```

```base
npm install --save @keystonehq/sdk
```

## Usage

```
import sdk from '@keystonehq/sdk';
const read = async () => {
    const result = await sdk.read();
}

const play = async () => {
    await sdk.play("any data string");
}

```

## API

| Name | Parameters                                      | result                                                                      | Description                                                                        |
| ---- | ----------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| read |                                                 | Promise<{type: 'text' &#124; 'json' &#124; 'ur', data: string} &#124; null> | Open a modal and read qrcode with camera, will return null when click Close button |
| play | data: string, options?: {refreshSpeed?: number} | Promise<void>                                                               | Open a modal and display a dynamic qrcode, will resolve when click Finish button   |

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