SuiGraphQLClient class

GraphQL client for Sui GraphQL RPC (the secondary transport).

Use for indexed historical queries, staking and validator APYs. Full nodes also support filtered ledger scans through gRPC. Mysten operates public endpoints at graphql.<network>.sui.io; see graphqlEndpoint.

Constructors

SuiGraphQLClient({required String endpoint, Dio? dio, Map<String, String> headers = const {}, GraphQLTransport? transport})
SuiGraphQLClient.forNetwork(SuiNetwork network, {Dio? dio, Map<String, String> headers = const {}})
Construct against the public GraphQL endpoint for network.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transport → GraphQLTransport
final

Methods

defaultNameServiceName(String address, {CancelToken? cancelToken}) → Future<String?>
getActiveValidators({int? epochId, int first = 50, String? after, CancelToken? cancelToken}) → Future<List<ValidatorInfo>>
Active validators for the current (or given) epoch, parsed from each validator's on-chain 0x3::validator::Validator contents.
getChainIdentifier({CancelToken? cancelToken}) → Future<String>
Chain identifier (digest of the genesis checkpoint).
getEpochSummary({int? epochId, CancelToken? cancelToken}) → Future<EpochSummary>
Summary of an epoch (defaults to the current epoch).
getStakes(String owner, {int first = 50, String? after, CancelToken? cancelToken}) → Future<List<StakedSuiInfo>>
Staked SUI objects owned by owner (0x3::staking_pool::StakedSui).
listEvents({GraphQLEventFilter? filter, int limit = 50, String? after, String? before, bool descending = true, CancelToken? cancelToken}) → Future<GraphQLPage<Map<String, dynamic>>>
Events include their contents, transaction identity and checkpoint.
listTransactions({GraphQLTransactionFilter? filter, int limit = 50, String? after, String? before, bool descending = true, CancelToken? cancelToken}) → Future<GraphQLPage<SenderTransaction>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
queryEventsByModule(String packageId, String module, {int first = 20, String? after, CancelToken? cancelToken}) → Future<List<Map<String, dynamic>>>
Query events emitted by a Move module, e.g. package 0x2, module coin.
queryTransactionsByAddress(String address, {int first = 20, String? after, TransactionHistoryOptions options = const TransactionHistoryOptions(), CancelToken? cancelToken}) → Future<SenderTransactionPage>
Query transactions that affected address — both sent and received.
queryTransactionsByObject(String objectId, {int first = 20, String? after, CancelToken? cancelToken}) → Future<TransactionDigestPage>
Query transaction digests that affected a given object (its history).
queryTransactionsBySender(String sender, {int first = 20, String? after, TransactionHistoryOptions options = const TransactionHistoryOptions(), CancelToken? cancelToken}) → Future<SenderTransactionPage>
Query transactions the account sent (signed), via the sentAddress filter — the sender-only primitive. For a complete wallet history that also includes incoming transfers, use queryTransactionsByAddress.
resolveNameServiceAddress(String name, {CancelToken? cancelToken}) → Future<String?>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited