/ examples / balance.ts
balance.ts
 1  import * as izly from "../src";
 2  import { read } from "./_persisted-session";
 3  
 4  void (async function main() {
 5    const identification = await read();
 6  
 7    const balance = await izly.balance(identification);
 8    // note that information also gives balance but let's not use it here !
 9    const { configuration } = await izly.information(identification);
10  
11    console.log("Your balance is currently at", balance.value, configuration.currency);
12    console.log("Your cash balance is currently at", balance.cashValue, configuration.currency);
13    console.log(`Last updated the ${balance.lastUpdate.toLocaleString("fr-FR")}`);
14  }());