Call backend API method directly (types unsafe)
Use it if backend API update (add new methods, change request or response fileds), but library is not
Backend API method name
Backend API options object
Promise, what resolved to backend API response result
field value
Close created handling webhooks server
Promise, what resolved void
Create invoice
Use toInvoice backend API result convert function and prepare backend API parameters prepareCreateInvoiceOptions function
New invoice options
Promise, what resolved to created invoice information object
Create handling webhooks server
Important: at the time of publication of version 0.2.0 (Dec 9, 2021), API servers do not accept self-signed certificates
Node.js built-in server options
Webhooks secret path, processing webhooks takes place only on it
Node.js built-in server listen options
Promise, what resolved void
Get API app balance value for passed currency
Call Client.getBalances method to fetch balances information
Currency code
If true, return raw balances in nanos, else return converted to coins balances
If true, return fresh data from backend API, not from cache
Promise, what resolved to API app balance value for passed currency
Get API app balances infomation
Use toBalances backend API result convert function
Call Store.getCurrencies method to fetch exchange rates information
If true, return raw balances in nanos, else return converted to coins balances
If true, return fresh data from backend API, not from cache
Promise, what resolved to API app balances infomation object
Get API supported currencies infomation
Use toCurrencies backend API result convert function
If true, return fresh data from backend API, not from cache
Promise, what resolved to API supported currencies infomation object
Get currency with passed code infomation
Call Store.getCurrencies method to fetch currencies information
Currency code
If true, return fresh data from backend API, not from cache
Promise, what resolved to currency with passed code infomation object or null, if currency with passed code not exists
Get one exchange rate infomation to passed currencies pair
Call Store.getExchangeRates method to fetch exchange rates information, Store.getCurrencies method to fetch currencies information and use getExchageRate function to get signle exchange rate
Source currency code
Target currency code
If true, return fresh data from backend API, not from cache
Promise, what resolved to exchange rate or zero, if currencies pair not exists
Get API supported currencies exchange rate infomation
Use toExchangeRates backend API result convert function
If true, return fresh data from backend API, not from cache
Promise, what resolved to API supported currencies exchange rate infomation object
Get invoices
Use toInvoices backend API result convert function and prepare backend API parameters prepareGetInvoicesOptions function
Filters options
Promise, what resolved to invoices information object
Get invoices paginated
Fetch invoices with page
options parameter, except count
and offset
See Client.getPageSize and Client.setPageSize
Use toInvoicesPaginated backend API result convert function and prepare backend API parameters prepareGetInvoicesPaginateOptions function
Filters options
Promise, what resolved to invoices information object
Return count invoices per page for Client.getInvoicesPaginate method
Create middleware function for Express.js-like API
Middleware function
Subscribes to paid
event
See ClientEmitter._emit to more about event listener
paid
event name
Event listener with invoice
and requestDate
callback parameters
Set count invoices per page for Client.getInvoicesPaginate method
Emit event to listeners
paid
event name
Paid invoice information object
Date of occurrence of event, need to filter old event. If server is not available, backend API try resend webhooks by timeout, so when server becomes available again, many old events will be sent from backend API.
Handling webhook data, send response and emit events
Parsed request body
Node.js built-in IncomingMessage object
Node.js built-in ServerResponse object
Create class instance
Crypto Bot API key, looks like '1234:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
API endpoint url or 'mainnet' or 'testnet' for hardcoded in library endpoint urls
Transport class instance
Api key
Event listeners store
Handling webhooks created Node.js built-in server
Main class for work with API for Node.js
Library for Node.js default export this class