coinbase-sdk 0.0.7 → 0.0.9

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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/external_address.rb +173 -0
  3. data/lib/coinbase/address/wallet_address.rb +219 -0
  4. data/lib/coinbase/address.rb +32 -219
  5. data/lib/coinbase/asset.rb +76 -66
  6. data/lib/coinbase/authenticator.rb +2 -0
  7. data/lib/coinbase/balance.rb +10 -6
  8. data/lib/coinbase/client/api/addresses_api.rb +1 -1
  9. data/lib/coinbase/client/api/assets_api.rb +91 -0
  10. data/lib/coinbase/client/api/external_addresses_api.rb +242 -0
  11. data/lib/coinbase/client/api/server_signers_api.rb +1 -1
  12. data/lib/coinbase/client/api/stake_api.rb +157 -7
  13. data/lib/coinbase/client/api/trades_api.rb +1 -1
  14. data/lib/coinbase/client/api/transfers_api.rb +1 -1
  15. data/lib/coinbase/client/api/users_api.rb +1 -1
  16. data/lib/coinbase/client/api/wallets_api.rb +1 -1
  17. data/lib/coinbase/client/api_client.rb +3 -3
  18. data/lib/coinbase/client/api_error.rb +1 -1
  19. data/lib/coinbase/client/configuration.rb +1 -1
  20. data/lib/coinbase/client/models/address.rb +1 -1
  21. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  22. data/lib/coinbase/client/models/address_list.rb +1 -1
  23. data/lib/coinbase/client/models/asset.rb +1 -1
  24. data/lib/coinbase/client/models/balance.rb +1 -1
  25. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  26. data/lib/coinbase/client/models/broadcast_transfer_request.rb +1 -1
  27. data/lib/coinbase/client/models/build_staking_operation_request.rb +1 -1
  28. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  29. data/lib/coinbase/client/models/create_server_signer_request.rb +22 -5
  30. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  31. data/lib/coinbase/client/models/create_transfer_request.rb +1 -1
  32. data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
  33. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
  34. data/lib/coinbase/client/models/error.rb +1 -1
  35. data/lib/coinbase/client/models/faucet_transaction.rb +23 -5
  36. data/lib/coinbase/client/models/feature.rb +1 -1
  37. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +258 -0
  38. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +330 -0
  39. data/lib/coinbase/client/models/get_staking_context_request.rb +274 -0
  40. data/lib/coinbase/client/models/partial_eth_staking_context.rb +254 -0
  41. data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
  42. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  43. data/lib/coinbase/client/models/server_signer.rb +22 -5
  44. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  45. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  46. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  47. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  48. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  49. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  50. data/lib/coinbase/client/models/{request_faucet_funds200_response.rb → staking_context.rb} +16 -16
  51. data/lib/coinbase/client/models/staking_context_context.rb +104 -0
  52. data/lib/coinbase/client/models/staking_operation.rb +15 -12
  53. data/lib/coinbase/client/models/staking_reward.rb +324 -0
  54. data/lib/coinbase/client/models/staking_reward_format.rb +40 -0
  55. data/lib/coinbase/client/models/trade.rb +1 -1
  56. data/lib/coinbase/client/models/trade_list.rb +1 -1
  57. data/lib/coinbase/client/models/transaction.rb +1 -1
  58. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  59. data/lib/coinbase/client/models/transfer.rb +1 -1
  60. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  61. data/lib/coinbase/client/models/user.rb +1 -1
  62. data/lib/coinbase/client/models/wallet.rb +1 -1
  63. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  64. data/lib/coinbase/client/version.rb +1 -1
  65. data/lib/coinbase/client.rb +11 -1
  66. data/lib/coinbase/constants.rb +2 -27
  67. data/lib/coinbase/errors.rb +56 -64
  68. data/lib/coinbase/faucet_transaction.rb +5 -4
  69. data/lib/coinbase/network.rb +6 -20
  70. data/lib/coinbase/pagination.rb +26 -0
  71. data/lib/coinbase/staking_operation.rb +29 -0
  72. data/lib/coinbase/staking_reward.rb +79 -0
  73. data/lib/coinbase/transaction.rb +6 -0
  74. data/lib/coinbase/user.rb +5 -51
  75. data/lib/coinbase/wallet.rb +97 -102
  76. data/lib/coinbase.rb +19 -11
  77. metadata +17 -17
@@ -0,0 +1,242 @@
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.6.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Coinbase::Client
16
+ class ExternalAddressesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get the balance of an asset in an external address
23
+ # Get the balance of an asset in an external address
24
+ # @param network_id [String] The ID of the blockchain network
25
+ # @param address_id [String] The ID of the address to fetch the balance for
26
+ # @param asset_id [String] The ID of the asset to fetch the balance for
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [Balance]
29
+ def get_external_address_balance(network_id, address_id, asset_id, opts = {})
30
+ data, _status_code, _headers = get_external_address_balance_with_http_info(network_id, address_id, asset_id, opts)
31
+ data
32
+ end
33
+
34
+ # Get the balance of an asset in an external address
35
+ # Get the balance of an asset in an external address
36
+ # @param network_id [String] The ID of the blockchain network
37
+ # @param address_id [String] The ID of the address to fetch the balance for
38
+ # @param asset_id [String] The ID of the asset to fetch the balance for
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Array<(Balance, Integer, Hash)>] Balance data, response status code and response headers
41
+ def get_external_address_balance_with_http_info(network_id, address_id, asset_id, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: ExternalAddressesApi.get_external_address_balance ...'
44
+ end
45
+ # verify the required parameter 'network_id' is set
46
+ if @api_client.config.client_side_validation && network_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling ExternalAddressesApi.get_external_address_balance"
48
+ end
49
+ # verify the required parameter 'address_id' is set
50
+ if @api_client.config.client_side_validation && address_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling ExternalAddressesApi.get_external_address_balance"
52
+ end
53
+ # verify the required parameter 'asset_id' is set
54
+ if @api_client.config.client_side_validation && asset_id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'asset_id' when calling ExternalAddressesApi.get_external_address_balance"
56
+ end
57
+ # resource path
58
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/balances/{asset_id}'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body]
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type] || 'Balance'
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || []
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"ExternalAddressesApi.get_external_address_balance",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: ExternalAddressesApi#get_external_address_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # Get the balances of an external address
98
+ # List all of the balances of an external address
99
+ # @param network_id [String] The ID of the blockchain network
100
+ # @param address_id [String] The ID of the address to fetch the balance for
101
+ # @param [Hash] opts the optional parameters
102
+ # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
103
+ # @return [AddressBalanceList]
104
+ def list_external_address_balances(network_id, address_id, opts = {})
105
+ data, _status_code, _headers = list_external_address_balances_with_http_info(network_id, address_id, opts)
106
+ data
107
+ end
108
+
109
+ # Get the balances of an external address
110
+ # List all of the balances of an external address
111
+ # @param network_id [String] The ID of the blockchain network
112
+ # @param address_id [String] The ID of the address to fetch the balance for
113
+ # @param [Hash] opts the optional parameters
114
+ # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
115
+ # @return [Array<(AddressBalanceList, Integer, Hash)>] AddressBalanceList data, response status code and response headers
116
+ def list_external_address_balances_with_http_info(network_id, address_id, opts = {})
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug 'Calling API: ExternalAddressesApi.list_external_address_balances ...'
119
+ end
120
+ # verify the required parameter 'network_id' is set
121
+ if @api_client.config.client_side_validation && network_id.nil?
122
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling ExternalAddressesApi.list_external_address_balances"
123
+ end
124
+ # verify the required parameter 'address_id' is set
125
+ if @api_client.config.client_side_validation && address_id.nil?
126
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling ExternalAddressesApi.list_external_address_balances"
127
+ end
128
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
129
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ExternalAddressesApi.list_external_address_balances, the character length must be smaller than or equal to 5000.'
130
+ end
131
+
132
+ # resource path
133
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/balances'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
134
+
135
+ # query parameters
136
+ query_params = opts[:query_params] || {}
137
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
138
+
139
+ # header parameters
140
+ header_params = opts[:header_params] || {}
141
+ # HTTP header 'Accept' (if needed)
142
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
143
+
144
+ # form parameters
145
+ form_params = opts[:form_params] || {}
146
+
147
+ # http body (model)
148
+ post_body = opts[:debug_body]
149
+
150
+ # return_type
151
+ return_type = opts[:debug_return_type] || 'AddressBalanceList'
152
+
153
+ # auth_names
154
+ auth_names = opts[:debug_auth_names] || []
155
+
156
+ new_options = opts.merge(
157
+ :operation => :"ExternalAddressesApi.list_external_address_balances",
158
+ :header_params => header_params,
159
+ :query_params => query_params,
160
+ :form_params => form_params,
161
+ :body => post_body,
162
+ :auth_names => auth_names,
163
+ :return_type => return_type
164
+ )
165
+
166
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
167
+ if @api_client.config.debugging
168
+ @api_client.config.logger.debug "API called: ExternalAddressesApi#list_external_address_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
169
+ end
170
+ return data, status_code, headers
171
+ end
172
+
173
+ # Request faucet funds for external address.
174
+ # Request faucet funds to be sent to external address.
175
+ # @param network_id [String] The ID of the wallet the address belongs to.
176
+ # @param address_id [String] The onchain address of the address that is being fetched.
177
+ # @param [Hash] opts the optional parameters
178
+ # @return [FaucetTransaction]
179
+ def request_external_faucet_funds(network_id, address_id, opts = {})
180
+ data, _status_code, _headers = request_external_faucet_funds_with_http_info(network_id, address_id, opts)
181
+ data
182
+ end
183
+
184
+ # Request faucet funds for external address.
185
+ # Request faucet funds to be sent to external address.
186
+ # @param network_id [String] The ID of the wallet the address belongs to.
187
+ # @param address_id [String] The onchain address of the address that is being fetched.
188
+ # @param [Hash] opts the optional parameters
189
+ # @return [Array<(FaucetTransaction, Integer, Hash)>] FaucetTransaction data, response status code and response headers
190
+ def request_external_faucet_funds_with_http_info(network_id, address_id, opts = {})
191
+ if @api_client.config.debugging
192
+ @api_client.config.logger.debug 'Calling API: ExternalAddressesApi.request_external_faucet_funds ...'
193
+ end
194
+ # verify the required parameter 'network_id' is set
195
+ if @api_client.config.client_side_validation && network_id.nil?
196
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling ExternalAddressesApi.request_external_faucet_funds"
197
+ end
198
+ # verify the required parameter 'address_id' is set
199
+ if @api_client.config.client_side_validation && address_id.nil?
200
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling ExternalAddressesApi.request_external_faucet_funds"
201
+ end
202
+ # resource path
203
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/faucet'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
204
+
205
+ # query parameters
206
+ query_params = opts[:query_params] || {}
207
+
208
+ # header parameters
209
+ header_params = opts[:header_params] || {}
210
+ # HTTP header 'Accept' (if needed)
211
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
212
+
213
+ # form parameters
214
+ form_params = opts[:form_params] || {}
215
+
216
+ # http body (model)
217
+ post_body = opts[:debug_body]
218
+
219
+ # return_type
220
+ return_type = opts[:debug_return_type] || 'FaucetTransaction'
221
+
222
+ # auth_names
223
+ auth_names = opts[:debug_auth_names] || []
224
+
225
+ new_options = opts.merge(
226
+ :operation => :"ExternalAddressesApi.request_external_faucet_funds",
227
+ :header_params => header_params,
228
+ :query_params => query_params,
229
+ :form_params => form_params,
230
+ :body => post_body,
231
+ :auth_names => auth_names,
232
+ :return_type => return_type
233
+ )
234
+
235
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug "API called: ExternalAddressesApi#request_external_faucet_funds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
238
+ end
239
+ return data, status_code, headers
240
+ end
241
+ end
242
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -21,23 +21,27 @@ module Coinbase::Client
21
21
  end
22
22
  # Build a new staking operation
23
23
  # Build a new staking operation
24
+ # @param build_staking_operation_request [BuildStakingOperationRequest]
24
25
  # @param [Hash] opts the optional parameters
25
- # @option opts [BuildStakingOperationRequest] :build_staking_operation_request
26
26
  # @return [StakingOperation]
27
- def build_staking_operation(opts = {})
28
- data, _status_code, _headers = build_staking_operation_with_http_info(opts)
27
+ def build_staking_operation(build_staking_operation_request, opts = {})
28
+ data, _status_code, _headers = build_staking_operation_with_http_info(build_staking_operation_request, opts)
29
29
  data
30
30
  end
31
31
 
32
32
  # Build a new staking operation
33
33
  # Build a new staking operation
34
+ # @param build_staking_operation_request [BuildStakingOperationRequest]
34
35
  # @param [Hash] opts the optional parameters
35
- # @option opts [BuildStakingOperationRequest] :build_staking_operation_request
36
36
  # @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
37
- def build_staking_operation_with_http_info(opts = {})
37
+ def build_staking_operation_with_http_info(build_staking_operation_request, opts = {})
38
38
  if @api_client.config.debugging
39
39
  @api_client.config.logger.debug 'Calling API: StakeApi.build_staking_operation ...'
40
40
  end
41
+ # verify the required parameter 'build_staking_operation_request' is set
42
+ if @api_client.config.client_side_validation && build_staking_operation_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'build_staking_operation_request' when calling StakeApi.build_staking_operation"
44
+ end
41
45
  # resource path
42
46
  local_var_path = '/v1/stake/build'
43
47
 
@@ -58,7 +62,7 @@ module Coinbase::Client
58
62
  form_params = opts[:form_params] || {}
59
63
 
60
64
  # http body (model)
61
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'build_staking_operation_request'])
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(build_staking_operation_request)
62
66
 
63
67
  # return_type
64
68
  return_type = opts[:debug_return_type] || 'StakingOperation'
@@ -82,5 +86,151 @@ module Coinbase::Client
82
86
  end
83
87
  return data, status_code, headers
84
88
  end
89
+
90
+ # Fetch staking rewards
91
+ # Fetch staking rewards for a list of addresses
92
+ # @param fetch_staking_rewards_request [FetchStakingRewardsRequest]
93
+ # @param [Hash] opts the optional parameters
94
+ # @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 50.
95
+ # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
96
+ # @return [FetchStakingRewards200Response]
97
+ def fetch_staking_rewards(fetch_staking_rewards_request, opts = {})
98
+ data, _status_code, _headers = fetch_staking_rewards_with_http_info(fetch_staking_rewards_request, opts)
99
+ data
100
+ end
101
+
102
+ # Fetch staking rewards
103
+ # Fetch staking rewards for a list of addresses
104
+ # @param fetch_staking_rewards_request [FetchStakingRewardsRequest]
105
+ # @param [Hash] opts the optional parameters
106
+ # @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 50.
107
+ # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
108
+ # @return [Array<(FetchStakingRewards200Response, Integer, Hash)>] FetchStakingRewards200Response data, response status code and response headers
109
+ def fetch_staking_rewards_with_http_info(fetch_staking_rewards_request, opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: StakeApi.fetch_staking_rewards ...'
112
+ end
113
+ # verify the required parameter 'fetch_staking_rewards_request' is set
114
+ if @api_client.config.client_side_validation && fetch_staking_rewards_request.nil?
115
+ fail ArgumentError, "Missing the required parameter 'fetch_staking_rewards_request' when calling StakeApi.fetch_staking_rewards"
116
+ end
117
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
118
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling StakeApi.fetch_staking_rewards, the character length must be smaller than or equal to 5000.'
119
+ end
120
+
121
+ # resource path
122
+ local_var_path = '/v1/stake/rewards/search'
123
+
124
+ # query parameters
125
+ query_params = opts[:query_params] || {}
126
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
127
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
128
+
129
+ # header parameters
130
+ header_params = opts[:header_params] || {}
131
+ # HTTP header 'Accept' (if needed)
132
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
133
+ # HTTP header 'Content-Type'
134
+ content_type = @api_client.select_header_content_type(['application/json'])
135
+ if !content_type.nil?
136
+ header_params['Content-Type'] = content_type
137
+ end
138
+
139
+ # form parameters
140
+ form_params = opts[:form_params] || {}
141
+
142
+ # http body (model)
143
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(fetch_staking_rewards_request)
144
+
145
+ # return_type
146
+ return_type = opts[:debug_return_type] || 'FetchStakingRewards200Response'
147
+
148
+ # auth_names
149
+ auth_names = opts[:debug_auth_names] || []
150
+
151
+ new_options = opts.merge(
152
+ :operation => :"StakeApi.fetch_staking_rewards",
153
+ :header_params => header_params,
154
+ :query_params => query_params,
155
+ :form_params => form_params,
156
+ :body => post_body,
157
+ :auth_names => auth_names,
158
+ :return_type => return_type
159
+ )
160
+
161
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug "API called: StakeApi#fetch_staking_rewards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
164
+ end
165
+ return data, status_code, headers
166
+ end
167
+
168
+ # Get staking context
169
+ # Get staking context for an address
170
+ # @param get_staking_context_request [GetStakingContextRequest]
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [StakingContext]
173
+ def get_staking_context(get_staking_context_request, opts = {})
174
+ data, _status_code, _headers = get_staking_context_with_http_info(get_staking_context_request, opts)
175
+ data
176
+ end
177
+
178
+ # Get staking context
179
+ # Get staking context for an address
180
+ # @param get_staking_context_request [GetStakingContextRequest]
181
+ # @param [Hash] opts the optional parameters
182
+ # @return [Array<(StakingContext, Integer, Hash)>] StakingContext data, response status code and response headers
183
+ def get_staking_context_with_http_info(get_staking_context_request, opts = {})
184
+ if @api_client.config.debugging
185
+ @api_client.config.logger.debug 'Calling API: StakeApi.get_staking_context ...'
186
+ end
187
+ # verify the required parameter 'get_staking_context_request' is set
188
+ if @api_client.config.client_side_validation && get_staking_context_request.nil?
189
+ fail ArgumentError, "Missing the required parameter 'get_staking_context_request' when calling StakeApi.get_staking_context"
190
+ end
191
+ # resource path
192
+ local_var_path = '/v1/stake/context'
193
+
194
+ # query parameters
195
+ query_params = opts[:query_params] || {}
196
+
197
+ # header parameters
198
+ header_params = opts[:header_params] || {}
199
+ # HTTP header 'Accept' (if needed)
200
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
201
+ # HTTP header 'Content-Type'
202
+ content_type = @api_client.select_header_content_type(['application/json'])
203
+ if !content_type.nil?
204
+ header_params['Content-Type'] = content_type
205
+ end
206
+
207
+ # form parameters
208
+ form_params = opts[:form_params] || {}
209
+
210
+ # http body (model)
211
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(get_staking_context_request)
212
+
213
+ # return_type
214
+ return_type = opts[:debug_return_type] || 'StakingContext'
215
+
216
+ # auth_names
217
+ auth_names = opts[:debug_auth_names] || []
218
+
219
+ new_options = opts.merge(
220
+ :operation => :"StakeApi.get_staking_context",
221
+ :header_params => header_params,
222
+ :query_params => query_params,
223
+ :form_params => form_params,
224
+ :body => post_body,
225
+ :auth_names => auth_names,
226
+ :return_type => return_type
227
+ )
228
+
229
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
230
+ if @api_client.config.debugging
231
+ @api_client.config.logger.debug "API called: StakeApi#get_staking_context\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
232
+ end
233
+ return data, status_code, headers
234
+ end
85
235
  end
86
236
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -249,7 +249,7 @@ module Coinbase::Client
249
249
  # @param [String] mime MIME
250
250
  # @return [Boolean] True if the MIME is application/json
251
251
  def json_mime?(mime)
252
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
252
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
253
253
  end
254
254
 
255
255
  # Deserialize the response to the given return type.
@@ -328,7 +328,7 @@ module Coinbase::Client
328
328
  # @param [String] filename the filename to be sanitized
329
329
  # @return [String] the sanitized filename
330
330
  def sanitize_filename(filename)
331
- filename.gsub(/.*[\/\\]/, '')
331
+ filename.split(/[\/\\]/).last
332
332
  end
333
333
 
334
334
  def build_request_url(path, opts = {})
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12