linera-execution 0.15.17

Persistent data and the corresponding logics used by the Linera protocol for runtime and execution of smart contracts / applications.
Documentation
// Copyright (c) Zefchain Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//! Wasm entrypoints for contracts and services.

use linera_base::data_types::StreamUpdate;
use linera_witty::wit_import;

/// WIT entrypoints for application contracts.
#[wit_import(package = "linera:app")]
pub trait ContractEntrypoints {
    fn instantiate(argument: Vec<u8>);
    fn execute_operation(operation: Vec<u8>) -> Vec<u8>;
    fn execute_message(message: Vec<u8>);
    fn process_streams(streams: Vec<StreamUpdate>);
    fn finalize();
}

/// WIT entrypoints for application services.
#[wit_import(package = "linera:app")]
pub trait ServiceEntrypoints {
    fn handle_query(argument: Vec<u8>) -> Vec<u8>;
}