# @o1labs/client-sdk

> Node API for signing transactions for Mina Protocol

Latest version **1.0.1** (published 2021-05-27) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @o1labs/client-sdk
pnpm add @o1labs/client-sdk
yarn add @o1labs/client-sdk
bun add @o1labs/client-sdk
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-05-27 |
| First published | 2020-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2119 |
| Author | o1labs |
| Maintainers | ihm00, akraines, mminkov, bkase |
| Keywords | mina, coda, cryptocurrency |

## Links

- npm: https://www.npmjs.com/package/@o1labs/client-sdk
- Repository: https://github.com/MinaProtocol/mina
- Homepage: https://minaprotocol.com/
- Issues: https://github.com/MinaProtocol/mina/issues
- npm.io page: https://npm.io/package/@o1labs/client-sdk

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) ^13.7.0

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-05-27
- 1.0.0 — 2021-03-16
- 0.2.5 — 2021-02-18
- 0.2.3 — 2021-01-30
- 0.2.2 — 2021-01-01
- 0.2.0 — 2020-09-11
- 0.1.3 — 2020-07-07
- 0.1.2 — 2020-03-18
- 0.1.1 — 2020-03-17
- 0.1.0 — 2020-02-22

## README

# Coda Client Javascript SDK

This is a NodeJS client SDK that allows you to sign transactions and strings using Coda's keypairs.
The project contains Typescript and ReasonML typings but can be used from plain NodeJS as well. 

# Install
```bash
yarn add @o1labs/client-sdk
# or with npm:
npm install --save @o1labs/client-sdk
```

# Usage
Typescript:
```typescript
import * as CodaSDK from "@o1labs/client-sdk";

let keys = CodaSDK.genKeys();
let signed = CodaSDK.signMessage("hello", keys);
if (CodaSDK.verifyMessage(signed)) {
    console.log("Message was verified successfully")
};

let signedPayment = CodaSDK.signPayment({
    to: keys.publicKey,
    from: keys.publicKey,
    amount: 1,
    fee: 1,
    nonce: 0
  }, keys);
```

NodeJS:
```javascript
const CodaSDK = require("@o1labs/client-sdk");

let keys = CodaSDK.genKeys();
let signed = CodaSDK.signMessage("hello", keys);
if (CodaSDK.verifyMessage(signed)) {
    console.log("Message was verified successfully")
};

let signedPayment = CodaSDK.signPayment({
    to: keys.publicKey,
    from: keys.publicKey,
    amount: 1,
    fee: 1,
    nonce: 0
  }, keys);
```

ReasonML:
- Install gentype: `yarn add -D gentype`
- Install bs-platform: `yarn add -D bs-platform`
- Build dependencies: `yarn bsb -make-world`

```reason
module CodaSDK = O1labsClientSdk.CodaSDK;

let keys = CodaSDK.genKeys();
let signed = CodaSDK.signMessage(. "hello", keys);
if (CodaSDK.verifyMessage(. signed)) {
  Js.log("Message was verified successfully");
};

let signedPayment = CodaSDK.signPayment({
    to_: keys.publicKey,
    from: keys.publicKey,
    amount: "1",
    fee: "1",
    nonce: "0"
  }, keys);

```

# API Reference
- [Main API](src/CodaSDK.d.ts)
- [Other](src/SDKWrapper.d.ts)

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