Account Control

From ArdorDocs
Jump to: navigation, search

Get All Phasing Only Controls

Retrieve all accounts subject to phasing control with their respective restrictions. Javadoc

Request:

  • requestType is getAllPhasingOnlyControls
  • firstIndex is a zero-based index to the first block ID to retrieve (optional)
  • lastIndex is a zero-based index to the last block ID 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:

  • phasingOnlyControls (A) is an array with phasing only controls objects (Refer to Get Phasing Only Control for details)
  • requestProcessingTime (N) is the API request processing time (in millisec)


Get All Phasing Only Controls Example

http://localhost:27876/nxt?
  requestType=getAllPhasingOnlyControls&
  firstIndex=0&
  lastIndex=1
{
 "phasingOnlyControls": [
  {
   "minDuration": 0,
   "votingModel": 0,
   "minBalance": "0",
   "accountRS": "ARDOR-AVGK-SKJZ-583G-A689A",
   "quorum": "2",
   "maxFees": "0",
   "whitelist": [
    {
     "whitelistedRS": "ARDOR-EVHD-5FLM-3NMQ-G46NR",
     "whitelisted": "16992224448242675179"
    },
    {
     "whitelistedRS": "ARDOR-XK4R-7VJU-6EQG-7R335",
     "whitelisted": "5873880488492319831"
    },
    {
     "whitelistedRS": "ARDOR-SZKV-J8TH-GSM9-9LKV6",
     "whitelisted": "8245583500397018683"
    }
   ],
   "minBalanceModel": 0,
   "account": "9519700060090428881",
   "maxDuration": 0
  },
  {
   "minDuration": 10,
   "votingModel": 0,
   "minBalance": "0",
   "accountRS": "ARDOR-VSTJ-MHZK-A6N3-CHRRH",
   "quorum": "1",
   "maxFees": "1000000000",
   "whitelist": [
    {
     "whitelistedRS": "ARDOR-D5A2-7CCE-G35P-BB324",
     "whitelisted": "10448396398360890624"
    },
    {
     "whitelistedRS": "ARDOR-KGPY-DF8U-HSF9-GQ69A",
     "whitelisted": "16437178058884561598"
    }
   ],
   "minBalanceModel": 0,
   "account": "12096369102442849072",
   "maxDuration": 100
  }
 ],
 "requestProcessingTime": 0
}

Get Phasing Only Control

Retrieve phasing control with their respective restrictions for a specific account. Javadoc

Request:

  • requestType is getPhasingOnlyControl
  • 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:

  • account (S) is the account number
  • accountRS (S) is the Reed-Solomon address of the account
  • quorum (S) is the minimum number of votes needed to approve the transaction
  • whitelist (A) is an array with the whitelisted accounts including the fields:
    • whitelisted (S) is the account number
    • whitelistedRS (S) is the Reed-Solomon address of the account
  • maxFees (S) is the maximum fees the account can spend per block
  • minDuration (N) is the minimum duration of the phasing period
  • maxDuration (N) is the maximum duration of the phasing period
  • votingModel (N) is an integer code for the method of approval
  • minBalance (S) is the minimum balance (in NQT or QNT) required for voting
  • minBalanceModel (N) is the minimum balance model
  • holding (S) is the asset or currency ID (only included if holding != 0)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Phasing Only Control Example

http://localhost:27876/nxt?
  requestType=getPhasingOnlyControl&
  account=ARDOR-AVGK-SKJZ-583G-A689A
{
 "minDuration": 0,
 "votingModel": 0,
 "minBalance": "0",
 "accountRS": "ARDOR-AVGK-SKJZ-583G-A689A",
 "quorum": "2",
 "maxFees": "0",
 "whitelist": [
  {
   "whitelistedRS": "ARDOR-EVHD-5FLM-3NMQ-G46NR",
   "whitelisted": "16992224448242675179"
  },
  {
   "whitelistedRS": "ARDOR-XK4R-7VJU-6EQG-7R335",
   "whitelisted": "5873880488492319831"
  },
  {
   "whitelistedRS": "ARDOR-SZKV-J8TH-GSM9-9LKV6",
   "whitelisted": "8245583500397018683"
  }
 ],
 "requestProcessingTime": 1,
 "minBalanceModel": 0,
 "account": "9519700060090428881",
 "maxDuration": 0
}

Lease Balance

Lease the entire guaranteed balance of ARDR to another account, after 1440 confirmations. POST only. Javadoc

Request: Refer to Create Transaction Request for common parameters.

  • requestType is leaseBalance
  • period is the lease period (in number of blocks, 1440 minimum)
  • recipient is the lessee (recipient) account
  • recipientPublicKey is the public key of the lessee (recipient) account (optional, enhances security of a new account)

Response: Refer to Create Transaction Response.

Lease Balance Example

http://localhost:27876/nxt?
  requestType=leaseBalance&
  period=1440&
  recipient=ARDOR-4VNQ-RWZC-4WWQ-GVM8S&
  secretPhrase=IWontTellYou&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "462590bb85b615ddd34d59a1ffdc452a9baee2088044c1b9eb44298e49158f35",
 "unsignedTransactionBytes": "04107977ce013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473b...",
 "transactionJSON": {
  "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
  "signature": "4a89702535246fd55bfc4b4691dc4266daa3100e00cdf0caaed57a5ad750da075a...",
  "feeNQT": "100000000",
  "type": 4,
  "fullHash": "251bcd86057c09bb2d055bbeeb9b67ccae861f75d4aada21b3b79a13db9712e1",
  "version": 1,
  "ecBlockId": "6565389899781382679",
  "signatureHash": "462590bb85b615ddd34d59a1ffdc452a9baee2088044c1b9eb44298e49158f35",
  "attachment": {
   "version.EffectiveBalanceLeasing": 1,
   "period": 1440
  },
  "senderRS": "ARDOR-L6FM-89WK-VK8P-FCRBB",
  "subtype": 0,
  "amountNQT": "0",
  "sender": "15323192282528158131",
  "recipientRS": "ARDOR-4VNQ-RWZC-4WWQ-GVM8S",
  "recipient": "17013046603665206934",
  "ecBlockHeight": 280672,
  "deadline": 60,
  "transaction": "13477439723061189413",
  "timestamp": 30308217,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 7340,
 "transactionBytes": "04107977ce013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473b...",
 "fullHash": "251bcd86057c09bb2d055bbeeb9b67ccae861f75d4aada21b3b79a13db9712e1",
 "transaction": "13477439723061189413"
}


Set Phasing Only Control

Sets (or removes) phasing control for a specific account. POST only. Javadoc

Request: Refer to Create Transaction Request for common parameters.

  • chain is reserved for 2, the Ignis child chain
  • requestType is setPhasingOnlyControl
  • controlVotingModel is the voting model or -1 to remove phasing control
  • controlQuorum is the expected quorum (optional)
  • controlMinBalance is the expected minimum balance (optional)
  • controlMinBalanceModel is the expected minimum balance model (optional)
  • controlHolding is the holding ID (optional)
  • controlWhitelisted is the whitelisted accounts (optional, multiple values)
  • controlWhitelisted is the whitelisted accounts (optional, multiple values)

  • controlMaxFees is the maximum allowed accumulated total fees for not yet finished phased transactions (optional)
  • controlMinDuration is the minimum duration in block height (optional)
  • controlMaxDuration is the maximum phasing duration in block height (optional)

Response: Refer to Create Transaction Response.

Set Phasing Only Control Example
http://localhost:27876/nxt?
 requestType=setPhasingOnlyControl&
 controlVotingModel=0&
 controlQuorum=1&
 controlWhitelisted=ARDOR-5MYN-AP7M-NKMH-CRQJZ&
 secretPhrase=IWontTellYou&
 feeNQT:100000000&
 deadline=60
{
 "signatureHash": "bbb24087ab3639f508da77413a63ed8c45431ec9b7f0413fd574faea0de7e70a",
 "transactionJSON": {
  "senderPublicKey": "373522bcd8904f4707472e590cbb67976d40e7af39650ea11cb2be5734cdf30c",
  "chain": 2,
  "signature": "eacaf3dc98c0e2ddc1b7b546209cecf092f16bb9e2fe9fd09760fb5815573f063...",
  "feeNQT": "100000000",
  "type": 4,
  "fullHash": "b6b7ac7a29f9f638244f1025c39199e8b5f8f7c5415f77ef0ca95c0f206e1e2d",
  "version": 1,
  "phased": false,
  "ecBlockId": "12092908062633562059",
  "signatureHash": "bbb24087ab3639f508da77413a63ed8c45431ec9b7f0413fd574faea0de7e70a",
  "attachment": {
   "version.SetPhasingOnly": 1,
   "controlMaxFees": "0",
   "controlMinDuration": 0,
   "controlMaxDuration": 0,
   "phasingControlParams": {
    "phasingHolding": "0",
    "phasingQuorum": 1,
    "phasingWhitelist": [
     "12664921794733526996"
    ],
    "phasingMinBalance": 0,
    "phasingMinBalanceModel": 0,
    "phasingVotingModel": 0
   }
  },
  "senderRS": "ARDOR-7A48-47JL-T7LD-D5FS3",
  "subtype": 1,
  "amountNQT": "0",
  "sender": "12745647715474645062",
  "ecBlockHeight": 767270,
  "deadline": 60,
  "transaction": "4104742066941900726",
  "timestamp": 80779288,
  "height": 2147483647
 },
 "unsignedTransactionBytes": "04111898d0043c00373522bcd8904f4707472e590cbb67976d40e7af39650ea...",
 "broadcasted": true,
 "requestProcessingTime": 5,
 "transactionBytes": "04111898d0043c00373522bcd8904f4707472e590cbb67976d40e7af39650ea1...",
 "fullHash": "b6b7ac7a29f9f638244f1025c39199e8b5f8f7c5415f77ef0ca95c0f206e1e2d",
 "transaction": "4104742066941900726"
}