erebos

erebos

  • Docs
  • Examples
  • API
  • Help
  • GitHub

›RPC tools

Docs

  • Introduction
  • Getting started

Swarm examples

  • File storage examples
  • Feeds examples
  • Communications examples

Swarm APIs and CLI

  • Swarm client
  • Individual APIs
  • Bzz API
  • Bzz Feed API
  • Bzz FS API
  • Pss API
  • CLI

Data structures

  • Data structures
  • Feed lists
  • Document synchronization
  • Timeline

Timeline protocol

  • Timeline specification
  • Timeline example
  • Timeline API

Utility libraries

  • Hexadecimal encoding
  • Keccak256 hashing
  • SECP256k1 signing
  • Hierarchical Deterministic wallet

RPC tools

  • RPC clients, handler and transport
  • Base RPC class and types
  • RPC Errors
  • RequestRPC client (stateless)
  • StreamRPC client (stateful)
  • RPC handler
  • RPC client over HTTP
  • RPC client over WebSocket
  • RPC client over IPC
  • RPC client for browsers
  • RPC client for Node
  • RPC client for Electron
  • HTTP transport
  • WebSocket transport
  • IPC transport
  • Electron transport
Edit

RPC client for browsers

Purpose

RPC client factory, returning a RequestRPC instance using the HTTP transport if the provided endpoint is a HTTP URL, or a StreamRPC instance using the WebSocket transport if the provided endpoint is a WebSocket URL.

Installation

npm install @erebos/rpc-browser

Usage

import { createRPC } from '@erebos/rpc-browser'

const rpcOverHTTP = createRPC('http://localhost') // RequestRPC using HTTP transport
const rpcOverWS = createRPC('ws://localhost') // StreamRPC using WebSocket transport

API

createRPC()

Arguments

  1. endpoint: string: HTTP or WebSocket URL to connect to.

Returns RequestRPC (with HTTP endpoint) or StreamRPC (with WebSocket endpoint).

← RPC client over IPCRPC client for Node →
  • Purpose
  • Installation
  • Usage
  • API
    • createRPC()
Docs
Getting StartedAPI ReferenceCLI
Community
Gitter chatGitHub repositoryStar
Swarm
Official documentationHTTP gatewayDevelopment chat