use std::collections::BTreeMap;
use iota_json_rpc_types::{
IotaMoveNormalizedFunction, IotaMoveNormalizedModule, IotaMoveNormalizedStruct,
MoveFunctionArgType,
};
use iota_open_rpc_macros::open_rpc;
use iota_types::base_types::ObjectID;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
#[open_rpc(namespace = "iota", tag = "Move Utils")]
#[rpc(server, client, namespace = "iota")]
pub trait MoveUtils {
#[method(name = "getMoveFunctionArgTypes")]
async fn get_move_function_arg_types(
&self,
package: ObjectID,
module: String,
function: String,
) -> RpcResult<Vec<MoveFunctionArgType>>;
#[method(name = "getNormalizedMoveModulesByPackage")]
async fn get_normalized_move_modules_by_package(
&self,
package: ObjectID,
) -> RpcResult<BTreeMap<String, IotaMoveNormalizedModule>>;
#[method(name = "getNormalizedMoveModule")]
async fn get_normalized_move_module(
&self,
package: ObjectID,
module_name: String,
) -> RpcResult<IotaMoveNormalizedModule>;
#[method(name = "getNormalizedMoveStruct")]
async fn get_normalized_move_struct(
&self,
package: ObjectID,
module_name: String,
struct_name: String,
) -> RpcResult<IotaMoveNormalizedStruct>;
#[method(name = "getNormalizedMoveFunction")]
async fn get_normalized_move_function(
&self,
package: ObjectID,
module_name: String,
function_name: String,
) -> RpcResult<IotaMoveNormalizedFunction>;
}