coinbase-sdk 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/coinbase/address.rb +113 -40
- data/lib/coinbase/asset.rb +18 -4
- data/lib/coinbase/authenticator.rb +1 -1
- data/lib/coinbase/client/api/server_signers_api.rb +429 -0
- data/lib/coinbase/client/api/stake_api.rb +86 -0
- data/lib/coinbase/client/api/trades_api.rb +342 -0
- data/lib/coinbase/client/models/broadcast_trade_request.rb +232 -0
- data/lib/coinbase/client/models/build_staking_operation_request.rb +291 -0
- data/lib/coinbase/client/models/create_address_request.rb +0 -14
- data/lib/coinbase/client/models/create_server_signer_request.rb +239 -0
- data/lib/coinbase/client/models/create_trade_request.rb +256 -0
- data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
- data/lib/coinbase/client/models/create_wallet_request_wallet.rb +233 -0
- data/lib/coinbase/client/models/feature.rb +42 -0
- data/lib/coinbase/client/models/request_faucet_funds200_response.rb +222 -0
- data/lib/coinbase/client/models/seed_creation_event.rb +240 -0
- data/lib/coinbase/client/models/seed_creation_event_result.rb +274 -0
- data/lib/coinbase/client/models/server_signer.rb +235 -0
- data/lib/coinbase/client/models/server_signer_event.rb +239 -0
- data/lib/coinbase/client/models/server_signer_event_event.rb +105 -0
- data/lib/coinbase/client/models/server_signer_event_list.rb +275 -0
- data/lib/coinbase/client/models/server_signer_list.rb +275 -0
- data/lib/coinbase/client/models/signature_creation_event.rb +363 -0
- data/lib/coinbase/client/models/signature_creation_event_result.rb +329 -0
- data/lib/coinbase/client/models/staking_operation.rb +222 -0
- data/lib/coinbase/client/models/trade.rb +365 -0
- data/lib/coinbase/client/models/trade_list.rb +275 -0
- data/lib/coinbase/client/models/transaction.rb +338 -0
- data/lib/coinbase/client/models/transaction_type.rb +39 -0
- data/lib/coinbase/client/models/transfer.rb +33 -1
- data/lib/coinbase/client/models/wallet.rb +74 -4
- data/lib/coinbase/client.rb +23 -0
- data/lib/coinbase/errors.rb +3 -0
- data/lib/coinbase/server_signer.rb +57 -0
- data/lib/coinbase/trade.rb +147 -0
- data/lib/coinbase/transaction.rb +125 -0
- data/lib/coinbase/transfer.rb +38 -71
- data/lib/coinbase/user.rb +14 -89
- data/lib/coinbase/wallet.rb +188 -27
- data/lib/coinbase.rb +19 -4
- metadata +43 -2
@@ -0,0 +1,429 @@
|
|
1
|
+
=begin
|
2
|
+
#Coinbase Platform API
|
3
|
+
|
4
|
+
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.0.1-alpha
|
7
|
+
Contact: yuga.cohler@coinbase.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.5.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Coinbase::Client
|
16
|
+
class ServerSignersApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create a new Server-Signer
|
23
|
+
# Create a new Server-Signer
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [CreateServerSignerRequest] :create_server_signer_request
|
26
|
+
# @return [ServerSigner]
|
27
|
+
def create_server_signer(opts = {})
|
28
|
+
data, _status_code, _headers = create_server_signer_with_http_info(opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create a new Server-Signer
|
33
|
+
# Create a new Server-Signer
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @option opts [CreateServerSignerRequest] :create_server_signer_request
|
36
|
+
# @return [Array<(ServerSigner, Integer, Hash)>] ServerSigner data, response status code and response headers
|
37
|
+
def create_server_signer_with_http_info(opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ServerSignersApi.create_server_signer ...'
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/v1/server_signers'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = opts[:query_params] || {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = opts[:header_params] || {}
|
49
|
+
# HTTP header 'Accept' (if needed)
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
53
|
+
if !content_type.nil?
|
54
|
+
header_params['Content-Type'] = content_type
|
55
|
+
end
|
56
|
+
|
57
|
+
# form parameters
|
58
|
+
form_params = opts[:form_params] || {}
|
59
|
+
|
60
|
+
# http body (model)
|
61
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_server_signer_request'])
|
62
|
+
|
63
|
+
# return_type
|
64
|
+
return_type = opts[:debug_return_type] || 'ServerSigner'
|
65
|
+
|
66
|
+
# auth_names
|
67
|
+
auth_names = opts[:debug_auth_names] || []
|
68
|
+
|
69
|
+
new_options = opts.merge(
|
70
|
+
:operation => :"ServerSignersApi.create_server_signer",
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => return_type
|
77
|
+
)
|
78
|
+
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug "API called: ServerSignersApi#create_server_signer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
+
end
|
83
|
+
return data, status_code, headers
|
84
|
+
end
|
85
|
+
|
86
|
+
# Get a server signer by ID
|
87
|
+
# Get a server signer by ID
|
88
|
+
# @param server_signer_id [String] The ID of the server signer to fetch
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [ServerSigner]
|
91
|
+
def get_server_signer(server_signer_id, opts = {})
|
92
|
+
data, _status_code, _headers = get_server_signer_with_http_info(server_signer_id, opts)
|
93
|
+
data
|
94
|
+
end
|
95
|
+
|
96
|
+
# Get a server signer by ID
|
97
|
+
# Get a server signer by ID
|
98
|
+
# @param server_signer_id [String] The ID of the server signer to fetch
|
99
|
+
# @param [Hash] opts the optional parameters
|
100
|
+
# @return [Array<(ServerSigner, Integer, Hash)>] ServerSigner data, response status code and response headers
|
101
|
+
def get_server_signer_with_http_info(server_signer_id, opts = {})
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug 'Calling API: ServerSignersApi.get_server_signer ...'
|
104
|
+
end
|
105
|
+
# verify the required parameter 'server_signer_id' is set
|
106
|
+
if @api_client.config.client_side_validation && server_signer_id.nil?
|
107
|
+
fail ArgumentError, "Missing the required parameter 'server_signer_id' when calling ServerSignersApi.get_server_signer"
|
108
|
+
end
|
109
|
+
# resource path
|
110
|
+
local_var_path = '/v1/server_signers/{server_signer_id}'.sub('{' + 'server_signer_id' + '}', CGI.escape(server_signer_id.to_s))
|
111
|
+
|
112
|
+
# query parameters
|
113
|
+
query_params = opts[:query_params] || {}
|
114
|
+
|
115
|
+
# header parameters
|
116
|
+
header_params = opts[:header_params] || {}
|
117
|
+
# HTTP header 'Accept' (if needed)
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
119
|
+
|
120
|
+
# form parameters
|
121
|
+
form_params = opts[:form_params] || {}
|
122
|
+
|
123
|
+
# http body (model)
|
124
|
+
post_body = opts[:debug_body]
|
125
|
+
|
126
|
+
# return_type
|
127
|
+
return_type = opts[:debug_return_type] || 'ServerSigner'
|
128
|
+
|
129
|
+
# auth_names
|
130
|
+
auth_names = opts[:debug_auth_names] || []
|
131
|
+
|
132
|
+
new_options = opts.merge(
|
133
|
+
:operation => :"ServerSignersApi.get_server_signer",
|
134
|
+
:header_params => header_params,
|
135
|
+
:query_params => query_params,
|
136
|
+
:form_params => form_params,
|
137
|
+
:body => post_body,
|
138
|
+
:auth_names => auth_names,
|
139
|
+
:return_type => return_type
|
140
|
+
)
|
141
|
+
|
142
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
143
|
+
if @api_client.config.debugging
|
144
|
+
@api_client.config.logger.debug "API called: ServerSignersApi#get_server_signer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
145
|
+
end
|
146
|
+
return data, status_code, headers
|
147
|
+
end
|
148
|
+
|
149
|
+
# List events for a server signer
|
150
|
+
# List events for a server signer
|
151
|
+
# @param server_signer_id [String] The ID of the server signer to fetch events for
|
152
|
+
# @param [Hash] opts the optional parameters
|
153
|
+
# @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
154
|
+
# @option opts [String] :page A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
|
155
|
+
# @return [ServerSignerEventList]
|
156
|
+
def list_server_signer_events(server_signer_id, opts = {})
|
157
|
+
data, _status_code, _headers = list_server_signer_events_with_http_info(server_signer_id, opts)
|
158
|
+
data
|
159
|
+
end
|
160
|
+
|
161
|
+
# List events for a server signer
|
162
|
+
# List events for a server signer
|
163
|
+
# @param server_signer_id [String] The ID of the server signer to fetch events for
|
164
|
+
# @param [Hash] opts the optional parameters
|
165
|
+
# @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
166
|
+
# @option opts [String] :page A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
|
167
|
+
# @return [Array<(ServerSignerEventList, Integer, Hash)>] ServerSignerEventList data, response status code and response headers
|
168
|
+
def list_server_signer_events_with_http_info(server_signer_id, opts = {})
|
169
|
+
if @api_client.config.debugging
|
170
|
+
@api_client.config.logger.debug 'Calling API: ServerSignersApi.list_server_signer_events ...'
|
171
|
+
end
|
172
|
+
# verify the required parameter 'server_signer_id' is set
|
173
|
+
if @api_client.config.client_side_validation && server_signer_id.nil?
|
174
|
+
fail ArgumentError, "Missing the required parameter 'server_signer_id' when calling ServerSignersApi.list_server_signer_events"
|
175
|
+
end
|
176
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
|
177
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ServerSignersApi.list_server_signer_events, the character length must be smaller than or equal to 5000.'
|
178
|
+
end
|
179
|
+
|
180
|
+
# resource path
|
181
|
+
local_var_path = '/v1/server_signers/{server_signer_id}/events'.sub('{' + 'server_signer_id' + '}', CGI.escape(server_signer_id.to_s))
|
182
|
+
|
183
|
+
# query parameters
|
184
|
+
query_params = opts[:query_params] || {}
|
185
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
186
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
187
|
+
|
188
|
+
# header parameters
|
189
|
+
header_params = opts[:header_params] || {}
|
190
|
+
# HTTP header 'Accept' (if needed)
|
191
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
192
|
+
|
193
|
+
# form parameters
|
194
|
+
form_params = opts[:form_params] || {}
|
195
|
+
|
196
|
+
# http body (model)
|
197
|
+
post_body = opts[:debug_body]
|
198
|
+
|
199
|
+
# return_type
|
200
|
+
return_type = opts[:debug_return_type] || 'ServerSignerEventList'
|
201
|
+
|
202
|
+
# auth_names
|
203
|
+
auth_names = opts[:debug_auth_names] || []
|
204
|
+
|
205
|
+
new_options = opts.merge(
|
206
|
+
:operation => :"ServerSignersApi.list_server_signer_events",
|
207
|
+
:header_params => header_params,
|
208
|
+
:query_params => query_params,
|
209
|
+
:form_params => form_params,
|
210
|
+
:body => post_body,
|
211
|
+
:auth_names => auth_names,
|
212
|
+
:return_type => return_type
|
213
|
+
)
|
214
|
+
|
215
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
216
|
+
if @api_client.config.debugging
|
217
|
+
@api_client.config.logger.debug "API called: ServerSignersApi#list_server_signer_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
218
|
+
end
|
219
|
+
return data, status_code, headers
|
220
|
+
end
|
221
|
+
|
222
|
+
# List server signers for the current project
|
223
|
+
# List server signers for the current project
|
224
|
+
# @param [Hash] opts the optional parameters
|
225
|
+
# @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
226
|
+
# @option opts [String] :page A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
|
227
|
+
# @return [ServerSignerList]
|
228
|
+
def list_server_signers(opts = {})
|
229
|
+
data, _status_code, _headers = list_server_signers_with_http_info(opts)
|
230
|
+
data
|
231
|
+
end
|
232
|
+
|
233
|
+
# List server signers for the current project
|
234
|
+
# List server signers for the current project
|
235
|
+
# @param [Hash] opts the optional parameters
|
236
|
+
# @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
237
|
+
# @option opts [String] :page A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
|
238
|
+
# @return [Array<(ServerSignerList, Integer, Hash)>] ServerSignerList data, response status code and response headers
|
239
|
+
def list_server_signers_with_http_info(opts = {})
|
240
|
+
if @api_client.config.debugging
|
241
|
+
@api_client.config.logger.debug 'Calling API: ServerSignersApi.list_server_signers ...'
|
242
|
+
end
|
243
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
|
244
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ServerSignersApi.list_server_signers, the character length must be smaller than or equal to 5000.'
|
245
|
+
end
|
246
|
+
|
247
|
+
# resource path
|
248
|
+
local_var_path = '/v1/server_signers'
|
249
|
+
|
250
|
+
# query parameters
|
251
|
+
query_params = opts[:query_params] || {}
|
252
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
253
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
254
|
+
|
255
|
+
# header parameters
|
256
|
+
header_params = opts[:header_params] || {}
|
257
|
+
# HTTP header 'Accept' (if needed)
|
258
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
259
|
+
|
260
|
+
# form parameters
|
261
|
+
form_params = opts[:form_params] || {}
|
262
|
+
|
263
|
+
# http body (model)
|
264
|
+
post_body = opts[:debug_body]
|
265
|
+
|
266
|
+
# return_type
|
267
|
+
return_type = opts[:debug_return_type] || 'ServerSignerList'
|
268
|
+
|
269
|
+
# auth_names
|
270
|
+
auth_names = opts[:debug_auth_names] || []
|
271
|
+
|
272
|
+
new_options = opts.merge(
|
273
|
+
:operation => :"ServerSignersApi.list_server_signers",
|
274
|
+
:header_params => header_params,
|
275
|
+
:query_params => query_params,
|
276
|
+
:form_params => form_params,
|
277
|
+
:body => post_body,
|
278
|
+
:auth_names => auth_names,
|
279
|
+
:return_type => return_type
|
280
|
+
)
|
281
|
+
|
282
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
283
|
+
if @api_client.config.debugging
|
284
|
+
@api_client.config.logger.debug "API called: ServerSignersApi#list_server_signers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
285
|
+
end
|
286
|
+
return data, status_code, headers
|
287
|
+
end
|
288
|
+
|
289
|
+
# Submit the result of a server signer event
|
290
|
+
# Submit the result of a server signer event
|
291
|
+
# @param server_signer_id [String] The ID of the server signer to submit the event result for
|
292
|
+
# @param [Hash] opts the optional parameters
|
293
|
+
# @option opts [SeedCreationEventResult] :seed_creation_event_result
|
294
|
+
# @return [SeedCreationEventResult]
|
295
|
+
def submit_server_signer_seed_event_result(server_signer_id, opts = {})
|
296
|
+
data, _status_code, _headers = submit_server_signer_seed_event_result_with_http_info(server_signer_id, opts)
|
297
|
+
data
|
298
|
+
end
|
299
|
+
|
300
|
+
# Submit the result of a server signer event
|
301
|
+
# Submit the result of a server signer event
|
302
|
+
# @param server_signer_id [String] The ID of the server signer to submit the event result for
|
303
|
+
# @param [Hash] opts the optional parameters
|
304
|
+
# @option opts [SeedCreationEventResult] :seed_creation_event_result
|
305
|
+
# @return [Array<(SeedCreationEventResult, Integer, Hash)>] SeedCreationEventResult data, response status code and response headers
|
306
|
+
def submit_server_signer_seed_event_result_with_http_info(server_signer_id, opts = {})
|
307
|
+
if @api_client.config.debugging
|
308
|
+
@api_client.config.logger.debug 'Calling API: ServerSignersApi.submit_server_signer_seed_event_result ...'
|
309
|
+
end
|
310
|
+
# verify the required parameter 'server_signer_id' is set
|
311
|
+
if @api_client.config.client_side_validation && server_signer_id.nil?
|
312
|
+
fail ArgumentError, "Missing the required parameter 'server_signer_id' when calling ServerSignersApi.submit_server_signer_seed_event_result"
|
313
|
+
end
|
314
|
+
# resource path
|
315
|
+
local_var_path = '/v1/server_signers/{server_signer_id}/seed_event_result'.sub('{' + 'server_signer_id' + '}', CGI.escape(server_signer_id.to_s))
|
316
|
+
|
317
|
+
# query parameters
|
318
|
+
query_params = opts[:query_params] || {}
|
319
|
+
|
320
|
+
# header parameters
|
321
|
+
header_params = opts[:header_params] || {}
|
322
|
+
# HTTP header 'Accept' (if needed)
|
323
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
324
|
+
# HTTP header 'Content-Type'
|
325
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
326
|
+
if !content_type.nil?
|
327
|
+
header_params['Content-Type'] = content_type
|
328
|
+
end
|
329
|
+
|
330
|
+
# form parameters
|
331
|
+
form_params = opts[:form_params] || {}
|
332
|
+
|
333
|
+
# http body (model)
|
334
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'seed_creation_event_result'])
|
335
|
+
|
336
|
+
# return_type
|
337
|
+
return_type = opts[:debug_return_type] || 'SeedCreationEventResult'
|
338
|
+
|
339
|
+
# auth_names
|
340
|
+
auth_names = opts[:debug_auth_names] || []
|
341
|
+
|
342
|
+
new_options = opts.merge(
|
343
|
+
:operation => :"ServerSignersApi.submit_server_signer_seed_event_result",
|
344
|
+
:header_params => header_params,
|
345
|
+
:query_params => query_params,
|
346
|
+
:form_params => form_params,
|
347
|
+
:body => post_body,
|
348
|
+
:auth_names => auth_names,
|
349
|
+
:return_type => return_type
|
350
|
+
)
|
351
|
+
|
352
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
353
|
+
if @api_client.config.debugging
|
354
|
+
@api_client.config.logger.debug "API called: ServerSignersApi#submit_server_signer_seed_event_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
355
|
+
end
|
356
|
+
return data, status_code, headers
|
357
|
+
end
|
358
|
+
|
359
|
+
# Submit the result of a server signer event
|
360
|
+
# Submit the result of a server signer event
|
361
|
+
# @param server_signer_id [String] The ID of the server signer to submit the event result for
|
362
|
+
# @param [Hash] opts the optional parameters
|
363
|
+
# @option opts [SignatureCreationEventResult] :signature_creation_event_result
|
364
|
+
# @return [SignatureCreationEventResult]
|
365
|
+
def submit_server_signer_signature_event_result(server_signer_id, opts = {})
|
366
|
+
data, _status_code, _headers = submit_server_signer_signature_event_result_with_http_info(server_signer_id, opts)
|
367
|
+
data
|
368
|
+
end
|
369
|
+
|
370
|
+
# Submit the result of a server signer event
|
371
|
+
# Submit the result of a server signer event
|
372
|
+
# @param server_signer_id [String] The ID of the server signer to submit the event result for
|
373
|
+
# @param [Hash] opts the optional parameters
|
374
|
+
# @option opts [SignatureCreationEventResult] :signature_creation_event_result
|
375
|
+
# @return [Array<(SignatureCreationEventResult, Integer, Hash)>] SignatureCreationEventResult data, response status code and response headers
|
376
|
+
def submit_server_signer_signature_event_result_with_http_info(server_signer_id, opts = {})
|
377
|
+
if @api_client.config.debugging
|
378
|
+
@api_client.config.logger.debug 'Calling API: ServerSignersApi.submit_server_signer_signature_event_result ...'
|
379
|
+
end
|
380
|
+
# verify the required parameter 'server_signer_id' is set
|
381
|
+
if @api_client.config.client_side_validation && server_signer_id.nil?
|
382
|
+
fail ArgumentError, "Missing the required parameter 'server_signer_id' when calling ServerSignersApi.submit_server_signer_signature_event_result"
|
383
|
+
end
|
384
|
+
# resource path
|
385
|
+
local_var_path = '/v1/server_signers/{server_signer_id}/signature_event_result'.sub('{' + 'server_signer_id' + '}', CGI.escape(server_signer_id.to_s))
|
386
|
+
|
387
|
+
# query parameters
|
388
|
+
query_params = opts[:query_params] || {}
|
389
|
+
|
390
|
+
# header parameters
|
391
|
+
header_params = opts[:header_params] || {}
|
392
|
+
# HTTP header 'Accept' (if needed)
|
393
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
394
|
+
# HTTP header 'Content-Type'
|
395
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
396
|
+
if !content_type.nil?
|
397
|
+
header_params['Content-Type'] = content_type
|
398
|
+
end
|
399
|
+
|
400
|
+
# form parameters
|
401
|
+
form_params = opts[:form_params] || {}
|
402
|
+
|
403
|
+
# http body (model)
|
404
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'signature_creation_event_result'])
|
405
|
+
|
406
|
+
# return_type
|
407
|
+
return_type = opts[:debug_return_type] || 'SignatureCreationEventResult'
|
408
|
+
|
409
|
+
# auth_names
|
410
|
+
auth_names = opts[:debug_auth_names] || []
|
411
|
+
|
412
|
+
new_options = opts.merge(
|
413
|
+
:operation => :"ServerSignersApi.submit_server_signer_signature_event_result",
|
414
|
+
:header_params => header_params,
|
415
|
+
:query_params => query_params,
|
416
|
+
:form_params => form_params,
|
417
|
+
:body => post_body,
|
418
|
+
:auth_names => auth_names,
|
419
|
+
:return_type => return_type
|
420
|
+
)
|
421
|
+
|
422
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
423
|
+
if @api_client.config.debugging
|
424
|
+
@api_client.config.logger.debug "API called: ServerSignersApi#submit_server_signer_signature_event_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
425
|
+
end
|
426
|
+
return data, status_code, headers
|
427
|
+
end
|
428
|
+
end
|
429
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
=begin
|
2
|
+
#Coinbase Platform API
|
3
|
+
|
4
|
+
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.0.1-alpha
|
7
|
+
Contact: yuga.cohler@coinbase.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.5.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Coinbase::Client
|
16
|
+
class StakeApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Build a new staking operation
|
23
|
+
# Build a new staking operation
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [BuildStakingOperationRequest] :build_staking_operation_request
|
26
|
+
# @return [StakingOperation]
|
27
|
+
def build_staking_operation(opts = {})
|
28
|
+
data, _status_code, _headers = build_staking_operation_with_http_info(opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Build a new staking operation
|
33
|
+
# Build a new staking operation
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @option opts [BuildStakingOperationRequest] :build_staking_operation_request
|
36
|
+
# @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
|
37
|
+
def build_staking_operation_with_http_info(opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: StakeApi.build_staking_operation ...'
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/v1/stake/build'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = opts[:query_params] || {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = opts[:header_params] || {}
|
49
|
+
# HTTP header 'Accept' (if needed)
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
53
|
+
if !content_type.nil?
|
54
|
+
header_params['Content-Type'] = content_type
|
55
|
+
end
|
56
|
+
|
57
|
+
# form parameters
|
58
|
+
form_params = opts[:form_params] || {}
|
59
|
+
|
60
|
+
# http body (model)
|
61
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'build_staking_operation_request'])
|
62
|
+
|
63
|
+
# return_type
|
64
|
+
return_type = opts[:debug_return_type] || 'StakingOperation'
|
65
|
+
|
66
|
+
# auth_names
|
67
|
+
auth_names = opts[:debug_auth_names] || []
|
68
|
+
|
69
|
+
new_options = opts.merge(
|
70
|
+
:operation => :"StakeApi.build_staking_operation",
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => return_type
|
77
|
+
)
|
78
|
+
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug "API called: StakeApi#build_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
+
end
|
83
|
+
return data, status_code, headers
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|