Create class instance
Crypto Bot API key, looks like '1234:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
API endpoint url or 'mainnet' or 'testnet' for hardcoded in library endpoint urls
Static
CheckAccess to CheckStatus enumeration, used in Check type, Client.getChecks and Client.getChecksPaginate methods options
Static
CurrencyAccess to CurrencyType enumeration, used in Invoice type
Static
DetailedAccess to DetailedCurrencyType enumeration, used in Store.getCurrencies and Client.getCurrency methods results
Static
InvoiceAccess to InvoiceStatus enumeration, used in Invoice type, Client.getInvoices and Client.getInvoicesPaginate methods options
Static
TransferAccess to TransferStatus enumeration, used in Transfer type, Client.getTransfers and Client.getTransfersPaginate methods options
Protected
_transportTransport class instance
Private
_apiApi key
Private
_eventsEvent listeners store
Private
_serverHandling webhooks created Node.js built-in server
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
Create check
Use toCheck backend API result convert function and prepare backend API parameters prepareCreateCheckOptions function
New check options
Promise, what resolved to created check information object
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
If you app work behind proxy and no need create HTTPS server,
no pass key
and cert
fields and add http
field with true
value: { http: true }
Note: if you want to use self-signed certificate you must uploat it in CryptoBot API application settings
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
Crypto currency code
Promise, what resolved to API app balance value for passed currency
Get API app balance value for passed currency
Call Client.getBalances method to fetch balances information
Crypto currency code
Promise, what resolved to API app available balance value for passed currency
Get API app balance value for passed currency
Call Client.getBalances method to fetch balances information
Crypto currency code
Promise, what resolved to API app balance on hold value for passed currency
Get API app balances infomation
Use toBalances backend API result convert function
Promise, what resolved to API app balances infomation object
Get API app balances infomation
Use toBalances backend API result convert function
Promise, what resolved to API app available balances infomation object
Get API app balances infomation
Use toBalances backend API result convert function
Promise, what resolved to API app balances on hold infomation object
Get checks
Use toChecks backend API result convert function and prepare backend API parameters prepareGetChecksOptions function
Filters options
Promise, what resolved to checks information object
Get checks paginated
Fetch checks with page
options parameter, except count
and offset
See Client.getPageSize and Client.setPageSize
Use toChecks backend API result convert function and prepare backend API parameters prepareGetChecksPaginateOptions function
Filters options
Promise, what resolved to checks information object
Get API supported currencies infomation
Use toCurrencies backend API result convert function
Optional
isForce: booleanIf 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
Optional
isForce: booleanIf 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 toInvoices backend API result convert function and prepare backend API parameters prepareGetInvoicesPaginateOptions function
Filters options
Promise, what resolved to invoices information object
Get associated with passed API key app infomation
Use toMe backend API result convert function
If true, return fresh data from backend API, not from cache
Promise, what resolved to associated with passed API key app infomation object
Return count invoices per page for Client.getInvoicesPaginate method
Get associated with passed API key app statistics
Use toStats backend API result convert function
New receive statistics options
Promise, what resolved to associated with passed API key app statistics object
Get transfers
Use toTransfers backend API result convert function and prepare backend API parameters prepareGetTransfersOptions function
Filters options
Promise, what resolved to transfers information object
Get transfers paginated
Fetch checks with page
options parameter, except count
and offset
See Client.getPageSize and Client.setPageSize
Use toTransfers backend API result convert function and prepare backend API parameters prepareGetTransfersOptions function
Filters options
Promise, what resolved to transfers information object
Create middleware function for Express.js-like API
Middleware function
Subscribes to paid
event
See ClientEmitter._emit to more about event listener
Set count invoices per page for Client.getInvoicesPaginate method
Invoices per page
Transfer
Use toTransfer backend API result convert function and prepare backend API parameters prepareTransferOptions function
Transfer options
Promise, what resolved to completed transfer information object
Private
_emitEmit 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.
Private
_handle
Main class for work with API for Node.js
Library for Node.js default export this class