diff --git a/balius/wit/balius.wit b/balius/wit/balius.wit index ebec09f..f274cf2 100644 --- a/balius/wit/balius.wit +++ b/balius/wit/balius.wit @@ -9,6 +9,36 @@ interface kv { list-values: func(prefix: string) -> result, kv-error>; } +interface ledger { + type ledger-error = u32; + type cbor = list; + + record txo-ref { + tx-hash: list, + tx-index: u32, + } + + record utxo { + body: cbor, + ref: txo-ref, + } + + type address = list; + + record token-pattern { + policy: list, + name: option>, + } + + record utxo-pattern { + address: option
, + token: option, + } + + read-utxos: func(refs: list) -> result, ledger-error>; + search-utxos: func(pattern: utxo-pattern) -> result, ledger-error>; +} + interface submit { type cbor = list; type submit-error = u32; @@ -78,6 +108,7 @@ world worker { import kv; import broadcast; import submit; + import ledger; use driver.{event, handle-error, response};