Promise-based True Wallet API for JS
yarn add truewallet
const truewallet = require('truewallet');
;(async () => {
// Get token with email and password
var token = await truewallet.get.token('[email protected]', 'p4ssw0rd')
// Logout
await truewallet.logout(token)
})()
const truewallet = require('truewallet');
;(async () => {
// Get token with email and password
var token = await truewallet.get.token('[email protected]', 'p4ssw0rd')
// Check scuccessfully login
if(token !== null) {
var profile = await truewallet.get.balance(token)
console.log(profile)
// Logout
await truewallet.logout(token)
}
})()
const truewallet = require('truewallet');
;(async () => {
// Get token with email and password
var token = await truewallet.get.token('[email protected]', 'p4ssw0rd')
// Check scuccessfully login
if(token !== null) {
var topup = await truewallet.cashcard.topup(token, '00000000000000')
// Logout
await truewallet.logout(token)
}
})()
const moment = require('moment');
const truewallet = require('truewallet');
;(async () => {
// Get token with email and password
var token = await truewallet.get.token('[email protected]', 'p4ssw0rd')
// Check scuccessfully login
if(token !== null) {
var startDate= moment().subtract(1, 'days').format('YYYY-MM-DD')
var endDate= moment().add(1, 'days').format('YYYY-MM-DD')
var activities = await truewallet.fetch.activity(token, startDate, endDate)
console.log(activities)
// Logout
await truewallet.logout(token)
}
})()
const moment = require('moment');
const truewallet = require('truewallet');
(async () => {
// Get token with email and password
var token = await truewallet.get.token('[email protected]', 'p4ssw0rd')
// Check scuccessfully login
if(token !== null) {
var startDate= moment().subtract(1, 'days').format('YYYY-MM-DD')
var endDate= moment().add(1, 'days').format('YYYY-MM-DD')
var activities = await truewallet.fetch.activity(token, startDate, endDate)
activities.forEach(function(activity) {
if(activity.original_action === 'creditor') {
var data = await truewallet.fetch.txDetail(token, data.report_id)
// Tx ID
var txId = data.section4.column2.cell1.value
// Value
var txValue = data.section3.column1.cell1.value.replace(',', '')
console.log(txId)
console.log(txValue)
}
})
// Logout
await truewallet.logout(token)
}
})()
We welcome all contributions by sending PR to this repository.
If you need help with anything, here're following methods:
If you have something you want to discuss in detail, or have hit an issue which you believe others will also have in deployment or development of the system, opening an issue is the best way to get help. It creates a permanent resource for others wishing to contribute to conversation.
You can feed me by donating money via Bank Account or PromptPay