Socket
Socket
Sign inDemoInstall

@o1labs/client-sdk

Package Overview
Dependencies
1
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @o1labs/client-sdk

Node API for signing transactions for Mina Protocol


Version published
Weekly downloads
1.3K
increased by73.47%
Maintainers
4
Install size
3.82 MB
Created
Weekly downloads
 

Readme

Source

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

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

Usage

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:

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
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
  • Other

Keywords

FAQs

Last updated on 27 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc