coinbase-sdk 0.2.0 → 0.5.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 +61 -0
- data/lib/coinbase/address.rb +25 -1
- data/lib/coinbase/client/api/addresses_api.rb +238 -8
- data/lib/coinbase/client/api/assets_api.rb +3 -3
- data/lib/coinbase/client/api/balance_history_api.rb +107 -0
- data/lib/coinbase/client/api/contract_events_api.rb +5 -5
- data/lib/coinbase/client/api/contract_invocations_api.rb +342 -0
- data/lib/coinbase/client/api/external_addresses_api.rb +24 -30
- data/lib/coinbase/client/api/networks_api.rb +3 -3
- data/lib/coinbase/client/api/server_signers_api.rb +8 -8
- data/lib/coinbase/client/api/stake_api.rb +7 -7
- data/lib/coinbase/client/api/trades_api.rb +6 -6
- data/lib/coinbase/client/api/transfers_api.rb +6 -6
- data/lib/coinbase/client/api/validators_api.rb +8 -8
- data/lib/coinbase/client/api/wallet_stake_api.rb +5 -5
- data/lib/coinbase/client/api/wallets_api.rb +11 -11
- data/lib/coinbase/client/api/webhooks_api.rb +6 -6
- data/lib/coinbase/client/api_client.rb +31 -25
- data/lib/coinbase/client/api_error.rb +2 -2
- data/lib/coinbase/client/configuration.rb +2 -2
- data/lib/coinbase/client/models/address.rb +2 -2
- data/lib/coinbase/client/models/address_balance_list.rb +2 -2
- data/lib/coinbase/client/models/address_historical_balance_list.rb +2 -2
- data/lib/coinbase/client/models/address_list.rb +2 -2
- data/lib/coinbase/client/models/address_transaction_list.rb +258 -0
- data/lib/coinbase/client/models/asset.rb +2 -2
- data/lib/coinbase/client/models/balance.rb +2 -2
- data/lib/coinbase/client/models/{user.rb → broadcast_contract_invocation_request.rb} +17 -26
- data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +2 -2
- data/lib/coinbase/client/models/broadcast_trade_request.rb +2 -2
- data/lib/coinbase/client/models/broadcast_transfer_request.rb +2 -2
- data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -2
- data/lib/coinbase/client/models/contract_event.rb +2 -2
- data/lib/coinbase/client/models/contract_event_list.rb +2 -2
- data/lib/coinbase/client/models/contract_invocation.rb +368 -0
- data/lib/coinbase/client/models/contract_invocation_list.rb +274 -0
- data/lib/coinbase/client/models/create_address_request.rb +2 -2
- data/lib/coinbase/client/models/create_contract_invocation_request.rb +276 -0
- data/lib/coinbase/client/models/create_payload_signature_request.rb +232 -0
- data/lib/coinbase/client/models/create_server_signer_request.rb +2 -2
- data/lib/coinbase/client/models/create_staking_operation_request.rb +2 -2
- data/lib/coinbase/client/models/create_trade_request.rb +2 -2
- data/lib/coinbase/client/models/create_transfer_request.rb +3 -3
- data/lib/coinbase/client/models/create_wallet_request.rb +2 -2
- data/lib/coinbase/client/models/create_wallet_request_wallet.rb +2 -2
- data/lib/coinbase/client/models/create_webhook_request.rb +30 -6
- 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 +16 -6
- data/lib/coinbase/client/models/ethereum_transaction.rb +389 -0
- data/lib/coinbase/client/models/ethereum_transaction_access.rb +225 -0
- data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +216 -0
- data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +378 -0
- data/lib/coinbase/client/models/ethereum_validator_metadata.rb +2 -2
- data/lib/coinbase/client/models/faucet_transaction.rb +2 -2
- data/lib/coinbase/client/models/feature_set.rb +2 -2
- data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +2 -2
- data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +2 -2
- data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +2 -2
- data/lib/coinbase/client/models/get_staking_context_request.rb +2 -2
- data/lib/coinbase/client/models/historical_balance.rb +2 -2
- data/lib/coinbase/client/models/network.rb +4 -4
- data/lib/coinbase/client/models/network_identifier.rb +5 -3
- data/lib/coinbase/client/models/payload_signature.rb +335 -0
- data/lib/coinbase/client/models/payload_signature_list.rb +275 -0
- data/lib/coinbase/client/models/seed_creation_event.rb +2 -2
- data/lib/coinbase/client/models/seed_creation_event_result.rb +2 -2
- data/lib/coinbase/client/models/server_signer.rb +2 -2
- data/lib/coinbase/client/models/server_signer_event.rb +2 -2
- data/lib/coinbase/client/models/server_signer_event_event.rb +2 -2
- data/lib/coinbase/client/models/server_signer_event_list.rb +2 -2
- data/lib/coinbase/client/models/server_signer_list.rb +2 -2
- data/lib/coinbase/client/models/signature_creation_event.rb +2 -2
- data/lib/coinbase/client/models/signature_creation_event_result.rb +2 -2
- data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +2 -2
- data/lib/coinbase/client/models/sponsored_send.rb +2 -2
- data/lib/coinbase/client/models/staking_balance.rb +2 -2
- data/lib/coinbase/client/models/staking_context.rb +2 -2
- data/lib/coinbase/client/models/staking_context_context.rb +2 -2
- data/lib/coinbase/client/models/staking_operation.rb +2 -2
- data/lib/coinbase/client/models/staking_operation_metadata.rb +2 -2
- data/lib/coinbase/client/models/staking_reward.rb +2 -2
- data/lib/coinbase/client/models/staking_reward_format.rb +2 -2
- data/lib/coinbase/client/models/staking_reward_usd_value.rb +2 -2
- data/lib/coinbase/client/models/trade.rb +2 -2
- data/lib/coinbase/client/models/trade_list.rb +2 -2
- data/lib/coinbase/client/models/transaction.rb +37 -8
- data/lib/coinbase/client/models/transaction_content.rb +104 -0
- data/lib/coinbase/client/models/transaction_type.rb +2 -2
- data/lib/coinbase/client/models/transfer.rb +2 -2
- data/lib/coinbase/client/models/transfer_list.rb +2 -2
- data/lib/coinbase/client/models/update_webhook_request.rb +3 -51
- data/lib/coinbase/client/models/validator.rb +2 -2
- data/lib/coinbase/client/models/validator_details.rb +2 -2
- data/lib/coinbase/client/models/validator_list.rb +2 -2
- data/lib/coinbase/client/models/validator_status.rb +2 -2
- data/lib/coinbase/client/models/wallet.rb +2 -2
- data/lib/coinbase/client/models/wallet_list.rb +2 -2
- data/lib/coinbase/client/models/webhook.rb +16 -6
- data/lib/coinbase/client/models/webhook_event_filter.rb +5 -5
- data/lib/coinbase/client/models/webhook_event_type.rb +2 -2
- data/lib/coinbase/client/models/webhook_list.rb +2 -2
- data/lib/coinbase/client/version.rb +2 -2
- data/lib/coinbase/client.rb +19 -4
- data/lib/coinbase/constants.rb +3 -0
- data/lib/coinbase/contract_invocation.rb +259 -0
- data/lib/coinbase/payload_signature.rb +181 -0
- data/lib/coinbase/transaction.rb +21 -0
- data/lib/coinbase/version.rb +1 -1
- data/lib/coinbase/wallet.rb +11 -1
- data/lib/coinbase/webhook.rb +17 -6
- data/lib/coinbase.rb +2 -0
- metadata +21 -5
- data/lib/coinbase/client/api/users_api.rb +0 -79
- data/lib/coinbase/client/models/feature.rb +0 -43
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -19,6 +19,12 @@ module Coinbase::Client
|
|
19
19
|
# The ID of the blockchain network.
|
20
20
|
attr_accessor :network_id
|
21
21
|
|
22
|
+
# The hash of the block at which the transaction was recorded.
|
23
|
+
attr_accessor :block_hash
|
24
|
+
|
25
|
+
# The block height at which the transaction was recorded.
|
26
|
+
attr_accessor :block_height
|
27
|
+
|
22
28
|
# The onchain address of the sender.
|
23
29
|
attr_accessor :from_address_id
|
24
30
|
|
@@ -40,6 +46,8 @@ module Coinbase::Client
|
|
40
46
|
# The status of the transaction.
|
41
47
|
attr_accessor :status
|
42
48
|
|
49
|
+
attr_accessor :content
|
50
|
+
|
43
51
|
class EnumAttributeValidator
|
44
52
|
attr_reader :datatype
|
45
53
|
attr_reader :allowable_values
|
@@ -66,13 +74,16 @@ module Coinbase::Client
|
|
66
74
|
def self.attribute_map
|
67
75
|
{
|
68
76
|
:'network_id' => :'network_id',
|
77
|
+
:'block_hash' => :'block_hash',
|
78
|
+
:'block_height' => :'block_height',
|
69
79
|
:'from_address_id' => :'from_address_id',
|
70
80
|
:'to_address_id' => :'to_address_id',
|
71
81
|
:'unsigned_payload' => :'unsigned_payload',
|
72
82
|
:'signed_payload' => :'signed_payload',
|
73
83
|
:'transaction_hash' => :'transaction_hash',
|
74
84
|
:'transaction_link' => :'transaction_link',
|
75
|
-
:'status' => :'status'
|
85
|
+
:'status' => :'status',
|
86
|
+
:'content' => :'content'
|
76
87
|
}
|
77
88
|
end
|
78
89
|
|
@@ -85,13 +96,16 @@ module Coinbase::Client
|
|
85
96
|
def self.openapi_types
|
86
97
|
{
|
87
98
|
:'network_id' => :'String',
|
99
|
+
:'block_hash' => :'String',
|
100
|
+
:'block_height' => :'String',
|
88
101
|
:'from_address_id' => :'String',
|
89
102
|
:'to_address_id' => :'String',
|
90
103
|
:'unsigned_payload' => :'String',
|
91
104
|
:'signed_payload' => :'String',
|
92
105
|
:'transaction_hash' => :'String',
|
93
106
|
:'transaction_link' => :'String',
|
94
|
-
:'status' => :'String'
|
107
|
+
:'status' => :'String',
|
108
|
+
:'content' => :'TransactionContent'
|
95
109
|
}
|
96
110
|
end
|
97
111
|
|
@@ -122,6 +136,14 @@ module Coinbase::Client
|
|
122
136
|
self.network_id = nil
|
123
137
|
end
|
124
138
|
|
139
|
+
if attributes.key?(:'block_hash')
|
140
|
+
self.block_hash = attributes[:'block_hash']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.key?(:'block_height')
|
144
|
+
self.block_height = attributes[:'block_height']
|
145
|
+
end
|
146
|
+
|
125
147
|
if attributes.key?(:'from_address_id')
|
126
148
|
self.from_address_id = attributes[:'from_address_id']
|
127
149
|
else
|
@@ -155,6 +177,10 @@ module Coinbase::Client
|
|
155
177
|
else
|
156
178
|
self.status = nil
|
157
179
|
end
|
180
|
+
|
181
|
+
if attributes.key?(:'content')
|
182
|
+
self.content = attributes[:'content']
|
183
|
+
end
|
158
184
|
end
|
159
185
|
|
160
186
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -189,7 +215,7 @@ module Coinbase::Client
|
|
189
215
|
return false if @from_address_id.nil?
|
190
216
|
return false if @unsigned_payload.nil?
|
191
217
|
return false if @status.nil?
|
192
|
-
status_validator = EnumAttributeValidator.new('String', ["pending", "signed", "broadcast", "complete", "failed", "unknown_default_open_api"])
|
218
|
+
status_validator = EnumAttributeValidator.new('String', ["pending", "signed", "broadcast", "complete", "failed", "unspecified", "unknown_default_open_api"])
|
193
219
|
return false unless status_validator.valid?(@status)
|
194
220
|
true
|
195
221
|
end
|
@@ -197,7 +223,7 @@ module Coinbase::Client
|
|
197
223
|
# Custom attribute writer method checking allowed values (enum).
|
198
224
|
# @param [Object] status Object to be assigned
|
199
225
|
def status=(status)
|
200
|
-
validator = EnumAttributeValidator.new('String', ["pending", "signed", "broadcast", "complete", "failed", "unknown_default_open_api"])
|
226
|
+
validator = EnumAttributeValidator.new('String', ["pending", "signed", "broadcast", "complete", "failed", "unspecified", "unknown_default_open_api"])
|
201
227
|
unless validator.valid?(status)
|
202
228
|
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
203
229
|
end
|
@@ -210,13 +236,16 @@ module Coinbase::Client
|
|
210
236
|
return true if self.equal?(o)
|
211
237
|
self.class == o.class &&
|
212
238
|
network_id == o.network_id &&
|
239
|
+
block_hash == o.block_hash &&
|
240
|
+
block_height == o.block_height &&
|
213
241
|
from_address_id == o.from_address_id &&
|
214
242
|
to_address_id == o.to_address_id &&
|
215
243
|
unsigned_payload == o.unsigned_payload &&
|
216
244
|
signed_payload == o.signed_payload &&
|
217
245
|
transaction_hash == o.transaction_hash &&
|
218
246
|
transaction_link == o.transaction_link &&
|
219
|
-
status == o.status
|
247
|
+
status == o.status &&
|
248
|
+
content == o.content
|
220
249
|
end
|
221
250
|
|
222
251
|
# @see the `==` method
|
@@ -228,7 +257,7 @@ module Coinbase::Client
|
|
228
257
|
# Calculates hash code according to all attributes.
|
229
258
|
# @return [Integer] Hash code
|
230
259
|
def hash
|
231
|
-
[network_id, from_address_id, to_address_id, unsigned_payload, signed_payload, transaction_hash, transaction_link, status].hash
|
260
|
+
[network_id, block_hash, block_height, from_address_id, to_address_id, unsigned_payload, signed_payload, transaction_hash, transaction_link, status, content].hash
|
232
261
|
end
|
233
262
|
|
234
263
|
# Builds the object from hash
|
@@ -0,0 +1,104 @@
|
|
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 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Coinbase::Client
|
17
|
+
module TransactionContent
|
18
|
+
class << self
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
20
|
+
def openapi_one_of
|
21
|
+
[
|
22
|
+
:'EthereumTransaction'
|
23
|
+
]
|
24
|
+
end
|
25
|
+
|
26
|
+
# Builds the object
|
27
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
28
|
+
# @return [Object] Returns the model or the data itself
|
29
|
+
def build(data)
|
30
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
31
|
+
# Note:
|
32
|
+
# - We do not attempt to check whether exactly one item matches.
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
36
|
+
# - TODO: logging when debugging is set.
|
37
|
+
openapi_one_of.each do |klass|
|
38
|
+
begin
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
40
|
+
typed_data = find_and_cast_into_type(klass, data)
|
41
|
+
return typed_data if typed_data
|
42
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
SchemaMismatchError = Class.new(StandardError)
|
52
|
+
|
53
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
54
|
+
def find_and_cast_into_type(klass, data)
|
55
|
+
return if data.nil?
|
56
|
+
|
57
|
+
case klass.to_s
|
58
|
+
when 'Boolean'
|
59
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
60
|
+
when 'Float'
|
61
|
+
return data if data.instance_of?(Float)
|
62
|
+
when 'Integer'
|
63
|
+
return data if data.instance_of?(Integer)
|
64
|
+
when 'Time'
|
65
|
+
return Time.parse(data)
|
66
|
+
when 'Date'
|
67
|
+
return Date.parse(data)
|
68
|
+
when 'String'
|
69
|
+
return data if data.instance_of?(String)
|
70
|
+
when 'Object' # "type: object"
|
71
|
+
return data if data.instance_of?(Hash)
|
72
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
73
|
+
if data.instance_of?(Array)
|
74
|
+
sub_type = Regexp.last_match[:sub_type]
|
75
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
76
|
+
end
|
77
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
78
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
79
|
+
sub_type = Regexp.last_match[:sub_type]
|
80
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
81
|
+
end
|
82
|
+
else # model
|
83
|
+
const = Coinbase::Client.const_get(klass)
|
84
|
+
if const
|
85
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
86
|
+
model = const.build(data)
|
87
|
+
return model if model
|
88
|
+
else
|
89
|
+
# raise if data contains keys that are not known to the model
|
90
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
91
|
+
model = const.build_from_hash(data)
|
92
|
+
return model if model
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
raise # if no match by now, raise
|
98
|
+
rescue
|
99
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -15,44 +15,15 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Coinbase::Client
|
17
17
|
class UpdateWebhookRequest
|
18
|
-
# The ID of the blockchain network
|
19
|
-
attr_accessor :network_id
|
20
|
-
|
21
|
-
attr_accessor :event_type
|
22
|
-
|
23
18
|
# Webhook will monitor all events that matches any one of the event filters.
|
24
19
|
attr_accessor :event_filters
|
25
20
|
|
26
21
|
# The Webhook uri that updates to
|
27
22
|
attr_accessor :notification_uri
|
28
23
|
|
29
|
-
class EnumAttributeValidator
|
30
|
-
attr_reader :datatype
|
31
|
-
attr_reader :allowable_values
|
32
|
-
|
33
|
-
def initialize(datatype, allowable_values)
|
34
|
-
@allowable_values = allowable_values.map do |value|
|
35
|
-
case datatype.to_s
|
36
|
-
when /Integer/i
|
37
|
-
value.to_i
|
38
|
-
when /Float/i
|
39
|
-
value.to_f
|
40
|
-
else
|
41
|
-
value
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def valid?(value)
|
47
|
-
!value || allowable_values.include?(value)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
52
25
|
def self.attribute_map
|
53
26
|
{
|
54
|
-
:'network_id' => :'network_id',
|
55
|
-
:'event_type' => :'event_type',
|
56
27
|
:'event_filters' => :'event_filters',
|
57
28
|
:'notification_uri' => :'notification_uri'
|
58
29
|
}
|
@@ -66,8 +37,6 @@ module Coinbase::Client
|
|
66
37
|
# Attribute type mapping.
|
67
38
|
def self.openapi_types
|
68
39
|
{
|
69
|
-
:'network_id' => :'String',
|
70
|
-
:'event_type' => :'WebhookEventType',
|
71
40
|
:'event_filters' => :'Array<WebhookEventFilter>',
|
72
41
|
:'notification_uri' => :'String'
|
73
42
|
}
|
@@ -94,16 +63,6 @@ module Coinbase::Client
|
|
94
63
|
h[k.to_sym] = v
|
95
64
|
}
|
96
65
|
|
97
|
-
if attributes.key?(:'network_id')
|
98
|
-
self.network_id = attributes[:'network_id']
|
99
|
-
end
|
100
|
-
|
101
|
-
if attributes.key?(:'event_type')
|
102
|
-
self.event_type = attributes[:'event_type']
|
103
|
-
else
|
104
|
-
self.event_type = nil
|
105
|
-
end
|
106
|
-
|
107
66
|
if attributes.key?(:'event_filters')
|
108
67
|
if (value = attributes[:'event_filters']).is_a?(Array)
|
109
68
|
self.event_filters = value
|
@@ -124,10 +83,6 @@ module Coinbase::Client
|
|
124
83
|
def list_invalid_properties
|
125
84
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
126
85
|
invalid_properties = Array.new
|
127
|
-
if @event_type.nil?
|
128
|
-
invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
|
129
|
-
end
|
130
|
-
|
131
86
|
if @event_filters.nil?
|
132
87
|
invalid_properties.push('invalid value for "event_filters", event_filters cannot be nil.')
|
133
88
|
end
|
@@ -143,7 +98,6 @@ module Coinbase::Client
|
|
143
98
|
# @return true if the model is valid
|
144
99
|
def valid?
|
145
100
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
146
|
-
return false if @event_type.nil?
|
147
101
|
return false if @event_filters.nil?
|
148
102
|
return false if @notification_uri.nil?
|
149
103
|
true
|
@@ -154,8 +108,6 @@ module Coinbase::Client
|
|
154
108
|
def ==(o)
|
155
109
|
return true if self.equal?(o)
|
156
110
|
self.class == o.class &&
|
157
|
-
network_id == o.network_id &&
|
158
|
-
event_type == o.event_type &&
|
159
111
|
event_filters == o.event_filters &&
|
160
112
|
notification_uri == o.notification_uri
|
161
113
|
end
|
@@ -169,7 +121,7 @@ module Coinbase::Client
|
|
169
121
|
# Calculates hash code according to all attributes.
|
170
122
|
# @return [Integer] Hash code
|
171
123
|
def hash
|
172
|
-
[
|
124
|
+
[event_filters, notification_uri].hash
|
173
125
|
end
|
174
126
|
|
175
127
|
# Builds the object from hash
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
5
5
|
|
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
|
|