pub enum Asset {
Xch,
Cat(AssetId),
}Expand description
The asset a wallet balance/coin read is denominated in: native XCH, or any CAT by asset id.
§Why there is no separate Dig variant
$DIG is a CAT, so it is Asset::DIG — an associated constant, not a variant. A three-variant
{Xch, Dig, Cat(id)} would give $DIG two INEQUAL spellings, and a balance or coin list filtered
by one of them would silently omit everything carrying the other: a wallet reporting half a
balance as though it were the whole. One token, one value.
§Wire form (additive — CLAUDE.md §5.1)
| Value | JSON |
|---|---|
Asset::Xch | "xch" |
Asset::DIG | "dig" |
| any other CAT | {"cat":"<64-hex>"} |
Both legacy tokens are still ACCEPTED and "dig" is still EMITTED, so a node or client built
before this release keeps understanding, and being understood by, one built after it.
{"cat":"<the $DIG asset id>"} is also accepted and normalizes to Asset::DIG.
Byte-identical to dig-app’s consumer type (dig-app-core::wallet::state::Asset), recorded in the
canonical skill so the two implementations cannot drift.
Variants§
Xch
Native Chia (XCH), denominated in mojos.
Cat(AssetId)
A CAT, named by its asset id and denominated in its own base units.
Implementations§
Source§impl Asset
impl Asset
Sourcepub const DIG_ASSET_ID_HEX: &'static str = "a406d3a9de984d03c9591c10d917593b434d5263cabe2b42f6b367df16832f81"
pub const DIG_ASSET_ID_HEX: &'static str = "a406d3a9de984d03c9591c10d917593b434d5263cabe2b42f6b367df16832f81"
Canonical $DIG CAT asset id (TAIL hash) on Chia mainnet, as lowercase hex.
CONTRACT: byte-identical to dig_constants::DIG_ASSET_ID, chip35_dl_coin::DIG_ASSET_ID,
and digstore-chain’s. It is duplicated here rather than imported because this crate is a
level-00 foundation crate and may not depend sideways on dig-constants (CLAUDE.md
Appendix B). dig_asset_id_hex_and_bytes_are_the_same_id pins THIS crate’s two spellings
of it together; agreement with the ecosystem constant is a source-of-truth obligation on
whoever changes it, recorded in the canonical skill.