question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Minimum balance calculator in Account object

See original GitHub issue

This would be extremely helpful for people writing clients and cutting down on confusion.

This is just a back-of-the-napkin API design. More care should be taken into designing this API.

let sdkAccount = Server.loadAccount(blah);
let reserve = sdkAccount.calculateReserve();

Brainstorming API; just a thought; not final; faulty api design

And then reserve would give us

{
  baseReserve: 20,
  totalReserve: 55,
  maxNativeSend: '53.2853952',

  canAddTrust: false,
  canCreateOffer: false,
  canAddSigner: false,
  canAddData: false,
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
jedmccalebcommented, Sep 15, 2017

I think we just need:

let sdkAccount = Server.loadAccount(blah);
if sdkAccount.canCreateSubentry() {
...
and 

sdkAccount.maxNativeSend()
 
0reactions
irislicommented, Nov 17, 2017

It’s effectively static on a human scale of time. I can expect that it’ll only chance at most once a year. (As opposed to changing every 5 seconds)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checkbook Balance Calculator
Balance your checkbook using this formatted checkbook calculator. Provides a total that should match your checkbook balance. Hints on how to balance your ......
Read more >
2023 Balance Transfer Calculator
Use WalletHub's balance transfer calculator to price out a balance transfer & find the best 0% card. Personalize your repayment plan & maximize...
Read more >
Credit Card Calculator
Free credit card calculator to find the time it will take to pay off a balance, or the amount necessary to pay it...
Read more >
Credit Card Minimum Payment Calculator
Find out the difference in interest between a fixed payment and the minimum credit card payment with Bankrate's financial calculator.
Read more >
How Much Money Should I Have in My Checking Account
Use the following formula to calculate how much money to keep in your checking account. + Minimum Balance Requirement
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found