Skip to content

Implement Balance model #43

Description

@codebestia

Represents the per-asset balance breakdown returned by Merchant.get_balance(). A merchant wallet may hold multiple Stellar assets.

Proposed Steps:

  • Create src/shade/models/balance.py.
  • Define AssetBalance(ShadeObject) with asset_code: str, asset_issuer: Optional[str], balance: Decimal.
  • Define Balance(ShadeObject) with balances: list[AssetBalance] and a get(asset_code: str) helper.

Acceptance Criteria:

  • balance.get("XLM") returns the native balance AssetBalance.
  • balance.get("USDC") returns the USDC balance if held.
  • balance.get("NOTEXIST") returns None rather than raising.
  • All balance amounts are Decimal.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions