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 "Amount.h"
10
#include "Script.h"
11

12
#include <memory>
13

14
namespace TW::Bitcoin {
15

16
/// Bitcoin transaction output.
17 1
struct TransactionOutput {
18
    /// Transaction amount.
19
    Amount value;
20

21
    /// Usually contains the public key as a Bitcoin script setting up
22
    /// conditions to claim this output.
23
    Script script;
24

25
    /// Initializes an empty transaction output.
26
    TransactionOutput() = default;
27

28
    /// Initializes a transaction output with a value and a script.
29 1
    TransactionOutput(Amount value, Script script) : value(value), script(std::move(script)) {}
30

31
    /// Encodes the output into the provided buffer.
32
    void encode(std::vector<uint8_t>& data) const;
33
};
34

35
} // namespace TW::Bitcoin
36

37
/// Wrapper for C interface.
38
struct TWBitcoinTransactionOutput {
39
    TW::Bitcoin::TransactionOutput impl;
40
};

Read our documentation on viewing source code .

Loading