Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
crypto-bot-api
Advanced tools
Simple and minimalistic client for Telegram CryptoBot Crypto Pay API
Written in TypeScript up-to-date client library for Crypto Pay API provided by Telegram CryptoBot.
Using npm/yarn:
$ npm install crypto-bot-api
$ yarn add crypto-bot-api
For browsers use bundles from dist
directory or add package to your project dependencies and import it.
In Node.js:
const CryptoBotAPI = require('crypto-bot-api');
const client = new CryptoBotAPI('1234:AAA...AAA');
const me = await client.getMe();
console.log(me);
In browsers:
<script src="crypto-bot-api.min.js"></script>
<script>
var client = new CryptoBotAPI('1234:AAA...AAA');
client.getMe().then(function(me) {
console.log(me);
});
</script>
Important: at the time of publication of version 0.3.3 (Sep 18, 2024), API servers do not return header Access-Control-Allow-Origin, which allows make requests to API from third-party domains, so client request from website environment won't work (but its work in browser extensions, Electron and similar apps)
More usage examples see in examples project directory.
Crypto Pay API support events by sending webhooks requests. To handle webhooks request library proposes to use creating Node.js built-in HTTP or HTTPS server or using Express.js-like middleware API. See examples with names starts with webhooks-
.
Note: you need enable webhooks in CryptoBot app settings, if you want to use self-signed certificate you must uploat it in CryptoBot API application settings
Library documentation can be found in repository GitHub page.
For Node.js usage, we advise you to start studying documentation with library default exported ClientEmitter class.
For browsers usage, we advise you to start studying documentation with library default exported for browsers Client class.
Files for Node.js compiled to lib
directory. Browsers bundles compiled to dist
directory.
$ git clone https://github.com/sergeiivankov/crypto-bot-api
$ cd crypto-bot-api
$ npm i
$ npm run build-docs # To build library documentation
$ npm run build-lib # To build for Node.js
$ npm run build-dist # To build for Browsers
$ npm run build # To build all
Also, project have watch
commands to using it in development:
$ npm run watch-docs # To watch build library documentation
$ npm run watch-lib # To watch build for Node.js
$ npm run watch-dist # To watch build for Browsers
$ npm run watch # To watch all
To maintain high quality of the code and bring source code to a consistent form, project use eslint
linter and has high documentation requirements. If you want to make a pull request, check that documentation matches your changes and eslint
does not signal errors with command:
$ npm run lint
FAQs
Simple and minimalistic client for Telegram CryptoBot Crypto Pay API
The npm package crypto-bot-api receives a total of 33 weekly downloads. As such, crypto-bot-api popularity was classified as not popular.
We found that crypto-bot-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.