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

@rpch/sdk

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rpch/sdk

## Description

  • 1.11.0
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

RPCh SDK

Description

RPCh SDK is a library which will be used by a client who wants to access the RPCh network, additionally, the SDK will be integrated into our own “RPCh web3 adaptors”. Through the SDK, the client should be able to send traffic through the RPCh network and maintain a reliability metric of used HOPR entry nodes.

How to use SDK

You will need to have Node.js and npm/yarn installed on your computer. You can download them from their official website or use a package manager like Homebrew (for Mac) or Chocolatey (for Windows).

Install necessary packages

yarn add @rpch/sdk

Get your rpch client by visiting degen rpch website.

You can create an instance of the SDK by passing in the required options and key-value store functions:

import SDK from "@rpch/sdk";
const sdk = new SDK(<your-client-secret>)

Now you can start sending request similar to using fetch:

const rpcReq = {
    jsonrpc: "2.0",
    method: "eth_chainId",
    id: "test1",
    params: [],
};
const resp = await sdk.send(rpcReq);
console.log(resp);

This will send the request through the HOPR network and return the response. If there is an error, it will be thrown.

In case you want to use a different EVM chain or a different RPC provider, just specify it in the options:

sdk.send(rpcReq, {
    provider: 'https://ethereum-provider.rpch.tech'
});

Enabling debugging logs

Depending on which platform you are running the SDK, you need to enable debugging in different ways. We use the library debug for our logging.

  • on nodejs: you need to run the instance with the following environment variable DEBUG="rpch*" ..
  • on web platforms: update localStorage with keyval debug:rpch*

Keywords

FAQs

Package last updated on 18 Jan 2024

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