forked from multiversx/mx-bridge-eth-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransactions.go
More file actions
90 lines (76 loc) · 2.94 KB
/
transactions.go
File metadata and controls
90 lines (76 loc) · 2.94 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package models
import (
"github.com/klever-io/klever-go/data/transaction"
idata "github.com/klever-io/klever-go/indexer/data"
)
// TxHashes represents a colection of hashs of each transaction returned by a SendBulkTransactions
type TxHashes struct {
Hashes []string `json:"txHashes"`
}
// SendBulkTransactionsResponse defines the structure of responses on SendBulkTransactions API endpoint
type SendBulkTransactionsResponse struct {
Data TxHashes `json:"data"`
Error string `json:"error"`
Code string `json:"code"`
}
// SendTransactionData holds the data of a transaction sent to the network
type SendTransactionData struct {
TxHash string `json:"txHash"`
TxCount int `json:"txCount"`
}
// SendTransactionResponse holds the response received from the network when broadcasting a transaction
type SendTransactionResponse struct {
Data *SendTransactionData `json:"data"`
Error string `json:"error"`
Code string `json:"code"`
}
// EstimateTransactionFeesResponse defines the structure of responses on EstimateTransactionFees API endpoint
type EstimateTransactionFeesResponse struct {
Data *transaction.FeesResponse `json:"data"`
Error string `json:"error"`
Code string `json:"code"`
}
// KDAFungibleResponse holds the KDA (fungible) token data endpoint response
type KDAFungibleResponse struct {
Data struct {
TokenData *KDAFungibleTokenData `json:"tokenData"`
} `json:"data"`
Error string `json:"error"`
Code string `json:"code"`
}
// KDAFungibleTokenData holds the KDA (fungible) token data definition
type KDAFungibleTokenData struct {
TokenIdentifier string `json:"tokenIdentifier"`
Balance string `json:"balance"`
Properties string `json:"properties"`
}
// TransactionData represents the structure that maps and validates user input for publishing a new transaction
type TransactionData struct {
*idata.Transaction
}
// GetTransactionResponseData follows the format of the data field of get transaction response
type GetTransactionResponseData struct {
Transaction TransactionData `json:"transaction"`
}
// GetTransactionResponse defines a response from the node holding the transaction sent from the chain
type GetTransactionResponse struct {
Data GetTransactionResponseData `json:"data"`
Error string `json:"error"`
Code string `json:"code"`
}
// TransactionStatus holds a transaction's status response from the network
type TransactionStatus struct {
Data struct {
Status string `json:"status"`
} `json:"data"`
Error string `json:"error"`
Code string `json:"code"`
}
// BroadcastTransactionData holds a transaction which is used to request a broadcast
type BroadcastTransactionData struct {
Tx *transaction.Transaction `json:"tx"`
}
// BroadcastBulkTransactionData holds bulk transactions which are used to request a broadcast
type BroadcastBulkTransactionData struct {
Txs []*transaction.Transaction `json:"txs"`
}