iota_json_rpc_api/
bridge.rs

1// Copyright (c) Mysten Labs, Inc.
2// Modifications Copyright (c) 2024 IOTA Stiftung
3// SPDX-License-Identifier: Apache-2.0
4
5use iota_open_rpc_macros::open_rpc;
6use iota_types::bridge::BridgeSummary;
7use jsonrpsee::{core::RpcResult, proc_macros::rpc};
8
9#[open_rpc(namespace = "iotax", tag = "Bridge Read API")]
10#[rpc(server, client, namespace = "iotax")]
11pub trait BridgeReadApi {
12    /// Returns the latest BridgeSummary
13    #[method(name = "getLatestBridge")]
14    async fn get_latest_bridge(&self) -> RpcResult<BridgeSummary>;
15
16    /// Returns the initial shared version of the bridge object, usually
17    /// for the purpose of constructing an ObjectArg in a transaction.
18    #[method(name = "getBridgeObjectInitialSharedVersion")]
19    async fn get_bridge_object_initial_shared_version(&self) -> RpcResult<u64>;
20}