Accounts

From Nxtwiki
Jump to: navigation, search

Delete Account Property

Deletes an account property. POST only.

Request:

  • requestType is deleteAccountProperty
  • property is the name of the property
  • recipient is the account where a property should be removed (optional)
  • setter is the account who did set the property (optional)

Response: Refer to Create Transaction Response.

Delete Account Property Example

http://localhost:7876/nxt?
  requestType=deleteAccountProperty&
  recipient=NXT-7A48-47JL-T7LD-D5FS3&
  property=testkey1&
  secretPhrase=iWontTellYou&
  feeNQT=100000000&
  deadline=60
{
  "signatureHash": "4ff58a03d056ee8a3fee89766bf8e4acd008c2147216...",
  "transactionJSON": {
    "senderPublicKey": "373522bcd8904f4707472e590cbb67976d40e7af...",
    "signature": "26ed697fc82f3b15e6d2c972eff5b195445314aa4bacc8...",
    "feeNQT": "100000000",
    "type": 1,
    "fullHash": "33f7edaec1034153f8e28a996b13b2b2665d0d0a3e4a194...",
    "version": 1,
    "phased": false,
    "ecBlockId": "10023643060833833497",
    "signatureHash": "4ff58a03d056ee8a3fee89766bf8e4acd008c21472...",
    "attachment": {
        "property": "940296349549404868",
        "version.AccountPropertyDelete": 1
    },
    "senderRS": "NXT-7A48-47JL-T7LD-D5FS3",
    "subtype": 11,
    "amountNQT": "0",
    "sender": "12745647715474645062",
    "recipientRS": "NXT-7A48-47JL-T7LD-D5FS3",
    "recipient": "12745647715474645062",
    "ecBlockHeight": 754255,
    "deadline": 60,
    "transaction": "5999080309032613683",
    "timestamp": 80189128,
    "height": 2147483647
  },
  "unsignedTransactionBytes": "011bc896c7043c00373522bcd8904f4707472e590cbb67976d40e7af39650ea11c...",
  "broadcasted": false,
  "requestProcessingTime": 3,
  "transactionBytes": "011bc896c7043c00373522bcd8904f4707472e590cbb67976d40e7af39650ea11cb2be5734...",
  "fullHash": "33f7edaec1034153f8e28a996b13b2b2665d0d0a3e4a1942718aa480c6097cf6",
  "transaction": "5999080309032613683"
}


Get Account

Get account information given an account ID.

Request:

  • requestType is getAccount
  • account is the account ID
  • includeLessors is true to include lessors, lessorsRS and lessorsInfo (optional)
  • includeAssets is true to include assetBalances and unconfirmedAssetBalances (optional)
  • includeCurrencies is true to include accountCurrencies (optional)
  • includeEffectiveBalance is true to include effectiveBalanceNXT 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
  • effectiveBalanceNXT (N) is the balance (in NXT) of the account available for forging: the unleased guaranteedBalance of this account plus the leased guaranteedBalance of all lessors to this account
  • lessorsInfo (A) is an array of lessor objects including the fields:
    • currentHeightTo (S)
    • nextHeightFrom (S)
    • effectiveBalanceNXT (S)
    • nextLesseeRS (S)
    • currentLesseeRS (S)
    • currentHeightFrom (S)
    • nextHeightTo (S)
  • lessors (A) is an array of lessor account IDs
  • currentLessee (S) is the account number of the lessee, if applicable
  • currentLeasingHeightTo (N) is the block height when the lease completes, if applicable
  • 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)
  • assetBalances (A) is an array of asset objects including the fields balanceQNT (S) and asset (S) ID
  • 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
  • currentLesseeRS (S) is the Reed-Solomon address of the lessee account
  • accountRS (S) is the Reed-Solomon address of the account
  • lessorsRS (A) is an array of Reed-Solomon lessor account addresses
  • accountCurrencies (A) is an array of currency objects (refer to Get Account Currencies for details)
  • 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
  • currentLeasingHeightFrom (N) is the block height when the lease starts, if applicable
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

Get Account Example

http://localhost:7876/nxt?
  requestType=getAccount&
  account=NXT-4VNQ-RWZC-4WWQ-GVM8S
{
 "unconfirmedBalanceNQT": "2501162882344",
 "effectiveBalanceNXT": 13983,
 "lessorsInfo": [
  {
   "currentHeightTo": "341420",
   "nextHeightFrom": "341420",
   "effectiveBalanceNXT": "544525",
   "nextLesseeRS": "NXT-7WVC-W7TJ-REQ2-4VDJD",
   "currentLesseeRS": "NXT-7WVC-W7TJ-REQ2-4VDJD",
   "currentHeightFrom": "308653",
   "nextHeightTo": "374187"
  }
 ],
 "currentLessee": "7114946486381367146",
 "currentLeasingHeightTo": 281179,
 "forgedBalanceNQT": "0",
 "balanceNQT": "2501162882344",
 "publicKey": "73080c6a224062660184f10ebb7fb431d4593...",
 "requestProcessingTime": 2,
 "assetBalances": [
  {
   "balanceQNT": "96651298",
   "asset": "4551058913252105307"
  }
 ],
 "guaranteedBalanceNQT": "1398383666344",
 "unconfirmedAssetBalances": [
  {
   "unconfirmedBalanceQNT": "96651298",
   "asset": "4551058913252105307"
  }
 ],
 "currentLesseeRS": "NXT-TMVC-69YC-SJB4-8YCH7",
 "accountRS": "NXT-4VNQ-RWZC-4WWQ-GVM8S",
 "name": "mystical",
 "account": "17013046603665206934",
 "currentLeasingHeightFrom": 279739
}


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)

Get Account Block Count Example

http://localhost:7876/nxt?
  requestType=getAccountBlockCount&
  account=7114946486381367146
{
 "numberOfBlocks": 460,
 "requestProcessingTime": 70
}


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)

Get Account Block Ids Example

http://localhost:7876/nxt?
  requestType=getAccountBlockIds&
  account=7114946486381367146&
  lastIndex=5
{
 "blockIds": [
  "6021945980475236545",
  "11040962152457477526",
  "1157648883168692101",
  "9322994768555364845",
  "12862636636638339558",
  "11535040705139271493"
 ],
 "requestProcessingTime": 3
}


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)

Get Account Blocks Example

http://localhost:7876/nxt?
  requestType=getAccountBlocks&
  account=7114946486381367146&
  lastIndex=0
{
 "blocks": [
  {
   "previousBlockHash": "bd8948556e968f1d532cd286a5dd8fde0159d7950467f1ed8fbf26a31d663e99",
   "payloadLength": 386,
   "totalAmountNQT": "0",
   "generationSignature": "74138446cacdb30075492670f7e24fb839434818cb877bba174e37361fc899a1",
   "generator": "7114946486381367146",
   "generatorPublicKey": "dbc809e8237914f25add0d349ea16b2ac05cae6882d0a1782d23605af264d97a",
   "baseTarget": "325377698",
   "payloadHash": "32df67383f63b74f1331bbdb6f1be424c87a1e6423fc7091d81683481eb6c4ca",
   "generatorRS": "NXT-TMVC-69YC-SJB4-8YCH7",
   "nextBlock": "3553212706398858282",
   "numberOfTransactions": 2,
   "blockSignature": "d30e3f95d547fa922feb31303f877a345d0ad8c232778a4507adf9082b5df3...",
   "transactions": [
    "1199750337785535382",
    "8975701802988160413"
   ],
   "version": 3,
   "totalFeeNQT": "200000000",
   "previousBlock": "2130086549390920125",
   "block": "6021945980475236545",
   "height": 278953,
   "timestamp": 30130340
  }
 ],
 "requestProcessingTime": 3
}


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

Get Account Id Example

http://localhost:7876/nxt?
  requestType=getAccountId&
  secretPhrase=IWontTellYou
{
 "accountRS": "NXT-L6FM-89WK-VK8P-FCRBB",
 "publicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
 "requestProcessingTime": 2,
 "account": "15323192282528158131"
}


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)
  • includeHoldingInfo is true to retrieve asset or currency info (optional) with each ledger entry. The default is false.
  • 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)

Get Account Ledger Example

http://localhost:7876/nxt?
  requestType=getAccountLedger&
  account=NXT-7A48-47JL-T7LD-D5FS3
{
  "entries": [
    {
      "change": "100",
      "eventType": "CURRENCY_OFFER_EXPIRED",
      "ledgerId": "532246",
      "holding": "6112509426732269765",
      "isTransactionEvent": true,
      "balance": "90000",
      "holdingType": "UNCONFIRMED_CURRENCY_BALANCE",
      "accountRS": "NXT-7A48-47JL-T7LD-D5FS3",
      "block": "2303344830040052747",
      "event": "13236557417702245931",
      "account": "12745647715474645062",
      "height": 736757,
      "timestamp": 78995635
    }
  ],
    "requestProcessingTime": 1
}


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)

Get Account Ledger Entry Example

http://localhost:7876/nxt?
  requestType=getAccountLedgerEntry&
  ledgerId=532246
{
  "change": "100",
  "eventType": "CURRENCY_OFFER_EXPIRED",
  "requestProcessingTime": 1,
  "ledgerId": "532246",
  "holding": "6112509426732269765",
  "isTransactionEvent": true,
  "balance": "90000",
  "holdingType": "UNCONFIRMED_CURRENCY_BALANCE",
  "accountRS": "NXT-7A48-47JL-T7LD-D5FS3",
  "block": "2303344830040052747",
  "event": "13236557417702245931",
  "account": "12745647715474645062",
  "height": 736757,
  "timestamp": 78995635
}


Get Account Lessors

Get the lessors to an account.

Request:

  • requestType is getAccountLessors
  • account is the account ID
  • height is the height of the blockchain to determine the lessors (optional, default is last block)
  • 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: If table trimming is enabled (default), the height must be within 1440 blocks of the last block.

Response:

  • accountRS (S) is the Reed-Solomon address of the account
  • account (S) is the account number
  • height (N) is the height of the blockchain
  • 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)
  • lessors (A) is an array of lessor objects including the fields:
    • lessorRS (S)
    • lessor (S)
    • guaranteedBalanceNQT (S)

Get Account Lessors Example

http://localhost:7876/nxt?
  requestType=getAccountLessors&
  account=7114946486381367146&
  height=282497
{
 "lessors": [
  {
   "guaranteedBalanceNQT": "2643314085738687",
   "lessorRS": "NXT-MRBN-8DFH-PFMK-A4DBM",
   "lessor": "9918441724915080500"
  }
 ],
 "accountRS": "NXT-TMVC-69YC-SJB4-8YCH7",
 "requestProcessingTime": 1,
 "account": "7114946486381367146",
 "height": 282497
}


Get Account Properties

Get the Account properties for a specific account or setter.

Request:

  • requestType is getAccountProperties
  • recipient is the account ID to which the property is attached to
  • setter is the account ID who set the property (optional if recipient provided)
  • property is the property key (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)
  • 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:

  • setterRS: (S) is the Reed-Solomon address of the setter account (only if setter is defined in the request)
  • recipientRS: (S) is the Reed-Solomon address of the recipient account (only if recipient is defined in the request)
  • recipient: (S) is the account number of the recipient account (only if recipient is defined in the request)
  • requestProcessingTime (N) is the API request processing time (in millisec)
  • setter: (S) is the account number of the setter account (only if setter is defined in the request)
  • properties: (A) is an array of properties including the fields:
    • setterRS: (S) is the Reed-Solomon address of the setter account (only if setter is omitted in the request)
    • recipientRS: (S) is the Reed-Solomon address of the recipient account (only if recipient is omitted in the request)
    • recipient: (S) is the account number of the recipient account (only if recipient is omitted in the request)
    • property: (S) property name
    • setter: (S) is the account number of the setter account (only if setter is omitted in the request)
    • value: (S) property value

Example

http://localhost:7876/nxt?
  requestType=getAccountProperties&
  recipient=NXT-7A48-47JL-T7LD-D5FS3
{
  "recipientRS": "NXT-7A48-47JL-T7LD-D5FS3",
  "recipient": "12745647715474645062",
  "requestProcessingTime": 0,
  "properties": [
    {
      "setterRS": "NXT-7A48-47JL-T7LD-D5FS3",
      "property": "testkey1",
      "setter": "12745647715474645062",
      "value": "testvalue1"
    }
  ]
}


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)

Get Account Public Key Example

http://localhost:7876/nxt?
  requestType=getAccountPublicKey&
  account=NXT-L6FM-89WK-VK8P-FCRBB
{
 "publicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d...",
 "requestProcessingTime": 36
}


Get Account Transaction Ids

Get the transaction IDs associated with an account in reverse block timestamp order. This call only returns non-phased transactions as of Version 1.5.7e and is deprecated, to be removed in version 1.6. Use Get Blockchain Transactions instead.

Request:

  • requestType is getAccountTransactionIds
  • 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 ID to retrieve (optional)
  • lastIndex is a zero-based index to the last transaction ID 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)
  • 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:

  • transactionIds (A) is an array of 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)

Get Account Transaction Ids Example

http://localhost:7876/nxt?
  requestType=getAccountTransactionIds&
  account=NXT-L6FM-89WK-VK8P-FCRBB
{
 "transactionIds": [
  "15200507403046301754",
  "10900022216391397990"
 ],
 "requestProcessingTime": 1
}


Get Account Transactions

Get the transactions associated with an account in reverse block timestamp order. This call only returns non-phased transactions as of Version 1.5.7e and is depricated, to be removed in version 1.6. Use Get Blockchain Transactions instead.

Request:

  • requestType is getAccountTransactions
  • 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)
  • 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)

Get Account Transactions Example

http://localhost:7876/nxt?
  requestType=getAccountTransactions&
  account=NXT-L6FM-89WK-VK8P-FCRBB
{
 "requestProcessingTime": 1,
 "transactions": [
  {
   "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
   "signature": "5f0378b7390ff5a815eadd1354de533eef682f139362b153576e2207320a6...",
   "feeNQT": "100000000",
   "transactionIndex": 2,
   "type": 0,
   "confirmations": 1704,
   "fullHash": "3a304584f20cf3d2cbbdd9698ff9a166427005ab98fbe9ca4ad6253651ee81f1",
   "version": 1,
   "ecBlockId": "17321329645912574173",
   "signatureHash": "b35eae7d2f01639810d37694138aa0a86fbbf8a9bf58c2be4f2a5b8f0f30b3f7",
   "senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
   "subtype": 0,
   "amountNQT": "100000000",
   "sender": "15323192282528158131",
   "recipientRS": "NXT-4VNQ-RWZC-4WWQ-GVM8S",
   "recipient": "17013046603665206934",
   "ecBlockHeight": 275727,
   "block": "8455642159445842600",
   "blockTimestamp": 29797208,
   "deadline": 60,
   "transaction": "15200507403046301754",
   "timestamp": 29796934,
   "height": 275730
  },
  {
   "senderPublicKey": "73080c6a224062660184f10ebb7fb431d459364a12403320c7f601f9d75cc547",
   "signature": "7f4a5b70e3f91dd1e7a089c7985bb08f7035666dbfe3e857e706f08ad93f6...",
   "feeNQT": "100000000",
   "transactionIndex": 0,
   "type": 0,
   "confirmations": 1706,
   "fullHash": "6612e07b74a84497b02d5bafea020391dcefadc157dc1cbd56611c66dc11f974",
   "version": 1,
   "ecBlockId": "4218793004869721496",
   "signatureHash": "0fc3d917e37111752004ac13a280ea121799388ff7aaf611f22f3ce93f1df5e0",
   "attachment": {
    "version.PublicKeyAnnouncement": 1,
    "recipientPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c"
   },
   "senderRS": "NXT-4VNQ-RWZC-4WWQ-GVM8S",
   "subtype": 0,
   "amountNQT": "200000000",
   "sender": "17013046603665206934",
   "recipientRS": "NXT-L6FM-89WK-VK8P-FCRBB",
   "recipient": "15323192282528158131",
   "ecBlockHeight": 275723,
   "block": "14241452309033661857",
   "blockTimestamp": 29796841,
   "deadline": 60,
   "transaction": "10900022216391397990",
   "timestamp": 29796542,
   "height": 275728
  }
 ]
}


Get Balance

Get the balance of an account.

Request:

  • requestType is getBalance
  • account is an account ID
  • includeEffectiveBalance is true to include effectiveBalanceNXT 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
  • effectiveBalanceNXT (N) is the balance (in NXT) 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)

Get Balance Example

http://localhost:7876/nxt?
  requestType=getBalance&
  account=7114946486381367146
{
 "unconfirmedBalanceNQT": "9246231058415",
 "guaranteedBalanceNQT": "9242231058415",
 "effectiveBalanceNXT": 92422,
 "forgedBalanceNQT": "260560000000",
 "balanceNQT": "9246231058415",
 "requestProcessingTime": 1
}


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)
  • phasedOnly is true to retrieve only phased transactions (optional unless nonPhasedOnly provided)
  • nonPhasedOnly is true to retrieve only nonphased transactions (optional unless phasedOnly provided)
  • includeExpiredPrunable is true' to retrieve pruned data if available (optional)
  • includePhasingResult is true to retrieve execution status of each phased transaction (optional)
  • executedOnly is true to exclude phased transactions that are not yet executed (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)

Get Blockchain Transactions Example

http://localhost:7876/nxt?
  requestType=getBlockchainTransactions&
  account=NXT-4VDY-LNVT-LMAY-FMCKA&
  lastIndex=0
{
 "requestProcessingTime": 2,
 "transactions": [
  {
   "signature": "0bc2045c2e4291e9595702fc6a9e805f11b65a88a867d515e44b980ef72b440a2...",
   "transactionIndex": 0,
   "type": 0,
   "phased": false,
   "ecBlockId": "441034190304176853",
   "signatureHash": "31f92d5612115e174748c7a261cd0412e00028639301aae0f0c1ddfc7618b7e7",
   "attachment": {
    "version.OrdinaryPayment": 0
   },
   "senderRS": "NXT-4VDY-LNVT-LMAY-FMCKA",
   "subtype": 0,
   "amountNQT": "1400000000",
   "recipientRS": "NXT-BMUV-8QQR-47VK-CR7F3",
   "block": "6752144003309284467",
   "blockTimestamp": 46567698,
   "deadline": 1440,
   "timestamp": 46567612,
   "height": 291611,
   "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
   "feeNQT": "100000000",
   "confirmations": 2046,
   "fullHash": "a26a2a36086e5d13f069dd9da06ce4e6b0418e9a299bec0cda39bfa04a2ca5e3",
   "version": 1,
   "sender": "15295723609781267838",
   "recipient": "11580081983047651163",
   "ecBlockHeight": 291600,
   "transaction": "1395392441102264994"
  }
 ]
}


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)

Get Guaranteed Balance Example

http://localhost:7876/nxt?
  requestType=getGuaranteedBalance&
  account=7114946486381367146&
  numberOfConfirmations=1440
{
 "guaranteedBalanceNQT": "9242231058415",
 "requestProcessingTime": 0
}


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)

Get Unconfirmed Transaction Ids Example

http://localhost:7876/nxt?
  requestType=getUnconfirmedTransactionIds&
  account=NXT-L6FM-89WK-VK8P-FCRBB
{
 "requestProcessingTime": 1,
 "unconfirmedTransactionIds": []
}


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)

Get Unconfirmed Transactions Example

http://localhost:7876/nxt?
  requestType=getUnconfirmedTransactions&
  account=NXT-L6FM-89WK-VK8P-FCRBB
{
 "unconfirmedTransactions": [],
 "requestProcessingTime": 1
}


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)

Search Accounts Example

http://localhost:7876/nxt?
  requestType=searchAccounts&
  query=testnet AND tyler
{
 "accounts": [
  {
   "accountRS": "NXT-7C4U-3Z9K-GZM8-CU8EJ",
   "name": "Tyler Jordan",
   "description": "testnet account",
   "account": "12119426358687475802"
  }
 ],
 "requestProcessingTime": 16
}


Send Money

Send NXT 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.


Send Money Example

http://localhost:7876/nxt?
  requestType=sendMoney&
  secretPhrase=IWontTellYou&
  recipient=NXT-4VNQ-RWZC-4WWQ-GVM8S&
  amountNQT=100000000&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "b35eae7d2f01639810d37694138aa0a86fbbf8a9bf58c2be4f2a5b8f0f30b3f7",
 "unsignedTransactionBytes": "001046aac6013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143...",
 "transactionJSON": {
  "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
  "signature": "5f0378b7390ff5a815eadd1354de533eef682f139362b153576e2207320a6...",
  "feeNQT": "100000000",
  "type": 0,
  "fullHash": "3a304584f20cf3d2cbbdd9698ff9a166427005ab98fbe9ca4ad6253651ee81f1",
  "version": 1,
  "ecBlockId": "17321329645912574173",
  "signatureHash": "b35eae7d2f01639810d37694138aa0a86fbbf8a9bf58c2be4f2a5b8f0f30b3f7",
  "senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
  "subtype": 0,
  "amountNQT": "100000000",
  "sender": "15323192282528158131",
  "recipientRS": "NXT-4VNQ-RWZC-4WWQ-GVM8S",
  "recipient": "17013046603665206934",
  "ecBlockHeight": 275727,
  "deadline": 60,
  "transaction": "15200507403046301754",
  "timestamp": 29796934,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 8475,
 "transactionBytes": "001046aac6013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143...",
 "fullHash": "3a304584f20cf3d2cbbdd9698ff9a166427005ab98fbe9ca4ad6253651ee81f1",
 "transaction": "15200507403046301754"
}


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)
  • messagePatternRegex is a regular expression pattern following the java.util.regex.Pattern specification; incoming transactions are only accepted if they contain a plain text message which matches this pattern (disabled indefinitely due to a security issue)
  • messagePatternFlags is a bitmask of java.util.regex.Pattern flags, such as 2 (Pattern.CASE_INSENSITIVE)

Response: Refer to [[[Create_Transaction#Create_Transaction_Response|Create Transaction Response]].

Set Account Info Example

http://localhost:7876/nxt?
  requestType=setAccountInfo&
  secretPhrase=IWontTellYou&
  name=iwonttellyou
  description=example account
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "15917aafd59ad9cece7dfc127ab256711d1c58a8ed1a0dc7334949ca826d8a32",
 "unsignedTransactionBytes": "0115dfeecb013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
 "transactionJSON": {
  "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
  "signature": "3f5167a3a23677c85aba7fbbc8bc31cddf540a632abebee4a80fe08ba92b9a0...",
  "feeNQT": "100000000",
  "type": 1,
  "fullHash": "2d31c26aa2b0ae4cf233cc4035c555bca0c579bdcef24bc9819132dc2ce5b2e5",
  "version": 1,
  "ecBlockId": "17558522603047297060",
  "signatureHash": "15917aafd59ad9cece7dfc127ab256711d1c58a8ed1a0dc7334949ca826d8a32",
  "attachment": {
   "name": "iwonttellyou",
   "description": "example account",
   "version.AccountInfo": 1
  },
  "senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
  "subtype": 5,
  "amountNQT": "0",
  "sender": "15323192282528158131",
  "ecBlockHeight": 279080,
  "deadline": 60,
  "transaction": "5525548004452479277",
  "timestamp": 30142175,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 8553,
 "transactionBytes": "0115dfeecb013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
 "fullHash": "2d31c26aa2b0ae4cf233cc4035c555bca0c579bdcef24bc9819132dc2ce5b2e5",
 "transaction": "5525548004452479277"
}


Set Account Property

Set account property. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is setAccountProperty
  • recipient is the account ID of the recipient.
  • property is the property name.
  • value is the property value.

Response: Refer to Create Transaction Response.

Set Account Property Example

http://localhost:7876/nxt?requestType=setAccountProperty&secretPhrase=
iwonttellyou&property=country&value=switzerland&recipient=
NXT-EZQ9-35P5-XZ8C-4LW87&feeNQT=100000000&deadline=60

The request is shown above in URL format for consistency. The actual request must be an HTTP POST request with a multipart content type. For example, the corresponding cURL command is as follows: [cURL command?]

{
    "signatureHash": "34a690abc9f7fe4749da49d996e875e961aa0d38d6b80cdca9a01a7614004089",
    "transactionJSON": {
        "senderPublicKey": "b0db10704a831f1a0fd028e947784811e88fbe0fde25dc1f68209a2d9f93be13",
        "signature": "f5fd4b881c5625c778ffe38bced33d44231eda406e95d9068dea69407ea3370dc873f52a123a0cbe590ecf4adf2a3c6238dc26c73ee63aeb7ac4331958b53a1e",
        "feeNQT": "100000000",
        "type": 1,
        "fullHash": "d94baf764f0b7e47dbbe30c5aef1694fef6dfd2ecc7c86e29eefee7e6d1b2b39",
        "version": 1,
        "phased": false,
        "ecBlockId": "1026208230615777523",
        "signatureHash": "34a690abc9f7fe4749da49d996e875e961aa0d38d6b80cdca9a01a7614004089",
        "attachment": {
            "property": "\"switzerland\"",
            "value": "\"country\"",
            "version.AccountProperty": 1
        },
        "senderRS": "NXT-EZQ9-35P5-XZ8C-4LW87",
        "subtype": 10,
        "amountNQT": "0",
        "sender": "2493747385666535111",
        "recipientRS": "NXT-EZQ9-35P5-XZ8C-4LW87",
        "recipient": "2493747385666535111",
        "ecBlockHeight": 684730,
        "deadline": 360,
        "transaction": "5151567459679947737",
        "timestamp": 72072027,
        "height": 2147483647
    },
    "unsignedTransactionBytes": "011a5bbb4b046801b0db10704a831f1a0fd028e947784811e88fbe0fde25dc1f68209a2d9f93be13c77e36ea08929b22000000000000000000e1f5050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ba720a00f3806fdbf2d23d0e010d22737769747a65726c616e64220922636f756e74727922",
    "broadcasted": true,
    "requestProcessingTime": 83,
    "transactionBytes": "011a5bbb4b046801b0db10704a831f1a0fd028e947784811e88fbe0fde25dc1f68209a2d9f93be13c77e36ea08929b22000000000000000000e1f505000000000000000000000000000000000000000000000000000000000000000000000000f5fd4b881c5625c778ffe38bced33d44231eda406e95d9068dea69407ea3370dc873f52a123a0cbe590ecf4adf2a3c6238dc26c73ee63aeb7ac4331958b53a1e00000000ba720a00f3806fdbf2d23d0e010d22737769747a65726c616e64220922636f756e74727922",
    "fullHash": "d94baf764f0b7e47dbbe30c5aef1694fef6dfd2ecc7c86e29eefee7e6d1b2b39",
    "transaction": "5151567459679947737"


Start Funding Monitor

Starts a funding monitor that will transfer NXT, ASSET or CURRENCY from the funding account to a recipient account when the amount held by the recipient account drops below the threshold. The transfer will not be done until the current block height is greater than equal to the block height of the last transfer plus the interval. The funding account is identified by the secret phrase.

The recipient accounts are identified by the specified account property (see Set Account Property). Each account that has this property set by the funding account will be monitored for changes. The property value can be omitted or it can consist of a JSON string containing one or more values in the format: {"amount":long,"threshold":long,"interval":integer} . POST only.

Request:

  • requestType is startFundingMonitor
  • property is the name of the account property
  • amount is the amount to fund the recipient account with (in NQT or QNT)
  • threshold is the threshold
  • interval is the the number of blocks to wait after before funding the recipient
  • secretPhrase is the secret phrase of the funding account
  • holdingType is a string representing the holding type (optional)
  • holding is the holding ID (optional)

Response:

  • started (B) is true if the monitor has been started
  • requestProcessingTime (N) is the API request processing time (in millisec)

Start Funding Monitor Example

http://localhost:7876/nxt?
 requestType=startFundingMonitor&
 property=funding&
 amount=1000000000&
 threshold=15000000000&
 interval=10&
 secretPhrase=IWontTellYou
{
 "started": true,
 "requestProcessingTime": 5
}


Stop Funding Monitor

Stop a funding monitor. When the secret phrase is specified, a single monitor will be stopped. The monitor is identified by the secret phrase, holding and account property. The administrator password is not required and will be ignored.

When the administrator password is specified, a single monitor can be stopped by specifying the funding account, holding and account property. If no account is specified, all monitors will be stopped.

The holding type and account property name must be specified when the secret phrase or account is specified. Holding type codes are listed in getConstants. In addition, the holding identifier must be specified when the holding type is ASSET or CURRENCY. POST only.

Request:

  • requestType is stopFundingMonitor
  • secretPhrase is the secret phrase of the funding account, used to stop a single monitor. (optional)
  • adminPassword is the admin password, used to stop a single monitor or all monitors (optional if secretPhrase is provided)
  • property is the name of the account property (optional)
  • holdingType is a string representing the holding type (optional)
  • holding is the holding ID (optional)
  • account is the account ID (optional)

Response:

  • stopped (N) is the number of the monitors that have been stopped
  • requestProcessingTime (N) is the API request processing time (in millisec)

Stop Funding Monitor Example

http://localhost:7876/nxt?
 requestType=stopFundingMonitor&
 property=funding&
 secretPhrase=IWontTellYou
{
 "stopped": 1,
 "requestProcessingTime": 5
}