Phasing

From ArdorDocs
Jump to: navigation, search
Other languages:

Approve Transaction

Approve (vote for) a phased transaction. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is approveTransaction
  • chain the chain related to the operation
  • phasedTransaction 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 for phasingVotingModel 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.

Approve Transaction Example

http://localhost:27876/nxt?
  requestType=approveTransaction&
  chain=2&
  phasedTransaction=dcfed8eb4b9c7395e57c7e37f2e269d4915f35e77edfc29075c8050acec1f826&
  revealedSecretText=secret&
  secretPhrase=secretPhrase&
  feeNQT=100000&
  deadline=60
{
 "minimumFeeFQT": "1000000",
 "signatureHash": "ccab74150e75773f2dbfd8d24775ea6ded36ae7dcb13a130891d9b2d5a4d38c9",
 "transactionJSON": {
  "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
  "chain": 2,
  "signature": "4abdae987ff05d31a3bf83052f8d7e05fff8ceaa23b8d69fd01b0bd319a0fe0761...",
  "feeNQT": "100000",
  "type": 9,
  "fullHash": "678829d506b782c05dd63d183a2a4116007647eda232cabb9f143050dd1fad61",
  "version": 1,
  "fxtTransaction": "0",
  "phased": false,
  "ecBlockId": "4371271177276071860",
  "signatureHash": "ccab74150e75773f2dbfd8d24775ea6ded36ae7dcb13a130891d9b2d5a4d38c9",
  "attachment": {
   "phasedTransactions": [
     {
      "chain": 2,
      "transactionFullHash": "dcfed8eb4b9c7395e57c7e37f2e269d4915f35e77edfc29075c8050acec1f826"
     }
    ],
   "version.PhasingVoteCasting": 1
  },
  "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
  "subtype": 2,
  "amountNQT": "0",
  "sender": "15382970207090678772",
  "ecBlockHeight": 361990,
  "deadline": 15,
  "timestamp": 21532107,
  "height": 2147483647
   },
    "unsignedTransactionBytes": "02000000090201cb8d48010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dc...",
    "broadcasted": false,
    "requestProcessingTime": 1,
    "transactionBytes": "02000000090201cb8d48010f00df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c0000000000000000000000...",
    "fullHash": "678829d506b782c05dd63d183a2a4116007647eda232cabb9f143050dd1fad61",
    "bundlerRateNQTPerFXT": "10000000"
}


Create Phased Transaction

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 as Send Money
  • chain the chain related to the operation
  • phased is true 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 executed
  • phasingVotingModel is an integer code for the method of approval:
    • -1 for None
    • 0 for Vote By Account
    • 1 for Vote By Account Balance
    • 2 for Vote By Asset Balance
    • 3 for Vote By Currency Balance
    • 4 for By Linked Transactions
    • 5 for By Secret
    • 6 for Composite phasing see Composite phasing
    • 7 for Vote By Property
  • phasingQuorum is the number of "votes" needed for transaction approval (required if phasingVotingModel >= 0, default 0):
    • 0 for voting model -1
    • the number of accounts for model 0
    • total NQT for model 1
    • total QNT for models 2 and 3
    • the number of transactions for model 4
    • 1 for model 5
  • phasingMinBalance is the minimum balance (in NQT or QNT) required for voting (optional, default 0)
  • phasingMinBalanceModel is (required if phasingMinBalance > 0, must match phasingVotingModel when phasingVotingModel = 1, 2 or 3):
    • 1 for chain balance
    • 2 for an asset balance
    • 3 for a currency balance
  • phasingHolding is the asset or currency ID (required if phasingMinBalanceModel = 2 or 3)
  • 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 the phasingFinishHeight; 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 model 4, 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 model 5)
  • phasingHashedSecretAlgorithm is the hash function used: 2 for SHA256, 6 for RIPEMD160 and 62 for SHA256 followed by RIPEMD160, according to Get Constants (required for a phasingHashedSecret)

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.

Create Phasing Poll Example

http://localhost:27876/nxt?
  requestType=sendMoney&
  chain=2&
  recipient=ARDOR-BMUV-8QQR-47VK-CR7F3&
  secretPhrase=secretPhrase&
  feeNQT=200000000&
  deadline=60&
  phased=true&
  phasingFinishHeight=261550&
  phasingVotingModel=0&
  phasingQuorum=2
{
 "signatureHash": "df6c2dfcaf17f83256cfe388f408e091c08f208a060d54d1fbdb407ffdca121c",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "chain": 2,
  "signature": "418a5453329d6c8d29b1b49dff30653a7f1e66992cece404d8ae997413deaa015b749a...",
  "feeNQT": "200000000",
  "type": 0,
  "fullHash": "6fd876512477ef4fab089ec2ffa084d6db75ba3cd0cef2541675515470dca374",
  "version": 1,
  "phased": true,
  "ecBlockId": "17522485785088843392",
  "signatureHash": "df6c2dfcaf17f83256cfe388f408e091c08f208a060d54d1fbdb407ffdca121c",
  "attachment": {
   "phasingFinishHeight": 261550,
   "phasingHolding": "0",
   "phasingQuorum": "2",
   "version.Phasing": 1,
   "phasingMinBalance": "0",
   "phasingMinBalanceModel": 0,
   "version.OrdinaryPayment": 0,
   "phasingVotingModel": 0
  },
  "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 0,
  "amountNQT": "2000000000",
  "sender": "15295723609781267838",
  "recipientRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
  "recipient": "11580081983047651163",
  "ecBlockHeight": 261454,
  "deadline": 60,
  "transaction": "5759953446299424879",
  "timestamp": 43874749,
  "height": 2147483647
 },
 "unsignedTransactionBytes": "0010bd799d023c0010f09c34f225d425306e5be55a494690...",
 "broadcasted": true,
 "requestProcessingTime": 760,
 "transactionBytes": "0010bd799d023c0010f09c34f225d425306e5be55a4946908156072a...",
 "fullHash": "6fd876512477ef4fab089ec2ffa084d6db75ba3cd0cef2541675515470dca374",
 "transaction": "5759953446299424879"
 "bundlerRateNQTPerFXT": "10000000"
}


Get Account Phased Transaction Count

Get the number of pending phased transactions associated with an account given the account ID.

Request:

  • requestType is getAccountPhasedTransactionCount
  • chain the chain related to the operation
  • account is the account ID
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • numberOfPhasedTransactions (N) is the number of pending phased transactions
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Account Phased Transaction Count Example

http://localhost:27876/nxt?
  requestType=getAccountPhasedTransactionCount&
  chain=2&
  account=15295723609781267838
{
 "requestProcessingTime": 1,
 "numberOfPhasedTransactions": 3
}


Get Account Phased Transactions

Get pending phased transactions associated with an account given the account ID in reverse chronological creation order.

Request:

  • requestType is getAccountPhasedTransactions
  • chain the chain related to the operation
  • account is the account ID
  • 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.

Get Account Phased Transactions Example

http://localhost:27876/nxt?
  requestType=getAccountPhasedTransactions&
  chain=2&
  account=15382970207090678772&
  lastIndex=0
{
 "requestProcessingTime": 1,
 "transactions": [
  {
   "signature": "fa088e98126784e1f502267aadc5acc078346b99088734f668b91f9e257bd00c50b219fbd8eb15ac8a7ae5163e03d973521e02d8e20b73e899dcffd74afd6237",
   "transactionIndex": 1,
   "type": 1,
   "fxtTransaction": "3631739759413271110",
   "phased": true,
   "ecBlockId": "2329106975025976796",
   "signatureHash": "889c856fb4ecc359f9a7b19f85f6f2b79d1646d29b0cc785825239140f48dcec",
   "attachment": {
    "phasingFinishHeight": 364148,
    "phasingHolding": "0",
    "phasingQuorum": "1",
    "encryptedMessage": {
     "data": "5f579d6533662b45ab1099ba76c73175e130429b...",
     "nonce": "96d6e3f308f65fbd915b5fb907f9e0261849c15e53fcb20384fe70e17f270091",
     "isText": true,
     "isCompressed": true
   },
   "version.Phasing": 1,
   "version.ArbitraryMessage": 0,
   "phasingWhitelist": [
    "15382970207090678772"
   ],
   "phasingMinBalance": "0",
   "phasingMinBalanceModel": 0,
   "version.PrunableEncryptedMessage": 1,
   "phasingVotingModel": 0,
   "encryptedMessageHash": "7a9a2dfe8a1d7eaa79f4bba91285a95f3d72b4f89823628320acd363bd8ba623"
  },
  "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
  "subtype": 0,
  "amountNQT": "0",
  "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
  "block": "15757251541504155235",
  "blockTimestamp": 21532047,
  "timestamp": 21532018,
  "deadline": 15,
  "height": 362709,
  "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
  "chain": 2,
  "feeNQT": "200000",
  "confirmations": 40,
  "fullHash": "dcfed8eb4b9c7395e57c7e37f2e269d4915f35e77edfc29075c8050acec1f826",
  "version": 1,
  "sender": "15382970207090678772",
  "recipient": "11579697950237343285",
  "ecBlockHeight": 230000
  }
 ]
}


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 is getAssetPhasedTransactions
  • chain the chain related to the operation
  • asset is the asset ID
  • account is an account ID of the account that created the phased transactions (optional)
  • withoutWhitelist is true 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.

Get Asset Phased Transactions Example

http://localhost:27876/nxt?
  requestType=getAssetPhasedTransactions&
  chain=2&
  asset=17091401215301664836
{
 "requestProcessingTime": 2,
 "transactions": [
  {
   "signature": "803d3fad7076bfe3f48a8ced40bb7075539858bf2b9d23b7653671a7204e6108234d...",
   "transactionIndex": 0,
   "type": 0,
   "phased": true,
   "ecBlockId": "14167949999961480077",
   "signatureHash": "693b18675d813dcc2de1a889fd919d0c4a0eaa679df0b0f8b0ec703bc2e278d4",
   "attachment": {
    "phasingFinishHeight": 262450,
    "phasingHolding": "",
    "phasingQuorum": "500",
    "version.Phasing": 1,
    "phasingMinBalance": "100",
    "phasingMinBalanceModel": 2,
    "version.OrdinaryPayment": 0,
    "phasingVotingModel": 2
   },
   "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "subtype": 0,
   "amountNQT": "500000000",
   "recipientRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "block": "11015494088798322289",
   "blockTimestamp": 43957876,
   "deadline": 60,
   "timestamp": 43957682,
   "height": 262418,
   "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
   "chain": 2,
   "feeNQT": "2100000000",
   "confirmations": 27,
   "fullHash": "e57462c46447f8bd7a0bafd9ab65bde8743ca6c13213185271d7ea6c48118861",
   "version": 1,
   "sender": "15295723609781267838",
   "recipient": "11580081983047651163",
   "ecBlockHeight": 262409,
   "transaction": "13688769565509711077"
  }
 ]
}


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 is getCurrencyPhasedTransactions
  • chain the chain related to the operation
  • currency is the currency ID
  • account is an account ID of the account that created the phased transactions (optional)
  • withoutWhitelist is true 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.

Get Currency Phased Transactions Example

http://localhost:27876/nxt?
  requestType=getCurrencyPhasedTransactions&
  chain=2&
  currency=12366259387060174981
{
 "requestProcessingTime": 2,
 "transactions": [
  {
   "signature": "ec467483307c73c08e7e9195eeddf23ce129ce30d703881cca505cbb0569c2009...",
   "transactionIndex": 0,
   "type": 0,
   "phased": true,
   "ecBlockId": "7353294686633135686",
   "signatureHash": "12cc1d54a453c3d1231b991a54f3323db6a51c00387ca5480db268164d5b7cfa",
   "attachment": {
    "phasingFinishHeight": 263500,
    "phasingHolding": "12366259387060174981",
    "phasingQuorum": "100",
    "version.Phasing": 1,
    "phasingMinBalance": "10",
    "phasingMinBalanceModel": 3,
    "version.OrdinaryPayment": 0,
    "phasingVotingModel": 3
   },
   "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "subtype": 0,
   "amountNQT": "800000000",
   "recipientRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "block": "699750272975612223",
   "blockTimestamp": 44042909,
   "deadline": 60,
   "timestamp": 44042827,
   "height": 263430,
   "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
   "chain": 2,
   "feeNQT": "4100000000",
   "confirmations": 2,
   "fullHash": "5799d135aacf48a317c813fea405c317e7ab90888afb701b92c17914744f244f",
   "version": 1,
   "sender": "15295723609781267838",
   "recipient": "11580081983047651163",
   "ecBlockHeight": 263424,
   "transaction": "11765882356459739479"
  }
 ]
}


Get Hashed Secret Phased Transactions

Returns a list of phased by hash transactions with phasingHashedSecret and phasingHashedSecretAlgorithm as specified.

Request:

  • requestType is getHashedSecretPhasedTransactions
  • phasingHashedSecret is the hash of a secret phrase (up to 100 bytes long) required for approval
  • phasingHashedSecretAlgorithm is the hash function used: 2 for SHA256, 6 for RIPEMD160 and 62 for SHA256 followed by RIPEMD160, according to Get Constants (required for a phasingHashedSecret)
  • 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:

  • transactions (A) is an array of transactions (refer to Get Transaction for details)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Hashed Secret Phased Transactions Example

http://localhost:27876/nxt?
  requestType=getHashedSecretPhasedTransactions&
  phasingHashedSecret=2e99758548972a8e8822ad47fa1017ff72f06f3ff6a016851f45c398732bc50c&
  phasingHashedSecretAlgorithm=2
{
    "requestProcessingTime": 4,
    "transactions": [
        {
            "signature": "41536d0665b7aa2a434c21f313d49a728a7ec78dbbcb866c22ab5618ad7b750173ce9f38d3f61e9394f504c35c2b8fafc8b00f09e547a1e0d2073d2ea26eca01",
            "transactionIndex": 1,
            "type": 1,
            "fxtTransaction": "18071313166612936271",
            "phased": true,
            "ecBlockId": "531019291093849415",
            "signatureHash": "247ef15e1bdba87c3bfeb3facdf375a4df45942a104c9ba5c1ee0b44109d59dd",
            "attachment": {
                "phasingQuorum": "1",
                "version.Phasing": 1,
                "encryptedMessageHash": "21ab6c91e6dba79940109603e2de7c94fe35d9707901446cf958598fcb1e7fae",
                "phasingFinishHeight": 784811,
                "phasingHolding": "0",
                "phasingHashedSecret": "2e99758548972a8e8822ad47fa1017ff72f06f3ff6a016851f45c398732bc50c",
                "encryptedMessage": {
                    "data": "df575b7d8d80292bff0e61785ddfc03b490034ca56462f4a53675882c5ea571bc7e8408abb6ad71f64b1987ac56466394b0f12b5ebe9992fa24e0200e2563dd7",
                    "nonce": "a6362b09583dbcd66bde934591dc0de0836222c28f65163da1b86a3aa29f7e7d",
                    "isText": true,
                    "isCompressed": true
                },
                "version.ArbitraryMessage": 0,
                "phasingHashedSecretAlgorithm": 2,
                "phasingMinBalance": "0",
                "phasingMinBalanceModel": 0,
                "version.PrunableEncryptedMessage": 1,
                "phasingVotingModel": 5
            },
            "senderRS": "ARDOR-X8ZN-WUJ2-SXY3-FBUYC",
            "subtype": 0,
            "amountNQT": "0",
            "recipientRS": "ARDOR-GHKP-XWB5-XMZB-CTUE3",
            "block": "15857620873311522734",
            "blockTimestamp": 30759341,
            "deadline": 15,
            "timestamp": 30759318,
            "height": 783375,
            "senderPublicKey": "df21142bd38c04bd5c5c342c6ca36802f9de89b75b2a0a8cbd32d29dca481e5c",
            "chain": 2,
            "feeNQT": "30000",
            "confirmations": 0,
            "fullHash": "b9fb8aed3907b683bab356bc7124aa9ec633dd83a2a127848d5bb738329025a8",
            "version": 1,
            "sender": "15382970207090678772",
            "recipient": "11579697950237343285",
            "ecBlockHeight": 782652
        }
    ]
}


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 is getLinkedPhasedTransactions
  • linkedFullHash is the full hash of the transaction
  • 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:

  • transactions (A) is an array of transactions (refer to Get Transaction for details)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Linked Phased Transactions Example

http://localhost:27876/nxt?
  requestType=getLinkedPhasedTransactions&
  chain=2&
  linkedFullHash=083eba49bb481c38752a14493f0d40b3c60635935f13dd1fb33f6831fb997079
{
 "requestProcessingTime": 1,
 "transactions": [
  {
   "signature": "d20a8bb84dcb335182ddc81ceaa1c5464881137d32eb195805ad460c9fcdba0...",
   "transactionIndex": 0,
   "type": 0,
   "phased": true,
   "ecBlockId": "4351283327032663440",
   "signatureHash": "77dfa3ff467a3b253530ad1b7a227633fa21fa064efe1df8206690bafb06f42c",
   "attachment": {
    "phasingFinishHeight": 770000,
    "version.Message": 1,
    "phasingHolding": "0",
    "phasingQuorum": "1",
    "version.Phasing": 1,
    "messageIsText": true,
    "phasingLinkedFullHashes": [
     "083eba49bb481c38752a14493f0d40b3c60635935f13dd1fb33f6831fb997079"
    ],
    "phasingMinBalance": "0",
    "message": "I givef Ignis",
    "phasingMinBalanceModel": 0,
    "version.OrdinaryPayment": 0,
    "phasingVotingModel": 4
   },
   "senderRS": "ARDOR-7A48-47JL-T7LD-D5FS3",
   "subtype": 0,
   "amountNQT": "500000000",
   "recipientRS": "ARDOR-5MYN-AP7M-NKMH-CRQJZ",
   "block": "13425992991123879393",
   "blockTimestamp": 80870662,
   "deadline": 1440,
   "timestamp": 80870626,
   "height": 768864,
   "senderPublicKey": "373522bcd8904f4707472e590cbb67976d40e7af39650ea11cb2be...",
   "chain": 2,
   "feeNQT": "300000000",
   "confirmations": 11,
   "fullHash": "a1d845b3daf08493a2b299639b71422a41fcf923e1b68a4533d2bd0e22ad694d",
   "version": 1,
   "sender": "12745647715474645062",
   "recipient": "12664921794733526996",
   "ecBlockHeight": 768850,
   "transaction": "10629885842602449057"
  }
 ]
}


Get Phasing Poll

Get the details of a phasing poll.

Request:

  • requestType is getPhasingPoll
  • chain the chain related to the operation
  • transaction is the transaction ID of the phasing poll
  • countVotes is true to compute the poll result 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 poll
  • account (S) is the number of the account that created the phasing poll
  • accountRS (S) is the Reed-Solomon address of the account that created the phasing poll
  • finishHeight (N) is the block height at which the poll finished or will finish
  • votingModel (N) is the voting model (refer to Create Transaction Request)
  • quorum (S) is the minimum number of votes needed to approve the poll
  • transactionFullHash (S) is the full hash of the phasing poll transaction
  • finished (B) is true if the poll is finished, false otherwise (omitted if finished is false)
  • result (S) is the sum of the result of each account that approved (voted for) the transaction; an account's result is 1 if the voting model is 0, 4 or 5; it is the NQT, asset QNT or currency QNT balance of the account if the voting model is 1, 2 or 3 respectively; however, the result is 0 if minBalance is not met
  • approved (B) is true if the poll was approved, false otherwise
  • minBalance (S) is the required minimum balance of voting accounts to be eligible to vote
  • minBalanceModel (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 if votingModel != 4)
  • whitelist (A) is an array of whitelist objects containing the following two fields (omitted if votingModel != 5):
    • whitelisted (S) is the number of the whitelisted account
    • whitelistedRS (S) is the Reed-Solomon address of the whitelisted account
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Phasing Poll Example

http://localhost:27876/nxt?
  requestType=getPhasingPoll&
  chain=2&
  transaction=15402897900571339064
{
 "votingModel": 0,
 "quorum": "2",
 "transactionFullHash": "38292a530816c2d5693bf5d0afb20847a3c4d2f37c3665fd294a7d2fdc278d56",
 "finished": true,
 "whitelist": [
  {
   "whitelistedRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "whitelisted": "11580081983047651163"
  },
  {
   "whitelistedRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "whitelisted": "15295723609781267838"
  }
 ],
 "requestProcessingTime": 1,
 "result": "2",
 "approved": true,
 "minBalance": "0",
 "accountRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
 "finishHeight": 259600,
 "minBalanceModel": 0,
 "transaction": "15402897900571339064",
 "account": "15295723609781267838",
 "hashedSecret": ""
}


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 is getPhasingPollVote
  • chain the chain related to the operation
  • transactionFullHash is the phased transaction ID
  • account is the account ID of a voter in the poll
  • 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:

  • voter (S) is the account ID of the voter in the poll
  • voterRS (S) is the Reed-Solomon address of the voter
  • transaction (S) is the phased transaction ID
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Phasing Poll Vote Example

http://localhost:27876/nxt?
  requestType=getPhasingPollVote&
  chain=2&
  transaction=12580288379938056583&
  account=15295723609781267838
{
 "voterRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
 "voter": "15295723609781267838",
 "requestProcessingTime": 1,
 "transaction": "9761138556025135837"
}


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 is getPhasingPollVotes
  • chain the chain related to the operation
  • transactionFullHash is the phased transaction ID
  • firstIndex 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

Get Phasing Poll Votes Example

http://localhost:27876/nxt?
  requestType=getPhasingPollVotes&
  account=12580288379938056583
{
 "votes": [
  {
   "voterRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "voter": "15295723609781267838",
   "transaction": "9761138556025135837"
  }
 ],
 "requestProcessingTime": 2
}


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 is getVoterPhasedTransactions
  • chain the chain related to the operation
  • account is a whitelisted account ID included in the phased transactions
  • 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.

Get Voter Phased Transactions Example

http://localhost:27876/nxt?
  requestType=getVoterPhasedTransactions&
  chain=2&
  account=15295723609781267838
{
 "requestProcessingTime": 1,
 "transactions": [
  {
   "signature": "e527fce6591049b61d232ebbf4171319ae4e208f34d8a055ffb09f07dec7d9033527...",
   "transactionIndex": 0,
   "type": 0,
   "fxtTransaction": "3631739759413271110",
   "phased": true,
   "ecBlockId": "13625660527605830055",
   "signatureHash": "2a3cc644b1cb48130a172de92a418d48522b45a25a36d4d48c2347f032e430ab",
   "attachment": {
    "phasingFinishHeight": 263850,
    "phasingHolding": "0",
    "phasingQuorum": "2",
    "version.Phasing": 1,
    "phasingWhitelist": [
     "11580081983047651163",
     "15295723609781267838"
    ],
    "phasingMinBalance": "0",
    "phasingMinBalanceModel": 0,
    "version.OrdinaryPayment": 0,
    "phasingVotingModel": 0
   },
   "senderRS": "ARDOR-4VDY-LNVT-LMAY-FMCKA",
   "subtype": 0,
   "amountNQT": "1100000000",
   "recipientRS": "ARDOR-BMUV-8QQR-47VK-CR7F3",
   "block": "16550954176569210781",
   "blockTimestamp": 44074579,
   "deadline": 1440,
   "timestamp": 44074556,
   "height": 263813,
   "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
   "chain": 2,
   "feeNQT": "200000000",
   "confirmations": 0,
   "fullHash": "b54a7e14c910e0750af0b29c0328347e27411dbe5d158d5d358ee2165b781968",
   "version": 1,
   "sender": "15295723609781267838",
   "recipient": "11580081983047651163",
   "ecBlockHeight": 263804,
   "transaction": "8493807353039047349"
  }
 ]
}


Parse Phasing Params

Request:

  • requestType is parsePhasingParams
  • phasingVotingModel is an integer code for the method of approval:
    • -1 for None
    • 0 for Vote By Account
    • 1 for Vote By Account Balance
    • 2 for Vote By Asset Balance
    • 3 for Vote By Currency Balance
    • 4 for By Linked Transactions
    • 5 for By Secret
    • 6 for Composite phasing see Composite phasing
    • 7 for Vote By Property
  • phasingQuorum is the number of "votes" needed for transaction approval (required if phasingVotingModel >= 0, default 0):
    • 0 for voting model -1
    • the number of accounts for model 0
    • total NQT for model 1
    • total QNT for models 2 and 3
    • the number of transactions for model 4
    • 1 for model 5
  • phasingMinBalance is the minimum balance (in NQT or QNT) required for voting (optional, default 0)
  • phasingMinBalanceModel is (required if phasingMinBalance > 0, must match phasingVotingModel when phasingVotingModel = 1, 2 or 3):
    • 1 for chain balance
    • 2 for an asset balance
    • 3 for a currency balance
  • phasingHolding is the asset or currency ID (required if phasingMinBalanceModel = 2 or 3)
  • 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)
  • phasingHolding is the asset or currency ID (required if phasingMinBalanceModel = 2 or 3)
  • chain the chain related to the operation
  • phasingLinkedTransaction fullHash of the linked transaction in the format chainId:fullHash
  • phasingHashedSecret is the hash of a secret phrase (up to 100 bytes long) required for approval (required only for voting model 5)
  • phasingHashedSecretAlgorithm is the hash function used: 2 for SHA256, 6 for RIPEMD160 and 62 for SHA256 followed by RIPEMD160, according to Get Constants (required for a phasingHashedSecret)

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.

  • phasingExpression is a boolean expresion that sets the phasing in formatt [a-zA-Z][a-zA-Z0-9]* and operators "&" (AND), "|" (OR), "!" (NOT).
  • phasingSenderPropertySetter is the by-property that sets the phasing condition
  • phasingSenderPropertyName is the by-property property name that sets the phasing condition
  • phasingSenderPropertyValue is the by-property phasing value that sets the condition


Response: Refer to Get Transaction for details.


http://localhost:27876/nxt?
  requestType=parsePhasingParams&
  chain=2&
  phasingVotingModel=0&
  phasingExpression=!DMS
{
 "phasingHolding": "0",
 "phasingQuorum": "0",
 "phasingMinBalance": "0",
 "requestProcessingTime": 0,
 "phasingMinBalanceModel": 0,
 "phasingVotingModel": 0
}