🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
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

latest
npmnpm
Version
0.0.1-alpha.1
Version published
Weekly downloads
3
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

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

const client = new CommitmentClient();
  • Generate the signature:
const signature = await injectedProvider.signMessage(client.SIGN_IN_PROMPT);
  • 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