coinbase-sdk 0.3.0 → 0.6.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/wallet_address.rb +35 -2
- data/lib/coinbase/address.rb +5 -1
- data/lib/coinbase/client/api/addresses_api.rb +10 -10
- data/lib/coinbase/client/api/assets_api.rb +2 -2
- data/lib/coinbase/client/api/balance_history_api.rb +107 -0
- data/lib/coinbase/client/api/contract_events_api.rb +4 -4
- data/lib/coinbase/client/api/contract_invocations_api.rb +5 -5
- data/lib/coinbase/client/api/external_addresses_api.rb +5 -90
- data/lib/coinbase/client/api/networks_api.rb +2 -2
- data/lib/coinbase/client/api/server_signers_api.rb +7 -7
- data/lib/coinbase/client/api/smart_contracts_api.rb +332 -0
- data/lib/coinbase/client/api/stake_api.rb +6 -14
- data/lib/coinbase/client/api/trades_api.rb +5 -5
- data/lib/coinbase/client/api/transfers_api.rb +5 -5
- data/lib/coinbase/client/api/users_api.rb +2 -2
- data/lib/coinbase/client/api/validators_api.rb +3 -3
- data/lib/coinbase/client/api/wallet_stake_api.rb +4 -4
- data/lib/coinbase/client/api/wallets_api.rb +6 -6
- data/lib/coinbase/client/api/webhooks_api.rb +5 -5
- data/lib/coinbase/client/api_client.rb +30 -24
- data/lib/coinbase/client/api_error.rb +1 -1
- data/lib/coinbase/client/configuration.rb +1 -1
- data/lib/coinbase/client/models/address.rb +1 -1
- data/lib/coinbase/client/models/address_balance_list.rb +1 -1
- data/lib/coinbase/client/models/address_historical_balance_list.rb +1 -1
- data/lib/coinbase/client/models/address_list.rb +1 -1
- data/lib/coinbase/client/models/address_transaction_list.rb +1 -1
- data/lib/coinbase/client/models/asset.rb +1 -1
- data/lib/coinbase/client/models/balance.rb +1 -1
- data/lib/coinbase/client/models/broadcast_contract_invocation_request.rb +1 -1
- data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +1 -1
- data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
- data/lib/coinbase/client/models/broadcast_transfer_request.rb +1 -1
- data/lib/coinbase/client/models/build_staking_operation_request.rb +1 -1
- data/lib/coinbase/client/models/contract_event.rb +1 -1
- data/lib/coinbase/client/models/contract_event_list.rb +1 -1
- data/lib/coinbase/client/models/contract_invocation.rb +19 -2
- data/lib/coinbase/client/models/contract_invocation_list.rb +1 -1
- data/lib/coinbase/client/models/create_address_request.rb +1 -1
- data/lib/coinbase/client/models/create_contract_invocation_request.rb +15 -5
- data/lib/coinbase/client/models/create_payload_signature_request.rb +1 -1
- data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
- data/lib/coinbase/client/models/create_smart_contract_request.rb +259 -0
- data/lib/coinbase/client/models/create_staking_operation_request.rb +1 -1
- data/lib/coinbase/client/models/create_trade_request.rb +1 -1
- data/lib/coinbase/client/models/create_transfer_request.rb +2 -2
- data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
- data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
- data/lib/coinbase/client/models/create_webhook_request.rb +11 -9
- data/lib/coinbase/client/models/deploy_smart_contract_request.rb +222 -0
- data/lib/coinbase/client/models/erc20_transfer_event.rb +336 -0
- data/lib/coinbase/client/models/erc721_transfer_event.rb +336 -0
- data/lib/coinbase/client/models/error.rb +15 -5
- data/lib/coinbase/client/models/ethereum_transaction.rb +1 -1
- data/lib/coinbase/client/models/ethereum_transaction_access.rb +1 -1
- data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +1 -1
- data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +1 -1
- data/lib/coinbase/client/models/ethereum_validator_metadata.rb +1 -1
- data/lib/coinbase/client/models/faucet_transaction.rb +1 -1
- data/lib/coinbase/client/models/feature_set.rb +1 -1
- data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +1 -1
- data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
- data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +1 -1
- data/lib/coinbase/client/models/get_staking_context_request.rb +1 -1
- data/lib/coinbase/client/models/historical_balance.rb +1 -1
- data/lib/coinbase/client/models/network.rb +1 -1
- data/lib/coinbase/client/models/network_identifier.rb +3 -2
- data/lib/coinbase/client/models/nft_contract_options.rb +240 -0
- data/lib/coinbase/client/models/payload_signature.rb +1 -1
- data/lib/coinbase/client/models/payload_signature_list.rb +1 -1
- data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
- data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
- data/lib/coinbase/client/models/server_signer.rb +1 -1
- data/lib/coinbase/client/models/server_signer_event.rb +1 -1
- data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
- data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
- data/lib/coinbase/client/models/server_signer_list.rb +1 -1
- data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
- data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
- data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
- data/lib/coinbase/client/models/smart_contract.rb +378 -0
- data/lib/coinbase/client/models/smart_contract_list.rb +257 -0
- data/lib/coinbase/client/models/smart_contract_options.rb +106 -0
- data/lib/coinbase/client/models/smart_contract_type.rb +41 -0
- data/lib/coinbase/client/models/sponsored_send.rb +1 -1
- data/lib/coinbase/client/models/staking_balance.rb +3 -3
- data/lib/coinbase/client/models/staking_context.rb +1 -1
- data/lib/coinbase/client/models/staking_context_context.rb +1 -1
- data/lib/coinbase/client/models/staking_operation.rb +1 -1
- data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
- data/lib/coinbase/client/models/staking_reward.rb +3 -3
- data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
- data/lib/coinbase/client/models/staking_reward_usd_value.rb +1 -1
- data/lib/coinbase/client/models/token_contract_options.rb +257 -0
- data/lib/coinbase/client/models/trade.rb +1 -1
- data/lib/coinbase/client/models/trade_list.rb +1 -1
- data/lib/coinbase/client/models/transaction.rb +1 -1
- data/lib/coinbase/client/models/transaction_content.rb +1 -1
- data/lib/coinbase/client/models/transaction_type.rb +1 -1
- data/lib/coinbase/client/models/transfer.rb +1 -1
- data/lib/coinbase/client/models/transfer_list.rb +1 -1
- data/lib/coinbase/client/models/update_webhook_request.rb +11 -9
- data/lib/coinbase/client/models/user.rb +1 -1
- data/lib/coinbase/client/models/validator.rb +1 -1
- data/lib/coinbase/client/models/validator_details.rb +1 -1
- data/lib/coinbase/client/models/validator_list.rb +1 -1
- data/lib/coinbase/client/models/validator_status.rb +1 -1
- data/lib/coinbase/client/models/wallet.rb +1 -1
- data/lib/coinbase/client/models/wallet_list.rb +1 -1
- data/lib/coinbase/client/models/webhook.rb +11 -2
- data/lib/coinbase/client/models/webhook_event_filter.rb +4 -4
- data/lib/coinbase/client/models/webhook_event_type.rb +3 -2
- data/lib/coinbase/client/models/webhook_event_type_filter.rb +105 -0
- data/lib/coinbase/client/models/webhook_list.rb +1 -1
- data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +228 -0
- data/lib/coinbase/client/version.rb +1 -1
- data/lib/coinbase/client.rb +15 -1
- data/lib/coinbase/contract_invocation.rb +34 -10
- data/lib/coinbase/smart_contract.rb +216 -45
- data/lib/coinbase/transaction.rb +3 -0
- data/lib/coinbase/transfer.rb +1 -1
- data/lib/coinbase/version.rb +1 -1
- data/lib/coinbase/wallet.rb +11 -2
- metadata +16 -2
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.8.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -47,7 +47,7 @@ module Coinbase::Client
|
|
47
47
|
# header parameters
|
48
48
|
header_params = opts[:header_params] || {}
|
49
49
|
# HTTP header 'Accept' (if needed)
|
50
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
51
51
|
# HTTP header 'Content-Type'
|
52
52
|
content_type = @api_client.select_header_content_type(['application/json'])
|
53
53
|
if !content_type.nil?
|
@@ -115,7 +115,7 @@ module Coinbase::Client
|
|
115
115
|
# header parameters
|
116
116
|
header_params = opts[:header_params] || {}
|
117
117
|
# HTTP header 'Accept' (if needed)
|
118
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
119
119
|
|
120
120
|
# form parameters
|
121
121
|
form_params = opts[:form_params] || {}
|
@@ -182,7 +182,7 @@ module Coinbase::Client
|
|
182
182
|
# header parameters
|
183
183
|
header_params = opts[:header_params] || {}
|
184
184
|
# HTTP header 'Accept' (if needed)
|
185
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
186
186
|
|
187
187
|
# form parameters
|
188
188
|
form_params = opts[:form_params] || {}
|
@@ -247,7 +247,7 @@ module Coinbase::Client
|
|
247
247
|
# header parameters
|
248
248
|
header_params = opts[:header_params] || {}
|
249
249
|
# HTTP header 'Accept' (if needed)
|
250
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
250
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
251
251
|
# HTTP header 'Content-Type'
|
252
252
|
content_type = @api_client.select_header_content_type(['application/json'])
|
253
253
|
if !content_type.nil?
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.8.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -164,35 +164,41 @@ module Coinbase::Client
|
|
164
164
|
request.options.on_data = Proc.new do |chunk, overall_received_bytes|
|
165
165
|
stream << chunk
|
166
166
|
end
|
167
|
+
|
167
168
|
stream
|
168
169
|
end
|
169
170
|
|
170
171
|
def deserialize_file(response, stream)
|
171
|
-
body
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
172
|
+
body = response.body
|
173
|
+
encoding = body.encoding
|
174
|
+
|
175
|
+
# reconstruct content
|
176
|
+
content = stream.join
|
177
|
+
content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary'
|
178
|
+
content = content.force_encoding(encoding)
|
179
|
+
|
180
|
+
# return byte stream
|
181
|
+
return content if @config.return_binary_data == true
|
182
|
+
|
183
|
+
# return file instead of binary data
|
184
|
+
content_disposition = response.headers['Content-Disposition']
|
185
|
+
if content_disposition && content_disposition =~ /filename=/i
|
186
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
187
|
+
prefix = sanitize_filename(filename)
|
176
188
|
else
|
177
|
-
|
178
|
-
content_disposition = response.headers['Content-Disposition']
|
179
|
-
if content_disposition && content_disposition =~ /filename=/i
|
180
|
-
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
181
|
-
prefix = sanitize_filename(filename)
|
182
|
-
else
|
183
|
-
prefix = 'download-'
|
184
|
-
end
|
185
|
-
prefix = prefix + '-' unless prefix.end_with?('-')
|
186
|
-
encoding = body.encoding
|
187
|
-
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
188
|
-
tempfile.write(stream.join.force_encoding(encoding))
|
189
|
-
tempfile.close
|
190
|
-
config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
191
|
-
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
192
|
-
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
193
|
-
"explicitly with `tempfile.delete`"
|
194
|
-
tempfile
|
189
|
+
prefix = 'download-'
|
195
190
|
end
|
191
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
192
|
+
|
193
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
194
|
+
tempfile.write(content)
|
195
|
+
tempfile.close
|
196
|
+
|
197
|
+
config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
198
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
199
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
200
|
+
"explicitly with `tempfile.delete`"
|
201
|
+
tempfile
|
196
202
|
end
|
197
203
|
|
198
204
|
def connection(opts)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.8.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -40,6 +40,9 @@ module Coinbase::Client
|
|
40
40
|
# The JSON-encoded ABI of the contract.
|
41
41
|
attr_accessor :abi
|
42
42
|
|
43
|
+
# The amount to send to the contract for a payable method
|
44
|
+
attr_accessor :amount
|
45
|
+
|
43
46
|
attr_accessor :transaction
|
44
47
|
|
45
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -53,6 +56,7 @@ module Coinbase::Client
|
|
53
56
|
:'method' => :'method',
|
54
57
|
:'args' => :'args',
|
55
58
|
:'abi' => :'abi',
|
59
|
+
:'amount' => :'amount',
|
56
60
|
:'transaction' => :'transaction'
|
57
61
|
}
|
58
62
|
end
|
@@ -73,6 +77,7 @@ module Coinbase::Client
|
|
73
77
|
:'method' => :'String',
|
74
78
|
:'args' => :'String',
|
75
79
|
:'abi' => :'String',
|
80
|
+
:'amount' => :'String',
|
76
81
|
:'transaction' => :'Transaction'
|
77
82
|
}
|
78
83
|
end
|
@@ -144,6 +149,12 @@ module Coinbase::Client
|
|
144
149
|
self.abi = attributes[:'abi']
|
145
150
|
end
|
146
151
|
|
152
|
+
if attributes.key?(:'amount')
|
153
|
+
self.amount = attributes[:'amount']
|
154
|
+
else
|
155
|
+
self.amount = nil
|
156
|
+
end
|
157
|
+
|
147
158
|
if attributes.key?(:'transaction')
|
148
159
|
self.transaction = attributes[:'transaction']
|
149
160
|
else
|
@@ -184,6 +195,10 @@ module Coinbase::Client
|
|
184
195
|
invalid_properties.push('invalid value for "args", args cannot be nil.')
|
185
196
|
end
|
186
197
|
|
198
|
+
if @amount.nil?
|
199
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
200
|
+
end
|
201
|
+
|
187
202
|
if @transaction.nil?
|
188
203
|
invalid_properties.push('invalid value for "transaction", transaction cannot be nil.')
|
189
204
|
end
|
@@ -202,6 +217,7 @@ module Coinbase::Client
|
|
202
217
|
return false if @contract_address.nil?
|
203
218
|
return false if @method.nil?
|
204
219
|
return false if @args.nil?
|
220
|
+
return false if @amount.nil?
|
205
221
|
return false if @transaction.nil?
|
206
222
|
true
|
207
223
|
end
|
@@ -219,6 +235,7 @@ module Coinbase::Client
|
|
219
235
|
method == o.method &&
|
220
236
|
args == o.args &&
|
221
237
|
abi == o.abi &&
|
238
|
+
amount == o.amount &&
|
222
239
|
transaction == o.transaction
|
223
240
|
end
|
224
241
|
|
@@ -231,7 +248,7 @@ module Coinbase::Client
|
|
231
248
|
# Calculates hash code according to all attributes.
|
232
249
|
# @return [Integer] Hash code
|
233
250
|
def hash
|
234
|
-
[network_id, wallet_id, address_id, contract_invocation_id, contract_address, method, args, abi, transaction].hash
|
251
|
+
[network_id, wallet_id, address_id, contract_invocation_id, contract_address, method, args, abi, amount, transaction].hash
|
235
252
|
end
|
236
253
|
|
237
254
|
# Builds the object from hash
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.8.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -27,13 +27,17 @@ module Coinbase::Client
|
|
27
27
|
# The JSON-encoded ABI of the contract.
|
28
28
|
attr_accessor :abi
|
29
29
|
|
30
|
+
# The amount in atomic units of the native asset to send to the contract for a payable method
|
31
|
+
attr_accessor :amount
|
32
|
+
|
30
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
31
34
|
def self.attribute_map
|
32
35
|
{
|
33
36
|
:'contract_address' => :'contract_address',
|
34
37
|
:'method' => :'method',
|
35
38
|
:'args' => :'args',
|
36
|
-
:'abi' => :'abi'
|
39
|
+
:'abi' => :'abi',
|
40
|
+
:'amount' => :'amount'
|
37
41
|
}
|
38
42
|
end
|
39
43
|
|
@@ -48,7 +52,8 @@ module Coinbase::Client
|
|
48
52
|
:'contract_address' => :'String',
|
49
53
|
:'method' => :'String',
|
50
54
|
:'args' => :'String',
|
51
|
-
:'abi' => :'String'
|
55
|
+
:'abi' => :'String',
|
56
|
+
:'amount' => :'String'
|
52
57
|
}
|
53
58
|
end
|
54
59
|
|
@@ -94,6 +99,10 @@ module Coinbase::Client
|
|
94
99
|
if attributes.key?(:'abi')
|
95
100
|
self.abi = attributes[:'abi']
|
96
101
|
end
|
102
|
+
|
103
|
+
if attributes.key?(:'amount')
|
104
|
+
self.amount = attributes[:'amount']
|
105
|
+
end
|
97
106
|
end
|
98
107
|
|
99
108
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -134,7 +143,8 @@ module Coinbase::Client
|
|
134
143
|
contract_address == o.contract_address &&
|
135
144
|
method == o.method &&
|
136
145
|
args == o.args &&
|
137
|
-
abi == o.abi
|
146
|
+
abi == o.abi &&
|
147
|
+
amount == o.amount
|
138
148
|
end
|
139
149
|
|
140
150
|
# @see the `==` method
|
@@ -146,7 +156,7 @@ module Coinbase::Client
|
|
146
156
|
# Calculates hash code according to all attributes.
|
147
157
|
# @return [Integer] Hash code
|
148
158
|
def hash
|
149
|
-
[contract_address, method, args, abi].hash
|
159
|
+
[contract_address, method, args, abi, amount].hash
|
150
160
|
end
|
151
161
|
|
152
162
|
# Builds the object from hash
|