Accounts

Get Account Information

Request information about an account.

POST /api/accounts/open

Request

 {
  "secret": "secret key of account"
}

Response

 {
  "success": true,
  "account": {
    "address": "Address of account. String",
    "unconfirmedBalance": "Unconfirmed balance of account. String",
    "balance": "Balance of account. String",
    "publicKey": "Public key of account. Hex",
    "unconfirmedSignature": "If account enabled second signature, but it's still not confirmed. Integer",
    "secondSignature": "If account enabled second signature. Integer",
    "secondPublicKey": "Second public key of account. Hex",
    "multisignatures": "Multisignatures. Array"
    "u_multisignatures": "uMultisignatures. Array"
  }
}

Example

curl -k -H "Content-Type: application/json" \
-X POST -d '{"secret":"<INSERT SECRET HERE>"}' \
http://localhost:8000/api/accounts/open

Get Account Balance

Request the balance of an account.

GET /api/accounts/getBalance?address=<address>

Response

 {
  "success": true,
  "balance": "Balance of account",
  "unconfirmedBalance": "Unconfirmed balance of account"
}

Example

curl -k -X GET http://localhost:8000/api/accounts/getBalance?address=<address>

Get Account Public Key

Get the public key of an account. If the account does not exist the API call will return an error.

GET /api/accounts/getPublicKey?address=address

Response

 {
  "success": true,
  "publicKey": "Public key of account. Hex"
}

Example

curl -k -X GET http://localhost:8000/api/accounts/getPublicKey?address=<address>

Generate Public Key

Returns the public key of the provided secret key.

POST /api/accounts/generatePublicKey

Request

 {
  "secret": "secret key of account"
}

Response

 {
  "success": true,
  "publicKey": "Public key of account. Hex"
}

Example

curl -k -H "Content-Type: application/json" \
-X POST -d '{"secret":"<INSERT SECRET HERE>"}' \
http://localhost:8000/api/accounts/generatePublicKey

Get Account Information from Address

Returns account information of an address.

GET /api/accounts?address=address

Response

 {
  "success": true,
  "account": {
    "address": "Address of account. String",
    "unconfirmedBalance": "Unconfirmed balance of account. Integer",
    "balance": "Balance of account. Integer",
    "publicKey": "Public key of account. Hex",
    "unconfirmedSignature": "If account enabled second signature, but it's still not confirmed. Boolean: true or false",
    "secondSignature": "If account enabled second signature. Boolean: true or false",
    "multisignatures": "Array",
    "u_multisignatures": "Array"
  }
}

Example

curl -k -X GET http://localhost:8000/api/accounts?address=<address>

Get Delegates

Returns delegate accounts by address.

GET /api/accounts/delegates?address=address

Response

 {
    "success": true,
    "delegates": [
      "array of delegates object. (see below the delegate object response)"
    ]
}

Example

curl -k -X GET http://localhost:8000/api/accounts/delegates?address=<address>

Vote Delegates

Vote for the selected delegates. Maximum of 33 delegates at once.

PUT /api/accounts/delegates

Request

 {
    "secret" : "Secret key of account",
    "publicKey" : "Public key of sender account, to verify secret passphrase in wallet. Optional, only for UI",
    "secondSecret" : "Secret key from second transaction, required if user uses second signature",
    "delegates" : "Array of string in the following format: ["+DelegatePublicKey"] OR ["-DelegatePublicKey"]. Use + to UPvote, - to DOWNvote"
}

Response

 {  
   "success": true,
   "transaction": {  
      "type": "Type of transaction. Integer",
      "amount": "Amount. Integer",
      "senderPublicKey": "Sender public key. String",
      "requesterPublicKey": "Requester public key. String",
      "timestamp": "Time. Integer",
      "asset":{  
         "votes":[  
            "+VotedPublickKey",
            "-RemovedVotePublicKey"
         ]
      },
      "recipientId": "Recipient address. String",
      "signature": "Signature. String",
      "signSignature": "Sign signature. String",
      "id": "Tx ID. String",
      "fee": "Fee. Integer",
      "senderId": "Sender address. String",
      "relays": "Propagation. Integer",
      "receivedAt": "Time. String"
   }
}

Example

curl -k -H "Content-Type: application/json" \
-X PUT -d '{"secret":"<INSERT SECRET HERE>","publicKey"="<INSERT PUBLICKEY HERE>","delegates":["<INSERT DELEGATE PUBLICKEY HERE>"]}' \
http://localhost:8000/api/accounts/delegates

Example - With Second Secret

curl -k -H "Content-Type: application/json" \
-X PUT -d '{"secret":["<INSERT SECRET HERE>","secondSecret":"<INSERT SECOND SECRET HERE>", "<INSERT SECOND SECRET HERE>"],"publicKey"="<INSERT PUBLICKEY HERE>","delegates":["<INSERT DELEGATE PUBLICKEY HERE>","<INSERT DELEGATE PUBLICKEY HERE>"]}' \
http://localhost:8000/api/accounts/delegates

Example - Multiple Votes

curl -k -H "Content-Type: application/json" \
-X PUT -d '{"secret":"<INSERT SECRET HERE>","publicKey"="<INSERT PUBLICKEY HERE>","delegates":["<INSERT DELEGATE PUBLICKEY HERE>","<INSERT DELEGATE PUBLICKEY HERE>"]}' \
http://localhost:8000/api/accounts/delegates

What's next?
Loader