Skip to content

Commit f5f43f8

Browse files
committed
feat: delete useless api and add get url binding.
1 parent 049f8fa commit f5f43f8

File tree

1 file changed

+97
-35
lines changed

1 file changed

+97
-35
lines changed

api/api.proto

Lines changed: 97 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,18 @@ service Wallet {
2626
option (google.api.http) = {
2727
post: "/wallet/createtransaction"
2828
body: "*"
29+
additional_bindings {
30+
get: "/wallet/createtransaction"
31+
}
2932
};
3033
};
3134

3235
rpc BroadcastTransaction (Transaction) returns (Return) {
3336
option (google.api.http) = {
3437
post: "/wallet/broadcasttransaction"
3538
body: "*"
36-
};
37-
};
38-
39-
rpc ListAccounts (EmptyMessage) returns (AccountList) {
40-
option (google.api.http) = {
41-
post: "/wallet/listaccount"
42-
body: "*"
4339
additional_bindings {
44-
get: "/wallet/listaccount"
40+
get: "/wallet/broadcasttransaction"
4541
}
4642
};
4743
};
@@ -50,29 +46,28 @@ service Wallet {
5046
option (google.api.http) = {
5147
post: "/wallet/updateaccount"
5248
body: "*"
49+
additional_bindings {
50+
get: "/wallet/updateaccount"
51+
}
5352
};
5453
};
5554

5655
rpc VoteWitnessAccount (VoteWitnessContract) returns (Transaction) {
5756
option (google.api.http) = {
5857
post: "/wallet/votewitnessaccount"
5958
body: "*"
59+
additional_bindings {
60+
get: "/wallet/votewitnessaccount"
61+
}
6062
};
6163
};
6264

6365
rpc CreateAssetIssue (AssetIssueContract) returns (Transaction) {
6466
option (google.api.http) = {
6567
post: "/wallet/createassetissue"
6668
body: "*"
67-
};
68-
};
69-
70-
rpc ListWitnesses (EmptyMessage) returns (WitnessList) {
71-
option (google.api.http) = {
72-
post: "/wallet/listwitnesses"
73-
body: "*"
7469
additional_bindings {
75-
get: "/wallet/listwitnesses"
70+
get: "/wallet/createassetissue"
7671
}
7772
};
7873
};
@@ -81,55 +76,79 @@ service Wallet {
8176
option (google.api.http) = {
8277
post: "/wallet/updatewitness"
8378
body: "*"
79+
additional_bindings {
80+
get: "/wallet/updatewitness"
81+
}
8482
};
8583
};
8684

8785
rpc CreateWitness (WitnessCreateContract) returns (Transaction) {
8886
option (google.api.http) = {
8987
post: "/wallet/createwitness"
9088
body: "*"
89+
additional_bindings {
90+
get: "/wallet/createwitness"
91+
}
9192
};
9293
};
9394

9495
rpc TransferAsset (TransferAssetContract) returns (Transaction) {
9596
option (google.api.http) = {
9697
post: "/wallet/transferasset"
9798
body: "*"
99+
additional_bindings {
100+
get: "/wallet/transferasset"
101+
}
98102
};
99103
}
100104

101105
rpc ParticipateAssetIssue (ParticipateAssetIssueContract) returns (Transaction) {
102106
option (google.api.http) = {
103107
post: "/wallet/participateassetissue"
104108
body: "*"
109+
additional_bindings {
110+
get: "/wallet/participateassetissue"
111+
}
105112
};
106113
}
107114

108115
rpc FreezeBalance (FreezeBalanceContract) returns (Transaction) {
109116
option (google.api.http) = {
110117
post: "/wallet/freezebalance"
111118
body: "*"
119+
additional_bindings {
120+
get: "/wallet/freezebalance"
121+
}
112122
};
113123
}
114124

115125
rpc UnfreezeBalance (UnfreezeBalanceContract) returns (Transaction) {
116126
option (google.api.http) = {
117127
post: "/wallet/unfreezebalance"
118128
body: "*"
129+
additional_bindings {
130+
get: "/wallet/unfreezebalance"
131+
}
119132
};
120133
}
121134

122135
rpc UnfreezeAsset (UnfreezeAssetContract) returns (Transaction) {
123136
option (google.api.http) = {
124137
post: "/wallet/unfreezeasset"
125138
body: "*"
139+
additional_bindings {
140+
get: "/wallet/unfreezeasset"
141+
}
126142
};
127143
}
128144

129145
rpc WithdrawBalance (WithdrawBalanceContract) returns (Transaction) {
130146
option (google.api.http) = {
131147
post: "/wallet/withdrawbalance"
132148
body: "*"
149+
additional_bindings {
150+
get: "/wallet/withdrawbalance"
151+
}
133152
};
134153
}
135154

@@ -142,25 +161,23 @@ service Wallet {
142161
}
143162
};
144163
}
145-
rpc GetAssetIssueList (EmptyMessage) returns (AssetIssueList) {
146-
option (google.api.http) = {
147-
post: "/wallet/getassetissuelist"
148-
body: "*"
149-
additional_bindings {
150-
get: "/wallet/getassetissuelist"
151-
}
152-
};
153-
}
164+
154165
rpc GetAssetIssueByAccount (Account) returns (AssetIssueList) {
155166
option (google.api.http) = {
156167
post: "/wallet/getassetissuebyaccount"
157168
body: "*"
169+
additional_bindings {
170+
get: "/wallet/getassetissuebyaccount"
171+
}
158172
};
159173
}
160174
rpc GetAssetIssueByName (BytesMessage) returns (AssetIssueContract) {
161175
option (google.api.http) = {
162176
post: "/wallet/getassetissuebyname"
163177
body: "*"
178+
additional_bindings {
179+
get: "/wallet/getassetissuebyname"
180+
}
164181
};
165182
}
166183
rpc GetNowBlock (EmptyMessage) returns (Block) {
@@ -181,37 +198,41 @@ service Wallet {
181198
}
182199
};
183200
}
184-
rpc TotalTransaction (EmptyMessage) returns (NumberMessage) {
185-
option (google.api.http) = {
186-
post: "/wallet/totaltransaction"
187-
body: "*"
188-
additional_bindings {
189-
get: "/wallet/totaltransaction"
190-
}
191-
};
192-
}
201+
193202
rpc GetBlockById (BytesMessage) returns (Block) {
194203
option (google.api.http) = {
195204
post: "/wallet/getblockbyid"
196205
body: "*"
206+
additional_bindings {
207+
get: "/wallet/getblockbyid"
208+
}
197209
};
198210
}
199211
rpc GetBlockByLimitNext (BlockLimit) returns (BlockList) {
200212
option (google.api.http) = {
201213
post: "/wallet/getblockbylimitnext"
202214
body: "*"
215+
additional_bindings {
216+
get: "/wallet/getblockbylimitnext"
217+
}
203218
};
204219
}
205220
rpc GetBlockByLatestNum (NumberMessage) returns (BlockList) {
206221
option (google.api.http) = {
207222
post: "/wallet/getblockbylatestnum"
208223
body: "*"
224+
additional_bindings {
225+
get: "/wallet/getblockbylatestnum"
226+
}
209227
};
210228
}
211229
rpc GetTransactionById (BytesMessage) returns (Transaction) {
212230
option (google.api.http) = {
213231
post: "/wallet/gettransactionbyid"
214232
body: "*"
233+
additional_bindings {
234+
get: "/wallet/gettransactionbyid"
235+
}
215236
};
216237
}
217238
};
@@ -223,87 +244,129 @@ service WalletSolidity {
223244
option (google.api.http) = {
224245
post: "/walletsolidity/getaccount"
225246
body: "*"
247+
additional_bindings {
248+
get: "/walletsolidity/getaccount"
249+
}
226250
};
227251
};
228252

229253
rpc ListAccounts (EmptyMessage) returns (AccountList) {
230254
option (google.api.http) = {
231255
post: "/walletsolidity/listaccounts"
232256
body: "*"
257+
additional_bindings {
258+
get: "/walletsolidity/listaccounts"
259+
}
233260
};
234261
};
235262

236263
rpc ListWitnesses (EmptyMessage) returns (WitnessList) {
237264
option (google.api.http) = {
238265
post: "/walletsolidity/listwitnesses"
239266
body: "*"
267+
additional_bindings {
268+
get: "/walletsolidity/listwitnesses"
269+
}
240270
};
241271
};
242272
rpc GetAssetIssueList (EmptyMessage) returns (AssetIssueList) {
243273
option (google.api.http) = {
244274
post: "/walletsolidity/getassetissuelist"
245275
body: "*"
276+
additional_bindings {
277+
get: "/walletsolidity/getassetissuelist"
278+
}
246279
};
247280
}
248281
rpc GetAssetIssueListByTimestamp (NumberMessage) returns (AssetIssueList) {
249282
option (google.api.http) = {
250283
post: "/walletsolidity/getassetissuelistbytimestamp"
251284
body: "*"
285+
additional_bindings {
286+
get: "/walletsolidity/getassetissuelistbytimestamp"
287+
}
252288
};
253289
}
254290
rpc GetAssetIssueByAccount (Account) returns (AssetIssueList) {
255291
option (google.api.http) = {
256292
post: "/walletsolidity/getassetissuebyaccount"
257293
body: "*"
294+
additional_bindings {
295+
get: "/walletsolidity/getassetissuebyaccount"
296+
}
258297
};
259298
}
260299
rpc GetAssetIssueByName (BytesMessage) returns (AssetIssueContract) {
261300
option (google.api.http) = {
262301
post: "/walletsolidity/getassetissuebyname"
263302
body: "*"
303+
additional_bindings {
304+
get: "/walletsolidity/getassetissuebyname"
305+
}
264306
};
265307
}
266308
rpc GetNowBlock (EmptyMessage) returns (Block) {
267309
option (google.api.http) = {
268310
post: "/walletsolidity/getnowblock"
269311
body: "*"
312+
additional_bindings {
313+
get: "/walletsolidity/getnowblock"
314+
}
270315
};
271316
}
272317
rpc GetBlockByNum (NumberMessage) returns (Block) {
273318
option (google.api.http) = {
274319
post: "/walletsolidity/getblockbynum"
275320
body: "*"
321+
additional_bindings {
322+
get: "/walletsolidity/getblockbynum"
323+
}
276324
};
277325
}
278326
//get transaction
279327
rpc TotalTransaction (EmptyMessage) returns (NumberMessage) {
280328
option (google.api.http) = {
281329
post: "/walletsolidity/totaltransaction"
282330
body: "*"
331+
additional_bindings {
332+
get: "/walletsolidity/totaltransaction"
333+
}
283334
};
284335
}
285336
rpc GetTransactionById (BytesMessage) returns (Transaction) {
286337
option (google.api.http) = {
287338
post: "/walletsolidity/gettransactionbyid"
288339
body: "*"
340+
additional_bindings {
341+
get: "/walletsolidity/gettransactionbyid"
342+
}
289343
};
290344
}
291345
rpc GetTransactionsByTimestamp (TimeMessage) returns (TransactionList) {
292346
option (google.api.http) = {
293347
post: "/walletsolidity/gettransactionsbytimestamp"
294348
body: "*"
349+
additional_bindings {
350+
get: "/walletsolidity/gettransactionsbytimestamp"
351+
}
295352
};
296353
}
297354
rpc GetTransactionsFromThis (Account) returns (TransactionList) {
298355
option (google.api.http) = {
299356
post: "/walletsolidity/gettransactionsfromthis"
300357
body: "*"
358+
additional_bindings {
359+
get: "/walletsolidity/gettransactionsfromthis"
360+
}
301361
};
302362
}
303363
rpc GetTransactionsToThis (Account) returns (TransactionList) {
304364
option (google.api.http) = {
305365
post: "/walletsolidity/gettransactionstothis"
306366
body: "*"
367+
additional_bindings {
368+
get: "/walletsolidity/gettransactionstothis"
369+
}
307370
};
308371
}
309372
};
@@ -356,7 +419,6 @@ service Network {
356419
};
357420

358421

359-
360422
message AccountList {
361423
repeated Account accounts = 1;
362424
}

0 commit comments

Comments
 (0)