比特幣(Bitcoin) RPC Wallet API中getnewaddress的用法及代碼示例。
用法:
getnewaddress ( "label" "address_type" )
返回一個新的比特幣地址以接收付款。
如果指定了‘label’,則會將其添加到通訊簿中,以便使用該地址收到的付款將與‘label’相關聯。
參數1 - label
類型:字符串,可選,默認=“”
要鏈接的地址的標簽名稱。也可以將其設置為空字符串“”以表示默認標簽。標簽不需要存在,如果沒有給定名稱的標簽,則會創建標簽。
參數2 - address_type
類型:字符串,可選,默認=由-addresstype設置
要使用的地址類型。選項為“legacy”,“p2sh-segwit”和“bech32”。
返回結果
名稱 |
類型 |
描述 |
---|---|---|
address |
string |
新的比特幣地址 |
示例
bitcoin-cli getnewaddress
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -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 getrawchangeaddress用法及代碼示例
- Bitcoin getreceivedbyaddress用法及代碼示例
- Bitcoin getreceivedbylabel用法及代碼示例
- Bitcoin gettransaction用法及代碼示例
- Bitcoin getwalletinfo用法及代碼示例
- Bitcoin importaddress用法及代碼示例
- Bitcoin importmulti用法及代碼示例
- Bitcoin importprivkey用法及代碼示例
- Bitcoin importpubkey用法及代碼示例
- Bitcoin importwallet用法及代碼示例
- Bitcoin keypoolrefill用法及代碼示例
- Bitcoin listaddressgroupings用法及代碼示例
- Bitcoin listlabels用法及代碼示例
注:本文由純淨天空篩選整理自bitcoin.org大神的英文原創作品 Bitcoin getnewaddress。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。