Asset Exchange

From Nxtwiki
Jump to: navigation, search

Cancel Order

Cancel an existing asset order. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is either cancelBidOrder or cancelAskOrder
  • order is the order ID of the order being canceled

Response: Refer to Create Transaction Response.

Cancel Order Example

http://localhost:7876/nxt?
  requestType=cancelBidOrder&
  secretPhrase=IWontTellYou&
  order=17185236428295897167&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "20264f33a06331f6a8d7c4362d0525aee25e4ef991653f14bbfb1b2beebba433",
 "unsignedTransactionBytes": "02153c6ed6013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143...",
 "transactionJSON": {
  "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
  "signature": "30cf47942179f5969369699b548f5a3517ef7ff71b337db630ea5f8b6e740...",
  "feeNQT": "100000000",
  "type": 2,
  "fullHash": "725f441d9f50a9b2e02d780098a827b1015ec902199becd493bfa73a4843ae89",
  "version": 1,
  "ecBlockId": "196207598250363138",
  "signatureHash": "20264f33a06331f6a8d7c4362d0525aee25e4ef991653f14bbfb1b2beebba433",
  "attachment": {
   "version.BidOrderCancellation": 1,
   "order": "17185236428295897167"
  },
  "senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
  "subtype": 5,
  "amountNQT": "0",
  "sender": "15323192282528158131",
  "ecBlockHeight": 285586,
  "deadline": 60,
  "transaction": "12873909654136315762",
  "timestamp": 30830140,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 7640,
 "transactionBytes": "02153c6ed6013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
 "fullHash": "725f441d9f50a9b2e02d780098a827b1015ec902199becd493bfa73a4843ae89",
 "transaction": "12873909654136315762"
}


Cancel Ask Order

Refer to Cancel Order.

Cancel Bid Order

Refer to Cancel Order.

Delete Asset Property

Permanently deletes a specified asset property.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is deleteAssetProperty
  • asset is the asset ID to delete the property
  • property is the property name to be deleted.
  • setter is the setter account of the property

Response: Refer to Create Transaction Response.

Delete Asset Property Example

http://localhost:7876/nxt?
  requestType=deleteAssetProperty&
  asset=10982263251111884451&
  property=isIdentified&
  setter=NXT-X8ZN-WUJ2-SXY3-FBUYC
  secretPhrase=IWontTellYou
{
    "signatureHash": "c6039bd2a6d00b9f0960bf1fcd7e1e5f44cf121a7f3478a08f4ed848d01b6273",
    "transactionJSON": {
        "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
        "signature": "b88c933d9fd1e325738ddf0769e2cda0deddaed8a1607f3b3597843504dd770c6dfa848a8060dc190237983365e31b3dfd247336172877f982c1ddd955dd16dd",
        "feeNQT": "1000000",
        "type": 2,
        "fullHash": "02e3382805554d9caef831ebadd27acb8d689590ae813a5fab75e37004b29d7e",
        "version": 1,
        "phased": false,
        "ecBlockId": "12919444854690185600",
        "signatureHash": "c6039bd2a6d00b9f0960bf1fcd7e1e5f44cf121a7f3478a08f4ed848d01b6273",
        "attachment": {
            "property": "isIdentified",
            "asset": "-7464480822597667165",
            "version.AssetPropertyDelete": 1,
            "value": "true"
        },
        "senderRS": "NXT-X8ZN-WUJ2-SXY3-FBUYC",
        "subtype": 10,
        "amountNQT": "0",
        "sender": "15382970207090678772",
        "recipientRS": "NXT-X8ZN-WUJ2-SXY3-FBUYC",
        "recipient": "15382970207090678772",
        "ecBlockHeight": 449282,
        "deadline": 15,
        "timestamp": 26856670,
        "height": 2147483647
    },
    "unsignedTransactionBytes": "02000000020a01decc99010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5cf49b0ea0e6497bd5000000000000000040420f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002db060080810e2ba5164bb30000000001a3b659883dd668980c69734964656e7469666965640474727565000000000000000000000000000000000000000000000000000000000000000000000000",
    "broadcasted": false,
    "requestProcessingTime": 5,
    "transactionBytes": "02000000020a01decc99010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5cf49b0ea0e6497bd5000000000000000040420f0000000000b88c933d9fd1e325738ddf0769e2cda0deddaed8a1607f3b3597843504dd770c6dfa848a8060dc190237983365e31b3dfd247336172877f982c1ddd955dd16dd02db060080810e2ba5164bb30000000001a3b659883dd668980c69734964656e7469666965640474727565000000000000000000000000000000000000000000000000000000000000000000000000",
    "fullHash": "02e3382805554d9caef831ebadd27acb8d689590ae813a5fab75e37004b29d7e",
}


Delete Asset Shares

Permanently deletes a specified quantity of owned asset shares.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is deleteAssetShares
  • asset is the asset ID
  • quantityQNT is the quantity (in QNT) of the asset to be deleted

Response: Refer to Create Transaction Response.

Delete Asset Shares Example

http://localhost:7876/nxt?
  requestType=deleteAssetProperty&
  asset=10982263251111884451&
  property=isIdentified&
  setter=NXT-X8ZN-WUJ2-SXY3-FBUYC
  secretPhrase=IWontTellYou&
{
    "signatureHash": "883599a340375c387e7b27a4f2c37f4ee960760b31e4b1a9c604663c6b84c708",
    "transactionJSON": {
      "senderPublicKey": "373522bcd8904f4707472e590cbb67976d40e7af39650ea11cb2be5734cdf30c",
      "signature": "b91a664d9ee99399ebba913fa56abea26fbf4b84fe10fa4f76a29a8eae16810e61...",
      "feeNQT": "100000000",
      "type": 2,
      "fullHash": "8929fa9d30fd38c8811e079835b3959c1a3f8503df8999d5a858831ea6ba7741",
      "version": 1,
      "phased": false,
      "ecBlockId": "9535861265974556985",
      "signatureHash": "883599a340375c387e7b27a4f2c37f4ee960760b31e4b1a9c604663c6b84c708",
      "attachment": {
        "quantityQNT": "100",
        "version.AssetDelete": 1,
        "asset": "5920455660623529270"
      },
      "senderRS": "NXT-7A48-47JL-T7LD-D5FS3",
      "subtype": 7,
      "amountNQT": "0",
      "sender": "12745647715474645062",
      "ecBlockHeight": 757498,
      "deadline": 60,
      "transaction": "14427559791532059017",
      "timestamp": 80204814,
      "height": 2147483647
    },
  "unsignedTransactionBytes": "02170ed4c7043c00373522bcd8904f4707472e590cbb67976d40e7a...",
  "broadcasted": false,
  "requestProcessingTime": 2,
  "transactionBytes": "02170ed4c7043c00373522bcd8904f4707472e590cbb67976d40e7af39650ea...",
  "fullHash": "8929fa9d30fd38c8811e079835b3959c1a3f8503df8999d5a858831ea6ba7741",
  "transaction": "14427559791532059017"
}


Dividend Payment

Pay dividend to all shareholders of an asset. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is dividendPayment
  • asset is the asset ID
  • holdingType is a string representing the holding type (optional)
  • holding is the holding ID (optional)
  • height is the blockchain height at which asset holders shares will be counted (must be less than 1440 blocks in the past)
  • amountNQTPerQNT is dividend amount (in NQT per QNT of the asset)

Response: Refer to Create Transaction Response.

Dividend Payment Example

http://localhost:7876/nxt?
  requestType=dividendPayment&
  asset=3517042713515967694&
  height=161157&
  amountNQTPerQNT=100000000
{
 "signatureHash": "5d92fee3570b7b058ace2387f5b4eef4377ea738e6a6c2aabc06bd9f6871e4b4",
 "unsignedTransactionBytes": "02160feb0c023c0010f09c34f225d425306e5be55a49469081...",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "signature": "61e2398087b078bdba24021d909e937c2d5fe157a09fa3c82d910e7b5843e00cef2...",
  "feeNQT": "100000000",
  "type": 2,
  "fullHash": "27b52e61813b73fdf9ff3b1bacf3b344d3ed60e8c94db2c9d0518c8483150770",
  "version": 1,
  "ecBlockId": "17871828515938613022",
  "signatureHash": "5d92fee3570b7b058ace2387f5b4eef4377ea738e6a6c2aabc06bd9f6871e4b4",
  "attachment": {
   "version.DividendPayment": 1,
   "amountNQTPerQNT": "100000000",
   "asset": "3517042713515967694",
   "height": 161157
  },
  "senderRS": "NXT-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 6,
  "amountNQT": "0",
  "sender": "15295723609781267838",
  "ecBlockHeight": 161151,
  "deadline": 60,
  "transaction": "18263006340784764199",
  "timestamp": 34401039,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 111,
 "transactionBytes": "02160feb0c023c0010f09c34f225d425306e5be55a49469081560...",
 "fullHash": "27b52e61813b73fdf9ff3b1bacf3b344d3ed60e8c94db2c9d0518c8483150770",
 "transaction": "18263006340784764199"
}


Get Account Asset Count

Get the number of assets owned by an account given the account ID.

Request:

  • requestType is getAccountAssetCount
  • account is the account ID
  • height is the height of the blockchain to determine the asset count (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:

  • numberOfAssets (N) is the number of assets owned 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

http://localhost:7876/nxt?
  requestType=getAccountAssetCount&
  account=NXT-8N9W-TN4F-YA2S-H5B7R
{
 "requestProcessingTime": 1,
 "numberOfAssets": 3
}


Get Account Assets

Get the assets owned by a given account in reverse quantity order.

Request:

  • requestType is getAccountAssets
  • account is the account ID
  • asset is an asset ID filter (optional)
  • height is the blockchain height at which to retrieve balances (optional, default is the last block in the blockchain)
  • includeAssetInfo is true if asset information is to be included (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: If table trimming is enabled (default), the height must be within 1440 blocks of the last block.

Response:

  • accountAssets (A) is an array of asset objects (unless the asset parameter is specified) with the following fields for each asset:
    • quantityQNT (S) is the quantity (in QNT) of the asset
    • unconfirmedQuantityQNT (S) is the unconfirmed quantity (in QNT) of the asset
    • decimals (N) is the number of decimal places used by the asset (if includeAssetInfo is true)
    • name (S) is the asset name (if includeAssetInfo is true)
    • asset (S) is the asset ID
  • 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 Assets Example

http://localhost:7876/nxt?
  requestType=getAccountAssets&
  account=NXT-4VNQ-RWZC-4WWQ-GVM8S
{
 "accountAssets": [
  {
   "quantityQNT": "68013764",
   "unconfirmedQuantityQNT": "68013764",
   "decimals": 0,
   "name": "Test",
   "asset": "17554243582654188572"
  }
 ],
 "requestProcessingTime": 1
}


Get Account Current Order Ids

Get current asset order IDs given an account ID in reverse block height order.

Request:

  • requestType is either getAccountCurrentBidOrderIds or getAccountCurrentAskOrderIds
  • account is the account ID
  • asset is an asset ID filter (optional)
  • firstIndex is a zero-based index to the first order ID to retrieve (optional)
  • lastIndex is a zero-based index to the last order 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:

  • bidOrderIds or askOrderIds (A) is an array of order 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 Current Order Ids Example

http://localhost:7876/nxt?requestType=getAccountCurrentBidOrderIds&account=NXT-L6FM-89WK-VK8P-FCRBB&asset=17554243582654188572
{
 "bidOrderIds": [
  "17185236428295897167"
 ],
 "requestProcessingTime": 4
}


Get Account Current Ask Order Ids

Refer to Get Account Current Order Ids.

Get Account Current Bid Order Ids

Refer to Get Account Current Order Ids.

Get Account Current Orders

Get current asset orders given an account ID in reverse block height order.

Request:

  • requestType is either getAccountCurrentBidOrders or getAccountCurrentAskOrders
  • account is the account ID
  • asset is an asset ID filter (optional)
  • firstIndex is a zero-based index to the first order to retrieve (optional)
  • lastIndex is a zero-based index to the last order 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:

  • bidOrders or askOrders (A) is an array of order objects (refer to Get Order 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 Current Orders Example

http://localhost:7876/nxt?
  requestType=getAccountCurrentBidOrders&
  account=NXT-L6FM-89WK-VK8P-FCRBB
{
 "bidOrders": [
  {
   "quantityQNT": "1000000",
   "priceNQT": "100",
   "accountRS": "NXT-L6FM-89WK-VK8P-FCRBB",
   "asset": "17554243582654188572",
   "type": "bid",
   "account": "15323192282528158131",
   "order": "17185236428295897167",
   "height": 285549
  }
 ],
 "requestProcessingTime": 1
}


Get Account Current Ask Orders

Refer to Get Account Current Orders.

Get Account Current Bid Orders

Refer to Get Account Current Orders.

Get All Assets

Get all assets in the exchange in reverse block height of creation order.

Request:

  • requestType is getAllAssets
  • firstIndex is a zero-based index to the first asset to retrieve (optional)
  • lastIndex is a zero-based index to the last asset to retrieve (optional)
  • includeCounts is true if the fields beginning with numberOf... are to be included (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:

  • assets (A) is an array of asset objects (refer to Get Asset)
  • 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 All Assets Example

http://localhost:7876/nxt?
  requestType=getAllAssets&
  firstIndex=13&
  lastIndex=13
{
 "assets": [
  {
   "quantityQNT": "2100000000000000",
   "numberOfAccounts": 31,
   "accountRS": "NXT-3TKA-UH62-478B-DQU6K",
   "decimals": 8,
   "numberOfTransfers": 63,
   "name": "mgwBTC",
   "description": "Production Multigateway BTC (mgwBTC) is backed 100% by...",
   "numberOfTrades": 9,
   "asset": "17554243582654188572",
   "account": "13300069592148796968"
  }
 ],
 "requestProcessingTime": 13
}


Get All Open Orders

Get all open bid/ask orders in reverse block height order.

Request:

  • requestType is either getAllOpenBidOrders or getAllOpenAskOrders
  • firstIndex is a zero-based index to the first order to retrieve (optional)
  • lastIndex is a zero-based index to the last order 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:

  • openOrders (A) is an array of order objects (refer to Get Order 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 All Open Orders Example

http://localhost:7876/nxt?
  requestType=getAllOpenBidOrders&
  firstIndex=123&
  lastIndex=123
{
 "requestProcessingTime": 5631,
 "openOrders": [
  {
   "quantityQNT": "1000000",
   "priceNQT": "101",
   "accountRS": "NXT-L6FM-89WK-VK8P-FCRBB",
   "asset": "17554243582654188572",
   "type": "bid",
   "account": "15323192282528158131",
   "order": "12743274869785967304",
   "height": 285577
  }
 ]
}

Get All Open Ask Orders

Refer to Get All Open Orders.

Get All Open Bid Orders

Refer to Get All Open Orders.

Get All Trades

Get all trades since a given timestamp in reverse block height order.

Request:

  • requestType is getAllTrades
  • timestamp is the timestamp (in seconds since the genesis block) to begin retrieving trades (optional, default 0)
  • firstIndex is a zero-based index to the first trade to retrieve (optional)
  • lastIndex is a zero-based index to the last trade to retrieve (optional)
  • includeAssetInfo is true if asset information is to be included in the result (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: If timestamp is omitted or zero, and no index is given, all trades in the entire blockchain will be retrieved, which may timeout or crash your system.

Response:

  • trades (A) is an array of trade objects (refer to Get Trades)
  • 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 All Trades Example

http://localhost:7876/nxt?
  requestType=getAllTrades&
  lastIndex=0
{
 "trades": [
  {
   "seller": "14968762166783718535",
   "quantityQNT": "10000",
   "bidOrder": "1166717226538227076",
   "sellerRS": "NXT-8F69-W9Z9-8M6Y-ETXGZ",
   "buyer": "202478233571806601",
   "priceNQT": "19796",
   "askOrder": "16222071953599729591",
   "buyerRS": "NXT-RMEB-W7TE-28EM-2SUM7",
   "decimals": 8,
   "name": "mgwBTC",
   "block": "8807797247643599359",
   "asset": "4551058913252105307",
   "askOrderHeight": 285768,
   "bidOrderHeight": 286453,
   "tradeType": "buy",
   "timestamp": 30920039,
   "height": 286453
  }
 ],
 "requestProcessingTime": 25840
}


Get Asset

Get asset information given an asset ID.

Request:

  • requestType is getAsset
  • asset is the asset ID
  • includeCounts is true if the fields beginning with numberOf... are to be included (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:

  • account (S) is the number of the account that issued the asset
  • accountRS (S) is the Reed-Solomon address of the account that issued the asset
  • name (S) is the asset name
  • description (S) is the asset description
  • quantityQNT (S) is the total asset quantity (in QNT) in existence
  • asset (N) is the asset ID
  • decimals (N) is the number of decimal places used by the asset
  • numberOfAccounts (N) is the number of accounts that own the asset
  • numberOfTrades (N) is the number of trades of this asset
  • numberOfTransfers (N) is the number of transfers of this asset
  • 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 Asset Example

http://localhost:7876/nxt?
  requestType=getAsset&
  asset=17554243582654188572
{
 "quantityQNT": "2100000000000000",
 "numberOfAccounts": 31,
 "accountRS": "NXT-3TKA-UH62-478B-DQU6K",
 "decimals": 8,
 "numberOfTransfers": 63,
 "name": "mgwBTC",
 "description": "Production Multigateway BTC (mgwBTC) is backed 100% by...",
 "numberOfTrades": 9,
 "requestProcessingTime": 11,
 "asset": "17554243582654188572",
 "account": "13300069592148796968"
}


Get Asset Account Count

Get the number of accounts that own an asset given the asset ID.

Request:

  • requestType is getAssetAccountCount
  • asset is the asset ID
  • height is the height of the blockchain to determine the account count (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:

  • numberOfAccounts (N) is the number of accounts that own the asset
  • 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 Asset Account Count Example

http://localhost:7876/nxt?
  requestType=getAssetAccountCount&
  asset=17554243582654188572
{
 "numberOfAccounts": 38,
 "requestProcessingTime": 14
}


Get Asset Accounts

Get the accounts that own an asset given the asset ID in reverse quantity order.

Request:

  • requestType is getAssetAccounts
  • asset is the asset ID
  • height is the height of the blockchain to determine the accounts (optional, default is last block)
  • 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)

Note: If table trimming is enabled (default), the height must be within 1440 blocks of the last block.

Response:

  • accountAssets (A) is an array of asset objects with the following fields for each asset:
    • quantityQNT (S) is the quantity (in QNT) of the asset
    • accountRS (S) is the Reed-Solomon address of the account that owns the asset
    • unconfirmedQuantityQNT (S) is the unconfirmed quantity (in QNT) of the asset
    • asset (S) is the asset ID
    • account (S) is the number of the account that owns the asset
  • 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 Asset Accounts Example

http://localhost:7876/nxt?
  requestType=getAssetAccounts&
  asset=5539238107226883203
{
 "accountAssets": [
  {
   "quantityQNT": "100000000",
   "accountRS": "NXT-JTE5-HB7Y-QPS5-B58MZ",
   "unconfirmedQuantityQNT": "100000000",
   "asset": "5539238107226883203",
   "account": "11514793277306463619"
  }
 ],
 "requestProcessingTime": 19
}


Get Asset History

Get asset deletions or increases for a specific asset or account.

Request:

  • requestType is getAssetHistory
  • asset is the asset ID (optional if account is provided)
  • account is the account ID (optional if asset is provided)
  • firstIndex is a zero-based index to the first phased transaction to retrieve (optional)
  • lastIndex is a zero-based index to the last phased transaction to retrieve (optional)
  • timestamp is the earliest deletion (in seconds since the genesis block) to retrieve (optional)
  • deletesOnly is an optional parameter to retrieve only share delete history events
  • increasesOnly is an optional parameter to retrieve only share increase history events
  • includeAssetInfo is true if asset information is to be included (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:

  • assetHistory (A) is an array of asset history objects with following properties:
    • quantityQNT (S) is the number of shares that were deleted or increased
    • assetHistory (S) is the full hash of the increase or decrease transaction
    • account (S) is the account ID
    • accountRS (S) is the account Reed Solomon address
    • asset (S) is the asset ID
    • height (N) is the block height of the delete
    • timestamp (N) is the block timestamp of the delete
    • decimals (N) is the number of decimal places used by the asset (if includeAssetInfo is true)
    • name (S) is the asset name (if includeAssetInfo is true)

Get Asset History Example

http://localhost:7876/nxt?
  requestType=GetAssetHistory&
  includeAssetInfo=true&
  asset=15833076224651823484
{
    "requestProcessingTime": 0,
    "assetHistory": [
        {
            "quantityQNT": "10000000",
            "accountRS": "NXT-X8ZN-WUJ2-SXY3-FBUYC",
            "decimals": 2,
            "name": "MyAsset",
            "asset": "15833076224651823484",
            "assetHistory": "15833076224651823484",
            "account": "15382970207090678772",
            "height": 2497601,
            "timestamp": 181865909
        }
    ]
}


Get Asset Deletes

Get asset deletions for a specific asset or account.

Request:

  • requestType is getAssetDeletes
  • asset is the asset ID (optional if account is provided)
  • account is the account ID (optional if asset is provided)
  • firstIndex is a zero-based index to the first phased transaction to retrieve (optional)
  • lastIndex is a zero-based index to the last phased transaction to retrieve (optional)
  • timestamp is the earliest deletion (in seconds since the genesis block) to retrieve (optional)
  • includeAssetInfo is true if asset information is to be included (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:

  • deletes (A) is an array of asset delete objects with following properties:
    • quantityQNT (S) is the number of shares that was deleted
    • assetDelete (S) is the transaction ID
    • account (S) is the account ID
    • accountRS (S) is the account Reed Solomon address
    • asset (S) is the asset ID
    • height (N) is the block height of the delete
    • timestamp (N) is the block timestamp of the delete
    • decimals (N) is the number of decimal places used by the asset (if includeAssetInfo is true)
    • name (S) is the asset name (if includeAssetInfo is true)

Get Asset Deletes Example

http://localhost:7876/nxt?
  requestType=getAssetDeletes&
  asset=5920455660623529270
{
 "deletes": [
  {
   "quantityQNT": "1000",
   "assetDelete": "16186302132012496205",
   "accountRS": "NXT-G885-AKDX-5G2B-BLUCG",
   "asset": "5920455660623529270",
   "account": "10892890577210644675",
   "height": 678815,
   "timestamp": 75619271
  },
  {
   "quantityQNT": "1",
   "assetDelete": "5520627816808994883",
   "accountRS": "NXT-7A48-47JL-T7LD-D5FS3",
   "asset": "5920455660623529270",
   "account": "12745647715474645062",
   "height": 513529,
   "timestamp": 65930633
  },
  {
   "quantityQNT": "1",
   "assetDelete": "14523372185703177675",
   "accountRS": "NXT-7A48-47JL-T7LD-D5FS3",
   "asset": "5920455660623529270",
   "account": "12745647715474645062",
   "height": 512164,
   "timestamp": 65851395
  }
 ],
 "requestProcessingTime": 3
}


Get Asset Dividends

Get the dividend payment history for a specific asset.

Request:

  • requestType is getAssetDividends
  • asset is the asset ID
  • firstIndex is a zero-based index to the first dividend payment to retrieve (optional)
  • lastIndex is a zero-based index to the last dividend payment to retrieve (optional)
  • timestamp is the earliest dividend payment (in seconds since the genesis block) to retrieve (optional)
  • adminPassword is a string with the admin password (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:

  • dividends (A) is an array of dividend transactions with the following properties:
    • assetDividend (S) is the dividend payment transaction ID
    • numberOfAccounts (N) is the number of accounts that received a dividend
    • amountNQTPerQNT (S) is the amount of NXT (in NQT) paid per quantity (in QNT) of the asset
    • totalDividend (S) is the total amount of NXT (in NQT) sent in the dividend payment
    • dividendHeight (N) is the block height of the dividend calculation
    • asset (S) is the asset ID
    • height (N) is the block height of the dividend payment
    • timestamp (N) is the block timestamp of the dividend payment

Get Asset Dividends Example

http://localhost:7876/nxt?
  requestType=getAssetDividends&
  asset=4348103880042995903&
  timestamp=105414366
{
    "dividends": [
        {
            "assetDividend": "9638088763182480941",
            "numberOfAccounts": 391,
            "amountNQTPerQNT": "15",
            "totalDividend": "31399603179510",
            "dividendHeight": 1332177,
            "asset": "4348103880042995903",
            "height": 1332178,
            "timestamp": 111043612
        },
        {
            "assetDividend": "15350389444990902579",
            "numberOfAccounts": 374,
            "amountNQTPerQNT": "28",
            "totalDividend": "51709584601752",
            "dividendHeight": 1287433,
            "asset": "4348103880042995903",
            "height": 1287434,
            "timestamp": 108351797
        },
        {
            "assetDividend": "8213383200925147837",
            "numberOfAccounts": 309,
            "amountNQTPerQNT": "22",
            "totalDividend": "29425292831902",
            "dividendHeight": 1238568,
            "asset": "4348103880042995903",
            "height": 1238569,
            "timestamp": 105414366
        }
    ],
    "requestProcessingTime": 5
}


Get Asset Ids

Get the IDs of all assets in the exchange in reverse block height of creation order.

Request:

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

  • assets (A) is an array of asset 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 Asset Ids Example

http://localhost:7876/nxt?
  requestType=getAssetIds&
  firstIndex=15&
  lastIndex=15
{
 "assetIds": [
  "17554243582654188572"
 ],
 "requestProcessingTime": 1
}


Get Asset Transfers

Get transfers associated with a given asset and/or account in reverse block height order (or in the expected order of execution for expected transfers).

Request:

  • requestType is either getAssetTransfers or getExpectedAssetTransfers, where expected transfers are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next block
  • asset is the asset ID (optional)
  • account is the account ID (optional if asset provided)
  • timestamp is the earliest transfer (in seconds since the genesis block) to retrieve (optional, does not apply to expected transfers)
  • firstIndex is a zero-based index to the first transfer to retrieve (optional, does not apply to expected transfers)
  • lastIndex is a zero-based index to the last transfer to retrieve (optional, does not apply to expected transfers)
  • includeAssetInfo is true if the decimals and name fields are to be included (optional, does not apply to expected transfers)
  • 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:

  • transfers (A) is an array of transfer objects with the following fields for each transfer:
    • quantityQNT (S) is the quantity (in QNT) of the asset traded
    • senderRS (S) is the Reed-Solomon address of the sender
    • assetTransfer (S) is the transaction ID of the asset transfer
    • sender (S) is the account number of the sender
    • recipientRS (S) is the Reed-Solomon address of the recipient
    • decimals (N) is the number of decimal places used by the asset (if includeAssetInfo is true)
    • recipient (S) is the account number of the recipient
    • name (S) is the name of the asset (if includeAssetInfo is true)
    • asset (S) is the asset ID
    • height (N) is the height of the transfer block
    • timestamp (N) is the timestamp (in seconds since the genesis block) of the transfer block, does not apply to an expected transfer
    • phased (B) is true if the transaction is phased, false otherwise, applies only to an expected transfer
  • 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 Asset Transfers Example

http://localhost:7876/nxt?
  requestType=getAssetTransfers&
  asset=17554243582654188572&
  lastIndex=0
{
 "transfers": [
  {
   "quantityQNT": "500000",
   "senderRS": "NXT-9K6X-4ZQS-PCQN-465T4",
   "assetTransfer": "15255934090738722602",
   "sender": "2406158154854548637",
   "recipientRS": "NXT-YMEM-ERX3-BFUZ-4MQ4P",
   "decimals": 8,
   "recipient": "3065494931320556947",
   "name": "mgwBTC",
   "asset": "17554243582654188572",
   "height": 287648,
   "timestamp": 31042663
  }
 ],
 "requestProcessingTime": 4
}


Get Expected Asset Transfers

Refer to Get Asset Transfers.

Get Assets

Get asset information given multiple asset IDs

Request:

  • requestType is getAssets
  • assets is one the multiple asset IDs
  • assets is one the multiple asset IDs

  • includeCounts is true if the fields beginning with numberOf... are to be included (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:

  • assets (A) is an array of asset objects (refer to Get Asset)
  • 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 Assets Example

http://localhost:7876/nxt?
  requestType=getAssets&
  assets=17554243582654188572
{
 "assets": [
  {
   "quantityQNT": "2100000000000000",
   "numberOfAccounts": 31,
   "accountRS": "NXT-3TKA-UH62-478B-DQU6K",
   "decimals": 8,
   "numberOfTransfers": 63,
   "name": "mgwBTC",
   "description": "Production Multigateway BTC (mgwBTC) is backed 100% by...",
   "numberOfTrades": 9,
   "asset": "17554243582654188572",
   "account": "13300069592148796968"
  }
 ],
 "requestProcessingTime": 15
}


Get Assets By Issuer

Get asset information given multiple creation account IDs in reverse block height of creation order.

Request:

  • requestType is getAssetsByIssuer
  • account is one of the multiple account IDs
  • account is one of the multiple account IDs

  • firstIndex is a zero-based index to the first asset to retrieve (optional)
  • lastIndex is a zero-based index to the last asset to retrieve (optional)
  • includeCounts is true if the fields beginning with numberOf... are to be included (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:

  • assets (A) is an array of asset objects (refer to Get Asset)
  • 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 Assets By Issuer Example

http://localhost:7876/nxt?
  requestType=getAssetsByIssuer&
  account=NXT-DE2F-W76R-GL25-HMFPR&
  lastIndex=0
{
 "assets": [
  [
   {
    "quantityQNT": "10000000000",
    "numberOfAccounts": 222,
    "accountRS": "NXT-DE2F-W76R-GL25-HMFPR",
    "decimals": 4,
    "numberOfTransfers": 278,
    "name": "NXTprivacy",
    "description": "NXTprivacy will contain various privacy related projects...",
    "numberOfTrades": 456,
    "asset": "17911762572811467637",
    "account": "18146608053740744717"
   }
  ]
 ],
 "requestProcessingTime": 9
}


Get Asset Properties

Get asset properties given asset and a setter. When it is provided property it lists the value of the given property.

Request:

  • requestType is getAssetProperties
  • asset is the asset id for its properties to be listed
  • setter is the property setter address
  • property when provided, it lists the value of the given property (optional)
  • firstIndex is a zero-based index to the first transfer to retrieve (optional, does not apply to expected transfers)
  • lastIndex is a zero-based index to the last transfer to retrieve (optional, does not apply to expected transfers)
  • includeAssetInfo is true if the decimals and name fields are to be included (optional, does not apply to expected transfers)
  • 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 is the setter address in reed salomon format
  • asset is the asset id
  • setter is setter numeric id
  • properties (A) is an array of the asset properties
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Asset Properties Example

http://localhost:7876/nxt?
  requestType=getAssetProperties&
  asset=17554243582654188572&
  setter=NXT-X8ZN-WUJ2-SXY3-FBUYC&
  property=isIdentified
{
    "setterRS": "NXT-X8ZN-WUJ2-SXY3-FBUYC",
    "requestProcessingTime": 1,
    "asset": "3295228938014260892",
    "setter": "15382970207090678772",
    "properties": []
}


Get Expected Asset Deletes

Gets asset deletes which are expected to be executed in the next block.

Request:

  • requestType is either getExpectedAssetDeletes
  • asset is the asset ID (optional)
  • account is the account ID (optional)
  • firstIndex is a zero-based index to the first phased transaction to retrieve (optional)
  • lastIndex is a zero-based index to the last phased transaction to retrieve (optional)
  • timestamp is the earliest deletion (in seconds since the genesis block) to retrieve (optional)
  • includeAssetInfo is true if asset information is to be included (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:

  • deletes (A) is an array of expected asset delete objects with following properties:
    • assetDelete (S) is the transaction ID
    • asset (S) is the asset ID
    • account (S) is the account ID
    • accountRS (S) is the account Reed Solomon address
    • quantityQNT (S) is the number of shares that will be deleted
    • decimals (N) is the number of decimal places used by the asset (if includeAssetInfo is true)
    • name (S) is the asset name (if includeAssetInfo is true)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Expected Asset Deletes Example

http://localhost:7876/nxt?
  requestType=getExpectedAssetDeletes
{
 "deletes": [
  {
   "quantityQNT": "1000",
   "assetDelete": "16186302132012496205",
   "accountRS": "NXT-G885-AKDX-5G2B-BLUCG",
   "asset": "5920455660623529270",
   "account": "10892890577210644675"
  }
 ],
 "requestProcessingTime": 3
}


Get Order

Get a bid/ask order given an order ID.

Request:

  • requestType is either getBidOrder or getAskOrder
  • order is the Order 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:

  • account (S) is the account number associated with the order
  • accountRS (S) is the Reed-Solomon address of the account
  • asset (S) is the ID of the asset being ordered
  • quantityQNT (S) is the order quantity (in QNT)
  • priceNQT (S) is the order price (in NQT)
  • height (N) is the block height of the order transaction
  • transactionHeight (N) is the transaction height
  • transactionIndex (N) is a zero-based index giving the order of the transaction in its block
  • order (S) is the ID of the order
  • type (S) is the type of order (bid or ask)
  • 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 Order Example

http://localhost:7876/nxt?
  requestType=getAskOrder&
  order=6044046093672850641
{
 "quantityQNT": "100",
 "priceNQT": "100000000",
 "transactionHeight": 346634,
 "accountRS": "NXT-4VDY-LNVT-LMAY-FMCKA",
 "transactionIndex": 0,
 "requestProcessingTime": 0,
 "asset": "17091401215301664836",
 "type": "ask",
 "account": "15295723609781267838",
 "order": "6044046093672850641",
 "height": 346634
}


Get Ask Order

Refer to Get Order.

Get Bid Order

Refer to Get Order.

Get Order Ids

Get bid/ask order IDs given an asset ID, in order of decreasing bid price or increasing ask price.

Request:

  • requestType is either getBidOrderIds or getAskOrderIds
  • asset is the asset ID
  • firstIndex is a zero-based index to the first order ID to retrieve (optional)
  • lastIndex is a zero-based index to the last order 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:

  • bidOrderIds or askOrderIds (A) is an array of order 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 Order Ids Example

http://localhost:7876/nxt?
  requestType=getBidOrderIds&
  asset=17554243582654188572
{
 "bidOrderIds": [
  "17972270381487138621",
  "8331653287549483600",
  "16386956089071870421",
  "12743274869785967304",
  "3409888667133338290"
 ],
 "requestProcessingTime": 1
}


Get Ask Order Ids

Refer to Get Order Ids.

Get Bid Order Ids

Refer to Get Order Ids.

Get Orders

Get bid/ask orders given an asset ID, in order of decreasing bid price or increasing ask price (if sortByPrice is true for expected orders, otherwise in the expected order of execution).

Request:

  • requestType is one of getBidOrders, getAskOrders, getExpectedBidOrders or getExpectedAskOrders, where expected orders are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next block
  • asset is the asset ID
  • sortByPrice is true to sort by price (optional, applies only to expected orders, which are returned in expected order of execution by default)
  • showExpectedCancellations is true to include orders that are expected to be cancelled in the next block, based on the content of the unconfirmed transactions pool and the phased transactions expected to finish in the next block (optional, does not apply to expected orders)
  • firstIndex is a zero-based index to the first order to retrieve (optional, does not apply to expected orders)
  • lastIndex is a zero-based index to the last order to retrieve (optional, does not apply to expected orders)
  • 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:

  • bidOrders or askOrders (A) is an array of order objects (refer to Get Order for details) with the following additional field only for an expected order:
    • phased (B) is true if the order is phased, false otherwise
  • 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 Orders Example

http://localhost:7876/nxt?
  requestType=getBidOrders&
  asset=17554243582654188572&
  firstIndex=3&
  lastIndex=3
{
 "bidOrders": [
  {
   "quantityQNT": "1000000",
   "priceNQT": "101",
   "accountRS": "NXT-L6FM-89WK-VK8P-FCRBB",
   "asset": "17554243582654188572",
   "type": "bid",
   "account": "15323192282528158131",
   "order": "12743274869785967304",
   "height": 285577
  }
 ],
 "requestProcessingTime": 2
}


Get Ask Orders

Refer to Get Orders.

Get Bid Orders

Refer to Get Orders.

Get Expected Ask Orders

Refer to Get Orders.

Get Expected Bid Orders

Refer to Get Orders.

Get Expected Order Cancellations

Get all expected order cancellations in the order in which they are expected to be executed.

Request:

  • requestType is getExpectedOrderCancellations, where expected cancellations are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next 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)

Response:

  • orderCancellations (A) is an array of order cancellation objects with the following fields for each transfer:
    • account (S) is the cancelling account number
    • accountRS (S) is the Reed-Solomon address of the account
    • order (S) is the ID of the order to be cancelled
    • height (N) is the block height of the order cancellation transaction
    • phased (B) is true if the order cancellation transaction is phased
  • 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 Expected Order Cancellations Example

http://localhost:7876/nxt?
  requestType=getExpectedOrderCancellations
{
 "orderCancellations": [
  {
   "accountRS": "NXT-4VDY-LNVT-LMAY-FMCKA",
   "account": "15295723609781267838",
   "order": "8404616015717333294",
   "height": 348793,
   "phased": false
  }
 ],
 "requestProcessingTime": 1
}


Get Last Trades

Get the last trade of each of multiple assets.

Request:

  • requestType is getLastTrades
  • assets is one of multiple asset IDs
  • assets is one of multiple asset IDs

  • 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:

  • trades (A) is an array of trade objects (refer to Get Trades without name and decimals for details)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Last Trades Example

http://localhost:7876/nxt?
  requestType=getLastTrades&
  assets=17091401215301664836
{
 "trades": [
  {
   "seller": "11580081983047651163",
   "quantityQNT": "100",
   "bidOrder": "12461616895431889058",
   "sellerRS": "NXT-BMUV-8QQR-47VK-CR7F3",
   "buyer": "15295723609781267838",
   "priceNQT": "100000000",
   "askOrder": "16690422801364092687",
   "buyerRS": "NXT-4VDY-LNVT-LMAY-FMCKA",
   "block": "9740784167963638799",
   "asset": "17091401215301664836",
   "askOrderHeight": 286247,
   "bidOrderHeight": 286243,
   "tradeType": "sell",
   "timestamp": 46115694,
   "height": 286247
  }
 ],
 "requestProcessingTime": 1
}


Get Order Trades

Get all trades that were executed as a result of a given askOrder and/or bidOrder in reverse block height order.

Request:

  • requestType is getOrderTrades
  • askOrder is an ask order ID (optional)
  • bidOrder is a bid order ID (optional if askOrder provided)
  • firstIndex is a zero-based index to the first trade to retrieve (optional)
  • lastIndex is a zero-based index to the last trade to retrieve (optional)
  • includeAssetInfo is true if the decimals and name fields are to be included (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: Refer to Get Trades.

Get Order Trades Example

http://localhost:7876/nxt?
  requestType=getOrderTrades&
  askOrder=2769987326979385551&
  includeAssetInfo=true
{
 "trades": [
  {
   "seller": "8069635474378047786",
   "quantityQNT": "200",
   "bidOrder": "6083013926058683287",
   "sellerRS": "NXT-5JBC-QQ8M-UAFJ-8UAZZ",
   "buyer": "3617506283101058376",
   "priceNQT": "5000000",
   "askOrder": "2769987326979385551",
   "buyerRS": "NXT-QXCA-TKAH-KK85-5QZE6",
   "decimals": 0,
   "name": "TWT",
   "block": "17820716559461579006",
   "asset": "7496917644161273018",
   "askOrderHeight": 263896,
   "bidOrderHeight": 265168,
   "tradeType": "buy",
   "timestamp": 44288754,
   "height": 265168
  }
 ],
 "requestProcessingTime": 0
}


Get Trades

Get trades associated with a given asset and/or account in reverse block height order.

Request:

  • requestType is getTrades
  • asset is the asset ID (optional)
  • account is the account ID (optional if asset provided)
  • firstIndex is a zero-based index to the first trade to retrieve (optional)
  • lastIndex is a zero-based index to the last trade to retrieve (optional)
  • timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)
  • includeAssetInfo is true if the decimals and name fields are to be included (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:

  • trades (A) is an array of trade objects with the following fields for each trade:
    • seller (S) is the account number of the seller
    • quantityQNT (S) is the quantity (in QNT) of the asset traded
    • bidOrder (S) is the bid order ID
    • sellerRS (S) is the Reed-Solomon address of the seller
    • buyer (S) is the account number of the buyer
    • priceNQT (S) is the trade price (in NQT, the ask price for a buy or the bid price for a sell)
    • askOrder (S) is the ask order ID
    • buyerRS (S) is the Reed-Solomon address of the buyer
    • decimals (N) is the number of decimal places used by the asset
    • name (S) is the name of the asset (if includeAssetInfo is true)
    • block (S) is the block ID of the trade (if includeAssetInfo is true)
    • asset (S) is the asset ID
    • askOrderHeight (N) is the block height of the ask order
    • bidOrderHeight (N) is the block height of the bid order
    • tradeType (S) is the trade type (sell or buy, where buy implies that the bid occurred after the ask, or if in the same block, has a greater order ID)
    • timestamp (N) is the timestamp (in seconds since the genesis block) of the trade block
    • height (N) is the height of the trade block
  • 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 Trades Example

http://localhost:7876/nxt?
  requestType=getTrades&
  asset=17554243582654188572&
  lastIndex=0
{
 "trades": [
  {
   "seller": "4012743767778395236",
   "quantityQNT": "922082",
   "bidOrder": "18332182738291742411",
   "sellerRS": "NXT-J356-8B4K-L4DK-533EH",
   "buyer": "17013046603665206934",
   "priceNQT": "19607",
   "askOrder": "5860848661439768841",
   "buyerRS": "NXT-4VNQ-RWZC-4WWQ-GVM8S",
   "decimals": 8,
   "name": "mgwBTC",
   "block": "15627545821108097361",
   "asset": "17554243582654188572",
   "askOrderHeight": 285964,
   "bidOrderHeight": 285821,
   "tradeType": "sell",
   "timestamp": 30869573,
   "height": 285964
  }
 ],
 "requestProcessingTime": 0
}


Increase Asset Shares

Increase asset shares of a specific asset. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is increaseAssetShares
  • asset the asset that shares will be increased
  • quantityQNT is the total amount (in QNT) of the asset to be increased

Response: Refer to Create Transaction Response. The transaction ID is also the asset ID.

Increase Asset Shares Example

http://localhost:7876/nxt?
  requestType=increaseAssetShares&
  asset=3295228938014260892&
  quantityQNT=1000000&
  secretPhrase=IWontTellYou
  deadline=60&
  feeNQT=100000000000
{
    "minimumFeeFQT": "1000000000",
    "signatureHash": "86cb335dfe08da715bd424cda7ac4348b04d372c55340a4aa7325de2f29ece8a",
    "transactionJSON": {
        "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
        "signature": "0d0ae03e740c5461b189428adb1ba4566e4811d88eba4011afbdfc6635bcdf09252fb2838ddbefa91daf6fbfcd634d3d7ec65b65e10e0ad9b51c0e1b014c1014",
        "feeNQT": "100000000",
        "type": 2,
        "fullHash": "02bfd8498c029aa5525cfe0c9350d47a623f50fbec8c5ecf05dbbf51fe10d6fc",
        "version": 1,
        "fxtTransaction": "0",
        "phased": false,
        "ecBlockId": "848399269223681227",
        "signatureHash": "86cb335dfe08da715bd424cda7ac4348b04d372c55340a4aa7325de2f29ece8a",
        "attachment": {
            "quantityQNT": "10000",
            "asset": "3295228938014260892",
            "version.AssetIncrease": 1
        },
        "senderRS": "NXT-X8ZN-WUJ2-SXY3-FBUYC",
        "subtype": 8,
        "amountNQT": "0",
        "sender": "15382970207090678772",
        "ecBlockHeight": 378420,
        "deadline": 15,
        "timestamp": 22501256,
        "height": 2147483647
    },
    "unsignedTransactionBytes": "02000000020801885757010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0000000000000000000000000000000000e1f505000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034c60500cb4cc7eda31ec60b00000000019c7eed9f4201bb2d1027000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "broadcasted": false,
    "requestProcessingTime": 2,
    "transactionBytes": "02000000020801885757010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0000000000000000000000000000000000e1f505000000000d0ae03e740c5461b189428adb1ba4566e4811d88eba4011afbdfc6635bcdf09252fb2838ddbefa91daf6fbfcd634d3d7ec65b65e10e0ad9b51c0e1b014c101434c60500cb4cc7eda31ec60b00000000019c7eed9f4201bb2d1027000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "fullHash": "02bfd8498c029aa5525cfe0c9350d47a623f50fbec8c5ecf05dbbf51fe10d6fc",
}


Issue Asset

Create an asset on the exchange. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is issueAsset
  • name is the name of the asset
  • description is a url-encoded description of the asset in UTF-8 with a maximum length of 1000 bytes (optional)
  • quantityQNT is the total amount (in QNT) of the asset in existence
  • decimals is the number of decimal places used by the asset (optional, zero default)

Response: Refer to Create Transaction Response. The transaction ID is also the asset ID.

Issue Asset Example

http://localhost:7876/nxt?
  requestType=issueAsset&
  publicKey=57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c&
  name=SecretCoin&
  description=This+is+SecretCoin&
  quantityQNT=100&
  deadline=60&
  feeNQT=100000000000&
  broad=false
{
 "unsignedTransactionBytes": "021095e5da013c0073080c6a224062660184f10ebb7fb431d459364a12403...",
 "transactionJSON": {
  "senderPublicKey": "73080c6a224062660184f10ebb7fb431d459364a12403320c7f601f9d75cc547",
  "feeNQT": "100000000000",
  "type": 2,
  "version": 1,
  "ecBlockId": "1564408139943737911",
  "attachment": {
   "name": "SecretCoin",
   "description": "This+is+SecretCoin",
   "quantityQNT": "100",
   "version.AssetIssuance": 1,
   "decimals": 0
  },
  "senderRS": "NXT-4VNQ-RWZC-4WWQ-GVM8S",
  "subtype": 0,
  "amountNQT": "0",
  "sender": "17013046603665206934",
  "ecBlockHeight": 288402,
  "deadline": 60,
  "timestamp": 31122837,
  "height": 2147483647
 },
 "broadcasted": false,
 "requestProcessingTime": 2
}


Place Order

Place an asset order. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is either placeBidOrder or placeAskOrder
  • asset is the asset ID of the asset being ordered
  • quantityQNT is the amount (in QNT) of the asset being ordered
  • priceNQT is the bid/ask price (in NQT)

Response: Refer to Create Transaction Response. The transaction ID is also the order ID.

Place Order Example

http://localhost:7876/nxt?
  requestType=placeBidOrder&
  secretPhrase=IWontTellYou&
  asset=17554243582654188572&
  quantityQNT=1000000&
  priceNQT=100&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "44028b4ddb46e7d4383331425b79019bb0f004f88ede12a5aa66f05c23a75f03",
 "unsignedTransactionBytes": "02135a5ed6013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143...",
 "transactionJSON": {
  "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
  "signature": "65713e80be99a927bfa7bb2e9a7b6fbd2f17c226fb956494c68a6d90a8127...",
  "feeNQT": "100000000",
  "type": 2,
  "fullHash": "4f00aef17a397eee25027e834ca765660e4e3f3f1b162468bdac67b315aeb812",
  "version": 1,
  "ecBlockId": "14593256906948324209",
  "signatureHash": "44028b4ddb46e7d4383331425b79019bb0f004f88ede12a5aa66f05c23a75f03",
  "attachment": {
   "quantityQNT": "1000000",
   "priceNQT": "100",
   "asset": "17554243582654188572",
   "version.BidOrderPlacement": 1
  },
  "senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
  "subtype": 3,
  "amountNQT": "0",
  "sender": "15323192282528158131",
  "ecBlockHeight": 285545,
  "deadline": 60,
  "transaction": "17185236428295897167",
  "timestamp": 30826074,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 8729,
 "transactionBytes": "02135a5ed6013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143...",
 "fullHash": "4f00aef17a397eee25027e834ca765660e4e3f3f1b162468bdac67b315aeb812",
 "transaction": "17185236428295897167"
}


Place Ask Order

Refer to Place Order.

Place Bid Order

Refer to Place Order.

Search Assets

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

Request:

  • requestType is searchAssets
  • query is a full text query on the asset fields name (S) and description (S) in the standard Lucene syntax
  • firstIndex is a zero-based index to the first asset to retrieve (optional)
  • lastIndex is a zero-based index to the last asset to retrieve (optional)
  • includeCounts is true if the fields beginning with numberOf... are to be included (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:

  • assets (A) is an array of asset objects (refer to Get Asset)
  • 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 Assets Example

http://localhost:7876/nxt?
  requestType=searchAssets&
  query=assets AND production
{
 "assets": [
  {
   "quantityQNT": "2100000000000000",
   "numberOfAccounts": 37,
   "accountRS": "NXT-3TKA-UH62-478B-DQU6K",
   "decimals": 8,
   "numberOfTransfers": 84,
   "name": "mgwBTC",
   "description": "Production Multigateway BTC (mgwBTC) is backed 100% by...",
   "numberOfTrades": 15,
   "asset": "17554243582654188572",
   "account": "13300069592148796968"
  }
 ],
 "requestProcessingTime": 96
}


Set Asset Property

Set an asset property that allows attaching metadata to assets, in the form of name/value pairs.

The property name can be up to 32 characters, and property value up to 160 characters in length.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is setAssetProperty
  • asset is the asset id for setting a property
  • property is the property name. It can be up to 32 characters in length
  • value is the property value. It can be up to 160 characters in length

Response: Refer to Create Transaction Response.

Set Asset Property Example

http://localhost:7876/nxt?
  requestType=setAssetProperty&
  asset=10982263251111884451&
  property=isIdentified&
  value=true&
  secretphrase=IwontTellYou
  feeNQT=100000000&
  deadline=60
{
    "signatureHash": "24229be75fc4af5a3795ecc2a1c24d9bc8f9d44a72f05513b790c73be856cce5",
    "transactionJSON": {
        "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
        "signature": "b3457fcb4b0d11dc5350c2ec55873c9ee8c0b4d8b4bc02008004257b83636b00f45e37bd6e668f33ea561ef5cdd081795300948dc7349a46ba8e8a1bd4f2dd4b",
        "feeNQT": "1000000",
        "type": 2,
        "fullHash": "1cf769f04937350132e83fdc2598177841c4a37c93fbbb8e58e3f16776c29c50",
        "version": 1,
        "phased": false,
        "ecBlockId": "12919444854690185600",
        "signatureHash": "24229be75fc4af5a3795ecc2a1c24d9bc8f9d44a72f05513b790c73be856cce5",
        "attachment": {
            "property": "isIdentified",
            "asset": "-7464480822597667165",
            "version.AssetProperty": 1,
            "value": "true"
        },
        "senderRS": "NXT-X8ZN-WUJ2-SXY3-FBUYC",
        "subtype": 10,
        "amountNQT": "0",
        "sender": "15382970207090678772",
        "recipientRS": "NXT-X8ZN-WUJ2-SXY3-FBUYC",
        "recipient": "15382970207090678772",
        "ecBlockHeight": 449282,
        "deadline": 15,
        "timestamp": 26855134,
        "height": 2147483647
    },
    "unsignedTransactionBytes": "02000000020a01dec699010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5cf49b0ea0e6497bd5000000000000000040420f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002db060080810e2ba5164bb30000000001a3b659883dd668980c69734964656e7469666965640474727565000000000000000000000000000000000000000000000000000000000000000000000000",
    "broadcasted": false,
    "requestProcessingTime": 10,
    "transactionBytes": "02000000020a01dec699010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5cf49b0ea0e6497bd5000000000000000040420f0000000000b3457fcb4b0d11dc5350c2ec55873c9ee8c0b4d8b4bc02008004257b83636b00f45e37bd6e668f33ea561ef5cdd081795300948dc7349a46ba8e8a1bd4f2dd4b02db060080810e2ba5164bb30000000001a3b659883dd668980c69734964656e7469666965640474727565000000000000000000000000000000000000000000000000000000000000000000000000",
    "fullHash": "1cf769f04937350132e83fdc2598177841c4a37c93fbbb8e58e3f16776c29c50",
    "bundlerRateNQTPerFXT": "10000000"
}


Transfer Asset

Transfer a quantity of an asset from one account to another. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is transferAsset
  • recipient is the recipient account ID
  • recipientPublicKey is the public key of the recipient account (optional, enhances security of a new account)
  • asset is the ID of the asset being transferred
  • quantityQNT is the amount (in QNT) of the asset being transferred

Response: Refer to Create Transaction Response. The transaction ID is also the transfered asset ID.

Transfer Asset Example

http://localhost:7876/nxt?
  requestType=transferAsset&
  secretPhrase=IWontTellYou&
  recipient=NXT-4VNQ-RWZC-4WWQ-GVM8S&
  asset=17554243582654188572&
  quantityQNT=1000&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "f622557588bc82942984286e431c978e687783b32db6a68a1c554b2e11349751",
 "unsignedTransactionBytes": "0211c9ebda013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
 "transactionJSON": {
  "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
  "signature": "33d0fccf1f19d18b4ca97d2636cf62f7a801c07628d1bbb1d6084dc3ca658d...",
  "feeNQT": "100000000",
  "type": 2,
  "fullHash": "c8f25b15b48fb5efd3341fb369627d00f8fefb59dc18016ba0c482b6de7cad59",
  "version": 1,
  "ecBlockId": "3925493493266246517",
  "signatureHash": "f622557588bc82942984286e431c978e687783b32db6a68a1c554b2e11349751",
  "attachment": {
   "version.AssetTransfer": 1,
   "quantityQNT": "1000",
   "asset": "17554243582654188572"
  },
  "senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
  "subtype": 1,
  "amountNQT": "0",
  "sender": "15323192282528158131",
  "recipientRS": "NXT-4VNQ-RWZC-4WWQ-GVM8S",
  "recipient": "17013046603665206934",
  "ecBlockHeight": 288416,
  "deadline": 60,
  "transaction": "17272869949464638152",
  "timestamp": 31124425,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 4968,
 "transactionBytes": "0211c9ebda013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473b...",
 "fullHash": "c8f25b15b48fb5efd3341fb369627d00f8fefb59dc18016ba0c482b6de7cad59",
 "transaction": "17272869949464638152"
}