#![doc(html_logo_url = "https://docs.gear.rs/logo.svg")]
#![doc(html_favicon_url = "https://gear-tech.io/favicons/favicon.ico")]
pub use crate::{
api::{Api, ApiBuilder},
config::GearConfig,
metadata::Event,
result::{Error, Result},
signer::PairSigner,
subscription::{Blocks, Events},
};
pub use gear_core::gas::GasInfo;
pub use subxt::dynamic::Value;
use crate::metadata::runtime_types::{
gear_common::gas_provider::node::{GasNode, GasNodeId},
gear_core::program::ActiveProgram,
};
use gear_core::ids::{MessageId, ReservationId};
use parity_scale_codec::Decode;
use sp_runtime::AccountId32;
use std::collections::HashMap;
use subxt::{
tx::{TxInBlock as SubxtTxInBlock, TxStatus as SubxtTxStatus},
OnlineClient,
};
mod api;
pub mod backtrace;
mod client;
pub mod config;
mod constants;
pub mod events;
pub mod metadata;
pub mod result;
mod rpc;
pub mod signer;
mod storage;
pub mod subscription;
mod utils;
pub mod ext {
pub use sp_core;
pub use sp_runtime::{self, codec, scale_info};
}
pub mod gp {
pub use subxt::ext::{
codec::{Decode, Encode},
scale_decode::DecodeAsType,
};
}
pub type BlockNumber = u32;
pub type GearGasNodeId = GasNodeId<MessageId, ReservationId>;
pub type GearGasNode = GasNode<AccountId32, GearGasNodeId, u64, u128>;
pub type GearPages = HashMap<u32, Vec<u8>>;
pub type TxInBlock = SubxtTxInBlock<GearConfig, OnlineClient<GearConfig>>;
pub type TxInBlockResult = Result<TxInBlock>;
pub type TxStatus = SubxtTxStatus<GearConfig, OnlineClient<GearConfig>>;
#[derive(Debug, Decode)]
pub enum Program {
Active(ActiveProgram<BlockNumber>),
Terminated,
}