Class: Privy::Models::Wallets::EarnAsset

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/privy/models/wallets/earn_asset.rb,
sig/privy/models/wallets/earn_asset.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(address:, decimals:, symbol:) ⇒ Object

Asset metadata for an earn vault position.

Parameters:

  • address (String)

    Token contract address.

  • decimals (Integer)

    Number of decimals for the asset (e.g. 6 for USDC).

  • symbol (String)

    Lowercase token symbol (e.g. "usdc").



# File 'lib/privy/models/wallets/earn_asset.rb', line 25

Instance Attribute Details

#addressString

Token contract address.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/privy/models/wallets/earn_asset.rb', line 11

required :address, String

#decimalsInteger

Number of decimals for the asset (e.g. 6 for USDC).

Parameters:

  • value (Integer)

Returns:

  • (Integer)


17
# File 'lib/privy/models/wallets/earn_asset.rb', line 17

required :decimals, Integer

#symbolString

Lowercase token symbol (e.g. "usdc").

Parameters:

  • value (String)

Returns:

  • (String)


23
# File 'lib/privy/models/wallets/earn_asset.rb', line 23

required :symbol, String

Instance Method Details

#to_hash{ address: String, decimals: Integer, symbol: String }

Returns:

  • ({ address: String, decimals: Integer, symbol: String })


19
# File 'sig/privy/models/wallets/earn_asset.rbs', line 19

def to_hash: -> { address: String, decimals: Integer, symbol: String }