Created
September 11, 2017 22:01
-
-
Save matejc/7ce1bd25a775754bd638a502a1873049 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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