pub trait GraphQlClientExt:
GraphQlClient
+ Sized
+ Send {
Show 31 methods
// Provided methods
fn current_epoch_id(
&self,
) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn epoch_final_checkpoint_num(
&self,
epoch_id: u64,
) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn events_backward(
&self,
filter: Option<EventFilter>,
cursor: Option<String>,
page_size: Option<u32>,
) -> impl Future<Output = Result<(Vec<EventEdge>, bool), Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn filtered_full_objects(
&self,
owner: Option<Address>,
type_: Option<String>,
page_size: Option<u32>,
) -> impl Stream<Item = Result<Object, Error<<Self as GraphQlClient>::Error>>> + '_ + Send { ... }
fn full_object(
&self,
object_id: Address,
version: Option<u64>,
) -> impl Future<Output = Result<Object, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn latest_full_objects(
&self,
objects: impl IntoIterator<Item = Address> + Send,
page_size: Option<u32>,
) -> impl Future<Output = Result<HashMap<Address, Object>, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn multi_get_objects(
&self,
keys: impl IntoIterator<Item = (Address, Version)> + Send,
) -> impl Future<Output = Result<Vec<Object>, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn genesis_tx(
&self,
) -> impl Future<Output = Result<Transaction, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn latest_checkpoint(
&self,
) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn latest_object_version(
&self,
object_id: Address,
) -> impl Future<Output = Result<(u64, u64), Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn latest_objects_version(
&self,
object_ids: &[Address],
) -> impl Future<Output = Result<(u64, HashMap<Address, u64>), Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn latest_version_at_checkpoint(
&self,
id: Address,
ckpt_num: u64,
) -> impl Future<Output = Result<u64, LatestVersionAtCheckpointError<Self::Error>>> + Send { ... }
fn object_arg(
&self,
id: Address,
) -> impl Future<Output = Result<ObjectArg, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn object_args(
&self,
names: BiMap<String, Address>,
page_size: Option<u32>,
) -> impl Future<Output = Result<BiMap<String, ObjectArg>, ObjectArgsError<Self::Error>>> + Send { ... }
fn object_args_and_content(
&self,
object_ids: impl IntoIterator<Item = Address> + Send,
mutable: bool,
page_size: Option<u32>,
) -> impl Future<Output = Result<Vec<(ObjectArg, RawMoveStruct)>, ObjectArgsAndContentError<Self::Error>>> + Send { ... }
fn object_content(
&self,
object_id: Address,
version: Option<u64>,
) -> impl Future<Output = Result<RawMoveStruct, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn objects_content(
&self,
object_ids: Vec<Address>,
) -> impl Future<Output = Result<HashMap<Address, RawMoveStruct>, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn owner_df_content(
&self,
address: Address,
raw_move_value: RawMoveValue,
root_version: Option<u64>,
) -> impl Future<Output = Result<RawMoveValue, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn owner_df_contents(
&self,
address: Address,
root_version: Option<u64>,
first: Option<i32>,
after: Option<String>,
) -> impl Future<Output = Result<(HashMap<RawMoveValue, DynamicField>, Option<String>), Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn owner_df_contents_stream(
&self,
address: Address,
root_version: Option<u64>,
page_size: Option<i32>,
) -> impl Future<Output = impl Stream<Item = Result<(RawMoveValue, DynamicField), Error<<Self as GraphQlClient>::Error>>> + '_> + Send { ... }
fn owner_dof_content(
&self,
address: Address,
raw_move_value: RawMoveValue,
root_version: Option<u64>,
) -> impl Future<Output = Result<(ObjectKey, RawMoveStruct), Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn latest_package(
&self,
package_id: Address,
) -> impl Future<Output = Result<(Address, Version), Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn package_at_version(
&self,
package_id: Address,
version: Version,
) -> impl Future<Output = Result<Address, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn packages_from_original(
&self,
package_id: Address,
) -> impl Future<Output = Result<impl Iterator<Item = (Address, u64)>, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn packages_published_epoch(
&self,
package_ids: Vec<Address>,
) -> impl Future<Output = Result<impl Iterator<Item = (Address, u64, u64)>, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn reference_gas_price(
&self,
) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn transaction_blocks_status(
&self,
transaction_digests: Vec<String>,
) -> impl Future<Output = Result<impl Iterator<Item = Result<(String, bool), Error>>, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn gas_payment(
&self,
sponsor: Address,
budget: u64,
exclude: Vec<Address>,
) -> impl Future<Output = Result<Vec<ObjectRef>, GasPaymentError<Self::Error>>> + Send { ... }
fn max_page_size(
&self,
) -> impl Future<Output = Result<i32, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn object_type(
&self,
id: Address,
) -> impl Future<Output = Result<StructTag, Error<<Self as GraphQlClient>::Error>>> + Send { ... }
fn coin_metadata(
&self,
type_: &str,
) -> impl Future<Output = Result<(Option<u8>, Option<String>, Option<String>), Error<<Self as GraphQlClient>::Error>>> + Send { ... }
}
queries
only.Expand description
Extension trait to GraphQlClient
collecting all defined queries in one place.
Provided Methods§
Sourcefn current_epoch_id(
&self,
) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send
fn current_epoch_id( &self, ) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send
The latest epoch id.
Sourcefn epoch_final_checkpoint_num(
&self,
epoch_id: u64,
) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send
fn epoch_final_checkpoint_num( &self, epoch_id: u64, ) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send
The last checkpoint number of an epoch.
Sourcefn events_backward(
&self,
filter: Option<EventFilter>,
cursor: Option<String>,
page_size: Option<u32>,
) -> impl Future<Output = Result<(Vec<EventEdge>, bool), Error<<Self as GraphQlClient>::Error>>> + Send
fn events_backward( &self, filter: Option<EventFilter>, cursor: Option<String>, page_size: Option<u32>, ) -> impl Future<Output = Result<(Vec<EventEdge>, bool), Error<<Self as GraphQlClient>::Error>>> + Send
Return a single page of events + cursors and a flag indicating if there’s a previous page.
If page_size
is left None
, the server decides the size of the page.
The edges are returned in reverse order of which they where returned by the server
Sourcefn filtered_full_objects(
&self,
owner: Option<Address>,
type_: Option<String>,
page_size: Option<u32>,
) -> impl Stream<Item = Result<Object, Error<<Self as GraphQlClient>::Error>>> + '_ + Send
fn filtered_full_objects( &self, owner: Option<Address>, type_: Option<String>, page_size: Option<u32>, ) -> impl Stream<Item = Result<Object, Error<<Self as GraphQlClient>::Error>>> + '_ + Send
The latest full Object
contents with the possibility to filter by owner or object type.
Sourcefn full_object(
&self,
object_id: Address,
version: Option<u64>,
) -> impl Future<Output = Result<Object, Error<<Self as GraphQlClient>::Error>>> + Send
fn full_object( &self, object_id: Address, version: Option<u64>, ) -> impl Future<Output = Result<Object, Error<<Self as GraphQlClient>::Error>>> + Send
The full Object
contents at a certain version or the latest if not specified.
Sourcefn latest_full_objects(
&self,
objects: impl IntoIterator<Item = Address> + Send,
page_size: Option<u32>,
) -> impl Future<Output = Result<HashMap<Address, Object>, Error<<Self as GraphQlClient>::Error>>> + Send
fn latest_full_objects( &self, objects: impl IntoIterator<Item = Address> + Send, page_size: Option<u32>, ) -> impl Future<Output = Result<HashMap<Address, Object>, Error<<Self as GraphQlClient>::Error>>> + Send
The full Object
contents at their latest versions.
Fails if any requested object id is not in the final map.
§Note
The check for returned object ids is just so that the caller can safely do map[object_id]
on the returned map. Keep in mind that the result if an object id is repeated in objects
is undefined. Avoid doing so.
Sourcefn multi_get_objects(
&self,
keys: impl IntoIterator<Item = (Address, Version)> + Send,
) -> impl Future<Output = Result<Vec<Object>, Error<<Self as GraphQlClient>::Error>>> + Send
fn multi_get_objects( &self, keys: impl IntoIterator<Item = (Address, Version)> + Send, ) -> impl Future<Output = Result<Vec<Object>, Error<<Self as GraphQlClient>::Error>>> + Send
The full Object
contents at specific versions.
Duplicate object keys are automatically discarded.
Sourcefn genesis_tx(
&self,
) -> impl Future<Output = Result<Transaction, Error<<Self as GraphQlClient>::Error>>> + Send
fn genesis_tx( &self, ) -> impl Future<Output = Result<Transaction, Error<<Self as GraphQlClient>::Error>>> + Send
Genesis transaction of the Sui network instance.
Sourcefn latest_checkpoint(
&self,
) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send
fn latest_checkpoint( &self, ) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send
Latest checkpoint number.
Sourcefn latest_object_version(
&self,
object_id: Address,
) -> impl Future<Output = Result<(u64, u64), Error<<Self as GraphQlClient>::Error>>> + Send
fn latest_object_version( &self, object_id: Address, ) -> impl Future<Output = Result<(u64, u64), Error<<Self as GraphQlClient>::Error>>> + Send
The latest checkpoint number and object version of an object.
Sourcefn latest_objects_version(
&self,
object_ids: &[Address],
) -> impl Future<Output = Result<(u64, HashMap<Address, u64>), Error<<Self as GraphQlClient>::Error>>> + Send
fn latest_objects_version( &self, object_ids: &[Address], ) -> impl Future<Output = Result<(u64, HashMap<Address, u64>), Error<<Self as GraphQlClient>::Error>>> + Send
The latest checkpoint number and the map of object ids to the their version at that checkpoint.
Fails if the server doesn’t return the version for any of the requested objects.
Sourcefn latest_version_at_checkpoint(
&self,
id: Address,
ckpt_num: u64,
) -> impl Future<Output = Result<u64, LatestVersionAtCheckpointError<Self::Error>>> + Send
fn latest_version_at_checkpoint( &self, id: Address, ckpt_num: u64, ) -> impl Future<Output = Result<u64, LatestVersionAtCheckpointError<Self::Error>>> + Send
Version of the object at this checkpoint.
Sourcefn object_arg(
&self,
id: Address,
) -> impl Future<Output = Result<ObjectArg, Error<<Self as GraphQlClient>::Error>>> + Send
fn object_arg( &self, id: Address, ) -> impl Future<Output = Result<ObjectArg, Error<<Self as GraphQlClient>::Error>>> + Send
Get the object argument for a programmable transaction.
Sourcefn object_args(
&self,
names: BiMap<String, Address>,
page_size: Option<u32>,
) -> impl Future<Output = Result<BiMap<String, ObjectArg>, ObjectArgsError<Self::Error>>> + Send
fn object_args( &self, names: BiMap<String, Address>, page_size: Option<u32>, ) -> impl Future<Output = Result<BiMap<String, ObjectArg>, ObjectArgsError<Self::Error>>> + Send
Turn a bijective map of names and object ids into one of names and object args.
Fails if the query response does not have the necessary data for the input map.
Sourcefn object_args_and_content(
&self,
object_ids: impl IntoIterator<Item = Address> + Send,
mutable: bool,
page_size: Option<u32>,
) -> impl Future<Output = Result<Vec<(ObjectArg, RawMoveStruct)>, ObjectArgsAndContentError<Self::Error>>> + Send
fn object_args_and_content( &self, object_ids: impl IntoIterator<Item = Address> + Send, mutable: bool, page_size: Option<u32>, ) -> impl Future<Output = Result<Vec<(ObjectArg, RawMoveStruct)>, ObjectArgsAndContentError<Self::Error>>> + Send
Get a sequence of object args and contents corresponding to object_ids
, but not
necessarily in the same order.
NOTE: prefer GraphQlClientExt::latest_full_objects
instead and call Object::object_arg
on each returned object.
The mutable
argument controls whether we want to create mutable ObjectArg
s, if they
are of the ObjectArg::SharedObject
variant.
Fails if any object in the response is missing data.
Sourcefn object_content(
&self,
object_id: Address,
version: Option<u64>,
) -> impl Future<Output = Result<RawMoveStruct, Error<<Self as GraphQlClient>::Error>>> + Send
fn object_content( &self, object_id: Address, version: Option<u64>, ) -> impl Future<Output = Result<RawMoveStruct, Error<<Self as GraphQlClient>::Error>>> + Send
Get the raw Move struct of an object’s content.
fn objects_content( &self, object_ids: Vec<Address>, ) -> impl Future<Output = Result<HashMap<Address, RawMoveStruct>, Error<<Self as GraphQlClient>::Error>>> + Send
Sourcefn owner_df_content(
&self,
address: Address,
raw_move_value: RawMoveValue,
root_version: Option<u64>,
) -> impl Future<Output = Result<RawMoveValue, Error<<Self as GraphQlClient>::Error>>> + Send
fn owner_df_content( &self, address: Address, raw_move_value: RawMoveValue, root_version: Option<u64>, ) -> impl Future<Output = Result<RawMoveValue, Error<<Self as GraphQlClient>::Error>>> + Send
Get the raw Move value of a dynamic field’s value.
Sourcefn owner_df_contents(
&self,
address: Address,
root_version: Option<u64>,
first: Option<i32>,
after: Option<String>,
) -> impl Future<Output = Result<(HashMap<RawMoveValue, DynamicField>, Option<String>), Error<<Self as GraphQlClient>::Error>>> + Send
fn owner_df_contents( &self, address: Address, root_version: Option<u64>, first: Option<i32>, after: Option<String>, ) -> impl Future<Output = Result<(HashMap<RawMoveValue, DynamicField>, Option<String>), Error<<Self as GraphQlClient>::Error>>> + Send
Map of all keys to dynamic field values: RawMoveValue
-> DynamicField
.
Sourcefn owner_df_contents_stream(
&self,
address: Address,
root_version: Option<u64>,
page_size: Option<i32>,
) -> impl Future<Output = impl Stream<Item = Result<(RawMoveValue, DynamicField), Error<<Self as GraphQlClient>::Error>>> + '_> + Send
fn owner_df_contents_stream( &self, address: Address, root_version: Option<u64>, page_size: Option<i32>, ) -> impl Future<Output = impl Stream<Item = Result<(RawMoveValue, DynamicField), Error<<Self as GraphQlClient>::Error>>> + '_> + Send
Streamed map of all keys to dynamic field values: RawMoveValue
-> DynamicField
.
Sourcefn owner_dof_content(
&self,
address: Address,
raw_move_value: RawMoveValue,
root_version: Option<u64>,
) -> impl Future<Output = Result<(ObjectKey, RawMoveStruct), Error<<Self as GraphQlClient>::Error>>> + Send
fn owner_dof_content( &self, address: Address, raw_move_value: RawMoveValue, root_version: Option<u64>, ) -> impl Future<Output = Result<(ObjectKey, RawMoveStruct), Error<<Self as GraphQlClient>::Error>>> + Send
Get the raw Move struct of a dynamic object field’s value.
Sourcefn latest_package(
&self,
package_id: Address,
) -> impl Future<Output = Result<(Address, Version), Error<<Self as GraphQlClient>::Error>>> + Send
fn latest_package( &self, package_id: Address, ) -> impl Future<Output = Result<(Address, Version), Error<<Self as GraphQlClient>::Error>>> + Send
Get the latest version of a package.
Returns both its ID and version number.
Sourcefn package_at_version(
&self,
package_id: Address,
version: Version,
) -> impl Future<Output = Result<Address, Error<<Self as GraphQlClient>::Error>>> + Send
fn package_at_version( &self, package_id: Address, version: Version, ) -> impl Future<Output = Result<Address, Error<<Self as GraphQlClient>::Error>>> + Send
Get the address of a package at a specific version.
Sourcefn packages_from_original(
&self,
package_id: Address,
) -> impl Future<Output = Result<impl Iterator<Item = (Address, u64)>, Error<<Self as GraphQlClient>::Error>>> + Send
fn packages_from_original( &self, package_id: Address, ) -> impl Future<Output = Result<impl Iterator<Item = (Address, u64)>, Error<<Self as GraphQlClient>::Error>>> + Send
Get all the package ids and versions given the original package id.
Sourcefn packages_published_epoch(
&self,
package_ids: Vec<Address>,
) -> impl Future<Output = Result<impl Iterator<Item = (Address, u64, u64)>, Error<<Self as GraphQlClient>::Error>>> + Send
fn packages_published_epoch( &self, package_ids: Vec<Address>, ) -> impl Future<Output = Result<impl Iterator<Item = (Address, u64, u64)>, Error<<Self as GraphQlClient>::Error>>> + Send
The epoch and checkpoint number (in this order) for each package id.
Sourcefn reference_gas_price(
&self,
) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send
fn reference_gas_price( &self, ) -> impl Future<Output = Result<u64, Error<<Self as GraphQlClient>::Error>>> + Send
The reference gas price for the latest epoch.
Sourcefn transaction_blocks_status(
&self,
transaction_digests: Vec<String>,
) -> impl Future<Output = Result<impl Iterator<Item = Result<(String, bool), Error>>, Error<<Self as GraphQlClient>::Error>>> + Send
fn transaction_blocks_status( &self, transaction_digests: Vec<String>, ) -> impl Future<Output = Result<impl Iterator<Item = Result<(String, bool), Error>>, Error<<Self as GraphQlClient>::Error>>> + Send
Get execution status for the input transaction digests
Sourcefn gas_payment(
&self,
sponsor: Address,
budget: u64,
exclude: Vec<Address>,
) -> impl Future<Output = Result<Vec<ObjectRef>, GasPaymentError<Self::Error>>> + Send
fn gas_payment( &self, sponsor: Address, budget: u64, exclude: Vec<Address>, ) -> impl Future<Output = Result<Vec<ObjectRef>, GasPaymentError<Self::Error>>> + Send
Gas coins to satisfy the budget, excluding some object ids.
The exclude
is here because it can be useful if a SUI coin is already being used in the
PTB itself. However in such a scenario one can use Argument::Gas
instead.
Sourcefn max_page_size(
&self,
) -> impl Future<Output = Result<i32, Error<<Self as GraphQlClient>::Error>>> + Send
fn max_page_size( &self, ) -> impl Future<Output = Result<i32, Error<<Self as GraphQlClient>::Error>>> + Send
The maximum size for pagination allowed by the server.
Sourcefn object_type(
&self,
id: Address,
) -> impl Future<Output = Result<StructTag, Error<<Self as GraphQlClient>::Error>>> + Send
fn object_type( &self, id: Address, ) -> impl Future<Output = Result<StructTag, Error<<Self as GraphQlClient>::Error>>> + Send
Struct type of an object given its ID.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.