JSON-RPC 2.0 transport over HTTP POST.
HttpTransport handles request IDs, JSON-RPC envelopes, optional custom headers, optional timeout cancellation, and conversion of JSON-RPC error responses into JsonRpcError.
HttpTransport
import { HttpTransport } from "@thruputchain/client/transport";const transport = new HttpTransport("http://127.0.0.1:9545", { timeoutMs: 10_000,});const tip = await transport.request("getChainTip"); Copy
import { HttpTransport } from "@thruputchain/client/transport";const transport = new HttpTransport("http://127.0.0.1:9545", { timeoutMs: 10_000,});const tip = await transport.request("getChainTip");
Create an HTTP transport for a Thruput JSON-RPC endpoint URL.
Send one JSON-RPC request and return the decoded result value.
result
Optional
JSON-RPC 2.0 transport over HTTP POST.
HttpTransporthandles request IDs, JSON-RPC envelopes, optional custom headers, optional timeout cancellation, and conversion of JSON-RPC error responses into JsonRpcError.Example