fuel_gql_client::client

Struct FuelClient

Source
pub struct FuelClient { /* private fields */ }

Implementations§

Source§

impl FuelClient

Source

pub fn new(url: impl AsRef<str>) -> Result<Self>

Source

pub async fn health(&self) -> Result<bool>

Source

pub async fn node_info(&self) -> Result<NodeInfo>

Source

pub async fn chain_info(&self) -> Result<ChainInfo>

Source

pub async fn dry_run(&self, tx: &Transaction) -> Result<Vec<Receipt>>

Default dry run, matching the exact configuration as the node

Source

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

Source

pub async fn submit(&self, tx: &Transaction) -> Result<TransactionId>

Source

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.

Source

pub async fn start_session(&self) -> Result<String>

Source

pub async fn end_session(&self, id: &str) -> Result<bool>

Source

pub async fn reset(&self, id: &str) -> Result<bool>

Source

pub async fn execute(&self, id: &str, op: &Opcode) -> Result<bool>

Source

pub async fn register(&self, id: &str, register: RegisterId) -> Result<Word>

Source

pub async fn memory( &self, id: &str, start: usize, size: usize, ) -> Result<Vec<u8>>

Source

pub async fn set_breakpoint( &self, session_id: &str, contract: ContractId, pc: u64, ) -> Result<()>

Source

pub async fn set_single_stepping( &self, session_id: &str, enable: bool, ) -> Result<()>

Source

pub async fn start_tx( &self, session_id: &str, tx: &Transaction, ) -> Result<RunResult>

Source

pub async fn continue_tx(&self, session_id: &str) -> Result<RunResult>

Source

pub async fn transaction(&self, id: &str) -> Result<Option<TransactionResponse>>

Source

pub async fn transaction_status(&self, id: &str) -> Result<TransactionStatus>

Get the status of a transaction

Source

pub async fn subscribe_transaction_status( &self, id: &str, ) -> Result<impl Stream<Item = Result<TransactionStatus>>>

Subscribe to the status of a transaction

Source

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.

Source

pub async fn transactions( &self, request: PaginationRequest<String>, ) -> Result<PaginatedResult<TransactionResponse, String>>

returns a paginated set of transactions sorted by block height

Source

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.

Source

pub async fn receipts(&self, id: &str) -> Result<Vec<Receipt>>

Source

pub async fn produce_blocks( &self, blocks_to_produce: u64, time: Option<TimeParameters>, ) -> Result<u64>

Source

pub async fn block(&self, id: &str) -> Result<Option<Block>>

Source

pub async fn block_by_height(&self, height: u64) -> Result<Option<Block>>

Source

pub async fn blocks( &self, request: PaginationRequest<String>, ) -> Result<PaginatedResult<Block, String>>

Retrieve multiple blocks

Source

pub async fn coin(&self, id: &str) -> Result<Option<Coin>>

Source

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

Source

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

Source

pub async fn contract(&self, id: &str) -> Result<Option<Contract>>

Source

pub async fn contract_balance( &self, id: &str, asset: Option<&str>, ) -> Result<u64>

Source

pub async fn balance(&self, owner: &str, asset_id: Option<&str>) -> Result<u64>

Source

pub async fn balances( &self, owner: &str, request: PaginationRequest<String>, ) -> Result<PaginatedResult<Balance, String>>

Source

pub async fn contract_balances( &self, contract: &str, request: PaginationRequest<String>, ) -> Result<PaginatedResult<ContractBalance, String>>

Source

pub async fn messages( &self, owner: Option<&str>, request: PaginationRequest<String>, ) -> Result<PaginatedResult<Message, String>>

Source

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

Source§

fn clone(&self) -> FuelClient

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FuelClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S> From<S> for FuelClient
where S: Into<SocketAddr>,

Source§

fn from(socket: S) -> Self

Converts to this type from the input type.
Source§

impl FromStr for FuelClient

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(str: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for FuelClient

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FuelClient

Source§

fn eq(&self, other: &FuelClient) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for FuelClient

Source§

impl StructuralPartialEq for FuelClient

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<'a, T> StorageAsMut for T

Source§

fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>
where Type: Mappable,

Source§

impl<'a, T> StorageAsRef for T

Source§

fn storage<Type>(&self) -> StorageRef<'_, Self, Type>
where Type: Mappable,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> IsFieldType<T> for T

Source§

impl<T> MaybeSendSync for T