Class Transaction
A raw serializable transaction class, used to generate transactions to broadcast to the network. This is distinct from algod.model.Transaction, which is only returned for GET requests to algod.
Inheritance
Inherited Members
Namespace: Algorand
Assembly: Algorand.dll
Syntax
[JsonObject]
public class Transaction
Constructors
| Improve this Doc View SourceTransaction()
Declaration
public Transaction()
Transaction(Address, Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>)
Create a payment transaction
Declaration
public Transaction(Address fromAddr, Address toAddr, ulong? fee, ulong? amount, ulong? firstRound, ulong? lastRound)
Parameters
Type | Name | Description |
---|---|---|
Address | fromAddr | source address |
Address | toAddr | destination address |
System.Nullable<System.UInt64> | fee | transaction fee |
System.Nullable<System.UInt64> | amount | payment amount |
System.Nullable<System.UInt64> | firstRound | first valid round |
System.Nullable<System.UInt64> | lastRound | last valid round |
Transaction(Address, Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, String, Digest)
Declaration
public Transaction(Address fromAddr, Address toAddr, ulong? fee, ulong? amount, ulong? firstRound, ulong? lastRound, string genesisID, Digest genesisHash)
Parameters
Type | Name | Description |
---|---|---|
Address | fromAddr | |
Address | toAddr | |
System.Nullable<System.UInt64> | fee | |
System.Nullable<System.UInt64> | amount | |
System.Nullable<System.UInt64> | firstRound | |
System.Nullable<System.UInt64> | lastRound | |
System.String | genesisID | |
Digest | genesisHash |
Transaction(Address, Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, String, Digest)
Create a payment transaction. Make sure to sign with a suggested fee.
Declaration
public Transaction(Address fromAddr, Address toAddr, ulong? amount, ulong? firstRound, ulong? lastRound, string genesisID, Digest genesisHash)
Parameters
Type | Name | Description |
---|---|---|
Address | fromAddr | source address |
Address | toAddr | destination address |
System.Nullable<System.UInt64> | amount | amount to send |
System.Nullable<System.UInt64> | firstRound | first valid round |
System.Nullable<System.UInt64> | lastRound | last valid round |
System.String | genesisID | genesis id |
Digest | genesisHash | genesis hash |
Transaction(Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], Nullable<UInt64>, Address, String, Digest)
Declaration
public Transaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastValid, byte[] note, ulong? amount, Address receiver, string genesisID, Digest genesisHash)
Parameters
Type | Name | Description |
---|---|---|
Address | sender | |
System.Nullable<System.UInt64> | fee | |
System.Nullable<System.UInt64> | firstValid | |
System.Nullable<System.UInt64> | lastValid | |
System.Byte[] | note | |
System.Nullable<System.UInt64> | amount | |
Address | receiver | |
System.String | genesisID | |
Digest | genesisHash |
Transaction(Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], String, Digest, ParticipationPublicKey, VRFPublicKey, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>)
Create a key registration transaction. No field can be null except the note field.
Declaration
public Transaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastValid, byte[] note, string genesisID, Digest genesisHash, ParticipationPublicKey votePK, VRFPublicKey vrfPK, ulong? voteFirst, ulong? voteLast, ulong? voteKeyDilution)
Parameters
Type | Name | Description |
---|---|---|
Address | sender | source address |
System.Nullable<System.UInt64> | fee | transaction fee |
System.Nullable<System.UInt64> | firstValid | first valid round |
System.Nullable<System.UInt64> | lastValid | last valid round |
System.Byte[] | note | optional notes field (can be null) |
System.String | genesisID | genesis id |
Digest | genesisHash | genesis hash |
ParticipationPublicKey | votePK | the new participation key to register |
VRFPublicKey | vrfPK | the sortition key to register |
System.Nullable<System.UInt64> | voteFirst | key reg valid first round |
System.Nullable<System.UInt64> | voteLast | key reg valid last round |
System.Nullable<System.UInt64> | voteKeyDilution | key reg dilution |
Transaction(Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], String, Digest, Nullable<UInt64>, Address, Address)
Declaration
public Transaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastValid, byte[] note, string genesisID, Digest genesisHash, ulong? amount, Address receiver, Address closeRemainderTo)
Parameters
Type | Name | Description |
---|---|---|
Address | sender | |
System.Nullable<System.UInt64> | fee | |
System.Nullable<System.UInt64> | firstValid | |
System.Nullable<System.UInt64> | lastValid | |
System.Byte[] | note | |
System.String | genesisID | |
Digest | genesisHash | |
System.Nullable<System.UInt64> | amount | |
Address | receiver | |
Address | closeRemainderTo |
Fields
| Improve this Doc View Sourceaccounts
Declaration
[JsonProperty(PropertyName = "apat")]
public List<Address> accounts
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<Address> |
amount
Declaration
[JsonProperty(PropertyName = "amt")]
public ulong? amount
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
applicationArgs
Declaration
[JsonProperty(PropertyName = "apaa")]
public List<byte[]> applicationArgs
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Byte[]> |
applicationId
Declaration
[JsonProperty(PropertyName = "apid")]
public long applicationId
Field Value
Type | Description |
---|---|
System.Int64 |
approvalProgram
Declaration
[JsonProperty(PropertyName = "apap")]
public TEALProgram approvalProgram
Field Value
Type | Description |
---|---|
TEALProgram |
assetAmount
The amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map.
Declaration
[JsonProperty(PropertyName = "aamt")]
public ulong? assetAmount
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
assetCloseTo
Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the AssetID account.
Declaration
[JsonProperty(PropertyName = "aclose")]
public Address assetCloseTo
Field Value
Type | Description |
---|---|
Address |
assetFreezeID
Declaration
[JsonProperty(PropertyName = "faid")]
public ulong? assetFreezeID
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
assetIndex
Declaration
[JsonProperty(PropertyName = "caid")]
public ulong? assetIndex
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
assetParams
Declaration
[JsonProperty(PropertyName = "apar")]
public Transaction.AssetParams assetParams
Field Value
Type | Description |
---|---|
Transaction.AssetParams |
assetReceiver
The receiver of the transfer.
Declaration
[JsonProperty(PropertyName = "arcv")]
public Address assetReceiver
Field Value
Type | Description |
---|---|
Address |
assetSender
The sender of the transfer. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. If this is the zero value, the asset is sent from the transaction's Sender.
Declaration
[JsonProperty(PropertyName = "asnd")]
public Address assetSender
Field Value
Type | Description |
---|---|
Address |
clearStateProgram
Declaration
[JsonProperty(PropertyName = "apsu")]
public TEALProgram clearStateProgram
Field Value
Type | Description |
---|---|
TEALProgram |
closeRemainderTo
Declaration
[JsonProperty(PropertyName = "close")]
public Address closeRemainderTo
Field Value
Type | Description |
---|---|
Address |
fee
Declaration
[JsonProperty(PropertyName = "fee")]
public ulong? fee
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
firstValid
Declaration
[JsonProperty(PropertyName = "fv")]
public ulong? firstValid
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
foreignApps
Declaration
[JsonProperty(PropertyName = "apfa")]
public List<long> foreignApps
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Int64> |
foreignAssets
Declaration
[JsonProperty(PropertyName = "apas")]
public List<long> foreignAssets
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Int64> |
freezeState
Declaration
[JsonProperty(PropertyName = "afrz")]
public bool freezeState
Field Value
Type | Description |
---|---|
System.Boolean |
freezeTarget
Declaration
[JsonProperty(PropertyName = "fadd")]
public Address freezeTarget
Field Value
Type | Description |
---|---|
Address |
genesisHash
Declaration
[JsonProperty(PropertyName = "gh")]
public Digest genesisHash
Field Value
Type | Description |
---|---|
Digest |
genesisID
Declaration
[JsonProperty(PropertyName = "gen")]
public string genesisID
Field Value
Type | Description |
---|---|
System.String |
globalStateSchema
Declaration
[JsonProperty(PropertyName = "apgs")]
public StateSchema globalStateSchema
Field Value
Type | Description |
---|---|
StateSchema |
group
Declaration
[JsonProperty(PropertyName = "grp")]
public Digest group
Field Value
Type | Description |
---|---|
Digest |
lastValid
Declaration
[JsonProperty(PropertyName = "lv")]
public ulong? lastValid
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
localStateSchema
Declaration
[JsonProperty(PropertyName = "apls")]
public StateSchema localStateSchema
Field Value
Type | Description |
---|---|
StateSchema |
onCompletion
Declaration
[JsonProperty(PropertyName = "apan")]
public OnCompletion onCompletion
Field Value
Type | Description |
---|---|
OnCompletion |
receiver
Declaration
[JsonProperty(PropertyName = "rcv")]
public Address receiver
Field Value
Type | Description |
---|---|
Address |
RekeyTo
Declaration
[JsonProperty("rekey")]
public Address RekeyTo
Field Value
Type | Description |
---|---|
Address |
selectionPK
selectionPK is the VRF public key used in key registration transactions
Declaration
[JsonProperty(PropertyName = "selkey")]
public VRFPublicKey selectionPK
Field Value
Type | Description |
---|---|
VRFPublicKey |
sender
Declaration
[JsonProperty(PropertyName = "snd")]
public Address sender
Field Value
Type | Description |
---|---|
Address |
type
Declaration
[JsonProperty(PropertyName = "type")]
public Transaction.Type type
Field Value
Type | Description |
---|---|
Transaction.Type |
voteFirst
voteFirst is the first round this keyreg tx is valid for
Declaration
[JsonProperty(PropertyName = "votefst")]
public ulong? voteFirst
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
voteKeyDilution
voteKeyDilution
Declaration
[JsonProperty(PropertyName = "votekd")]
public ulong? voteKeyDilution
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
voteLast
voteLast is the last round this keyreg tx is valid for
Declaration
[JsonProperty(PropertyName = "votelst")]
public ulong? voteLast
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
votePK
VotePK is the participation public key used in key registration transactions
Declaration
[JsonProperty(PropertyName = "votekey")]
public ParticipationPublicKey votePK
Field Value
Type | Description |
---|---|
ParticipationPublicKey |
xferAsset
Declaration
[JsonProperty(PropertyName = "xaid")]
public ulong? xferAsset
Field Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
Properties
| Improve this Doc View Sourcelease
Declaration
[JsonProperty(PropertyName = "lx")]
public byte[] lease { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
note
Declaration
[JsonProperty(PropertyName = "note")]
public byte[] note { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Methods
| Improve this Doc View SourceAssignGroupID(Digest)
Declaration
public void AssignGroupID(Digest gid)
Parameters
Type | Name | Description |
---|---|---|
Digest | gid |
BytesToSign()
Return encoded representation of the transaction with a prefix suitable for signing
Declaration
public byte[] BytesToSign()
Returns
Type | Description |
---|---|
System.Byte[] |
CreateAssetAcceptTransaction(Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], String, Digest, Nullable<UInt64>)
Creates a tx to mark the account as willing to accept the asset.
Declaration
public static Transaction CreateAssetAcceptTransaction(Address acceptingAccount, ulong? flatFee, ulong? firstRound, ulong? lastRound, byte[] note, string genesisID, Digest genesisHash, ulong? assetIndex)
Parameters
Type | Name | Description |
---|---|---|
Address | acceptingAccount | checksummed, human-readable address that will accept receiving the asset. |
System.Nullable<System.UInt64> | flatFee | the transaction flat fee |
System.Nullable<System.UInt64> | firstRound | the first round this txn is valid (txn semantics unrelated to asset management) |
System.Nullable<System.UInt64> | lastRound | the last round this txn is valid |
System.Byte[] | note | |
System.String | genesisID | corresponds to the id of the network |
Digest | genesisHash | corresponds to the base64-encoded hash of the genesis |
System.Nullable<System.UInt64> | assetIndex | the asset index |
Returns
Type | Description |
---|---|
Transaction |
CreateAssetConfigureTransaction(Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], String, Digest, Nullable<UInt64>, Address, Address, Address, Address, Boolean)
Create an asset configuration transaction. Note can be null. manager, reserve, freeze, and clawback can be zeroed.
Declaration
public static Transaction CreateAssetConfigureTransaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastValid, byte[] note, string genesisID, Digest genesisHash, ulong? index, Address manager, Address reserve, Address freeze, Address clawback, bool strictEmptyAddressChecking)
Parameters
Type | Name | Description |
---|---|---|
Address | sender | source address |
System.Nullable<System.UInt64> | fee | transaction fee |
System.Nullable<System.UInt64> | firstValid | first valid round |
System.Nullable<System.UInt64> | lastValid | last valid round |
System.Byte[] | note | optional note field (can be null) |
System.String | genesisID | corresponds to the id of the network |
Digest | genesisHash | |
System.Nullable<System.UInt64> | index | asset index |
Address | manager | account which can reconfigure the asset |
Address | reserve | account whose asset holdings count as non-minted |
Address | freeze | account which can freeze or unfreeze holder accounts |
Address | clawback | account which can issue clawbacks against holder accounts |
System.Boolean | strictEmptyAddressChecking | if true, disallow empty admin accounts from being set (preventing accidental disable of admin features) |
Returns
Type | Description |
---|---|
Transaction | the asset configure transaction |
CreateAssetCreateTransaction(Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], String, Digest, Nullable<UInt64>, Int32, Boolean, String, String, String, Byte[], Address, Address, Address, Address)
Create an asset creation transaction. Note can be null. manager, reserve, freeze, and clawback can be zeroed.
Declaration
public static Transaction CreateAssetCreateTransaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastValid, byte[] note, string genesisID, Digest genesisHash, ulong? assetTotal, int assetDecimals, bool defaultFrozen, string assetUnitName, string assetName, string url, byte[] metadataHash, Address manager, Address reserve, Address freeze, Address clawback)
Parameters
Type | Name | Description |
---|---|---|
Address | sender | source address |
System.Nullable<System.UInt64> | fee | transaction fee |
System.Nullable<System.UInt64> | firstValid | first valid round |
System.Nullable<System.UInt64> | lastValid | last valid round |
System.Byte[] | note | optional note field (can be null) |
System.String | genesisID | |
Digest | genesisHash | |
System.Nullable<System.UInt64> | assetTotal | total asset issuance |
System.Int32 | assetDecimals | asset decimal precision |
System.Boolean | defaultFrozen | whether accounts have this asset frozen by default |
System.String | assetUnitName | name of unit of the asset |
System.String | assetName | name of the asset |
System.String | url | where more information about the asset can be retrieved |
System.Byte[] | metadataHash | specifies a commitment to some unspecified asset metadata. The format of this metadata is up to the application |
Address | manager | account which can reconfigure the asset |
Address | reserve | account whose asset holdings count as non-minted |
Address | freeze | account which can freeze or unfreeze holder accounts |
Address | clawback | account which can issue clawbacks against holder accounts |
Returns
Type | Description |
---|---|
Transaction |
CreateAssetDestroyTransaction(Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], Digest, Nullable<UInt64>)
Creates a tx to destroy the asset
Declaration
public static Transaction CreateAssetDestroyTransaction(Address senderAccount, ulong? flatFee, ulong? firstValid, ulong? lastValid, byte[] note, Digest genesisHash, ulong? assetIndex)
Parameters
Type | Name | Description |
---|---|---|
Address | senderAccount | checksummed, human-readable address of the sender |
System.Nullable<System.UInt64> | flatFee | the transaction flat fee |
System.Nullable<System.UInt64> | firstValid | the first round this txn is valid (txn semantics unrelated to asset management) |
System.Nullable<System.UInt64> | lastValid | the last round this txn is valid |
System.Byte[] | note | |
Digest | genesisHash | corresponds to the base64-encoded hash of the genesis |
System.Nullable<System.UInt64> | assetIndex | the asset ID to destroy |
Returns
Type | Description |
---|---|
Transaction |
CreateAssetFreezeTransaction(Address, Address, Boolean, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], Digest, Nullable<UInt64>)
Creates a tx to freeze/unfreeze assets
Declaration
public static Transaction CreateAssetFreezeTransaction(Address senderAccount, Address accountToFreeze, bool freezeState, ulong? flatFee, ulong? firstValid, ulong? lastValid, byte[] note, Digest genesisHash, ulong? assetIndex)
Parameters
Type | Name | Description |
---|---|---|
Address | senderAccount | checksummed, human-readable address of the sender |
Address | accountToFreeze | |
System.Boolean | freezeState | |
System.Nullable<System.UInt64> | flatFee | the transaction flat fee |
System.Nullable<System.UInt64> | firstValid | the first round this txn is valid (txn semantics unrelated to asset management) |
System.Nullable<System.UInt64> | lastValid | the last round this txn is valid |
System.Byte[] | note | |
Digest | genesisHash | corresponds to the base64-encoded hash of the genesis of the network |
System.Nullable<System.UInt64> | assetIndex | the asset ID to destroy |
Returns
Type | Description |
---|---|
Transaction |
CreateAssetRevokeTransaction(Address, Address, Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], String, Digest, Nullable<UInt64>)
Creates a tx for revoking an asset from an account and sending it to another
Declaration
public static Transaction CreateAssetRevokeTransaction(Address transactionSender, Address assetRevokedFrom, Address assetReceiver, ulong? assetAmount, ulong? flatFee, ulong? firstRound, ulong? lastRound, byte[] note, string genesisID, Digest genesisHash, ulong? assetIndex)
Parameters
Type | Name | Description |
---|---|---|
Address | transactionSender | checksummed, human-readable address that will send the transaction |
Address | assetRevokedFrom | checksummed, human-readable address that will have assets taken from |
Address | assetReceiver | checksummed, human-readable address what will receive the assets |
System.Nullable<System.UInt64> | assetAmount | the number of assets to send |
System.Nullable<System.UInt64> | flatFee | the transaction flat fee |
System.Nullable<System.UInt64> | firstRound | the first round this txn is valid (txn semantics unrelated to asset management) |
System.Nullable<System.UInt64> | lastRound | the last round this txn is valid |
System.Byte[] | note | |
System.String | genesisID | corresponds to the id of the network |
Digest | genesisHash | corresponds to the base64-encoded hash of the genesis of the network |
System.Nullable<System.UInt64> | assetIndex | the asset index |
Returns
Type | Description |
---|---|
Transaction |
CreateAssetTransferTransaction(Address, Address, Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], String, Digest, Nullable<UInt64>)
Creates a tx for sending some asset from an asset holder to another user. The asset receiver must have marked itself as willing to accept the asset.
Declaration
public static Transaction CreateAssetTransferTransaction(Address assetSender, Address assetReceiver, Address assetCloseTo, ulong? assetAmount, ulong? flatFee, ulong? firstRound, ulong? lastRound, byte[] note, string genesisID, Digest genesisHash, ulong? assetIndex)
Parameters
Type | Name | Description |
---|---|---|
Address | assetSender | checksummed, human-readable address that will send the transaction and assets |
Address | assetReceiver | checksummed, human-readable address what will receive the assets |
Address | assetCloseTo | checksummed, human-readable address that behaves as a close-to address for the asset transaction; the remaining assets not sent to assetReceiver will be sent to assetCloseTo. Leave blank for no close-to behavior. |
System.Nullable<System.UInt64> | assetAmount | the number of assets to send |
System.Nullable<System.UInt64> | flatFee | the transaction flat fee |
System.Nullable<System.UInt64> | firstRound | the first round this txn is valid (txn semantics unrelated to asset management) |
System.Nullable<System.UInt64> | lastRound | the last round this txn is valid |
System.Byte[] | note | |
System.String | genesisID | corresponds to the id of the network |
Digest | genesisHash | corresponds to the base64-encoded hash of the genesis of the network |
System.Nullable<System.UInt64> | assetIndex | the asset index |
Returns
Type | Description |
---|---|
Transaction |
CreateKeyRegistrationTransaction(Address, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>, Byte[], String, Digest, ParticipationPublicKey, VRFPublicKey, UInt64, UInt64, UInt64)
Create a key registration transaction.
Declaration
public static Transaction CreateKeyRegistrationTransaction(Address sender, ulong? fee, ulong? firstValid, ulong? lastValid, byte[] note, string genesisID, Digest genesisHash, ParticipationPublicKey votePK, VRFPublicKey vrfPK, ulong voteFirst, ulong voteLast, ulong voteKeyDilution)
Parameters
Type | Name | Description |
---|---|---|
Address | sender | |
System.Nullable<System.UInt64> | fee | |
System.Nullable<System.UInt64> | firstValid | |
System.Nullable<System.UInt64> | lastValid | |
System.Byte[] | note | |
System.String | genesisID | |
Digest | genesisHash | |
ParticipationPublicKey | votePK | |
VRFPublicKey | vrfPK | |
System.UInt64 | voteFirst | |
System.UInt64 | voteLast | |
System.UInt64 | voteKeyDilution |
Returns
Type | Description |
---|---|
Transaction |
Equals(Object)
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
System.Object | o |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
RawTxID()
Return transaction ID as Digest
Declaration
public Digest RawTxID()
Returns
Type | Description |
---|---|
Digest |
TxID()
Return transaction ID as string
Declaration
public string TxID()
Returns
Type | Description |
---|---|
System.String |