linera-sdk 0.15.17

Library to support developing Linera applications in Rust.
Documentation
package linera:app;

interface base-runtime-api {
    get-chain-id: func() -> chain-id;
    get-block-height: func() -> block-height;
    get-application-id: func() -> application-id;
    get-application-creator-chain-id: func() -> chain-id;
    read-application-description: func(application-id: application-id) -> application-description;
    application-parameters: func() -> list<u8>;
    get-chain-ownership: func() -> chain-ownership;
    get-application-permissions: func() -> application-permissions;
    read-system-timestamp: func() -> timestamp;
    read-chain-balance: func() -> amount;
    read-owner-balance: func(owner: account-owner) -> amount;
    read-owner-balances: func() -> list<tuple<account-owner, amount>>;
    read-balance-owners: func() -> list<account-owner>;
    perform-http-request: func(request: http-request) -> http-response;
    assert-before: func(timestamp: timestamp);
    read-data-blob: func(hash: data-blob-hash) -> list<u8>;
    assert-data-blob-exists: func(hash: data-blob-hash);
    log: func(message: string, level: log-level);
    contains-key-new: func(key: list<u8>) -> u32;
    contains-key-wait: func(promise-id: u32) -> bool;
    contains-keys-new: func(keys: list<list<u8>>) -> u32;
    contains-keys-wait: func(promise-id: u32) -> list<bool>;
    read-multi-values-bytes-new: func(keys: list<list<u8>>) -> u32;
    read-multi-values-bytes-wait: func(promise-id: u32) -> list<option<list<u8>>>;
    read-value-bytes-new: func(key: list<u8>) -> u32;
    read-value-bytes-wait: func(promise-id: u32) -> option<list<u8>>;
    find-keys-new: func(key-prefix: list<u8>) -> u32;
    find-keys-wait: func(promise-id: u32) -> list<list<u8>>;
    find-key-values-new: func(key-prefix: list<u8>) -> u32;
    find-key-values-wait: func(promise-id: u32) -> list<tuple<list<u8>, list<u8>>>;

    variant account-owner {
        reserved(u8),
        address32(crypto-hash),
        address20(array20),
    }

    record amount {
        inner0: u128,
    }

    record application-description {
        module-id: module-id,
        creator-chain-id: chain-id,
        block-height: block-height,
        application-index: u32,
        parameters: list<u8>,
        required-application-ids: list<application-id>,
    }

    record application-id {
        application-description-hash: crypto-hash,
    }

    record application-permissions {
        execute-operations: option<list<application-id>>,
        mandatory-applications: list<application-id>,
        close-chain: list<application-id>,
        change-application-permissions: list<application-id>,
        call-service-as-oracle: option<list<application-id>>,
        make-http-requests: option<list<application-id>>,
    }

    record array20 {
        part1: u64,
        part2: u64,
        part3: u64,
    }

    record block-height {
        inner0: u64,
    }

    record chain-id {
        inner0: crypto-hash,
    }

    record chain-ownership {
        super-owners: list<account-owner>,
        owners: list<tuple<account-owner, u64>>,
        multi-leader-rounds: u32,
        open-multi-leader-rounds: bool,
        timeout-config: timeout-config,
    }

    record crypto-hash {
        part1: u64,
        part2: u64,
        part3: u64,
        part4: u64,
    }

    record data-blob-hash {
        inner0: crypto-hash,
    }

    record http-header {
        name: string,
        value: list<u8>,
    }

    enum http-method {
        get,
        post,
        put,
        delete,
        head,
        options,
        connect,
        patch,
        trace,
    }

    record http-request {
        method: http-method,
        url: string,
        headers: list<http-header>,
        body: list<u8>,
    }

    record http-response {
        status: u16,
        headers: list<http-header>,
        body: list<u8>,
    }

    enum log-level {
        error,
        warn,
        info,
        debug,
        trace,
    }

    record module-id {
        contract-blob-hash: crypto-hash,
        service-blob-hash: crypto-hash,
        vm-runtime: vm-runtime,
    }

    record time-delta {
        inner0: u64,
    }

    record timeout-config {
        fast-round-duration: option<time-delta>,
        base-timeout: time-delta,
        timeout-increment: time-delta,
        fallback-duration: time-delta,
    }

    record timestamp {
        inner0: u64,
    }

    type u128 = tuple<u64, u64>;

    enum vm-runtime {
        wasm,
        evm,
    }
}