npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cliqueofficial/clique-client-sdk-node

v0.1.14

Published

The Clique Client SDK is an open-source library that enables users to interact with the Clique Network. We currently support Rust, NodeJS, and Web.

Downloads

237

Readme

Clique Client SDK

The Clique Client SDK is an open-source library that enables users to interact with the Clique Network. We currently support Rust, NodeJS, and Web.

Clique Query

Clique supports JSON-RPC-styled queries.

| Field | description | required | |----------|----------|----------| | id | Unique query ID | Yes | | method | Task name | Yes | | params | Task input | Yes | | inputTypes | Task input types | Yes | | customTypes | Task custom types | No |

How to use

Add this dependency to your package.json:

pnpm add @cliqueofficial/clique-client-sdk-node
# OR
yarn add @cliqueofficial/clique-client-sdk-node
# OR 
npm install @cliqueofficial/clique-client-sdk-node 
const { Client } = require('@cliqueofficial/clique-client-sdk-node');

(async () => {
  const client = new Client({ 
    endpoint: 'http://localhost:8000', 
    pollingInterval: 20, // default value is 20 ms
    retryNumber: 5,  // default value is 5
    allowExistQuery: false, // default value is false. If the user creates a query with the same id, method, and params, the client will return the result of the existing query when the value is true; otherwise, the client will throw an exception.
    trustedEnclaves: ['5d474d0e8b431764ddf3db67b1028399d42301340ceb4abc840c4dee426e0d9d'], // default is undefined. Trusted mr_enclaves of clique-kernel, if the value is undefined, all mr_enclaves will be trusted.
    trustedSigners: ['6601c448087c060907a3c71f1c10fbae92260bef8ac37258b2314338042dadb4'], // default is undefined. Trusted mr_signers of clique-kernel, if the value is undefined, all mr_signers will be trusted.
  });

  // Create single query
  const query = {
    id: 1,
    method: 'clique_fibonacci',
    params: { n: '10' },
    inputTypes: { n: 'u256' },
  };
  // OR batch query
  const query = [
    {
      id: 2,
      method: 'clique_fibonacci',
      params: { n: '11' },
      inputTypes: { n: 'u256' },
    },
    {
      id: 3,
      method: 'clique_fibonacci',
      params: { n: '12' },
      inputTypes: { n: 'u256' },
    },
  ];

  // Run the query and wait for the result
  const response = await client.runQuery(query);
  console.log("runQuery response:", response);
})();