forked from deqode/dq-vault
-
Notifications
You must be signed in to change notification settings - Fork 1
/
payload.go
43 lines (38 loc) · 1.18 KB
/
payload.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
40
41
42
43
package lib
import "math/big"
// IRawTx Raw transaction interface
// to enable decoding of all variants of raw transactions (JSON)
type IRawTx interface{}
// EthereumRawTx Ethereum raw transaction implements IRawTx
// to store raw Ethereum JSON payload
type EthereumRawTx struct {
Nonce uint64 `json:"nonce"`
Value *big.Int `json:"value"`
GasLimit uint64 `json:"gasLimit"`
GasPrice *big.Int `json:"gasPrice"`
To string `json:"to"`
Data string `json:"data"`
ChainID *big.Int `json:"chainId"`
IRawTx
}
// BitcoinRawTx stores bitcoin based raw transaction payloads
// stores input UTXO's and output Addresses
// implements IRawTx
type BitcoinRawTx struct {
Inputs []struct {
Txhash string `json:"txhash"`
Vout uint32 `json:"vout"`
} `json:"inputs"`
Outputs []struct {
Address string `json:"address"`
Amount int64 `json:"amount"`
} `json:"outputs"`
IRawTx
}
// BitsharesRawTx Ethereum raw transaction implements IRawTx
// to store raw Bitshares JSON payload
// Bitshares' Payload will only have a hex encoded string that would represent the transaction digest.
type BitsharesRawTx struct {
TransactionDigest string `json:"transactionDigest"`
IRawTx
}