Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Node client for the Bitwala.
For a detailed explanation of our API routes, please check out the documentation
yarn add bitwala
import bitwala from 'bitwala';
const token = {
_id: 'SuBnyc6d564P49Uuls',
secret: 'LTdFE6hw725yh0aM4m4azACEZSpNrtl4aowFjCZetSAAPBaGN3Ecq7FgMSR5b3Va'
};
const client = bitwala.client({
token: token,
env: 'sandbox'
});
client.info('inputs')
.then(data => console.log(data))
.catch(err => console.error(err));
/*
[
{
"collection": "BitcoinInvoices",
"currency": "XBT"
}
]
*/
The client can be initialised with the sandbox
or production
env.
For a breakdown of the differences, see our docs.
Endpoint | Method | Client |
---|---|---|
/info | GET | .info() |
/info/inputs | GET | .info('inputs') |
/info/outputs | GET | .info('outputs') |
/auth | GET | .auth() |
/transactions?page=1 | GET | .transactions.get({page: 1}) |
/transactions?transactionId=transactionId | GET | .transactions.get({transactionId: 'YRTvEJxAEm3MB1GI'}) |
/transactions?ref=ref | GET | .transactions.get({ref: 'YRTvEJxAEm3MB1GI'}) |
/transactions | POST | .transactions.create(yourTransactionObj}) |
/transactions/refresh | POST | .transactions.refresh({transactionId: transactionId}}) |
/transactions/refresh | POST | .transactions.refresh({transactionId: transactionId}}) |
All api calls can be used with promises or callbacks.
With callbacks
client.info((e, data) => {
if (e) {
return console.error(e);
}
console.log(data);
})
With promises
client.info()
.then(data => console.log(data));
With await
and async
(if you're using ES7)
(async function () {
let data;
try {
await data = client.info();
} catch (err) {
console.error(err);
}
console.log(data);
})();
ref
client.transactions.get({ref: 'My custom id'});
.then(r => console.log(r))
.catch(err => console.log(err));
client.transactions.create({
ref: 'My custom id',
webhookUrl: '...', // example: https://test.com/callbacks/bitwala
inputs: [{
collection: 'BitcoinInvoices',
doc: {
currency: 'XBT',
convertedCurrency: 'EUR',
convertedAmount: 100
}
}],
outputs: [{
collection: 'BankTransfers',
doc: {
amount: 100,
currency: 'EUR',
reference: 'January Salary',
bankAccount: {
recipientType: 'INDIVIDUAL',
firstName: 'Satoshi',
lastName: 'Nakamoto',
iban: 'DE89370400440532013000',
currency: 'EUR'
}
}
}]
}).then(r => console.log(r))
.catch(err => console.log(err));
import bitwala from 'bitwala';
import express from 'express';
import bodyParser from 'body-parser';
const token = {
_id: 'SuBnyc6d564P49Uuls',
secret: 'LTdFE6hw725yh0aM4m4azACEZSpNrtl4aowFjCZetSAAPBaGN3Ecq7FgMSR5b3Va'
};
const router = express.Router();
router.use(bodyParser.json({
limit: '100kb',
type: 'application/*+json'
}));
router.post('/callbacks/bitwala', function (req, res, next) {
// !important: use body-parser
const signatureOk = bitwala.verifications.verifyCallback(req, token.secret);
...
res.success();
});
...
FAQs
Node client for the Bitwala API (docs.bitwala.apiary.io)
The npm package bitwala receives a total of 9 weekly downloads. As such, bitwala popularity was classified as not popular.
We found that bitwala demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.