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: 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. |
| balance | abstract 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. |
| chainId | abstract suspend fun chainId(): String Get the chain identifier. |
| checkpoint | abstract 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. |
| checkpoints | abstract suspend fun checkpoints(paginationFilter: PaginationFilter? = null): CheckpointSummaryPage Get a page of CheckpointSummary for the provided parameters. |
| coinMetadata | abstract suspend fun coinMetadata(coinType: String): CoinMetadata? Get the coin metadata for the coin type. |
| coins | abstract suspend fun coins(owner: Address, paginationFilter: PaginationFilter? = null, coinType: StructTag? = null): CoinPage Get the list of coins for the specified address. |
| dryRunTx | abstract suspend fun dryRunTx(tx: Transaction, skipChecks: Boolean = false): DryRunResult Dry run a Transaction and return the transaction effects and dry run error (if any). |
| dryRunTxKind | abstract 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). |
| dynamicField | abstract 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. |
| dynamicFields | abstract 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. |
| dynamicObjectField | abstract 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. |
| epoch | abstract 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. |
| 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: EventFilter? = null, paginationFilter: PaginationFilter? = null): EventPage Return a page of tuple (event, transaction digest) based on the (optional) event filter. |
| eventsSubscription | abstract suspend fun eventsSubscription(filter: SubscriptionEventFilter? = null, startAfter: String? = null): EventSubscription Subscribe to a live stream of events matching the (optional) filter. |
| executeTx | abstract suspend fun executeTx(signatures: List<UserSignature>, tx: Transaction, waitFor: WaitForTx? = null): TransactionEffects Execute a transaction. |
| gasCoins | abstract suspend fun gasCoins(owner: Address, paginationFilter: PaginationFilter? = null): CoinPage 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: String): Address? Return the resolved address for the given name. |
| iotaNamesRegistrations | abstract suspend fun iotaNamesRegistrations(address: Address, paginationFilter: PaginationFilter): NameRegistrationPage Find all registration NFTs for the given address. |
| isTxFinalized | abstract suspend fun isTxFinalized(digest: TransactionDigest): Boolean Returns whether the transaction for the given digest has been included in a checkpoint (finalized). |
| isTxIndexedOnNode | abstract 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. |
| 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(functionName: String, typeArguments: List<TypeTag>? = null, arguments: List<MoveViewArg>? = null): MoveViewResult Execute a Move View Function. |
| moveViewCallJson | abstract suspend fun moveViewCallJson(functionName: String, typeArguments: List<String>? = null, arguments: List<Value>? = null): MoveViewResult Execute a Move View Function with raw JSON arguments. |
| normalizedMoveFunction | abstract 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. |
| normalizedMoveModule | abstract 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. |
| 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: ObjectFilter? = null, paginationFilter: PaginationFilter? = null): ObjectPage 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: PaginationFilter? = null): MovePackagePage 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: 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. |
| protocolConfig | abstract suspend fun protocolConfig(version: ULong? = null): ProtocolConfigs 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: Query): Value Run a query. |
| serviceConfig | abstract suspend fun serviceConfig(): ServiceConfig Get the GraphQL service configuration, including complexity limits, read and mutation limits, supported versions, and others. |
| setRpcServer | abstract 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. |
| totalSupply | abstract suspend fun totalSupply(coinType: String): 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. |
| totalTransactionBlocksBySeqNum | abstract suspend fun totalTransactionBlocksBySeqNum(seqNum: 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): ClientTransactionBuilder Create a new TransactionBuilder with the given sender address. |
| transactionDataEffects | abstract suspend fun transactionDataEffects(digest: TransactionDigest): TransactionDataEffects? 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: TransactionsFilter? = null, paginationFilter: PaginationFilter? = null): SignedTransactionPage Get a page of transactions based on the provided filters. |
| transactionsDataEffects | abstract suspend fun transactionsDataEffects(filter: TransactionsFilter? = null, paginationFilter: PaginationFilter? = null): TransactionDataEffectsPage Get a page of transactions' data and effects based on the provided filters. |
| transactionsEffects | abstract suspend fun transactionsEffects(filter: TransactionsFilter? = null, paginationFilter: PaginationFilter? = null): TransactionEffectsPage Get a page of transactions' effects based on the provided filters. |
| transactionsSubscription | abstract suspend fun transactionsSubscription(filter: SubscriptionTransactionFilter? = null, startAfter: String? = null): TransactionSubscription Subscribe to a live stream of transactions matching the (optional) filter. |
| waitForTx | abstract 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). |