Hubert - Distributed Infrastructure for Secure Multiparty Transactions - v1.0.0-alpha.20
    Preparing search index...

    Class ServerKvClient

    Server-backed key-value store using HTTP API.

    This implementation communicates with a Hubert server via HTTP POST requests.

    Port of struct ServerKvClient from server/kv.rs lines 6-37.

    const store = new ServerKvClient("http://127.0.0.1:45678");
    const arid = ARID.new();
    const envelope = Envelope.new("Hello, Server!");

    // Put envelope (write-once)
    await store.put(arid, envelope);

    // Get envelope with verbose logging
    const retrieved = await store.get(arid, undefined, true);

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Store an envelope at the given ARID.

      Port of KvStore::put() implementation from server/kv.rs lines 67-122.

      Parameters

      • arid: ARID
      • envelope: Envelope
      • OptionalttlSeconds: number
      • Optionalverbose: boolean

      Returns Promise<string>

    • Retrieve an envelope for the given ARID.

      Port of KvStore::get() implementation from server/kv.rs lines 124-212.

      Parameters

      • arid: ARID
      • OptionaltimeoutSeconds: number
      • Optionalverbose: boolean

      Returns Promise<Envelope | null>

    • Check if an envelope exists at the given ARID.

      Port of KvStore::exists() implementation from server/kv.rs lines 214-218.

      Parameters

      • arid: ARID

      Returns Promise<boolean>