ledger-core
Operation.h
1 
2 /*
3  *
4  * Operation
5  * ledger-core
6  *
7  * Created by Pierre Pollastri on 07/06/2017.
8  *
9  * The MIT License (MIT)
10  *
11  * Copyright (c) 2016 Ledger
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a copy
14  * of this software and associated documentation files (the "Software"), to deal
15  * in the Software without restriction, including without limitation the rights
16  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17  * copies of the Software, and to permit persons to whom the Software is
18  * furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in all
21  * copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29  * SOFTWARE.
30  *
31  */
32 #ifndef LEDGER_CORE_OPERATION_H
33 #define LEDGER_CORE_OPERATION_H
34 
35 #include <string>
36 #include <api/WalletType.hpp>
37 #include <chrono>
38 #include <vector>
39 #include <math/BigInt.h>
40 #include <utils/Option.hpp>
41 #include "TrustIndicator.h"
42 #include <memory>
43 #include <wallet/bitcoin/explorers/BitcoinLikeBlockchainExplorer.hpp>
44 #include <wallet/ethereum/explorers/EthereumLikeBlockchainExplorer.h>
45 #include <wallet/ripple/explorers/RippleLikeBlockchainExplorer.h>
46 #include <wallet/tezos/explorers/TezosLikeBlockchainExplorer.h>
47 #include <api/OperationType.hpp>
48 #include <api/Operation.hpp>
49 #include "Block.h"
50 
51 namespace ledger {
52  namespace core {
53  struct Operation {
54  std::string uid;
55  std::string accountUid;
56  std::string walletUid;
57  api::WalletType walletType;
58  std::chrono::system_clock::time_point date;
59  std::vector<std::string> senders;
60  std::vector<std::string> recipients;
61  BigInt amount;
62  Option<BigInt> fees;
63  Option<Block> block;
64  std::string currencyName;
65  api::OperationType type;
66  std::shared_ptr<TrustIndicator> trust;
71 
72  void refreshUid(const std::string &additional = "");
73 
74  Operation() = default;
75  Operation(Operation const&) = default;
76 
77  Operation(Operation&&) = default;
78 
79  Operation& operator=(Operation const&) = default;
80  Operation& operator=(Operation&&) = default;
81  };
82  }
83 }
84 
85 #endif //LEDGER_CORE_OPERATION_H
Definition: Option.hpp:49
Definition: Operation.h:53
Definition: Account.cpp:8
WalletType
Definition: WalletType.hpp:20
Definition: BigInt.h:56