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.
Represents the per-asset balance breakdown returned by
Merchant.get_balance(). A merchant wallet may hold multiple Stellar assets.Proposed Steps:
src/shade/models/balance.py.AssetBalance(ShadeObject)withasset_code: str,asset_issuer: Optional[str],balance: Decimal.Balance(ShadeObject)withbalances: list[AssetBalance]and aget(asset_code: str)helper.Acceptance Criteria:
balance.get("XLM")returns the native balanceAssetBalance.balance.get("USDC")returns the USDC balance if held.balance.get("NOTEXIST")returnsNonerather than raising.Decimal.