You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Import module asconstcb=require('crypto-bot-js');//Then create new instance likeconstcryptoBot=newcb.CryptoBot({target: 'testnet',//or mainnettoken: 'YOUR-TOKEN_HERE'//Example 3274:AAOBNJIheTfZ3Gwp3lTH4IwxAYXNnA38M5u});//And then you can call any method you want likecryptoBot.getMe().then((r)=>{console.log(`My App name is ${r.name}`);});
Typescript
import{CryptoBot,CryptoBotApp}from'crypto-bot-js';//Then you should create a new instance of CryptoBotconstcryptoBot=newCryptoBot({target: 'testnet',token: 'YOUR-TOKEN_HERE'//Example 3274:AAOBNJIheTfZ3Gwp3lTH4IwxAYXNnA38M5u});//Here you can execute any method you want.cryptoBot.getMe().then((r: CryptoBotApp)=>{console.log(`My App name is ${r.name}`);});
Methods
Method
Description
Request Params
Response Result
getMe
A simple method for testing your app's authentication token
Status of invoices. Available statusses active or paid. Default all statusses.
offset
number
Yes
0
Offset needed to return a specific subset of invoices.
count
number
Yes
100
Number of invoices to return. Default 100, max 1000.
CryptoBotGetPaymentsInput
Name
Type
Optional
Default
Description
offset
number
Yes
0
Offset needed to return a specific subset of invoices.
count
number
Yes
100
Number of invoices to return.
CryptoBotInvoiceInput
Name
Type
Optional
Default
Description
asset
CryptoBotAsset
No
None
Currency code.
amount
string
No
None
Amount of the invoice in float. For example 125.50
description
string
Yes
None
Description of the invoice. Up to 1024 symbols
paid_btn_name
'viewItem ' or 'openChannel' or 'openBot' or 'callback'
Yes
callback
This button will be shown when your invoice was paid
paid_btn_url
string
Yes
None
This is required when you use paid_btn_name. Paid button URL.You can set any payment success link (for example link on your bot). Start with https or http.
payload
string
Yes
None
Some data. User ID, payment id, or any data you want to attach to the invoice.
allow_comments
boolean
Yes
true
Allow adding comments when paying an invoice.
allow_anonymous
boolean
Yes
true
Allow pay invoice as anonymous
Response Parameters
These are the parameters contained in a response of your request.