Skip to main content

GrpcClientInterface

interface GrpcClientInterface

The gRPC client for interacting with the IOTA blockchain.

Inheritors​

GrpcClient

Functions​

NameSummary
allCoinsabstract suspend fun allCoins(owner: Address, coinType: StructTag? = null, limit: UInt? = null): List<Coin>
List all coins owned by an address, optionally filtered by coin type (the inner type T of Coin<T>), auto-paginating up to limit coins. If coin_type is None, coins of all types are returned. If limit is None, all coins are returned.
allDynamicFieldsabstract suspend fun allDynamicFields(parent: ObjectId, limit: UInt? = null, readMask: List<GrpcDynamicFieldField>? = null): List<GrpcDynamicField>
List all dynamic fields of an object, auto-paginating up to limit fields. If limit is None, all fields are returned.
allOwnedObjectsabstract suspend fun allOwnedObjects(owner: Address, objectType: StructTag? = null, limit: UInt? = null, readMask: List<GrpcOwnedObjectField>? = null): List<GrpcObject>
List all objects owned by an address, optionally filtered by object type, auto-paginating up to limit objects. If limit is None, all objects are returned.
allPackageVersionsabstract suspend fun allPackageVersions(packageId: ObjectId, limit: UInt? = null): List<GrpcPackageVersion>
List all versions of a Move package, auto-paginating up to limit versions. If limit is None, all versions are returned.
checkpointByDigestabstract suspend fun checkpointByDigest(digest: CheckpointDigest, transactionsFilter: GrpcTransactionFilter? = null, eventsFilter: GrpcEventFilter? = null, readMask: List<GrpcCheckpointResponseField>? = null): GrpcCheckpointResponse
Get a checkpoint by its digest.
checkpointBySequenceNumberabstract suspend fun checkpointBySequenceNumber(sequenceNumber: ULong, transactionsFilter: GrpcTransactionFilter? = null, eventsFilter: GrpcEventFilter? = null, readMask: List<GrpcCheckpointResponseField>? = null): GrpcCheckpointResponse
Get a checkpoint by its sequence number.
checkpointLatestabstract suspend fun checkpointLatest(transactionsFilter: GrpcTransactionFilter? = null, eventsFilter: GrpcEventFilter? = null, readMask: List<GrpcCheckpointResponseField>? = null): GrpcCheckpointResponse
Get the latest checkpoint.
checkpointsStreamabstract suspend fun checkpointsStream(startSequenceNumber: ULong? = null, endSequenceNumber: ULong? = null, transactionsFilter: GrpcTransactionFilter? = null, eventsFilter: GrpcEventFilter? = null, readMask: List<GrpcCheckpointResponseField>? = null): GrpcCheckpointStream
Stream checkpoints across a range of sequence numbers.
checkpointsStreamFilteredabstract suspend fun checkpointsStreamFiltered(startSequenceNumber: ULong? = null, endSequenceNumber: ULong? = null, transactionsFilter: GrpcTransactionFilter? = null, eventsFilter: GrpcEventFilter? = null, progressIntervalMs: UInt? = null, readMask: List<GrpcCheckpointResponseField>? = null): GrpcFilteredCheckpointStream
Stream checkpoints across a range of sequence numbers, skipping checkpoints with no data matching the filters.
coinInfoabstract suspend fun coinInfo(coinType: StructTag): GrpcCoinInfo
Get information about a coin type, including its metadata, treasury, and regulated metadata.
coinsabstract suspend fun coins(owner: Address, coinType: StructTag? = null, pageSize: UInt? = null, pageToken: ByteArray? = null): GrpcCoinPage
List a single page of coins owned by an address, optionally filtered by coin type (the inner type T of Coin<T>). If coin_type is None, coins of all types are returned.
dynamicFieldsabstract suspend fun dynamicFields(parent: ObjectId, pageSize: UInt? = null, pageToken: ByteArray? = null, readMask: List<GrpcDynamicFieldField>? = null): GrpcDynamicFieldPage
List a single page of dynamic fields of an object.
epochabstract suspend fun epoch(epoch: ULong? = null, readMask: List<GrpcEpochField>? = null): GrpcEpochInfo
Get information about an epoch. If epoch is None, the current epoch is returned.
executeTransactionabstract suspend fun executeTransaction(signedTransaction: SignedTransaction, checkpointInclusionTimeoutMs: ULong? = null, readMask: List<GrpcTransactionField>? = null): GrpcExecutedTransaction
Execute a signed transaction.
executeTransactionsabstract suspend fun executeTransactions(transactions: List<SignedTransaction>, checkpointInclusionTimeoutMs: ULong? = null, readMask: List<GrpcTransactionField>? = null): GrpcExecutedTransactionResults
Execute a batch of signed transactions.
healthabstract suspend fun health(thresholdMs: ULong? = null): GrpcHealthInfo
Get the health of the node serving the gRPC service.
objectsabstract suspend fun objects(objectIds: List<ObjectId>, readMask: List<GrpcObjectField>? = null): GrpcObjectResults
Get the latest version of objects by their ids.
objectsWithVersionsabstract suspend fun objectsWithVersions(requests: List<GrpcObjectRequest>, readMask: List<GrpcObjectField>? = null): GrpcObjectResults
Get objects by their ids and optional versions.
ownedObjectsabstract suspend fun ownedObjects(owner: Address, objectType: StructTag? = null, pageSize: UInt? = null, pageToken: ByteArray? = null, readMask: List<GrpcOwnedObjectField>? = null): GrpcOwnedObjectPage
List a single page of objects owned by an address, optionally filtered by object type.
packageVersionsabstract suspend fun packageVersions(packageId: ObjectId, pageSize: UInt? = null, pageToken: ByteArray? = null): GrpcPackageVersionPage
List a single page of versions of a Move package.
referenceGasPriceabstract suspend fun referenceGasPrice(): ULong
Get the reference gas price of the current epoch, denominated in NANOS.
serviceInfoabstract suspend fun serviceInfo(readMask: List<GrpcServiceInfoField>? = null): GrpcServiceInfo
Get information about the gRPC service and the node serving it.
setBasicAuthabstract fun setBasicAuth(username: String, password: String?)
Set a basic auth Authorization header that is sent with every request.
setBearerAuthabstract fun setBearerAuth(token: String)
Set a bearer auth Authorization header that is sent with every request.
setMaxDecodingMessageSizeabstract fun setMaxDecodingMessageSize(limit: ULong)
Set the maximum size in bytes that a response message can be.
simulateTransactionabstract suspend fun simulateTransaction(transaction: Transaction, skipChecks: Boolean = false, readMask: List<GrpcSimulateField>? = null): GrpcSimulatedTransaction
Simulate a transaction.
simulateTransactionsabstract suspend fun simulateTransactions(transactions: List<GrpcSimulateTransactionInput>, readMask: List<GrpcSimulateField>? = null): List<GrpcSimulatedTransactionResult>
Simulate a batch of transactions.
transactionBuilderabstract fun transactionBuilder(sender: Address): GrpcTransactionBuilder
Create a new transaction builder with the given sender address, backed by this client.
transactionsabstract suspend fun transactions(digests: List<TransactionDigest>, readMask: List<GrpcTransactionField>? = null): GrpcExecutedTransactionResults
Get transactions by their digests.
viewFunctionCallabstract suspend fun viewFunctionCall(fqFunctionName: String, typeArgs: List<TypeTag> = listOf(), callArgs: List<MoveViewArg> = listOf(), readMask: List<GrpcViewFunctionCallField>? = null): GrpcViewFunctionCallOutputs
Call a Move view function and read back what it returns, without submitting a transaction.
viewFunctionCallsabstract suspend fun viewFunctionCalls(functionCalls: List<GrpcViewFunctionCallInput>, readMask: List<GrpcViewFunctionCallField>? = null): List<GrpcViewFunctionCallResult>
Call a batch of Move view functions.
waitForTransactionabstract suspend fun waitForTransaction(digest: TransactionDigest, waitFor: WaitForTransaction)
Wait for the indexing (on the node) or finalization of a transaction by its digest, polling the node until then. Returns an error after 60s.