Download Qitmeer Wallet from github.com/Qitmeer/qitmeer-wallet
# run rpc or ul model will support rpc interface
./qitmeer-wallet web
Usage:
RPC interface URL http://127.0.0.1:38130/api
curl -k -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["account"],"id":1}' http://127.0.0.1:38130/api | jq
{"jsonrpc":"1.0","method":"wallet_unlock","params":["password",30],"id":1}
{"jsonrpc":"1.0","method":"wallet_lock","params":[],"id":1}
{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":[],"id":1}
result:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"account": {
"TotalAmount": 0,
"SpendAmount": 0,
"UnspendAmount": 0,
"ConfirmAmount": 0
},
"default": {
"TotalAmount": 280000000000,
"SpendAmount": 0,
"UnspendAmount": 280000000000,
"ConfirmAmount": 0
},
"imported": {
"TotalAmount": 11172999678800,
"SpendAmount": 325000000000,
"UnspendAmount": 8754999678800,
"ConfirmAmount": 2418000000000
}
}
}
{"jsonrpc":"1.0","method":"wallet_createAccount","params":["accountName"],"id":1}
{"jsonrpc":"1.0","method":"wallet_getAddressesByAccount","params":["default"],"id":1}
result:
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"TmSbEJs3nDmy68Af7M4Rsuj4pyAwcAret5a",
"Tmbzp2af9Ereh2hRejcVH9mCQgYdY2GHCAa",
"TmZu8zU1i6xbZMpLQZLMAJsyWHanZXUZtiV"
]
}
{"jsonrpc":"1.0","method":"wallet_createAddress","params":["default"],"id":1}
result:
{
"jsonrpc": "2.0",
"id": 1,
"result": "TmhMzHPCH6F2k3WYQkyvjhwAXoZt7q8TFv9"
}
{"id":1574828051839,"method":"wallet_sendToAddressByAccount","params":["default","TmZu8zU1i6xbZMpLQZLMAJsyWHanZXUZtiV",800,"",""]}
result:
{
"jsonrpc": "2.0",
"id": 1574828051839,
"result": "b1ff3645c374992313e66d504fdf4fd3f2006f9414b97a7e1f6382328cc74fb1"
}
{"id":1574750774018,"method":"wallet_getTxListByAddr","params":["TmhJcjphz3Y3jRysKT56JaH8m9pzAzsFMu7",2,-1,100]}
result:
{
"jsonrpc": "2.0",
"id": 1574750774018,
"result": {
"Total": 1,
"Page": 1,
"PageSize": 1000000000,
"transactions": [
{
"hex": "",
"txid": "47879fb9dea684e4ce6f24f30812d3832d11fee34400754c6d8b34cd7d7eba8f",
"txhash": "937de7e15ec48e9cd58d79c594e7395015d5c663924ab5af929a9ef5e5f2e446",
"size": 377,
"version": 1,
"locktime": 0,
"expire": 0,
"vin": [
...
],
"vout": [
...
],
"blockhash": "026c6c85a1ae0183fe2e8bfda3450b9990acf9b8c4af3e995f9e361c7bb3d4cd",
"confirmations": 0
}
]
}
}
{"id":1574750774018,"method":"wallet_importWifPrivKey","params":["imported","xxxxx",false]}
{"id":1574829854509,"method":"wallet_dumpPrivKey","params":["Tmh3je9zbnHAvPfwwHhQsFSJmKkeRTtKqmV"]}
{"jsonrpc":"1.0","method":"ui_openWallet","params":["pass"],"id":1}
{"jsonrpc":"1.0","method":"wallet_syncStats","params":[],"id":1}
result:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"Height": 20460
}
}
{"jsonrpc":"1.0","method":"wallet_getUtxo","params":["TmgD1mu8zMMV9aWmJrXqQYnWRhR9SBfDZG6"],"id":1}
result:
{
"jsonrpc": "2.0",
"id": 1,
"result": [{
"Txid": "54c47af3a17201c64a8f3b27164d4e09e8e38e05501b16bfd4f001caeddfa86a",
"Index": 1,
"Amount": 699925600
}]
}
{"jsonrpc":"1.0","method":"wallet_importPrivKey","params":["imported","xxxxxx",true],"id":1}
{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmfDniZnvsjdH98GsH4aetL3XQKFUTWPp4e",1],"id":16}
result:
{
"jsonrpc": "2.0",
"id": 16,
"result": {
"TotalAmount": 400000000,
"SpendAmount": 0,
"UnspendAmount": 400000000,
"ConfirmAmount": 0
}
}
{
"id": 1578639635748,
"method": "wallet_sendToAddressBatch",
"params": [{
"TmeUg4pxc14y64J5BQj4M7jKEryeYfJ4APh": 0.1,
"TmU3Xwo1rnh4hTKBwifDYAccDrF3kxXaEFe": 0.2,
"TmjbGfbcMN1nVVHdcvzmPA4ksKqGq4eEkXu": 0.3,
"TmmWRCMcRZ1ZGdQEw2BwZ3ibsobATw4KTrw": 0.4
}]
}
result:
{
"jsonrpc": "2.0",
"id": 1578639635748,
"result": "d7a7d24d47bb66ad3d3185764808af730c9a9dbb5970686cf6e5a1d5f249923c"
}
© Copyright Qitmeer 2021.
This work is licensed under a Creative Commons Attribution 4.0 International License