npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

crypto-bot-api

v0.3.3

Published

Simple and minimalistic client for Telegram CryptoBot Crypto Pay API

Downloads

705

Readme

Crypto Bot API - client library for Crypto Pay API

Written in TypeScript up-to-date client library for Crypto Pay API provided by Telegram CryptoBot.

Installing

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.

Usage

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.

Receiving updates

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

Documentation

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.

Building

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

Resources

Code quality

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

Supported environments

  • >= Node.js 12
  • >= Chrome 32
  • >= Firefox 29
  • >= Edge 12
  • >= Safari 8
  • >= Safari on iOS 8
  • > Android Browser 4.4.4

License

MIT