Skip to main content
Version: 1.3

Class: IotaIdentityClient

iota_identity_client.IotaIdentityClient

Provides operations for IOTA DID Documents with Alias Outputs.

Implements

Table of contents

Methods

Methods

newDidOutput

newDidOutput(address, document, rentStructure?): Promise\<AliasOutput>

Create a DID with a new Alias Output containing the given document.

The address will be set as the state controller and governor unlock conditions. The minimum required token deposit amount will be set according to the given rent_structure, which will be fetched from the node if not provided. The returned Alias Output can be further customized before publication, if desired.

NOTE: this does not publish the Alias Output.

Parameters

NameType
addressAddress
documentIotaDocument
rentStructure?IRent

Returns

Promise\<AliasOutput>


updateDidOutput

updateDidOutput(document): Promise\<AliasOutput>

Fetches the associated Alias Output and updates it with document in its state metadata. The storage deposit on the output is left unchanged. If the size of the document increased, the amount should be increased manually.

NOTE: this does not publish the updated Alias Output.

Parameters

NameType
documentIotaDocument

Returns

Promise\<AliasOutput>


deactivateDidOutput

deactivateDidOutput(did): Promise\<AliasOutput>

Removes the DID document from the state metadata of its Alias Output, effectively deactivating it. The storage deposit on the output is left unchanged, and should be reallocated manually.

Deactivating does not destroy the output. Hence, it can be re-activated by publishing an update containing a DID document.

NOTE: this does not publish the updated Alias Output.

Parameters

NameType
didIotaDID

Returns

Promise\<AliasOutput>


resolveDid

resolveDid(did): Promise\<IotaDocument>

Resolve a IotaDocument. Returns an empty, deactivated document if the state metadata of the Alias Output is empty.

Parameters

NameType
didIotaDID

Returns

Promise\<IotaDocument>


resolveDidOutput

resolveDidOutput(did): Promise\<AliasOutput>

Fetches the Alias Output associated with the given DID.

Parameters

NameType
didIotaDID

Returns

Promise\<AliasOutput>


publishDidOutput

publishDidOutput(secretManager, aliasOutput): Promise\<IotaDocument>

Publish the given aliasOutput with the provided secretManager, and returns the DID document extracted from the published block.

Note that only the state controller of an Alias Output is allowed to update its state. This will attempt to move tokens to or from the state controller address to match the storage deposit amount specified on aliasOutput.

This method modifies the on-ledger state.

Parameters

NameType
secretManagerSecretManagerType
aliasOutputAliasOutput

Returns

Promise\<IotaDocument>


deleteDidOutput

deleteDidOutput(secretManager, address, did): Promise\<void>

Destroy the Alias Output containing the given did, sending its tokens to a new Basic Output unlockable by the given address.

Note that only the governor of an Alias Output is allowed to destroy it.

WARNING

This destroys the Alias Output and DID document, rendering them permanently unrecoverable.

Parameters

NameType
secretManagerSecretManagerType
addressAddress
didIotaDID

Returns

Promise\<void>