Skip to content

Instantly share code, notes, and snippets.

@matejc
Created September 11, 2017 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matejc/7ce1bd25a775754bd638a502a1873049 to your computer and use it in GitHub Desktop.
Save matejc/7ce1bd25a775754bd638a502a1873049 to your computer and use it in GitHub Desktop.
async function test () {
let prefix = 'my-super-dooper-user-prefix';
await add(prefix, 'silver_hook', -2.6);
await add(prefix, 'Predkambrij', -2);
await add(prefix, 'offlinehacker', -200);
await add(prefix, 'offlinehacker', -200);
await add(prefix, 'offlinehacker', 2);
let transactions = await list(prefix, 'offlinehacker');
let balance = await get(prefix, 'offlinehacker');
console.log({transactions, balance})
// {
// transactions: [
// {
// time: '1505167111860',
// amount: '2'
// }, {
// time: '1505167147082',
// amount: '-200'
// }, {
// time: '1505167147182',
// amount: '-200'
// }, {
// time: '1505167147282',
// amount: '2'
// }
// ],
// balance: -396
// }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment