GetWalletInfo()
Summary
Route | Type | Example |
---|---|---|
/monitor/getwalletinfo | POST | http://apinode.credits.com/api/monitor/getwalletinfo |
Description
Gets information about the wallet balance, including a detailed list of outgoing and incoming delegations.
Request
Request Structure
x
{
// Parameters common for all requests
// Wallet address
"PublicKey": "public key in base 58 format",
}
Request Parameters
string: PublicKey - Wallet address (public key) in Base58
Response
JSON output depends on the request type and its success.
If there’s an error, request returns to the node basic Result:
- Success: False
- Message:
If successful, requested information is returned.
Response Structure
{
// Wallet balance as is in CS
“balance”:"decimal_value",
// Ordinal number of the last transaction of the wallet
“lastTransaction”:i64_value,
“delegated:
[
//Sum of all incoming delegations at the moment
“incoming”:"decimal_value",
//Sum of all outgoing delegations at the moment
“outgoing”:"decimal_value",
//List of donors with indications of the amount and duration of the delegation
“Donors”:
[
“address”:“base58_value”,
“sum”:"decimal_value",
// delegation time (date is in Unix format), if time limit equals to 0, delegation is considered indefinite and can be revoked with the corresponding transaction
“validUntil”:i64
],
“Recipients”:
[
“address”:“base58_value”,
“sum”:"decimal_value",
“validUntil”:i64
]
]
}
Example Code
import requests
import json
def getwalletinfo():
url = 'http://apinode.credits.com/api/monitor/getwalletinfo'
headers = {
'Content-type': 'application/json'
, 'Accept': 'application/json'
, 'Content-Encoding': 'utf-8'
}
data = {
"authKey": ""
, "NetworkAlias":"Mainnet"
, "PublicKey":"HhhRGwgA3W5qcNFrLC3odC4GmbkQnhdEc5XPqBiRW3Wx"
}
answer = requests.post(url, data=json.dumps(data), headers=headers)
response = answer.json()
print(response)
getwalletinfo()