InMemoryChainAccount

class InMemoryChainAccount(val chainId: String, val address: String, val keyRef: KmsKeyRef, anchorClient: BlockchainAnchorClient, kms: KeyManagementService) : ChainAccount

Phase 2 in-memory ChainAccount adapter.

Bridges to the registered BlockchainAnchorClient for fee estimation and to a KeyManagementService for signing. Phase 2 plugins keep their embedded credentials, so balance returns TokenAmount.unknown — real on-chain balance lookup is out of scope until plugins surface it.

Constructors

Link copied to clipboard
constructor(chainId: String, address: String, keyRef: KmsKeyRef, anchorClient: BlockchainAnchorClient, kms: KeyManagementService)

Properties

Link copied to clipboard
open override val address: String

Native account identifier on chainId.

Link copied to clipboard
open override val chainId: String

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

Link copied to clipboard
open override val keyRef: KmsKeyRef

KMS reference used to sign on behalf of this account.

Functions

Link copied to clipboard
open suspend override fun balance(): TokenAmount

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

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

Estimate the fee an op would incur if submitted now.

Link copied to clipboard
open suspend override 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.