Ccxt.StructureNormalizer (CCXT Elixir v0.1.0-binance-pro-preview)

Copy Markdown View Source

Converts CCXT unified structures into database-facing attrs.

This module intentionally does not depend on Ecto. Decimal values are emitted as strings so a consuming Ecto app can cast them into :decimal fields without this package owning the database dependency.

Summary

Types

attrs()

@type attrs() :: map()

opts()

@type opts() :: keyword() | map()

Functions

normalize(structure, value, opts \\ [])

@spec normalize(atom() | String.t(), term(), opts()) ::
  {:ok, attrs() | [attrs()]} | {:error, term()}

normalize!(structure, value, opts \\ [])

@spec normalize!(atom() | String.t(), term(), opts()) :: attrs() | [attrs()]