Kbyte
A lightweight JavaScript library for Obyte
Install / Use
/learn @bonustrack/KbyteREADME
kbyte.js
A lightweight JavaScript library for Obyte
Install
kbyte was designed to work both in the browser and in Node.js.
Node.js
To install kbyte on Node.js, open your terminal and run:
npm install kbyte
Browser
You can create an index.html file and include kbyte with:
<script src="https://cdn.jsdelivr.net/npm/kbyte"></script>
Usage
var kbyte = require('kbyte');
// Init WebSocket client
var client = new kbyte.Client('wss://obyte.org/bb');
// Get peers
client.request('get_peers', null, function(err, result) {
console.log(err, result);
});
Promises
You can also use kbyte with promises by promisifying kbyte with bluebird as in:
var kbyte = require('kbyte');
bluebird.promisifyAll(kbyte.Client.prototype);
It'll add a Async to all kbyte functions (e.g. return client.requestAsync().then()) client.request('get_peers', null, function(err, result) { console.log(err, result); });
// So instead of writing client.request('get_peers', null, cb); you have to write:
client.requestAsync('get_peers', null).then(function(result) {
console.log(result); // => ['wss://byteroll.com/bb', 'wss://byteball.fr/bb' ...]
});
License
MIT.
Related Skills
canvas
344.1kCanvas Skill Display HTML content on connected OpenClaw nodes (Mac app, iOS, Android). Overview The canvas tool lets you present web content on any connected node's canvas view. Great for: -
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
