Skip to main content

@iota/sdk

Table of contents

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AliasId

Ƭ AliasId: HexEncodedString

An Alias ID represented as hex-encoded string.


NftId

Ƭ NftId: HexEncodedString

An NFT ID represented as hex-encoded string.


BlockId

Ƭ BlockId: HexEncodedString

A Block ID represented as hex-encoded string.


TokenId

Ƭ TokenId: HexEncodedString

A Token ID represented as hex-encoded string.


FoundryId

Ƭ FoundryId: HexEncodedString

A Foundry ID represented as hex-encoded string.


OutputId

Ƭ OutputId: string


MilestoneId

Ƭ MilestoneId: string


__ClientMethods__

Ƭ __ClientMethods__: __GetInfoMethod__ | __GetOutputMethod__ | __GetBasicOutputIdsMethod__ | __GetOutputsMethod__ | __PostBlockMethod__ | __BuildAndPostBlockMethod__ | __GetTipsMethod__ | __GetNetworkInfoMethod__ | __GetBlockMethod__ | __GetBlockMetadataMethod__ | __FindInputsMethod__ | __PrepareTransactionMethod__ | __SignTransactionMethod__ | __SignatureUnlockMethod__ | __PostBlockPayloadMethod__ | __GetNodeMethod__ | __GetNetworkIdMethod__ | __GetBech32HrpMethod__ | __GetMinPowScoreMethod__ | __GetTipsIntervalMethod__ | __GetProtocolParametersMethod__ | __GetLocalPowMethod__ | __GetFallbackToLocalPowMethod__ | __GetHealthMethod__ | __GetNodeInfoMethod__ | __GetPeersMethod__ | __PostBlockRawMethod__ | __GetBlockRawMethod__ | __GetMilestoneByIdMethod__ | __GetUtxoChangesByIdMethod__ | __GetMilestoneByIndexMethod__ | __GetUtxoChangesByIndexMethod__ | __GetReceiptsMethod__ | __GetReceiptsMigratedAtMethod__ | __GetTreasuryMethod__ | __GetIncludedBlockMethod__ | __GetIncludedBlockMetadataMethod__ | __HexToBech32Method__ | __AliasIdToBech32Method__ | __NftIdToBech32Method__ | __HexPublicKeyToBech32AddressMethod__ | __AliasOutputIdsMethod__ | __AliasOutputIdMethod__ | __NftOutputIdsMethod__ | __NftOutputIdMethod__ | __FoundryOutputIdsMethod__ | __FoundryOutputIdMethod__ | __GetOutputsIgnoreErrorsMethod__ | __FindBlocksMethod__ | __RetryMethod__ | __RetryUntilIncludedMethod__ | __ConsolidateFundsMethod__ | __ReattachMethod__ | __ReattachUncheckedMethod__ | __PromoteMethod__ | __PromoteUncheckedMethod__ | __UnhealthyNodesMethod__ | __BuildBasicOutputMethod__ | __BuildAliasOutputMethod__ | __BuildFoundryOutputMethod__ | __BuildNftOutputMethod__ | __ClearListenersMethod__ | __MinimumRequiredStorageDepositMethod__ | __RequestFundsFromFaucetMethod__ | __CallPluginRouteMethod__


QueryParameter

Ƭ QueryParameter: Address | AliasAddress | HasStorageDepositReturn | StorageDepositReturnAddress | HasTimelock | TimelockedBefore | TimelockedAfter | HasExpiration | ExpiresBefore | ExpiresAfter | ExpirationReturnAddress | Sender | Tag | Issuer | StateController | Governor | CommonQueryParameters

Query parameter for filtering output requests


AliasQueryParameter

Ƭ AliasQueryParameter: StateController | Governor | Issuer | Sender | CommonQueryParameters

Query parameters for filtering Alias Outputs


FoundryQueryParameter

Ƭ FoundryQueryParameter: AliasAddress | CommonQueryParameters

Query parameters for filtering Foundry Outputs


NftQueryParameter

Ƭ NftQueryParameter: Address | AliasAddress | HasStorageDepositReturn | StorageDepositReturnAddress | HasTimelock | TimelockedBefore | TimelockedAfter | HasExpiration | ExpiresBefore | ExpiresAfter | ExpirationReturnAddress | Issuer | Sender | Tag | CommonQueryParameters

Query parameters for filtering Nft Outputs


LedgerInclusionState

Ƭ LedgerInclusionState: "noTransaction" | "included" | "conflicting"

The different states of ledger inclusion.


__SecretManagerMethods__

Ƭ __SecretManagerMethods__: __GenerateEd25519AddressesMethod__ | __GenerateEvmAddressesMethod__ | __GetLedgerNanoStatusMethod__ | __SignTransactionMethod__ | __SignatureUnlockMethod__ | __StoreMnemonicMethod__ | __SignEd25519Method__ | __SignSecp256k1EcdsaMethod__


PlaceholderSecretManager

Ƭ PlaceholderSecretManager: "placeholder"

Placeholder secret manager that can't do anything.


SecretManagerType

Ƭ SecretManagerType: LedgerNanoSecretManager | MnemonicSecretManager | StrongholdSecretManager | PlaceholderSecretManager

Supported secret managers


__UtilsMethods__

Ƭ __UtilsMethods__: __GenerateMnemonicMethod__ | __MnemonicToHexSeedMethod__ | __ComputeAliasIdMethod__ | __ComputeNftIdMethod__ | __ComputeFoundryIdMethod__ | __ComputeOutputIdMethod__ | __ComputeTokenIdMethod__ | __ComputeInputsCommitmentMethod__ | __ComputeStorageDepositMethod__ | __ParseBech32AddressMethod__ | __BlockIdMethod__ | __MilestoneIdMethod__ | __TransactionIdMethod__ | __Bech32ToHexMethod__ | __HexToBech32Method__ | __AliasIdToBech32Method__ | __NftIdToBech32Method__ | __HexPublicKeyToBech32AddressMethod__ | __IsAddressValidMethod__ | __HashTransactionEssenceMethod__ | __VerifyEd25519SignatureMethod__ | __VerifySecp256k1EcdsaSignatureMethod__ | __VerifyMnemonicMethod__ | __FaucetMethod__ | __OutputIdToUtxoInput__


HexEncodedString

Ƭ HexEncodedString: string

Hex encoded bytes.


HexEncodedAmount

Ƭ HexEncodedAmount: string

Hex encoded U256.


AccountId

Ƭ AccountId: number | string

Account identifier Could be the account index (number) or account alias (string)


__AccountMethod__

Ƭ __AccountMethod__: __BuildAliasOutputMethod__ | __BuildBasicOutputMethod__ | __BuildFoundryOutputMethod__ | __BuildNftOutputMethod__ | __PrepareBurnMethod__ | __ClaimOutputsMethod__ | __PrepareConsolidateOutputsMethod__ | __PrepareCreateAliasOutputMethod__ | __DeregisterParticipationEventMethod__ | __GenerateEd25519AddressesMethod__ | __GetBalanceMethod__ | __GetOutputMethod__ | __GetIncomingTransactionMethod__ | __GetFoundryOutputMethod__ | __ClaimableOutputsMethod__ | __GetParticipationEventMethod__ | __GetParticipationEventIdsMethod__ | __GetParticipationEventsMethod__ | __GetParticipationEventStatusMethod__ | __GetTransactionMethod__ | __AddressesMethod__ | __AddressesWithUnspentOutputsMethod__ | __OutputsMethod__ | __PendingTransactionsMethod__ | __IncomingTransactionsMethod__ | __TransactionsMethod__ | __UnspentOutputsMethod__ | __PrepareCreateNativeTokenMethod__ | __PrepareMeltNativeTokenMethod__ | __PrepareMintNativeTokenMethod__ | __PrepareMintNftsMethod__ | __PrepareOutputMethod__ | __PrepareSendMethod__ | __PrepareTransactionMethod__ | __RegisterParticipationEventsMethod__ | __RetryTransactionUntilIncludedMethod__ | __SendMethod__ | __SendWithParamsMethod__ | __PrepareSendNativeTokensMethod__ | __PrepareSendNftMethod__ | __SendOutputsMethod__ | __SetAliasMethod__ | __SetDefaultSyncOptionsMethod__ | __SignTransactionEssenceMethod__ | __SignAndSubmitTransactionMethod__ | __SubmitAndStoreTransactionMethod__ | __SyncAccountMethod__ | __PrepareVoteMethod__ | __PrepareStopParticipatingMethod__ | __GetParticipationOverviewMethod__ | __PrepareIncreaseVotingPowerMethod__ | __PrepareDecreaseVotingPowerMethod__


__CallAccountMethodMethod__

Ƭ __CallAccountMethodMethod__: Object

Type declaration

NameType
name"callAccountMethod"
data{ accountId: AccountId ; method: __AccountMethod__ }
data.accountIdAccountId
data.method__AccountMethod__

__Method__

Ƭ __Method__: __BackupMethod__ | __CallAccountMethodMethod__ | __ChangeStrongholdPasswordMethod__ | __ClearListenersMethod__ | __ClearStrongholdPasswordMethod__ | __CreateAccountMethod__ | __EmitTestEventMethod__ | __GenerateMnemonicMethod__ | __GetAccountMethod__ | __GetAccountIndexesMethod__ | __GetAccountsMethod__ | __GetChrysalisDataMethod__ | __GetLedgerNanoStatusMethod__ | __GenerateEd25519AddressMethod__ | __IsStrongholdPasswordAvailableMethod__ | __RecoverAccountsMethod__ | __RemoveLatestAccountMethod__ | __RestoreBackupMethod__ | __SetClientOptionsMethod__ | __SetStrongholdPasswordClearIntervalMethod__ | __SetStrongholdPasswordMethod__ | __StartBackgroundSyncMethod__ | __StopBackgroundSyncMethod__ | __StoreMnemonicMethod__ | __UpdateNodeAuthMethod__


TransactionId

Ƭ TransactionId: string

A Transaction ID represented as hex-encoded string.


ParticipationEventId

Ƭ ParticipationEventId: string

A participation event ID represented as hex-encoded string.


ParticipationEventMap

Ƭ ParticipationEventMap: Object

Maps participation event IDs to their corresponding event data with nodes.

Index signature

▪ [id: ParticipationEventId]: ParticipationEventWithNodes


ParticipationEventPayload

Ƭ ParticipationEventPayload: VotingEventPayload | StakingEventPayload

Possible participation event payloads (voting or staking).


RemainderValueStrategy

Ƭ RemainderValueStrategy: ChangeAddress | ReuseAddress | CustomAddress

The possible remainder value strategies.


ChangeAddress

Ƭ ChangeAddress: Object

Allows to move the remainder value to a change address.

Type declaration

NameTypeDescription
strategy"ChangeAddress"The name of the strategy.
valuenullOnly required for CustomAddress.

ReuseAddress

Ƭ ReuseAddress: Object

Allows to keep the remainder value on the source address.

Type declaration

NameTypeDescription
strategy"ReuseAddress"The name of the strategy.
valuenullOnly required for CustomAddress.

CustomAddress

Ƭ CustomAddress: Object

CustomAddress variant of RemainderValueStrategy

Type declaration

NameTypeDescription
strategy"CustomAddress"The name of the strategy.
valueAccountAddress-

Variables

migrateStrongholdSnapshotV2ToV3

migrateStrongholdSnapshotV2ToV3: any


migrateDbChrysalisToStardust

migrateDbChrysalisToStardust: any


AddressDiscriminator

Const AddressDiscriminator: Object

Type declaration

NameType
propertystring
subTypes({ value: typeof Ed25519Address = Ed25519Address; name: any } | { value: typeof AliasAddress = AliasAddress; name: any } | { value: typeof NftAddress = NftAddress; name: any })[]

InputDiscriminator

Const InputDiscriminator: Object

Type declaration

NameType
propertystring
subTypes({ value: typeof TreasuryInput = TreasuryInput; name: any } | { value: typeof UTXOInput = UTXOInput; name: any })[]

FeatureDiscriminator

Const FeatureDiscriminator: Object

Type declaration

NameType
propertystring
subTypes({ value: typeof SenderFeature = SenderFeature; name: any } | { value: typeof IssuerFeature = IssuerFeature; name: any } | { value: typeof MetadataFeature = MetadataFeature; name: any } | { value: typeof TagFeature = TagFeature; name: any })[]

OutputDiscriminator

Const OutputDiscriminator: Object

Type declaration

NameType
propertystring
subTypes({ value: typeof TreasuryOutput = TreasuryOutput; name: any } | { value: typeof BasicOutput = BasicOutput; name: any } | { value: typeof AliasOutput = AliasOutput; name: any } | { value: typeof NftOutput = NftOutput; name: any } | { value: typeof FoundryOutput = FoundryOutput; name: any })[]

TokenSchemeDiscriminator

Const TokenSchemeDiscriminator: Object

Type declaration

NameType
propertystring
subTypes{ value: typeof SimpleTokenScheme = SimpleTokenScheme; name: any }[]

UnlockConditionDiscriminator

Const UnlockConditionDiscriminator: Object

Type declaration

NameType
propertystring
subTypes({ value: typeof AddressUnlockCondition = AddressUnlockCondition; name: any } | { value: typeof StorageDepositReturnUnlockCondition = StorageDepositReturnUnlockCondition; name: any } | { value: typeof TimelockUnlockCondition = TimelockUnlockCondition; name: any } | { value: typeof ExpirationUnlockCondition = ExpirationUnlockCondition; name: any })[]

PayloadDiscriminator

Const PayloadDiscriminator: Object

Type declaration

NameType
propertystring
subTypes({ value: typeof MilestonePayload = MilestonePayload; name: any } | { value: typeof TaggedDataPayload = TaggedDataPayload; name: any } | { value: typeof TransactionPayload = TransactionPayload; name: any } | { value: typeof TreasuryTransactionPayload = TreasuryTransactionPayload; name: any })[]

TransactionEssenceDiscriminator

Const TransactionEssenceDiscriminator: Object

Type declaration

NameType
propertystring
subTypes{ value: typeof RegularTransactionEssence = RegularTransactionEssence; name: any }[]

UnlockDiscriminator

Const UnlockDiscriminator: Object

Type declaration

NameType
propertystring
subTypes({ value: typeof SignatureUnlock = SignatureUnlock; name: any } | { value: typeof ReferenceUnlock = ReferenceUnlock; name: any })[]

IOTA_BECH32_HRP

Const IOTA_BECH32_HRP: "iota"


IOTA_TESTNET_BECH32_HRP

Const IOTA_TESTNET_BECH32_HRP: "atoi"


SHIMMER_BECH32_HRP

Const SHIMMER_BECH32_HRP: "smr"


SHIMMER_TESTNET_BECH32_HRP

Const SHIMMER_TESTNET_BECH32_HRP: "rms"


CONFLICT_REASON_STRINGS

Const CONFLICT_REASON_STRINGS: { [key in ConflictReason]: string }

Conflict reason strings.


MilestoneOptionDiscriminator

Const MilestoneOptionDiscriminator: Object

Type declaration

NameType
propertystring
subTypes({ value: typeof ReceiptMilestoneOption = ReceiptMilestoneOption; name: any } | { value: typeof ProtocolParamsMilestoneOption = ProtocolParamsMilestoneOption; name: any })[]

Functions

initLogger

initLogger(config?): any

Initialize logger, if no arguments are provided a default config will be used.

Parameters

NameTypeDefault value
configILoggerConfigdefaultLoggerConfig

Returns

any


parsePayload

parsePayload(data): Payload

Parameters

NameType
dataany

Returns

Payload


bigIntToHex

bigIntToHex(value): string

Converts bigint value to hexadecimal string representation prefixed with "0x".

Parameters

NameType
valuebigint

Returns

string


hexToBigInt

hexToBigInt(value): bigint

Converts hex encoded string to bigint value.

Parameters

NameType
valuestring

Returns

bigint


utf8ToBytes

utf8ToBytes(utf8): number[]

Convert UTF8 string to an array of bytes

Parameters

NameType
utf8string

Returns

number[]


hexToUtf8

hexToUtf8(hex): string

Convert hex encoded string to UTF8 string

Parameters

NameType
hexstring

Returns

string


utf8ToHex

utf8ToHex(utf8): string

Convert UTF8 string to hex encoded string

Parameters

NameType
utf8string

Returns

string