Skip to content

jackrobotics/truewallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

truewallet

Build Status Codacy Badge npm License: MIT

True Wallet API for JS

Install

yarn add truewallet

Examples

Login and Logout

const truewallet = require('truewallet')

// Get token with email and password
var token = truewallet.get.token('[email protected]', 'p4ssw0rd')

// Logout
truewallet.logout(token)

Check balance

const truewallet = require('truewallet')

// Get token with email and password
var token = truewallet.get.token('[email protected]', 'p4ssw0rd')

// Check scuccessfully login
if(token !== null) {
  var profile = truewallet.get.profle(token)
  console.log(profile)

  // Logout
  truewallet.logout(token)
}

Topup TrueMoney Cashcard

const truewallet = require('truewallet')

// Get token with email and password
var token = truewallet.get.token('[email protected]', 'p4ssw0rd')

// Check scuccessfully login
if(token !== null) {
  var topup = truewallet.cashcard.topup(token, '00000000000000')

  // Logout
  truewallet.logout(token)
}

Fetch Tx

const moment = require('moment')
const truewallet = require('truewallet')

// Get token with email and password
var token = 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 = truewallet.fetch.activity(token, startDate, endDate)
  console.log(activities)

  // Logout
  truewallet.logout(token)
}

Get Tx detailes by ID

const moment = require('moment')
const truewallet = require('truewallet')

// Get token with email and password
var token = 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 = truewallet.fetch.activity(token, startDate, endDate)

  activities.forEach(function(activity) {
    if(activity.original_action === 'creditor') {
      var data = 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
  truewallet.logout(token)
}

Contributing

We welcome all contributions by sending PR to this repository.

Need Help

If you need help with anything, here're following methods:

Create an Issue

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.

Donation

You can feed me by donating money via Bank Account or PromptPay

About

True Wallet API for JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published