IotaClient
@iota/iota-sdk / client / IotaClient
Class: IotaClient
Defined in: sdk/typescript/src/client/client.ts:187
Indexable
[
key:number]:boolean
Constructors
Constructor
new IotaClient(
options):IotaClient
Defined in: sdk/typescript/src/client/client.ts:200
Establish a connection to an IOTA RPC endpoint
Parameters
options
configuration options for the API Client
Returns
IotaClient
Properties
transport
protectedtransport:IotaTransport
Defined in: sdk/typescript/src/client/client.ts:188
waitForTransactionDefaults
protectedwaitForTransactionDefaults:WaitForTransactionDefaults
Defined in: sdk/typescript/src/client/client.ts:189
Methods
call()
call<
T>(method,params,args?):Promise<T>
Defined in: sdk/typescript/src/client/client.ts:313
Invoke any RPC method
Type Parameters
T
T = unknown
Parameters
method
string
the method to be invoked
params
unknown[]
args?
the arguments to be passed to the RPC request
signal?
AbortSignal
Returns
Promise<T>
devInspectTransactionBlock()
devInspectTransactionBlock(
input):Promise<DevInspectResults>
Defined in: sdk/typescript/src/client/client.ts:794
Runs the transaction block in dev-inspect mode. Which allows for nearly any transaction (or Move call) with any arguments. Detailed results are provided, including both the transaction effects and any return values.
Parameters
input
DevInspectTransactionBlockParams
Returns
Promise<DevInspectResults>
dryRunTransactionBlock()
dryRunTransactionBlock(
input):Promise<DryRunTransactionBlockResponse>
Defined in: sdk/typescript/src/client/client.ts:824
Dry run a transaction block and return the result.
Parameters
input
Returns
Promise<DryRunTransactionBlockResponse>
executeTransactionBlock()
executeTransactionBlock(
__namedParameters):Promise<IotaTransactionBlockResponse>
Defined in: sdk/typescript/src/client/client.ts:508
Parameters
__namedParameters
Returns
Promise<IotaTransactionBlockResponse>
getAddressMetrics()
getAddressMetrics(
__namedParameters?):Promise<AddressMetrics>
Defined in: sdk/typescript/src/client/client.ts:946
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<AddressMetrics>
getAllBalances()
getAllBalances(
input):Promise<CoinBalance[]>
Defined in: sdk/typescript/src/client/client.ts:262
Get the total coin balance for all coin types, owned by the address owner.
Parameters
input
Returns
Promise<CoinBalance[]>
getAllCoins()
getAllCoins(
input):Promise<PaginatedCoins>
Defined in: sdk/typescript/src/client/client.ts:233
Get all Coin objects owned by an address.
Parameters
input
Returns
Promise<PaginatedCoins>
getAllEpochAddressMetrics()
getAllEpochAddressMetrics(
input?):Promise<AllEpochsAddressMetrics>
Defined in: sdk/typescript/src/client/client.ts:966
Parameters
input?
descendingOrder?
boolean
signal?
AbortSignal
Returns
Promise<AllEpochsAddressMetrics>
getBalance()
getBalance(
input):Promise<CoinBalance>
Defined in: sdk/typescript/src/client/client.ts:248
Get the total coin balance for one coin type, owned by the address owner.
Parameters
input
Returns
Promise<CoinBalance>
getChainIdentifier()
getChainIdentifier(
__namedParameters?):Promise<string>
Defined in: sdk/typescript/src/client/client.ts:1068
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<string>
getCheckpoint()
getCheckpoint(
input):Promise<Checkpoint>
Defined in: sdk/typescript/src/client/client.ts:906
Returns information about a given checkpoint
Parameters
input
Returns
Promise<Checkpoint>
getCheckpointAddressMetrics()
getCheckpointAddressMetrics(
input?):Promise<AddressMetrics>
Defined in: sdk/typescript/src/client/client.ts:977
Parameters
input?
checkpoint
string
signal?
AbortSignal
Returns
Promise<AddressMetrics>
getCheckpoints()
getCheckpoints(
input):Promise<CheckpointPage>
Defined in: sdk/typescript/src/client/client.ts:917
Returns historical checkpoints paginated
Parameters
input
PaginationArguments<string | null> & GetCheckpointsParams
Returns
Promise<CheckpointPage>
getCirculatingSupply()
getCirculatingSupply(
__namedParameters?):Promise<IotaCirculatingSupply>
Defined in: sdk/typescript/src/client/client.ts:298
Fetch circulating supply for a coin
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<IotaCirculatingSupply>
getCoinMetadata()
getCoinMetadata(
input):Promise<CoinMetadata|null>
Defined in: sdk/typescript/src/client/client.ts:276
Fetch CoinMetadata for a given coin type
Parameters
input
Returns
Promise<CoinMetadata | null>
getCoins()
getCoins(
input):Promise<PaginatedCoins>
Defined in: sdk/typescript/src/client/client.ts:218
Get all Coin<coin_type> objects owned by an address.
Parameters
input
Returns
Promise<PaginatedCoins>
getCommitteeInfo()
getCommitteeInfo(
input?):Promise<CommitteeInfo>
Defined in: sdk/typescript/src/client/client.ts:930
Return the committee information for the asked epoch
Parameters
input?
Returns
Promise<CommitteeInfo>
getCurrentEpoch()
getCurrentEpoch(
__namedParameters?):Promise<EpochInfo>
Defined in: sdk/typescript/src/client/client.ts:1040
Return the committee information for the asked epoch
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<EpochInfo>
getDynamicFieldObject()
getDynamicFieldObject(
input):Promise<IotaObjectResponse>
Defined in: sdk/typescript/src/client/client.ts:856
Return the dynamic field object information for a specified object Uses the V2.
Parameters
input
Returns
Promise<IotaObjectResponse>
getDynamicFieldObjectV1()
getDynamicFieldObjectV1(
input):Promise<IotaObjectResponse>
Defined in: sdk/typescript/src/client/client.ts:868
Return the dynamic field object information for a specified object
Parameters
input
Returns
Promise<IotaObjectResponse>
Deprecated
getDynamicFieldObjectV1 is deprecated, prefer to use getDynamicFieldObject which uses V2.
getDynamicFieldObjectV2()
getDynamicFieldObjectV2(
input):Promise<IotaObjectResponse>
Defined in: sdk/typescript/src/client/client.ts:879
Return the dynamic field object information for a specified object with content options.
Parameters
input
Returns
Promise<IotaObjectResponse>
getDynamicFields()
getDynamicFields(
input):Promise<DynamicFieldPage>
Defined in: sdk/typescript/src/client/client.ts:841
Return the list of dynamic field objects owned by an object
Parameters
input
Returns
Promise<DynamicFieldPage>
getEpochMetrics()
getEpochMetrics(
input?):Promise<EpochMetricsPage>
Defined in: sdk/typescript/src/client/client.ts:954
Parameters
input?
object & PaginationArguments<string | null>
Returns
Promise<EpochMetricsPage>
getEpochs()
getEpochs(
input?):Promise<EpochPage>
Defined in: sdk/typescript/src/client/client.ts:991
Return the committee information for the asked epoch
Parameters
input?
object & PaginationArguments<string | null>
Returns
Promise<EpochPage>
getLatestCheckpointSequenceNumber()
getLatestCheckpointSequenceNumber(
__namedParameters?):Promise<string>
Defined in: sdk/typescript/src/client/client.ts:892
Get the sequence number of the latest checkpoint that has been executed
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<string>
getLatestIotaSystemState()
getLatestIotaSystemState(
__namedParameters?):Promise<LatestIotaSystemStateSummary>
Defined in: sdk/typescript/src/client/client.ts:690
Return the latest supported IOTA system state object.
This returns a backwards-compatible system state object that dynamically uses the V1 or V2 depending on the protocol version supported by the node. This method will continue to be supported as more protocol versions are released with changes to the system state.
This is quite useful in case your app does not know in advance what node is it going to be using, this way you as developer dont need to handle each possible system state variant, this is already handled by this method.
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<LatestIotaSystemStateSummary>
getLatestIotaSystemStateV1()
getLatestIotaSystemStateV1(
__namedParameters?):Promise<IotaSystemStateSummaryV1>
Defined in: sdk/typescript/src/client/client.ts:652
Return the latest IOTA system state object on networks supporting protocol version < 5.
These are networks with node software release version < 0.11.
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<IotaSystemStateSummaryV1>
Deprecated
Use getLatestIotaSystemState instead.
getLatestIotaSystemStateV2()
getLatestIotaSystemStateV2(
__namedParameters?):Promise<IotaSystemStateSummary>
Defined in: sdk/typescript/src/client/client.ts:669
Return the latest IOTA system state object on networks supporting protocol version >= 5.
These are networks with node software release version >= 0.11.
You probably want to use getLatestIotaSystemState instead to prevent issues with future deprecations
or in case the node does not support protocol version >= 5.
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<IotaSystemStateSummary>
getMoveCallMetrics()
getMoveCallMetrics(
__namedParameters?):Promise<MoveCallMetrics>
Defined in: sdk/typescript/src/client/client.ts:1029
Returns list of top move calls by usage
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<MoveCallMetrics>
getMoveFunctionArgTypes()
getMoveFunctionArgTypes(
input):Promise<IotaMoveFunctionArgType[]>
Defined in: sdk/typescript/src/client/client.ts:324
Get Move function argument types like read, write and full access
Parameters
input
Returns
Promise<IotaMoveFunctionArgType[]>
getNetworkMetrics()
getNetworkMetrics(
__namedParameters?):Promise<NetworkMetrics>
Defined in: sdk/typescript/src/client/client.ts:938
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<NetworkMetrics>
getNormalizedMoveFunction()
getNormalizedMoveFunction(
input):Promise<IotaMoveNormalizedFunction>
Defined in: sdk/typescript/src/client/client.ts:364
Get a structured representation of Move function
Parameters
input
GetNormalizedMoveFunctionParams
Returns
Promise<IotaMoveNormalizedFunction>
getNormalizedMoveModule()
getNormalizedMoveModule(
input):Promise<IotaMoveNormalizedModule>
Defined in: sdk/typescript/src/client/client.ts:351
Get a structured representation of Move module
Parameters
input
Returns
Promise<IotaMoveNormalizedModule>
getNormalizedMoveModulesByPackage()
getNormalizedMoveModulesByPackage(
input):Promise<IotaMoveNormalizedModules>
Defined in: sdk/typescript/src/client/client.ts:338
Get a map from module name to structured representations of Move modules
Parameters
input
GetNormalizedMoveModulesByPackageParams
Returns
Promise<IotaMoveNormalizedModules>
getNormalizedMoveStruct()
getNormalizedMoveStruct(
input):Promise<IotaMoveNormalizedStruct>
Defined in: sdk/typescript/src/client/client.ts:377
Get a structured representation of Move struct
Parameters
input
Returns
Promise<IotaMoveNormalizedStruct>
getObject()
getObject(
input):Promise<IotaObjectResponse>
Defined in: sdk/typescript/src/client/client.ts:413
Get details about an object
Parameters
input
Returns
Promise<IotaObjectResponse>
getOwnedObjects()
getOwnedObjects(
input):Promise<PaginatedObjectsResponse>
Defined in: sdk/typescript/src/client/client.ts:390
Get all objects owned by an address
Parameters
input
Returns
Promise<PaginatedObjectsResponse>
getParticipationMetrics()
getParticipationMetrics(
__namedParameters?):Promise<ParticipationMetrics>
Defined in: sdk/typescript/src/client/client.ts:1087
Returns the participation metrics (total unique addresses with delegated stake in the current epoch).
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<ParticipationMetrics>
getProtocolConfig()
getProtocolConfig(
input?):Promise<ProtocolConfig>
Defined in: sdk/typescript/src/client/client.ts:1076
Parameters
input?
Returns
Promise<ProtocolConfig>
getReferenceGasPrice()
getReferenceGasPrice(
__namedParameters?):Promise<bigint>
Defined in: sdk/typescript/src/client/client.ts:574
Getting the reference gas price for the network
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<bigint>
getRpcApiVersion()
getRpcApiVersion(
__namedParameters?):Promise<string|undefined>
Defined in: sdk/typescript/src/client/client.ts:205
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<string | undefined>
getStakes()
getStakes(
input):Promise<DelegatedStake[]>
Defined in: sdk/typescript/src/client/client.ts:586
Return the delegated stakes for an address
Parameters
input
Returns
Promise<DelegatedStake[]>
getStakesByIds()
getStakesByIds(
input):Promise<DelegatedStake[]>
Defined in: sdk/typescript/src/client/client.ts:616
Return the delegated stakes queried by id.
Parameters
input
Returns
Promise<DelegatedStake[]>
getTimelockedStakes()
getTimelockedStakes(
input):Promise<DelegatedTimelockedStake[]>
Defined in: sdk/typescript/src/client/client.ts:600
Return the timelocked delegated stakes for an address
Parameters
input
Returns
Promise<DelegatedTimelockedStake[]>
getTimelockedStakesByIds()
getTimelockedStakesByIds(
input):Promise<DelegatedTimelockedStake[]>
Defined in: sdk/typescript/src/client/client.ts:632
Return the timelocked delegated stakes queried by id.
Parameters
input
GetTimelockedStakesByIdsParams
Returns
Promise<DelegatedTimelockedStake[]>
getTotalSupply()
getTotalSupply(
input):Promise<CoinSupply>
Defined in: sdk/typescript/src/client/client.ts:287
Fetch total supply for a coin
Parameters
input
Returns
Promise<CoinSupply>
getTotalTransactionBlocks()
getTotalTransactionBlocks(
__namedParameters?):Promise<bigint>
Defined in: sdk/typescript/src/client/client.ts:562
Get total number of transactions
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<bigint>
getTotalTransactions()
getTotalTransactions(
__namedParameters?):Promise<string>
Defined in: sdk/typescript/src/client/client.ts:1048
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<string>
getTransactionBlock()
getTransactionBlock(
input):Promise<IotaTransactionBlockResponse>
Defined in: sdk/typescript/src/client/client.ts:474
Parameters
input
Returns
Promise<IotaTransactionBlockResponse>
getValidatorsApy()
getValidatorsApy(
__namedParameters?):Promise<ValidatorsApy>
Defined in: sdk/typescript/src/client/client.ts:1060
Return the Validators APYs
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<ValidatorsApy>
iotaNamesFindAllRegistrationNFTs()
iotaNamesFindAllRegistrationNFTs(
input):Promise<PaginatedObjectsResponse>
Defined in: sdk/typescript/src/client/client.ts:1195
Find all registration NFTs for the given address.
Parameters
input
IotaNamesFindAllRegistrationNFTsParams
Returns
Promise<PaginatedObjectsResponse>
iotaNamesLookup()
iotaNamesLookup(
input):Promise<IotaNameRecord|undefined>
Defined in: sdk/typescript/src/client/client.ts:1173
Return the resolved record for the given name.
Parameters
input
Returns
Promise<IotaNameRecord | undefined>
iotaNamesReverseLookup()
iotaNamesReverseLookup(
input):Promise<string|undefined>
Defined in: sdk/typescript/src/client/client.ts:1184
Return the resolved name for the given address.
Parameters
input
Returns
Promise<string | undefined>
isTransactionIndexedOnNode()
isTransactionIndexedOnNode(
input):Promise<boolean>
Defined in: sdk/typescript/src/client/client.ts:1208
Check if a Transaction has been indexed on the Node.
Parameters
input
IsTransactionIndexedOnNodeParams
Returns
Promise<boolean>
multiGetObjects()
multiGetObjects(
input):Promise<IotaObjectResponse[]>
Defined in: sdk/typescript/src/client/client.ts:435
Batch get details about a list of objects. If any of the object ids are duplicates the call will fail
Parameters
input
Returns
Promise<IotaObjectResponse[]>
multiGetTransactionBlocks()
multiGetTransactionBlocks(
input):Promise<IotaTransactionBlockResponse[]>
Defined in: sdk/typescript/src/client/client.ts:487
Parameters
input
MultiGetTransactionBlocksParams
Returns
Promise<IotaTransactionBlockResponse[]>
queryEvents()
queryEvents(
input):Promise<PaginatedEvents>
Defined in: sdk/typescript/src/client/client.ts:730
Get events for a given query criteria
Parameters
input
Returns
Promise<PaginatedEvents>
queryTransactionBlocks()
queryTransactionBlocks(
input):Promise<PaginatedTransactionResponse>
Defined in: sdk/typescript/src/client/client.ts:456
Get transaction blocks for a given query criteria
Parameters
input
Returns
Promise<PaginatedTransactionResponse>
signAndExecuteTransaction()
signAndExecuteTransaction(
__namedParameters):Promise<IotaTransactionBlockResponse>
Defined in: sdk/typescript/src/client/client.ts:529
Parameters
__namedParameters
object & Omit<ExecuteTransactionBlockParams, "signature" | "transactionBlock">
Returns
Promise<IotaTransactionBlockResponse>
subscribeEvent()
subscribeEvent(
input):Promise<Unsubscribe>
Defined in: sdk/typescript/src/client/client.ts:746
Subscribe to get notifications whenever an event matching the filter occurs
Parameters
input
SubscribeEventParams & SubscribeParams & object
Returns
Promise<Unsubscribe>
subscribeTransaction()
subscribeTransaction(
input):Promise<Unsubscribe>
Defined in: sdk/typescript/src/client/client.ts:769
Subscribe to transaction events matching the specified filter.
Parameters
input
SubscribeTransactionParams & SubscribeParams & object
Returns
Promise<Unsubscribe>
tryGetPastObject()
tryGetPastObject(
input):Promise<ObjectRead>
Defined in: sdk/typescript/src/client/client.ts:424
Parameters
input
Returns
Promise<ObjectRead>
view()
view(
input):Promise<IotaMoveViewCallResults>
Defined in: sdk/typescript/src/client/client.ts:1219
Calls a move view function.
Parameters
input
Returns
Promise<IotaMoveViewCallResults>
waitForTransaction()
waitForTransaction(
__namedParameters):Promise<IotaTransactionBlockResponse>
Defined in: sdk/typescript/src/client/client.ts:1104
Wait for a transaction block result to be available over the API.
This can be used in conjunction with executeTransactionBlock to wait for the transaction to
be available via the API.
This currently polls the getTransactionBlock API to check for the transaction.
timeout and pollInterval fall back to the client's waitForTransaction options.
Parameters
__namedParameters
object & GetTransactionBlockParams
Returns
Promise<IotaTransactionBlockResponse>