What would be three of the most used lines of code in the JavaScript SDK that could make my wallet perform small actions for me?

closed as too broad by Nekrataal, Henry WH Hack v2.1.3, Helmar, Andrei Savin, Glorfindel Jan 20 '18 at 17:40

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


The simplest one, show balances:

      .then(function(account) {
          account.balances.forEach(function(balance) {
              // show them

Next in line, show last payments:

          // show them

And finally, sending payments:

server.loadAccount(publicKey).then(function(sourceAccount) {
    var operation = StellarSdk.Operation.payment({
            destination: targetKey,
            asset: StellarSdk.Asset.native(),
            amount: ''+amount
    var transaction = new StellarSdk.TransactionBuilder(sourceAccount)

There are many more operations you could add to your wallet like setting inflation destination, buy/sell assets in the distributed exchange, etc but these are the basic operations every wallet should have for starters.

Not the answer you're looking for? Browse other questions tagged or ask your own question.