-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmodels.go
More file actions
44 lines (35 loc) · 1.35 KB
/
models.go
File metadata and controls
44 lines (35 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package txbuilder
import (
"github.com/tokenized/pkg/bitcoin"
"github.com/tokenized/pkg/wire"
)
// InputSupplement contains data required to sign an input that is not already in the wire.MsgTx.
type InputSupplement struct {
LockingScript bitcoin.Script `json:"locking_script"`
Value uint64 `json:"value"`
// Optional identifier for external use to track the key needed to sign the input.
KeyID string `json:"key_id,omitempty"`
}
// AddressKeyID is an address and a key ID.
type AddressKeyID struct {
Address bitcoin.RawAddress
KeyID string
}
// OutputSupplement contains data that is not contained in a tx message, but that is needed to
// perform operations on the tx, like fee and change calculation.
type OutputSupplement struct {
// Used when calculating fees to put remaining input value in.
IsRemainder bool `json:"is_remainder"`
// Used as a notification payment, but if value is added, then the previous dust amount isn't
// added to the new amount.
IsDust bool `json:"is_dust"`
// This output was added by the fee calculation and can be removed by the fee calculation.
addedForFee bool
// Optional identifier for external use to track the key needed to spend.
KeyID string `json:"key_id,omitempty"`
}
// Output is all of the data required for a txbuilder output.
type Output struct {
wire.TxOut
Supplement OutputSupplement
}