1.0.7 • Published 4 years ago
tgcryptopayment v1.0.7
telegramCryptoPayment
Install
npm i tgcryptopayment
How to use
const {Invoice, app} = require('tgcryptopayment');
const token = '10:AABVGyyCSb7Ivx01eHaaBY41ufCDeggLlgs'
app.connect(token, true).then(() => {
console.log("Connected!")
})
API
Invoice
find
const {Invoice} = require('tgcryptopayment');
Invoice.find({asset: 'TON', count: 10, status: 'all'})
/*
return:
Promise<[Invoice]>
*/
findById(invoice_id)
const {Invoice} = require('tgcryptopayment');
Invoice.findById(123)
/*
return:
Promise<Invoice>
*/
confirmPayment()
const {Invoice} = require('tgcryptopayment');
...
const invoice = await Invoice.findById(123)
await invoice.confirmPayment()
/*
return:
Promise<Invoice>
*/
app
- getBalance()
- getBalance()
- getCurrencies()
- getExchangeRates()
- getPayments({ offset, count })
const {app} = require('tgcryptopayment')
app.getBalance()
/*
return:
Promise<Balance>
*/
app.getCurrencies()
/*
return:
Promise<[Currency]>
*/
app.getExchangeRates()
/*
return:
Promise<[ExchangeRate]>
*/
app.getPayments({ offset, count })
/*
return:
Promise<Payment>
*/