# `Bourse.LedgerEntry`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/ledger_entry.ex#L1)

Unified ledger entry data.

Represents a single entry in an account's ledger/transaction history.

## Fields

  * `id` - Ledger entry ID
  * `timestamp` - Entry time in milliseconds
  * `datetime` - ISO 8601 datetime string
  * `direction` - "in" or "out"; nil when the venue assigns no flow direction (zero amount)
  * `account` - Account identifier
  * `reference_id` - Related transaction/order ID
  * `reference_account` - Related account
  * `type` - Entry type. Mapped vocabularies use one of two classes: registered unified values (`trade`, `fee`, `deposit`, `withdrawal`, `transfer`, `funding_fee`, `realized_pnl`, `liquidation`, `settlement`, `interest`, `rebate`, `commission`, `cashback`, `referral`, `conversion`, `bonus`), or a venue-faithful snake_case label when the event is outside that registry. Scopes with enum passthrough (base maps and routed maps alike) emit the provider's raw literal for any type outside their mapped set. The venue's literal is always retained in `info`.
  * `currency` - Currency code
  * `amount` - Entry amount
  * `before` - Balance before this entry
  * `after` - Balance after this entry
  * `status` - Entry status
  * `fee` - Associated fee
  * `info` - Raw exchange response

# `t`

```elixir
@type t() :: %Bourse.LedgerEntry{
  account: String.t() | nil,
  after: number() | nil,
  amount: number() | nil,
  before: number() | nil,
  currency: String.t() | nil,
  datetime: String.t() | nil,
  direction: String.t() | nil,
  fee: Bourse.Fee.t() | nil,
  id: String.t() | nil,
  info: map() | nil,
  reference_account: String.t() | nil,
  reference_id: String.t() | nil,
  status: String.t() | nil,
  timestamp: integer() | nil,
  type: String.t() | nil
}
```

# `schema`

```elixir
@spec schema() :: map()
```

JSON Schema for the LedgerEntry unified type.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
