Class: WhopSDK::Models::User::BalanceHistory::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/user.rb,
sig/whop_sdk/models/user.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(data:, last:, max:, min:) ⇒ Data

The user's cumulative wallet balance over time (USD { t, v } points plus last/min/max), for the balance chart. Opt in with include_balance_history=true on GET /users/me; populated only for callers with balance-read scope and null otherwise. A user with no wallet activity returns an empty series.

Parameters:

  • data (Array<WhopSDK::Models::User::BalanceHistory::Data>)
  • last (Float)

    Value of the most recent point, in USD.

  • max (Float)

    Maximum value across the window, in USD.

  • min (Float)

    Minimum value across the window, in USD.

  • t: (Integer)
  • v: (Float)


147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/whop_sdk/models/user.rb', line 147

class Data < WhopSDK::Internal::Type::BaseModel
  # @!attribute t
  #   Point timestamp, in Unix seconds.
  #
  #   @return [Integer]
  required :t, Integer

  # @!attribute v
  #   Cumulative wallet balance at this point, in USD.
  #
  #   @return [Float]
  required :v, Float

  # @!method initialize(t:, v:)
  #   Cumulative balance points over the requested window, oldest first.
  #
  #   @param t [Integer] Point timestamp, in Unix seconds.
  #
  #   @param v [Float] Cumulative wallet balance at this point, in USD.
end

Instance Attribute Details

#tInteger

Point timestamp, in Unix seconds.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


152
# File 'lib/whop_sdk/models/user.rb', line 152

required :t, Integer

#vFloat

Cumulative wallet balance at this point, in USD.

Parameters:

  • value (Float)

Returns:

  • (Float)


158
# File 'lib/whop_sdk/models/user.rb', line 158

required :v, Float

Instance Method Details

#to_hash{ t: Integer, v: Float }

Returns:

  • ({ t: Integer, v: Float })


109
# File 'sig/whop_sdk/models/user.rbs', line 109

def to_hash: -> { t: Integer, v: Float }