coinbase-sdk 0.3.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 +10 -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/stake_api.rb +6 -6
- 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/validators_api.rb +7 -7
- data/lib/coinbase/client/api/wallet_stake_api.rb +4 -4
- data/lib/coinbase/client/api/wallets_api.rb +10 -10
- 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_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 +1 -1
- data/lib/coinbase/client/models/erc20_transfer_event.rb +336 -0
- data/lib/coinbase/client/models/{user.rb → erc721_transfer_event.rb} +130 -25
- 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/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/sponsored_send.rb +1 -1
- data/lib/coinbase/client/models/staking_balance.rb +1 -1
- 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 +1 -1
- 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/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 +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 +1 -1
- data/lib/coinbase/client/models/webhook_event_filter.rb +4 -4
- data/lib/coinbase/client/models/webhook_event_type.rb +1 -1
- data/lib/coinbase/client/models/webhook_list.rb +1 -1
- data/lib/coinbase/client/version.rb +1 -1
- data/lib/coinbase/client.rb +4 -3
- data/lib/coinbase/contract_invocation.rb +26 -1
- data/lib/coinbase/version.rb +1 -1
- metadata +5 -5
- data/lib/coinbase/client/api/users_api.rb +0 -79
- data/lib/coinbase/client/models/feature.rb +0 -43
@@ -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
|
|
@@ -16,13 +16,13 @@ require 'time'
|
|
16
16
|
module Coinbase::Client
|
17
17
|
# The event_filter parameter specifies the criteria to filter events from the blockchain. It allows filtering events by contract address, sender address and receiver address. For a single event filter, not all of the properties need to be presented.
|
18
18
|
class WebhookEventFilter
|
19
|
-
# The onchain contract address of the token
|
19
|
+
# The onchain contract address of the token for which the events should be tracked.
|
20
20
|
attr_accessor :contract_address
|
21
21
|
|
22
|
-
# The onchain address of the sender.
|
22
|
+
# The onchain address of the sender. Set this filter to track all transfer events originating from your address.
|
23
23
|
attr_accessor :from_address
|
24
24
|
|
25
|
-
# The onchain address of the receiver.
|
25
|
+
# The onchain address of the receiver. Set this filter to track all transfer events sent to your address.
|
26
26
|
attr_accessor :to_address
|
27
27
|
|
28
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
data/lib/coinbase/client.rb
CHANGED
@@ -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
|
|
@@ -43,6 +43,8 @@ Coinbase::Client.autoload :CreateTransferRequest, 'coinbase/client/models/create
|
|
43
43
|
Coinbase::Client.autoload :CreateWalletRequest, 'coinbase/client/models/create_wallet_request'
|
44
44
|
Coinbase::Client.autoload :CreateWalletRequestWallet, 'coinbase/client/models/create_wallet_request_wallet'
|
45
45
|
Coinbase::Client.autoload :CreateWebhookRequest, 'coinbase/client/models/create_webhook_request'
|
46
|
+
Coinbase::Client.autoload :ERC20TransferEvent, 'coinbase/client/models/erc20_transfer_event'
|
47
|
+
Coinbase::Client.autoload :ERC721TransferEvent, 'coinbase/client/models/erc721_transfer_event'
|
46
48
|
Coinbase::Client.autoload :Error, 'coinbase/client/models/error'
|
47
49
|
Coinbase::Client.autoload :EthereumTransaction, 'coinbase/client/models/ethereum_transaction'
|
48
50
|
Coinbase::Client.autoload :EthereumTransactionAccess, 'coinbase/client/models/ethereum_transaction_access'
|
@@ -87,7 +89,6 @@ Coinbase::Client.autoload :TransactionType, 'coinbase/client/models/transaction_
|
|
87
89
|
Coinbase::Client.autoload :Transfer, 'coinbase/client/models/transfer'
|
88
90
|
Coinbase::Client.autoload :TransferList, 'coinbase/client/models/transfer_list'
|
89
91
|
Coinbase::Client.autoload :UpdateWebhookRequest, 'coinbase/client/models/update_webhook_request'
|
90
|
-
Coinbase::Client.autoload :User, 'coinbase/client/models/user'
|
91
92
|
Coinbase::Client.autoload :Validator, 'coinbase/client/models/validator'
|
92
93
|
Coinbase::Client.autoload :ValidatorDetails, 'coinbase/client/models/validator_details'
|
93
94
|
Coinbase::Client.autoload :ValidatorList, 'coinbase/client/models/validator_list'
|
@@ -102,6 +103,7 @@ Coinbase::Client.autoload :WebhookList, 'coinbase/client/models/webhook_list'
|
|
102
103
|
# APIs
|
103
104
|
Coinbase::Client.autoload :AddressesApi, 'coinbase/client/api/addresses_api'
|
104
105
|
Coinbase::Client.autoload :AssetsApi, 'coinbase/client/api/assets_api'
|
106
|
+
Coinbase::Client.autoload :BalanceHistoryApi, 'coinbase/client/api/balance_history_api'
|
105
107
|
Coinbase::Client.autoload :ContractEventsApi, 'coinbase/client/api/contract_events_api'
|
106
108
|
Coinbase::Client.autoload :ContractInvocationsApi, 'coinbase/client/api/contract_invocations_api'
|
107
109
|
Coinbase::Client.autoload :ExternalAddressesApi, 'coinbase/client/api/external_addresses_api'
|
@@ -110,7 +112,6 @@ Coinbase::Client.autoload :ServerSignersApi, 'coinbase/client/api/server_signers
|
|
110
112
|
Coinbase::Client.autoload :StakeApi, 'coinbase/client/api/stake_api'
|
111
113
|
Coinbase::Client.autoload :TradesApi, 'coinbase/client/api/trades_api'
|
112
114
|
Coinbase::Client.autoload :TransfersApi, 'coinbase/client/api/transfers_api'
|
113
|
-
Coinbase::Client.autoload :UsersApi, 'coinbase/client/api/users_api'
|
114
115
|
Coinbase::Client.autoload :ValidatorsApi, 'coinbase/client/api/validators_api'
|
115
116
|
Coinbase::Client.autoload :WalletStakeApi, 'coinbase/client/api/wallet_stake_api'
|
116
117
|
Coinbase::Client.autoload :WalletsApi, 'coinbase/client/api/wallets_api'
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'bigdecimal'
|
4
|
+
|
3
5
|
module Coinbase
|
4
6
|
# A representation of a Contract Invocation.
|
5
7
|
class ContractInvocation
|
@@ -10,6 +12,11 @@ module Coinbase
|
|
10
12
|
# @param contract_address [String] The contract address
|
11
13
|
# @param abi [Array<Hash>] The contract ABI
|
12
14
|
# @param method [String] The contract method
|
15
|
+
# @param amount [Integer, Float, BigDecimal] The amount of the native Asset
|
16
|
+
# to send to a payable contract method.
|
17
|
+
# @param asset_id [Symbol] The ID of the Asset to send to a payable contract method.
|
18
|
+
# The Asset must be a denomination of the native Asset. For Ethereum, :eth, :gwei, and :wei are supported.
|
19
|
+
# @param network [Coinbase::Network, Symbol] The Network or Network ID of the Asset
|
13
20
|
# @param args [Hash] The arguments to pass to the contract method.
|
14
21
|
# The keys should be the argument names, and the values should be the argument values.
|
15
22
|
# @return [ContractInvocation] The new Contract Invocation object
|
@@ -20,8 +27,19 @@ module Coinbase
|
|
20
27
|
contract_address:,
|
21
28
|
abi:,
|
22
29
|
method:,
|
30
|
+
amount:,
|
31
|
+
asset_id:,
|
32
|
+
network:,
|
23
33
|
args: {}
|
24
34
|
)
|
35
|
+
atomic_amount = nil
|
36
|
+
|
37
|
+
if amount && asset_id && network
|
38
|
+
network = Coinbase::Network.from_id(network)
|
39
|
+
asset = network.get_asset(asset_id)
|
40
|
+
atomic_amount = asset.to_atomic_amount(amount).to_i_to_s
|
41
|
+
end
|
42
|
+
|
25
43
|
model = Coinbase.call_api do
|
26
44
|
contract_invocation_api.create_contract_invocation(
|
27
45
|
wallet_id,
|
@@ -29,7 +47,8 @@ module Coinbase
|
|
29
47
|
contract_address: contract_address,
|
30
48
|
abi: abi.to_json,
|
31
49
|
method: method,
|
32
|
-
args: args.to_json
|
50
|
+
args: args.to_json,
|
51
|
+
amount: atomic_amount
|
33
52
|
)
|
34
53
|
end
|
35
54
|
|
@@ -121,6 +140,12 @@ module Coinbase
|
|
121
140
|
JSON.parse(@model.args).transform_keys(&:to_sym)
|
122
141
|
end
|
123
142
|
|
143
|
+
# Returns the amount of the native asset sent to a payable contract method, if applicable.
|
144
|
+
# @return [BigDecimal] The amount in atomic units of the native asset
|
145
|
+
def amount
|
146
|
+
BigDecimal(@model.amount)
|
147
|
+
end
|
148
|
+
|
124
149
|
# Returns the transaction.
|
125
150
|
# @return [Coinbase::Transaction] The Transfer transaction
|
126
151
|
def transaction
|
data/lib/coinbase/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coinbase-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuga Cohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|
@@ -279,6 +279,7 @@ files:
|
|
279
279
|
- lib/coinbase/client.rb
|
280
280
|
- lib/coinbase/client/api/addresses_api.rb
|
281
281
|
- lib/coinbase/client/api/assets_api.rb
|
282
|
+
- lib/coinbase/client/api/balance_history_api.rb
|
282
283
|
- lib/coinbase/client/api/contract_events_api.rb
|
283
284
|
- lib/coinbase/client/api/contract_invocations_api.rb
|
284
285
|
- lib/coinbase/client/api/external_addresses_api.rb
|
@@ -287,7 +288,6 @@ files:
|
|
287
288
|
- lib/coinbase/client/api/stake_api.rb
|
288
289
|
- lib/coinbase/client/api/trades_api.rb
|
289
290
|
- lib/coinbase/client/api/transfers_api.rb
|
290
|
-
- lib/coinbase/client/api/users_api.rb
|
291
291
|
- lib/coinbase/client/api/validators_api.rb
|
292
292
|
- lib/coinbase/client/api/wallet_stake_api.rb
|
293
293
|
- lib/coinbase/client/api/wallets_api.rb
|
@@ -321,6 +321,8 @@ files:
|
|
321
321
|
- lib/coinbase/client/models/create_wallet_request.rb
|
322
322
|
- lib/coinbase/client/models/create_wallet_request_wallet.rb
|
323
323
|
- lib/coinbase/client/models/create_webhook_request.rb
|
324
|
+
- lib/coinbase/client/models/erc20_transfer_event.rb
|
325
|
+
- lib/coinbase/client/models/erc721_transfer_event.rb
|
324
326
|
- lib/coinbase/client/models/error.rb
|
325
327
|
- lib/coinbase/client/models/ethereum_transaction.rb
|
326
328
|
- lib/coinbase/client/models/ethereum_transaction_access.rb
|
@@ -328,7 +330,6 @@ files:
|
|
328
330
|
- lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb
|
329
331
|
- lib/coinbase/client/models/ethereum_validator_metadata.rb
|
330
332
|
- lib/coinbase/client/models/faucet_transaction.rb
|
331
|
-
- lib/coinbase/client/models/feature.rb
|
332
333
|
- lib/coinbase/client/models/feature_set.rb
|
333
334
|
- lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb
|
334
335
|
- lib/coinbase/client/models/fetch_staking_rewards200_response.rb
|
@@ -366,7 +367,6 @@ files:
|
|
366
367
|
- lib/coinbase/client/models/transfer.rb
|
367
368
|
- lib/coinbase/client/models/transfer_list.rb
|
368
369
|
- lib/coinbase/client/models/update_webhook_request.rb
|
369
|
-
- lib/coinbase/client/models/user.rb
|
370
370
|
- lib/coinbase/client/models/validator.rb
|
371
371
|
- lib/coinbase/client/models/validator_details.rb
|
372
372
|
- lib/coinbase/client/models/validator_list.rb
|
@@ -1,79 +0,0 @@
|
|
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.7.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'cgi'
|
14
|
-
|
15
|
-
module Coinbase::Client
|
16
|
-
class UsersApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
# Get current user
|
23
|
-
# Get current user
|
24
|
-
# @param [Hash] opts the optional parameters
|
25
|
-
# @return [User]
|
26
|
-
def get_current_user(opts = {})
|
27
|
-
data, _status_code, _headers = get_current_user_with_http_info(opts)
|
28
|
-
data
|
29
|
-
end
|
30
|
-
|
31
|
-
# Get current user
|
32
|
-
# Get current user
|
33
|
-
# @param [Hash] opts the optional parameters
|
34
|
-
# @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
|
35
|
-
def get_current_user_with_http_info(opts = {})
|
36
|
-
if @api_client.config.debugging
|
37
|
-
@api_client.config.logger.debug 'Calling API: UsersApi.get_current_user ...'
|
38
|
-
end
|
39
|
-
# resource path
|
40
|
-
local_var_path = '/v1/users/me'
|
41
|
-
|
42
|
-
# query parameters
|
43
|
-
query_params = opts[:query_params] || {}
|
44
|
-
|
45
|
-
# header parameters
|
46
|
-
header_params = opts[:header_params] || {}
|
47
|
-
# HTTP header 'Accept' (if needed)
|
48
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
-
|
50
|
-
# form parameters
|
51
|
-
form_params = opts[:form_params] || {}
|
52
|
-
|
53
|
-
# http body (model)
|
54
|
-
post_body = opts[:debug_body]
|
55
|
-
|
56
|
-
# return_type
|
57
|
-
return_type = opts[:debug_return_type] || 'User'
|
58
|
-
|
59
|
-
# auth_names
|
60
|
-
auth_names = opts[:debug_auth_names] || []
|
61
|
-
|
62
|
-
new_options = opts.merge(
|
63
|
-
:operation => :"UsersApi.get_current_user",
|
64
|
-
:header_params => header_params,
|
65
|
-
:query_params => query_params,
|
66
|
-
:form_params => form_params,
|
67
|
-
:body => post_body,
|
68
|
-
:auth_names => auth_names,
|
69
|
-
:return_type => return_type
|
70
|
-
)
|
71
|
-
|
72
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
|
-
if @api_client.config.debugging
|
74
|
-
@api_client.config.logger.debug "API called: UsersApi#get_current_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
-
end
|
76
|
-
return data, status_code, headers
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,43 +0,0 @@
|
|
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.7.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module Coinbase::Client
|
17
|
-
class Feature
|
18
|
-
TRANSFER = "transfer".freeze
|
19
|
-
TRADE = "trade".freeze
|
20
|
-
FAUCET = "faucet".freeze
|
21
|
-
SERVER_SIGNER = "server_signer".freeze
|
22
|
-
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
|
23
|
-
|
24
|
-
def self.all_vars
|
25
|
-
@all_vars ||= [TRANSFER, TRADE, FAUCET, SERVER_SIGNER, UNKNOWN_DEFAULT_OPEN_API].freeze
|
26
|
-
end
|
27
|
-
|
28
|
-
# Builds the enum from string
|
29
|
-
# @param [String] The enum value in the form of the string
|
30
|
-
# @return [String] The enum value
|
31
|
-
def self.build_from_hash(value)
|
32
|
-
new.build_from_hash(value)
|
33
|
-
end
|
34
|
-
|
35
|
-
# Builds the enum from string
|
36
|
-
# @param [String] The enum value in the form of the string
|
37
|
-
# @return [String] The enum value
|
38
|
-
def build_from_hash(value)
|
39
|
-
return value if Feature.all_vars.include?(value)
|
40
|
-
raise "Invalid ENUM value #{value} for class #Feature"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|