Complete reference for integrating with the BlockFuze API. All endpoints require HMAC-SHA512 authentication.
All API requests should be made to:
https://api.blockfuze.comGet up and running with the BlockFuze API in minutes. Below are complete examples in multiple languages showing how to authenticate and make requests.
const crypto = require('crypto');
const PUBLIC_KEY = 'your-public-key';
const PRIVATE_KEY = 'your-private-key';
const BASE_URL = 'https://api.blockfuze.com';
function createSignature(payload, privateKey) {
return crypto
.createHmac('sha512', privateKey)
.update(payload)
.digest('hex');
}
async function makeGetRequest(endpoint, queryParams = {}) {
const queryString = new URLSearchParams(queryParams).toString();
const signature = createSignature(queryString, PRIVATE_KEY);
const url = queryString
? `${BASE_URL}${endpoint}?${queryString}`
: `${BASE_URL}${endpoint}`;
const response = await fetch(url, {
method: 'GET',
headers: {
'x-public-key': PUBLIC_KEY,
'x-signature': signature,
},
});
return response.json();
}
async function makePostRequest(endpoint, body = {}) {
const bodyString = JSON.stringify(body);
const signature = createSignature(bodyString, PRIVATE_KEY);
const response = await fetch(`${BASE_URL}${endpoint}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-public-key': PUBLIC_KEY,
'x-signature': signature,
},
body: bodyString,
});
return response.json();
}
const balance = await makeGetRequest('/Api/Balance');
console.log(balance);Test endpoints in real-time with our interactive playground. No code required.
For GET requests, create the signature from the query string without the leading "?". If there are no query parameters, sign an empty string.
For POST requests, create the signature from the raw JSON body string exactly as it will be sent in the request body.