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 |
---|---|---|
System.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 |
---|---|---|
System.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 |
---|---|
System.Int32 |
Properties
| Improve this Doc View SourceBytes
the underlying bytes
Declaration
public byte[] Bytes { get; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.String | the encoded address string |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
IsValid(String)
check if the address is valid
Declaration
public static bool IsValid(string encodedAddress)
Parameters
Type | Name | Description |
---|---|---|
System.String | encodedAddress | Address |
Returns
Type | Description |
---|---|
System.Boolean | valid or not |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Byte[] | message | the message that was signed |
Signature | signature | signature |
Returns
Type | Description |
---|---|
System.Boolean | true if the signature is valid |