This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
generated from mrz1836/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransaction.go
39 lines (37 loc) · 1.51 KB
/
transaction.go
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
package buxmodels
import "github.com/BuxOrg/bux-models/common"
// Transaction is a model that represents a transaction.
type Transaction struct {
// Model is a common model that contains common fields for all models.
common.Model
// ID is a transaction id.
ID string `json:"id"`
// Hex is a transaction hex.
Hex string `json:"hex"`
// XpubInIDs is a slice of xpub input ids.
XpubInIDs []string `json:"xpub_in_ids"`
// XpubOutIDs is a slice of xpub output ids.
XpubOutIDs []string `json:"xpub_out_ids"`
// BlockHash is a block hash that transaction is in.
BlockHash string `json:"block_hash"`
// BlockHeight is a block height that transaction is in.
BlockHeight uint64 `json:"block_height"`
// Fee is a transaction fee.
Fee uint64 `json:"fee"`
// NumberOfInputs is a number of transaction inputs.
NumberOfInputs uint32 `json:"number_of_inputs"`
// NumberOfOutputs is a number of transaction outputs.
NumberOfOutputs uint32 `json:"number_of_outputs"`
// DraftID is a transaction related draft id.
DraftID string `json:"draft_id"`
// TotalValue is a total input value.
TotalValue uint64 `json:"total_value"`
// OutputValue is a total output value.
OutputValue int64 `json:"output_value,omitempty"`
// Outputs represents all bux-transaction outputs. Will be shown only for admin.
Outputs map[string]int64 `json:"outputs,omitempty"`
// Status is a transaction status.
Status string `json:"status"`
// TransactionDirection is a transaction direction (inbound/outbound).
TransactionDirection string `json:"direction"`
}