forked from coinbase/mesh-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 10
/
api.go
231 lines (211 loc) · 9.66 KB
/
api.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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
// Copyright 2023 Coinbase, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Generated by: OpenAPI Generator (https://openapi-generator.tech)
package server
import (
"context"
"net/http"
"github.com/coinbase/rosetta-sdk-go/types"
)
// AccountAPIRouter defines the required methods for binding the api requests to a responses for the
// AccountAPI
// The AccountAPIRouter implementation should parse necessary information from the http request,
// pass the data to a AccountAPIServicer to perform the required actions, then write the service
// results to the http response.
type AccountAPIRouter interface {
AccountBalance(http.ResponseWriter, *http.Request)
AccountCoins(http.ResponseWriter, *http.Request)
}
// BlockAPIRouter defines the required methods for binding the api requests to a responses for the
// BlockAPI
// The BlockAPIRouter implementation should parse necessary information from the http request,
// pass the data to a BlockAPIServicer to perform the required actions, then write the service
// results to the http response.
type BlockAPIRouter interface {
Block(http.ResponseWriter, *http.Request)
BlockTransaction(http.ResponseWriter, *http.Request)
}
// CallAPIRouter defines the required methods for binding the api requests to a responses for the
// CallAPI
// The CallAPIRouter implementation should parse necessary information from the http request,
// pass the data to a CallAPIServicer to perform the required actions, then write the service
// results to the http response.
type CallAPIRouter interface {
Call(http.ResponseWriter, *http.Request)
}
// ConstructionAPIRouter defines the required methods for binding the api requests to a responses
// for the ConstructionAPI The ConstructionAPIRouter implementation should parse necessary
// information from the http request, pass the data to a ConstructionAPIServicer to perform the
// required actions, then write the service results to the http response.
type ConstructionAPIRouter interface {
ConstructionCombine(http.ResponseWriter, *http.Request)
ConstructionDerive(http.ResponseWriter, *http.Request)
ConstructionHash(http.ResponseWriter, *http.Request)
ConstructionMetadata(http.ResponseWriter, *http.Request)
ConstructionParse(http.ResponseWriter, *http.Request)
ConstructionPayloads(http.ResponseWriter, *http.Request)
ConstructionPreprocess(http.ResponseWriter, *http.Request)
ConstructionSubmit(http.ResponseWriter, *http.Request)
}
// EventsAPIRouter defines the required methods for binding the api requests to a responses for the
// EventsAPI
// The EventsAPIRouter implementation should parse necessary information from the http request,
// pass the data to a EventsAPIServicer to perform the required actions, then write the service
// results to the http response.
type EventsAPIRouter interface {
EventsBlocks(http.ResponseWriter, *http.Request)
}
// MempoolAPIRouter defines the required methods for binding the api requests to a responses for the
// MempoolAPI
// The MempoolAPIRouter implementation should parse necessary information from the http request,
// pass the data to a MempoolAPIServicer to perform the required actions, then write the service
// results to the http response.
type MempoolAPIRouter interface {
Mempool(http.ResponseWriter, *http.Request)
MempoolTransaction(http.ResponseWriter, *http.Request)
}
// NetworkAPIRouter defines the required methods for binding the api requests to a responses for the
// NetworkAPI
// The NetworkAPIRouter implementation should parse necessary information from the http request,
// pass the data to a NetworkAPIServicer to perform the required actions, then write the service
// results to the http response.
type NetworkAPIRouter interface {
NetworkList(http.ResponseWriter, *http.Request)
NetworkOptions(http.ResponseWriter, *http.Request)
NetworkStatus(http.ResponseWriter, *http.Request)
}
// SearchAPIRouter defines the required methods for binding the api requests to a responses for the
// SearchAPI
// The SearchAPIRouter implementation should parse necessary information from the http request,
// pass the data to a SearchAPIServicer to perform the required actions, then write the service
// results to the http response.
type SearchAPIRouter interface {
SearchTransactions(http.ResponseWriter, *http.Request)
}
// AccountAPIServicer defines the api actions for the AccountAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type AccountAPIServicer interface {
AccountBalance(
context.Context,
*types.AccountBalanceRequest,
) (*types.AccountBalanceResponse, *types.Error)
AccountCoins(
context.Context,
*types.AccountCoinsRequest,
) (*types.AccountCoinsResponse, *types.Error)
}
// BlockAPIServicer defines the api actions for the BlockAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type BlockAPIServicer interface {
Block(context.Context, *types.BlockRequest) (*types.BlockResponse, *types.Error)
BlockTransaction(
context.Context,
*types.BlockTransactionRequest,
) (*types.BlockTransactionResponse, *types.Error)
}
// CallAPIServicer defines the api actions for the CallAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type CallAPIServicer interface {
Call(context.Context, *types.CallRequest) (*types.CallResponse, *types.Error)
}
// ConstructionAPIServicer defines the api actions for the ConstructionAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type ConstructionAPIServicer interface {
ConstructionCombine(
context.Context,
*types.ConstructionCombineRequest,
) (*types.ConstructionCombineResponse, *types.Error)
ConstructionDerive(
context.Context,
*types.ConstructionDeriveRequest,
) (*types.ConstructionDeriveResponse, *types.Error)
ConstructionHash(
context.Context,
*types.ConstructionHashRequest,
) (*types.TransactionIdentifierResponse, *types.Error)
ConstructionMetadata(
context.Context,
*types.ConstructionMetadataRequest,
) (*types.ConstructionMetadataResponse, *types.Error)
ConstructionParse(
context.Context,
*types.ConstructionParseRequest,
) (*types.ConstructionParseResponse, *types.Error)
ConstructionPayloads(
context.Context,
*types.ConstructionPayloadsRequest,
) (*types.ConstructionPayloadsResponse, *types.Error)
ConstructionPreprocess(
context.Context,
*types.ConstructionPreprocessRequest,
) (*types.ConstructionPreprocessResponse, *types.Error)
ConstructionSubmit(
context.Context,
*types.ConstructionSubmitRequest,
) (*types.TransactionIdentifierResponse, *types.Error)
}
// EventsAPIServicer defines the api actions for the EventsAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type EventsAPIServicer interface {
EventsBlocks(
context.Context,
*types.EventsBlocksRequest,
) (*types.EventsBlocksResponse, *types.Error)
}
// MempoolAPIServicer defines the api actions for the MempoolAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type MempoolAPIServicer interface {
Mempool(context.Context, *types.NetworkRequest) (*types.MempoolResponse, *types.Error)
MempoolTransaction(
context.Context,
*types.MempoolTransactionRequest,
) (*types.MempoolTransactionResponse, *types.Error)
}
// NetworkAPIServicer defines the api actions for the NetworkAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type NetworkAPIServicer interface {
NetworkList(context.Context, *types.MetadataRequest) (*types.NetworkListResponse, *types.Error)
NetworkOptions(
context.Context,
*types.NetworkRequest,
) (*types.NetworkOptionsResponse, *types.Error)
NetworkStatus(
context.Context,
*types.NetworkRequest,
) (*types.NetworkStatusResponse, *types.Error)
}
// SearchAPIServicer defines the api actions for the SearchAPI service
// This interface intended to stay up to date with the openapi yaml used to generate it,
// while the service implementation can ignored with the .openapi-generator-ignore file
// and updated with the logic required for the API.
type SearchAPIServicer interface {
SearchTransactions(
context.Context,
*types.SearchTransactionsRequest,
) (*types.SearchTransactionsResponse, *types.Error)
}