ChainRecords extension

Application records on a chain assembled with the record state model, and the transaction queue every assembled chain proposes from.

on

Properties

pendingCount → int

Available on Chain, provided by the ChainRecords extension

Transactions waiting for the next proposal.
no setter

Methods

addTx(Uint8List tx) → Uint8List

Available on Chain, provided by the ChainRecords extension

Queues a signed, encoded transaction for the next proposal after checking it against the chain and the state the earlier queued transactions leave. Returns the txid; throws with the reason otherwise.
proveRecord(Uint8List key) → Uint8List

Available on Chain, provided by the ChainRecords extension

A state inclusion proof for the record at key; verify it with AviaryProofs.verifyStateProof and read it with AviaryRecords.recordFromProof.
record(Uint8List key) → RecordEntry?

Available on Chain, provided by the ChainRecords extension

The committed record at key, or null when none exists.
recordNonce(Uint8List address) → int

Available on Chain, provided by the ChainRecords extension

The next nonce address must use, counting queued writes.
write(Uint8List secret, Uint8List key, RecordOp op, Uint8List value) → Uint8List

Available on Chain, provided by the ChainRecords extension

Signs and queues a record write from a 64 byte Ed25519 secret; the nonce is taken from the chain, so several writes can be queued at once.
writeFromStore(KeyStore store, Uint8List from, Uint8List key, RecordOp op, Uint8List value) → Uint8List

Available on Chain, provided by the ChainRecords extension

Signs a record write with the key store account at from (the secret stays in the engine) and queues it; the nonce comes from the chain.