A JavaScript client for Grin's V1 API.
$ npm install grin-client
const GrinClient = require('grin-client');
(async function () {
const API_SECRET = '...';
const grin = new GrinClient({
protocol: 'http',
hostname: '127.0.0.1',
port: 3413,
username: 'grin',
password: API_SECRET,
});
try {
const status = await grin.status();
const block = await grin.blocks(13474);
// ...
} catch(e) {
console.log(e);
}
})();
Creates a new instance of a GrinClient
.
Either http
or https
Type: string
Type: string
Type: string
Type: number
Type: string
The Grin node's .api_secret
. Can be found in ~/.grin/main/.api_secret
.
Type: string
id
: <string>
can be hash, height or commit.
id
: <string>
can be hash, height or commit.
ids
: <string[]>
obj
: <Object>
obj.startHeight
: <integer>
obj.endHeight
: <integer>
n
: <integer>
n
: <integer>
n
: <integer>
obj
: <Object>
obj.startIndex
: <integer>
obj.max
: <integer>
id
: <string>
id
: <string>
addr
: <string>
addr
: <string>
addr
: <string>
grin-ql-js
mimblewimble/grin REST API
MIT