Struct fuel_gql_client::client::FuelClient
source · pub struct FuelClient { /* private fields */ }
Implementations§
source§impl FuelClient
impl FuelClient
pub fn new(url: impl AsRef<str>) -> Result<Self>
pub async fn health(&self) -> Result<bool>
pub async fn node_info(&self) -> Result<NodeInfo>
pub async fn chain_info(&self) -> Result<ChainInfo>
sourcepub async fn dry_run(&self, tx: &Transaction) -> Result<Vec<Receipt>>
pub async fn dry_run(&self, tx: &Transaction) -> Result<Vec<Receipt>>
Default dry run, matching the exact configuration as the node
sourcepub async fn dry_run_opt(
&self,
tx: &Transaction,
utxo_validation: Option<bool>
) -> Result<Vec<Receipt>>
pub async fn dry_run_opt(
&self,
tx: &Transaction,
utxo_validation: Option<bool>
) -> Result<Vec<Receipt>>
Dry run with options to override the node behavior
pub async fn submit(&self, tx: &Transaction) -> Result<TransactionId>
sourcepub async fn submit_and_await_commit(
&self,
tx: &Transaction
) -> Result<TransactionStatus>
pub async fn submit_and_await_commit(
&self,
tx: &Transaction
) -> Result<TransactionStatus>
Submit the transaction and wait for it to be included into a block.
This will wait forever if needed, so consider wrapping this call
with a tokio::time::timeout
.
pub async fn start_session(&self) -> Result<String>
pub async fn end_session(&self, id: &str) -> Result<bool>
pub async fn reset(&self, id: &str) -> Result<bool>
pub async fn execute(&self, id: &str, op: &Opcode) -> Result<bool>
pub async fn register(&self, id: &str, register: RegisterId) -> Result<Word>
pub async fn memory(&self, id: &str, start: usize, size: usize) -> Result<Vec<u8>>
pub async fn set_breakpoint(
&self,
session_id: &str,
contract: ContractId,
pc: u64
) -> Result<()>
pub async fn set_single_stepping(
&self,
session_id: &str,
enable: bool
) -> Result<()>
pub async fn start_tx(
&self,
session_id: &str,
tx: &Transaction
) -> Result<RunResult>
pub async fn continue_tx(&self, session_id: &str) -> Result<RunResult>
pub async fn transaction(&self, id: &str) -> Result<Option<TransactionResponse>>
sourcepub async fn transaction_status(&self, id: &str) -> Result<TransactionStatus>
pub async fn transaction_status(&self, id: &str) -> Result<TransactionStatus>
Get the status of a transaction
sourcepub async fn subscribe_transaction_status(
&self,
id: &str
) -> Result<impl Stream<Item = Result<TransactionStatus>>>
pub async fn subscribe_transaction_status(
&self,
id: &str
) -> Result<impl Stream<Item = Result<TransactionStatus>>>
Subscribe to the status of a transaction
sourcepub async fn await_transaction_commit(
&self,
id: &str
) -> Result<TransactionStatus>
pub async fn await_transaction_commit(
&self,
id: &str
) -> Result<TransactionStatus>
Awaits for the transaction to be committed into a block
This will wait forever if needed, so consider wrapping this call
with a tokio::time::timeout
.
sourcepub async fn transactions(
&self,
request: PaginationRequest<String>
) -> Result<PaginatedResult<TransactionResponse, String>>
pub async fn transactions(
&self,
request: PaginationRequest<String>
) -> Result<PaginatedResult<TransactionResponse, String>>
returns a paginated set of transactions sorted by block height
sourcepub async fn transactions_by_owner(
&self,
owner: &str,
request: PaginationRequest<String>
) -> Result<PaginatedResult<TransactionResponse, String>>
pub async fn transactions_by_owner(
&self,
owner: &str,
request: PaginationRequest<String>
) -> Result<PaginatedResult<TransactionResponse, String>>
Returns a paginated set of transactions associated with a txo owner address.
pub async fn receipts(&self, id: &str) -> Result<Vec<Receipt>>
pub async fn produce_blocks(
&self,
blocks_to_produce: u64,
time: Option<TimeParameters>
) -> Result<u64>
pub async fn block(&self, id: &str) -> Result<Option<Block>>
pub async fn block_by_height(&self, height: u64) -> Result<Option<Block>>
sourcepub async fn blocks(
&self,
request: PaginationRequest<String>
) -> Result<PaginatedResult<Block, String>>
pub async fn blocks(
&self,
request: PaginationRequest<String>
) -> Result<PaginatedResult<Block, String>>
Retrieve multiple blocks
pub async fn coin(&self, id: &str) -> Result<Option<Coin>>
sourcepub async fn coins(
&self,
owner: &str,
asset_id: Option<&str>,
request: PaginationRequest<String>
) -> Result<PaginatedResult<Coin, String>>
pub async fn coins(
&self,
owner: &str,
asset_id: Option<&str>,
request: PaginationRequest<String>
) -> Result<PaginatedResult<Coin, String>>
Retrieve a page of coins by their owner
sourcepub async fn resources_to_spend(
&self,
owner: &str,
spend_query: Vec<(&str, u64, Option<u64>)>,
excluded_ids: Option<(Vec<&str>, Vec<&str>)>
) -> Result<Vec<Vec<Resource>>>
pub async fn resources_to_spend(
&self,
owner: &str,
spend_query: Vec<(&str, u64, Option<u64>)>,
excluded_ids: Option<(Vec<&str>, Vec<&str>)>
) -> Result<Vec<Vec<Resource>>>
Retrieve resources to spend in a transaction
pub async fn contract(&self, id: &str) -> Result<Option<Contract>>
pub async fn contract_balance(&self, id: &str, asset: Option<&str>) -> Result<u64>
pub async fn balance(&self, owner: &str, asset_id: Option<&str>) -> Result<u64>
pub async fn balances(
&self,
owner: &str,
request: PaginationRequest<String>
) -> Result<PaginatedResult<Balance, String>>
pub async fn contract_balances(
&self,
contract: &str,
request: PaginationRequest<String>
) -> Result<PaginatedResult<ContractBalance, String>>
pub async fn messages(
&self,
owner: Option<&str>,
request: PaginationRequest<String>
) -> Result<PaginatedResult<Message, String>>
sourcepub async fn message_proof(
&self,
transaction_id: &str,
message_id: &str
) -> Result<Option<MessageProof>>
pub async fn message_proof(
&self,
transaction_id: &str,
message_id: &str
) -> Result<Option<MessageProof>>
Request a merkle proof of an output message.
Trait Implementations§
source§impl Clone for FuelClient
impl Clone for FuelClient
source§fn clone(&self) -> FuelClient
fn clone(&self) -> FuelClient
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FuelClient
impl Debug for FuelClient
source§impl<S> From<S> for FuelClientwhere
S: Into<SocketAddr>,
impl<S> From<S> for FuelClientwhere
S: Into<SocketAddr>,
source§impl FromStr for FuelClient
impl FromStr for FuelClient
source§impl Hash for FuelClient
impl Hash for FuelClient
source§impl PartialEq<FuelClient> for FuelClient
impl PartialEq<FuelClient> for FuelClient
source§fn eq(&self, other: &FuelClient) -> bool
fn eq(&self, other: &FuelClient) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for FuelClient
impl StructuralEq for FuelClient
impl StructuralPartialEq for FuelClient
Auto Trait Implementations§
impl RefUnwindSafe for FuelClient
impl Send for FuelClient
impl Sync for FuelClient
impl Unpin for FuelClient
impl UnwindSafe for FuelClient
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.