Phasing Operations
Approve Transaction
Approve (vote for) a phased transaction. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestTypeisapproveTransactiontransactionFullHashis the full hash of the transaction to be approved (may be used up to 10 times per API request)revealedSecretis the secret phrase (required only forphasingVotingModel 5, refer to Create Phasing Poll)revealedSecretIsTextis a way of specifying whether revealedSecret is text or binary.
Note: This transaction will be accepted in the blockchain only if all phased transactions it is voting for are already in it.
Response: Refer to Create Transaction Response.
Example: Refer to Approve Transaction example.
Create Phasing Poll
Create a phased transaction with conditional deferred execution based on the result of a vote, on a list of linked transactions or on the revelation of a secret; or simply with unconditional deferred execution. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestTypeis any type from the Create Transaction list which is phasing-safe, indicated with italics such assend Moneyphasedistrueto create a phased transaction (optional but required for all of the following parameters, which are all optional for unphased transactions)phasingFinishHeightis the block height at which the poll will finish; the transaction will be executed at this block height only if all conditions (if any) have been met, otherwise the transaction will never be executedphasingVotingModelis an integer code for the method of approval:-1forNone0forVote By Account1forVote By Account Balance2forVote By Asset Balance3forVote By Currency Balance4forby Linked Transactions5forby Secret
phasingQuorumis the number of "votes" needed for transaction approval (required ifphasingVotingModel>=0, default0):0for voting model-1the number of accountsfor model0total NQTfor model1total QNTfor models2and3the number of transactionsfor model41for model5
phasingMinBalanceis the minimum balance (in NQT or QNT) required for voting (optional, default0)phasingMinBalanceModelis (required ifphasingMinBalance>0, must matchphasingVotingModelwhenphasingVotingModel=1,2or3):1for BLX balance2for an asset balance3for a currency balance
phasingHoldingis the asset or currency ID (required ifphasingMinBalanceModel=2or3)phasingWhitelistedis the account ID of an account allowed to vote for the transaction; once used,onlywhitelisted accounts are allowed to vote (optional, may be used up to ten times per API request)phasingLinkedFullHashis the full hash of a transaction that must be in the blockchain at thephasingFinishHeight; transactions already in the blockchain before the acceptance of the phased transaction can also be linked, as long as they are not more than 60 days old, or themselves phased transactions (required only for voting model4, may be used up to ten times per API request)phasingHashedSecretis the hash of a secret phrase (up to 100 bytes long) required for approval (required only for voting model5)phasingHashedSecretAlgorithmis the hash function used:2for SHA256,6for RIPEMD160 and62for SHA256 followed by RIPEMD160, according to Get Constants (required for aphasingHashedSecret)
Note: When a balance affects the poll result, the result depends only on the balance (including pending outgoing phased transfers) computed just prior to the finish height.
Response: Refer to Create Transaction Response.
Example: Refer to Create Phasing Poll example.
Get Account Phased Transaction Count
Get the number of pending phased transactions associated with an account given the account ID.
Request:
requestTypeisgetAccountPhasedTransactionCountaccountis the account 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:
numberOfPhasedTransactions(N) is the number of pending phased transactionslastBlock(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 Phased Transaction Count example.
Get Account Phased Transactions
Get pending phased transactions associated with an account given the account ID in reverse chronological creation order.
Request:
requestTypeisgetAccountPhasedTransactionsaccountis the account IDfirstIndexis a zero-based index to the first phased transaction to retrieve (optional)lastIndexis a zero-based index to the last phased transaction 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: Refer to Get Transaction for details.
Example: Refer to Get Account Phased Transactions example.
Get Asset Phased Transactions
Get pending phased transactions based on an asset in reverse chronological creation order. These transactions can be considered transaction approval requests.
Request:
requestTypeisgetAssetPhasedTransactionsassetis the asset IDaccountis an account ID of the account that created the phased transactions (optional)withoutWhitelististrueto omit phased transactions that include a whitelist (optional)firstIndexis a zero-based index to the first phased transaction to retrieve (optional)lastIndexis a zero-based index to the last phased transaction 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: Refer to Get Transaction for details.
Example: Refer to Get Asset Phased Transactions example.
Get Currency Phased Transactions
Get pending phased transactions based on a currency in reverse chronological creation order. These transactions can be considered transaction approval requests.
Request:
requestTypeisgetCurrencyPhasedTransactionscurrencyis the currency IDaccountis an account ID of the account that created the phased transactions (optional)withoutWhitelististrueto omit phased transactions that include a whitelist (optional)firstIndexis a zero-based index to the first phased transaction to retrieve (optional)lastIndexis a zero-based index to the last phased transaction 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: Refer to Get Transaction for details.
Example: Refer to Get Currency Phased Transactions example.
Get Linked Phased Transactions
Gets the phased transactions with by-transaction voting model for a given linkedFullHash, regardless of their phasing status (pending, approved or rejected). Since the corresponding table is trimmed after finish height however, the result will not include those transactions that finished before the last trimming height.
Request:
requestTypeisgetLinkedPhasedTransactionslinkedFullHashis the full hash of the transaction transactionrequireBlockis 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:
transactions(A) is an array of transactions (refer to Get Transaction for details)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Get Linked Phased Transactions example.
Get Phasing Poll
Get the details of a phasing poll.
Request:
requestTypeisgetPhasingPolltransactionis the transaction ID of the phasing pollcountVotesistrueto compute the pollresultwhile the votes are still available (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:
transaction(S) is the transaction ID of the phasing pollaccount(S) is the number of the account that created the phasing pollaccountRS(S) is the Reed-Solomon address of the account that created the phasing pollfinishHeight(N) is the block height at which the poll finished or will finishvotingModel(N) is the voting model (refer to Create Transaction Request)quorum(S) is the minimum number of votes needed to approve the polltransactionFullHash(S) is the full hash of the phasing poll transactionfinished(B) istrueif the poll is finished,falseotherwise (omitted iffinishedisfalse)result(S) is the sum of theresultof each account that approved (voted for) the transaction; an account'sresultis1if the voting model is0,4or5; it is the NQT, asset QNT or currency QNT balance of the account if the voting model is1,2or3respectively; however, theresultis0ifminBalanceis not metapproved(B) istrueif the poll was approved,falseotherwiseminBalance(S) is the required minimum balance of voting accounts to be eligible to voteminBalanceModel(N) is the minimum balance model (refer to Create Transaction Request)hashedSecret(S) is the hash of a secret that must be included in each approval (vote) transaction for the approval to be accepted (refer to Create Transaction Request)linkedFullHashes(A) is an array of full hashes of linked transactions (omitted ifvotingModel!=4)whitelist(A) is an array of whitelist objects containing the following two fields (omitted ifvotingModel!=5):whitelisted(S) is the number of the whitelisted accountwhitelistedRS(S) is the Reed-Solomon address of the whitelisted account
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 Phasing Poll example.
Get Phasing Poll Vote
Get a cast phasing poll vote given a phased transaction ID and an account ID of a voter, if it is still available.
Request:
requestTypeisgetPhasingPollVotetransactionis the phased transaction IDaccountis the account ID of a voter in the pollrequireBlockis 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:
voter(S) is the account ID of the voter in the pollvoterRS(S) is the Reed-Solomon address of thevotertransaction(S) is the phased transaction IDlastBlock(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 Phasing Poll Vote example.
Get Phasing Poll Votes
Get all cast phasing poll votes in a phasing poll given a phased transaction ID, if they are still available.
Request:
requestTypeisgetPhasingPollVotestransactionis the phased transaction IDfirstIndexis a zero-based index to the first vote to retrieve (optional)lastIndexis a zero-based index to the last vote 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: Refer to Get Phasing Poll Vote
Example: Refer to Get Phasing Poll Votes example.
Get Phasing Polls
Get phasing poll details given multiple phased transaction IDs.
Request:
requestTypeisgetPhasingPollstransactionis one of the multiple phased transaction IDstransactionis one of the multiple phased transaction IDscountVotesistrueto compute the pollresultwhile the votes are still available (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: Refer to Get Phasing Poll.
Example: Refer to Get Phasing Polls example.
Get Voter Phased Transactions
Get pending phased transactions which include a whitelist in reverse chronological creation order. These transactions can be considered transaction approval requests.
Request:
requestTypeisgetVoterPhasedTransactionsaccountis a whitelisted account ID included in the phased transactionsfirstIndexis a zero-based index to the first phased transaction to retrieve (optional)lastIndexis a zero-based index to the last phased transaction 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: Refer to Get Transaction for details.
Example: Refer to Get Voter Phased Transactions example.