BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
ticket.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Abit More, and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #pragma once
27 
28 #include <fc/optional.hpp>
29 
30 namespace graphene { namespace protocol {
31 
34  {
35  liquid = 0,
41  };
42 
48  {
49  struct fee_params_t { uint64_t fee = 50 * GRAPHENE_BLOCKCHAIN_PRECISION; };
50 
52  account_id_type account;
55 
57 
58  account_id_type fee_payer()const { return account; }
59  void validate()const;
60  };
61 
67  {
68  struct fee_params_t { uint64_t fee = 50 * GRAPHENE_BLOCKCHAIN_PRECISION; };
69 
71  ticket_id_type ticket;
72  account_id_type account;
75 
77 
78  account_id_type fee_payer()const { return account; }
79  void validate()const;
80  };
81 
82 } } // graphene::protocol
83 
86 
89 
91  (fee)(account)(target_type)(amount)(extensions) )
93  (fee)(ticket)(account)(target_type)(amount_for_new_target)(extensions) )
94 
97 
graphene::protocol::lock_720_days
@ lock_720_days
Definition: ticket.hpp:38
graphene::protocol::ticket_create_operation
Creates a new ticket.
Definition: ticket.hpp:47
graphene::protocol::ticket_update_operation::ticket
ticket_id_type ticket
The ticket to update.
Definition: ticket.hpp:71
graphene::protocol::liquid
@ liquid
Definition: ticket.hpp:35
graphene::protocol::ticket_update_operation::fee_params_t::fee
uint64_t fee
Definition: ticket.hpp:68
graphene::protocol::ticket_update_operation::amount_for_new_target
optional< asset > amount_for_new_target
The amount to be used for the new target.
Definition: ticket.hpp:74
graphene::protocol::ticket_type
ticket_type
Type of a ticket.
Definition: ticket.hpp:33
graphene::protocol::lock_360_days
@ lock_360_days
Definition: ticket.hpp:37
graphene::protocol::ticket_update_operation::fee
asset fee
Operation fee.
Definition: ticket.hpp:70
graphene::protocol::ticket_create_operation::target_type
unsigned_int target_type
The target ticket type, see ticket_type.
Definition: ticket.hpp:53
graphene::protocol::base_operation
Definition: base.hpp:124
graphene::protocol::ticket_update_operation::account
account_id_type account
The account who owns the ticket.
Definition: ticket.hpp:72
graphene::protocol::TICKET_TYPE_COUNT
@ TICKET_TYPE_COUNT
Definition: ticket.hpp:40
graphene::protocol::ticket_create_operation::fee_params_t
Definition: ticket.hpp:49
GRAPHENE_BLOCKCHAIN_PRECISION
#define GRAPHENE_BLOCKCHAIN_PRECISION
Definition: config.hpp:29
graphene::protocol::ticket_update_operation::fee_payer
account_id_type fee_payer() const
Definition: ticket.hpp:78
fc::unsigned_int
Definition: varint.hpp:6
graphene::protocol::ticket_update_operation
Updates an existing ticket.
Definition: ticket.hpp:66
graphene::protocol::ticket_create_operation::fee
asset fee
Operation fee.
Definition: ticket.hpp:51
GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:85
graphene::protocol::ticket_update_operation::fee_params_t
Definition: ticket.hpp:68
graphene::protocol::ticket_create_operation::validate
void validate() const
Definition: ticket.cpp:30
graphene::protocol::ticket_update_operation::target_type
unsigned_int target_type
New target ticket type, see ticket_type.
Definition: ticket.hpp:73
graphene::protocol::ticket_update_operation::extensions
extensions_type extensions
Unused. Reserved for future use.
Definition: ticket.hpp:76
graphene::protocol::ticket_create_operation::extensions
extensions_type extensions
Unused. Reserved for future use.
Definition: ticket.hpp:56
FC_REFLECT_ENUM
FC_REFLECT_ENUM(graphene::net::core_message_type_enum,(trx_message_type)(block_message_type)(core_message_type_first)(item_ids_inventory_message_type)(blockchain_item_ids_inventory_message_type)(fetch_blockchain_item_ids_message_type)(fetch_items_message_type)(item_not_available_message_type)(hello_message_type)(connection_accepted_message_type)(connection_rejected_message_type)(address_request_message_type)(address_message_type)(closing_connection_message_type)(current_time_request_message_type)(current_time_reply_message_type)(check_firewall_message_type)(check_firewall_reply_message_type)(get_current_connections_request_message_type)(get_current_connections_reply_message_type)(core_message_type_last))(different_chain)(already_connected)(connected_to_self)(not_accepting_connections)(blocked)(invalid_hello_message)(client_too_old))(inbound)(outbound))(firewalled)(not_firewalled))(unable_to_connect)(connection_successful)) namespace std
Definition: core_messages.hpp:404
base.hpp
graphene::protocol::ticket_create_operation::fee_params_t::fee
uint64_t fee
Definition: ticket.hpp:49
graphene::protocol::ticket_create_operation::fee_payer
account_id_type fee_payer() const
Definition: ticket.hpp:58
graphene::protocol::ticket_create_operation::account
account_id_type account
The account who creates the ticket.
Definition: ticket.hpp:52
graphene::protocol::ticket_create_operation::amount
asset amount
The amount of the ticket.
Definition: ticket.hpp:54
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::protocol::ticket_update_operation::validate
void validate() const
Definition: ticket.cpp:39
graphene::protocol::asset
Definition: asset.hpp:31
asset.hpp
graphene::protocol::lock_forever
@ lock_forever
Definition: ticket.hpp:39
graphene::protocol::lock_180_days
@ lock_180_days
Definition: ticket.hpp:36
graphene
Definition: api.cpp:48
graphene::protocol::extensions_type
future_extensions::flat_set_type extensions_type
Definition: base.hpp:156
optional.hpp