Search Results for

    Show / Hide Table of Contents

    Struct Address

    A public key for an Algorand account.

    Namespace: Algorand.Unity
    Assembly: cs.temp.dll.dll
    Syntax
    [Serializable]
    [AlgoApiFormatter(typeof(AddressFormatter))]
    public struct Address : IByteArray, IEquatable<Address>

    Fields

    Empty

    An empty address.

    Declaration
    public static readonly Address Empty
    Field Value
    Type Description
    Address

    SizeBytes

    Size of an Algorand Address in Bytes.

    Declaration
    public const int SizeBytes = default(int)
    Field Value
    Type Description
    Int32

    StringLength

    Length of a formatted Address string.

    Declaration
    public const int StringLength = 58
    Field Value
    Type Description
    Int32

    Properties

    Item[Int32]

    The byte of this address at a given index.

    Declaration
    public byte this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index

    An index in the range [0, Length).

    Property Value
    Type Description
    Byte

    Length

    The length of an Address in Bytes = 32.

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    Int32

    Methods

    Equals(Address)

    Declaration
    public bool Equals(Address other)
    Parameters
    Type Name Description
    Address other
    Returns
    Type Description
    Boolean

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    FromPublicKey(Ed25519.PublicKey)

    Gets the address representation of an ed25519 public key.

    Declaration
    public static Address FromPublicKey(Ed25519.PublicKey publicKey)
    Parameters
    Type Name Description
    Ed25519.PublicKey publicKey
    Returns
    Type Description
    Address

    FromString(String)

    Get an address from a string. This will throw an error if the string isn't formatter properly.

    Declaration
    public static Address FromString(string addressString)
    Parameters
    Type Name Description
    String addressString
    Returns
    Type Description
    Address
    Exceptions
    Type Condition
    ArgumentException

    Thrown if the address has an invalid checksum or is not 58 chars long.

    FromString<TString>(TString)

    Get an address from a string. This will throw an error if the string isn't formatter properly.

    Declaration
    public static Address FromString<TString>(TString s)
        where TString : struct, IUTF8Bytes, INativeList<byte>
    Parameters
    Type Name Description
    TString s
    Returns
    Type Description
    Address
    Type Parameters
    Name Description
    TString
    Exceptions
    Type Condition
    ArgumentException

    Thrown if the address has an invalid checksum or is not 58 chars long.

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    GetUnsafePtr()

    Get the pointer to this struct.

    Declaration
    public void *GetUnsafePtr()
    Returns
    Type Description
    Void*

    A pointer to this struct.

    IsAddressString(String)

    Determines if the given string is a correctly formatted address.

    Declaration
    public static bool IsAddressString(string s)
    Parameters
    Type Name Description
    String s
    Returns
    Type Description
    Boolean

    IsAddressString<TString>(TString)

    Determines if the given string is a correctly formatted address.

    Declaration
    public static bool IsAddressString<TString>(TString s)
        where TString : struct, IUTF8Bytes, INativeList<byte>
    Parameters
    Type Name Description
    TString s
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    TString

    ToFixedString()

    Converts this address to a fixed string base32 representation with padding trimmed.

    Declaration
    public FixedString128Bytes ToFixedString()
    Returns
    Type Description
    FixedString128Bytes

    ToPublicKey()

    Returns the ed25519 public key this address represents.

    Declaration
    public Ed25519.PublicKey ToPublicKey()
    Returns
    Type Description
    Ed25519.PublicKey

    ToString()

    Converts this address to its base32 string representation with trimmed padding.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()

    TryParse(String, out Address)

    Try to parse a string for an address.

    Declaration
    public static AddressFormatError TryParse(string s, out Address address)
    Parameters
    Type Name Description
    String s
    Address address
    Returns
    Type Description
    AddressFormatError

    TryParse<TString>(TString, out Address)

    Try to parse a string for an address.

    Declaration
    public static AddressFormatError TryParse<TString>(TString s, out Address address)
        where TString : struct, IUTF8Bytes, INativeList<byte>
    Parameters
    Type Name Description
    TString s
    Address address
    Returns
    Type Description
    AddressFormatError
    Type Parameters
    Name Description
    TString

    Operators

    Equality(Address, Address)

    Declaration
    public static bool operator ==(in Address a1, in Address a2)
    Parameters
    Type Name Description
    Address a1
    Address a2
    Returns
    Type Description
    Boolean

    Implicit(Address to Ed25519.PublicKey)

    Declaration
    public static implicit operator Ed25519.PublicKey(Address address)
    Parameters
    Type Name Description
    Address address
    Returns
    Type Description
    Ed25519.PublicKey

    Implicit(Address to String)

    Declaration
    public static implicit operator string (Address addr)
    Parameters
    Type Name Description
    Address addr
    Returns
    Type Description
    String

    Implicit(Ed25519.PublicKey to Address)

    Declaration
    public static implicit operator Address(Ed25519.PublicKey publicKey)
    Parameters
    Type Name Description
    Ed25519.PublicKey publicKey
    Returns
    Type Description
    Address

    Implicit(Sha512_256_Hash to Address)

    Declaration
    public static implicit operator Address(Sha512_256_Hash checksum)
    Parameters
    Type Name Description
    Sha512_256_Hash checksum
    Returns
    Type Description
    Address

    Implicit(String to Address)

    Declaration
    public static implicit operator Address(string s)
    Parameters
    Type Name Description
    String s
    Returns
    Type Description
    Address

    Inequality(Address, Address)

    Declaration
    public static bool operator !=(in Address a1, in Address a2)
    Parameters
    Type Name Description
    Address a1
    Address a2
    Returns
    Type Description
    Boolean
    ☀
    ☾
    In This Article
    Back to top
    Generated by DocFX
    ☀
    ☾