ticket
This module allows you to purchase validator and host tickets that allow you to participate in network consensus operations. Ticket purchasing functions can be accessed from the global variable named ticket
.
buy
Send a transaction to purchase a validator ticket.
Parameters
txObject
-Object
: The transaction objectvalue
-String
: The amount of coins to pay for the ticket.delegate
-String
: Delegate the ticket to another validator by providing their base58 encoded public key.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
Create a transaction to purchase a ticket worth 1000 units.
host.buy
Send a transaction to purchase a host ticket.
Parameters
txObject
-Object
: The transaction objectvalue
-String
: The amount of coins to pay for the ticket.delegate
-String
: Delegate the ticket to another host by providing their base58 encoded public key.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
Create a transaction to purchase a host ticket for 1000 coins.
list
Get validator tickets belonging to a proposer.
Parameters
proposer
-String
: The base58 encoded public key of the proposer.queryopts
-Object
: The query optionsexpired
-Boolean
: When true, only decayed tickets will be returned.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
host.list
Get validator tickets belonging to a proposer.
Parameters
proposer
-String
: The base58 encoded public key of the proposer.queryopts
-Object
: The query options
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
Last updated