coinbase-sdk 0.7.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coinbase/address.rb +8 -3
- data/lib/coinbase/client/api/external_addresses_api.rb +78 -0
- data/lib/coinbase/client/api/fund_api.rb +336 -0
- data/lib/coinbase/client/api/onchain_identity_api.rb +108 -0
- data/lib/coinbase/client/api/smart_contracts_api.rb +80 -0
- data/lib/coinbase/client/api/webhooks_api.rb +5 -5
- data/lib/coinbase/client/models/create_fund_operation_request.rb +249 -0
- data/lib/coinbase/client/models/create_fund_quote_request.rb +239 -0
- data/lib/coinbase/client/models/create_wallet_webhook_request.rb +1 -1
- data/lib/coinbase/client/models/crypto_amount.rb +239 -0
- data/lib/coinbase/client/models/ethereum_token_transfer.rb +327 -0
- data/lib/coinbase/client/models/ethereum_transaction.rb +12 -1
- data/lib/coinbase/client/models/faucet_transaction.rb +20 -4
- data/lib/coinbase/client/models/fiat_amount.rb +240 -0
- data/lib/coinbase/client/models/fund_operation.rb +373 -0
- data/lib/coinbase/client/models/fund_operation_fees.rb +238 -0
- data/lib/coinbase/client/models/fund_operation_list.rb +275 -0
- data/lib/coinbase/client/models/fund_quote.rb +339 -0
- data/lib/coinbase/client/models/onchain_name.rb +357 -0
- data/lib/coinbase/client/models/onchain_name_list.rb +262 -0
- data/lib/coinbase/client/models/read_contract_request.rb +249 -0
- data/lib/coinbase/client/models/solidity_value.rb +287 -0
- data/lib/coinbase/client/models/token_transfer_type.rb +43 -0
- data/lib/coinbase/client/models/update_webhook_request.rb +0 -7
- data/lib/coinbase/client.rb +17 -0
- data/lib/coinbase/faucet_transaction.rb +64 -4
- data/lib/coinbase/smart_contract.rb +95 -0
- data/lib/coinbase/transaction.rb +8 -2
- data/lib/coinbase/version.rb +1 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29ac718bb1a79d86c1c626ff064e1ee9161e823a013d70479ef66557433f0729
|
4
|
+
data.tar.gz: 43cc2a356b086de2f1c59df45a6fcedfe3a6899c219c96743f682d2a176c75cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d314ce486da8317c575c2663a402c1b11bda90d8116e523b389d29e09c823af7251ded4f94dc9469106676d73e4376ec28e0ff944f4e480f39ac421bb83d6f02
|
7
|
+
data.tar.gz: 0c59e91c5175612a2ac5b5433880ec4c10286f406fc4ec48f17272566b1c5416612c4d225d27eb5b2731e1da2864865e138131c4bdf6fa8a4a292bc205ece738
|
data/lib/coinbase/address.rb
CHANGED
@@ -91,11 +91,16 @@ module Coinbase
|
|
91
91
|
# @raise [Coinbase::FaucetLimitReachedError] If the faucet limit has been reached for the address or user.
|
92
92
|
# @raise [Coinbase::Client::ApiError] If an unexpected error occurs while requesting faucet funds.
|
93
93
|
def faucet(asset_id: nil)
|
94
|
-
opts = { asset_id: asset_id }.compact
|
95
|
-
|
96
94
|
Coinbase.call_api do
|
97
95
|
Coinbase::FaucetTransaction.new(
|
98
|
-
addresses_api.request_external_faucet_funds(
|
96
|
+
addresses_api.request_external_faucet_funds(
|
97
|
+
network.normalized_id,
|
98
|
+
id,
|
99
|
+
{
|
100
|
+
asset_id: asset_id,
|
101
|
+
skip_wait: true
|
102
|
+
}.compact
|
103
|
+
)
|
99
104
|
)
|
100
105
|
end
|
101
106
|
end
|
@@ -94,6 +94,81 @@ module Coinbase::Client
|
|
94
94
|
return data, status_code, headers
|
95
95
|
end
|
96
96
|
|
97
|
+
# Get the status of a faucet transaction
|
98
|
+
# Get the status of a faucet transaction
|
99
|
+
# @param network_id [String] The ID of the blockchain network
|
100
|
+
# @param address_id [String] The ID of the address to fetch the faucet transaction for
|
101
|
+
# @param tx_hash [String] The hash of the faucet transaction
|
102
|
+
# @param [Hash] opts the optional parameters
|
103
|
+
# @return [FaucetTransaction]
|
104
|
+
def get_faucet_transaction(network_id, address_id, tx_hash, opts = {})
|
105
|
+
data, _status_code, _headers = get_faucet_transaction_with_http_info(network_id, address_id, tx_hash, opts)
|
106
|
+
data
|
107
|
+
end
|
108
|
+
|
109
|
+
# Get the status of a faucet transaction
|
110
|
+
# Get the status of a faucet transaction
|
111
|
+
# @param network_id [String] The ID of the blockchain network
|
112
|
+
# @param address_id [String] The ID of the address to fetch the faucet transaction for
|
113
|
+
# @param tx_hash [String] The hash of the faucet transaction
|
114
|
+
# @param [Hash] opts the optional parameters
|
115
|
+
# @return [Array<(FaucetTransaction, Integer, Hash)>] FaucetTransaction data, response status code and response headers
|
116
|
+
def get_faucet_transaction_with_http_info(network_id, address_id, tx_hash, opts = {})
|
117
|
+
if @api_client.config.debugging
|
118
|
+
@api_client.config.logger.debug 'Calling API: ExternalAddressesApi.get_faucet_transaction ...'
|
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.get_faucet_transaction"
|
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.get_faucet_transaction"
|
127
|
+
end
|
128
|
+
# verify the required parameter 'tx_hash' is set
|
129
|
+
if @api_client.config.client_side_validation && tx_hash.nil?
|
130
|
+
fail ArgumentError, "Missing the required parameter 'tx_hash' when calling ExternalAddressesApi.get_faucet_transaction"
|
131
|
+
end
|
132
|
+
# resource path
|
133
|
+
local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/faucet/{tx_hash}'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'tx_hash' + '}', CGI.escape(tx_hash.to_s))
|
134
|
+
|
135
|
+
# query parameters
|
136
|
+
query_params = opts[:query_params] || {}
|
137
|
+
|
138
|
+
# header parameters
|
139
|
+
header_params = opts[:header_params] || {}
|
140
|
+
# HTTP header 'Accept' (if needed)
|
141
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
142
|
+
|
143
|
+
# form parameters
|
144
|
+
form_params = opts[:form_params] || {}
|
145
|
+
|
146
|
+
# http body (model)
|
147
|
+
post_body = opts[:debug_body]
|
148
|
+
|
149
|
+
# return_type
|
150
|
+
return_type = opts[:debug_return_type] || 'FaucetTransaction'
|
151
|
+
|
152
|
+
# auth_names
|
153
|
+
auth_names = opts[:debug_auth_names] || []
|
154
|
+
|
155
|
+
new_options = opts.merge(
|
156
|
+
:operation => :"ExternalAddressesApi.get_faucet_transaction",
|
157
|
+
:header_params => header_params,
|
158
|
+
:query_params => query_params,
|
159
|
+
:form_params => form_params,
|
160
|
+
:body => post_body,
|
161
|
+
:auth_names => auth_names,
|
162
|
+
:return_type => return_type
|
163
|
+
)
|
164
|
+
|
165
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug "API called: ExternalAddressesApi#get_faucet_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
168
|
+
end
|
169
|
+
return data, status_code, headers
|
170
|
+
end
|
171
|
+
|
97
172
|
# Get the balances of an external address
|
98
173
|
# List all of the balances of an external address
|
99
174
|
# @param network_id [String] The ID of the blockchain network
|
@@ -176,6 +251,7 @@ module Coinbase::Client
|
|
176
251
|
# @param address_id [String] The onchain address of the address that is being fetched.
|
177
252
|
# @param [Hash] opts the optional parameters
|
178
253
|
# @option opts [String] :asset_id The ID of the asset to transfer from the faucet.
|
254
|
+
# @option opts [Boolean] :skip_wait Whether to skip waiting for the transaction to be mined. This will become the default behavior in the future.
|
179
255
|
# @return [FaucetTransaction]
|
180
256
|
def request_external_faucet_funds(network_id, address_id, opts = {})
|
181
257
|
data, _status_code, _headers = request_external_faucet_funds_with_http_info(network_id, address_id, opts)
|
@@ -188,6 +264,7 @@ module Coinbase::Client
|
|
188
264
|
# @param address_id [String] The onchain address of the address that is being fetched.
|
189
265
|
# @param [Hash] opts the optional parameters
|
190
266
|
# @option opts [String] :asset_id The ID of the asset to transfer from the faucet.
|
267
|
+
# @option opts [Boolean] :skip_wait Whether to skip waiting for the transaction to be mined. This will become the default behavior in the future.
|
191
268
|
# @return [Array<(FaucetTransaction, Integer, Hash)>] FaucetTransaction data, response status code and response headers
|
192
269
|
def request_external_faucet_funds_with_http_info(network_id, address_id, opts = {})
|
193
270
|
if @api_client.config.debugging
|
@@ -207,6 +284,7 @@ module Coinbase::Client
|
|
207
284
|
# query parameters
|
208
285
|
query_params = opts[:query_params] || {}
|
209
286
|
query_params[:'asset_id'] = opts[:'asset_id'] if !opts[:'asset_id'].nil?
|
287
|
+
query_params[:'skip_wait'] = opts[:'skip_wait'] if !opts[:'skip_wait'].nil?
|
210
288
|
|
211
289
|
# header parameters
|
212
290
|
header_params = opts[:header_params] || {}
|
@@ -0,0 +1,336 @@
|
|
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
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.8.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Coinbase::Client
|
16
|
+
class FundApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create a new fund operation.
|
23
|
+
# Create a new fund operation with an address.
|
24
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
25
|
+
# @param address_id [String] The onchain address to be funded.
|
26
|
+
# @param create_fund_operation_request [CreateFundOperationRequest]
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @return [FundOperation]
|
29
|
+
def create_fund_operation(wallet_id, address_id, create_fund_operation_request, opts = {})
|
30
|
+
data, _status_code, _headers = create_fund_operation_with_http_info(wallet_id, address_id, create_fund_operation_request, opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create a new fund operation.
|
35
|
+
# Create a new fund operation with an address.
|
36
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
37
|
+
# @param address_id [String] The onchain address to be funded.
|
38
|
+
# @param create_fund_operation_request [CreateFundOperationRequest]
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [Array<(FundOperation, Integer, Hash)>] FundOperation data, response status code and response headers
|
41
|
+
def create_fund_operation_with_http_info(wallet_id, address_id, create_fund_operation_request, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: FundApi.create_fund_operation ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'wallet_id' is set
|
46
|
+
if @api_client.config.client_side_validation && wallet_id.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling FundApi.create_fund_operation"
|
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 FundApi.create_fund_operation"
|
52
|
+
end
|
53
|
+
# verify the required parameter 'create_fund_operation_request' is set
|
54
|
+
if @api_client.config.client_side_validation && create_fund_operation_request.nil?
|
55
|
+
fail ArgumentError, "Missing the required parameter 'create_fund_operation_request' when calling FundApi.create_fund_operation"
|
56
|
+
end
|
57
|
+
# resource path
|
58
|
+
local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/fund_operations'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_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']) unless header_params['Accept']
|
67
|
+
# HTTP header 'Content-Type'
|
68
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
69
|
+
if !content_type.nil?
|
70
|
+
header_params['Content-Type'] = content_type
|
71
|
+
end
|
72
|
+
|
73
|
+
# form parameters
|
74
|
+
form_params = opts[:form_params] || {}
|
75
|
+
|
76
|
+
# http body (model)
|
77
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_fund_operation_request)
|
78
|
+
|
79
|
+
# return_type
|
80
|
+
return_type = opts[:debug_return_type] || 'FundOperation'
|
81
|
+
|
82
|
+
# auth_names
|
83
|
+
auth_names = opts[:debug_auth_names] || []
|
84
|
+
|
85
|
+
new_options = opts.merge(
|
86
|
+
:operation => :"FundApi.create_fund_operation",
|
87
|
+
:header_params => header_params,
|
88
|
+
:query_params => query_params,
|
89
|
+
:form_params => form_params,
|
90
|
+
:body => post_body,
|
91
|
+
:auth_names => auth_names,
|
92
|
+
:return_type => return_type
|
93
|
+
)
|
94
|
+
|
95
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
96
|
+
if @api_client.config.debugging
|
97
|
+
@api_client.config.logger.debug "API called: FundApi#create_fund_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
98
|
+
end
|
99
|
+
return data, status_code, headers
|
100
|
+
end
|
101
|
+
|
102
|
+
# Create a Fund Operation quote.
|
103
|
+
# Create a new fund operation with an address.
|
104
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
105
|
+
# @param address_id [String] The onchain address to be funded.
|
106
|
+
# @param create_fund_quote_request [CreateFundQuoteRequest]
|
107
|
+
# @param [Hash] opts the optional parameters
|
108
|
+
# @return [FundQuote]
|
109
|
+
def create_fund_quote(wallet_id, address_id, create_fund_quote_request, opts = {})
|
110
|
+
data, _status_code, _headers = create_fund_quote_with_http_info(wallet_id, address_id, create_fund_quote_request, opts)
|
111
|
+
data
|
112
|
+
end
|
113
|
+
|
114
|
+
# Create a Fund Operation quote.
|
115
|
+
# Create a new fund operation with an address.
|
116
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
117
|
+
# @param address_id [String] The onchain address to be funded.
|
118
|
+
# @param create_fund_quote_request [CreateFundQuoteRequest]
|
119
|
+
# @param [Hash] opts the optional parameters
|
120
|
+
# @return [Array<(FundQuote, Integer, Hash)>] FundQuote data, response status code and response headers
|
121
|
+
def create_fund_quote_with_http_info(wallet_id, address_id, create_fund_quote_request, opts = {})
|
122
|
+
if @api_client.config.debugging
|
123
|
+
@api_client.config.logger.debug 'Calling API: FundApi.create_fund_quote ...'
|
124
|
+
end
|
125
|
+
# verify the required parameter 'wallet_id' is set
|
126
|
+
if @api_client.config.client_side_validation && wallet_id.nil?
|
127
|
+
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling FundApi.create_fund_quote"
|
128
|
+
end
|
129
|
+
# verify the required parameter 'address_id' is set
|
130
|
+
if @api_client.config.client_side_validation && address_id.nil?
|
131
|
+
fail ArgumentError, "Missing the required parameter 'address_id' when calling FundApi.create_fund_quote"
|
132
|
+
end
|
133
|
+
# verify the required parameter 'create_fund_quote_request' is set
|
134
|
+
if @api_client.config.client_side_validation && create_fund_quote_request.nil?
|
135
|
+
fail ArgumentError, "Missing the required parameter 'create_fund_quote_request' when calling FundApi.create_fund_quote"
|
136
|
+
end
|
137
|
+
# resource path
|
138
|
+
local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/fund_operations/quote'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
|
139
|
+
|
140
|
+
# query parameters
|
141
|
+
query_params = opts[:query_params] || {}
|
142
|
+
|
143
|
+
# header parameters
|
144
|
+
header_params = opts[:header_params] || {}
|
145
|
+
# HTTP header 'Accept' (if needed)
|
146
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
147
|
+
# HTTP header 'Content-Type'
|
148
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
149
|
+
if !content_type.nil?
|
150
|
+
header_params['Content-Type'] = content_type
|
151
|
+
end
|
152
|
+
|
153
|
+
# form parameters
|
154
|
+
form_params = opts[:form_params] || {}
|
155
|
+
|
156
|
+
# http body (model)
|
157
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_fund_quote_request)
|
158
|
+
|
159
|
+
# return_type
|
160
|
+
return_type = opts[:debug_return_type] || 'FundQuote'
|
161
|
+
|
162
|
+
# auth_names
|
163
|
+
auth_names = opts[:debug_auth_names] || []
|
164
|
+
|
165
|
+
new_options = opts.merge(
|
166
|
+
:operation => :"FundApi.create_fund_quote",
|
167
|
+
:header_params => header_params,
|
168
|
+
:query_params => query_params,
|
169
|
+
:form_params => form_params,
|
170
|
+
:body => post_body,
|
171
|
+
:auth_names => auth_names,
|
172
|
+
:return_type => return_type
|
173
|
+
)
|
174
|
+
|
175
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
176
|
+
if @api_client.config.debugging
|
177
|
+
@api_client.config.logger.debug "API called: FundApi#create_fund_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
178
|
+
end
|
179
|
+
return data, status_code, headers
|
180
|
+
end
|
181
|
+
|
182
|
+
# Get fund operation.
|
183
|
+
# Get fund operation.
|
184
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
185
|
+
# @param address_id [String] The onchain address of the address that created the fund operation.
|
186
|
+
# @param fund_operation_id [String] The ID of the fund operation to fetch.
|
187
|
+
# @param [Hash] opts the optional parameters
|
188
|
+
# @return [FundOperation]
|
189
|
+
def get_fund_operation(wallet_id, address_id, fund_operation_id, opts = {})
|
190
|
+
data, _status_code, _headers = get_fund_operation_with_http_info(wallet_id, address_id, fund_operation_id, opts)
|
191
|
+
data
|
192
|
+
end
|
193
|
+
|
194
|
+
# Get fund operation.
|
195
|
+
# Get fund operation.
|
196
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
197
|
+
# @param address_id [String] The onchain address of the address that created the fund operation.
|
198
|
+
# @param fund_operation_id [String] The ID of the fund operation to fetch.
|
199
|
+
# @param [Hash] opts the optional parameters
|
200
|
+
# @return [Array<(FundOperation, Integer, Hash)>] FundOperation data, response status code and response headers
|
201
|
+
def get_fund_operation_with_http_info(wallet_id, address_id, fund_operation_id, opts = {})
|
202
|
+
if @api_client.config.debugging
|
203
|
+
@api_client.config.logger.debug 'Calling API: FundApi.get_fund_operation ...'
|
204
|
+
end
|
205
|
+
# verify the required parameter 'wallet_id' is set
|
206
|
+
if @api_client.config.client_side_validation && wallet_id.nil?
|
207
|
+
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling FundApi.get_fund_operation"
|
208
|
+
end
|
209
|
+
# verify the required parameter 'address_id' is set
|
210
|
+
if @api_client.config.client_side_validation && address_id.nil?
|
211
|
+
fail ArgumentError, "Missing the required parameter 'address_id' when calling FundApi.get_fund_operation"
|
212
|
+
end
|
213
|
+
# verify the required parameter 'fund_operation_id' is set
|
214
|
+
if @api_client.config.client_side_validation && fund_operation_id.nil?
|
215
|
+
fail ArgumentError, "Missing the required parameter 'fund_operation_id' when calling FundApi.get_fund_operation"
|
216
|
+
end
|
217
|
+
# resource path
|
218
|
+
local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/fund_operations/{fund_operation_id}'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'fund_operation_id' + '}', CGI.escape(fund_operation_id.to_s))
|
219
|
+
|
220
|
+
# query parameters
|
221
|
+
query_params = opts[:query_params] || {}
|
222
|
+
|
223
|
+
# header parameters
|
224
|
+
header_params = opts[:header_params] || {}
|
225
|
+
# HTTP header 'Accept' (if needed)
|
226
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
227
|
+
|
228
|
+
# form parameters
|
229
|
+
form_params = opts[:form_params] || {}
|
230
|
+
|
231
|
+
# http body (model)
|
232
|
+
post_body = opts[:debug_body]
|
233
|
+
|
234
|
+
# return_type
|
235
|
+
return_type = opts[:debug_return_type] || 'FundOperation'
|
236
|
+
|
237
|
+
# auth_names
|
238
|
+
auth_names = opts[:debug_auth_names] || []
|
239
|
+
|
240
|
+
new_options = opts.merge(
|
241
|
+
:operation => :"FundApi.get_fund_operation",
|
242
|
+
:header_params => header_params,
|
243
|
+
:query_params => query_params,
|
244
|
+
:form_params => form_params,
|
245
|
+
:body => post_body,
|
246
|
+
:auth_names => auth_names,
|
247
|
+
:return_type => return_type
|
248
|
+
)
|
249
|
+
|
250
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
251
|
+
if @api_client.config.debugging
|
252
|
+
@api_client.config.logger.debug "API called: FundApi#get_fund_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
253
|
+
end
|
254
|
+
return data, status_code, headers
|
255
|
+
end
|
256
|
+
|
257
|
+
# List fund operations for an address.
|
258
|
+
# List fund operations for an address.
|
259
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
260
|
+
# @param address_id [String] The onchain address of the address to list fund operations for.
|
261
|
+
# @param [Hash] opts the optional parameters
|
262
|
+
# @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.
|
263
|
+
# @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.
|
264
|
+
# @return [FundOperationList]
|
265
|
+
def list_fund_operations(wallet_id, address_id, opts = {})
|
266
|
+
data, _status_code, _headers = list_fund_operations_with_http_info(wallet_id, address_id, opts)
|
267
|
+
data
|
268
|
+
end
|
269
|
+
|
270
|
+
# List fund operations for an address.
|
271
|
+
# List fund operations for an address.
|
272
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
273
|
+
# @param address_id [String] The onchain address of the address to list fund operations for.
|
274
|
+
# @param [Hash] opts the optional parameters
|
275
|
+
# @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.
|
276
|
+
# @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.
|
277
|
+
# @return [Array<(FundOperationList, Integer, Hash)>] FundOperationList data, response status code and response headers
|
278
|
+
def list_fund_operations_with_http_info(wallet_id, address_id, opts = {})
|
279
|
+
if @api_client.config.debugging
|
280
|
+
@api_client.config.logger.debug 'Calling API: FundApi.list_fund_operations ...'
|
281
|
+
end
|
282
|
+
# verify the required parameter 'wallet_id' is set
|
283
|
+
if @api_client.config.client_side_validation && wallet_id.nil?
|
284
|
+
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling FundApi.list_fund_operations"
|
285
|
+
end
|
286
|
+
# verify the required parameter 'address_id' is set
|
287
|
+
if @api_client.config.client_side_validation && address_id.nil?
|
288
|
+
fail ArgumentError, "Missing the required parameter 'address_id' when calling FundApi.list_fund_operations"
|
289
|
+
end
|
290
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
|
291
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling FundApi.list_fund_operations, the character length must be smaller than or equal to 5000.'
|
292
|
+
end
|
293
|
+
|
294
|
+
# resource path
|
295
|
+
local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/fund_operations'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
|
296
|
+
|
297
|
+
# query parameters
|
298
|
+
query_params = opts[:query_params] || {}
|
299
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
300
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
301
|
+
|
302
|
+
# header parameters
|
303
|
+
header_params = opts[:header_params] || {}
|
304
|
+
# HTTP header 'Accept' (if needed)
|
305
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
306
|
+
|
307
|
+
# form parameters
|
308
|
+
form_params = opts[:form_params] || {}
|
309
|
+
|
310
|
+
# http body (model)
|
311
|
+
post_body = opts[:debug_body]
|
312
|
+
|
313
|
+
# return_type
|
314
|
+
return_type = opts[:debug_return_type] || 'FundOperationList'
|
315
|
+
|
316
|
+
# auth_names
|
317
|
+
auth_names = opts[:debug_auth_names] || []
|
318
|
+
|
319
|
+
new_options = opts.merge(
|
320
|
+
:operation => :"FundApi.list_fund_operations",
|
321
|
+
:header_params => header_params,
|
322
|
+
:query_params => query_params,
|
323
|
+
:form_params => form_params,
|
324
|
+
:body => post_body,
|
325
|
+
:auth_names => auth_names,
|
326
|
+
:return_type => return_type
|
327
|
+
)
|
328
|
+
|
329
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
330
|
+
if @api_client.config.debugging
|
331
|
+
@api_client.config.logger.debug "API called: FundApi#list_fund_operations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
332
|
+
end
|
333
|
+
return data, status_code, headers
|
334
|
+
end
|
335
|
+
end
|
336
|
+
end
|
@@ -0,0 +1,108 @@
|
|
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
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.8.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Coinbase::Client
|
16
|
+
class OnchainIdentityApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Obtains onchain identity for an address on a specific network
|
23
|
+
# Obtains onchain identity for an address on a specific network
|
24
|
+
# @param network_id [String] The ID of the blockchain network
|
25
|
+
# @param address_id [String] The ID of the address to fetch the identity for
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [Array<String>] :roles A filter by role of the names related to this address (managed or owned)
|
28
|
+
# @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.
|
29
|
+
# @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.
|
30
|
+
# @return [OnchainNameList]
|
31
|
+
def resolve_identity_by_address(network_id, address_id, opts = {})
|
32
|
+
data, _status_code, _headers = resolve_identity_by_address_with_http_info(network_id, address_id, opts)
|
33
|
+
data
|
34
|
+
end
|
35
|
+
|
36
|
+
# Obtains onchain identity for an address on a specific network
|
37
|
+
# Obtains onchain identity for an address on a specific network
|
38
|
+
# @param network_id [String] The ID of the blockchain network
|
39
|
+
# @param address_id [String] The ID of the address to fetch the identity for
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @option opts [Array<String>] :roles A filter by role of the names related to this address (managed or owned)
|
42
|
+
# @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.
|
43
|
+
# @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.
|
44
|
+
# @return [Array<(OnchainNameList, Integer, Hash)>] OnchainNameList data, response status code and response headers
|
45
|
+
def resolve_identity_by_address_with_http_info(network_id, address_id, opts = {})
|
46
|
+
if @api_client.config.debugging
|
47
|
+
@api_client.config.logger.debug 'Calling API: OnchainIdentityApi.resolve_identity_by_address ...'
|
48
|
+
end
|
49
|
+
# verify the required parameter 'network_id' is set
|
50
|
+
if @api_client.config.client_side_validation && network_id.nil?
|
51
|
+
fail ArgumentError, "Missing the required parameter 'network_id' when calling OnchainIdentityApi.resolve_identity_by_address"
|
52
|
+
end
|
53
|
+
# verify the required parameter 'address_id' is set
|
54
|
+
if @api_client.config.client_side_validation && address_id.nil?
|
55
|
+
fail ArgumentError, "Missing the required parameter 'address_id' when calling OnchainIdentityApi.resolve_identity_by_address"
|
56
|
+
end
|
57
|
+
allowable_values = ["managed", "owned", "unknown_default_open_api"]
|
58
|
+
if @api_client.config.client_side_validation && opts[:'roles'] && !opts[:'roles'].all? { |item| allowable_values.include?(item) }
|
59
|
+
fail ArgumentError, "invalid value for \"roles\", must include one of #{allowable_values}"
|
60
|
+
end
|
61
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
|
62
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling OnchainIdentityApi.resolve_identity_by_address, the character length must be smaller than or equal to 5000.'
|
63
|
+
end
|
64
|
+
|
65
|
+
# resource path
|
66
|
+
local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/identity'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
|
67
|
+
|
68
|
+
# query parameters
|
69
|
+
query_params = opts[:query_params] || {}
|
70
|
+
query_params[:'roles'] = @api_client.build_collection_param(opts[:'roles'], :csv) if !opts[:'roles'].nil?
|
71
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
72
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
73
|
+
|
74
|
+
# header parameters
|
75
|
+
header_params = opts[:header_params] || {}
|
76
|
+
# HTTP header 'Accept' (if needed)
|
77
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
78
|
+
|
79
|
+
# form parameters
|
80
|
+
form_params = opts[:form_params] || {}
|
81
|
+
|
82
|
+
# http body (model)
|
83
|
+
post_body = opts[:debug_body]
|
84
|
+
|
85
|
+
# return_type
|
86
|
+
return_type = opts[:debug_return_type] || 'OnchainNameList'
|
87
|
+
|
88
|
+
# auth_names
|
89
|
+
auth_names = opts[:debug_auth_names] || []
|
90
|
+
|
91
|
+
new_options = opts.merge(
|
92
|
+
:operation => :"OnchainIdentityApi.resolve_identity_by_address",
|
93
|
+
:header_params => header_params,
|
94
|
+
:query_params => query_params,
|
95
|
+
:form_params => form_params,
|
96
|
+
:body => post_body,
|
97
|
+
:auth_names => auth_names,
|
98
|
+
:return_type => return_type
|
99
|
+
)
|
100
|
+
|
101
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug "API called: OnchainIdentityApi#resolve_identity_by_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
104
|
+
end
|
105
|
+
return data, status_code, headers
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -328,5 +328,85 @@ module Coinbase::Client
|
|
328
328
|
end
|
329
329
|
return data, status_code, headers
|
330
330
|
end
|
331
|
+
|
332
|
+
# Read data from a smart contract
|
333
|
+
# Perform a read operation on a smart contract without creating a transaction
|
334
|
+
# @param network_id [String]
|
335
|
+
# @param contract_address [String]
|
336
|
+
# @param read_contract_request [ReadContractRequest]
|
337
|
+
# @param [Hash] opts the optional parameters
|
338
|
+
# @return [SolidityValue]
|
339
|
+
def read_contract(network_id, contract_address, read_contract_request, opts = {})
|
340
|
+
data, _status_code, _headers = read_contract_with_http_info(network_id, contract_address, read_contract_request, opts)
|
341
|
+
data
|
342
|
+
end
|
343
|
+
|
344
|
+
# Read data from a smart contract
|
345
|
+
# Perform a read operation on a smart contract without creating a transaction
|
346
|
+
# @param network_id [String]
|
347
|
+
# @param contract_address [String]
|
348
|
+
# @param read_contract_request [ReadContractRequest]
|
349
|
+
# @param [Hash] opts the optional parameters
|
350
|
+
# @return [Array<(SolidityValue, Integer, Hash)>] SolidityValue data, response status code and response headers
|
351
|
+
def read_contract_with_http_info(network_id, contract_address, read_contract_request, opts = {})
|
352
|
+
if @api_client.config.debugging
|
353
|
+
@api_client.config.logger.debug 'Calling API: SmartContractsApi.read_contract ...'
|
354
|
+
end
|
355
|
+
# verify the required parameter 'network_id' is set
|
356
|
+
if @api_client.config.client_side_validation && network_id.nil?
|
357
|
+
fail ArgumentError, "Missing the required parameter 'network_id' when calling SmartContractsApi.read_contract"
|
358
|
+
end
|
359
|
+
# verify the required parameter 'contract_address' is set
|
360
|
+
if @api_client.config.client_side_validation && contract_address.nil?
|
361
|
+
fail ArgumentError, "Missing the required parameter 'contract_address' when calling SmartContractsApi.read_contract"
|
362
|
+
end
|
363
|
+
# verify the required parameter 'read_contract_request' is set
|
364
|
+
if @api_client.config.client_side_validation && read_contract_request.nil?
|
365
|
+
fail ArgumentError, "Missing the required parameter 'read_contract_request' when calling SmartContractsApi.read_contract"
|
366
|
+
end
|
367
|
+
# resource path
|
368
|
+
local_var_path = '/v1/networks/{network_id}/smart_contracts/{contract_address}/read'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'contract_address' + '}', CGI.escape(contract_address.to_s))
|
369
|
+
|
370
|
+
# query parameters
|
371
|
+
query_params = opts[:query_params] || {}
|
372
|
+
|
373
|
+
# header parameters
|
374
|
+
header_params = opts[:header_params] || {}
|
375
|
+
# HTTP header 'Accept' (if needed)
|
376
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
377
|
+
# HTTP header 'Content-Type'
|
378
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
379
|
+
if !content_type.nil?
|
380
|
+
header_params['Content-Type'] = content_type
|
381
|
+
end
|
382
|
+
|
383
|
+
# form parameters
|
384
|
+
form_params = opts[:form_params] || {}
|
385
|
+
|
386
|
+
# http body (model)
|
387
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(read_contract_request)
|
388
|
+
|
389
|
+
# return_type
|
390
|
+
return_type = opts[:debug_return_type] || 'SolidityValue'
|
391
|
+
|
392
|
+
# auth_names
|
393
|
+
auth_names = opts[:debug_auth_names] || []
|
394
|
+
|
395
|
+
new_options = opts.merge(
|
396
|
+
:operation => :"SmartContractsApi.read_contract",
|
397
|
+
:header_params => header_params,
|
398
|
+
:query_params => query_params,
|
399
|
+
:form_params => form_params,
|
400
|
+
:body => post_body,
|
401
|
+
:auth_names => auth_names,
|
402
|
+
:return_type => return_type
|
403
|
+
)
|
404
|
+
|
405
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
406
|
+
if @api_client.config.debugging
|
407
|
+
@api_client.config.logger.debug "API called: SmartContractsApi#read_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
408
|
+
end
|
409
|
+
return data, status_code, headers
|
410
|
+
end
|
331
411
|
end
|
332
412
|
end
|