1
// Copyright © 2017-2020 Trust Wallet.
2
//
3
// This file is part of Trust. The full Trust copyright notice, including
4
// terms governing use, modification, and redistribution, is contained in the
5
// file LICENSE at the root of the source code distribution tree.
6

7
#pragma once
8

9
#include "Address.h"
10
#include "../Data.h"
11
#include "../proto/Waves.pb.h"
12
#include <nlohmann/json.hpp>
13

14
namespace TW::Waves {
15

16
enum class TransactionType { transfer = 4, lease = 8, cancelLease = 9 };
17
enum class TransactionVersion { V1 = 1, V2 = 2 };
18

19 1
class Transaction {
20
    /// We only support Transfer V2 transaction.
21
    /// See
22
    /// https://docs.wavesplatform.com/en/blockchain/waves-protocol/data-structures.html#section-8555a9aaf83a8d01f18a2c38d19484fe
23
  public:
24
    static const std::string WAVES;
25
    const Proto::SigningInput& input;
26
    const Data pub_key;
27
    
28 1
    Transaction(const Proto::SigningInput& input, const Data pub_key) : input(input), pub_key(std::move(pub_key)) {};
29

30
  public:
31
    Data serializeToSign() const;
32
    nlohmann::json buildJson(const Data& signature) const;
33
};
34

35
} // namespace TW::Waves

Read our documentation on viewing source code .

Loading