Class: Privy::Models::Gas

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/privy/models/gas.rb

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(amount:, base_amount:, gas_asset:) ⇒ Object

Gas cost for a blockchain action. Includes both raw base-unit amount and a human-readable decimal string, plus the gas token symbol.

Parameters:

  • amount (String)

    Gas cost in the gas token as a human-readable decimal string (e.g. “0.0001”).

  • base_amount (String)

    Gas cost in the gas token’s base units (e.g. wei).

  • gas_asset (String)

    Gas token symbol (e.g. “ETH”, “USDC”).



# File 'lib/privy/models/gas.rb', line 24

Instance Attribute Details

#amountString

Gas cost in the gas token as a human-readable decimal string (e.g. “0.0001”).

Returns:

  • (String)


10
# File 'lib/privy/models/gas.rb', line 10

required :amount, String

#base_amountString

Gas cost in the gas token’s base units (e.g. wei).

Returns:

  • (String)


16
# File 'lib/privy/models/gas.rb', line 16

required :base_amount, String

#gas_assetString

Gas token symbol (e.g. “ETH”, “USDC”).

Returns:

  • (String)


22
# File 'lib/privy/models/gas.rb', line 22

required :gas_asset, String