/
api.proto
209 lines (173 loc) · 4.23 KB
/
api.proto
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
syntax = "proto3";
package pb;
import "google/protobuf/timestamp.proto";
service API {
rpc Stop (Empty) returns (Empty) {}
rpc CurrentAddress (KeySelection) returns (Address) {}
rpc NewAddress (KeySelection) returns (Address) {}
rpc ChainTip (CoinSelection) returns (Height) {}
rpc Balance (CoinSelection) returns (Balances) {}
rpc MasterPrivateKey (CoinSelection) returns (Key) {}
rpc MasterPublicKey (CoinSelection) returns (Key) {}
rpc HasKey (Address) returns (BoolResponse) {}
rpc Params (Empty) returns (NetParams) {}
rpc Transactions (CoinSelection) returns (TransactionList) {}
rpc GetTransaction (Txid) returns (Tx) {}
rpc GetFeePerByte (FeeLevelSelection) returns (FeePerByte) {}
rpc Spend (SpendInfo) returns (Txid) {}
rpc BumpFee (Txid) returns (Txid) {}
rpc AddWatchedScript (Address) returns (Empty) {}
rpc GetConfirmations (Txid) returns (Confirmations) {}
rpc SweepAddress (SweepInfo) returns (Txid) {}
rpc CreateMultisigSignature (CreateMultisigInfo) returns (SignatureList) {}
rpc Multisign (MultisignInfo) returns (RawTx) {}
rpc EstimateFee (EstimateFeeData) returns (Fee) {}
rpc GetKey (Address) returns (Key) {}
rpc ListKeys (CoinSelection) returns (Keys) {}
rpc ListAddresses (CoinSelection) returns (Addresses) {}
rpc WalletNotify (CoinSelection) returns (stream Tx) {}
rpc DumpTables (CoinSelection) returns (stream Row) {}
}
enum CoinType {
BITCOIN = 0;
BITCOIN_CASH = 1;
ZCASH = 2;
LITECOIN = 3;
ETHEREUM = 4;
}
message Empty {}
message CoinSelection {
CoinType coin = 1;
}
enum KeyPurpose {
INTERNAL = 0;
EXTERNAL = 1;
}
message Row {
string data = 1;
}
message KeySelection {
CoinType coin = 1;
KeyPurpose purpose = 2;
}
message Address {
CoinType coin = 1;
string addr = 2;
}
message Height {
uint32 height = 1;
}
message Balances {
uint64 confirmed = 1;
uint64 unconfirmed = 2;
}
message Key {
string key = 1;
}
message Keys {
repeated Key keys = 1;
}
message Addresses {
repeated Address addresses = 1;
}
message BoolResponse {
bool bool = 1;
}
message NetParams {
string name = 1;
}
message TransactionList {
repeated Tx transactions = 1;
}
message Tx {
string txid = 1;
int64 value = 2;
int32 height = 3;
google.protobuf.Timestamp timestamp = 4;
bool watchOnly = 5;
bytes raw = 6;
}
message Txid {
CoinType coin = 1;
string hash = 2;
}
enum FeeLevel {
ECONOMIC = 0;
NORMAL = 1;
PRIORITY = 2;
}
message FeeLevelSelection {
CoinType coin = 1;
FeeLevel feeLevel = 2;
}
message FeePerByte {
uint64 fee = 1;
}
message Fee {
uint64 fee = 1;
}
message SpendInfo {
CoinType coin = 1;
string address = 2;
uint64 amount = 3;
FeeLevel feeLevel = 4;
string memo = 5;
}
message Confirmations {
uint32 confirmations = 1;
}
message Utxo {
string txid = 1;
uint32 index = 2;
uint64 value = 3;
}
message SweepInfo {
CoinType coin = 1;
repeated Utxo utxos = 2;
string address = 3;
string key = 4;
bytes redeemScript = 5;
FeeLevel feeLevel = 6;
}
message Input {
string txid = 1;
uint32 index = 2;
}
message Output {
bytes scriptPubKey = 1;
uint64 value = 2;
}
message Signature {
uint32 index = 1;
bytes signature = 2;
}
message CreateMultisigInfo {
CoinType coin = 1;
repeated Input inputs = 2;
repeated Output outputs = 3;
string key = 4;
bytes redeemScript = 5;
uint64 feePerByte = 6;
}
message SignatureList {
repeated Signature sigs = 1;
}
message MultisignInfo {
CoinType coin = 1;
repeated Input inputs = 2;
repeated Output outputs = 3;
repeated Signature sig1 = 4;
repeated Signature sig2 = 5;
bytes redeemScript = 6;
uint64 feePerByte = 7;
bool broadcast = 8;
}
message RawTx {
bytes tx = 1;
}
message EstimateFeeData {
CoinType coin = 1;
repeated Input inputs = 2;
repeated Output outputs = 3;
uint64 feePerByte = 4;
}