Monetary System

From ArdorDocs
Jump to: navigation, search
Other languages:

Can Delete Currency

Determine if a currency can be deleted.

Request:

  • requestType is canDeleteCurrency
  • account is the account ID
  • currency is the currency 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:

  • canDelete (B) is true if the currency can be deleted, 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)

Note: a currency can be deleted only when all units of the currency are held by account. A reservable currency that has not yet been issued can be deleted by the issuer. A mintable currency that has not completed minting cannot be deleted by a non-issuer.

Can Delete Currency Example

http://localhost:27876/nxt?
  requestType=canDeleteCurrency&
  account=ARDOR-2HCZ-6GCJ-2XGV-EDRPH&
  currency=4923907272718555444
{
 "canDelete": true,
 "requestProcessingTime": 1
}


Currency Buy / Sell

Make an exchange request to buy or sell an exchangeable currency. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • chain the chain related to the operation
  • requestType is currencyBuy or currencySell
  • currency is the currency ID
  • rateNQTPerUnit is the exchange rate (in NQT per unit)
  • unitsQNT is the amount of the currency to buy or sell (in QNT)

Note: An exchange request is immediately executed once accepted onto the blockchain based only on currently available offers (refer to Publish Exchange Offer). The request then expires, regardless of the amount of currency exchanged; the request may be completely filled, partially filled, or expire without any exchange if no matching offers are found.

Response: Refer to Create Transaction Response.

Currency Buy / Sell Example

http://localhost:27876/nxt?
  requestType=currencyBuy&
  chain=2&
  currency=6520756875632314476&
  rateNQT=1500000000&
  units=200&
  secretPhrase=SECRETPHRASE&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "0471907734d4aae7fc708131726f8660a68e66fe873fa17cab4f0cb3f879243f",
 "unsignedTransactionBytes": "051607cb08023c0010f09c34f225d425306e5be55a49469081...",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "chain": 2,
  "signature": "dda6c065344827bfdecfee179b22dfee1d5280fa5da5431b012d9ea045a0d80b9d4...",
  "feeNQT": "100000000",
  "type": 5,
  "fullHash": "d388798c9ecaf2cd28578cfcb8fb7e8f07d308e36e2a5674bb1c7766595b8435",
  "version": 1,
  "fxtTransaction": "0",
  "phased": false,
  "ecBlockId": "10096636210021430702",
  "signatureHash": "0471907734d4aae7fc708131726f8660a68e66fe873fa17cab4f0cb3f879243f",
  "attachment": {
   "currency": "6520756875632314476",
   "version.ExchangeSell": 1,
   "unitsQNT": "200",
   "rateNQTPerUnit": "1500000000"
  },
  "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 6,
  "amountNQT": "0",
  "sender": "15295723609781267838",
  "ecBlockHeight": 162266,
  "deadline": 60,
  "transaction": "14840146504449624275",
  "timestamp": 34130695,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 331,
 "transactionBytes": "051607cb08023c0010f09c34f225d425306e5be55a49469081560...",
 "fullHash": "d388798c9ecaf2cd28578cfcb8fb7e8f07d308e36e2a5674bb1c7766595b8435",
 "transaction": "14840146504449624275"
 "bundlerRateNQTPerFXT": "10000000"
}


Currency Mint

Submit a valid computed nonce to the blockchain in return for newly minted currency. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is currencyMint
  • chain the chain related to the operation
  • currency is the mintable currency ID
  • nonce is the computed nonce
  • units is the amount (in QNT) of currency to mint
  • counter (N) is the counter associated with the minting account

Note: The hash of nonce must be less than targetBytes provided by Get Minting Target for given units and counter. counter must be increased with each submission.

Response: Refer to Create Transaction Response.

Currency Mint Example

http://localhost:27876/nxt?
  requestType=currencyMint&
  chain=2&
  currency=9207767346829573996&
  nonce=-6757092571753666960&
  unitsQNT=1&
  counter=26&
  secretPhrase=SECRETPHRASE&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "f0e9f3b040890043fbc2d1b235377eb566805419f459184bc9290051bacdf80f",
 "unsignedTransactionBytes": "0517655a0c023c0010f09c34f225d425306e5be55a49469081...",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "chain": 2,
  "signature": "e961f58250dd256bb5f0628df342beb6ce042765d7cdad8d7598495759d7ec00ad8...",
  "feeNQT": "100000000",
  "type": 5,
  "fullHash": "05cbe451cdece14bab56c5684d30cd7eb62e45a86136071e90ae26981d4c1fc3",
  "version": 1,
  "ecBlockId": "12526333689713738846",
  "signatureHash": "f0e9f3b040890043fbc2d1b235377eb566805419f459184bc9290051bacdf80f",
  "attachment": {
   "currency": "9207767346829573996",
   "unitsQNT": "1",
   "counter": "26",
   "version.CurrencyMinting": 1,
   "nonce": "-6757092571753666960"
  },
  "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 7,
  "amountNQT": "0",
  "sender": "15295723609781267838",
  "ecBlockHeight": 160721,
  "deadline": 60,
  "transaction": "5467911789190892293",
  "timestamp": 34364005,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 815,
 "transactionBytes": "0517655a0c023c0010f09c34f225d425306e5be55a49469081560...",
 "fullHash": "05cbe451cdece14bab56c5684d30cd7eb62e45a86136071e90ae26981d4c1fc3",
 "transaction": "5467911789190892293"
}


Currency Reserve Claim

Claim currency reserve. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is currencyReserveClaim
  • chain the chain related to the operation
  • currency is the currency ID
  • units is the amount (in QNT) of reserve currency to claim

Note: Holders of a claimable currency may claim the locked NQT backing their units, thus reducing the supply of the currency.

Response: Refer to Create Transaction Response.

Currency Reserve Claim Example

http://localhost:27876/nxt?
  requestType=currencyReserveClaim&
  chain=2&
  currency=15992040603642022742&
  unitsQNT=36
{
 "signatureHash": "6daef8c9b8653a9b78b64e400c2ab64ea201e9888b8bc54ec6c9a28814b0a69e",
 "unsignedTransactionBytes": "0512a7830b023c00169cf83994b0e8c48a152ddc50606d58bd...",
 "transactionJSON": {
  "senderPublicKey": "169cf83994b0e8c48a152ddc50606d58bd4b2b85ec2f5bbbaae93d838443df7f",
  "chain": 2,
  "signature": "5ab6605aca7a958b10e5f0198660eccd01bff1418f2bf172105ba39e9c911d09709...",
  "feeNQT": "100000000",
  "type": 5,
  "fullHash": "f32e02362dce767c6f4b069f793f2cd8c6b89bad04847c8abe98d8998cede94f",
  "version": 1,
  "ecBlockId": "14980969893438059909",
  "signatureHash": "6daef8c9b8653a9b78b64e400c2ab64ea201e9888b8bc54ec6c9a28814b0a69e",
  "attachment": {
   "version.ReserveClaim": 1,
   "currency": "15992040603642022742",
   "unitsQNT": "36"
  },
  "senderRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
  "subtype": 2,
  "amountNQT": "0",
  "sender": "11580081983047651163",
  "ecBlockHeight": 160064,
  "deadline": 60,
  "transaction": "8968582401529884403",
  "timestamp": 34309031,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 7,
 "transactionBytes": "0512a7830b023c00169cf83994b0e8c48a152ddc50606d58bd4b2...",
 "fullHash": "f32e02362dce767c6f4b069f793f2cd8c6b89bad04847c8abe98d8998cede94f",
 "transaction": "8968582401529884403"
}


Currency Reserve Increase

Increase the currency reserve of an unissued reservable currency. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is currencyReserveIncrease
  • chain the chain related to the operation
  • currency is the currency ID
  • amountPerUnitNQT is the additional amount (in NQT per QNT of reserveSupply) to reserve (refer to Issue Currency)

Note: An additional amountPerUnitNQT * reserveSupply NQT (beyond what has previously been reserved) will be locked until the issuanceHeight is reached. Upon issuance, if the currency is claimable the NQT will remain locked until claimed; otherwise the NQT will transfer to the issuing account. Also upon issuance, a portion of the reserveSupply QNT will be transfered to each reserving account in proportion to the NQT that was contributed.

Response: Refer to Create Transaction Response.

Currency Reserve Increase Example

http://localhost:27876/nxt?
  requestType=currencyReserveIncrease&
  chain=2&
  currency=11847174313362984527
  amountPerUnitNQT=40000000
{
 "signatureHash": "0ba69ec678e0d4c4f94ee576d9520bf13a1c88b87e46c79d937b8f998a4a1f54",
 "unsignedTransactionBytes": "05115c930b023c00169cf83994b0e8c48a152ddc50606d58bd...",
 "transactionJSON": {
  "senderPublicKey": "169cf83994b0e8c48a152ddc50606d58bd4b2b85ec2f5bbbaae93d838443df7f",
  "chain": 2,
  "signature": "01ab2e01e8543321bb93baef1cdfd24335b2f98f4898c0203ebb372f6ea2140f609...",
  "feeNQT": "100000000",
  "type": 5,
  "fullHash": "0e583d097aa7832ef97f49bf1c43fe6fa26592cd7b60cd1c652b1139719c9404",
  "version": 1,
  "ecBlockId": "3894856940593871962",
  "signatureHash": "0ba69ec678e0d4c4f94ee576d9520bf13a1c88b87e46c79d937b8f998a4a1f54",
  "attachment": {
   "amountPerUnitNQT": "40000000",
   "currency": "11847174313362984527",
   "version.ReserveIncrease": 1
  },
  "senderRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
  "subtype": 1,
  "amountNQT": "0",
  "sender": "11580081983047651163",
  "ecBlockHeight": 160118,
  "deadline": 60,
  "transaction": "3351706690276644878",
  "timestamp": 34313052,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 7,
 "transactionBytes": "05115c930b023c00169cf83994b0e8c48a152ddc50606d58bd4b2...",
 "fullHash": "0e583d097aa7832ef97f49bf1c43fe6fa26592cd7b60cd1c652b1139719c9404",
 "transaction": "3351706690276644878"
}


Delete Currency

Delete a deletable currency (refer to Can Delete Currency). POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is deleteCurrency
  • chain the chain related to the operation
  • currency is the currency ID

Response: Refer to Create Transaction Response.

Delete Currency Example

http://localhost:27876/nxt?
  requestType=deleteCurrency&
  chain=2&
  currency=7103310507724273660&
  secretPhrase=SECRETPHRASE&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "3f2b029337263728f4d4fed1f774252b06706159659e6ba9116b2d74b67a8435",
 "unsignedTransactionBytes": "05189d7208023c0010f09c34f225d425306e5be55a49469081...",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "chain": 2,
  "signature": "09c7be5b0742191f3777cc850f9478af21bd42225aec5e0793b57cd188767a0be6f...",
  "feeNQT": "100000000",
  "type": 5,
  "fullHash": "a877379e3f3713e2f8baaa777c9a48af23d7da74e00301f12a4051dcf747243f",
  "version": 1,
  "ecBlockId": "2688066685599408512",
  "signatureHash": "3f2b029337263728f4d4fed1f774252b06706159659e6ba9116b2d74b67a8435",
  "attachment": {
   "version.CurrencyDeletion": 1,
   "currency": "7103310507724273660"
  },
  "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 8,
  "amountNQT": "0",
  "sender": "15295723609781267838",
  "ecBlockHeight": 162004,
  "deadline": 60,
  "transaction": "16290425023506118568",
  "timestamp": 34108061,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 112,
 "transactionBytes": "05189d7208023c0010f09c34f225d425306e5be55a49469081...",
 "fullHash": "a877379e3f3713e2f8baaa777c9a48af23d7da74e00301f12a4051dcf747243f",
 "transaction": "16290425023506118568"
}


Get Account Currencies

Get the currencies issued by a given account.

Request:

  • requestType is getAccountCurrencies
  • account is the account ID
  • currency is a currency ID filter (optional)
  • height is the blockchain height at which the response applies (optional, default is the current height)
  • includeCurrencyInfo is true if several currency information properties 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:

  • accountCurrencies (A) is an array of currency objects with the following fields:
    • code (S) is the currency code
    • unconfirmedUnits (S) is the amount of unconfirmed currency units (in QNT)
    • decimals (N) is the number of currency decimal places
    • name (S) is the currency name
    • currency (S) is the currency ID
    • units (S) is the amount of currency (in QNT)
    • issuanceHeight (N) is the blockchain height of issuance for a reservable currency
    • type (N) is the currency type bitmask (refer to Get Currency)
    • issuerAccountRS (S) is the Reed-Solomon address of the issuer account
    • issuerAccount (S) is the issuer account 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 Currencies Example

http://localhost:27876/nxt?
  requestType=getAccountCurrencies&
  account=ARDOR-4VDY-LNVT-LMAY-FMCKA&
  includeCurrencyInfo=true
{
 "accountCurrencies": [
  {
   "chain": 2,
   "issuerAccountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "code": "MYSTX",
   "unconfirmedUnitsQNT": "10000",
   "decimals": 2,
   "name": "MystcoinX",
   "currency": "6520756875632314476",
   "unitsQNT": "10000",
   "issuanceHeight": 0,
   "type": 1,
   "issuerAccount": "15295723609781267838"
  }
 ],
 "requestProcessingTime": 1
}


Get Account Currency Count

Get the number of currencies issued by a given account.

Request:

  • requestType is getAccountCurrencyCount
  • account is the account ID
  • height is the blockchain height at which the response applies (optional, default is the current height)
  • 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:

  • numberOfCurrencies (N) is the number of currencies issued
  • 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 Currency Count Example

http://localhost:27876/nxt?
  requestType=getAccountCurrencyCount&
  account=ARDOR-4VDY-LNVT-LMAY-FMCKA
{
 "numberOfCurrencies": 1,
 "requestProcessingTime": 1
}


Get Account Exchange Requests

Get the exchange requests associated with a given account and/or currency in reverse chronological order (or in expected order of execution for expected requests).

Request:

  • requestType is either getAccountExchangeRequests or getExpectedExchangeRequests, where expected requests are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next block
  • chain the chain related to the operation
  • account is the account ID (optional for expected requests)
  • currency is the currency ID (optional for expected requests if account provided)
  • includeCurrencyInfo is true to include the response fields code, decimals, name, issuanceHeight, type, timestamp, issuerAccountRS and issuerAccount (optional, applies only to expected requests)
  • firstIndex is a zero-based index to the first request to retrieve (optional, does not apply to expected requests)
  • lastIndex is a zero-based index to the last request to retrieve (optional, does not apply to expected requests)
  • 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:

  • exchangeRequests (A) is an array of requests with the following fields for each request:
    • code (S) is a currency code
    • subtype (N) is 5 for buy and 6 for sell
    • decimals (N) is the number of decimal places
    • name (S) is the currency name
    • units (S) is the number of currency units to buy or sell (in QNT)
    • issuanceHeight (N) is the blockchain height of issuance for a reservable currency, zero otherwise
    • type (N) is the currency type bitmask (refer to Get Currency)
    • transaction (S) is the transaction ID
    • timestamp (N) is the timestamp (in seconds since the genesis block) of the block when the request was executed
    • rateNQTPerUnit (S) is the exchange rate (in NQT per QNT)
    • issuerAccountRS (S) is the Reed-Solomon address of the issuer account
    • issuerAccount (S) is the issuer account ID
    • phased (B) is true if the transaction is phased (applies only to expected requests)
  • 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)

Notes: Even expired, unfilled requests will be retrieved. As of the former blockchain Nxt [Software Version 1.5.13] phased exchange requests that have not yet finished, or have not been approved, are now excluded if requestType is getAccountExchangeRequests.

Get Account Exchange Requests Example

http://localhost:27876/nxt?
  requestType=getAccountExchangeRequests&
  chain=2&
  account=ARDOR-4VDY-LNVT-LMAY-FMCKA&
  currency=6520756875632314476
{
 "exchangeRequests": [
  {
   "issuerAccountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "code": "MYSTX",
   "subtype": 6,
   "decimals": 2,
   "name": "MystcoinX",
   "unitsQNT": "200",
   "issuanceHeight": 0,
   "type": 1,
   "transaction": "14840146504449624275",
   "timestamp": 34130695,
   "rateNQTPerUnit": "1500000000",
   "issuerAccount": "15295723609781267838"
  }
 ],
 "requestProcessingTime": 1
}


Get Expected Exchange Requests

Refer to Get Account Exchange Requests. Since version 2.3.0e it returns both bundled and non-bundled transactions.


Get All Currencies

Get all currencies in reverse creation order.

Request:

  • requestType is getAllCurrencies
  • firstIndex is a zero-based index to the first currency to retrieve (optional)
  • lastIndex is a zero-based index to the last currency to retrieve (optional)
  • includeCounts is true to include numberOf... fields (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:

  • currencies (A) is an array of currency objects (refer to Get Currency 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 Currencies Example

http://localhost:27876/nxt?
  requestType=getAllCurrencies&
  firstIndex=2&
  lastIndex=2
{
 "requestProcessingTime": 3,
 "currencies": [
  {
   "initialSupply": "10000",
   "chain": 2,
   "currentReservePerUnitNQT": "0",
   "types": [
    "EXCHANGEABLE"
   ],
   "code": "MYSTX",
   "creationHeight": 162067,
   "minDifficulty": 0,
   "numberOfTransfers": 0,
   "description": "Exchangeable",
   "minReservePerUnitNQT": "0",
   "initialSupplyQNT": "100000000",
   "issuanceHeight": 0,
   "type": 1,
   "reserveSupplyQNT": "0",
   "maxDifficulty": 0,
   "accountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "decimals": 2,
   "name": "MystcoinX",
   "reserveSupplyQNT": "0",
   "numberOfExchanges": 12,
   "currency": "6520756875632314476",
   "maxSupplyQNT": "10000",
   "account": "15295723609781267838",
   "algorithm": 0
  }
 ]
}


Get All Exchanges

Get all currency exchanges in reverse chronological order.

Request:

  • requestType is getAllExchanges
  • chain the chain related to the operation
  • timestamp is the earliest timestamp to retrieve (optional)
  • firstIndex is a zero-based index to the first exchange to retrieve (optional)
  • lastIndex is a zero-based index to the last exchange to retrieve (optional)
  • includeCurrencyInfo is true to include some currency details (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:

  • exchanges (A) is an array of exchange objects (refer to Get Exchanges 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 Exchanges Example

http://localhost:27876/nxt?
  requestType=getAllExchanges&
  chain=2&
  firstIndex=7&
  lastIndex=7
{
 "exchanges": [
  {
   "issuerAccountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "seller": "15295723609781267838",
   "code": "MYSTX",
   "sellerRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "unitsQNT": "5000",
   "issuanceHeight": 0,
   "type": 1,
   "rateNQTPerUnit": "10000000",
   "buyer": "11580081983047651163",
   "offer": "17204924627068821879",
   "buyerRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "decimals": 2,
   "name": "MystcoinX",
   "currency": "6520756875632314476",
   "block": "4816799421151726903",
   "transaction": "2086609620693258113",
   "timestamp": 34206117,
   "height": 163202,
   "issuerAccount": "15295723609781267838"
  }
 ],
 "requestProcessingTime": 1
}


Get Available To Buy

Calculates the rate required in order to completely fill an exchange request.

Request:

  • requestType is getAvailableToBuy or getAvailableToSell
  • chain the chain related to the operation
  • currency is the currency ID
  • units is the number of units to buy
  • 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:

  • amountNQT (S) is the total amount needed to fill the exchange request
  • units (S) is the number of units
  • rateNQTperShare (S) is the rate for the currency units
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Available To Buy Example

http://localhost:27876/nxt?
  requestType=getAvailableToBuy&
  chain=2&
  currency=4855695375693311301&
  units=1
{
    "amountNQT": "1087",
    "units": "1",
    "requestProcessingTime": 0,
    "rateNQT": "1087"
}


Get Available To Sell

Refer to Get Available To Buy.

Get Buy / Sell Offers

Get currency buy or sell offers given a currency ID and/or an account ID in order of rate (if sortByRate is true for expected offers, otherwise in the expected order of execution).

Request:

  • requestType is one of getBuyOffers, getSellOffers, getExpectedBuyOffers or getExpectedSellOffers, where expected offers are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next block
  • chain the chain related to the operation
  • currency is the currency ID (optional)
  • account is the account ID (optional if currency provided)
  • availableOnly is true to include only offers with non-zero supply and limit, but is ignored when both currency and account are given (optional, does not apply to expected offers)
  • sortByRate is true to sort by rate (optional, applies only to expected offers, which are returned in expected order of execution by default)
  • firstIndex is a zero-based index to the first offer to retrieve (optional, does not apply to expected offers)
  • lastIndex is a zero-based index to the last offer to retrieve (optional, does not apply to expected offers)
  • 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:

  • offers (A) is an array of buy or sell offer objects (refer to Get Offer for details) with the following additional field only for an expected offer:
    • phased (B) is true if the offer 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 Buy / Sell Offers Example

http://localhost:27876/nxt?
  requestType=getSellOffers&
  chain=2&
  currency=6520756875632314476
{
 "offers": [
  {
    "offer": "9194373175351619049",
    "supplyQNT": "1000",
    "expirationHeight": 362636,
    "accountRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
    "rateNQTPerUnit": "100000000",
    "limitQNT": "1500",
    "currency": "7978322511509619701",
    "offerFullHash": "e9ad3669b0f9987f3659078cdabd8bf09c6ef0a43e1bb6cc1950f6940fdc1226",
    "account": "15382970207090678772",
    "height": 361199
  }
 ],
 "requestProcessingTime": 1
}


Get Buy Offers

Refer to Get Buy / Sell Offers.

Get Sell Offers

Refer to Get Buy / Sell Offers.

Get Expected Buy Offers

Refer to Get Buy / Sell Offers. Since version 2.3.0e it returns both bundled and non-bundled transactions.

Get Expected Sell Offers

Refer to Get Buy / Sell Offers. Since version 2.3.0e it returns both bundled and non-bundled transactions.

Get Currencies

Get currencies given multiple currency IDs.

Request:

  • requestType is getCurrencies
  • currencies is one of multiple currency IDs
  • currencies is one of multiple currency IDs

  • includeCounts is true to include numberOf... fields (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:

  • currencies (A) is an array of currency objects (refer to Get Currency 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 Currencies Example

http://localhost:27876/nxt?
  requestType=getCurrencies&
  currencies=7978322511509619701
{
 "requestProcessingTime": 3,
 "chain": 2,
 "currencies": [
  {
   "initialSupply": "10000",
   "currentReservePerUnitNQT": "0",
   "types": [
    "EXCHANGEABLE"
   ],
   "code": "PTNT",
   "currentSupplyQNT": "100000000",
   "creationHeight": 361192,
   "minDifficulty": 0,
   "description": "Potential coin",
   "minReservePerUnitNQT": "0",
   "initialSupplyQNT": "100000000",
   "issuanceHeight": 0,
   "type": 1,
   "maxSupplyQNT": "100000000",
   "maxDifficulty": 0,
   "accountRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
   "decimals": 2,
   "name": "POTENTIAL",
   "reserveSupplyQNT": "0",
   "currency": "7978322511509619701",
   "account": "15382970207090678772",
   "algorithm": 0
  }
 ]
}

Get Currencies By Issuer

Get currencies issued by multiple accounts in reverse creation order.

Request:

  • requestType is getCurrenciesByIssuer
  • account is one of multiple account IDs
  • account is one of multiple account IDs

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

  • currencies (A) is an array of arrays of currency objects, where the outer array is indexed by the given account IDs (refer to Get Currency for details about the currency objects)
  • 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 Currencies By Issuer Example

http://localhost:27876/nxt?
  requestType=getCurrenciesByIssuer&
  account=ARDOR-4VDY-LNVT-LMAY-FMCKA
{
 "requestProcessingTime": 334,
 "currencies": [
  [
   {
    "initialSupply": "10000",
    "currentReservePerUnitNQT": "0",
  "chain": 2,
    "types": [
     "EXCHANGEABLE"
    ],
    "code": "PTNT",
    "currentSupplyQNT": "100000000",
    "creationHeight": 361192,
    "minDifficulty": 0,
    "description": "Potential coin",
    "minReservePerUnitNQT": "0",
    "initialSupplyQNT": "100000000",
    "issuanceHeight": 0,
    "type": 1,
    "maxSupplyQNT": "100000000",
    "maxDifficulty": 0,
    "accountRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
    "decimals": 2,
    "name": "POTENTIAL",
    "reserveSupplyQNT": "0",
    "currency": "7978322511509619701",
    "account": "15382970207090678772",
    "algorithm": 0
   }
  ]
 ]
}


Get Currency

Get the details of a currency.

Request:

  • requestType is getCurrency
  • chain the chain related to the operation
  • currency is the currency ID (optional)
  • code is the currency code (optional if currency provided)
  • includeCounts is true if numberOf... 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:

  • initialSupply (S) is the initial currency supply (in QNT)
  • currentReservePerUnitNQT (S) is the minimum currency reserve (in NQT per QNT)
  • types (A) is an array of currency types, one or more of:
    • EXCHANGEABLE
    • CONTROLLABLE
    • RESERVABLE
    • CLAIMABLE
    • MINTABLE
    • NON_SHUFFLEABLE
  • code (S) is the currency code
  • creationHeight (N) is the blockchain height of the currency creation
  • minDifficulty (N) is the minimum difficulty for a mintable currency
  • numberOfTransfers (N) is the number of currency transfers
  • description (S) is the currency description
  • minReservePerUnitNQT (S) is the minimum currency reserve (in NQT per QNT) for a reservable currency
  • currentSupply (S) is the current currency supply (in QNT)
  • issuanceHeight (N) is the blockchain height of the currency issuance for a reservable currency
  • requestProcessingTime (N) is the API request processing time (in millisec)
  • type (N) is the currency type bitmask, from least to most significant bit: exchangeable, controllable, reservable, claimable, mintable, non-shuffleable
  • reserveSupply (S) is the reserve currency supply (in NQT) for a reservable currency
  • maxDifficulty (N) is the maximum difficulty for a mintable currency
  • accountRS (S) is the Reed-Solomon address of the issuing account
  • decimals (N) is the number of decimal places used by the currency
  • name (S) is the name of the currency
  • numberOfExchanges (N) is the number of currency exchanges
  • currency (S) is the currency ID
  • maxSupply (S) is the maximum currency supply (in QNT)
  • account (S) is the account ID of the currency issuer
  • algorithm (N) is the algorithm number for a mintable currency: 2 for SHA256, 3 for SHA3, 5 for Scrypt, 25 for Keccak25
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

Get Currency Example

http://localhost:27876/nxt?
  requestType=getCurrency&
  code=PTNT
{
 "initialSupply": "10000",
 "chain": 2,
 "types": [
  "EXCHANGEABLE"
 ],
 "code": "PTNT",
 "currentSupplyQNT": "100000000",
 "creationHeight": 361192,
 "minDifficulty": 0,
 "description": "Potential coin",
 "minReservePerUnitNQT": "0",
 "initialSupplyQNT": "100000000",
 "issuanceHeight": 0,
 "requestProcessingTime": 0,
 "type": 1,
 "maxSupplyQNT": "100000000",
 "maxDifficulty": 0,
 "accountRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
 "decimals": 2,
 "name": "POTENTIAL",
 "reserveSupplyQNT": "0",
 "currency": "7978322511509619701",
 "account": "15382970207090678772",
 "algorithm": 0
}

Get Currency Account Count

Get the number of accounts that hold a given currency.

Request:

  • requestType is getCurrencyAccountCount
  • currency is the currency ID
  • height is the blockchain height at which the response applies (optional, default is the current height)
  • 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:

  • numberOfAccounts (N) is the number of accounts that hold the currency
  • 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 Currency Account Count Example

http://localhost:27876/nxt?
  requestType=getCurrencyAccountCount&
  currency=7978322511509619701
{
 "numberOfAccounts": 2,
 "requestProcessingTime": 1
}


Get Currency Accounts

Get the accounts that hold a given currency in reverse units order.

Request:

  • requestType is getCurrencyAccounts
  • currency is the currency ID
  • height is the blockchain height at which the response applies (optional, default is current height)
  • 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:

  • accountCurrencies (A) is an array of account objects with the following fields:
    • unconfirmedUnits (S) is the amount of unconfirmed currency units (in QNT)
    • accountRS (S) is the Reed-Solomon address of the account
    • currency (S) is the currency ID
    • units (S) is the amount of currency (in QNT)
    • account (S) is the account number
  • 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 Currency Accounts Example

http://localhost:27876/nxt?
  requestType=getCurrencyAccounts&
  currency=7978322511509619701
{
 "accountCurrencies": [
  {
   "unitsQNT": "100000000",
   "unconfirmedUnitsQNT": "99999000",
   "accountRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
   "currency": "7978322511509619701",
   "account": "15382970207090678772"
        }
  },
  {
   "unitsQNT": "1000",
   "unconfirmedUnitsQNT": "1000",
   "accountRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "currency": "6520756875632314476",
   "account": "11580081983047651163"
  }
 ],
 "requestProcessingTime": 1
}


Get Currency Founders

Get a reservable currency's founders.

Request:

  • requestType is getCurrencyFounders
  • chain the chain related to the operation
  • currency is the currency ID
  • account is an account ID (optional)
  • firstIndex is a zero-based index to the first founder to retrieve (optional)
  • lastIndex is a zero-based index to the last founder 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:

  • founders (A) is an array of founder objects each of which has the following fields:
    • accountRS (S) is the Reed-Solomon address of the founding account
    • amountPerUnitNQT (S) is the amount (in NQT per QNT of reserveSupply) reserved by the founder
    • currency (S) is the currency ID
    • account (S) is the founding account number
  • 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 Currency Founders Example

http://localhost:27876/nxt?
  requestType=getCurrencyFounders&
  chain=2&
  currency=16165836410580103964
{
 "founders": [
  {
   "accountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "amountPerUnitNQT": "100000000",
   "currency": "16165836410580103964",
   "account": "15295723609781267838"
  }
 ],
 "requestProcessingTime": 1
}


Get Currency Ids

Get all currency IDs in reverse chronological creation order.

Request:

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

  • currencyIds(A) is an array of currency 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 Currency Ids Example

http://localhost:27876/nxt?
  requestType=getCurrencyIds&
  lastIndex=2
{
 "currencyIds": [
  "3543596621551215845",
  "6520756875632314476",
  "10304209318415949524"
 ],
 "requestProcessingTime": 2
}


Get Currency Transfers

Get currency transfers given a currency ID and/or an account ID in reverse block height order (or in expected order of execution for expected transfers).

Request:

  • requestType is either getCurrencyTransfers or getExpectedCurrencyTransfers, where expected transfers are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next block
  • currency is the currency ID (optional)
  • account is the account ID (optional if currency 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)
  • includeCurrencyInfo is true to include some currency fields (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:
    • code (S) is the currency code
    • units (S) is the amount (in QNT) of the transfer
    • issuanceHeight (N) is the blockchain height of the currency issuance for a reservable currency
    • type (N) is the currency type bitmask (refer to Get Currency for details)
    • issuerAccountRS (S) is the Reed-Solomon address of the issuer account
    • transfer (S) is the transfer ID
    • senderRS (S) is the Reed-Solomon address of the sender account
    • sender (S) is the account number of the sender account
    • recipientRS (S) is the Reed-Solomon address of the recipient account
    • decimals (N) is the number of decimal places used by the currency
    • recipient (S) is the account number of the recipient account
    • name (S) is the currency name
    • currency (S) is the currency ID
    • issuerAccount (S) is the issuer account ID
    • height (N) is the blockchain height of the transfer
    • 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
    • issuerAccountRS (S) is the Reed-Solomon address of the issuer account
    • issuerAccount (S) is the issuer account 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 Currency Transfers Example

http://localhost:27876/nxt?
  requestType=getCurrencyTransfers&
  currency=9387514940677621191
{
 "transfers": [
  {
   "issuerAccountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "code": "MYSTX",
   "units": "10",
   "issuanceHeight": 0,
   "type": 1,
   "transfer": "12208608533071682262",
   "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "sender": "15295723609781267838",
   "recipientRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "decimals": 2,
   "recipient": "11580081983047651163",
   "name": "MystcoinX",
   "currency": "9387514940677621191",
   "issuerAccount": "15295723609781267838",
   "height": 159732,
   "timestamp": 34280949
  }
 ],
 "requestProcessingTime": 0
}


Get Expected Currency Transfers

Refer to Get Currency Transfers. Since version 2.3.0e it returns both bundled and non-bundled transactions.

Get Exchanges

Get currency exchanges given a currency and/or an account in reverse chronological order.

Request:

  • requestType is getExchanges
  • chain the chain related to the operation
  • currency is a currency ID (optional)
  • account is an account ID (optional if currency provided)
  • firstIndex is a zero-based index to the first currency exchange to retrieve (optional)
  • lastIndex is a zero-based index to the last currency exchange to retrieve (optional)
  • timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)
  • includeCurrencyInfo is true to include several currency-related fields (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:

  • exchanges (A) is an array of exchange objects with the following fields for each exchange:
    • seller (S) is the seller account number
    • code (S) is the currency code
    • sellerRS (S) is the Reed-Solomon address of the seller account
    • unitsQNT (S) is the amount of currency exchanged (in QNT)
    • issuanceHeight (N) is the blockchain height of currency issuance for a reservable currency
    • type (N) is the currency type bitmask (refer to Get Currency for details)
    • rateNQTPerUnit (S) is the currency exchange rate (in NQT per QNT)
    • buyer (S) is the account number of the buyer
    • offer (S) is the offer ID
    • buyerRS (S) is the Reed-Solomon address of the buyer account
    • decimals (N) is the number of decimal places used by the currency
    • name (S) is the currency name
    • currency (S) is the currency ID
    • block (S) is the block ID of the block containing the exchange transaction
    • transaction (S) is the transaction ID of the exchange
    • timestamp (N) is the timestamp (in seconds since the genesis block) of the exchange
    • height is the blockchain height of the block containing the exchange transaction
    • issuerAccountRS (S) is the Reed-Solomon address of the issuer account
    • issuerAccount (S) is the issuer account 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 Exchanges Example

http://localhost:27876/nxt?
  requestType=getExchanges&
  chain=2&
  currency=6520756875632314476
{
 "exchanges": [
  {
   "issuerAccountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "seller": "15295723609781267838",
   "code": "MYSTX",
   "sellerRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "unitsQNT": "1",
   "issuanceHeight": 0,
   "type": 1,
   "rateNQTPerUnit": "1500000000",
   "buyer": "11580081983047651163",
   "offer": "7762792906174207279",
   "buyerRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "decimals": 2,
   "name": "MystcoinX",
   "currency": "6520756875632314476",
   "block": "2329341955641682831",
   "transaction": "12589829502215822061",
   "timestamp": 34137058,
   "height": 162356,
   "issuerAccount": "15295723609781267838"
  }
 ],
 "requestProcessingTime": 0
}


Get Exchanges By Exchange Request

Get currency exchanges given an exchange request transaction ID in reverse chronological order.

Request:

  • requestType is getExchangesByExchangeRequest
  • chain the chain related to the operation
  • transaction is the transaction ID of the exchange request
  • includeCurrencyInfo is true to include several currency-related fields (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:

  • exchanges (A) is an array of exchange objects (refer to Get Exchanges 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 Exchanges By Exchange Request Example

http://localhost:27876/nxt?
  requestType=getExchangesByExchangeRequest&
  transaction=12589829502215822061
{
 "exchanges": [
  {
   "issuerAccountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "seller": "15295723609781267838",
   "code": "MYSTX",
   "sellerRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "units": "1",
   "issuanceHeight": 0,
   "type": 1,
   "rateNQTPerUnit": "1500000000",
   "buyer": "11580081983047651163",
   "offer": "7762792906174207279",
   "buyerRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "decimals": 2,
   "name": "MystcoinX",
   "currency": "6520756875632314476",
   "block": "2329341955641682831",
   "transaction": "12589829502215822061",
   "timestamp": 34137058,
   "height": 162356,
   "issuerAccount": "15295723609781267838"
  }
 ],
 "requestProcessingTime": 1
}


Get Exchanges By Offer

Get currency exchanges given a currency offer ID in reverse chronological order.

Request:

  • requestType is getExchangesByOffer
  • chain the chain related to the operation
  • offer (S) is a currency offer ID
  • includeCurrencyInfo is true to include several currency-related fields (optional)
  • firstIndex is a zero-based index to the first currency exchange to retrieve (optional)
  • lastIndex is a zero-based index to the last currency exchange 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:

  • exchanges (A) is an array of exchange objects (refer to Get Exchanges 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 Exchanges By Offer Example

http://localhost:27876/nxt?
  requestType=getExchangesByOffer&
  chain=2&
  offer=7762792906174207279
{
 "exchanges": [
  {
   "issuerAccountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "seller": "15295723609781267838",
   "code": "MYSTX",
   "sellerRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "units": "1",
   "issuanceHeight": 0,
   "type": 1,
   "rateNQTPerUnit": "1500000000",
   "buyer": "11580081983047651163",
   "offer": "7762792906174207279",
   "buyerRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "decimals": 2,
   "name": "MystcoinX",
   "currency": "6520756875632314476",
   "block": "2329341955641682831",
   "transaction": "12589829502215822061",
   "timestamp": 34137058,
   "height": 162356,
   "issuerAccount": "15295723609781267838"
  }
 ],
 "requestProcessingTime": 1
}


Get Last Exchanges

Get the last exchange of each of multiple currencies.

Request:

  • requestType is getLastExchanges
  • chain the chain related to the operation
  • currencies is one of multiple currency IDs
  • currencies is one of multiple currency 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:

  • exchanges (A) is an array of exchange objects (refer to Get Exchanges without name, decimals, code, issuanceHeight, type, issuerAccountRS and issuerAccount for details)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Last Exchanges Example

http://localhost:27876/nxt?
  requestType=getLastExchanges&
  chain=2&
  currencies=12366259387060174981
{
 "exchanges": [
  {
   "offer": "1659323201112235372",
   "seller": "15295723609781267838",
   "buyerRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "sellerRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "currency": "12366259387060174981",
   "block": "15911141024340031754",
   "unitsQNT": "2",
   "transaction": "13926698078551037914",
   "timestamp": 35547397,
   "rateNQTPerUnit": "100000000",
   "buyer": "15295723609781267838",
   "height": 167709
  }
 ],
 "requestProcessingTime": 0
}


Get Minting Target

Get the current minting target of a mintable currency.

Request:

  • requestType is getMintingTarget
  • currency is the mintable currency ID
  • account is the minting account ID
  • unitsQNT is the amount (in QNT) of currency to mint
  • 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: units cannot be greater than 1/10000 of the maxSupply (refer to Issue Currency). Increasing units decreases targetBytes.

Response:

  • difficulty (S) is the current difficulty, an estimate of the number of hashes needed to meet the target
  • targetBytes (S) is the 32-byte target (little endian), which must equal or exceed the computed hash of the nonce
  • currency (S) is the currency ID
  • counter (N) is the counter associated with the minting account, the value previously submitted to Currency Mint
  • 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)

Note: If a nonce is found such that its hash is less than the target, it can be submitted to the blockchain along with counter + 1 using Currency Mint, which results in units NQT being credited to the minting account. difficulty is inversely related to the target, and so increases exponentially as maxSupply is approached because the target is defined as (2exp-1)/units, where exp decreases linearly from 256-minDifficulty to 256-maxDifficulty. (Refer to Issue Currency for maxSupply, minDifficulty and maxDifficulty.)

Get Minting Target Example

http://localhost:27876/nxt?
  requestType=getMintingTarget&
  currency=9207767346829573996&
  account=ARDOR-4VDY-LNVT-LMAY-FMCKA&
  units=1
{
 "difficulty": "1024",
 "targetBytes": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f00",
 "currency": "9207767346829573996",
 "counter": 0,
 "requestProcessingTime": 1
}


Get Offer

Get offer details given an offer ID.

Request:

  • requestType is getOffer
  • chain the chain related to the operation
  • offer is the offer 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:

  • sellOffer and buyOffer (O) are objects with the following fields:
    • offer (S) is the offer ID
    • expirationHeight (N) is the blockchain height of offer expiration
    • accountRS (S) is the Reed-Solomon address of the offering account
    • limitQNT (S) is the cumulative limit of currency buys or sells
    • currency (S) is the currency ID
    • supplyQNT (S) is the current currency supply
    • account (S) is the offering account number
    • height (N) is the blockchain height of offer creation
    • rateNQTPerUnit (S) is the currency exchange rate (in NQT per QNT)
  • 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 Offer Example

http://localhost:27876/nxt?
  requestType=getOffer&
  chain=2&
  offer=9194373175351619049
{
 "sellOffer": {
  "offer": "9194373175351619049",
  "supplyQNT": "1000",
  "expirationHeight": 362636,
  "accountRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
  "rateNQTPerUnit": "100000000",
  "limitQNT": "1500",
  "currency": "7978322511509619701",
  "offerFullHash": "e9ad3669b0f9987f3659078cdabd8bf09c6ef0a43e1bb6cc1950f6940fdc1226",
  "account": "15382970207090678772",
  "height": 361199
 },
  "offer": "9194373175351619049",
  "supplyQNT": "1000",
  "expirationHeight": 362636,
  "accountRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
  "rateNQTPerUnit": "100000000",
  "limitQNT": "1500",
  "currency": "7978322511509619701",
  "offerFullHash": "e9ad3669b0f9987f3659078cdabd8bf09c6ef0a43e1bb6cc1950f6940fdc1226",
  "account": "15382970207090678772",
  "height": 361199
 },
 "requestProcessingTime": 0
}


Issue Currency

Issue a new currency or re-issue an existing currency with different properties. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is issueCurrency
  • chain the chain related to the operation
  • name is the currency name, 3 to 10 characters and longer than the currency code
  • code is the uppercase currency code with the fee structure refered to Create Transaction Request
  • description is the currency description
  • type is the currency type bitmask, from least to most significant bit: exchangeable, controllable, reservable, claimable, mintable, non-shuffleable
  • initialSupplyQNT is the initial currency supply (in QNT) (must match maxSupply unless mintable or claimable, must be zero for claimable)
  • reserveSupplyQNT is the reserve currency supply (in QNT) (must match maxSupply)
  • maxSupplyQNT is the maximum currency supply (in QNT)
  • issuanceHeight is the blockchain height at which a reservable currency is issued if the reserve minimum is met
  • minReservePerUnitNQT is the minimum currency reserve (in NQT per QNT of reserveSupply) for issuance of a reservable currency
  • minDifficulty is the minimum difficulty (minimum 1) for a mintable currency
  • maxDifficulty is the maximum difficulty (maximum 255 and greater than minDifficulty) for a mintable currency
  • ruleset is for future use, always set to zero
  • algorithm is an algorithm code for a mintable currency: 2 for SHA256, 3 for SHA3, 5 for Scrypt, 25 for Keccak25
  • decimals is the number of decimal places used by the currency (optional, default zero)

Notes: Reservable requires exchangeable and/or claimable, as does controllable; but mintable requires exchangeable. Claimable requires reservable, non-mintable and zero initialSupply.

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

Issue Currency Example

http://localhost:27876/nxt?
  requestType=issueCurrency&
  chain=2&
  name=MystcoinX&
  code=MYSTX&
  description=Exchangeable&
  type=1&
  initialSupply=10000&
  maxSupply=10000&
  decimals=2&
  secretPhrase=SECRETPHRASE&
  feeNQT=4000000000&
  deadline=60
{
 "signatureHash": "c5ec66dd60bcc13fc0fe2cb617b4d7a05e7ef6360aacc591c911969785361491",
 "unsignedTransactionBytes": "05100f8308023c0010f09c34f225d425306e5be55a49469081...",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "chain": 2,
  "signature": "da27e4bead869d0e96fb9370f0afcd0c49eb17b7da503705384239d9abaec209733...",
  "feeNQT": "4000000000",
  "type": 5,
  "fullHash": "6c08c076d4617e5a4be6f027c9b3e47ddb0e92fab87032d631546051dbdbfe8c",
  "version": 1,
  "ecBlockId": "2004481009157728964",
  "signatureHash": "c5ec66dd60bcc13fc0fe2cb617b4d7a05e7ef6360aacc591c911969785361491",
  "attachment": {
   "initialSupply": "10000",
   "code": "MYSTX",
   "minDifficulty": 0,
   "ruleset": 0,
   "description": "Exchangeable",
   "minReservePerUnitNQT": "0",
   "issuanceHeight": 0,
   "type": 1,
   "reserveSupply": "0",
   "version.CurrencyIssuance": 1,
   "maxDifficulty": 0,
   "decimals": 2,
   "name": "MystcoinX",
   "maxSupply": "10000",
   "algorithm": 0
  },
  "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 0,
  "amountNQT": "0",
  "sender": "15295723609781267838",
  "ecBlockHeight": 162060,
  "deadline": 60,
  "transaction": "6520756875632314476",
  "timestamp": 34112271,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 53,
 "transactionBytes": "05100f8308023c0010f09c34f225d425306e5be55a49469081560...",
 "fullHash": "6c08c076d4617e5a4be6f027c9b3e47ddb0e92fab87032d631546051dbdbfe8c",
 "transaction": "6520756875632314476"
}


Publish Exchange Offer

Publish an exchange offer for an exchangeable currency. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is publishExchangeOffer
  • chain the chain related to the operation
  • currency is the currency ID
  • buyRateNQTPerUnit is the offered buy rate (in NQT per QNT)
  • sellRateNQTPerUnit is the offered sell rate (in NQT per QNT)
  • totalBuyLimitQNT is the cumulative limit (in QNT) of currency buys
  • totalSellLimitQNT is the cumulative limit (in QNT) of currency sells
  • initialBuySupplyQNT is the initial amount (in QNT) of currency offered to buy, cannot exceed totalBuyLimit
  • initialSellSupplyQNT is the initial amount (in QNT) of currency offered to sell, cannot exceed totalSellLimit
  • expirationHeight is the blockchain height for expiration of the offer

Notes: Each time currency is bought in response to an exchange request to sell currency (refer to Currency Sell), totalBuyLimit is reduced and the supply of currency offered to sell increases by the amount bought. When totalBuyLimit becomes zero, the buy offer is withdrawn. These same notes apply if buy and sell are interchanged. Only the most recent offer associated with an account is valid, even if an earlier offer by that account has not yet expired or reached its limits.

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

Publish Exchange Offer Example

http://localhost:27876/nxt?
  requestType=publishExchangeOffer&
  chain=2&
  currency=6520756875632314476&
  buyRateNQTPerUnit=10000000&
  sellRateNQTPerUnit=20000000&
  totalBuyLimitQNT=1000&
  totalSellLimitQNT=1000&
  initialBuySupplyQNT=500&
  initialSellSupplyQNT=500&
  expirationHeight=163080&
  secretPhrase=SECRETPHRASE&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "6fd60fcbc6e7022f12adad82a76c0534d2f79a569b9857b02328bf7573cf93f8",
 "unsignedTransactionBytes": "0514d7c409023c0010f09c34f225d425306e5be55a49469081...",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "chain": 2,
  "signature": "b204a7d9622ac6b99936447a4314fac1c2f0c67e45f4021f4b1949755c081802a34...",
  "feeNQT": "100000000",
  "type": 5,
  "fullHash": "fccb2c6200a04bbce82b9e623051b8d8ed9d519dbb0a12ec5a354c842da9a664",
  "version": 1,
  "ecBlockId": "6813726597245349906",
  "signatureHash": "6fd60fcbc6e7022f12adad82a76c0534d2f79a569b9857b02328bf7573cf93f8",
  "attachment": {
   "totalSellLimit": "1000",
   "buyRateNQTPerUnit": "10000000",
   "initialSellSupplyQNT": "500",
   "totalBuyLimitQNT": "1000",
   "expirationHeight": 163080,
   "sellRateNQTPerUnit": "20000000",
   "version.PublishExchangeOffer": 1,
   "currency": "6520756875632314476",
   "initialBuySupplyQNT": "500"
  },
  "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 4,
  "amountNQT": "0",
  "sender": "15295723609781267838",
  "ecBlockHeight": 163049,
  "deadline": 60,
  "transaction": "13568114225891298300",
  "timestamp": 34194647,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 54,
 "transactionBytes": "0514d7c409023c0010f09c34f225d425306e5be55a4946908156072...",
 "transaction": "13568114225891298300"
}


Search Currencies

Get currencies having a code that matches a given query in reverse relevance order.

Request:

  • requestType is searchCurrencies
  • query is a full text query on the currency field code in the standard Lucene syntax
  • firstIndex is a zero-based index to the first currency to retrieve (optional)
  • lastIndex is a zero-based index to the last currency 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:

  • currencies (A) is an array of currency objects (refer to Get Currency 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)

Search Currencies Example

http://localhost:27876/nxt?
  requestType=searchCurrencies&
  query=PTNT?
{
 "requestProcessingTime": 5,
 "currencies": [
  {
    "currentReservePerUnitNQT": "0",
    "chain": 2,
    "types": [
     "EXCHANGEABLE"
    ],
    "code": "PTNT",
    "currentSupplyQNT": "100000000",
    "creationHeight": 361192,
    "minDifficulty": 0,
    "description": "Potential coin",
    "minReservePerUnitNQT": "0",
    "initialSupplyQNT": "100000000",
    "issuanceHeight": 0,
    "type": 1,
    "maxSupplyQNT": "100000000",
    "maxDifficulty": 0,
    "accountRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
    "decimals": 2,
    "name": "POTENTIAL",
    "reserveSupplyQNT": "0",
    "currency": "7978322511509619701",
    "account": "15382970207090678772",
    "algorithm": 0
  }
 ]
}


Transfer Currency

Transfer currency to a given recipient. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • chain the chain related to the operation
  • requestType is transferCurrency
  • recipient is the account ID of the transfer recipient
  • currency is the currency ID
  • unitsQNT is the amount (in QNT) of the transfer

Response: Refer to Create Transaction Response.

Transfer Currency Example

http://localhost:27876/nxt?
  requestType=transferCurrency&
  chain=2&
  recipient=ARDOR-GHKP-XWB5-XMZB-CTUE3&
  currency=7978322511509619701&
  unitsQNT=10
{
 "minimumFeeFQT": "1000000",
 "signatureHash": "cddb8aa3f01e2b3df9ed978a29328779ca69ebf1695ded7aea4568d431001009",
 "transactionJSON": {
  "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
  "chain": 2,
  "signature": "a5ae39b7342ff791aa9e062f7a8e9db592e95d18e58378356570c3625fe6d90609baa5...",
  "feeNQT": "100000",
  "type": 5,
  "fullHash": "e3ab720b411b2406dd7dad261e30ed7660b3453e0c64c775af6c4651c6204605",
  "version": 1,
  "fxtTransaction": "0",
  "phased": false,
  "ecBlockId": "7450640804131256556",
  "signatureHash": "cddb8aa3f01e2b3df9ed978a29328779ca69ebf1695ded7aea4568d431001009",
  "attachment": {
   "currency": "7978322511509619701",
   "version.CurrencyTransfer": 1,
   "unitsQNT": "10"
  },
  "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
  "subtype": 3,
  "amountNQT": "0",
  "sender": "15382970207090678772",
  "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
  "recipient": "11579697950237343285",
  "ecBlockHeight": 360662,
  "deadline": 15,
  "timestamp": 21451363,
  "height": 2147483647
 },
 "unsignedTransactionBytes": "02000000050301635247010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca...",
 "broadcasted": false,
 "requestProcessingTime": 3,
 "transactionBytes": "02000000050301635247010f00df21142bd38c04bd5c5c342c6ca36802f...",
    "fullHash": "e3ab720b411b2406dd7dad261e30ed7660b3453e0c64c775af6c4651c6204605",
    "bundlerRateNQTPerFXT": "10000000"
}