Class Address
Address represents a serializable 32-byte length Algorand address.
Inherited Members
Namespace: Algorand
Assembly: Algorand.dll
Syntax
[JsonConverter(typeof(BytesConverter))]
[MessagePackObject(false)]
[MessagePackFormatter(typeof(AddressFormatterMsgPack))]
public class Address
Constructors
| Edit this page View SourceAddress()
default values for serializer to ignore
Declaration
public Address()
Address(byte[])
Create a new address from a byte array.
Declaration
[JsonConstructor]
public Address(byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes | array of 32 bytes |
Address(string)
Create a new address from an encoded string(encoded by encodeAsString)
Declaration
public Address(string encodedAddress)
Parameters
| Type | Name | Description |
|---|---|---|
| string | encodedAddress | Encoded Address |
Fields
| Edit this page View SourceLEN_BYTES
The length of an address. Equal to the size of a SHA256 checksum.
Declaration
public const int LEN_BYTES = 32
Field Value
| Type | Description |
|---|---|
| int |
ZERO_ADDRESS
Declaration
public static readonly Address ZERO_ADDRESS
Field Value
| Type | Description |
|---|---|
| Address |
Properties
| Edit this page View SourceBytes
the underlying bytes
Declaration
[IgnoreMember]
public byte[] Bytes { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
Methods
| Edit this page View SourceEncodeAsString()
EncodeAsString converts the address to a human-readable representation, with a 4-byte checksum appended at the end, using SHA256. Note that string representations of addresses generated by different SDKs may not be compatible.
Declaration
public string EncodeAsString()
Returns
| Type | Description |
|---|---|
| string | the encoded address string |
Equals(object?)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
| Edit this page View SourceForApplication(ulong)
Get the escrow address of an application.
Declaration
public static Address ForApplication(ulong appID)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | appID | appID The ID of the application |
Returns
| Type | Description |
|---|---|
| Address | The address corresponding to that application's escrow account. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
| Edit this page View SourceIsValid(string)
check if the address is valid
Declaration
public static bool IsValid(string encodedAddress)
Parameters
| Type | Name | Description |
|---|---|---|
| string | encodedAddress | Address |
Returns
| Type | Description |
|---|---|
| bool | valid or not |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
| Edit this page View SourceVerifyBytes(byte[], Signature)
verifyBytes verifies that the signature for the message is valid for the public key. The message should have been prepended with "MX" when signing.
Declaration
public bool VerifyBytes(byte[] message, Signature signature)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | message | the message that was signed |
| Signature | signature | signature |
Returns
| Type | Description |
|---|---|
| bool | true if the signature is valid |
Operators
| Edit this page View Sourceoperator ==(Address, Address)
For == equality
Declaration
public static bool operator ==(Address a1, Address a2)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | a1 | |
| Address | a2 |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(Address, Address)
For != equality
Declaration
public static bool operator !=(Address a1, Address a2)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | a1 | |
| Address | a2 |
Returns
| Type | Description |
|---|---|
| bool |