Onchain.Aave.V4.Types.SpokeReserveData (onchain_aave v0.4.0)

Copy Markdown View Source

Typed Aave V4 ISpoke.Reserve data.

Amounts and risk parameters remain raw integers. The packed reserve flags are retained and also exposed as named booleans.

API Functions

FunctionArityDescriptionParam Kinds
from_raw1Convert a decoded ISpoke.Reserve tuple into a typed struct.raw: exchange_data

Summary

Functions

Convert a decoded ISpoke.Reserve tuple into a typed struct.

Types

t()

@type t() :: %Onchain.Aave.V4.Types.SpokeReserveData{
  asset_id: non_neg_integer(),
  borrowable: boolean(),
  collateral_risk: non_neg_integer(),
  decimals: non_neg_integer(),
  dynamic_config_key: non_neg_integer(),
  flags: non_neg_integer(),
  frozen: boolean(),
  hub: String.t(),
  paused: boolean(),
  receive_shares_enabled: boolean(),
  underlying: String.t()
}

Functions

from_raw(arg)

@spec from_raw(tuple()) :: t()

Convert a decoded ISpoke.Reserve tuple into a typed struct.

Parameters

  • raw - 7-element tuple returned by getReserve (exchange_data)

Returns

%SpokeReserveData{} with checksummed addresses and decoded flags (struct)

# descripex:contract
%{
  params: %{
    raw: %{
      description: "7-element tuple returned by getReserve",
      source: "Onchain.Aave.V4.Spoke.get_reserve/3",
      kind: :exchange_data
    }
  },
  returns: %{
    type: :struct,
    description: "%SpokeReserveData{} with checksummed addresses and decoded flags"
  }
}