Skip to main content

@iota/iota.js

Table of contents

Classes

Variables

Functions

Interfaces

Type Aliases

Enumerations

Variables

MIN_ADDRESS_LENGTH

Const MIN_ADDRESS_LENGTH: number

The minimum length of an address binary representation.


ALIAS_ID_LENGTH

Const ALIAS_ID_LENGTH: number = 32

The length of an alias id.


MIN_ALIAS_ADDRESS_LENGTH

Const MIN_ALIAS_ADDRESS_LENGTH: number

The minimum length of an alias address binary representation.


MIN_ED25519_ADDRESS_LENGTH

Const MIN_ED25519_ADDRESS_LENGTH: number

The minimum length of an ed25519 address binary representation.


NFT_ID_LENGTH

Const NFT_ID_LENGTH: number = 32

The length of an NFT Id.


MIN_NFT_ADDRESS_LENGTH

Const MIN_NFT_ADDRESS_LENGTH: number

The minimum length of an nft address binary representation.


MAX_BLOCK_LENGTH

Const MAX_BLOCK_LENGTH: number = 32768

The maximum length of a block.


MAX_NUMBER_PARENTS

Const MAX_NUMBER_PARENTS: number = 8

The maximum number of parents.


MIN_NUMBER_PARENTS

Const MIN_NUMBER_PARENTS: number = 1

The minimum number of parents.


UINT8_SIZE

Const UINT8_SIZE: number = 1

Byte length for a uint8 field.


UINT16_SIZE

Const UINT16_SIZE: number = 2

Byte length for a uint16 field.


UINT32_SIZE

Const UINT32_SIZE: number = 4

Byte length for a uint32 field.


UINT64_SIZE

Const UINT64_SIZE: number = 8

Byte length for a uint64 field.


UINT256_SIZE

Const UINT256_SIZE: number = 32

Byte length for a uint256 field.


BLOCK_ID_LENGTH

Const BLOCK_ID_LENGTH: number = Blake2b.SIZE_256

Byte length for a block id.


TRANSACTION_ID_LENGTH

Const TRANSACTION_ID_LENGTH: number = Blake2b.SIZE_256

Byte length for a transaction id.


MERKLE_PROOF_LENGTH

Const MERKLE_PROOF_LENGTH: number = Blake2b.SIZE_256

Byte length for a merkle prrof.


TYPE_LENGTH

Const TYPE_LENGTH: number = UINT32_SIZE

Byte length for a type length.


SMALL_TYPE_LENGTH

Const SMALL_TYPE_LENGTH: number = UINT8_SIZE

Byte length for a small type length.


STRING_LENGTH

Const STRING_LENGTH: number = UINT16_SIZE

Byte length for a string length.


ARRAY_LENGTH

Const ARRAY_LENGTH: number = UINT16_SIZE

Byte length for an array length.


MIN_FEATURES_LENGTH

Const MIN_FEATURES_LENGTH: number = UINT8_SIZE

The minimum length of a featurs tokens list.


MIN_FEATURE_LENGTH

Const MIN_FEATURE_LENGTH: number

The minimum length of a feature binary representation.


MIN_ISSUER_FEATURE_LENGTH

Const MIN_ISSUER_FEATURE_LENGTH: number

The minimum length of a issuer feature binary representation.


MIN_METADATA_FEATURE_LENGTH

Const MIN_METADATA_FEATURE_LENGTH: number

The minimum length of a metadata feature block binary representation.


MIN_SENDER_FEATURE_LENGTH

Const MIN_SENDER_FEATURE_LENGTH: number

The minimum length of a sender feature binary representation.


MIN_TAG_FEATURE_LENGTH

Const MIN_TAG_FEATURE_LENGTH: number

The minimum length of a tag feature binary representation.


TAIL_HASH_LENGTH

Const TAIL_HASH_LENGTH: number = 49

The length of the tail hash length in bytes.


MIN_MIGRATED_FUNDS_LENGTH

Const MIN_MIGRATED_FUNDS_LENGTH: number

The minimum length of a migrated fund binary representation.


MAX_FUNDS_COUNT

Const MAX_FUNDS_COUNT: number = 127

The maximum number of funds.


MIN_INPUT_LENGTH

Const MIN_INPUT_LENGTH: number

The minimum length of an input binary representation.


MIN_INPUT_COUNT

Const MIN_INPUT_COUNT: number = 1

The minimum number of inputs.


MAX_INPUT_COUNT

Const MAX_INPUT_COUNT: number = 128

The maximum number of inputs.


MIN_TREASURY_INPUT_LENGTH

Const MIN_TREASURY_INPUT_LENGTH: number

The minimum length of a treasury input binary representation.


MIN_UTXO_INPUT_LENGTH

Const MIN_UTXO_INPUT_LENGTH: number

The minimum length of a utxo input binary representation.


MIN_MILESTONE_OPTION_LENGTH

Const MIN_MILESTONE_OPTION_LENGTH: number

The minimum length of a milestone option binary representation.


MIN_PROTOCOL_PARAMS_MILESTONE_OPTION_LENGTH

Const MIN_PROTOCOL_PARAMS_MILESTONE_OPTION_LENGTH: number

The minimum length of a protocol params milestone option binary representation.


MIN_RECEIPT_MILESTONE_OPTION_LENGTH

Const MIN_RECEIPT_MILESTONE_OPTION_LENGTH: number

The minimum length of a receipt milestone option binary representation.


MIN_ALIAS_OUTPUT_LENGTH

Const MIN_ALIAS_OUTPUT_LENGTH: number

The minimum length of a alias output binary representation.


MIN_BASIC_OUTPUT_LENGTH

Const MIN_BASIC_OUTPUT_LENGTH: number

The minimum length of a basic output binary representation.


MIN_FOUNDRY_OUTPUT_LENGTH

Const MIN_FOUNDRY_OUTPUT_LENGTH: number

The minimum length of a foundry output binary representation.


MIN_NFT_OUTPUT_LENGTH

Const MIN_NFT_OUTPUT_LENGTH: number

The minimum length of a nft output binary representation.


MIN_OUTPUT_LENGTH

Const MIN_OUTPUT_LENGTH: number

The minimum length of an output binary representation.


MIN_OUTPUT_COUNT

Const MIN_OUTPUT_COUNT: number = 1

The minimum number of outputs.


MAX_OUTPUT_COUNT

Const MAX_OUTPUT_COUNT: number = 128

The maximum number of outputs.


MIN_TREASURY_OUTPUT_LENGTH

Const MIN_TREASURY_OUTPUT_LENGTH: number

The minimum length of a treasury output binary representation.


MIN_MILESTONE_PAYLOAD_LENGTH

Const MIN_MILESTONE_PAYLOAD_LENGTH: number

The minimum length of a milestone payload binary representation.


MIN_PAYLOAD_LENGTH

Const MIN_PAYLOAD_LENGTH: number

The minimum length of a payload binary representation.


MIN_TAGGED_DATA_PAYLOAD_LENGTH

Const MIN_TAGGED_DATA_PAYLOAD_LENGTH: number

The minimum length of a tagged data payload binary representation.


MAX_TAG_LENGTH

Const MAX_TAG_LENGTH: number = 64

The maximum length of a tag.


MIN_TRANSACTION_PAYLOAD_LENGTH

Const MIN_TRANSACTION_PAYLOAD_LENGTH: number

The minimum length of a transaction payload binary representation.


MIN_TREASURY_TRANSACTION_PAYLOAD_LENGTH

Const MIN_TREASURY_TRANSACTION_PAYLOAD_LENGTH: number

The minimum length of a treasury transaction payload binary representation.


MIN_ED25519_SIGNATURE_LENGTH

Const MIN_ED25519_SIGNATURE_LENGTH: number

The minimum length of an ed25519 signature binary representation.


MIN_SIGNATURE_LENGTH

Const MIN_SIGNATURE_LENGTH: number = MIN_ED25519_SIGNATURE_LENGTH

The minimum length of a signature binary representation.


MIN_SIMPLE_TOKEN_SCHEME_LENGTH

Const MIN_SIMPLE_TOKEN_SCHEME_LENGTH: number

The minimum length of an simple token scheme binary representation.


MIN_TOKEN_SCHEME_LENGTH

Const MIN_TOKEN_SCHEME_LENGTH: number = MIN_SIMPLE_TOKEN_SCHEME_LENGTH

The minimum length of a simple token scheme binary representation.


MIN_TRANSACTION_ESSENCE_LENGTH

Const MIN_TRANSACTION_ESSENCE_LENGTH: number

The minimum length of a transaction essence binary representation.


MIN_ADDRESS_UNLOCK_CONDITION_LENGTH

Const MIN_ADDRESS_UNLOCK_CONDITION_LENGTH: number

The minimum length of an address unlock condition binary representation.


MIN_EXPIRATION_UNLOCK_CONDITION_LENGTH

Const MIN_EXPIRATION_UNLOCK_CONDITION_LENGTH: number

The minimum length of an expiration unlock condition binary representation.


MIN_GOVERNOR_ADDRESS_UNLOCK_CONDITION_LENGTH

Const MIN_GOVERNOR_ADDRESS_UNLOCK_CONDITION_LENGTH: number

The minimum length of an governor unlock condition binary representation.


MIN_IMMUTABLE_ALIAS_UNLOCK_CONDITION_LENGTH

Const MIN_IMMUTABLE_ALIAS_UNLOCK_CONDITION_LENGTH: number

The minimum length of an immutable alias unlock condition binary representation.


MIN_STATE_CONTROLLER_ADDRESS_UNLOCK_CONDITION_LENGTH

Const MIN_STATE_CONTROLLER_ADDRESS_UNLOCK_CONDITION_LENGTH: number

The minimum length of an state controller address unlock condition binary representation.


MIN_STORAGE_DEPOSIT_RETURN_UNLOCK_CONDITION_LENGTH

Const MIN_STORAGE_DEPOSIT_RETURN_UNLOCK_CONDITION_LENGTH: number

The minimum length of an storage deposit return unlock condition binary representation.


MIN_TIMELOCK_UNLOCK_CONDITION_LENGTH

Const MIN_TIMELOCK_UNLOCK_CONDITION_LENGTH: number

The minimum length of an timelock unlock condition binary representation.


MIN_UNLOCK_CONDITIONS_LENGTH

Const MIN_UNLOCK_CONDITIONS_LENGTH: number = UINT8_SIZE

The minimum length of a unlock conditions list.


MIN_UNLOCK_CONDITION_LENGTH

Const MIN_UNLOCK_CONDITION_LENGTH: number

The minimum length of a unlock conditions binary representation.


MIN_ALIAS_UNLOCK_LENGTH

Const MIN_ALIAS_UNLOCK_LENGTH: number

The minimum length of a alias unlock binary representation.


MIN_NFT_UNLOCK_LENGTH

Const MIN_NFT_UNLOCK_LENGTH: number

The minimum length of a nft unlock binary representation.


MIN_REFERENCE_UNLOCK_LENGTH

Const MIN_REFERENCE_UNLOCK_LENGTH: number

The minimum length of a reference unlock binary representation.


MIN_SIGNATURE_UNLOCK_LENGTH

Const MIN_SIGNATURE_UNLOCK_LENGTH: number

The minimum length of a signature unlock binary representation.


MIN_UNLOCK_LENGTH

Const MIN_UNLOCK_LENGTH: number

The minimum length of an unlock binary representation.


DEFAULT_PROTOCOL_VERSION

Const DEFAULT_PROTOCOL_VERSION: number = 2

The default protocol version.


TRANSACTION_ESSENCE_TYPE

Const TRANSACTION_ESSENCE_TYPE: 1

The global type for the transaction essence.


INPUTS_COMMITMENT_SIZE

Const INPUTS_COMMITMENT_SIZE: number = Blake2b.SIZE_256

Inputs commitment size.


ALIAS_ADDRESS_TYPE

Const ALIAS_ADDRESS_TYPE: 8

The global type for the alias address type.


ED25519_ADDRESS_TYPE

Const ED25519_ADDRESS_TYPE: 0

The global type for the ed25519 address type.


NFT_ADDRESS_TYPE

Const NFT_ADDRESS_TYPE: 16

The global type for the NFT address type.


ISSUER_FEATURE_TYPE

Const ISSUER_FEATURE_TYPE: 1

The global type for the issuer feature.


METADATA_FEATURE_TYPE

Const METADATA_FEATURE_TYPE: 2

The global type for the metadata feature.


SENDER_FEATURE_TYPE

Const SENDER_FEATURE_TYPE: 0

The global type for the sender feature.


TAG_FEATURE_TYPE

Const TAG_FEATURE_TYPE: 3

The global type for the tag feature.


TREASURY_INPUT_TYPE

Const TREASURY_INPUT_TYPE: 1

The global type for the treasury input.


UTXO_INPUT_TYPE

Const UTXO_INPUT_TYPE: 0

The global type for the input.


PROTOCOL_PARAMETERS_MILESTONE_OPTION_TYPE

Const PROTOCOL_PARAMETERS_MILESTONE_OPTION_TYPE: 1

The global type for the option.


RECEIPT_MILESTONE_OPTION_TYPE

Const RECEIPT_MILESTONE_OPTION_TYPE: 0

The global type for the option.


ALIAS_OUTPUT_TYPE

Const ALIAS_OUTPUT_TYPE: 4

The global type for the alias output.


BASIC_OUTPUT_TYPE

Const BASIC_OUTPUT_TYPE: 3

The global type for the basic output.


FOUNDRY_OUTPUT_TYPE

Const FOUNDRY_OUTPUT_TYPE: 5

The global type for the foundry output.


NFT_OUTPUT_TYPE

Const NFT_OUTPUT_TYPE: 6

The global type for the NFT output.


TREASURY_OUTPUT_TYPE

Const TREASURY_OUTPUT_TYPE: 2

The global type for the treasury output.


MILESTONE_PAYLOAD_TYPE

Const MILESTONE_PAYLOAD_TYPE: 7

The global type for the payload.


TAGGED_DATA_PAYLOAD_TYPE

Const TAGGED_DATA_PAYLOAD_TYPE: 5

The global type for the payload.


TRANSACTION_PAYLOAD_TYPE

Const TRANSACTION_PAYLOAD_TYPE: 6

The global type for the payload.


TREASURY_TRANSACTION_PAYLOAD_TYPE

Const TREASURY_TRANSACTION_PAYLOAD_TYPE: 4

The global type for the payload.


ED25519_SIGNATURE_TYPE

Const ED25519_SIGNATURE_TYPE: 0

The global type for the signature type.


SIMPLE_TOKEN_SCHEME_TYPE

Const SIMPLE_TOKEN_SCHEME_TYPE: 0

The global type for the simple token scheme.


ADDRESS_UNLOCK_CONDITION_TYPE

Const ADDRESS_UNLOCK_CONDITION_TYPE: 0

The global type for the address unlock condition.


EXPIRATION_UNLOCK_CONDITION_TYPE

Const EXPIRATION_UNLOCK_CONDITION_TYPE: 3

The global type for the expiration unlock condition.


GOVERNOR_ADDRESS_UNLOCK_CONDITION_TYPE

Const GOVERNOR_ADDRESS_UNLOCK_CONDITION_TYPE: 5

The global type for the governor address unlock condition.


IMMUTABLE_ALIAS_UNLOCK_CONDITION_TYPE

Const IMMUTABLE_ALIAS_UNLOCK_CONDITION_TYPE: 6

The global type for the immutable alias unlock condition.


STATE_CONTROLLER_ADDRESS_UNLOCK_CONDITION_TYPE

Const STATE_CONTROLLER_ADDRESS_UNLOCK_CONDITION_TYPE: 4

The global type for the state controller unlock condition.


STORAGE_DEPOSIT_RETURN_UNLOCK_CONDITION_TYPE

Const STORAGE_DEPOSIT_RETURN_UNLOCK_CONDITION_TYPE: 1

The global type for the storage deposit return unlock condition.


TIMELOCK_UNLOCK_CONDITION_TYPE

Const TIMELOCK_UNLOCK_CONDITION_TYPE: 2

The global type for the timelock unlock condition.


ALIAS_UNLOCK_TYPE

Const ALIAS_UNLOCK_TYPE: 2

The global type for the alias unlock.


NFT_UNLOCK_TYPE

Const NFT_UNLOCK_TYPE: 3

The global type for the NFT unlock.


REFERENCE_UNLOCK_TYPE

Const REFERENCE_UNLOCK_TYPE: 1

The global type for the reference unlock.


SIGNATURE_UNLOCK_TYPE

Const SIGNATURE_UNLOCK_TYPE: 0

The global type for the unlock.


CONFLICT_REASON_STRINGS

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

Conflict reason strings.


ED25519_SEED_TYPE

Const ED25519_SEED_TYPE: number = 1

The global type for the seed.

Functions

deserializeAddress

deserializeAddress(readStream): AddressTypes

Deserialize the address from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

AddressTypes

The deserialized object.


serializeAddress

serializeAddress(writeStream, object): void

Serialize the address to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITypeBase<number>The object to serialize.

Returns

void


deserializeAliasAddress

deserializeAliasAddress(readStream): IAliasAddress

Deserialize the alias address from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IAliasAddress

The deserialized object.


serializeAliasAddress

serializeAliasAddress(writeStream, object): void

Serialize the alias address to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIAliasAddressThe object to serialize.

Returns

void


deserializeEd25519Address

deserializeEd25519Address(readStream): IEd25519Address

Deserialize the Ed25519 address from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IEd25519Address

The deserialized object.


serializeEd25519Address

serializeEd25519Address(writeStream, object): void

Serialize the ed25519 address to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIEd25519AddressThe object to serialize.

Returns

void


deserializeNftAddress

deserializeNftAddress(readStream): INftAddress

Deserialize the nft address from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

INftAddress

The deserialized object.


serializeNftAddress

serializeNftAddress(writeStream, object): void

Serialize the nft address to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectINftAddressThe object to serialize.

Returns

void


deserializeBlock

deserializeBlock(readStream): IBlock

Deserialize the block from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe block to deserialize.

Returns

IBlock

The deserialized block.


serializeBlock

serializeBlock(writeStream, object): void

Serialize the block essence to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIBlockThe object to serialize.

Returns

void


deserializeFeatures

deserializeFeatures(readStream): FeatureTypes[] | undefined

Deserialize the feature from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

FeatureTypes[] | undefined

The deserialized object.


serializeFeatures

serializeFeatures(writeStream, objects): void

Serialize the feature to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectsundefined | FeatureTypes[]The objects to serialize.

Returns

void


deserializeFeature

deserializeFeature(readStream): FeatureTypes

Deserialize the feature from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

FeatureTypes

The deserialized object.


serializeFeature

serializeFeature(writeStream, object): void

Serialize the feature to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITypeBase<number>The object to serialize.

Returns

void


deserializeIssuerFeature

deserializeIssuerFeature(readStream): IIssuerFeature

Deserialize the issuer feature from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IIssuerFeature

The deserialized object.


serializeIssuerFeature

serializeIssuerFeature(writeStream, object): void

Serialize the issuer feature to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIIssuerFeatureThe object to serialize.

Returns

void


deserializeMetadataFeature

deserializeMetadataFeature(readStream): IMetadataFeature

Deserialize the metadata feature block from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IMetadataFeature

The deserialized object.


serializeMetadataFeature

serializeMetadataFeature(writeStream, object): void

Serialize the metadata feature to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIMetadataFeatureThe object to serialize.

Returns

void


deserializeSenderFeature

deserializeSenderFeature(readStream): ISenderFeature

Deserialize the sender feature from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ISenderFeature

The deserialized object.


serializeSenderFeature

serializeSenderFeature(writeStream, object): void

Serialize the sender feature to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectISenderFeatureThe object to serialize.

Returns

void


deserializeTagFeature

deserializeTagFeature(readStream): ITagFeature

Deserialize the tag feature from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ITagFeature

The deserialized object.


serializeTagFeature

serializeTagFeature(writeStream, object): void

Serialize the tag feature to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITagFeatureThe object to serialize.

Returns

void


deserializeFunds

deserializeFunds(readStream): IMigratedFunds[]

Deserialize the receipt payload funds from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IMigratedFunds[]

The deserialized object.


serializeFunds

serializeFunds(writeStream, objects): void

Serialize the receipt payload funds to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectsIMigratedFunds[]The objects to serialize.

Returns

void


deserializeMigratedFunds

deserializeMigratedFunds(readStream): IMigratedFunds

Deserialize the migrated fund from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IMigratedFunds

The deserialized object.


serializeMigratedFunds

serializeMigratedFunds(writeStream, object): void

Serialize the migrated funds to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIMigratedFundsThe object to serialize.

Returns

void


deserializeInputs

deserializeInputs(readStream): InputTypes[]

Deserialize the inputs from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

InputTypes[]

The deserialized object.


serializeInputs

serializeInputs(writeStream, objects): void

Serialize the inputs to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectsInputTypes[]The objects to serialize.

Returns

void


deserializeInput

deserializeInput(readStream): InputTypes

Deserialize the input from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

InputTypes

The deserialized object.


serializeInput

serializeInput(writeStream, object): void

Serialize the input to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectInputTypesThe object to serialize.

Returns

void


deserializeTreasuryInput

deserializeTreasuryInput(readStream): ITreasuryInput

Deserialize the treasury input from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ITreasuryInput

The deserialized object.


serializeTreasuryInput

serializeTreasuryInput(writeStream, object): void

Serialize the treasury input to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITreasuryInputThe object to serialize.

Returns

void


deserializeUTXOInput

deserializeUTXOInput(readStream): IUTXOInput

Deserialize the utxo input from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IUTXOInput

The deserialized object.


serializeUTXOInput

serializeUTXOInput(writeStream, object): void

Serialize the utxo input to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIUTXOInputThe object to serialize.

Returns

void


deserializeMilestoneOptions

deserializeMilestoneOptions(readStream): MilestoneOptionTypes[]

Deserialize the milestone options from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

MilestoneOptionTypes[]

The deserialized object.


serializeMilestoneOptions

serializeMilestoneOptions(writeStream, objects): void

Serialize the milestone options to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectsMilestoneOptionTypes[]The objects to serialize.

Returns

void


deserializeMilestoneOption

deserializeMilestoneOption(readStream): MilestoneOptionTypes

Deserialize the milestone options from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

MilestoneOptionTypes

The deserialized object.


serializeMilestoneOption

serializeMilestoneOption(writeStream, object): void

Serialize the milestone option to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITypeBase<number>The object to serialize.

Returns

void


deserializeProtocolParamsMilestoneOption

deserializeProtocolParamsMilestoneOption(readStream): IProtocolParamsMilestoneOption

Deserialize the protocol params milestone option from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IProtocolParamsMilestoneOption

The deserialized object.


serializeProtocolParamsMilestoneOption

serializeProtocolParamsMilestoneOption(writeStream, object): void

Serialize the protocol params milestone option to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIProtocolParamsMilestoneOptionThe object to serialize.

Returns

void


deserializeReceiptMilestoneOption

deserializeReceiptMilestoneOption(readStream): IReceiptMilestoneOption

Deserialize the receipt milestone option from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IReceiptMilestoneOption

The deserialized object.


serializeReceiptMilestoneOption

serializeReceiptMilestoneOption(writeStream, object): void

Serialize the receipt milestone option to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIReceiptMilestoneOptionThe object to serialize.

Returns

void


deserializeAliasOutput

deserializeAliasOutput(readStream): IAliasOutput

Deserialize the alias output from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IAliasOutput

The deserialized object.


serializeAliasOutput

serializeAliasOutput(writeStream, object): void

Serialize the alias output to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIAliasOutputThe object to serialize.

Returns

void


deserializeBasicOutput

deserializeBasicOutput(readStream): IBasicOutput

Deserialize the basic output from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IBasicOutput

The deserialized object.


serializeBasicOutput

serializeBasicOutput(writeStream, object): void

Serialize the basic output to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIBasicOutputThe object to serialize.

Returns

void


deserializeFoundryOutput

deserializeFoundryOutput(readStream): IFoundryOutput

Deserialize the foundry output from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IFoundryOutput

The deserialized object.


serializeFoundryOutput

serializeFoundryOutput(writeStream, object): void

Serialize the foundry output to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIFoundryOutputThe object to serialize.

Returns

void


deserializeNftOutput

deserializeNftOutput(readStream): INftOutput

Deserialize the nft output from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

INftOutput

The deserialized object.


serializeNftOutput

serializeNftOutput(writeStream, object): void

Serialize the nft output to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectINftOutputThe object to serialize.

Returns

void


deserializeOutputs

deserializeOutputs(readStream): OutputTypes[]

Deserialize the outputs from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

OutputTypes[]

The deserialized object.


serializeOutputs

serializeOutputs(writeStream, objects): void

Serialize the outputs to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectsOutputTypes[]The objects to serialize.

Returns

void


deserializeOutput

deserializeOutput(readStream): OutputTypes

Deserialize the output from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

OutputTypes

The deserialized object.


serializeOutput

serializeOutput(writeStream, object): void

Serialize the output to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITypeBase<number>The object to serialize.

Returns

void


deserializeTreasuryOutput

deserializeTreasuryOutput(readStream): ITreasuryOutput

Deserialize the treasury output from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ITreasuryOutput

The deserialized object.


serializeTreasuryOutput

serializeTreasuryOutput(writeStream, object): void

Serialize the treasury output to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITreasuryOutputThe object to serialize.

Returns

void


deserializeMilestonePayload

deserializeMilestonePayload(readStream): IMilestonePayload

Deserialize the milestone payload from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IMilestonePayload

The deserialized object.


serializeMilestonePayload

serializeMilestonePayload(writeStream, object): void

Serialize the milestone payload to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIMilestonePayloadThe object to serialize.

Returns

void


serializeMilestoneEssence

serializeMilestoneEssence(writeStream, object): void

Serialize the milestone payload to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIMilestonePayloadThe object to serialize.

Returns

void


deserializePayload

deserializePayload(readStream): PayloadTypes | undefined

Deserialize the payload from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

PayloadTypes | undefined

The deserialized object.


serializePayload

serializePayload(writeStream, object): void

Serialize the payload essence to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectundefined | PayloadTypesThe object to serialize.

Returns

void


deserializeTaggedDataPayload

deserializeTaggedDataPayload(readStream): ITaggedDataPayload

Deserialize the tagged data payload from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ITaggedDataPayload

The deserialized object.


serializeTaggedDataPayload

serializeTaggedDataPayload(writeStream, object): void

Serialize the tagged data payload to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITaggedDataPayloadThe object to serialize.

Returns

void


deserializeTransactionPayload

deserializeTransactionPayload(readStream): ITransactionPayload

Deserialize the transaction payload from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ITransactionPayload

The deserialized object.


serializeTransactionPayload

serializeTransactionPayload(writeStream, object): void

Serialize the transaction payload to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITransactionPayloadThe object to serialize.

Returns

void


deserializeTreasuryTransactionPayload

deserializeTreasuryTransactionPayload(readStream): ITreasuryTransactionPayload

Deserialize the treasury transaction payload from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ITreasuryTransactionPayload

The deserialized object.


serializeTreasuryTransactionPayload

serializeTreasuryTransactionPayload(writeStream, object): void

Serialize the treasury transaction payload to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITreasuryTransactionPayloadThe object to serialize.

Returns

void


deserializeEd25519Signature

deserializeEd25519Signature(readStream): IEd25519Signature

Deserialize the Ed25519 signature from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IEd25519Signature

The deserialized object.


serializeEd25519Signature

serializeEd25519Signature(writeStream, object): void

Serialize the Ed25519 signature to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIEd25519SignatureThe object to serialize.

Returns

void


deserializeSignature

deserializeSignature(readStream): SignatureTypes

Deserialize the signature from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

SignatureTypes

The deserialized object.


serializeSignature

serializeSignature(writeStream, object): void

Serialize the signature to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIEd25519SignatureThe object to serialize.

Returns

void


deserializeSimpleTokenScheme

deserializeSimpleTokenScheme(readStream): ISimpleTokenScheme

Deserialize the simple token scheme from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ISimpleTokenScheme

The deserialized object.


serializeSimpleTokenScheme

serializeSimpleTokenScheme(writeStream, object): void

Serialize the simple token scheme to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectISimpleTokenSchemeThe object to serialize.

Returns

void


deserializeTokenScheme

deserializeTokenScheme(readStream): TokenSchemeTypes

Deserialize the token scheme from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

TokenSchemeTypes

The deserialized object.


serializeTokenScheme

serializeTokenScheme(writeStream, object): void

Serialize the token scheme to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectISimpleTokenSchemeThe object to serialize.

Returns

void


deserializeTransactionEssence

deserializeTransactionEssence(readStream): ITransactionEssence

Deserialize the transaction essence from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ITransactionEssence

The deserialized object.


serializeTransactionEssence

serializeTransactionEssence(writeStream, object): void

Serialize the transaction essence to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITransactionEssenceThe object to serialize.

Returns

void


deserializeAddressUnlockCondition

deserializeAddressUnlockCondition(readStream): IAddressUnlockCondition

Deserialize the address unlock condition from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IAddressUnlockCondition

The deserialized object.


serializeAddressUnlockCondition

serializeAddressUnlockCondition(writeStream, object): void

Serialize the address unlock condition to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIAddressUnlockConditionThe object to serialize.

Returns

void


deserializeExpirationUnlockCondition

deserializeExpirationUnlockCondition(readStream): IExpirationUnlockCondition

Deserialize the expiration unlock condition from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IExpirationUnlockCondition

The deserialized object.


serializeExpirationUnlockCondition

serializeExpirationUnlockCondition(writeStream, object): void

Serialize the expiration unlock condition to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIExpirationUnlockConditionThe object to serialize.

Returns

void


deserializeGovernorAddressUnlockCondition

deserializeGovernorAddressUnlockCondition(readStream): IGovernorAddressUnlockCondition

Deserialize the governor address unlock condition from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IGovernorAddressUnlockCondition

The deserialized object.


serializeGovernorAddressUnlockCondition

serializeGovernorAddressUnlockCondition(writeStream, object): void

Serialize the governor address unlock condition to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIGovernorAddressUnlockConditionThe object to serialize.

Returns

void


deserializeImmutableAliasUnlockCondition

deserializeImmutableAliasUnlockCondition(readStream): IImmutableAliasUnlockCondition

Deserialize the immutable alias unlock condition from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IImmutableAliasUnlockCondition

The deserialized object.


serializeImmutableAliasUnlockCondition

serializeImmutableAliasUnlockCondition(writeStream, object): void

Serialize the immutable alias unlock condition to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIImmutableAliasUnlockConditionThe object to serialize.

Returns

void


deserializeStateControllerAddressUnlockCondition

deserializeStateControllerAddressUnlockCondition(readStream): IStateControllerAddressUnlockCondition

Deserialize the state controller address unlock condition from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IStateControllerAddressUnlockCondition

The deserialized object.


serializeStateControllerAddressUnlockCondition

serializeStateControllerAddressUnlockCondition(writeStream, object): void

Serialize the state controller address unlock condition to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIStateControllerAddressUnlockConditionThe object to serialize.

Returns

void


deserializeStorageDepositReturnUnlockCondition

deserializeStorageDepositReturnUnlockCondition(readStream): IStorageDepositReturnUnlockCondition

Deserialize the storage deposit return unlock condition from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IStorageDepositReturnUnlockCondition

The deserialized object.


serializeStorageDepositReturnUnlockCondition

serializeStorageDepositReturnUnlockCondition(writeStream, object): void

Serialize the storage deposit return unlock condition to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIStorageDepositReturnUnlockConditionThe object to serialize.

Returns

void


deserializeTimelockUnlockCondition

deserializeTimelockUnlockCondition(readStream): ITimelockUnlockCondition

Deserialize the timelock unlock condition from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ITimelockUnlockCondition

The deserialized object.


serializeTimelockUnlockCondition

serializeTimelockUnlockCondition(writeStream, object): void

Serialize the timelock unlock condition to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITimelockUnlockConditionThe object to serialize.

Returns

void


deserializeUnlockConditions

deserializeUnlockConditions(readStream): UnlockConditionTypes[]

Deserialize the unlock conditions from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

UnlockConditionTypes[]

The deserialized object.


serializeUnlockConditions

serializeUnlockConditions(writeStream, objects): void

Serialize the unlock conditions to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectsUnlockConditionTypes[]The objects to serialize.

Returns

void


deserializeUnlockCondition

deserializeUnlockCondition(readStream): UnlockConditionTypes

Deserialize the unlock condition from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

UnlockConditionTypes

The deserialized object.


serializeUnlockCondition

serializeUnlockCondition(writeStream, object): void

Serialize the unlock condition to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectITypeBase<number>The object to serialize.

Returns

void


deserializeAliasUnlock

deserializeAliasUnlock(readStream): IAliasUnlock

Deserialize the alias unlock from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IAliasUnlock

The deserialized object.


serializeAliasUnlock

serializeAliasUnlock(writeStream, object): void

Serialize the alias unlock to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIAliasUnlockThe object to serialize.

Returns

void


deserializeNftUnlock

deserializeNftUnlock(readStream): INftUnlock

Deserialize the nft unlock from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

INftUnlock

The deserialized object.


serializeNftUnlock

serializeNftUnlock(writeStream, object): void

Serialize the nft unlock to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectINftUnlockThe object to serialize.

Returns

void


deserializeReferenceUnlock

deserializeReferenceUnlock(readStream): IReferenceUnlock

Deserialize the reference unlock from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

IReferenceUnlock

The deserialized object.


serializeReferenceUnlock

serializeReferenceUnlock(writeStream, object): void

Serialize the reference unlock to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectIReferenceUnlockThe object to serialize.

Returns

void


deserializeSignatureUnlock

deserializeSignatureUnlock(readStream): ISignatureUnlock

Deserialize the signature unlock from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

ISignatureUnlock

The deserialized object.


serializeSignatureUnlock

serializeSignatureUnlock(writeStream, object): void

Serialize the signature unlock to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectISignatureUnlockThe object to serialize.

Returns

void


deserializeUnlocks

deserializeUnlocks(readStream): UnlockTypes[]

Deserialize the unlocks from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

UnlockTypes[]

The deserialized object.


serializeUnlocks

serializeUnlocks(writeStream, objects): void

Serialize the unlocks to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectsUnlockTypes[]The objects to serialize.

Returns

void


deserializeUnlock

deserializeUnlock(readStream): UnlockTypes

Deserialize the unlock from binary.

Parameters

NameTypeDescription
readStreamReadStreamThe stream to read the data from.

Returns

UnlockTypes

The deserialized object.


serializeUnlock

serializeUnlock(writeStream, object): void

Serialize the unlock to binary.

Parameters

NameTypeDescription
writeStreamWriteStreamThe stream to write the data to.
objectUnlockTypesThe object to serialize.

Returns

void


addressBalance

addressBalance(client, addressBech32): Promise<{}>

Get the balance for an address.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to get the information from.
addressBech32stringThe address to get the balances for.

Returns

Promise<{}>

The balance.


generateBip44Path

generateBip44Path(accountIndex, addressIndex, isInternal): Bip32Path

Generate a bip44 path based on all its parts.

Parameters

NameTypeDescription
accountIndexnumberThe account index.
addressIndexnumberThe address index.
isInternalbooleanIs this an internal address.

Returns

Bip32Path

The generated address.


generateBip44Address

generateBip44Address(generatorState): string

Generate addresses based on the account indexing style.

Parameters

NameTypeDescription
generatorStateIBip44GeneratorStateThe address state.

Returns

string

The key pair for the address.


getBalance

getBalance(client, seed, accountIndex, addressOptions?): Promise<BigInteger>

Get the balance for a list of addresses.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
seedISeedThe seed.
accountIndexnumberThe account index in the wallet.
addressOptions?ObjectOptional address configuration for balance address lookups.

Returns

Promise<BigInteger>

The balance.


getUnspentAddress

getUnspentAddress(client, seed, accountIndex, addressOptions?): Promise<{} | undefined>

Get the first unspent address.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
seedISeedThe seed to use for address generation.
accountIndexnumberThe account index in the wallet.
addressOptions?ObjectOptional address configuration for balance address lookups.

Returns

Promise<{} | undefined>

The first unspent address.


getUnspentAddresses

getUnspentAddresses(client, seed, accountIndex, addressOptions?): Promise<{}[]>

Get all the unspent addresses.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
seedISeedThe seed to use for address generation.
accountIndexnumberThe account index in the wallet.
addressOptions?ObjectOptional address configuration for balance address lookups.

Returns

Promise<{}[]>

All the unspent addresses.


getUnspentAddressesWithAddressGenerator

getUnspentAddressesWithAddressGenerator<T>(client, seed, initialAddressState, nextAddressPath, addressOptions?): Promise<{}[]>

Get all the unspent addresses using an address generator.

Type parameters

Name
T

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to get the addresses from.
seedISeedThe seed to use for address generation.
initialAddressStateTThe initial address state for calculating the addresses.
nextAddressPath(addressState: T) => stringCalculate the next address for inputs.
addressOptions?ObjectOptional address configuration for balance address lookups.

Returns

Promise<{}[]>

All the unspent addresses.


promote

promote(client, blockId): Promise<{}>

Promote an existing block.

Parameters

NameTypeDescription
clientstring | IClientThe clientor node endpoint to perform the promote with.
blockIdstringThe block to promote.

Returns

Promise<{}>

The id and block that were promoted.


reattach

reattach(client, blockId): Promise<{}>

Reattach an existing block.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to perform the reattach with.
blockIdstringThe block to reattach.

Returns

Promise<{}>

The id and block that were reattached.


retrieveData

retrieveData(client, blockId): Promise<{} | undefined>

Retrieve a data block.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to retrieve the data with.
blockIdstringThe block id of the data to get.

Returns

Promise<{} | undefined>

The block tag and data.


retry

retry(client, blockId): Promise<{}>

Retry an existing block either by promoting or reattaching.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to perform the retry with.
blockIdstringThe block to retry.

Returns

Promise<{}>

The id and block that were retried.


send

send(client, seed, accountIndex, addressBech32, amount, taggedData?, addressOptions?): Promise<{}>

Send a transfer from the balance on the seed to a single output.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
seedISeedThe seed to use for address generation.
accountIndexnumberThe account index in the wallet.
addressBech32stringThe address to send the funds to in bech32 format.
amountBigIntegerThe amount to send.
taggedData?ObjectOptional tagged data to associate with the transaction.
addressOptions?ObjectOptional address configuration for balance address lookups.

Returns

Promise<{}>

The id of the block created and the contructed block.


sendEd25519

sendEd25519(client, seed, accountIndex, addressEd25519, amount, taggedData?, addressOptions?): Promise<{}>

Send a transfer from the balance on the seed to a single output.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
seedISeedThe seed to use for address generation.
accountIndexnumberThe account index in the wallet.
addressEd25519stringThe address to send the funds to in ed25519 format.
amountBigIntegerThe amount to send.
taggedData?ObjectOptional tagged data to associate with the transaction.
addressOptions?ObjectOptional address configuration for balance address lookups.

Returns

Promise<{}>

The id of the block created and the contructed block.


sendMultiple

sendMultiple(client, seed, accountIndex, outputs, taggedData?, addressOptions?): Promise<{}>

Send a transfer from the balance on the seed to multiple outputs.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
seedISeedThe seed to use for address generation.
accountIndexnumberThe account index in the wallet.
outputs{}[]The address to send the funds to in bech32 format and amounts.
taggedData?ObjectOptional tagged data to associate with the transaction.
addressOptions?ObjectOptional address configuration for balance address lookups.

Returns

Promise<{}>

The id of the block created and the contructed block.


sendMultipleEd25519

sendMultipleEd25519(client, seed, accountIndex, outputs, taggedData?, addressOptions?): Promise<{}>

Send a transfer from the balance on the seed.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
seedISeedThe seed to use for address generation.
accountIndexnumberThe account index in the wallet.
outputs{}[]The outputs including address to send the funds to in ed25519 format and amount.
taggedData?ObjectOptional tagged data to associate with the transaction.
addressOptions?ObjectOptional address configuration for balance address lookups.

Returns

Promise<{}>

The id of the block created and the contructed block.


sendWithAddressGenerator

sendWithAddressGenerator<T>(client, seed, initialAddressState, nextAddressPath, outputs, taggedData?, zeroCount?): Promise<{}>

Send a transfer using account based indexing for the inputs.

Type parameters

Name
T

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
seedISeedThe seed to use for address generation.
initialAddressStateTThe initial address state for calculating the addresses.
nextAddressPath(addressState: T) => stringCalculate the next address for inputs.
outputs{}[]The address to send the funds to in bech32 format and amounts.
taggedData?ObjectOptional tagged data to associate with the transaction.
zeroCount?numberThe number of addresses with 0 balance during lookup before aborting.

Returns

Promise<{}>

The id of the block created and the contructed block.


calculateInputs

calculateInputs<T>(client, seed, initialAddressState, nextAddressPath, outputs, zeroCount?): Promise<{}[]>

Calculate the inputs from the seed and basePath.

Type parameters

Name
T

Parameters

NameTypeDefault valueDescription
clientstring | IClientundefinedThe client or node endpoint to calculate the inputs with.
seedISeedundefinedThe seed to use for address generation.
initialAddressStateTundefinedThe initial address state for calculating the addresses.
nextAddressPath(addressState: T) => stringundefinedCalculate the next address for inputs.
outputs{}[]undefinedThe outputs to send.
zeroCountnumber5Abort when the number of zero balances is exceeded.

Returns

Promise<{}[]>

The id of the block created and the contructed block.


sendAdvanced

sendAdvanced(client, inputsAndSignatureKeyPairs, outputs, taggedData?): Promise<{}>

Send a transfer from the balance on the seed.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the transfer with.
inputsAndSignatureKeyPairs{}[]The inputs with the signature key pairs needed to sign transfers.
outputs{}[]The outputs to send.
taggedData?ObjectOptional tagged data to associate with the transaction.

Returns

Promise<{}>

The id of the block created and the remainder address if one was needed.


buildTransactionPayload

buildTransactionPayload(networkId, inputsAndSignatureKeyPairs, outputs, taggedData?): ITransactionPayload

Build a transaction payload.

Parameters

NameTypeDescription
networkIdstringThe network id we are sending the payload on.
inputsAndSignatureKeyPairs{}[]The inputs with the signature key pairs needed to sign transfers.
outputs{}[]The outputs to send.
taggedData?ObjectOptional tagged data to associate with the transaction.

Returns

ITransactionPayload

The transaction payload.


sendData

sendData(client, tag?, data?): Promise<{}>

Send a data block.

Parameters

NameTypeDescription
clientstring | IClientThe client or node endpoint to send the data with.
tag?string | Uint8ArrayThe tag for the data.
data?string | Uint8ArrayThe data as either UTF8 text or Uint8Array bytes.

Returns

Promise<{}>

The id of the block created and the block.


setLogger

setLogger(log): void

Set the logger for output.

Parameters

NameTypeDescription
log(message: string, data?: unknown) => voidThe logger.

Returns

void


logRoutes

logRoutes(prefix, routes): void

Log the routes of the node.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
routesIRoutesResponseThe available routes.

Returns

void


logInfo

logInfo(prefix, info): void

Log the node information.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
infoINodeInfoThe info to log.

Returns

void


logTips

logTips(prefix, tipsResponse): void

Log the tips information.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
tipsResponseITipsResponseThe tips to log.

Returns

void


logBlock

logBlock(prefix, block): void

Log a block to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
blockIBlockThe block to log.

Returns

void


logBlockMetadata

logBlockMetadata(prefix, blockMetadata): void

Log the block metadata to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
blockMetadataIBlockMetadataThe blockMetadata to log.

Returns

void


logPayload

logPayload(prefix, payload?): void

Log a block to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
payload?PayloadTypesThe payload.

Returns

void


logTransactionPayload

logTransactionPayload(prefix, payload?): void

Log a transaction payload to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
payload?ITransactionPayloadThe payload.

Returns

void


logTaggedDataPayload

logTaggedDataPayload(prefix, payload?): void

Log a tagged data payload to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
payload?ITaggedDataPayloadThe payload.

Returns

void


logMilestonePayload

logMilestonePayload(prefix, payload?): void

Log a milestone payload to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
payload?IMilestonePayloadThe payload.

Returns

void


logMilestoneOptions

logMilestoneOptions(prefix, milestoneOptions?): void

Log milestone options to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
milestoneOptions?MilestoneOptionTypes[]The milestone options.

Returns

void


logMilestoneOption

logMilestoneOption(prefix, milestoneOption): void

Log milestone option to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
milestoneOptionMilestoneOptionTypesThe milestone option.

Returns

void


logReceiptMilestoneOption

logReceiptMilestoneOption(prefix, option?): void

Log a receipt milestone option to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
option?IReceiptMilestoneOptionThe option.

Returns

void


logProtocolParamsMilestoneOption

logProtocolParamsMilestoneOption(prefix, option?): void

Log a protocol params milestone option to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
option?IProtocolParamsMilestoneOptionThe option.

Returns

void


logTreasuryTransactionPayload

logTreasuryTransactionPayload(prefix, payload?): void

Log a treasury transaction payload to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
payload?ITreasuryTransactionPayloadThe payload.

Returns

void


logAddress

logAddress(prefix, address?): void

Log an address to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
address?AddressTypesThe address to log.

Returns

void


logSignature

logSignature(prefix, signature?): void

Log signature to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
signature?IEd25519SignatureThe signature to log.

Returns

void


logInput

logInput(prefix, input?): void

Log input to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
input?InputTypesThe input to log.

Returns

void


logOutput

logOutput(prefix, output?): void

Log output to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
output?OutputTypesThe output to log.

Returns

void


logUnlock

logUnlock(prefix, unlock?): void

Log unlock to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
unlock?UnlockTypesThe unlock to log.

Returns

void


logFunds

logFunds(prefix, fund?): void

Log fund to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
fund?IMigratedFundsThe fund to log.

Returns

void


logNativeTokens

logNativeTokens(prefix, nativeTokens): void

Log native tokens to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
nativeTokensundefined | INativeToken[]The native tokens.

Returns

void


logTokenScheme

logTokenScheme(prefix, tokenScheme): void

Log token scheme to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
tokenSchemeISimpleTokenSchemeThe token scheme.

Returns

void


logFeatures

logFeatures(prefix, features): void

Log featurew to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
featuresundefined | FeatureTypes[]The features.

Returns

void


logImmutableFeatures

logImmutableFeatures(prefix, immutableFeatures): void

Log immutable featuress to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
immutableFeaturesundefined | FeatureTypes[]The features.

Returns

void


logFeature

logFeature(prefix, feature): void

Log feature to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
featureFeatureTypesThe feature.

Returns

void


logUnlockConditions

logUnlockConditions(prefix, unlockConditions): void

Log unlock conditions to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
unlockConditionsUnlockConditionTypes[]The unlock conditions.

Returns

void


logUnlockCondition

logUnlockCondition(prefix, unlockCondition): void

Log feature block to the console.

Parameters

NameTypeDescription
prefixstringThe prefix for the output.
unlockConditionUnlockConditionTypesThe unlock condition.

Returns

void


milestoneIdFromMilestonePayload

milestoneIdFromMilestonePayload(payload): string

Compute a milestoneId from a milestone payload.

Parameters

NameTypeDescription
payloadIMilestonePayloadThe milestone payload.

Returns

string

The milestone id hex prefixed string.


blockIdFromMilestonePayload

blockIdFromMilestonePayload(protocolVersion, payload): string

Compute a blockId from a milestone payload.

Parameters

NameTypeDescription
protocolVersionnumberThe protocol version to use.
payloadIMilestonePayloadThe milestone payload.

Returns

string

The blockId of the block with the milestone payload.

Type Aliases

AddressTypes

Ƭ AddressTypes: IEd25519Address | IAliasAddress | INftAddress

All of the address types.


FeatureTypes

Ƭ FeatureTypes: ISenderFeature | IIssuerFeature | IMetadataFeature | ITagFeature

All of the feature block types.


InputTypes

Ƭ InputTypes: IUTXOInput | ITreasuryInput

All of the input types.


LedgerInclusionState

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

The different states of ledger inclusion.


Magnitudes

Ƭ Magnitudes: "P" | "T" | "G" | "M" | "K" | ""

Magnitudes for the numbers.


MilestoneOptionTypes

Ƭ MilestoneOptionTypes: IReceiptMilestoneOption | IProtocolParamsMilestoneOption

All of the milestone option types.


OutputTypes

Ƭ OutputTypes: ITreasuryOutput | IBasicOutput | IAliasOutput | IFoundryOutput | INftOutput

All of the output types.


PayloadTypes

Ƭ PayloadTypes: ITransactionPayload | IMilestonePayload | ITreasuryTransactionPayload | ITaggedDataPayload

All of the payload types.


SignatureTypes

Ƭ SignatureTypes: IEd25519Signature

All of the signature types.


TokenSchemeTypes

Ƭ TokenSchemeTypes: ISimpleTokenScheme

All of the token scheme types.


UnlockConditionTypes

Ƭ UnlockConditionTypes: IAddressUnlockCondition | IStorageDepositReturnUnlockCondition | ITimelockUnlockCondition | IExpirationUnlockCondition | IStateControllerAddressUnlockCondition | IGovernorAddressUnlockCondition | IImmutableAliasUnlockCondition

All of the unlock condition types.


UnlockTypes

Ƭ UnlockTypes: ISignatureUnlock | IReferenceUnlock | IAliasUnlock | INftUnlock

All of the unlock types.