Getting Started with Rebar SDK

Installation

First, install the Rebar SDK using npm:

npm install @rebar_xyz/sdk

Basic Configuration

Here's a basic configuration to get you started:

import { RebarClient } from '@rebar_xyz/sdk'
 
const rebar_client = new RebarClient("http://rpc.rebar.xyz");

Pull Data

Now you can pull data with a simple query:

const nodeAddress = 'nodeab059158baaeadc7175e8cb20572e54ace8030df38f93f16827a7b9231405892';
const value = await rebar_client.getValue(nodeAddress);
 
console.log('[ETH Mainnet] Base Fee per Block', value);

Pull Anything

You can easily pull other aspects of any node from descriptions and types to calculation logic:

const nodeAddress = 'nodeab059158baaeadc7175e8cb20572e54ace8030df38f93f16827a7b9231405892';
const node = await rebar_client.getNode(nodeAddress);
 
console.log(`${node.name}: ${node.value}`);
console.log(` ﹂ Type: ${node.valueType}`);
console.log(` ﹂ Description: ${node.description}`);