Class: Privy::Models::Wallets::BalanceGetResponse::Balance

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/privy/models/wallets/balance_get_response.rb,
sig/privy/models/wallets/balance_get_response.rbs

Defined Under Namespace

Modules: Asset

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(asset:, chain:, display_values:, raw_value:, raw_value_decimals:) ⇒ Object

Parameters:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/privy/models/wallets/balance_get_response.rb', line 17

class Balance < Privy::Internal::Type::BaseModel
  # @!attribute asset
  #
  #   @return [Symbol, String, Privy::Models::Wallets::BalanceGetResponse::Balance::Asset]
  required :asset, union: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset }

  # @!attribute chain
  #   Supported blockchain network names for wallet balance and transaction queries.
  #
  #   @return [Symbol, Privy::Models::WalletAssetChainNameInput]
  required :chain, enum: -> { Privy::WalletAssetChainNameInput }

  # @!attribute display_values
  #
  #   @return [Hash{Symbol=>String}]
  required :display_values, Privy::Internal::Type::HashOf[String]

  # @!attribute raw_value
  #
  #   @return [String]
  required :raw_value, String

  # @!attribute raw_value_decimals
  #
  #   @return [Float]
  required :raw_value_decimals, Float

  # @!method initialize(asset:, chain:, display_values:, raw_value:, raw_value_decimals:)
  #   @param asset [Symbol, String, Privy::Models::Wallets::BalanceGetResponse::Balance::Asset]
  #
  #   @param chain [Symbol, Privy::Models::WalletAssetChainNameInput] Supported blockchain network names for wallet balance and transaction queries.
  #
  #   @param display_values [Hash{Symbol=>String}]
  #
  #   @param raw_value [String]
  #
  #   @param raw_value_decimals [Float]

  # @see Privy::Models::Wallets::BalanceGetResponse::Balance#asset
  module Asset
    extend Privy::Internal::Type::Union

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::USDC }

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::USDC_E }

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::ETH }

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::AVAX }

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::POL }

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::USDT }

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::EURC }

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::USDB }

    variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::SOL }

    variant String

    # @!method self.variants
    #   @return [Array(Symbol, String)]

    define_sorbet_constant!(:Variants) do
      T.type_alias { T.any(Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol, String) }
    end

    # @!group

    USDC = :usdc
    USDC_E = :"usdc.e"
    ETH = :eth
    AVAX = :avax
    POL = :pol
    USDT = :usdt
    EURC = :eurc
    USDB = :usdb
    SOL = :sol

    # @!endgroup
  end
end

Instance Attribute Details

#assetSymbol, ...

Parameters:

  • value (Privy::Models::Wallets::BalanceGetResponse::Balance::asset)

Returns:



21
# File 'lib/privy/models/wallets/balance_get_response.rb', line 21

required :asset, union: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset }

#chainSymbol, Privy::Models::WalletAssetChainNameInput

Supported blockchain network names for wallet balance and transaction queries.

Parameters:

  • value (Privy::Models::wallet_asset_chain_name_input)

Returns:



27
# File 'lib/privy/models/wallets/balance_get_response.rb', line 27

required :chain, enum: -> { Privy::WalletAssetChainNameInput }

#display_valuesHash{Symbol=>String}

Parameters:

  • value (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String})


32
# File 'lib/privy/models/wallets/balance_get_response.rb', line 32

required :display_values, Privy::Internal::Type::HashOf[String]

#raw_valueString

Parameters:

  • value (String)

Returns:

  • (String)


37
# File 'lib/privy/models/wallets/balance_get_response.rb', line 37

required :raw_value, String

#raw_value_decimalsFloat

Parameters:

  • value (Float)

Returns:

  • (Float)


42
# File 'lib/privy/models/wallets/balance_get_response.rb', line 42

required :raw_value_decimals, Float

Instance Method Details

#to_hash{

Returns:

  • ({)


48
# File 'sig/privy/models/wallets/balance_get_response.rbs', line 48

def to_hash: -> {