coinbase-sdk 0.0.14 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/coinbase/address/wallet_address.rb +31 -21
- data/lib/coinbase/address.rb +51 -17
- data/lib/coinbase/asset.rb +11 -8
- data/lib/coinbase/client/api/contract_events_api.rb +17 -9
- data/lib/coinbase/client/api/external_addresses_api.rb +85 -0
- data/lib/coinbase/client/api/networks_api.rb +85 -0
- data/lib/coinbase/client/api/stake_api.rb +74 -195
- data/lib/coinbase/client/api/validators_api.rb +2 -2
- data/lib/coinbase/client/api/wallet_stake_api.rb +263 -0
- data/lib/coinbase/client/models/address.rb +21 -4
- data/lib/coinbase/client/models/{native_eth_staking_context.rb → address_historical_balance_list.rb} +39 -35
- data/lib/coinbase/client/models/contract_event.rb +99 -8
- data/lib/coinbase/client/models/create_address_request.rb +14 -4
- data/lib/coinbase/client/models/create_transfer_request.rb +14 -4
- data/lib/coinbase/client/models/ethereum_validator_metadata.rb +11 -11
- data/lib/coinbase/client/models/feature.rb +2 -1
- data/lib/coinbase/client/models/feature_set.rb +307 -0
- data/lib/coinbase/client/models/{partial_eth_staking_context.rb → fetch_historical_staking_balances200_response.rb} +39 -35
- data/lib/coinbase/client/models/historical_balance.rb +273 -0
- data/lib/coinbase/client/models/network.rb +365 -0
- data/lib/coinbase/client/models/network_identifier.rb +44 -0
- data/lib/coinbase/client/models/sponsored_send.rb +338 -0
- data/lib/coinbase/client/models/staking_balance.rb +289 -0
- data/lib/coinbase/client/models/staking_context_context.rb +222 -74
- data/lib/coinbase/client/models/staking_operation.rb +2 -2
- data/lib/coinbase/client/models/staking_reward.rb +22 -6
- data/lib/coinbase/client/models/staking_reward_format.rb +2 -1
- data/lib/coinbase/client/models/staking_reward_usd_value.rb +257 -0
- data/lib/coinbase/client/models/transaction.rb +17 -7
- data/lib/coinbase/client/models/transaction_type.rb +2 -1
- data/lib/coinbase/client/models/transfer.rb +101 -8
- data/lib/coinbase/client/models/validator.rb +23 -2
- data/lib/coinbase/client/models/validator_status.rb +52 -0
- data/lib/coinbase/client/models/wallet.rb +13 -16
- data/lib/coinbase/client/models/webhook_event_type.rb +2 -1
- data/lib/coinbase/client.rb +12 -3
- data/lib/coinbase/constants.rb +0 -10
- data/lib/coinbase/contract_event.rb +104 -0
- data/lib/coinbase/correlation.rb +30 -0
- data/lib/coinbase/destination.rb +11 -9
- data/lib/coinbase/errors.rb +14 -0
- data/lib/coinbase/historical_balance.rb +53 -0
- data/lib/coinbase/middleware.rb +2 -0
- data/lib/coinbase/network.rb +103 -20
- data/lib/coinbase/server_signer.rb +14 -3
- data/lib/coinbase/smart_contract.rb +106 -0
- data/lib/coinbase/sponsored_send.rb +110 -0
- data/lib/coinbase/staking_balance.rb +92 -0
- data/lib/coinbase/staking_operation.rb +134 -36
- data/lib/coinbase/staking_reward.rb +18 -0
- data/lib/coinbase/trade.rb +10 -9
- data/lib/coinbase/transaction.rb +13 -3
- data/lib/coinbase/transfer.rb +65 -36
- data/lib/coinbase/validator.rb +18 -10
- data/lib/coinbase/version.rb +5 -0
- data/lib/coinbase/wallet/data.rb +31 -0
- data/lib/coinbase/wallet.rb +143 -182
- data/lib/coinbase/webhook.rb +181 -0
- data/lib/coinbase.rb +64 -21
- metadata +51 -5
- data/lib/coinbase/user.rb +0 -65
    
        data/lib/coinbase.rb
    CHANGED
    
    | @@ -5,10 +5,13 @@ require_relative 'coinbase/address/wallet_address' | |
| 5 5 | 
             
            require_relative 'coinbase/address/external_address'
         | 
| 6 6 | 
             
            require_relative 'coinbase/asset'
         | 
| 7 7 | 
             
            require_relative 'coinbase/authenticator'
         | 
| 8 | 
            +
            require_relative 'coinbase/correlation'
         | 
| 8 9 | 
             
            require_relative 'coinbase/balance'
         | 
| 9 10 | 
             
            require_relative 'coinbase/balance_map'
         | 
| 11 | 
            +
            require_relative 'coinbase/historical_balance'
         | 
| 10 12 | 
             
            require_relative 'coinbase/client'
         | 
| 11 13 | 
             
            require_relative 'coinbase/constants'
         | 
| 14 | 
            +
            require_relative 'coinbase/contract_event'
         | 
| 12 15 | 
             
            require_relative 'coinbase/destination'
         | 
| 13 16 | 
             
            require_relative 'coinbase/errors'
         | 
| 14 17 | 
             
            require_relative 'coinbase/faucet_transaction'
         | 
| @@ -18,12 +21,16 @@ require_relative 'coinbase/pagination' | |
| 18 21 | 
             
            require_relative 'coinbase/trade'
         | 
| 19 22 | 
             
            require_relative 'coinbase/transfer'
         | 
| 20 23 | 
             
            require_relative 'coinbase/transaction'
         | 
| 21 | 
            -
            require_relative 'coinbase/user'
         | 
| 22 24 | 
             
            require_relative 'coinbase/wallet'
         | 
| 23 25 | 
             
            require_relative 'coinbase/server_signer'
         | 
| 26 | 
            +
            require_relative 'coinbase/smart_contract'
         | 
| 27 | 
            +
            require_relative 'coinbase/sponsored_send'
         | 
| 28 | 
            +
            require_relative 'coinbase/staking_balance'
         | 
| 24 29 | 
             
            require_relative 'coinbase/staking_operation'
         | 
| 25 30 | 
             
            require_relative 'coinbase/staking_reward'
         | 
| 26 31 | 
             
            require_relative 'coinbase/validator'
         | 
| 32 | 
            +
            require_relative 'coinbase/version'
         | 
| 33 | 
            +
            require_relative 'coinbase/webhook'
         | 
| 27 34 | 
             
            require 'json'
         | 
| 28 35 |  | 
| 29 36 | 
             
            # The Coinbase SDK.
         | 
| @@ -70,6 +77,17 @@ module Coinbase | |
| 70 77 | 
             
                  @debug_api = false
         | 
| 71 78 | 
             
                  @use_server_signer = false
         | 
| 72 79 | 
             
                  @max_network_tries = 3
         | 
| 80 | 
            +
                  @default_network = Coinbase::Network::BASE_SEPOLIA
         | 
| 81 | 
            +
                end
         | 
| 82 | 
            +
             | 
| 83 | 
            +
                attr_reader :default_network
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                def default_network=(network)
         | 
| 86 | 
            +
                  unless network.is_a?(Coinbase::Network)
         | 
| 87 | 
            +
                    raise InvalidConfiguration, 'Default network must use a network constant, e.g. Coinbase::Network::BASE_MAINNET'
         | 
| 88 | 
            +
                  end
         | 
| 89 | 
            +
             | 
| 90 | 
            +
                  @default_network = network
         | 
| 73 91 | 
             
                end
         | 
| 74 92 |  | 
| 75 93 | 
             
                # Sets configuration values based on the provided CDP API Key JSON file.
         | 
| @@ -94,12 +112,6 @@ module Coinbase | |
| 94 112 | 
             
                end
         | 
| 95 113 | 
             
              end
         | 
| 96 114 |  | 
| 97 | 
            -
              # Returns the default user.
         | 
| 98 | 
            -
              # @return [Coinbase::User] the default user
         | 
| 99 | 
            -
              def self.default_user
         | 
| 100 | 
            -
                @default_user ||= load_default_user
         | 
| 101 | 
            -
              end
         | 
| 102 | 
            -
             | 
| 103 115 | 
             
              # Converts a string to a symbol, replacing hyphens with underscores.
         | 
| 104 116 | 
             
              # @param string [String] the string to convert
         | 
| 105 117 | 
             
              # @return [Symbol] the converted symbol
         | 
| @@ -107,19 +119,14 @@ module Coinbase | |
| 107 119 | 
             
                value.to_s.gsub('-', '_').to_sym
         | 
| 108 120 | 
             
              end
         | 
| 109 121 |  | 
| 110 | 
            -
              # Converts a network symbol  | 
| 111 | 
            -
              #  | 
| 112 | 
            -
              # @ | 
| 113 | 
            -
               | 
| 114 | 
            -
             | 
| 115 | 
            -
             | 
| 122 | 
            +
              # Converts a Network object or network symbol with the string representation of the network ID,
         | 
| 123 | 
            +
              # replacing underscores with hyphens.
         | 
| 124 | 
            +
              # @param network_sym [Coinbase::Network, Symbol] The network or network symbol to convert
         | 
| 125 | 
            +
              # @return [String] The string representation of the network ID
         | 
| 126 | 
            +
              def self.normalize_network(network)
         | 
| 127 | 
            +
                network_sym = network.is_a?(Coinbase::Network) ? network.id : network
         | 
| 116 128 |  | 
| 117 | 
            -
             | 
| 118 | 
            -
              # @return [Coinbase::User] the default user
         | 
| 119 | 
            -
              def self.load_default_user
         | 
| 120 | 
            -
                users_api = Coinbase::Client::UsersApi.new(configuration.api_client)
         | 
| 121 | 
            -
                user_model = users_api.get_current_user
         | 
| 122 | 
            -
                Coinbase::User.new(user_model)
         | 
| 129 | 
            +
                network_sym.to_s.gsub('_', '-')
         | 
| 123 130 | 
             
              end
         | 
| 124 131 |  | 
| 125 132 | 
             
              # Wraps a call to the Platform API to ensure that the error is caught and
         | 
| @@ -128,8 +135,17 @@ module Coinbase | |
| 128 135 | 
             
                yield
         | 
| 129 136 | 
             
              rescue Coinbase::Client::ApiError => e
         | 
| 130 137 | 
             
                raise Coinbase::APIError.from_error(e), cause: nil
         | 
| 131 | 
            -
               | 
| 132 | 
            -
             | 
| 138 | 
            +
              end
         | 
| 139 | 
            +
             | 
| 140 | 
            +
              # Returns a pretty-printed object string that contains the object's class name and
         | 
| 141 | 
            +
              # the details of the object, filtering out nil values.
         | 
| 142 | 
            +
              # @param klass [Class] the class of the object
         | 
| 143 | 
            +
              # @param details [Hash] the details of the object
         | 
| 144 | 
            +
              # @return [String] the pretty-printed object string
         | 
| 145 | 
            +
              def self.pretty_print_object(klass, **details)
         | 
| 146 | 
            +
                filtered_details = details.filter { |_, v| !v.nil? }.map { |k, v| "#{k}: '#{v}'" }
         | 
| 147 | 
            +
             | 
| 148 | 
            +
                "#{klass}{#{filtered_details.join(', ')}}"
         | 
| 133 149 | 
             
              end
         | 
| 134 150 |  | 
| 135 151 | 
             
              # Returns whether to use a server signer to manage private keys.
         | 
| @@ -138,9 +154,36 @@ module Coinbase | |
| 138 154 | 
             
                Coinbase.configuration.use_server_signer
         | 
| 139 155 | 
             
              end
         | 
| 140 156 |  | 
| 157 | 
            +
              # Returns the default network.
         | 
| 158 | 
            +
              # @return [Coinbase::Network] the default network
         | 
| 159 | 
            +
              def self.default_network
         | 
| 160 | 
            +
                Coinbase.configuration.default_network
         | 
| 161 | 
            +
              end
         | 
| 162 | 
            +
             | 
| 141 163 | 
             
              # Returns whether the SDK is configured.
         | 
| 142 164 | 
             
              # @return [bool] whether the SDK is configured
         | 
| 143 165 | 
             
              def self.configured?
         | 
| 144 166 | 
             
                !Coinbase.configuration.api_key_name.nil? && !Coinbase.configuration.api_key_private_key.nil?
         | 
| 145 167 | 
             
              end
         | 
| 146 168 | 
             
            end
         | 
| 169 | 
            +
             | 
| 170 | 
            +
            # Initialize the Network constants.
         | 
| 171 | 
            +
            Coinbase::Network.const_set(
         | 
| 172 | 
            +
              'ALL',
         | 
| 173 | 
            +
              Coinbase::Client::NetworkIdentifier.all_vars.each_with_object([]) do |id, list|
         | 
| 174 | 
            +
                next if id == Coinbase::Client::NetworkIdentifier::UNKNOWN_DEFAULT_OPEN_API
         | 
| 175 | 
            +
             | 
| 176 | 
            +
                network = Coinbase::Network.new(id)
         | 
| 177 | 
            +
             | 
| 178 | 
            +
                Coinbase::Network.const_set(id.upcase.gsub('-', '_'), network)
         | 
| 179 | 
            +
             | 
| 180 | 
            +
                list << network
         | 
| 181 | 
            +
              end
         | 
| 182 | 
            +
            )
         | 
| 183 | 
            +
             | 
| 184 | 
            +
            Coinbase::Network.const_set(
         | 
| 185 | 
            +
              'NETWORK_MAP',
         | 
| 186 | 
            +
              Coinbase::Network::ALL.each_with_object({}) do |network, map|
         | 
| 187 | 
            +
                map[network.id] = network
         | 
| 188 | 
            +
              end
         | 
| 189 | 
            +
            )
         | 
    
        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.0 | 
| 4 | 
            +
              version: 0.1.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-08- | 
| 11 | 
            +
            date: 2024-08-22 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bigdecimal
         | 
| @@ -136,6 +136,20 @@ dependencies: | |
| 136 136 | 
             
                - - ">="
         | 
| 137 137 | 
             
                  - !ruby/object:Gem::Version
         | 
| 138 138 | 
             
                    version: '0'
         | 
| 139 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 140 | 
            +
              name: factory_bot
         | 
| 141 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 142 | 
            +
                requirements:
         | 
| 143 | 
            +
                - - ">="
         | 
| 144 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 145 | 
            +
                    version: '0'
         | 
| 146 | 
            +
              type: :development
         | 
| 147 | 
            +
              prerelease: false
         | 
| 148 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 149 | 
            +
                requirements:
         | 
| 150 | 
            +
                - - ">="
         | 
| 151 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 152 | 
            +
                    version: '0'
         | 
| 139 153 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 140 154 | 
             
              name: pry
         | 
| 141 155 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -192,6 +206,20 @@ dependencies: | |
| 192 206 | 
             
                - - '='
         | 
| 193 207 | 
             
                  - !ruby/object:Gem::Version
         | 
| 194 208 | 
             
                    version: 1.63.1
         | 
| 209 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 210 | 
            +
              name: rubocop-rspec
         | 
| 211 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 212 | 
            +
                requirements:
         | 
| 213 | 
            +
                - - ">="
         | 
| 214 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 215 | 
            +
                    version: '0'
         | 
| 216 | 
            +
              type: :development
         | 
| 217 | 
            +
              prerelease: false
         | 
| 218 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 219 | 
            +
                requirements:
         | 
| 220 | 
            +
                - - ">="
         | 
| 221 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 222 | 
            +
                    version: '0'
         | 
| 195 223 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 196 224 | 
             
              name: simplecov
         | 
| 197 225 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -253,12 +281,14 @@ files: | |
| 253 281 | 
             
            - lib/coinbase/client/api/assets_api.rb
         | 
| 254 282 | 
             
            - lib/coinbase/client/api/contract_events_api.rb
         | 
| 255 283 | 
             
            - lib/coinbase/client/api/external_addresses_api.rb
         | 
| 284 | 
            +
            - lib/coinbase/client/api/networks_api.rb
         | 
| 256 285 | 
             
            - lib/coinbase/client/api/server_signers_api.rb
         | 
| 257 286 | 
             
            - lib/coinbase/client/api/stake_api.rb
         | 
| 258 287 | 
             
            - lib/coinbase/client/api/trades_api.rb
         | 
| 259 288 | 
             
            - lib/coinbase/client/api/transfers_api.rb
         | 
| 260 289 | 
             
            - lib/coinbase/client/api/users_api.rb
         | 
| 261 290 | 
             
            - lib/coinbase/client/api/validators_api.rb
         | 
| 291 | 
            +
            - lib/coinbase/client/api/wallet_stake_api.rb
         | 
| 262 292 | 
             
            - lib/coinbase/client/api/wallets_api.rb
         | 
| 263 293 | 
             
            - lib/coinbase/client/api/webhooks_api.rb
         | 
| 264 294 | 
             
            - lib/coinbase/client/api_client.rb
         | 
| @@ -266,6 +296,7 @@ files: | |
| 266 296 | 
             
            - lib/coinbase/client/configuration.rb
         | 
| 267 297 | 
             
            - lib/coinbase/client/models/address.rb
         | 
| 268 298 | 
             
            - lib/coinbase/client/models/address_balance_list.rb
         | 
| 299 | 
            +
            - lib/coinbase/client/models/address_historical_balance_list.rb
         | 
| 269 300 | 
             
            - lib/coinbase/client/models/address_list.rb
         | 
| 270 301 | 
             
            - lib/coinbase/client/models/asset.rb
         | 
| 271 302 | 
             
            - lib/coinbase/client/models/balance.rb
         | 
| @@ -287,11 +318,14 @@ files: | |
| 287 318 | 
             
            - lib/coinbase/client/models/ethereum_validator_metadata.rb
         | 
| 288 319 | 
             
            - lib/coinbase/client/models/faucet_transaction.rb
         | 
| 289 320 | 
             
            - lib/coinbase/client/models/feature.rb
         | 
| 321 | 
            +
            - lib/coinbase/client/models/feature_set.rb
         | 
| 322 | 
            +
            - lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb
         | 
| 290 323 | 
             
            - lib/coinbase/client/models/fetch_staking_rewards200_response.rb
         | 
| 291 324 | 
             
            - lib/coinbase/client/models/fetch_staking_rewards_request.rb
         | 
| 292 325 | 
             
            - lib/coinbase/client/models/get_staking_context_request.rb
         | 
| 293 | 
            -
            - lib/coinbase/client/models/ | 
| 294 | 
            -
            - lib/coinbase/client/models/ | 
| 326 | 
            +
            - lib/coinbase/client/models/historical_balance.rb
         | 
| 327 | 
            +
            - lib/coinbase/client/models/network.rb
         | 
| 328 | 
            +
            - lib/coinbase/client/models/network_identifier.rb
         | 
| 295 329 | 
             
            - lib/coinbase/client/models/seed_creation_event.rb
         | 
| 296 330 | 
             
            - lib/coinbase/client/models/seed_creation_event_result.rb
         | 
| 297 331 | 
             
            - lib/coinbase/client/models/server_signer.rb
         | 
| @@ -302,12 +336,15 @@ files: | |
| 302 336 | 
             
            - lib/coinbase/client/models/signature_creation_event.rb
         | 
| 303 337 | 
             
            - lib/coinbase/client/models/signature_creation_event_result.rb
         | 
| 304 338 | 
             
            - lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb
         | 
| 339 | 
            +
            - lib/coinbase/client/models/sponsored_send.rb
         | 
| 340 | 
            +
            - lib/coinbase/client/models/staking_balance.rb
         | 
| 305 341 | 
             
            - lib/coinbase/client/models/staking_context.rb
         | 
| 306 342 | 
             
            - lib/coinbase/client/models/staking_context_context.rb
         | 
| 307 343 | 
             
            - lib/coinbase/client/models/staking_operation.rb
         | 
| 308 344 | 
             
            - lib/coinbase/client/models/staking_operation_metadata.rb
         | 
| 309 345 | 
             
            - lib/coinbase/client/models/staking_reward.rb
         | 
| 310 346 | 
             
            - lib/coinbase/client/models/staking_reward_format.rb
         | 
| 347 | 
            +
            - lib/coinbase/client/models/staking_reward_usd_value.rb
         | 
| 311 348 | 
             
            - lib/coinbase/client/models/trade.rb
         | 
| 312 349 | 
             
            - lib/coinbase/client/models/trade_list.rb
         | 
| 313 350 | 
             
            - lib/coinbase/client/models/transaction.rb
         | 
| @@ -319,6 +356,7 @@ files: | |
| 319 356 | 
             
            - lib/coinbase/client/models/validator.rb
         | 
| 320 357 | 
             
            - lib/coinbase/client/models/validator_details.rb
         | 
| 321 358 | 
             
            - lib/coinbase/client/models/validator_list.rb
         | 
| 359 | 
            +
            - lib/coinbase/client/models/validator_status.rb
         | 
| 322 360 | 
             
            - lib/coinbase/client/models/wallet.rb
         | 
| 323 361 | 
             
            - lib/coinbase/client/models/wallet_list.rb
         | 
| 324 362 | 
             
            - lib/coinbase/client/models/webhook.rb
         | 
| @@ -327,21 +365,29 @@ files: | |
| 327 365 | 
             
            - lib/coinbase/client/models/webhook_list.rb
         | 
| 328 366 | 
             
            - lib/coinbase/client/version.rb
         | 
| 329 367 | 
             
            - lib/coinbase/constants.rb
         | 
| 368 | 
            +
            - lib/coinbase/contract_event.rb
         | 
| 369 | 
            +
            - lib/coinbase/correlation.rb
         | 
| 330 370 | 
             
            - lib/coinbase/destination.rb
         | 
| 331 371 | 
             
            - lib/coinbase/errors.rb
         | 
| 332 372 | 
             
            - lib/coinbase/faucet_transaction.rb
         | 
| 373 | 
            +
            - lib/coinbase/historical_balance.rb
         | 
| 333 374 | 
             
            - lib/coinbase/middleware.rb
         | 
| 334 375 | 
             
            - lib/coinbase/network.rb
         | 
| 335 376 | 
             
            - lib/coinbase/pagination.rb
         | 
| 336 377 | 
             
            - lib/coinbase/server_signer.rb
         | 
| 378 | 
            +
            - lib/coinbase/smart_contract.rb
         | 
| 379 | 
            +
            - lib/coinbase/sponsored_send.rb
         | 
| 380 | 
            +
            - lib/coinbase/staking_balance.rb
         | 
| 337 381 | 
             
            - lib/coinbase/staking_operation.rb
         | 
| 338 382 | 
             
            - lib/coinbase/staking_reward.rb
         | 
| 339 383 | 
             
            - lib/coinbase/trade.rb
         | 
| 340 384 | 
             
            - lib/coinbase/transaction.rb
         | 
| 341 385 | 
             
            - lib/coinbase/transfer.rb
         | 
| 342 | 
            -
            - lib/coinbase/user.rb
         | 
| 343 386 | 
             
            - lib/coinbase/validator.rb
         | 
| 387 | 
            +
            - lib/coinbase/version.rb
         | 
| 344 388 | 
             
            - lib/coinbase/wallet.rb
         | 
| 389 | 
            +
            - lib/coinbase/wallet/data.rb
         | 
| 390 | 
            +
            - lib/coinbase/webhook.rb
         | 
| 345 391 | 
             
            homepage: https://github.com/coinbase/coinbase-sdk-ruby
         | 
| 346 392 | 
             
            licenses:
         | 
| 347 393 | 
             
            - Apache-2.0
         | 
    
        data/lib/coinbase/user.rb
    DELETED
    
    | @@ -1,65 +0,0 @@ | |
| 1 | 
            -
            # frozen_string_literal: true
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            require_relative 'client'
         | 
| 4 | 
            -
            require_relative 'wallet'
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            module Coinbase
         | 
| 7 | 
            -
              # A representation of a User. Users have Wallets, which can hold balances of Assets. Access the default User through
         | 
| 8 | 
            -
              # Coinbase#default_user.
         | 
| 9 | 
            -
              class User
         | 
| 10 | 
            -
                # Returns a new User object. Do not use this method directly. Instead, use Coinbase#default_user.
         | 
| 11 | 
            -
                # @param model [Coinbase::Client::User] the underlying User object
         | 
| 12 | 
            -
                def initialize(model)
         | 
| 13 | 
            -
                  @model = model
         | 
| 14 | 
            -
                end
         | 
| 15 | 
            -
             | 
| 16 | 
            -
                # Returns the User ID.
         | 
| 17 | 
            -
                # @return [String] the User ID
         | 
| 18 | 
            -
                def id
         | 
| 19 | 
            -
                  @model.id
         | 
| 20 | 
            -
                end
         | 
| 21 | 
            -
             | 
| 22 | 
            -
                # Creates a new Wallet belonging to the User.
         | 
| 23 | 
            -
                # @param network_id [String] (Optional) the ID of the blockchain network. Defaults to 'base-sepolia'.
         | 
| 24 | 
            -
                # @return [Coinbase::Wallet] the new Wallet
         | 
| 25 | 
            -
                def create_wallet(create_wallet_options = {})
         | 
| 26 | 
            -
                  # For ruby 2.7 compatibility we cannot pass in keyword args when the create wallet
         | 
| 27 | 
            -
                  # options is empty
         | 
| 28 | 
            -
                  return Wallet.create if create_wallet_options.empty?
         | 
| 29 | 
            -
             | 
| 30 | 
            -
                  Wallet.create(**create_wallet_options)
         | 
| 31 | 
            -
                end
         | 
| 32 | 
            -
             | 
| 33 | 
            -
                # Imports a Wallet belonging to the User.
         | 
| 34 | 
            -
                # @param data [Coinbase::Wallet::Data] the Wallet data to import
         | 
| 35 | 
            -
                # @return [Coinbase::Wallet] the imported Wallet
         | 
| 36 | 
            -
                def import_wallet(data)
         | 
| 37 | 
            -
                  Wallet.import(data)
         | 
| 38 | 
            -
                end
         | 
| 39 | 
            -
             | 
| 40 | 
            -
                # Enumerates the Wallets belonging to the User.
         | 
| 41 | 
            -
                # @return [Enumerator<Coinbase::Wallet>] the Wallets belonging to the User
         | 
| 42 | 
            -
                def wallets
         | 
| 43 | 
            -
                  Wallet.list
         | 
| 44 | 
            -
                end
         | 
| 45 | 
            -
             | 
| 46 | 
            -
                # Returns the Wallet with the given ID.
         | 
| 47 | 
            -
                # @param wallet_id [String] the ID of the Wallet
         | 
| 48 | 
            -
                # @return [Coinbase::Wallet] the unhydrated Wallet
         | 
| 49 | 
            -
                def wallet(wallet_id)
         | 
| 50 | 
            -
                  Wallet.fetch(wallet_id)
         | 
| 51 | 
            -
                end
         | 
| 52 | 
            -
             | 
| 53 | 
            -
                # Returns a string representation of the User.
         | 
| 54 | 
            -
                # @return [String] a string representation of the User
         | 
| 55 | 
            -
                def to_s
         | 
| 56 | 
            -
                  "Coinbase::User{user_id: '#{id}'}"
         | 
| 57 | 
            -
                end
         | 
| 58 | 
            -
             | 
| 59 | 
            -
                # Same as to_s.
         | 
| 60 | 
            -
                # @return [String] a string representation of the User
         | 
| 61 | 
            -
                def inspect
         | 
| 62 | 
            -
                  to_s
         | 
| 63 | 
            -
                end
         | 
| 64 | 
            -
              end
         | 
| 65 | 
            -
            end
         |