ChainAccount

interface ChainAccount

On-chain account owned by a Trusted Domain on one specific chain.

Holds the key reference (not the key material), the on-chain address, and the operations needed by the treasury to query balance, estimate fees, and sign unsigned transactions handed up from a plugin.

Implementations are chain-aware (delegating to the corresponding org.trustweave.anchor.BlockchainAnchorClient for estimation and to a org.trustweave.kms.KeyManagementService for signing) and must not cache key material outside of the configured KMS.

Inheritors

Properties

Link copied to clipboard
abstract val address: String

Native account identifier on chainId.

Link copied to clipboard
abstract val chainId: String

CAIP-2 chain ID — e.g. eip155:137, algorand:mainnet.

Link copied to clipboard
abstract val keyRef: KmsKeyRef

KMS reference used to sign on behalf of this account.

Functions

Link copied to clipboard
abstract suspend fun balance(): TokenAmount

Current native-token balance, queried live from the chain.

Link copied to clipboard
abstract suspend fun estimateFee(op: OperationDescriptor): TokenAmount

Estimate the fee an op would incur if submitted now.

Link copied to clipboard
abstract suspend fun sign(tx: UnsignedTx): SignedTx

Sign an unsigned, plugin-built transaction. The transaction is opaque to the treasury — only the plugin understands its structure (Cardano UTXO, ETH RLP, Algorand MsgPack, …). The treasury merely brokers the KMS call.