-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
67 lines (58 loc) · 1.78 KB
/
types.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package clefclient
import (
"encoding/json"
)
// Transaction represents an Ethereum transaction
type Transaction struct {
From string `json:"from"`
To string `json:"to"`
Gas string `json:"gas,omitempty"`
GasPrice string `json:"gasPrice,omitempty"`
Value string `json:"value,omitempty"`
Nonce string `json:"nonce,omitempty"`
Data string `json:"data,omitempty"`
}
// SignDataRequest represents the parameters for signing data
type SignDataRequest struct {
Address string `json:"address"`
Data string `json:"data"`
}
// TypedDataRequest represents the parameters for signing typed data
type TypedDataRequest struct {
Address string `json:"address"`
TypedData json.RawMessage `json:"data"`
RawVersion string `json:"raw_version,omitempty"`
}
// SignTxResponse represents the response from signing a transaction
type SignTxResponse struct {
Raw string `json:"raw"`
Tx struct {
Nonce string `json:"nonce"`
GasPrice string `json:"gasPrice"`
Gas string `json:"gas"`
To string `json:"to"`
Value string `json:"value"`
Input string `json:"input"`
V string `json:"v"`
R string `json:"r"`
S string `json:"s"`
Hash string `json:"hash"`
} `json:"tx"`
}
// SignDataResponse represents the response from signing data
type SignDataResponse struct {
Signature string `json:"signature"`
}
// VersionResponse represents the response from version query
type VersionResponse struct {
Version string `json:"version"`
}
// EcRecoverRequest represents the parameters for ecRecover
type EcRecoverRequest struct {
Data string `json:"data"`
Signature string `json:"sig"`
}
// EcRecoverResponse represents the response from ecRecover
type EcRecoverResponse struct {
Address string `json:"address"`
}