BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
market_evaluator.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cryptonomex, Inc., 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
26 #include <graphene/chain/types.hpp>
27 
28 namespace graphene { namespace chain {
29 
30  class account_object;
31  class asset_object;
32  class asset_bitasset_data_object;
33  class call_order_object;
34  class limit_order_object;
35  class collateral_bid_object;
36 
37  class limit_order_create_evaluator : public evaluator<limit_order_create_evaluator>
38  {
39  public:
41 
44 
47  virtual void convert_fee() override;
48 
52  virtual void pay_fee() override;
53 
57  const account_object* _seller = nullptr;
58  const asset_object* _sell_asset = nullptr;
59  const asset_object* _receive_asset = nullptr;
60  };
61 
62  class limit_order_cancel_evaluator : public evaluator<limit_order_cancel_evaluator>
63  {
64  public:
66 
69 
71  };
72 
73  class call_order_update_evaluator : public evaluator<call_order_update_evaluator>
74  {
75  public:
77 
80 
81  bool _closing_order = false;
82  const asset_object* _debt_asset = nullptr;
83  const account_object* _paying_account = nullptr;
84  const call_order_object* _order = nullptr;
85  const asset_bitasset_data_object* _bitasset_data = nullptr;
86  const asset_dynamic_data_object* _dynamic_data_obj = nullptr;
87  };
88 
89  class bid_collateral_evaluator : public evaluator<bid_collateral_evaluator>
90  {
91  public:
93 
96 
97  const asset_object* _debt_asset = nullptr;
98  const asset_bitasset_data_object* _bitasset_data = nullptr;
99  const account_object* _paying_account = nullptr;
100  const collateral_bid_object* _bid = nullptr;
101  };
102 
103 } } // graphene::chain
contains properties that only apply to bitassets (market issued assets)
This class represents an account on the object graphAccounts are the primary unit of authority on the...
Definition: api.cpp:56
tracks debt and call price information
void_result do_evaluate(const limit_order_create_operation &o)
instructs the blockchain to attempt to sell one asset for anotherThe blockchain will atempt to sell a...
Definition: market.hpp:48
tracks the asset information that changes frequentlyBecause the asset_object is very large it doesn&#39;t...
bids of collateral for debt after a black swan
tracks the parameters of an assetAll assets have a globally unique symbol name that controls how they...
const limit_order_create_operation * _op
object_id_type do_apply(const limit_order_create_operation &o)
an offer to sell a amount of a asset at a specified exchange rate by a certain timeThis limit_order_o...