pub struct FuelClient { /* private fields */ }

Implementations§

source§

impl FuelClient

source

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

source

pub async fn query<ResponseData, Vars>( &self, q: Operation<ResponseData, Vars> ) -> Result<ResponseData>where Vars: Serialize, ResponseData: DeserializeOwned + 'static,

Send the GraphQL query ot the client.

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: &Instruction) -> 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 FuelClientwhere S: Into<SocketAddr>,

source§

fn from(socket: S) -> Self

Converts to this type from the input type.
source§

impl FromStr for FuelClient

§

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AnyDebug for Twhere T: Any + Debug,

§

fn as_any_ref(&self) -> &(dyn Any + 'static)

Returns a reference to the underlying type as Any.
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> StorageAsMut for T

§

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

§

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

§

impl<T> StorageAsRef for T

§

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

§

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

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> IsFieldType<T> for T