1.0.7 • Published 4 years ago

tgcryptopayment v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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>
*/
1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago