Class: WhopSDK::Models::UserBalance::Crypto

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/user_balance.rb,
sig/whop_sdk/models/user_balance.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(balance:, icon_url:, name:, price_usd:, symbol:, value_usd:) ⇒ Object

Per-token crypto holdings in the ledger's own wallet.

Parameters:

  • balance (String)

    Amount held in native token units, as a decimal string.

  • icon_url (String, nil)

    Token icon URL.

  • name (String, nil)

    The token's display name.

  • price_usd (Float, nil)

    USD price per token, or null when unknown.

  • symbol (String)

    Token display symbol, such as USDT, XAUT, or cbBTC.

  • value_usd (Float)

    Holding USD value.



# File 'lib/whop_sdk/models/user_balance.rb', line 209

Instance Attribute Details

#balanceString

Amount held in native token units, as a decimal string.

Parameters:

  • value (String)

Returns:

  • (String)


177
# File 'lib/whop_sdk/models/user_balance.rb', line 177

required :balance, String

#icon_urlString?

Token icon URL.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


183
# File 'lib/whop_sdk/models/user_balance.rb', line 183

required :icon_url, String, nil?: true

#nameString?

The token's display name.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


189
# File 'lib/whop_sdk/models/user_balance.rb', line 189

required :name, String, nil?: true

#price_usdFloat?

USD price per token, or null when unknown.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


195
# File 'lib/whop_sdk/models/user_balance.rb', line 195

required :price_usd, Float, nil?: true

#symbolString

Token display symbol, such as USDT, XAUT, or cbBTC.

Parameters:

  • value (String)

Returns:

  • (String)


201
# File 'lib/whop_sdk/models/user_balance.rb', line 201

required :symbol, String

#value_usdFloat

Holding USD value.

Parameters:

  • value (Float)

Returns:

  • (Float)


207
# File 'lib/whop_sdk/models/user_balance.rb', line 207

required :value_usd, Float

Instance Method Details

#to_hash{

Returns:

  • ({)


160
# File 'sig/whop_sdk/models/user_balance.rbs', line 160

def to_hash: -> {