Class Address
Address represents a serializable 32-byte length Algorand address.
Inheritance
Inherited Members
Namespace: Algorand
Assembly: Algorand.dll
Syntax
[JsonConverter(typeof(BytesConverter))]
public class Address
  Constructors
| Improve this Doc 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
| Improve this Doc 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 | 
Properties
| Improve this Doc View SourceBytes
the underlying bytes
Declaration
public byte[] Bytes { get; }
  Property Value
| Type | Description | 
|---|---|
| byte[] | 
Methods
| Improve this Doc 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)
Declaration
public override bool Equals(object obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| object | obj | 
Returns
| Type | Description | 
|---|---|
| bool | 
Overrides
ForApplication(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()
Declaration
public override int GetHashCode()
  Returns
| Type | Description | 
|---|---|
| int | 
Overrides
IsValid(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()
Declaration
public override string ToString()
  Returns
| Type | Description | 
|---|---|
| string | 
Overrides
VerifyBytes(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  |