Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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 3 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.