# Accounts example code

Post by: satoshi on December 10, 2010, 07:21:03 PM`

Some sample pseudocode using the new Accounts based commands in 0.3.18.

print "send to " + getaccountaddress(username) + " to fund your account"<br>
print "balance: " + getbalance(username, 0)<br>
print "available balance: " + getbalance(username, 6)

// if you make a sale, move the money from their account to your "" account<br>
if (move(username, "", amount, 6, "purchased item"))<br>
&nbsp;&nbsp;&nbsp;&nbsp;SendTheGoods()

// withdrawal
sendfrom(username, bitcoinaddress, amount, 6, "withdrawal by user")

You can use listtransactions(username) to show them a list of their recent transactions.

---

Source file: bitcoin-forum-satoshi-nakamoto.tgz

External link: https://bitcointalk.org/index.php?topic=2202.msg28947#msg28947