Class AtomicTxn
Namespace: Algorand.Unity
Assembly: cs.temp.dll.dll
Syntax
public static class AtomicTxn
Fields
IdPrefix
The prefix to use when converting this group of transactions to bytes.
Declaration
public static readonly byte[] IdPrefix
Field Value
Type | Description |
---|---|
Byte[] |
MaxNumTxns
Max number of allowed transactions in an atomic transaction.
Declaration
public const int MaxNumTxns = 16
Field Value
Type | Description |
---|---|
Int32 |
Methods
CheckTxnIndicesToSign<TSigning>(TSigning, TxnIndices)
Checks whether the given indices can be signed. Will throw exceptions if they cannot be signed.
Declaration
public static void CheckTxnIndicesToSign<TSigning>(this TSigning group, TxnIndices txnsToSign)
where TSigning : AtomicTxn.ISigning<TSigning>
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The signing atomic txn group. |
TxnIndices | txnsToSign | The txn indices to sign. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
Remarks
Indices must be in range of the length of transactions and cannot be associated with any transactions that are already signed.
GetTxnIndicesWithSender<TSigning>(TSigning, Address)
Get the transaction indices that have Sender equal to the given address.
Declaration
public static TxnIndices GetTxnIndicesWithSender<TSigning>(this TSigning group, Address sender)
where TSigning : AtomicTxn.ISigning<TSigning>
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The atomic transaction group to look for transactions. |
Address | sender | The address to compare to the transaction's Sender address. |
Returns
Type | Description |
---|---|
TxnIndices | Transaction indices flagged with the indices in the correct position. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
SetSignatures<TSigning>(TSigning, SignedTxn<Transaction>[], TxnIndices)
Utility function to set signatures given by signers to signatures in this signing atomic txn group.
Declaration
public static void SetSignatures<TSigning>(this TSigning group, SignedTxn<Transaction>[] signedTxns, TxnIndices indices)
where TSigning : AtomicTxn.ISigning<TSigning>
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The signing atomic txn group. |
SignedTxn<Transaction>[] | signedTxns | The result from signers. |
TxnIndices | indices | The txn indices that were going to be signed. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
SignWith<TSigning, TSigner>(TSigning, TSigner)
Declaration
public static TSigning SignWith<TSigning, TSigner>(this TSigning group, TSigner signer)
where TSigning : AtomicTxn.ISigning<TSigning> where TSigner : IAccount, ISigner
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The signing atomic txn group. |
TSigner | signer | The account to sign with. |
Returns
Type | Description |
---|---|
TSigning | This signing atomic txn group with new signatures added. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
TSigner | The type of the account signer. |
SignWith<TSigning, TSigner>(TSigning, TSigner, TxnIndices)
Sign transactions in this group indicated by the given indices with the given signer.
Declaration
public static TSigning SignWith<TSigning, TSigner>(this TSigning group, TSigner signer, TxnIndices txnsToSign)
where TSigning : AtomicTxn.ISigning<TSigning> where TSigner : ISigner
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The signing atomic txn group. |
TSigner | signer | The signer to sign these transactions. |
TxnIndices | txnsToSign | The indices of the transactions to sign. |
Returns
Type | Description |
---|---|
TSigning | This signing atomic txn group with new signatures added. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
TSigner | The type of the account signer. |
SignWithAsync<TSigning, TSigner>(TSigning, TSigner, TxnIndices, CancellationToken)
Sign transactions in this group indicated by the given indices with the given signer.
Declaration
public static AtomicTxn.AsyncSigning SignWithAsync<TSigning, TSigner>(this TSigning group, TSigner signer, TxnIndices txnsToSign, CancellationToken cancellationToken = null)
where TSigning : AtomicTxn.ISigning<TSigning> where TSigner : IAsyncSigner
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The signing atomic txn group. |
TSigner | signer | The async signer account to sign the transactions. |
TxnIndices | txnsToSign | The indices of the transactions to sign. |
CancellationToken | cancellationToken | An optional cancellation token for this signer. |
Returns
Type | Description |
---|---|
AtomicTxn.AsyncSigning | An Async Signing Atomic Txn Group with new signatures awaiting to be added. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
TSigner | The type of the account signer. |
SignWithAsync<TSigning, TSigner>(TSigning, TSigner, CancellationToken)
Declaration
public static AtomicTxn.AsyncSigning SignWithAsync<TSigning, TSigner>(this TSigning group, TSigner signer, CancellationToken cancellationToken = null)
where TSigning : AtomicTxn.ISigning<TSigning> where TSigner : IAccount, IAsyncSigner
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The signing atomic txn group. |
TSigner | signer | The async signer account to sign the transactions. |
CancellationToken | cancellationToken | An optional cancellation token for this signer. |
Returns
Type | Description |
---|---|
AtomicTxn.AsyncSigning | An Async Signing Atomic Txn Group with new signatures awaiting to be added. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
TSigner | The type of the account signer. |
SignWithAsync<TSigning, TSigner, TProgress>(TSigning, TSigner, TProgress, CancellationToken)
Declaration
public static AtomicTxn.AsyncSigning SignWithAsync<TSigning, TSigner, TProgress>(this TSigning group, TSigner signer, TProgress progress, CancellationToken cancellationToken = null)
where TSigning : AtomicTxn.ISigning<TSigning> where TSigner : IAccount, IAsyncSignerWithProgress where TProgress : IProgress<float>
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The signing atomic txn group. |
TSigner | signer | The async signer account to sign the transactions. |
TProgress | progress | A progress token used to track progress |
CancellationToken | cancellationToken | An optional cancellation token for this signer. |
Returns
Type | Description |
---|---|
AtomicTxn.AsyncSigning | An Async Signing Atomic Txn Group with new signatures awaiting to be added. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
TSigner | The type of the account signer. |
TProgress |
SignWithAsync<TSigning, TSigner, TProgress>(TSigning, TSigner, TxnIndices, TProgress, CancellationToken)
Sign transactions in this group indicated by the given indices with the given signer.
Declaration
public static AtomicTxn.AsyncSigning SignWithAsync<TSigning, TSigner, TProgress>(this TSigning group, TSigner signer, TxnIndices txnsToSign, TProgress progress, CancellationToken cancellationToken = null)
where TSigning : AtomicTxn.ISigning<TSigning> where TSigner : IAsyncSignerWithProgress where TProgress : IProgress<float>
Parameters
Type | Name | Description |
---|---|---|
TSigning | group | The signing atomic txn group. |
TSigner | signer | The async signer account to sign the transactions. |
TxnIndices | txnsToSign | The indices of the transactions to sign. |
TProgress | progress | A progress token used to track progress |
CancellationToken | cancellationToken | An optional cancellation token for this signer. |
Returns
Type | Description |
---|---|
AtomicTxn.AsyncSigning | An Async Signing Atomic Txn Group with new signatures awaiting to be added. |
Type Parameters
Name | Description |
---|---|
TSigning | The type of the signing atomic txn group. |
TSigner | The type of the account signer. |
TProgress |