Skip to main content

Module 0x107a::alias

use 0x1::option; use 0x2::object;

Resource Alias

The persisted Alias object from Stardust, without tokens and assets. Outputs owned the AliasID/Address in Stardust will be sent to this object and have to be received via this object once extracted from AliasOutput.

struct Alias has store, key

Fields
id: object::UID

The ID of the Alias = hash of the Output ID that created the Alias Output in Stardust. This is the AliasID from Stardust.

legacy_state_controller: address

The last State Controller address assigned before the migration.

state_index: u32

A counter increased by 1 every time the alias was state transitioned.

state_metadata: option::Option<vector<u8>>

State metadata that can be used to store additional information.

sender: option::Option<address>

The sender feature.

metadata: option::Option<vector<u8>>

The metadata feature.

immutable_issuer: option::Option<address>

The immutable issuer feature.

immutable_metadata: option::Option<vector<u8>>

The immutable metadata feature.

Function destroy

Destroy the Alias object, equivalent to burning an Alias Output in Stardust.

public fun destroy(self: alias::Alias)

Implementation

public fun destroy(self: Alias) { let Alias { id, legacy_state_controller: _, state_index: _, state_metadata: _, sender: _, metadata: _, immutable_issuer: _, immutable_metadata: _, } = self;

object::delete(id); }

Function legacy_state_controller

Get the Alias's legacy_state_controller.

public fun legacy_state_controller(self: &alias::Alias): &address

Implementation

public fun legacy_state_controller(self: &Alias): &address { &self.legacy_state_controller }

Function state_index

Get the Alias's state_index.

public fun state_index(self: &alias::Alias): u32

Implementation

public fun state_index(self: &Alias): u32 { self.state_index }

Function state_metadata

Get the Alias's state_metadata.

public fun state_metadata(self: &alias::Alias): &option::Option<vector<u8>>

Implementation

public fun state_metadata(self: &Alias): &Option<vector<u8>> { &self.state_metadata }

Function sender

Get the Alias's sender.

public fun sender(self: &alias::Alias): &option::Option<address>

Implementation

public fun sender(self: &Alias): &Option<address> { &self.sender }

Function metadata

Get the Alias's metadata.

public fun metadata(self: &alias::Alias): &option::Option<vector<u8>>

Implementation

public fun metadata(self: &Alias): &Option<vector<u8>> { &self.metadata }

Function immutable_issuer

Get the Alias's immutable_sender.

public fun immutable_issuer(self: &alias::Alias): &option::Option<address>

Implementation

public fun immutable_issuer(self: &Alias): &Option<address> { &self.immutable_issuer }

Function immutable_metadata

Get the Alias's immutable_metadata.

public fun immutable_metadata(self: &alias::Alias): &option::Option<vector<u8>>

Implementation

public fun immutable_metadata(self: &Alias): &Option<vector<u8>> { &self.immutable_metadata }

Function id

Get the Alias's id.

public(friend) fun id(self: &mut alias::Alias): &mut object::UID

Implementation

public(package) fun id(self: &mut Alias): &mut UID { &mut self.id }