Requests
Send a message to a node that requires a response.
Obyte.js library has API helper functions for most requests that the WebSocket API supports (even some that are not documented: api.getTempPubkey, api.tempPubkey, api.deliver), but if there is anything missing, it's possible to extend it with existing internal functions. Here is quick start example written without the helper function.

Example

1
// API helper function
2
client.api.getJoint('oj8yEksX9Ubq7lLc+p6F2uyHUuynugeVq4+ikT67X6E=', function(err, result) {
3
if (err) return console.error(err);
4
console.log(result);
5
});
6
7
// internal function
8
client.client.request('get_joint', 'oj8yEksX9Ubq7lLc+p6F2uyHUuynugeVq4+ikT67X6E=', function(err, result) {
9
if (err) return console.error(err);
10
console.log(result);
11
});
Copied!
Here is an example of a response that you may receive:
1
{
2
"joint": {
3
"unit": {Object}
4
}
5
}
Copied!
Last modified 4mo ago
Copy link
Contents
Example