Accounts
Endpoints intended to interact with ADAMANT accounts.
See also:
Get Account by Address
GET /api/accounts?address={ADAMANT address}Description
One of the ways to get actual account's information in ADAMANT blockchain. Send GET request to
/api/accountsendpoint with ADAMANT'saddressas parameter.Response includes:
address— ADAMANT address starting withUbalance— actual confirmed balance of ADAMANT account. Integer amount of 1/10^8 ADM tokens (1 ADM = 100000000)unconfirmedBalance— balance of ADAMANT account, which includes unconfirmed transactionspublicKey— 256-bit public key of ADAMANT address in hex format
Example
Request:
shGET https://endless.adamant.im/api/accounts?address=U777355171330060015Response:
jsonc{ "success": true, "nodeTimestamp": 58030181, "account": { "address": "U777355171330060015", "unconfirmedBalance": "4509718944753", "balance": "4509718944753", "publicKey": "a9407418dafb3c8aeee28f3263fd55bae0f528a5697a9df0e77e6568b19dfe34", "unconfirmedSignature": 0, "secondSignature": 0, "secondPublicKey": null, "multisignatures": [], "u_multisignatures": [] } }
Get Account by Public Key
GET /api/accounts?publicKey={publicKey}Description
One of the ways to get actual account's information in ADAMANT blockchain. Send GET request to
/api/accountsendpoint with ADAMANT'spublicKeyas parameter.Response is in the same format as Get Account by Address.
Example
Request:
shGET https://endless.adamant.im/api/accounts?publicKey=a9407418dafb3c8aeee28f3263fd55bae0f528a5697a9df0e77e6568b19dfe34Response:
jsonc{ "success": true, "nodeTimestamp": 58665858, "account": { "address": "U777355171330060015", "unconfirmedBalance": "4509718944753", "balance": "4509718944753", "publicKey": "a9407418dafb3c8aeee28f3263fd55bae0f528a5697a9df0e77e6568b19dfe34", "unconfirmedSignature": 0, "secondSignature": 0, "secondPublicKey": null, "multisignatures": [], "u_multisignatures": [] } }
Get Account Balance
GET /api/accounts/getBalance?address={ADAMANT address}Description
Request endpoint
/api/accounts/getBalancewith known ADAMANT'saddressto getbalanceandunconfirmedBalanceof account.Response includes:
balance— actual confirmed balance of ADAMANT account. Integer amount of 1/10^8 ADM tokens (1 ADM = 100000000)unconfirmedBalance— balance of ADAMANT account, which includes unconfirmed transactions
Example
Request:
shGET https://endless.adamant.im/api/accounts/getBalance?address=U777355171330060015Response:
jsonc{ "success": true, "nodeTimestamp": 58043462, "balance": "4453802755711", "unconfirmedBalance": "4453802755711" }
Get Account Public Key
GET /api/accounts/getPublicKey?address={ADAMANT address}Description
If you need
publicKeyof ADAMANT account, get it from endpoint/api/accounts/getPublicKeywith known ADAMANT'saddressas parameter.Response includes:
publicKey— 256-bit public key of ADAMANT address in hex format
WARNING
For a
publicKeyto become available in the blockchain, the account must have at least one outgoing transaction. Read more: Chats and uninitialized accounts in ADAMANT.Example
Request:
shGET https://endless.adamant.im/api/accounts/getPublicKey?address=U777355171330060015Response:
jsonc{ "success": true, "nodeTimestamp": 58043820, "publicKey": "a9407418dafb3c8aeee28f3263fd55bae0f528a5697a9df0e77e6568b19dfe34" }
Create New Account
POST /api/accounts/newDescription
Note: To create an ADAMANT account, generate pass phrase and key pair locally in your application.
After that, you can send (it's optional) POST request to
/api/accounts/newendpoint with payload of JSON object which includes:publicKey— 256-bit public key of ADAMANT address in hex format
Response contains ADAMANT account info.
WARNING
Created account is only known to the node where it was presented. This means other apps cannot request this account information yet from the blockchain. To become available, the account must have at least one outgoing transaction. Read more: Chats and uninitialized accounts in ADAMANT.
Example
Request:
shPOST https://clown.adamant.im/api/accounts/newjsonc{ "publicKey": "bee368cc0ce2974adcbcc97e649ac18a031492a579034abed5f77d667001d450" }Response:
jsonc{ "success": true, "nodeTimestamp": 63205623, "account": { "address": "U4697606961271319613", "unconfirmedBalance": "0", "balance": "0", "publicKey": "bee368cc0ce2974adcbcc97e649ac18a031492a579034abed5f77d667001d450", "unconfirmedSignature": 0, "secondSignature": 0, "secondPublicKey": null, "multisignatures": null, "u_multisignatures": null } }