Bitcointalk · Accounts example code

中本聪,2010 年 12 月 10 日

SN-3834 已核对来源,附原文与上下文。

阅读语言
中文译文

一个使用 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) 向他们展示其近期交易列表。

ORIGINAL · 英文原文
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.
上下文
← 上一条 SN-3834 · 当前 下一条 → 在档案中查看完整主题串 →
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-3834