Class Logic
Namespace: Algorand.Unity
Assembly: cs.temp.dll.dll
Syntax
public static class Logic
  Fields
LogicDataPrefix
Declaration
public static readonly byte[] LogicDataPrefix
  Field Value
| Type | Description | 
|---|---|
| Byte[] | 
SigningPrefix
Declaration
public static readonly byte[] SigningPrefix
  Field Value
| Type | Description | 
|---|---|
| Byte[] | 
Methods
GetAddress(CompiledTeal)
Return the Address of a program.
Declaration
public static Address GetAddress(CompiledTeal program)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CompiledTeal | program | The stateful or stateless program to get the address of.  | 
      
Returns
| Type | Description | 
|---|---|
| Address | An Address for a program.  | 
      
GetSignBytes(CompiledTeal, Allocator)
Get a 
Declaration
public static NativeByteArray GetSignBytes(CompiledTeal program, Allocator allocator)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CompiledTeal | program | The program that will be signed.  | 
      
| Allocator | allocator | Defines the memory lifetime used for   | 
      
Returns
| Type | Description | 
|---|---|
| NativeByteArray | A   | 
      
Sign(CompiledTeal, MultisigSig, PrivateKey)
Signs the program with the msig and returns a signature and its index.
Declaration
public static (Sig, int) Sign(CompiledTeal program, MultisigSig msig, PrivateKey privateKey)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CompiledTeal | program | The program to sign.  | 
      
| MultisigSig | msig | A MultisigSig that contains the   | 
      
| PrivateKey | privateKey | The private key to sign with. Its corresponding   | 
      
Returns
| Type | Description | 
|---|---|
| ValueTuple<Sig, Int32> | A tuple of the Sig from signing the program and its index in the   | 
      
Sign(CompiledTeal, SecretKeyHandle)
Signs the given program and returns the signature.
Declaration
public static Sig Sign(CompiledTeal program, SecretKeyHandle secretKey)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CompiledTeal | program | Program to sign  | 
      
| SecretKeyHandle | secretKey | Key to sign this program with.  | 
      
Returns
| Type | Description | 
|---|---|
| Sig | Sig | 
TealSign(SecretKeyHandle, NativeArray<Byte>, Address)
Creates a signature compatible with ed25519verify opcode from the contract address.
Declaration
public static Sig TealSign(SecretKeyHandle sk, NativeArray<byte> data, Address contractAddress)
  Parameters
| Type | Name | Description | 
|---|---|---|
| SecretKeyHandle | sk | The secretkey handle to use to sign using the given data and the program.  | 
      
| NativeArray<Byte> | data | The data to sign.  | 
      
| Address | contractAddress | The teal contract address to use to sign this data.  | 
      
Returns
| Type | Description | 
|---|---|
| Sig | A signature compatible with ed25519verify opcode.  | 
      
TealSign(SecretKeyHandle, Byte[], Address)
Creates a signature compatible with ed25519verify opcode from the contract address.
Declaration
public static Sig TealSign(SecretKeyHandle sk, byte[] data, Address contractAddress)
  Parameters
| Type | Name | Description | 
|---|---|---|
| SecretKeyHandle | sk | The secretkey handle to use to sign using the given data and the program.  | 
      
| Byte[] | data | The data to sign.  | 
      
| Address | contractAddress | The teal contract address to use to sign this data.  | 
      
Returns
| Type | Description | 
|---|---|
| Sig | A signature compatible with ed25519verify opcode.  | 
      
TealSign<TBytes>(SecretKeyHandle, TBytes, Address)
Creates a signature compatible with ed25519verify opcode from the contract address.
Declaration
public static Sig TealSign<TBytes>(SecretKeyHandle sk, TBytes data, Address contractAddress)
    where TBytes : struct, IByteArray
  Parameters
| Type | Name | Description | 
|---|---|---|
| SecretKeyHandle | sk | The secretkey handle to use to sign using the given data and the program.  | 
      
| TBytes | data | The data to sign.  | 
      
| Address | contractAddress | The teal contract address to use to sign this data.  | 
      
Returns
| Type | Description | 
|---|---|
| Sig | A signature compatible with ed25519verify opcode.  | 
      
Type Parameters
| Name | Description | 
|---|---|
| TBytes | The type of the byte array.  | 
      
TealSignProgram(SecretKeyHandle, NativeArray<Byte>, CompiledTeal)
Creates a signature compatible with ed25519verify opcode from raw program bytes.
Declaration
public static Sig TealSignProgram(SecretKeyHandle sk, NativeArray<byte> data, CompiledTeal program)
  Parameters
| Type | Name | Description | 
|---|---|---|
| SecretKeyHandle | sk | The secretkey handle to use to sign using the given data and the program.  | 
      
| NativeArray<Byte> | data | The data to sign.  | 
      
| CompiledTeal | program | The program to hash and prepend to the signed message.  | 
      
Returns
| Type | Description | 
|---|---|
| Sig | A signature compatible with ed25519verify opcode.  | 
      
TealSignProgram(SecretKeyHandle, Byte[], CompiledTeal)
Creates a signature compatible with ed25519verify opcode from raw program bytes.
Declaration
public static Sig TealSignProgram(SecretKeyHandle sk, byte[] data, CompiledTeal program)
  Parameters
| Type | Name | Description | 
|---|---|---|
| SecretKeyHandle | sk | The secretkey handle to use to sign using the given data and the program.  | 
      
| Byte[] | data | The data to sign.  | 
      
| CompiledTeal | program | The program to hash and prepend to the signed message.  | 
      
Returns
| Type | Description | 
|---|---|
| Sig | A signature compatible with ed25519verify opcode.  | 
      
TealSignProgram<TBytes>(SecretKeyHandle, TBytes, CompiledTeal)
Creates a signature compatible with ed25519verify opcode from raw program bytes.
Declaration
public static Sig TealSignProgram<TBytes>(SecretKeyHandle sk, TBytes data, CompiledTeal program)
    where TBytes : struct, IByteArray
  Parameters
| Type | Name | Description | 
|---|---|---|
| SecretKeyHandle | sk | The secretkey handle to use to sign using the given data and the program.  | 
      
| TBytes | data | The data to sign.  | 
      
| CompiledTeal | program | The program to hash and prepend to the signed message.  | 
      
Returns
| Type | Description | 
|---|---|
| Sig | A signature compatible with ed25519verify opcode.  | 
      
Type Parameters
| Name | Description | 
|---|---|
| TBytes | The type of the byte array.  |