比特币(Bitcoin) RPC Wallet API中sendtoaddress的用法及代码示例。
用法:
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" )
汇款至指定地址。
参数1 - address
类型:字符串,必填
要发送到的比特币地址。
参数2 - amount
类型:数字或字符串,必填
要发送的BTC数量。例如0.1
参数3 - comment
类型:字符串,可选
- 用于存储交易用途的注释。
这不是交易的一部分,只是保存在您的钱包中。
参数4 - comment_to
类型:字符串,可选
- 存储个人或组织名称的注释
您要将交易发送到的地址。这不是交易的一部分,只是保存在您的钱包中。
参数5 - subtractfeefromamount
类型:布尔值,可选,默认= false
- 该费用将从发送的数量中扣除。
收件人收到的比特币将少于您在“数量”字段中输入的比特币。
参数6 - replaceable
类型:布尔值,可选,默认值=后备到钱包的默认值
允许通过BIP 125将此项交易替换为费用较高的交易
参数7 - conf_target
类型:数字,可选,默认值=后备到钱包的默认值
确认目标(以块为单位)
参数8 - estimate_mode
类型:字符串,可选,默认= UNSET
- 费用估算模式,必须是以下之一:
“UNSET” “ECONOMICAL” “CONSERVATIVE”
返回结果
名称 |
类型 |
描述 |
---|---|---|
txid |
string |
交易编号。 |
示例
bitcoin-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1
bitcoin-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 "donation" "seans outpost"
bitcoin-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 "" "" true
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendtoaddress", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd", 0.1, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
相关用法
- Bitcoin abandontransaction用法及代码示例
- Bitcoin abortrescan用法及代码示例
- Bitcoin addmultisigaddress用法及代码示例
- Bitcoin backupwallet用法及代码示例
- Bitcoin bumpfee用法及代码示例
- Bitcoin createwallet用法及代码示例
- Bitcoin dumpprivkey用法及代码示例
- Bitcoin dumpwallet用法及代码示例
- Bitcoin encryptwallet用法及代码示例
- Bitcoin getaddressesbylabel用法及代码示例
- Bitcoin getaddressinfo用法及代码示例
- Bitcoin getbalance用法及代码示例
- Bitcoin getnewaddress用法及代码示例
- Bitcoin getrawchangeaddress用法及代码示例
- Bitcoin getreceivedbyaddress用法及代码示例
- Bitcoin getreceivedbylabel用法及代码示例
- Bitcoin gettransaction用法及代码示例
- Bitcoin getwalletinfo用法及代码示例
- Bitcoin importaddress用法及代码示例
- Bitcoin importmulti用法及代码示例
- Bitcoin importprivkey用法及代码示例
- Bitcoin importpubkey用法及代码示例
- Bitcoin importwallet用法及代码示例
- Bitcoin keypoolrefill用法及代码示例
- Bitcoin listaddressgroupings用法及代码示例
注:本文由纯净天空筛选整理自bitcoin.org大神的英文原创作品 Bitcoin sendtoaddress。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。