Account Operations

Get Account

Get account information given an account ID.

Request:

  • requestType is getAccount

  • account is the account ID

  • includeEffectiveBalance is true to include effectiveBalancePrizm and guaranteedBalanceNQT (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • unconfirmedBalanceNQT (S) is balanceNQT less unconfirmed outgoing transactions, the balance displayed in the client

  • effectiveBalancePrizm (N) is the balance (in PRIZM) of the account available for forging

  • forgedBalanceNQT (S) is the balance (in NQT) that the account has forged

  • balanceNQT (S) is the minimally confirmed basic balance (in NQT) of the account

  • publicKey (S) is the public key of the account

  • requestProcessingTime (N) is the API request processing time (in millisec)

  • guaranteedBalanceNQT (S) is the balance (in NQT) of the account with at least 1440 confirmations

  • unconfirmedAssetBalances (A) is an array of asset objects including the fields unconfirmedBalanceQNT (S) and asset (S) ID

  • accountRS (S) is the Reed-Solomon address of the account

  • name (S) is the name associated with the account, if applicable

  • description (S) is the description of the account, if applicable

  • account (S) is the account number

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

Example: Refer to Get Account example.

Get Account Block Count

Get the number of blocks forged by an account.

Request:

  • requestType is getAccountBlockCount

  • account is an account ID

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • numberOfBlocks (N) is the number of blocks forged by the account

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Account Block Count example.

Get Account Block Ids

Get the block IDs of all blocks forged (generated) by an account in reverse block height order.

Request:

  • requestType is getAccountBlockIds

  • account is the account ID

  • timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)

  • firstIndex is a zero-based index to the first block ID to retrieve (optional)

  • lastIndex is a zero-based index to the last block ID to retrieve (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • blockIds (A) is an array of block IDs

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millsec)

Example: Refer to Get Account Block Ids example.

Get Account Blocks

Get all blocks forged (generated) by an account in reverse block height order.

Request:

  • requestType is getAccountBlocks

  • account is the account ID

  • timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)

  • firstIndex is a zero-based index to the first block to retrieve (optional)

  • lastIndex is a zero-based index to the last block to retrieve (optional)

  • includeTransactions is true to retrieve transaction details, otherwise only transaction IDs are retrieved (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • blocks (A) is an array of blocks (refer to Get Block for details)

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Account Blocks example.

Get Account Id

Get an account ID given a secret passphrase or public key. POST only.

Request:

  • requestType is getAccountId

  • secretPhrase is the secret passphrase of the account (optional)

  • publicKey is the public key of the account (optional if secretPhrase provided)

Response:

  • accountRS (S) is the Reed-Solomon address of the account

  • publicKey (S) is the public key of the account

  • requestProcessingTime (N) is the API request processing time (in millisec)

  • account (S) is the account number

Example: Refer to Get Account Id example.

Get Account Ledger

Get multiple account ledger entries.

Request:

  • requestType is getAccountLedger

  • account is the account ID (optional)

  • firstIndex is a zero-based index to the first block to retrieve (optional)

  • lastIndex is a zero-based index to the last block to retrieve (optional)

  • event is the event ID (optional)

  • eventType is a string representing the event type (optional)

  • holdingType is a string representing the holding type (optional)

  • holding is the holding ID (optional)

  • includeTransactions is true to retrieve transaction details, otherwise only transaction IDs are retrieved (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • entries (A) is an array of ledger objects including the fields:

    • change (S) is the change in the balance for the holding identified by 'holdingType'

    • eventType (S) is the event type causing the account change

    • ledgerId (S) is the ledger entry ID

    • holding (S) is the item identifier for an asset or currency balance

    • isTransactionEvent (B) is true if the event is associated with a transaction and false if it is associated with a block.

    • balance (S) is the balance for the holding identified by 'holdingType'

    • holdingType (S) is the item being changed (account balance, asset balance or currency balance)

    • accountRS (S) is the Reed-Solomon address of the account

    • block (S) is the block ID that created the ledger entry

    • event (S) is the block or transaction associated with the event

    • account (S) is the account number

    • height (N) is the the block height associated with the event

    • timestamp (N) is the the block timestamp associated with the event

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Account Ledger example.

Get Account Ledger Entry

Get a specific account ledger entry.

Request:

  • requestType is getAccountLedgerEntry

  • ledgerId is the ledger ID

  • includeTransactions is true to retrieve transaction details, otherwise only transaction IDs are retrieved (optional)

  • includeHoldingInfo is true to retrieve asset or currency info (optional) with the ledger entry. The default is false.

Response:

  • change (S) is the change in the balance for the holding identified by 'holdingType'

  • eventType (S) is the event type causing the account change

  • ledgerId (S) is the ledger entry ID

  • holding (S) is the item identifier for an asset or currency balance

  • isTransactionEvent (B) is true if the event is associated with a transaction and false if it is associated with a block.

  • balance (S) is the balance for the holding identified by 'holdingType'

  • holdingType (S) is the item being changed (account balance, asset balance or currency balance)

  • accountRS (S) is the Reed-Solomon address of the account

  • block (S) is the block ID that created the ledger entry

  • event (S) is the block or transaction associated with the event

  • account (S) is the account number

  • height (N) is the the block height associated with the event

  • timestamp (N) is the the block timestamp associated with the event

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Account Ledger Entry example.

Get Account Public Key

Get the public key associated with an account ID.

Request:

  • requestType is getAccountPublicKey

  • account is the account ID

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • publicKey (S) is the 32-byte public key associated with the account, returned as a hex string

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Account Public Key example.

Get Account Transaction Ids

(Removed. Use Get Blockchain Transactions instead.)

Get Account Transactions

(Removed. Use Get Blockchain Transactions instead.)

Get Balance

Get the balance of an account.

Request:

  • requestType is getBalance

  • account is an account ID

  • includeEffectiveBalance is true to include effectiveBalancePrizm and guaranteedBalanceNQT (optional)

  • height is the height to retrieve account balance for, if still available (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • unconfirmedBalanceNQT (S) is balanceNQT less unconfirmed outgoing transactions, the balance displayed in the client

  • guaranteedBalanceNQT (S) is the balance (in NQT) of the account with at least 1440 confirmations

  • effectiveBalancePrizm (N) is the balance (in PRIZM) of the account available for forging: the unleased guaranteedBalance of this account plus the leased guaranteedBalance of all lessors to this account

  • forgedBalanceNQT (S) is the balance (in NQT) that the account has forged

  • balanceNQT (S) is the minimally confirmed basic balance (in NQT) of the account

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Balance example.

Get Blockchain Transactions

Get the transactions associated with an account in reverse block timestamp order.

Request:

  • requestType is getBlockchainTransactions

  • account is the account ID

  • timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)

  • type is the type of transactions to retrieve (optional)

  • subtype is the subtype of transactions to retrieve (optional)

  • firstIndex is a zero-based index to the first transaction to retrieve (optional)

  • lastIndex is a zero-based index to the last transaction to retrieve (optional)

  • numberOfConfirmations is the required number of confirmations per transaction (optional)

  • withMessage is true to retrieve only only transactions having a message attachment, either non-encrypted or decryptable by the account (optional)

  • includeExpiredPrunable is true' to retrieve pruned data if available (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Note: Refer to Get Constants for definitions of types and subtypes

Response:

  • transactions (A) is an array of transactions (refer to Get Transaction for details)

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Blockchain Transactions example.

Get Guaranteed Balance

Get the guaranteed balance of an account. This is the minimum balance the account had in the interval

(currentHeight - numberOfConfirmations, currentHeight]

Amounts in unconfirmed transactions are not deduced from the result (or included to the result).

Request:

  • requestType is getGuaranteedBalance

  • account is an account ID

  • numberOfConfirmations is the minimum number of confirmations for a transaction to be included in the guaranteed balance (optional, if omitted or zero then minimally confirmed transactions are included)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • guaranteedBalanceNQT (S) is the balance (in NQT) of the account with at least numberOfConfirmations confirmations

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Guaranteed Balance example.

Get Unconfirmed Transaction Ids

Get a list of unconfirmed transaction IDs associated with an account.

Request:

  • requestType is getUnconfirmedTransactionIds

  • account is one account ID (optional)

  • account is one account ID (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

  • firstIndex is a zero-based index to the first transaction ID to retrieve (optional)

  • lastIndex is a zero-based index to the last transaction ID to retrieve (optional)

Response:

  • unconfirmedTransactionIds (A) is an array of unconfirmed transaction IDs

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Unconfirmed Transaction Ids example.

Get Unconfirmed Transactions

Get a list of unconfirmed transactions associated with an account.

Request:

  • requestType is getUnconfirmedTransactions

  • account is one account ID (optional)

  • account is one account ID (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

  • firstIndex is a zero-based index to the first unconfirmed transaction to retrieve (optional)

  • lastIndex is a zero-based index to the last unconfirmed transaction to retrieve (optional)

Response:

  • unconfirmedTransactions (A) is an array of unconfirmed transactions (refer to Get Transaction for details)

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Get Unconfirmed Transactions example.

Search Accounts

Get accounts having a name or description that match a given query in reverse relevance order.

Request:

  • requestType is searchAccounts

  • query is a full text query on the account fields name (S) and description (S) in the standard Lucene syntax

  • firstIndex is a zero-based index to the first account to retrieve (optional)

  • lastIndex is a zero-based index to the last account to retrieve (optional)

  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)

  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • accounts (A) is an array of account objects with the following fields:

    • account (S) is the account number

    • accountRS (S) is the Reed-Solomon address of the account

    • name (S) is the name of the account

    • description (S) is the description of the account (if applicable)

  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

  • requestProcessingTime (N) is the API request processing time (in millisec)

Example: Refer to Search Accounts example.

Send Money

Send PRIZM to an account. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is sendMoney

  • amountNQT is the amount (in NQT) in the transaction

  • recipient is the account ID of the recipient

  • recipientPublicKey is the public key of the receiving account (optional, enhances security of a new account)

Response: Refer to Create Transaction Response.

Example: Refer to Send Money example.

Set Account Info

Set account information. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is setAccountInfo

  • name is a name to associate with the account (optional)

  • description is a description to associate with the account (optional)

Response: Refer to Create Transaction Response.

Example: Refer to Set Account Info example.