Skip to main content

Class: GraphQlClient

The GraphQL client for interacting with the IOTA blockchain.

Extends​

  • UniffiAbstractObject

Implements​

Constructors​

Constructor​

new GraphQlClient(server): GraphQlClient;

Create a new GraphQL client with the provided server address.

Parameters​

server​

string

Returns​

GraphQlClient

Overrides​

UniffiAbstractObject.constructor

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

readonly [uniffiTypeNameSymbol]: "GraphQlClient" = "GraphQlClient";

Methods​

activeValidators()​

activeValidators(
epoch?,
paginationFilter?,
asyncOpts_?
): Promise<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.

Parameters​

epoch?​

bigint | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlValidatorPage>

Implementation of​

GraphQlClientLike.activeValidators


addressTransactions()​

addressTransactions(
address,
relation?,
filter?,
paginationFilter?,
asyncOpts_?
): Promise<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.

Parameters​

address​

AddressLike

relation?​

| GraphQlAddressTransactionRelationship | undefined = undefined

filter?​

| GraphQlTransactionsFilterLike | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlSignedTransactionPage>

Implementation of​

GraphQlClientLike.addressTransactions


balance()​

balance(
address,
coinType?,
asyncOpts_?
): Promise<bigint | undefined>;

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.

Parameters​

address​

AddressLike

coinType?​

StructTagLike | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.balance


chainId()​

chainId(asyncOpts_?): Promise<string>;

Get the chain identifier.

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<string>

Implementation of​

GraphQlClientLike.chainId


checkpoint()​

checkpoint(
digest?,
sequenceNumber?,
asyncOpts_?
): Promise<
| CheckpointSummaryLike
| undefined>;

Get the CheckpointSummary for a given checkpoint digest or checkpoint id. If none is provided, it will use the last known checkpoint id.

Parameters​

digest?​

CheckpointDigestLike | undefined = undefined

sequenceNumber?​

bigint | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise< | CheckpointSummaryLike | undefined>

Implementation of​

GraphQlClientLike.checkpoint


checkpoints()​

checkpoints(paginationFilter?, asyncOpts_?): Promise<GraphQlCheckpointSummaryPage>;

Get a page of CheckpointSummary for the provided parameters.

Parameters​

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlCheckpointSummaryPage>

Implementation of​

GraphQlClientLike.checkpoints


coinMetadata()​

coinMetadata(coinType, asyncOpts_?): Promise<GraphQlCoinMetadata | undefined>;

Get the coin metadata for the coin type.

Parameters​

coinType​

StructTagLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlCoinMetadata | undefined>

Implementation of​

GraphQlClientLike.coinMetadata


coins()​

coins(
owner,
paginationFilter?,
coinType?,
asyncOpts_?
): Promise<GraphQlCoinPage>;

Get the list of coins for the specified address.

If coin_type is not provided, all coins will be returned. For IOTA coins, pass in the coin type: 0x2::iota::IOTA.

Parameters​

owner​

AddressLike

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

coinType?​

StructTagLike | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlCoinPage>

Implementation of​

GraphQlClientLike.coins


dryRunTransaction()​

dryRunTransaction(
transaction,
skipChecks?,
asyncOpts_?
): Promise<GraphQlDryRunResult>;

Dry run a Transaction and return the transaction effects and dry run error (if any).

skipChecks optional flag disables the usual verification checks that prevent access to objects that are owned by addresses other than the sender, and calling non-public, non-entry functions, and some other checks. Defaults to false.

Parameters​

transaction​

TransactionLike

skipChecks?​

boolean = false

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlDryRunResult>

Implementation of​

GraphQlClientLike.dryRunTransaction


dryRunTransactionKind()​

dryRunTransactionKind(
transactionKind,
transactionMetadata,
skipChecks?,
asyncOpts_?
): Promise<GraphQlDryRunResult>;

Dry run a TransactionKind and return the transaction effects and dry run error (if any).

skipChecks optional flag disables the usual verification checks that prevent access to objects that are owned by addresses other than the sender, and calling non-public, non-entry functions, and some other checks. Defaults to false.

transaction_metadata is the transaction metadata.

Parameters​

transactionKind​

TransactionKindLike

transactionMetadata​

GraphQlTransactionMetadata

skipChecks?​

boolean = false

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlDryRunResult>

Implementation of​

GraphQlClientLike.dryRunTransactionKind


dynamicField()​

dynamicField(
address,
typeTag,
name,
asyncOpts_?
): Promise<
| GraphQlDynamicFieldOutput
| undefined>;

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.

The name argument is a json serialized type.

This returns GraphQLDynamicFieldOutput which contains the name, the value as json, and object.

Parameters​

address​

AddressLike

typeTag​

TypeTagLike

name​

string

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise< | GraphQlDynamicFieldOutput | undefined>

Implementation of​

GraphQlClientLike.dynamicField


dynamicFields()​

dynamicFields(
address,
paginationFilter?,
asyncOpts_?
): Promise<GraphQlDynamicFieldOutputPage>;

Get a page of dynamic fields for the provided address. Note that this will also fetch dynamic fields on wrapped objects.

This returns a page of GraphQLDynamicFieldOutputs.

Parameters​

address​

AddressLike

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlDynamicFieldOutputPage>

Implementation of​

GraphQlClientLike.dynamicFields


dynamicObjectField()​

dynamicObjectField(
address,
typeTag,
name,
asyncOpts_?
): Promise<
| GraphQlDynamicFieldOutput
| undefined>;

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.

The name argument is a json serialized type.

This returns GraphQLDynamicFieldOutput which contains the name, the value as json, and object.

Parameters​

address​

AddressLike

typeTag​

TypeTagLike

name​

string

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise< | GraphQlDynamicFieldOutput | undefined>

Implementation of​

GraphQlClientLike.dynamicObjectField


epoch()​

epoch(epoch?, asyncOpts_?): Promise<GraphQlEpoch | undefined>;

Return the epoch information for the provided epoch. If no epoch is provided, it will return the last known epoch.

Parameters​

epoch?​

bigint | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlEpoch | undefined>

Implementation of​

GraphQlClientLike.epoch


epochTotalCheckpoints()​

epochTotalCheckpoints(epoch?, asyncOpts_?): Promise<bigint | undefined>;

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).

Parameters​

epoch?​

bigint | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.epochTotalCheckpoints


epochTotalTransactionBlocks()​

epochTotalTransactionBlocks(epoch?, asyncOpts_?): Promise<bigint | undefined>;

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).

Parameters​

epoch?​

bigint | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.epochTotalTransactionBlocks


events()​

events(
filter?,
paginationFilter?,
asyncOpts_?
): Promise<GraphQlEventPage>;

Return a page of tuple (event, transaction digest) based on the (optional) event filter.

Parameters​

filter?​

GraphQlEventFilter | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlEventPage>

Implementation of​

GraphQlClientLike.events


eventsSubscription()​

eventsSubscription(filter?, startAfter?): GraphQlEventSubscriptionLike;

Subscribe to a live stream of events matching the (optional) filter.

start_after optionally resumes from the transaction immediately following the given transaction digest; thereafter the subscription tracks its own resume point across reconnects.

Note: subscriptions are served over a WebSocket, which the node has to have enabled — serviceConfig.enabledFeatures includes SUBSCRIPTIONS when it is available.

Parameters​

filter?​

EmittingModule_ | undefined = undefined

startAfter?​

| TransactionDigestLike | undefined = undefined

Returns​

GraphQlEventSubscriptionLike

Implementation of​

GraphQlClientLike.eventsSubscription


executeTransaction()​

executeTransaction(
signatures,
transaction,
waitFor?,
asyncOpts_?
): Promise<TransactionEffectsLike>;

Execute a transaction.

If the wait fails, the error is returned although the transaction was executed, and its effects are lost. To keep them, pass no wait_for and call wait_for_transaction on the client afterwards.

Parameters​

signatures​

UserSignatureLike[]

transaction​

TransactionLike

waitFor?​

WaitForTransaction | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<TransactionEffectsLike>

Implementation of​

GraphQlClientLike.executeTransaction


gasCoins()​

gasCoins(
owner,
paginationFilter?,
asyncOpts_?
): Promise<GraphQlCoinPage>;

Get the list of gas coins for the specified address.

Parameters​

owner​

AddressLike

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlCoinPage>

Implementation of​

GraphQlClientLike.gasCoins


iotaNamesDefaultName()​

iotaNamesDefaultName(
address,
format,
asyncOpts_?
): Promise<NameLike | undefined>;

Get the default name pointing to this address, if one exists.

Parameters​

address​

AddressLike

format​

NameFormat | undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<NameLike | undefined>

Implementation of​

GraphQlClientLike.iotaNamesDefaultName


iotaNamesLookup()​

iotaNamesLookup(name, asyncOpts_?): Promise<AddressLike | undefined>;

Return the resolved address for the given name.

Parameters​

name​

NameLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<AddressLike | undefined>

Implementation of​

GraphQlClientLike.iotaNamesLookup


iotaNamesRegistrations()​

iotaNamesRegistrations(
address,
paginationFilter,
asyncOpts_?
): Promise<GraphQlNameRegistrationPage>;

Find all registration NFTs for the given address.

Parameters​

address​

AddressLike

paginationFilter​

GraphQlPaginationFilter

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlNameRegistrationPage>

Implementation of​

GraphQlClientLike.iotaNamesRegistrations


isTransactionFinalized()​

isTransactionFinalized(digest, asyncOpts_?): Promise<boolean>;

Returns whether the transaction for the given digest has been included in a checkpoint (finalized).

Parameters​

digest​

TransactionDigestLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<boolean>

Implementation of​

GraphQlClientLike.isTransactionFinalized


isTransactionIndexedOnNode()​

isTransactionIndexedOnNode(digest, asyncOpts_?): Promise<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.

Parameters​

digest​

TransactionDigestLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<boolean>

Implementation of​

GraphQlClientLike.isTransactionIndexedOnNode


latestCheckpointSequenceNumber()​

latestCheckpointSequenceNumber(asyncOpts_?): Promise<bigint | undefined>;

Return the sequence number of the latest checkpoint that has been executed.

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.latestCheckpointSequenceNumber


maxPageSize()​

maxPageSize(asyncOpts_?): Promise<number>;

Lazily fetch the max page size

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<number>

Implementation of​

GraphQlClientLike.maxPageSize


moveObjectContents()​

moveObjectContents(
objectId,
version?,
asyncOpts_?
): Promise<string | undefined>;

Return the contents' JSON of an object that is a Move object.

If the object does not exist (e.g., due to pruning), this will return Ok(None). Similarly, if this is not an object but an address, it will return Ok(None).

Parameters​

objectId​

ObjectIdLike

version?​

VersionLike | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<string | undefined>

Implementation of​

GraphQlClientLike.moveObjectContents


moveObjectContentsBcs()​

moveObjectContentsBcs(
objectId,
version?,
asyncOpts_?
): Promise<ArrayBuffer | undefined>;

Return the BCS of an object that is a Move object.

If the object does not exist (e.g., due to pruning), this will return Ok(None). Similarly, if this is not an object but an address, it will return Ok(None).

Parameters​

objectId​

ObjectIdLike

version?​

VersionLike | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<ArrayBuffer | undefined>

Implementation of​

GraphQlClientLike.moveObjectContentsBcs


moveViewCall()​

moveViewCall(
package_,
module,
function_,
typeArguments?,
moveArguments?,
asyncOpts_?
): Promise<GraphQlMoveViewResult>;

Execute a Move View Function.

A View Function is a function in a Move module with a return type that does not alter the state of the ledger. When using this interface, no transactions are submitted to the network for inclusion into the ledger.

This method allows calling nearly any Move function with a return type and any arguments. The function's result values are provided and decoded using the appropriate Move type, then formatted in JSON.

The use of this interface does not require signature checks (even for functions that take Owned Objects as input) or gas coins, as it does not alter ledger state. Spam attacks are dealt with at the RPC level rather than execution level.

Arguments

  • package - The package the Move function is defined in
  • module - The module the Move function is defined in
  • function - The name of the Move function
  • type_arguments - The type arguments of the Move function
  • arguments - The typed arguments to be passed into the Move function

Returns

A GraphQLMoveViewResult containing either execution results (return values) or an error.

Parameters​

package_​

ObjectIdLike

module​

string

function_​

string

typeArguments?​

TypeTagLike[] | undefined = undefined

moveArguments?​

MoveViewArgLike[] | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlMoveViewResult>

Implementation of​

GraphQlClientLike.moveViewCall


moveViewCallJson()​

moveViewCallJson(
package_,
module,
function_,
typeArguments?,
moveArguments?,
asyncOpts_?
): Promise<GraphQlMoveViewResult>;

Execute a Move View Function with raw JSON arguments.

This is an alternative to [GraphQLClient::move_view_call] that accepts raw JSON values instead of typed arguments.

A View Function is a function in a Move module with a return type that does not alter the state of the ledger. When using this interface, no transactions are submitted to the network for inclusion into the ledger.

Arguments

  • package - The package the Move function is defined in
  • module - The module the Move function is defined in
  • function - The name of the Move function
  • type_arguments - The type arguments of the Move function
  • arguments - The arguments to be passed into the Move function, in JSON format

Returns

A GraphQLMoveViewResult containing either execution results (return values) or an error.

Parameters​

package_​

ObjectIdLike

module​

string

function_​

string

typeArguments?​

string[] | undefined = undefined

moveArguments?​

string[] | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlMoveViewResult>

Implementation of​

GraphQlClientLike.moveViewCallJson


normalizedMoveFunction()​

normalizedMoveFunction(
package_,
module,
function_,
version?,
asyncOpts_?
): Promise<
| GraphQlMoveFunctionLike
| undefined>;

Return the normalized Move function data for the provided package, module, and function.

Parameters​

package_​

AddressLike

module​

string

function_​

string

version?​

VersionLike | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise< | GraphQlMoveFunctionLike | undefined>

Implementation of​

GraphQlClientLike.normalizedMoveFunction


normalizedMoveModule()​

normalizedMoveModule(
package_,
module,
version?,
paginationFilterEnums?,
paginationFilterFriends?,
paginationFilterFunctions?,
paginationFilterStructs?,
asyncOpts_?
): Promise<GraphQlMoveModule | undefined>;

Return the normalized Move module data for the provided module.

Parameters​

package_​

AddressLike

module​

string

version?​

VersionLike | undefined = undefined

paginationFilterEnums?​

| GraphQlPaginationFilter | undefined = undefined

paginationFilterFriends?​

| GraphQlPaginationFilter | undefined = undefined

paginationFilterFunctions?​

| GraphQlPaginationFilter | undefined = undefined

paginationFilterStructs?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlMoveModule | undefined>

Implementation of​

GraphQlClientLike.normalizedMoveModule


object()​

object(
objectId,
version?,
asyncOpts_?
): Promise<ObjectLike | undefined>;

Return an object based on the provided Address.

If the object does not exist (e.g., due to pruning), this will return Ok(None). Similarly, if this is not an object but an address, it will return Ok(None).

Parameters​

objectId​

ObjectIdLike

version?​

VersionLike | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<ObjectLike | undefined>

Implementation of​

GraphQlClientLike.object


objectBcs()​

objectBcs(objectId, asyncOpts_?): Promise<ArrayBuffer | undefined>;

Return the object's bcs content Vec<u8> based on the provided Address.

Parameters​

objectId​

ObjectIdLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<ArrayBuffer | undefined>

Implementation of​

GraphQlClientLike.objectBcs


objects()​

objects(
filter?,
paginationFilter?,
asyncOpts_?
): Promise<GraphQlObjectPage>;

Return a page of objects based on the provided parameters.

Use this function together with the GraphQLObjectFilter::owner to get the objects owned by an address.

Parameters​

filter?​

GraphQlObjectFilter | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlObjectPage>

Implementation of​

GraphQlClientLike.objects


package_()​

package_(
address,
version?,
asyncOpts_?
): Promise<MovePackageLike | undefined>;

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.

Note that this interpretation of version is different from a historical object read (the interpretation of version for the object query).

Parameters​

address​

AddressLike

version?​

VersionLike | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<MovePackageLike | undefined>

Implementation of​

GraphQlClientLike.package_


packageLatest()​

packageLatest(address, asyncOpts_?): Promise<MovePackageLike | undefined>;

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.

Parameters​

address​

AddressLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<MovePackageLike | undefined>

Implementation of​

GraphQlClientLike.packageLatest


packages()​

packages(
afterCheckpoint?,
beforeCheckpoint?,
paginationFilter?,
asyncOpts_?
): Promise<GraphQlMovePackagePage>;

The Move packages that exist in the network, optionally filtered to be strictly before beforeCheckpoint and/or strictly after afterCheckpoint.

This query returns all versions of a given user package that appear between the specified checkpoints, but only records the latest versions of system packages.

Parameters​

afterCheckpoint?​

bigint | undefined = undefined

beforeCheckpoint?​

bigint | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlMovePackagePage>

Implementation of​

GraphQlClientLike.packages


packageVersions()​

packageVersions(
address,
afterVersion?,
beforeVersion?,
paginationFilter?,
asyncOpts_?
): Promise<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.

Parameters​

address​

AddressLike

afterVersion?​

VersionLike | undefined = undefined

beforeVersion?​

VersionLike | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlMovePackagePage>

Implementation of​

GraphQlClientLike.packageVersions


protocolConfig()​

protocolConfig(version?, asyncOpts_?): Promise<GraphQlProtocolConfigs>;

Get the protocol configuration.

Parameters​

version?​

bigint | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlProtocolConfigs>

Implementation of​

GraphQlClientLike.protocolConfig


referenceGasPrice()​

referenceGasPrice(epoch?, asyncOpts_?): Promise<bigint | undefined>;

Get the reference gas price for the provided epoch or the last known one if no epoch is provided.

This will return Ok(None) if the epoch requested is not available in the GraphQL service (e.g., due to pruning).

Parameters​

epoch?​

bigint | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.referenceGasPrice


runQuery()​

runQuery(query, asyncOpts_?): Promise<string>;

Run a query.

Parameters​

query​

GraphQlQuery

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<string>

Implementation of​

GraphQlClientLike.runQuery


serviceConfig()​

serviceConfig(asyncOpts_?): Promise<GraphQlServiceConfig>;

Get the GraphQL service configuration, including complexity limits, read and mutation limits, supported versions, and others.

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlServiceConfig>

Implementation of​

GraphQlClientLike.serviceConfig


totalSupply()​

totalSupply(coinType, asyncOpts_?): Promise<bigint | undefined>;

Get total supply for the coin type.

Parameters​

coinType​

StructTagLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.totalSupply


totalTransactionBlocks()​

totalTransactionBlocks(asyncOpts_?): Promise<bigint | undefined>;

The total number of transaction blocks in the network by the end of the last known checkpoint.

Parameters​

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.totalTransactionBlocks


totalTransactionBlocksByDigest()​

totalTransactionBlocksByDigest(digest, asyncOpts_?): Promise<bigint | undefined>;

The total number of transaction blocks in the network by the end of the provided checkpoint digest.

Parameters​

digest​

CheckpointDigestLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.totalTransactionBlocksByDigest


totalTransactionBlocksBySequenceNumber()​

totalTransactionBlocksBySequenceNumber(sequenceNumber, asyncOpts_?): Promise<bigint | undefined>;

The total number of transaction blocks in the network by the end of the provided checkpoint sequence number.

Parameters​

sequenceNumber​

bigint

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<bigint | undefined>

Implementation of​

GraphQlClientLike.totalTransactionBlocksBySequenceNumber


transaction()​

transaction(digest, asyncOpts_?): Promise<SignedTransaction | undefined>;

Get a transaction by its digest.

Parameters​

digest​

TransactionDigestLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<SignedTransaction | undefined>

Implementation of​

GraphQlClientLike.transaction


transactionBuilder()​

transactionBuilder(sender): GraphQlTransactionBuilderLike;

Create a new transaction builder with the given sender address, backed by this client.

Parameters​

sender​

AddressLike

Returns​

GraphQlTransactionBuilderLike

Implementation of​

GraphQlClientLike.transactionBuilder


transactionDataEffects()​

transactionDataEffects(digest, asyncOpts_?): Promise<
| GraphQlTransactionDataEffects
| undefined>;

Get a transaction's data and effects by its digest.

Parameters​

digest​

TransactionDigestLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise< | GraphQlTransactionDataEffects | undefined>

Implementation of​

GraphQlClientLike.transactionDataEffects


transactionEffects()​

transactionEffects(digest, asyncOpts_?): Promise<
| TransactionEffectsLike
| undefined>;

Get a transaction's effects by its digest.

Parameters​

digest​

TransactionDigestLike

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise< | TransactionEffectsLike | undefined>

Implementation of​

GraphQlClientLike.transactionEffects


transactions()​

transactions(
filter?,
paginationFilter?,
asyncOpts_?
): Promise<GraphQlSignedTransactionPage>;

Get a page of transactions based on the provided filters.

Parameters​

filter?​

| GraphQlTransactionsFilterLike | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlSignedTransactionPage>

Implementation of​

GraphQlClientLike.transactions


transactionsDataEffects()​

transactionsDataEffects(
filter?,
paginationFilter?,
asyncOpts_?
): Promise<GraphQlTransactionDataEffectsPage>;

Get a page of transactions' data and effects based on the provided filters.

Parameters​

filter?​

| GraphQlTransactionsFilterLike | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlTransactionDataEffectsPage>

Implementation of​

GraphQlClientLike.transactionsDataEffects


transactionsEffects()​

transactionsEffects(
filter?,
paginationFilter?,
asyncOpts_?
): Promise<GraphQlTransactionEffectsPage>;

Get a page of transactions' effects based on the provided filters.

Parameters​

filter?​

| GraphQlTransactionsFilterLike | undefined = undefined

paginationFilter?​

| GraphQlPaginationFilter | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<GraphQlTransactionEffectsPage>

Implementation of​

GraphQlClientLike.transactionsEffects


transactionsSubscription()​

transactionsSubscription(filter?, startAfter?): GraphQlTransactionSubscriptionLike;

Subscribe to a live stream of transactions matching the (optional) filter.

start_after optionally resumes from the transaction immediately following the given digest; thereafter the subscription tracks its own resume point across reconnects.

Note: subscriptions are served over a WebSocket, which the node has to have enabled — serviceConfig.enabledFeatures includes SUBSCRIPTIONS when it is available.

Parameters​

filter?​

| GraphQlSubscriptionTransactionFilter | undefined = undefined

startAfter?​

| TransactionDigestLike | undefined = undefined

Returns​

GraphQlTransactionSubscriptionLike

Implementation of​

GraphQlClientLike.transactionsSubscription


uniffiDestroy()​

uniffiDestroy(): void;

Explicitly tell Rust to destroy the native peer that backs this object.

Once this method has been called, any following method calls will throw an error.

Can be called more than once.

Returns​

void

Overrides​

UniffiAbstractObject.uniffiDestroy


uniffiUse()​

uniffiUse<T>(block): T;

A convenience method to use this object, then destroy it after its use.

Type Parameters​

T​

T

Parameters​

block​

(obj) => T

Returns​

T

Inherited from​

UniffiAbstractObject.uniffiUse


waitForTransaction()​

waitForTransaction(
digest,
waitFor,
timeout?,
asyncOpts_?
): Promise<void>;

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).

Parameters​

digest​

TransactionDigestLike

waitFor​

WaitForTransaction

timeout?​

number | undefined = undefined

asyncOpts_?​
signal​

AbortSignal

Returns​

Promise<void>

Implementation of​

GraphQlClientLike.waitForTransaction


withSubscriptionUrl()​

withSubscriptionUrl(url): GraphQlClientLike;

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.

Parameters​

url​

string

Returns​

GraphQlClientLike

Implementation of​

GraphQlClientLike.withSubscriptionUrl


instanceOf()​

static instanceOf(obj_): obj_ is GraphQlClient;

Parameters​

obj_​

any

Returns​

obj_ is GraphQlClient


newDevnet()​

static newDevnet(): GraphQlClientLike;

Create a new GraphQL client connected to the devnet GraphQL server: https://graphql.devnet.iota.cafe.

Returns​

GraphQlClientLike


newLocalnet()​

static newLocalnet(): GraphQlClientLike;

Create a new GraphQL client connected to the localhost GraphQL server: http://localhost:9125/graphql.

Returns​

GraphQlClientLike


newMainnet()​

static newMainnet(): GraphQlClientLike;

Create a new GraphQL client connected to the mainnet GraphQL server: https://graphql.mainnet.iota.cafe.

Returns​

GraphQlClientLike


newTestnet()​

static newTestnet(): GraphQlClientLike;

Create a new GraphQL client connected to the testnet GraphQL server: https://graphql.testnet.iota.cafe.

Returns​

GraphQlClientLike


newWithHttpOptions()​

static newWithHttpOptions(server, options): GraphQlClientLike;

Create a new GraphQL client with the provided server address, using an HTTP client built to the given options.

Parameters​

server​

string

options​

HttpClientOptions

Returns​

GraphQlClientLike