Aptos Unity SDK
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Aptos.Accounts.AccountAddress Class Reference

Represents an Aptos account address. More details can her found here. More...

Public Member Functions

 AccountAddress (byte[] address)
 Initializes an account address by setting a 32-byte representation of an address.
 
override string ToString ()
 Represent an account address in a way that is compliant with the v1 address standard.The standard is defined as part of AIP-40, read more here: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.
 
void Serialize (Serialization serializer)
 Reference implementation to BCS can be found here.
More details on creating a BCS signed transaction can be found here.
 
TypeTag Variant ()
 Returns the type of type tag.
 
object GetValue ()
 Gets the internal value.
 
override bool Equals (object other)
 
override int GetHashCode ()
 
- Public Member Functions inherited from Aptos.BCS.ISerializableTag
void SerializeTag (Serialization serializer)
 Serializes the type tag using it's own serializaton method.
 

Static Public Member Functions

static AccountAddress FromHex (string address)
 Returns an AccountAddress object from a hexadecimal Address.
 
static AccountAddress FromKey (byte[] publicKey)
 Generate an AccountAddress object from a given public key, byte array.
 
static AccountAddress FromMultiEd25519 (MultiPublicKey keys)
 Create an AccountAddress instance from a MultiPublicKey.
 
static AccountAddress ForResourceAccount (AccountAddress creator, byte[] seed)
 Create an AccountAddress instance for a resource account.
 
static AccountAddress ForGuidObject (AccountAddress creator, int creationNum)
 Generates an AccountAddress for a GUID object.
 
static AccountAddress ForNamedObject (AccountAddress creator, byte[] seed)
 Create an AccountAddress instance for a named object.
 
static AccountAddress ForNamedToken (AccountAddress creator, string collectionName, string tokenName)
 Generates an AccountAddress for a named token by concatenating the collectionName, the tokenName, and the separator "::" as a Data and calling the forNamedObject function with the resulting Data as the seed.
 
static AccountAddress ForNamedCollection (AccountAddress creator, string collectionName)
 Derive an AccountAddress for a named collection.
 
static AccountAddress Deserialize (Deserialization deserializer)
 Deserializes a byte array hosted inside the Deserializer.
 
- Static Public Member Functions inherited from Aptos.BCS.ISerializableTag
static ISerializableTag DeserializeTag (Deserialization deserializer)
 Deserialize a tag based on it's type.
 

Detailed Description

Represents an Aptos account address. More details can her found here.

Constructor & Destructor Documentation

◆ AccountAddress()

Aptos.Accounts.AccountAddress.AccountAddress ( byte[]  address)
inline

Initializes an account address by setting a 32-byte representation of an address.

Parameters
addressByte array representing address.

Member Function Documentation

◆ Deserialize()

static AccountAddress Aptos.Accounts.AccountAddress.Deserialize ( Deserialization  deserializer)
inlinestatic

Deserializes a byte array hosted inside the Deserializer.

Parameters
deserializer
Returns

Implements Aptos.BCS.ISerializableTag.

◆ ForGuidObject()

static AccountAddress Aptos.Accounts.AccountAddress.ForGuidObject ( AccountAddress  creator,
int  creationNum 
)
inlinestatic

Generates an AccountAddress for a GUID object.

This function takes in a creator address and a creationNum which it uses to serialize into an array of bytes. It then appends the creator address and deriveObjectAddressFromGuid to this array. It uses this byte array to compute a SHA-256 hash. This hash is then returned as a new AccountAddress.

Parameters
creatorThe account address of the creator.
creationNumThe creation number of the object.
Returns
An AccountAddress which is generated for a GUID object.

◆ ForNamedCollection()

static AccountAddress Aptos.Accounts.AccountAddress.ForNamedCollection ( AccountAddress  creator,
string  collectionName 
)
inlinestatic

Derive an AccountAddress for a named collection.

This function takes the creator's AccountAddress and the name of the collection as a String. The collection name is then converted to data using UTF-8 encoding. The forNamedObject function is called with the creator's address and the collection name data as the seed. This returns an AccountAddress derived from the creator's address and collection name seed, which represents the named collection.

Parameters
creatorThe creator's AccountAddress.
collectionNameThe name of the collection as a String.
Returns
An AccountAddress that represents the named collection.

◆ ForNamedObject()

static AccountAddress Aptos.Accounts.AccountAddress.ForNamedObject ( AccountAddress  creator,
byte[]  seed 
)
inlinestatic

Create an AccountAddress instance for a named object.

This function creates an AccountAddress instance for a named object given the creator's address and a seed value. The function generates a new address by concatenating the byte representation of the creator's address, the provided seed value, and the DERIVE_OBJECT_ADDRESS_FROM_SEED authorization key scheme value. It then computes the SHA3-256 hash of the resulting byte array to generate a new AccountAddress instance.

Parameters
creatorAn AccountAddress instance representing the address of the account that will create the named object.
seedA byte array used to create a unique named object.
Returns
An AccountAddress instance representing the newly created named object.

◆ ForNamedToken()

static AccountAddress Aptos.Accounts.AccountAddress.ForNamedToken ( AccountAddress  creator,
string  collectionName,
string  tokenName 
)
inlinestatic

Generates an AccountAddress for a named token by concatenating the collectionName, the tokenName, and the separator "::" as a Data and calling the forNamedObject function with the resulting Data as the seed.

Parameters
creatorThe AccountAddress of the account that creates the token./param>
Parameters
collectionNameA String that represents the name of the collection to which the token belongs.
tokenNameA String that represents the name of the token.
Returns
An AccountAddress object that represents the named token.

◆ ForResourceAccount()

static AccountAddress Aptos.Accounts.AccountAddress.ForResourceAccount ( AccountAddress  creator,
byte[]  seed 
)
inlinestatic

Create an AccountAddress instance for a resource account.

This function creates an AccountAddress instance for a resource account given the creator's address and a seed value. The function generates a new address by concatenating the byte representation of the creator's address, the provided seed value, and the DERIVE_RESOURCE_ACCOUNT_ADDRESS authorization key scheme value. It then computes the SHA3-256 hash of the resulting byte array to generate a new AccountAddress instance.

Parameters
creatorAn AccountAddress instance representing the address of the account that will create the resource account.
seedA byte array used to create a unique resource account.
Returns
An AccountAddress instance representing the newly created resource account.

◆ FromHex()

static AccountAddress Aptos.Accounts.AccountAddress.FromHex ( string  address)
inlinestatic

Returns an AccountAddress object from a hexadecimal Address.

Parameters
addressHexadecimal representation of an Address.
Returns
An account address object

◆ FromKey()

static AccountAddress Aptos.Accounts.AccountAddress.FromKey ( byte[]  publicKey)
inlinestatic

Generate an AccountAddress object from a given public key, byte array.

Parameters
publicKeyByte array representing a public key.
Returns
An account address object.

◆ FromMultiEd25519()

static AccountAddress Aptos.Accounts.AccountAddress.FromMultiEd25519 ( MultiPublicKey  keys)
inlinestatic

Create an AccountAddress instance from a MultiPublicKey.

This function creates an AccountAddress instance from a provided MultiPublicKey. The function generates a new address by appending the Multi ED25519 authorization key scheme value to the byte representation of the provided MultiPublicKey, and then computes the SHA3-256 hash of the resulting byte array. The resulting hash is used to create a new AccountAddress instance.

Parameters
keysA MultiPublicKey instance representing the multiple public keys to create the AccountAddress instance from.
Returns
An AccountAddress instance created from the provided MultiPublicKey.

◆ GetValue()

object Aptos.Accounts.AccountAddress.GetValue ( )
inline

Gets the internal value.

Returns

Implements Aptos.BCS.ISerializableTag.

◆ Serialize()

void Aptos.Accounts.AccountAddress.Serialize ( Serialization  serializer)
inline

Reference implementation to BCS can be found here.
More details on creating a BCS signed transaction can be found here.

Binary Canonical Serialization (BCS) is a serialization format applied to the raw (unsigned) transaction. See BCS for a description of the design goals of BCS. BCS is not a self-describing format.As such, in order to deserialize a message, one must know the message type and layout ahead of time.

Implements Aptos.BCS.ISerializable.

◆ ToString()

override string Aptos.Accounts.AccountAddress.ToString ( )
inline

Represent an account address in a way that is compliant with the v1 address standard.The standard is defined as part of AIP-40, read more here: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.

Returns
String representation of account address

◆ Variant()

TypeTag Aptos.Accounts.AccountAddress.Variant ( )
inline

Returns the type of type tag.

Returns
A TypeTag enum.

Implements Aptos.BCS.ISerializableTag.


The documentation for this class was generated from the following file: