Monetary System Operations
Can Delete Currency
Determine if a currency can be deleted.
Request:
requestType
iscanDeleteCurrency
account
is the account IDcurrency
is the currency IDrequireBlock
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) istrue
if the currency can be deleted,false
otherwiselastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is 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.
requestType
iscurrencyBuy
orcurrencySell
currency
is the currency IDrateNQT
is the exchange rate (in NQT per QNT)units
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.
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.
requestType
iscurrencyMint
currency
is the mintable currency IDnonce
is the computed nonceunits
is 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.
requestType
iscurrencyReserveClaim
currency
is the currency IDunits
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.
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.
requestType
iscurrencyReserveIncrease
currency
is the currency IDamountPerUnitNQT
is 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.
requestType
isdeleteCurrency
currency
is 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:
requestType
isgetAccountCurrencies
account
is the account IDcurrency
is a currency ID filter (optional)height
is the blockchain height at which the response applies (optional, default is the current height)includeCurrencyInfo
istrue
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 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 ifrequireBlock
is 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:
requestType
isgetAccountCurrencyCount
account
is the account IDheight
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 issuedlastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is 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:
requestType
is eithergetAccountExchangeRequests
orgetExpectedExchangeRequests
, where expected requests are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next blockaccount
is the account ID (optional for expected requests)currency
is the currency ID (optional for expected requests ifaccount
provided)includeCurrencyInfo
istrue
to include the response fieldscode
,decimals
,name
,issuanceHeight
,type
,timestamp
,issuerAccountRS
andissuerAccount
(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 codesubtype
(N) is5
for buy and6
for 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 ifrequireBlock
is 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:
requestType
isgetFundingMonitor
secretPhrase
is the secret phrase of the funding account, used to get a single monitor. (optional)adminPassword
is the admin password, used to get a single monitor or all monitors (optional ifsecretPhrase
is provided)includeMonitoredAccounts
istrue
to include account info of the monitored accounts (optional)property
is the name of the account property (optional)holdingType
is a string representing the holding type (optional)holding
is the holding ID (optional)account
is the account ID (optional)
Response:
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 ifincludeMonitoredAccounts
istrue
):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:
requestType
isgetAllCurrencies
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
istrue
to includenumberOf...
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 ifrequireBlock
is 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:
requestType
isgetAllExchanges
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
istrue
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 ifrequireBlock
is 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:
requestType
isgetAvailableToBuy
orgetAvailableToSell
currency
is the currency IDunits
is the number of units to buyrequireBlock
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 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:
requestType
is one ofgetBuyOffers
,getSellOffers
,getExpectedBuyOffers
orgetExpectedSellOffers
, where expected offers are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next blockcurrency
is the currency ID (optional)account
is the account ID (optional ifcurrency
provided)availableOnly
istrue
to include only offers with non-zero supply and limit, but is ignored when bothcurrency
andaccount
are given (optional, does not apply to expected offers)sortByRate
istrue
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) istrue
if the offer is phased,false
otherwise
lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is 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:
requestType
isgetCurrencies
currencies
is one of multiple currency IDscurrencies
is one of multiple currency IDsincludeCounts
istrue
to includenumberOf...
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 ifrequireBlock
is 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:
requestType
isgetCurrenciesByIssuer
account
is one of multiple account IDsaccount
is one of multiple account IDsfirstIndex
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
istrue
ifnumberOf...
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:
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 ifrequireBlock
is 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:
requestType
isgetCurrency
currency
is the currency ID (optional)code
is the currency code (optional ifcurrency
provided)includeCounts
istrue
ifnumberOf...
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 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 ifrequireBlock
is provided but notrequireLastBlock
)
Example: Refer to Get Currency example.
Get Currency Account Count
Get the number of accounts that hold a given currency.
Request:
requestType
isgetCurrencyAccountCount
currency
is the currency IDheight
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 currencylastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is 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:
requestType
isgetCurrencyAccounts
currency
is the currency IDheight
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 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 ifrequireBlock
is 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:
requestType
isgetCurrencyFounders
currency
is the currency IDaccount
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 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 ifrequireBlock
is 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:
requestType
isgetCurrencyIds
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 IDslastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is 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:
requestType
is eithergetCurrencyTransfers
orgetExpectedCurrencyTransfers
, where expected transfers are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next blockcurrency
is the currency ID (optional)account
is the account ID (optional ifcurrency
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
istrue
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 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) istrue
if the transaction is phased,false
otherwise, 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 ifrequireBlock
is 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:
requestType
isgetExchanges
currency
is a currency ID (optional)account
is an account ID (optional ifcurrency
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
istrue
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 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 exchangeheight
is 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 ifrequireBlock
is 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:
requestType
isgetExchangesByExchangeRequest
transaction
is the transaction ID of the exchange requestincludeCurrencyInfo
istrue
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 ifrequireBlock
is 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:
requestType
isgetExchangesByOffer
offer
(S) is a currency offer IDincludeCurrencyInfo
istrue
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 ifrequireBlock
is 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:
requestType
isgetLastExchanges
currencies
is one of multiple currency IDscurrencies
is one of multiple currency IDsrequireBlock
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 withoutname
,decimals
,code
,issuanceHeight
,type
,issuerAccountRS
andissuerAccount
for 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:
requestType
isgetMintingTarget
currency
is the mintable currency IDaccount
is the minting account IDunits
is the amount (in QNT) of currency to mintrequireBlock
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 targettargetBytes
(S) is the 32-byte target (little endian), which must equal or exceed the computed hash of thenonce
currency
(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 ifrequireBlock
is 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:
requestType
isgetOffer
offer
is the offer IDrequireBlock
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
andbuyOffer
(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 ifrequireBlock
is 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.
requestType
isissueCurrency
name
is the currency name, 3 to 10 characters and longer than the currency codecode
is the uppercase currency code with the following fee structure: three letters 25000 BLX, four letters 1000 BLX, five letters 40 BLX, re-issue 40 BLXdescription
is the currency descriptiontype
is the currency type bitmask, from least to most significant bit: exchangeable, controllable, reservable, claimable, mintable, non-shuffleableinitialSupply
is the initial currency supply (in QNT) (must matchmaxSupply
unless mintable or claimable, must be zero for claimable)reserveSupply
is the reserve currency supply (in QNT) (must matchmaxSupply
)maxSupply
is the maximum currency supply (in QNT)issuanceHeight
is the blockchain height at which a reservable currency is issued if the reserve minimum is metminReservePerUnitNQT
is the minimum currency reserve (in NQT per QNT ofreserveSupply
) for issuance of a reservable currencyminDifficulty
is the minimum difficulty (minimum1
) for a mintable currencymaxDifficulty
is the maximum difficulty (maximum255
and greater thanminDifficulty
) for a mintable currencyruleset
is for future use, always set to zeroalgorithm
is an algorithm code for a mintable currency:2
for SHA256,3
for SHA3,5
for Scrypt,25
for Keccak25decimals
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.
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.
requestType
ispublishExchangeOffer
currency
is the currency IDbuyRateNQT
is the offered buy rate (in NQT per QNT)sellRateNQT
is the offered sell rate (in NQT per QNT)totalBuyLimit
is the cumulative limit (in QNT) of currency buystotalSellLimit
is the cumulative limit (in QNT) of currency sellsinitialBuySupply
is the initial amount (in QNT) of currency offered to buy, cannot exceedtotalBuyLimit
initialSellSupply
is the initial amount (in QNT) of currency offered to sell, cannot exceedtotalSellLimit
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.
Example: Refer to Publish Exchange Offer example.
Search Currencies
Get currencies having a code that matches a given query in reverse relevance order.
Request:
requestType
issearchCurrencies
query
is a full text query on the currency fieldcode
in the standard Lucene syntax (opens in a new tab)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
istrue
if the fields beginning withnumberOf...
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 ifrequireBlock
is 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.
requestType
istransferCurrency
recipient
is the account ID of the transfer recipientcurrency
is the currency IDunits
is the amount (in QNT) of the transfer
Response: Refer to Create Transaction Response.
Example: Refer to Transfer Currency example.