Phasing Operations
Approve Transaction
Approve (vote for) a phased transaction. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isapproveTransaction
transactionFullHash
is the full hash of the transaction to be approved (may be used up to 10 times per API request)revealedSecret
is the secret phrase (required only forphasingVotingModel 5
, refer to Create Phasing Poll)revealedSecretIsText
is 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.
requestType
is any type from the Create Transaction list which is phasing-safe, indicated with italics such assend Money
phased
istrue
to create a phased transaction (optional but required for all of the following parameters, which are all optional for unphased transactions)phasingFinishHeight
is 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 executedphasingVotingModel
is an integer code for the method of approval:-1
forNone
0
forVote By Account
1
forVote By Account Balance
2
forVote By Asset Balance
3
forVote By Currency Balance
4
forby Linked Transactions
5
forby Secret
phasingQuorum
is the number of "votes" needed for transaction approval (required ifphasingVotingModel
>=0
, default0
):0
for voting model-1
the number of accounts
for model0
total NQT
for model1
total QNT
for models2
and3
the number of transactions
for model4
1
for model5
phasingMinBalance
is the minimum balance (in NQT or QNT) required for voting (optional, default0
)phasingMinBalanceModel
is (required ifphasingMinBalance
>0
, must matchphasingVotingModel
whenphasingVotingModel
=1
,2
or3
):1
for BLX balance2
for an asset balance3
for a currency balance
phasingHolding
is the asset or currency ID (required ifphasingMinBalanceModel
=2
or3
)phasingWhitelisted
is the account ID of an account allowed to vote for the transaction; once used,only
whitelisted accounts are allowed to vote (optional, may be used up to ten times per API request)phasingLinkedFullHash
is 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)phasingHashedSecret
is the hash of a secret phrase (up to 100 bytes long) required for approval (required only for voting model5
)phasingHashedSecretAlgorithm
is the hash function used:2
for SHA256,6
for RIPEMD160 and62
for 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:
requestType
isgetAccountPhasedTransactionCount
account
is the account 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:
numberOfPhasedTransactions
(N) is the number of pending phased transactionslastBlock
(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 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:
requestType
isgetAccountPhasedTransactions
account
is the account IDfirstIndex
is a zero-based index to the first phased transaction to retrieve (optional)lastIndex
is a zero-based index to the last phased transaction to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response: Refer to Get 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:
requestType
isgetAssetPhasedTransactions
asset
is the asset IDaccount
is an account ID of the account that created the phased transactions (optional)withoutWhitelist
istrue
to omit phased transactions that include a whitelist (optional)firstIndex
is a zero-based index to the first phased transaction to retrieve (optional)lastIndex
is a zero-based index to the last phased transaction to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response: Refer to Get 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:
requestType
isgetCurrencyPhasedTransactions
currency
is the currency IDaccount
is an account ID of the account that created the phased transactions (optional)withoutWhitelist
istrue
to omit phased transactions that include a whitelist (optional)firstIndex
is a zero-based index to the first phased transaction to retrieve (optional)lastIndex
is a zero-based index to the last phased transaction to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response: Refer to Get 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:
requestType
isgetLinkedPhasedTransactions
linkedFullHash
is the full hash of the transaction transactionrequireBlock
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:
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:
requestType
isgetPhasingPoll
transaction
is the transaction ID of the phasing pollcountVotes
istrue
to compute the pollresult
while the votes are still available (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:
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) istrue
if the poll is finished,false
otherwise (omitted iffinished
isfalse
)result
(S) is the sum of theresult
of each account that approved (voted for) the transaction; an account'sresult
is1
if the voting model is0
,4
or5
; it is the NQT, asset QNT or currency QNT balance of the account if the voting model is1
,2
or3
respectively; however, theresult
is0
ifminBalance
is not metapproved
(B) istrue
if the poll was approved,false
otherwiseminBalance
(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 ifrequireBlock
is 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:
requestType
isgetPhasingPollVote
transaction
is the phased transaction IDaccount
is the account ID of a voter in the pollrequireBlock
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:
voter
(S) is the account ID of the voter in the pollvoterRS
(S) is the Reed-Solomon address of thevoter
transaction
(S) is the phased transaction IDlastBlock
(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 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:
requestType
isgetPhasingPollVotes
transaction
is the phased transaction IDfirstIndex
is a zero-based index to the first vote to retrieve (optional)lastIndex
is a zero-based index to the last vote 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: 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:
requestType
isgetPhasingPolls
transaction
is one of the multiple phased transaction IDstransaction
is one of the multiple phased transaction IDscountVotes
istrue
to compute the pollresult
while the votes are still available (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response: Refer to Get 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:
requestType
isgetVoterPhasedTransactions
account
is a whitelisted account ID included in the phased transactionsfirstIndex
is a zero-based index to the first phased transaction to retrieve (optional)lastIndex
is a zero-based index to the last phased transaction to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response: Refer to Get Transaction for details.
Example: Refer to Get Voter Phased Transactions example.