GraphQlClientInterface
interface GraphQlClientInterface
The GraphQL client for interacting with the IOTA blockchain.
Inheritors
| GraphQlClient |
Functions
| Name | Summary |
|---|---|
| activeValidators | abstract suspend fun activeValidators(epoch: ULong? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlValidatorPage 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. |
| addressTransactions | abstract suspend fun addressTransactions(address: Address, relation: GraphQlAddressTransactionRelationship? = null, filter: GraphQlTransactionsFilter? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlSignedTransactionPage Get a page of transactions related to the given address. relation selects how the address relates to them, defaulting to the transactions it sent. |
| balance | abstract suspend fun balance(address: Address, coinType: StructTag? = null): ULong? Get the balance of all the coins owned by address for the provided coin type. Coin type will default to 0x2::iota::IOTA if not provided. |
| chainId | abstract suspend fun chainId(): String Get the chain identifier. |
| checkpoint | abstract suspend fun checkpoint(digest: CheckpointDigest? = null, sequenceNumber: 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. |
| checkpoints | abstract suspend fun checkpoints(paginationFilter: GraphQlPaginationFilter? = null): GraphQlCheckpointSummaryPage Get a page of CheckpointSummary for the provided parameters. |
| coinMetadata | abstract suspend fun coinMetadata(coinType: StructTag): GraphQlCoinMetadata? Get the coin metadata for the coin type. |
| coins | abstract suspend fun coins(owner: Address, paginationFilter: GraphQlPaginationFilter? = null, coinType: StructTag? = null): GraphQlCoinPage Get the list of coins for the specified address. |
| dryRunTransaction | abstract suspend fun dryRunTransaction(transaction: Transaction, skipChecks: Boolean = false): GraphQlDryRunResult Dry run a Transaction and return the transaction effects and dry run error (if any). |
| dryRunTransactionKind | abstract suspend fun dryRunTransactionKind(transactionKind: TransactionKind, transactionMetadata: GraphQlTransactionMetadata, skipChecks: Boolean = false): GraphQlDryRunResult Dry run a TransactionKind and return the transaction effects and dry run error (if any). |
| dynamicField | abstract suspend fun dynamicField(address: Address, typeTag: TypeTag, name: Value): GraphQlDynamicFieldOutput? 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. |
| dynamicFields | abstract suspend fun dynamicFields(address: Address, paginationFilter: GraphQlPaginationFilter? = null): GraphQlDynamicFieldOutputPage Get a page of dynamic fields for the provided address. Note that this will also fetch dynamic fields on wrapped objects. |
| dynamicObjectField | abstract suspend fun dynamicObjectField(address: Address, typeTag: TypeTag, name: Value): GraphQlDynamicFieldOutput? 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. |
| epoch | abstract suspend fun epoch(epoch: ULong? = null): GraphQlEpoch? Return the epoch information for the provided epoch. If no epoch is provided, it will return the last known epoch. |
| epochTotalCheckpoints | abstract 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). |
| epochTotalTransactionBlocks | abstract 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). |
| events | abstract suspend fun events(filter: GraphQlEventFilter? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlEventPage Return a page of tuple (event, transaction digest) based on the (optional) event filter. |
| eventsSubscription | abstract fun eventsSubscription(filter: GraphQlSubscriptionEventFilter? = null, startAfter: TransactionDigest? = null): GraphQlEventSubscription Subscribe to a live stream of events matching the (optional) filter. |
| executeTransaction | abstract suspend fun executeTransaction(signatures: List<UserSignature>, transaction: Transaction, waitFor: WaitForTransaction? = null): TransactionEffects Execute a transaction. |
| gasCoins | abstract suspend fun gasCoins(owner: Address, paginationFilter: GraphQlPaginationFilter? = null): GraphQlCoinPage Get the list of gas coins for the specified address. |
| iotaNamesDefaultName | abstract suspend fun iotaNamesDefaultName(address: Address, format: NameFormat?): Name? Get the default name pointing to this address, if one exists. |
| iotaNamesLookup | abstract suspend fun iotaNamesLookup(name: Name): Address? Return the resolved address for the given name. |
| iotaNamesRegistrations | abstract suspend fun iotaNamesRegistrations(address: Address, paginationFilter: GraphQlPaginationFilter): GraphQlNameRegistrationPage Find all registration NFTs for the given address. |
| isTransactionFinalized | abstract suspend fun isTransactionFinalized(digest: TransactionDigest): Boolean Returns whether the transaction for the given digest has been included in a checkpoint (finalized). |
| isTransactionIndexedOnNode | abstract suspend fun isTransactionIndexedOnNode(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_transaction_finalized. |
| latestCheckpointSequenceNumber | abstract suspend fun latestCheckpointSequenceNumber(): ULong? Return the sequence number of the latest checkpoint that has been executed. |
| maxPageSize | abstract suspend fun maxPageSize(): Int Lazily fetch the max page size |
| moveObjectContents | abstract suspend fun moveObjectContents(objectId: ObjectId, version: Version? = null): Value? Return the contents' JSON of an object that is a Move object. |
| moveObjectContentsBcs | abstract suspend fun moveObjectContentsBcs(objectId: ObjectId, version: Version? = null): ByteArray? Return the BCS of an object that is a Move object. |
| moveViewCall | abstract suspend fun moveViewCall(package: ObjectId, module: String, function: String, typeArguments: List<TypeTag>? = null, arguments: List<MoveViewArg>? = null): GraphQlMoveViewResult Execute a Move View Function. |
| moveViewCallJson | abstract suspend fun moveViewCallJson(package: ObjectId, module: String, function: String, typeArguments: List<String>? = null, arguments: List<Value>? = null): GraphQlMoveViewResult Execute a Move View Function with raw JSON arguments. |
| normalizedMoveFunction | abstract suspend fun normalizedMoveFunction(package: Address, module: String, function: String, version: Version? = null): GraphQlMoveFunction? Return the normalized Move function data for the provided package, module, and function. |
| normalizedMoveModule | abstract suspend fun normalizedMoveModule(package: Address, module: String, version: Version? = null, paginationFilterEnums: GraphQlPaginationFilter? = null, paginationFilterFriends: GraphQlPaginationFilter? = null, paginationFilterFunctions: GraphQlPaginationFilter? = null, paginationFilterStructs: GraphQlPaginationFilter? = null): GraphQlMoveModule? Return the normalized Move module data for the provided module. |
| object | abstract suspend fun object(objectId: ObjectId, version: Version? = null): Object? Return an object based on the provided Address. |
| objectBcs | abstract suspend fun objectBcs(objectId: ObjectId): ByteArray? Return the object's bcs content Vec<u8> based on the provided Address. |
| objects | abstract suspend fun objects(filter: GraphQlObjectFilter? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlObjectPage Return a page of objects based on the provided parameters. |
| package | abstract 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. |
| packageLatest | abstract 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. |
| packages | abstract suspend fun packages(afterCheckpoint: ULong? = null, beforeCheckpoint: ULong? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlMovePackagePage The Move packages that exist in the network, optionally filtered to be strictly before beforeCheckpoint and/or strictly after afterCheckpoint. |
| packageVersions | abstract suspend fun packageVersions(address: Address, afterVersion: Version? = null, beforeVersion: Version? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlMovePackagePage 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. |
| protocolConfig | abstract suspend fun protocolConfig(version: ULong? = null): GraphQlProtocolConfigs Get the protocol configuration. |
| referenceGasPrice | abstract 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. |
| runQuery | abstract suspend fun runQuery(query: GraphQlQuery): Value Run a query. |
| serviceConfig | abstract suspend fun serviceConfig(): GraphQlServiceConfig Get the GraphQL service configuration, including complexity limits, read and mutation limits, supported versions, and others. |
| totalSupply | abstract suspend fun totalSupply(coinType: StructTag): ULong? Get total supply for the coin type. |
| totalTransactionBlocks | abstract suspend fun totalTransactionBlocks(): ULong? The total number of transaction blocks in the network by the end of the last known checkpoint. |
| totalTransactionBlocksByDigest | abstract suspend fun totalTransactionBlocksByDigest(digest: CheckpointDigest): ULong? The total number of transaction blocks in the network by the end of the provided checkpoint digest. |
| totalTransactionBlocksBySequenceNumber | abstract suspend fun totalTransactionBlocksBySequenceNumber(sequenceNumber: ULong): ULong? The total number of transaction blocks in the network by the end of the provided checkpoint sequence number. |
| transaction | abstract suspend fun transaction(digest: TransactionDigest): SignedTransaction? Get a transaction by its digest. |
| transactionBuilder | abstract fun transactionBuilder(sender: Address): GraphQlTransactionBuilder Create a new transaction builder with the given sender address, backed by this client. |
| transactionDataEffects | abstract suspend fun transactionDataEffects(digest: TransactionDigest): GraphQlTransactionDataEffects? Get a transaction's data and effects by its digest. |
| transactionEffects | abstract suspend fun transactionEffects(digest: TransactionDigest): TransactionEffects? Get a transaction's effects by its digest. |
| transactions | abstract suspend fun transactions(filter: GraphQlTransactionsFilter? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlSignedTransactionPage Get a page of transactions based on the provided filters. |
| transactionsDataEffects | abstract suspend fun transactionsDataEffects(filter: GraphQlTransactionsFilter? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlTransactionDataEffectsPage Get a page of transactions' data and effects based on the provided filters. |
| transactionsEffects | abstract suspend fun transactionsEffects(filter: GraphQlTransactionsFilter? = null, paginationFilter: GraphQlPaginationFilter? = null): GraphQlTransactionEffectsPage Get a page of transactions' effects based on the provided filters. |
| transactionsSubscription | abstract fun transactionsSubscription(filter: GraphQlSubscriptionTransactionFilter? = null, startAfter: TransactionDigest? = null): GraphQlTransactionSubscription Subscribe to a live stream of transactions matching the (optional) filter. |
| waitForTransaction | abstract suspend fun waitForTransaction(digest: TransactionDigest, waitFor: WaitForTransaction, 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). |
| withSubscriptionUrl | abstract fun withSubscriptionUrl(url: String): GraphQlClient A copy of this client whose subscriptions connect to url instead of the subscriptions endpoint under the RPC URL. An http or https URL is upgraded to ws or wss. |