Monetary System Operations
Can Delete Currency
Determine if a currency can be deleted.
Request:
requestTypeiscanDeleteCurrencyaccountis the account IDcurrencyis the currency IDrequireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
canDelete(B) istrueif the currency can be deleted,falseotherwiselastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)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.
Example: Refer to Can Delete Currency example.
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.
requestTypeiscurrencyBuyorcurrencySellcurrencyis the currency IDrateNQTis the exchange rate (in NQT per QNT)unitsis 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.
Example: Refer to Currency Buy / Sell example.
Currency Buy
Refer to Currency Buy / Sell.
Currency Sell
Refer to Currency Buy / Sell.
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.
requestTypeiscurrencyMintcurrencyis the mintable currency IDnonceis the computed nonceunitsis the amount (in QNT) of currency to mintcounter(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.
Example: Refer to Currency Mint example.
Currency Reserve Claim
Claim currency reserve. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestTypeiscurrencyReserveClaimcurrencyis the currency IDunitsis 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.
Example: Refer to Currency Reserve Claim example.
Currency Reserve Increase
Increase the currency reserve of an unissued reservable currency. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestTypeiscurrencyReserveIncreasecurrencyis the currency IDamountPerUnitNQTis the additional amount (in NQT per QNT ofreserveSupply) 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.
Example: Refer to Currency Reserve Increase example.
Delete Currency
Delete a deletable currency (refer to Can Delete Currency). POST only.
Request: Refer to Create Transaction Request for common parameters.
requestTypeisdeleteCurrencycurrencyis the currency ID
Response: Refer to Create Transaction Response.
Example: Refer to Delete Currency example.
Get Account Currencies
Get the currencies issued by a given account.
Request:
requestTypeisgetAccountCurrenciesaccountis the account IDcurrencyis a currency ID filter (optional)heightis the blockchain height at which the response applies (optional, default is the current height)includeCurrencyInfoistrueif several currency information properties is to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 codeunconfirmedUnits(S) is the amount of unconfirmed currency units (in QNT)decimals(N) is the number of currency decimal placesname(S) is the currency namecurrency(S) is the currency IDunits(S) is the amount of currency (in QNT)issuanceHeight(N) is the blockchain height of issuance for a reservable currencytype(N) is the currency type bitmask (refer to Get Currency)issuerAccountRS(S) is the Reed-Solomon address of the issuer accountissuerAccount(S) is the issuer account ID
lastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Account Currencies example.
Get Account Currency Count
Get the number of currencies issued by a given account.
Request:
requestTypeisgetAccountCurrencyCountaccountis the account IDheightis the blockchain height at which the response applies (optional, default is the current height)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
numberOfCurrencies(N) is the number of currencies issuedlastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Account Currency Count example.
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:
requestTypeis eithergetAccountExchangeRequestsorgetExpectedExchangeRequests, where expected requests are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next blockaccountis the account ID (optional for expected requests)currencyis the currency ID (optional for expected requests ifaccountprovided)includeCurrencyInfoistrueto include the response fieldscode,decimals,name,issuanceHeight,type,timestamp,issuerAccountRSandissuerAccount(optional, applies only to expected requests)firstIndexis a zero-based index to the first request to retrieve (optional, does not apply to expected requests)lastIndexis a zero-based index to the last request to retrieve (optional, does not apply to expected requests)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 codesubtype(N) is5for buy and6for selldecimals(N) is the number of decimal placesname(S) is the currency nameunits(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 otherwisetype(N) is the currency type bitmask (refer to Get Currency)transaction(S) is the transaction IDtimestamp(N) is the timestamp (in seconds since the genesis block) of the block when the request was executedrateNQT(S) is the exchange rate (in NQT per QNT)issuerAccountRS(S) is the Reed-Solomon address of the issuer accountissuerAccount(S) is the issuer account IDphased(B) is true if the transaction is phased (applies only to expected requests)
lastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Account Exchange Requests example.
Get Expected Exchange Requests
Refer to Get Account Exchange Requests.
Get Funding Monitor
Get a funding monitor.
Request:
requestTypeisgetFundingMonitorsecretPhraseis the secret phrase of the funding account, used to get a single monitor. (optional)adminPasswordis the admin password, used to get a single monitor or all monitors (optional ifsecretPhraseis provided)includeMonitoredAccountsistrueto include account info of the monitored accounts (optional)propertyis the name of the account property (optional)holdingTypeis a string representing the holding type (optional)holdingis the holding ID (optional)accountis the account ID (optional)
Response:
monitors(A) is an array of monitor objects including the following fields:holding(S) is the holding IDamount(S) is the amount to fund the monitored accounts with (NQT or QNT)monitoredAccounts(A) is an array of monitored account objects including the following fields (only ifincludeMonitoredAccountsistrue):amount(S) is the amount to fund the monitored accounts with. Overrides amount in parent object.account(S) is the monitored account IDaccountRS(S) is the monitored account Reed Solomon addressthreshold(S) is the threshold. Overrides threshold in parent object.interval(N) is the interval. Overrides interval in parent object.
holdingType(N) is the holding typeaccount(S) is the monitoring account IDaccountRS(S) is the Reed Solomon address of the monitoring accountproperty(S) is the account propertythreshold(S) is the thresholdinterval(N) is the interval
requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Funding Monitor example.
Get All Currencies
Get all currencies in reverse creation order.
Request:
requestTypeisgetAllCurrenciesfirstIndexis a zero-based index to the first currency to retrieve (optional)lastIndexis a zero-based index to the last currency to retrieve (optional)includeCountsistrueto includenumberOf...fields (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get All Currencies example.
Get All Exchanges
Get all currency exchanges in reverse chronological order.
Request:
requestTypeisgetAllExchangestimestampis the earliest timestamp to retrieve (optional)firstIndexis a zero-based index to the first exchange to retrieve (optional)lastIndexis a zero-based index to the last exchange to retrieve (optional)includeCurrencyInfoistrueto include some currency details (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get All Exchanges example.
Get Available To Buy
Calculates the rate required in order to completely fill an exchange request.
Request:
requestTypeisgetAvailableToBuyorgetAvailableToSellcurrencyis the currency IDunitsis the number of units to buyrequireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 requestunits(S) is the number of unitsrateNQT(S) is the rate for the currency unitsrequestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Available To Buy example.
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:
requestTypeis one ofgetBuyOffers,getSellOffers,getExpectedBuyOffersorgetExpectedSellOffers, where expected offers are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next blockcurrencyis the currency ID (optional)accountis the account ID (optional ifcurrencyprovided)availableOnlyistrueto include only offers with non-zero supply and limit, but is ignored when bothcurrencyandaccountare given (optional, does not apply to expected offers)sortByRateistrueto sort by rate (optional, applies only to expected offers, which are returned in expected order of execution by default)firstIndexis a zero-based index to the first offer to retrieve (optional, does not apply to expected offers)lastIndexis a zero-based index to the last offer to retrieve (optional, does not apply to expected offers)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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) istrueif the offer is phased,falseotherwise
lastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Buy / Sell Offers example.
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.
Get Expected Sell Offers
Refer to Get Buy / Sell Offers.
Get Currencies
Get currencies given multiple currency IDs.
Request:
requestTypeisgetCurrenciescurrenciesis one of multiple currency IDscurrenciesis one of multiple currency IDsincludeCountsistrueto includenumberOf...fields (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Currencies example.
Get Currencies By Issuer
Get currencies issued by multiple accounts in reverse creation order.
Request:
requestTypeisgetCurrenciesByIssueraccountis one of multiple account IDsaccountis one of multiple account IDsfirstIndexis a zero-based index to the first currency to retrieve (optional)lastIndexis a zero-based index to the last currency to retrieve (optional)includeCountsistrueifnumberOf...fields are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Currencies By Issuer example.
Get Currency
Get the details of a currency.
Request:
requestTypeisgetCurrencycurrencyis the currency ID (optional)codeis the currency code (optional ifcurrencyprovided)includeCountsistrueifnumberOf...fields are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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:EXCHANGEABLECONTROLLABLERESERVABLECLAIMABLEMINTABLENON-SHUFFLEABLE
code(S) is the currency codecreationHeight(N) is the blockchain height of the currency creationminDifficulty(N) is the minimum difficulty for a mintable currencynumberOfTransfers(N) is the number of currency transfersdescription(S) is the currency descriptionminReservePerUnitNQT(S) is the minimum currency reserve (in NQT per QNT) for a reservable currencycurrentSupply(S) is the current currency supply (in QNT)issuanceHeight(N) is the blockchain height of the currency issuance for a reservable currencyrequestProcessingTime(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-shuffleablereserveSupply(S) is the reserve currency supply (in NQT) for a reservable currencymaxDifficulty(N) is the maximum difficulty for a mintable currencyaccountRS(S) is the Reed-Solomon address of the issuing accountdecimals(N) is the number of decimal places used by the currencyname(S) is the name of the currencynumberOfExchanges(N) is the number of currency exchangescurrency(S) is the currency IDmaxSupply(S) is the maximum currency supply (in QNT)account(S) is the account ID of the currency issueralgorithm(N) is the algorithm number for a mintable currency: 2 for SHA256, 3 for SHA3, 5 for Scrypt, 25 for Keccak25lastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)
Example: Refer to Get Currency example.
Get Currency Account Count
Get the number of accounts that hold a given currency.
Request:
requestTypeisgetCurrencyAccountCountcurrencyis the currency IDheightis the blockchain height at which the response applies (optional, default is the current height)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 currencylastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Currency Account Count example.
Get Currency Accounts
Get the accounts that hold a given currency in reverse units order.
Request:
requestTypeisgetCurrencyAccountscurrencyis the currency IDheightis the blockchain height at which the response applies (optional, default is current height)firstIndexis a zero-based index to the first account to retrieve (optional)lastIndexis a zero-based index to the last account to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 accountcurrency(S) is the currency IDunits(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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Currency Accounts example.
Get Currency Founders
Get a reservable currency's founders.
Request:
requestTypeisgetCurrencyFounderscurrencyis the currency IDaccountis an account ID (optional)firstIndexis a zero-based index to the first founder to retrieve (optional)lastIndexis a zero-based index to the last founder to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 accountamountPerUnitNQT(S) is the amount (in NQT per QNT ofreserveSupply) reserved by the foundercurrency(S) is the currency IDaccount(S) is the founding account number
lastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Currency Founders example.
Get Currency Ids
Get all currency IDs in reverse chronological creation order.
Request:
requestTypeisgetCurrencyIdsfirstIndexis a zero-based index to the first currency to retrieve (optional)lastIndexis a zero-based index to the last currency to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
currencyIds(A) is an array of currency IDslastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Currency Ids example.
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:
requestTypeis eithergetCurrencyTransfersorgetExpectedCurrencyTransfers, where expected transfers are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next blockcurrencyis the currency ID (optional)accountis the account ID (optional ifcurrencyprovided)timestampis the earliest transfer (in seconds since the genesis block) to retrieve (optional, does not apply to expected transfers)firstIndexis a zero-based index to the first transfer to retrieve (optional, does not apply to expected transfers)lastIndexis a zero-based index to the last transfer to retrieve (optional, does not apply to expected transfers)includeCurrencyInfoistrueto include some currency fields (optional, does not apply to expected transfers)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 codeunits(S) is the amount (in QNT) of the transferissuanceHeight(N) is the blockchain height of the currency issuance for a reservable currencytype(N) is the currency type bitmask (refer to Get Currency for details)issuerAccountRS(S) is the Reed-Solomon address of the issuer accounttransfer(S) is the transfer IDsenderRS(S) is the Reed-Solomon address of the sender accountsender(S) is the account number of the sender accountrecipientRS(S) is the Reed-Solomon address of the recipient accountdecimals(N) is the number of decimal places used by the currencyrecipient(S) is the account number of the recipient accountname(S) is the currency namecurrency(S) is the currency IDissuerAccount(S) is the issuer account IDheight(N) is the blockchain height of the transfertimestamp(N) is the timestamp (in seconds since the genesis block) of the transfer block, does not apply to an expected transferphased(B) istrueif the transaction is phased,falseotherwise, applies only to an expected transferissuerAccountRS(S) is the Reed-Solomon address of the issuer accountissuerAccount(S) is the issuer account ID
lastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Currency Transfers example.
Get Expected Currency Transfers
Refer to Get Currency Transfers.
Get Exchanges
Get currency exchanges given a currency and/or an account in reverse chronological order.
Request:
requestTypeisgetExchangescurrencyis a currency ID (optional)accountis an account ID (optional ifcurrencyprovided)firstIndexis a zero-based index to the first currency exchange to retrieve (optional)lastIndexis a zero-based index to the last currency exchange to retrieve (optional)timestampis the earliest block (in seconds since the genesis block) to retrieve (optional)includeCurrencyInfoistrueto include several currency-related fields (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 numbercode(S) is the currency codesellerRS(S) is the Reed-Solomon address of the seller accountunits(S) is the amount of currency exchanged (in QNT)issuanceHeight(N) is the blockchain height of currency issuance for a reservable currencytype(N) is the currency type bitmask (refer to Get Currency for details)rateNQT(S) is the currency exchange rate (in NQT per QNT)buyer(S) is the account number of the buyeroffer(S) is the offer IDbuyerRS(S) is the Reed-Solomon address of the buyer accountdecimals(N) is the number of decimal places used by the currencyname(S) is the currency namecurrency(S) is the currency IDblock(S) is the block ID of the block containing the exchange transactiontransaction(S) is the transaction ID of the exchangetimestamp(N) is the timestamp (in seconds since the genesis block) of the exchangeheightis the blockchain height of the block containing the exchange transactionissuerAccountRS(S) is the Reed-Solomon address of the issuer accountissuerAccount(S) is the issuer account ID
lastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Exchanges example.
Get Exchanges By Exchange Request
Get currency exchanges given an exchange request transaction ID in reverse chronological order.
Request:
requestTypeisgetExchangesByExchangeRequesttransactionis the transaction ID of the exchange requestincludeCurrencyInfoistrueto include several currency-related fields (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Exchanges By Exchange Request example.
Get Exchanges By Offer
Get currency exchanges given a currency offer ID in reverse chronological order.
Request:
requestTypeisgetExchangesByOfferoffer(S) is a currency offer IDincludeCurrencyInfoistrueto include several currency-related fields (optional)firstIndexis a zero-based index to the first currency exchange to retrieve (optional)lastIndexis a zero-based index to the last currency exchange to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Exchanges By Offer example.
Get Last Exchanges
Get the last exchange of each of multiple currencies.
Request:
requestTypeisgetLastExchangescurrenciesis one of multiple currency IDscurrenciesis one of multiple currency IDsrequireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 withoutname,decimals,code,issuanceHeight,type,issuerAccountRSandissuerAccountfor details)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Last Exchanges example.
Get Minting Target
Get the current minting target of a mintable currency.
Request:
requestTypeisgetMintingTargetcurrencyis the mintable currency IDaccountis the minting account IDunitsis the amount (in QNT) of currency to mintrequireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 targettargetBytes(S) is the 32-byte target (little endian), which must equal or exceed the computed hash of thenoncecurrency(S) is the currency IDcounter(N) is the counter associated with the minting account, the value previously submitted to Currency MintlastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)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.)
Example: Refer to Get Minting Target example.
Get Offer
Get offer details given an offer ID.
Request:
requestTypeisgetOfferofferis the offer IDrequireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis the block ID of a block that must be last in the blockchain during execution (optional)
Response:
sellOfferandbuyOffer(O) are objects with the following fields:offer(S) is the offer IDexpirationHeight(N) is the blockchain height of offer expirationaccountRS(S) is the Reed-Solomon address of the offering accountlimit(S) is the cumulative limit of currency buys or sellscurrency(S) is the currency IDsupply(S) is the current currency supplyaccount(S) is the offering account numberheight(N) is the blockchain height of offer creationrateNQT(S) is the currency exchange rate (in NQT per QNT)
lastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Offer example.
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.
requestTypeisissueCurrencynameis the currency name, 3 to 10 characters and longer than the currency codecodeis the uppercase currency code with the following fee structure: three letters 25000 BLX, four letters 1000 BLX, five letters 40 BLX, re-issue 40 BLXdescriptionis the currency descriptiontypeis the currency type bitmask, from least to most significant bit: exchangeable, controllable, reservable, claimable, mintable, non-shuffleableinitialSupplyis the initial currency supply (in QNT) (must matchmaxSupplyunless mintable or claimable, must be zero for claimable)reserveSupplyis the reserve currency supply (in QNT) (must matchmaxSupply)maxSupplyis the maximum currency supply (in QNT)issuanceHeightis the blockchain height at which a reservable currency is issued if the reserve minimum is metminReservePerUnitNQTis the minimum currency reserve (in NQT per QNT ofreserveSupply) for issuance of a reservable currencyminDifficultyis the minimum difficulty (minimum1) for a mintable currencymaxDifficultyis the maximum difficulty (maximum255and greater thanminDifficulty) for a mintable currencyrulesetis for future use, always set to zeroalgorithmis an algorithm code for a mintable currency:2for SHA256,3for SHA3,5for Scrypt,25for Keccak25decimalsis 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.
Example: Refer to Issue Currency example.
Publish Exchange Offer
Publish an exchange offer for an exchangeable currency. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestTypeispublishExchangeOffercurrencyis the currency IDbuyRateNQTis the offered buy rate (in NQT per QNT)sellRateNQTis the offered sell rate (in NQT per QNT)totalBuyLimitis the cumulative limit (in QNT) of currency buystotalSellLimitis the cumulative limit (in QNT) of currency sellsinitialBuySupplyis the initial amount (in QNT) of currency offered to buy, cannot exceedtotalBuyLimitinitialSellSupplyis the initial amount (in QNT) of currency offered to sell, cannot exceedtotalSellLimitexpirationHeightis 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.
Example: Refer to Publish Exchange Offer example.
Search Currencies
Get currencies having a code that matches a given query in reverse relevance order.
Request:
requestTypeissearchCurrenciesqueryis a full text query on the currency fieldcodein the standard Lucene syntax (opens in a new tab)firstIndexis a zero-based index to the first currency to retrieve (optional)lastIndexis a zero-based index to the last currency to retrieve (optional)includeCountsistrueif the fields beginning withnumberOf...are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Search Currencies example.
Transfer Currency
Transfer currency to a given recipient. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestTypeistransferCurrencyrecipientis the account ID of the transfer recipientcurrencyis the currency IDunitsis the amount (in QNT) of the transfer
Response: Refer to Create Transaction Response.
Example: Refer to Transfer Currency example.