账户示例代码
原始发布页
打开来源页面查看 1 个交叉存档
下面是一些使用 0.3.18 中基于账户的新命令的伪代码示例。
print "send to " + getaccountaddress(username) + " to fund your account" print "balance: " + getbalance(username, 0) print "available balance: " + getbalance(username, 6)
// if you make a sale, move the money from their account to your "" account if (move(username, "", amount, 6, "purchased item")) SendTheGoods()
// withdrawal sendfrom(username, bitcoinaddress, amount, 6, "withdrawal by user")
你可以使用 listtransactions(username) 向他们显示最近的交易列表。
英文原文
展开英文原文
Some sample pseudocode using the new Accounts based commands in 0.3.18.
print "send to " + getaccountaddress(username) + " to fund your account" print "balance: " + getbalance(username, 0) print "available balance: " + getbalance(username, 6)
// if you make a sale, move the money from their account to your "" account if (move(username, "", amount, 6, "purchased item")) SendTheGoods()
// withdrawal sendfrom(username, bitcoinaddress, amount, 6, "withdrawal by user")
You can use listtransactions(username) to show them a list of their recent transactions.