Socket
Socket
Sign inDemoInstall

personalcapital-js-telegram

Package Overview
Dependencies
139
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    personalcapital-js-telegram

NodeJS API wrapper for the private Personal Capital API with support for entering 2fa code via telegram chat bot


Version published
Weekly downloads
3
Maintainers
1
Install size
10.6 MB
Created
Weekly downloads
 

Readme

Source

NodeJS Wrapper for the Personal Capital private API.

SMS 2FA must be enabled on your account in order to use this, this is not an API limitation, should someone need non-sms auth it can be implemented.

Wrapper Functions :

updateBalance method works with all custom accounts other than Custom Stock Options and Manual Investment Holdings. addHolding, updateHolding, and updateInvestmentCashBalance methods work with Manual Investment Holdings asset type

Installation

$ npm install personalcapital
$ npm install request@^2.34

Usage

;({
  PersonalCapital,
  TwoFactorMode
} = require('./personalcapital/personalcapital.js'))
let tcfs = require('tough-cookie-file-store')
let request = require('request-promise-native')
let pc = new PersonalCapital(
  (name = 'pcjs'),
  (cookiejar = request.jar(new tcfs('./pc-cookie.json'))),
  'your-telegram-bot-token',
  'your-telegram-chat-id'
)

let main = async () => {
  await pc.auth('USERNAME', 'PASSWORD')
  let accounts = await pc.getAccounts()
  let accountIds = accounts.map(e => e.accountId).slice(0, 3)
  console.log(await pc.getHistories((accounts = accountIds)))
  return ''
}

main().then(() => process.exit())

Attributions

  • John Collins (@jamaicanmoose) : Wrapper Development
  • Haochi Chen (@haochi) : Inspiration for authentication method from his Python wrapper

Keywords

FAQs

Last updated on 14 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc