Skip to main content

GraphQlClientInterface

interface GraphQlClientInterface

The GraphQL client for interacting with the IOTA blockchain.

Inheritors

GraphQlClient

Functions

NameSummary
activeValidatorsabstract suspend fun activeValidators(epoch: ULong? = null, paginationFilter: PaginationFilter? = null): ValidatorPage
Get the list of active validators for the provided epoch, including related metadata. If no epoch is provided, it will return the active validators for the current epoch.
balanceabstract suspend fun balance(address: Address, coinType: String? = null): ULong?
Get the balance of all the coins owned by address for the provided coin type. Coin type will default to 0x2::coin::Coin<0x2::iota::IOTA> if not provided.
chainIdabstract suspend fun chainId(): String
Get the chain identifier.
checkpointabstract suspend fun checkpoint(digest: CheckpointDigest? = null, seqNum: ULong? = null): CheckpointSummary?
Get the CheckpointSummary for a given checkpoint digest or checkpoint id. If none is provided, it will use the last known checkpoint id.
checkpointsabstract suspend fun checkpoints(paginationFilter: PaginationFilter? = null): CheckpointSummaryPage
Get a page of CheckpointSummary for the provided parameters.
coinMetadataabstract suspend fun coinMetadata(coinType: String): CoinMetadata?
Get the coin metadata for the coin type.
coinsabstract suspend fun coins(owner: Address, paginationFilter: PaginationFilter? = null, coinType: StructTag? = null): CoinPage
Get the list of coins for the specified address.
dryRunTxabstract suspend fun dryRunTx(tx: Transaction, skipChecks: Boolean = false): DryRunResult
Dry run a Transaction and return the transaction effects and dry run error (if any).
dryRunTxKindabstract suspend fun dryRunTxKind(txKind: TransactionKind, txMeta: TransactionMetadata, skipChecks: Boolean = false): DryRunResult
Dry run a TransactionKind and return the transaction effects and dry run error (if any).
dynamicFieldabstract suspend fun dynamicField(address: Address, typeTag: TypeTag, name: Value): DynamicFieldOutput?
Access a dynamic field on an object using its name. Names are arbitrary Move values whose type have copy, drop, and store, and are specified using their type, and their BCS contents, Base64 encoded.
dynamicFieldsabstract suspend fun dynamicFields(address: Address, paginationFilter: PaginationFilter? = null): DynamicFieldOutputPage
Get a page of dynamic fields for the provided address. Note that this will also fetch dynamic fields on wrapped objects.
dynamicObjectFieldabstract suspend fun dynamicObjectField(address: Address, typeTag: TypeTag, name: Value): DynamicFieldOutput?
Access a dynamic object field on an object using its name. Names are arbitrary Move values whose type have copy, drop, and store, and are specified using their type, and their BCS contents, Base64 encoded.
epochabstract suspend fun epoch(epoch: ULong? = null): Epoch?
Return the epoch information for the provided epoch. If no epoch is provided, it will return the last known epoch.
epochTotalCheckpointsabstract suspend fun epochTotalCheckpoints(epoch: ULong? = null): ULong?
Return the number of checkpoints in this epoch. This will return Ok(None) if the epoch requested is not available in the GraphQL service (e.g., due to pruning).
epochTotalTransactionBlocksabstract suspend fun epochTotalTransactionBlocks(epoch: ULong? = null): ULong?
Return the number of transaction blocks in this epoch. This will return Ok(None) if the epoch requested is not available in the GraphQL service (e.g., due to pruning).
eventsabstract suspend fun events(filter: EventFilter? = null, paginationFilter: PaginationFilter? = null): EventPage
Return a page of tuple (event, transaction digest) based on the (optional) event filter.
eventsSubscriptionabstract suspend fun eventsSubscription(filter: SubscriptionEventFilter? = null, startAfter: String? = null): EventSubscription
Subscribe to a live stream of events matching the (optional) filter.
executeTxabstract suspend fun executeTx(signatures: List<UserSignature>, tx: Transaction, waitFor: WaitForTx? = null): TransactionEffects
Execute a transaction.
gasCoinsabstract suspend fun gasCoins(owner: Address, paginationFilter: PaginationFilter? = null): CoinPage
Get the list of gas coins for the specified address.
iotaNamesDefaultNameabstract suspend fun iotaNamesDefaultName(address: Address, format: NameFormat?): Name?
Get the default name pointing to this address, if one exists.
iotaNamesLookupabstract suspend fun iotaNamesLookup(name: String): Address?
Return the resolved address for the given name.
iotaNamesRegistrationsabstract suspend fun iotaNamesRegistrations(address: Address, paginationFilter: PaginationFilter): NameRegistrationPage
Find all registration NFTs for the given address.
isTxFinalizedabstract suspend fun isTxFinalized(digest: TransactionDigest): Boolean
Returns whether the transaction for the given digest has been included in a checkpoint (finalized).
isTxIndexedOnNodeabstract suspend fun isTxIndexedOnNode(digest: TransactionDigest): Boolean
Returns whether the transaction for the given digest has been indexed on the node. This means that it can be queried by its digest and its effects will be usable for subsequent transactions. To check for full finalization, use is_tx_finalized.
latestCheckpointSequenceNumberabstract suspend fun latestCheckpointSequenceNumber(): ULong?
Return the sequence number of the latest checkpoint that has been executed.
maxPageSizeabstract suspend fun maxPageSize(): Int
Lazily fetch the max page size
moveObjectContentsabstract suspend fun moveObjectContents(objectId: ObjectId, version: Version? = null): Value?
Return the contents' JSON of an object that is a Move object.
moveObjectContentsBcsabstract suspend fun moveObjectContentsBcs(objectId: ObjectId, version: Version? = null): ByteArray?
Return the BCS of an object that is a Move object.
moveViewCallabstract suspend fun moveViewCall(functionName: String, typeArguments: List<TypeTag>? = null, arguments: List<MoveViewArg>? = null): MoveViewResult
Execute a Move View Function.
moveViewCallJsonabstract suspend fun moveViewCallJson(functionName: String, typeArguments: List<String>? = null, arguments: List<Value>? = null): MoveViewResult
Execute a Move View Function with raw JSON arguments.
normalizedMoveFunctionabstract suspend fun normalizedMoveFunction(package: Address, module: String, function: String, version: Version? = null): MoveFunction?
Return the normalized Move function data for the provided package, module, and function.
normalizedMoveModuleabstract suspend fun normalizedMoveModule(package: Address, module: String, version: Version? = null, paginationFilterEnums: PaginationFilter? = null, paginationFilterFriends: PaginationFilter? = null, paginationFilterFunctions: PaginationFilter? = null, paginationFilterStructs: PaginationFilter? = null): MoveModule?
Return the normalized Move module data for the provided module.
objectabstract suspend fun object(objectId: ObjectId, version: Version? = null): Object?
Return an object based on the provided Address.
objectBcsabstract suspend fun objectBcs(objectId: ObjectId): ByteArray?
Return the object's bcs content Vec<u8> based on the provided Address.
objectsabstract suspend fun objects(filter: ObjectFilter? = null, paginationFilter: PaginationFilter? = null): ObjectPage
Return a page of objects based on the provided parameters.
packageabstract suspend fun package(address: Address, version: Version? = null): MovePackage?
The package corresponding to the given address (at the optionally given version). When no version is given, the package is loaded directly from the address given. Otherwise, the address is translated before loading to point to the package whose original ID matches the package at address, but whose version is version. For non-system packages, this might result in a different address than address because different versions of a package, introduced by upgrades, exist at distinct addresses.
packageLatestabstract suspend fun packageLatest(address: Address): MovePackage?
Fetch the latest version of the package at address. This corresponds to the package with the highest version that shares its original ID with the package at address.
packagesabstract suspend fun packages(afterCheckpoint: ULong? = null, beforeCheckpoint: ULong? = null, paginationFilter: PaginationFilter? = null): MovePackagePage
The Move packages that exist in the network, optionally filtered to be strictly before beforeCheckpoint and/or strictly after afterCheckpoint.
packageVersionsabstract suspend fun packageVersions(address: Address, afterVersion: Version? = null, beforeVersion: Version? = null, paginationFilter: PaginationFilter? = null): MovePackagePage
Fetch all versions of package at address (packages that share this package's original ID), optionally bounding the versions exclusively from below with afterVersion, or from above with beforeVersion.
protocolConfigabstract suspend fun protocolConfig(version: ULong? = null): ProtocolConfigs
Get the protocol configuration.
referenceGasPriceabstract suspend fun referenceGasPrice(epoch: ULong? = null): ULong?
Get the reference gas price for the provided epoch or the last known one if no epoch is provided.
runQueryabstract suspend fun runQuery(query: Query): Value
Run a query.
serviceConfigabstract suspend fun serviceConfig(): ServiceConfig
Get the GraphQL service configuration, including complexity limits, read and mutation limits, supported versions, and others.
setRpcServerabstract suspend fun setRpcServer(server: String)
Set the server address for the GraphQL client. It should be a valid URL with a host and optionally a port number.
totalSupplyabstract suspend fun totalSupply(coinType: String): ULong?
Get total supply for the coin type.
totalTransactionBlocksabstract suspend fun totalTransactionBlocks(): ULong?
The total number of transaction blocks in the network by the end of the last known checkpoint.
totalTransactionBlocksByDigestabstract suspend fun totalTransactionBlocksByDigest(digest: CheckpointDigest): ULong?
The total number of transaction blocks in the network by the end of the provided checkpoint digest.
totalTransactionBlocksBySeqNumabstract suspend fun totalTransactionBlocksBySeqNum(seqNum: ULong): ULong?
The total number of transaction blocks in the network by the end of the provided checkpoint sequence number.
transactionabstract suspend fun transaction(digest: TransactionDigest): SignedTransaction?
Get a transaction by its digest.
transactionBuilderabstract fun transactionBuilder(sender: Address): ClientTransactionBuilder
Create a new TransactionBuilder with the given sender address.
transactionDataEffectsabstract suspend fun transactionDataEffects(digest: TransactionDigest): TransactionDataEffects?
Get a transaction's data and effects by its digest.
transactionEffectsabstract suspend fun transactionEffects(digest: TransactionDigest): TransactionEffects?
Get a transaction's effects by its digest.
transactionsabstract suspend fun transactions(filter: TransactionsFilter? = null, paginationFilter: PaginationFilter? = null): SignedTransactionPage
Get a page of transactions based on the provided filters.
transactionsDataEffectsabstract suspend fun transactionsDataEffects(filter: TransactionsFilter? = null, paginationFilter: PaginationFilter? = null): TransactionDataEffectsPage
Get a page of transactions' data and effects based on the provided filters.
transactionsEffectsabstract suspend fun transactionsEffects(filter: TransactionsFilter? = null, paginationFilter: PaginationFilter? = null): TransactionEffectsPage
Get a page of transactions' effects based on the provided filters.
transactionsSubscriptionabstract suspend fun transactionsSubscription(filter: SubscriptionTransactionFilter? = null, startAfter: String? = null): TransactionSubscription
Subscribe to a live stream of transactions matching the (optional) filter.
waitForTxabstract suspend fun waitForTx(digest: TransactionDigest, waitFor: WaitForTx, timeout: Duration? = null)
Wait for the indexing (on the node, not the indexer) or finalization of a transaction by its digest. An optional timeout can be provided, which, if exceeded, will return an error (default 60s).