IotaClient
@iota/iota-sdk / client / IotaClient
Class: IotaClient
Defined in: sdk/typescript/src/client/client.ts:166
Indexable
[
key:number]:boolean
Constructors
Constructor
new IotaClient(
options):IotaClient
Defined in: sdk/typescript/src/client/client.ts:178
Establish a connection to an IOTA RPC endpoint
Parameters
options
NetworkOrTransport
configuration options for the API Client
Returns
IotaClient
Properties
transport
protectedtransport:IotaTransport
Defined in: sdk/typescript/src/client/client.ts:167
Methods
call()
call<
T>(method,params,args?):Promise<T>
Defined in: sdk/typescript/src/client/client.ts:290
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:763
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:793
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:485
Parameters
__namedParameters
Returns
Promise<IotaTransactionBlockResponse>
getAddressMetrics()
getAddressMetrics(
__namedParameters?):Promise<AddressMetrics>
Defined in: sdk/typescript/src/client/client.ts:915
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<AddressMetrics>
getAllBalances()
getAllBalances(
input):Promise<CoinBalance[]>
Defined in: sdk/typescript/src/client/client.ts:239
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:210
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:935
Parameters
input?
descendingOrder?
boolean
signal?
AbortSignal
Returns
Promise<AllEpochsAddressMetrics>
getBalance()
getBalance(
input):Promise<CoinBalance>
Defined in: sdk/typescript/src/client/client.ts:225
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:1037
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<string>
getCheckpoint()
getCheckpoint(
input):Promise<Checkpoint>
Defined in: sdk/typescript/src/client/client.ts:875
Returns information about a given checkpoint
Parameters
input
Returns
Promise<Checkpoint>
getCheckpointAddressMetrics()
getCheckpointAddressMetrics(
input?):Promise<AddressMetrics>
Defined in: sdk/typescript/src/client/client.ts:946
Parameters
input?
checkpoint
string
signal?
AbortSignal
Returns
Promise<AddressMetrics>
getCheckpoints()
getCheckpoints(
input):Promise<CheckpointPage>
Defined in: sdk/typescript/src/client/client.ts:886
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:275
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:253
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:195
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:899
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:1009
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:825
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:837
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:848
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:810
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:923
Parameters
input?
object & PaginationArguments<string | null>
Returns
Promise<EpochMetricsPage>
getEpochs()
getEpochs(
input?):Promise<EpochPage>
Defined in: sdk/typescript/src/client/client.ts:960
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:861
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:667
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:629
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:646
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:998
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:301
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:907
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<NetworkMetrics>
getNormalizedMoveFunction()
getNormalizedMoveFunction(
input):Promise<IotaMoveNormalizedFunction>
Defined in: sdk/typescript/src/client/client.ts:341
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:328
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:315
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:354
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:390
Get details about an object
Parameters
input
Returns
Promise<IotaObjectResponse>
getOwnedObjects()
getOwnedObjects(
input):Promise<PaginatedObjectsResponse>
Defined in: sdk/typescript/src/client/client.ts:367
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:1056
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:1045
Parameters
input?
Returns
Promise<ProtocolConfig>
getReferenceGasPrice()
getReferenceGasPrice(
__namedParameters?):Promise<bigint>
Defined in: sdk/typescript/src/client/client.ts:551
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:182
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<string | undefined>
getStakes()
getStakes(
input):Promise<DelegatedStake[]>
Defined in: sdk/typescript/src/client/client.ts:563
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:593
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:577
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:609
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:264
Fetch total supply for a coin
Parameters
input
Returns
Promise<CoinSupply>
getTotalTransactionBlocks()
getTotalTransactionBlocks(
__namedParameters?):Promise<bigint>
Defined in: sdk/typescript/src/client/client.ts:539
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:1017
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<string>
getTransactionBlock()
getTransactionBlock(
input):Promise<IotaTransactionBlockResponse>
Defined in: sdk/typescript/src/client/client.ts:451
Parameters
input
Returns
Promise<IotaTransactionBlockResponse>
getValidatorsApy()
getValidatorsApy(
__namedParameters?):Promise<ValidatorsApy>
Defined in: sdk/typescript/src/client/client.ts:1029
Return the Validators APYs
Parameters
__namedParameters?
signal?
AbortSignal
Returns
Promise<ValidatorsApy>
iotaNamesFindAllRegistrationNFTs()
iotaNamesFindAllRegistrationNFTs(
input):Promise<PaginatedObjectsResponse>
Defined in: sdk/typescript/src/client/client.ts:1163
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:1141
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:1152
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:1176
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:412
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:464
Parameters
input
MultiGetTransactionBlocksParams
Returns
Promise<IotaTransactionBlockResponse[]>
queryEvents()
queryEvents(
input):Promise<PaginatedEvents>
Defined in: sdk/typescript/src/client/client.ts:707
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:433
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:506
Parameters
__namedParameters
object & Omit<ExecuteTransactionBlockParams, "signature" | "transactionBlock">
Returns
Promise<IotaTransactionBlockResponse>
subscribeEvent()
subscribeEvent(
input):Promise<Unsubscribe>
Defined in: sdk/typescript/src/client/client.ts:725
Subscribe to get notifications whenever an event matching the filter occurs
Parameters
input
SubscribeEventParams & object
Returns
Promise<Unsubscribe>
Deprecated
subscribeTransaction()
subscribeTransaction(
input):Promise<Unsubscribe>
Defined in: sdk/typescript/src/client/client.ts:743
Parameters
input
SubscribeTransactionParams & object
Returns
Promise<Unsubscribe>
Deprecated
tryGetPastObject()
tryGetPastObject(
input):Promise<ObjectRead>
Defined in: sdk/typescript/src/client/client.ts:401
Parameters
input
Returns
Promise<ObjectRead>
view()
view(
input):Promise<IotaMoveViewCallResults>
Defined in: sdk/typescript/src/client/client.ts:1187
Calls a move view function.
Parameters
input
Returns
Promise<IotaMoveViewCallResults>
waitForTransaction()
waitForTransaction(
__namedParameters):Promise<IotaTransactionBlockResponse>
Defined in: sdk/typescript/src/client/client.ts:1072
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.
Parameters
__namedParameters
object & GetTransactionBlockParams
Returns
Promise<IotaTransactionBlockResponse>