Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@connext/channel-commitments

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@connext/channel-commitments

  • 0.0.1-alpha.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
5
Weekly downloads
 
Created
Source

@connext/channel-commitments

Usage

The CommitmentClient is responsible for interacting with the backend to collect signatures for channel signers. It will be consumed by the claim UI to capture signatures from returning users to redeem commitments.

Interface

The class has the following interface:

class CommitmentClient {
  // What consumer should prompt user to sign
  public readonly SIGN_IN_PROMPT: string = "...";

  // This method should:
  // - generate the channel wallet from input signature
  // - store the backend URL
  // - store the injected provider
  // - create a new CommitmentClient + return it
  public async post(signature: string, backend?: string): Promise<void> {}
}

Quickstart

  1. Install the package:
npm i @connext/channel-commitments
  1. Instantiate the client in your application:
import { CommitmentClient } from "@connext/channel-commitments";

const client = new CommitmentClient();
  1. Generate the signature:
const signature = await injectedProvider.signMessage(client.SIGN_IN_PROMPT);
  1. Post signature to backend:
try {
  await client.post(signature);
} catch (e) {
  console.warn("Failed to post to client");
}

FAQs

Package last updated on 22 Jun 2023

Did you know?

Socket

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc