Struct Address
A public key for an Algorand account.
Assembly: cs.temp.dll.dll
Syntax
[Serializable]
[AlgoApiFormatter(typeof(AddressFormatter))]
public struct Address : IByteArray, IEquatable<Address>
Fields
Empty
Declaration
public static readonly Address Empty
Field Value
SizeBytes
Size of an Algorand Address in Bytes.
Declaration
public const int SizeBytes = default(int)
Field Value
StringLength
Length of a formatted Address string.
Declaration
public const int StringLength = 58
Field Value
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
Length
The length of an Address in Bytes = 32.
Declaration
public int Length { get; }
Property Value
Methods
Equals(Address)
Declaration
public bool Equals(Address other)
Parameters
Type |
Name |
Description |
Address |
other |
|
Returns
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Overrides
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
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
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 Parameters
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
Overrides
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
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 Parameters
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
Overrides
TryParse(String, out Address)
Try to parse a string for an address.
Declaration
public static AddressFormatError TryParse(string s, out Address address)
Parameters
Returns
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 Parameters
Operators
Equality(Address, Address)
Declaration
public static bool operator ==(in Address a1, in Address a2)
Parameters
Returns
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
Returns
Implicit(Ed25519.PublicKey to Address)
Declaration
public static implicit operator Address(Ed25519.PublicKey publicKey)
Parameters
Type |
Name |
Description |
Ed25519.PublicKey |
publicKey |
|
Returns
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
Implicit(String to Address)
Declaration
public static implicit operator Address(string s)
Parameters
Type |
Name |
Description |
String |
s |
|
Returns
Inequality(Address, Address)
Declaration
public static bool operator !=(in Address a1, in Address a2)
Parameters
Returns