transaction

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 6 Imported by: 33

Documentation

Index

Constants

View Source
const MinTxnFee = 1000

MinTxnFee is v5 consensus params, in microAlgos

View Source
const NumOfAdditionalBytesAfterSigning = 75

NumOfAdditionalBytesAfterSigning is the number of bytes added to a txn after signing it

Variables

This section is empty.

Functions

func AssignGroupID

func AssignGroupID(txns []types.Transaction, account string) (result []types.Transaction, err error)

AssignGroupID computes and return list of transactions with Group field set. - txns is a list of transactions to process - account specifies a sender field of transaction to return. Set to empty string to return all of them

func EstimateSize added in v1.3.0

func EstimateSize(txn types.Transaction) (uint64, error)

EstimateSize returns the estimated length of the encoded transaction

func MakeAssetAcceptanceTxn

func MakeAssetAcceptanceTxn(account string, feePerByte, firstRound, lastRound uint64, note []byte,
	genesisID, genesisHash string, index uint64) (types.Transaction, error)

MakeAssetAcceptanceTxn creates a tx for marking an account as willing to accept the given asset - account is a checksummed, human-readable address that will send the transaction and begin accepting the asset - feePerByte is a fee per byte - firstRound is the first round this txn is valid (txn semantics unrelated to asset management) - lastRound is the last round this txn is valid - note is an arbitrary byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index Deprecated: next major version will use a Params object, see package future

func MakeAssetAcceptanceTxnWithFlatFee

func MakeAssetAcceptanceTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte,
	genesisID, genesisHash string, index uint64) (types.Transaction, error)

MakeAssetAcceptanceTxnWithFlatFee creates a tx for marking an account as willing to accept an asset - account is a checksummed, human-readable address that will send the transaction and begin accepting the asset - fee is a flat fee - firstRound is the first round this txn is valid (txn semantics unrelated to asset management) - lastRound is the last round this txn is valid - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index Deprecated: next major version will use a Params object, see package future

func MakeAssetConfigTxn

func MakeAssetConfigTxn(account string, feePerByte, firstRound, lastRound uint64, note []byte, genesisID, genesisHash string,
	index uint64, newManager, newReserve, newFreeze, newClawback string, strictEmptyAddressChecking bool) (types.Transaction, error)

MakeAssetConfigTxn creates a tx template for changing the key configuration of an existing asset. Important notes -

  • Every asset config transaction is a fresh one. No parameters will be inherited from the current config.
  • Once an address is set to to the empty string, IT CAN NEVER BE CHANGED AGAIN. For example, if you want to keep The current manager, you must specify its address again. Parameters -

- account is a checksummed, human-readable address that will send the transaction - feePerByte is a fee per byte - firstRound is the first round this txn is valid (txn semantics unrelated to asset config) - lastRound is the last round this txn is valid - note is an arbitrary byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index id - for newManager, newReserve, newFreeze, newClawback see asset.go - strictEmptyAddressChecking: if true, disallow empty admin accounts from being set (preventing accidental disable of admin features) Deprecated: next major version will use a Params object, see package future

func MakeAssetConfigTxnWithFlatFee

func MakeAssetConfigTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID, genesisHash string,
	index uint64, newManager, newReserve, newFreeze, newClawback string, strictEmptyAddressChecking bool) (types.Transaction, error)

MakeAssetConfigTxnWithFlatFee creates a tx template for changing the keys for an asset. An empty string means a zero key (which cannot be changed after becoming zero); to keep a key unchanged, you must specify that key. Deprecated: next major version will use a Params object, see package future

func MakeAssetCreateTxn

func MakeAssetCreateTxn(account string, feePerByte, firstRound, lastRound uint64, note []byte, genesisID, genesisHash string,
	total uint64, decimals uint32, defaultFrozen bool, manager, reserve, freeze, clawback string,
	unitName, assetName, url, metadataHash string) (types.Transaction, error)

MakeAssetCreateTxn constructs an asset creation transaction using the passed parameters. - account is a checksummed, human-readable address which will send the transaction. - fee is fee per byte as received from algod SuggestedFee API call. - firstRound is the first round this txn is valid (txn semantics unrelated to the asset) - lastRound is the last round this txn is valid - note is a byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network Asset creation parameters: - see asset.go Deprecated: next major version will use a Params object, see package future

func MakeAssetCreateTxnWithFlatFee

func MakeAssetCreateTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID, genesisHash string,
	total uint64, decimals uint32, defaultFrozen bool, manager, reserve, freeze, clawback, unitName, assetName, url, metadataHash string) (types.Transaction, error)

MakeAssetCreateTxnWithFlatFee constructs an asset creation transaction using the passed parameters. - account is a checksummed, human-readable address which will send the transaction. - fee is fee per byte as received from algod SuggestedFee API call. - firstRound is the first round this txn is valid (txn semantics unrelated to the asset) - lastRound is the last round this txn is valid - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network Asset creation parameters: - see asset.go Deprecated: next major version will use a Params object, see package future

func MakeAssetDestroyTxn

func MakeAssetDestroyTxn(account string, feePerByte, firstRound, lastRound uint64, note []byte, genesisID, genesisHash string,
	index uint64) (types.Transaction, error)

MakeAssetDestroyTxn creates a tx template for destroying an asset, removing it from the record. All outstanding asset amount must be held by the creator, and this transaction must be issued by the asset manager. - account is a checksummed, human-readable address that will send the transaction; it also must be the asset manager - fee is a fee per byte - firstRound is the first round this txn is valid (txn semantics unrelated to asset management) - lastRound is the last round this txn is valid - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index Deprecated: next major version will use a Params object, see package future

func MakeAssetDestroyTxnWithFlatFee

func MakeAssetDestroyTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID, genesisHash string,
	creator string, index uint64) (types.Transaction, error)

MakeAssetDestroyTxnWithFlatFee creates a tx template for destroying an asset, removing it from the record. All outstanding asset amount must be held by the creator, and this transaction must be issued by the asset manager. - account is a checksummed, human-readable address that will send the transaction; it also must be the asset manager - fee is a flat fee - firstRound is the first round this txn is valid (txn semantics unrelated to asset management) - lastRound is the last round this txn is valid - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index Deprecated: next major version will use a Params object, see package future

func MakeAssetFreezeTxn

func MakeAssetFreezeTxn(account string, fee, firstRound, lastRound uint64, note []byte, genesisID, genesisHash string,
	assetIndex uint64, target string, newFreezeSetting bool) (types.Transaction, error)

MakeAssetFreezeTxn constructs a transaction that freezes or unfreezes an account's asset holdings It must be issued by the freeze address for the asset - account is a checksummed, human-readable address which will send the transaction. - fee is fee per byte as received from algod SuggestedFee API call. - firstRound is the first round this txn is valid (txn semantics unrelated to the asset) - lastRound is the last round this txn is valid - note is an optional arbitrary byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - assetIndex is the index for tracking the asset - target is the account to be frozen or unfrozen - newFreezeSetting is the new state of the target account Deprecated: next major version will use a Params object, see package future

func MakeAssetFreezeTxnWithFlatFee

func MakeAssetFreezeTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID, genesisHash string,
	creator string, assetIndex uint64, target string, newFreezeSetting bool) (types.Transaction, error)

MakeAssetFreezeTxnWithFlatFee is as MakeAssetFreezeTxn, but taking a flat fee rather than a fee per byte. Deprecated: next major version will use a Params object, see package future

func MakeAssetRevocationTxn

func MakeAssetRevocationTxn(account, target, recipient string, amount, feePerByte, firstRound, lastRound uint64, note []byte,
	genesisID, genesisHash string, index uint64) (types.Transaction, error)

MakeAssetRevocationTxn creates a tx for revoking an asset from an account and sending it to another - account is a checksummed, human-readable address; it must be the revocation manager / clawback address from the asset's parameters - target is a checksummed, human-readable address; it is the account whose assets will be revoked - recipient is a checksummed, human-readable address; it will receive the revoked assets - feePerByte is a fee per byte - firstRound is the first round this txn is valid (txn semantics unrelated to asset management) - lastRound is the last round this txn is valid - note is an arbitrary byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index Deprecated: next major version will use a Params object, see package future

func MakeAssetRevocationTxnWithFlatFee

func MakeAssetRevocationTxnWithFlatFee(account, target, recipient string, amount, fee, firstRound, lastRound uint64, note []byte,
	genesisID, genesisHash, creator string, index uint64) (types.Transaction, error)

MakeAssetRevocationTxnWithFlatFee creates a tx for revoking an asset from an account and sending it to another - account is a checksummed, human-readable address; it must be the revocation manager / clawback address from the asset's parameters - target is a checksummed, human-readable address; it is the account whose assets will be revoked - recipient is a checksummed, human-readable address; it will receive the revoked assets - fee is a flat fee - firstRound is the first round this txn is valid (txn semantics unrelated to asset management) - lastRound is the last round this txn is valid - note is an arbitrary byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index Deprecated: next major version will use a Params object, see package future

func MakeAssetTransferTxn

func MakeAssetTransferTxn(account, recipient, closeAssetsTo string, amount, feePerByte, firstRound, lastRound uint64, note []byte,
	genesisID, genesisHash string, index uint64) (types.Transaction, error)

MakeAssetTransferTxn creates a tx for sending some asset from an asset holder to another user the recipient address must have previously issued an asset acceptance transaction for this asset - account is a checksummed, human-readable address that will send the transaction and assets - recipient is a checksummed, human-readable address what will receive the assets - closeAssetsTo is a checksummed, human-readable address that behaves as a close-to address for the asset transaction; the remaining assets not sent to recipient will be sent to closeAssetsTo. Leave blank for no close-to behavior. - amount is the number of assets to send - feePerByte is a fee per byte - firstRound is the first round this txn is valid (txn semantics unrelated to asset management) - lastRound is the last round this txn is valid - note is an arbitrary byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index Deprecated: next major version will use a Params object, see package future

func MakeAssetTransferTxnWithFlatFee

func MakeAssetTransferTxnWithFlatFee(account, recipient, closeAssetsTo string, amount, fee, firstRound, lastRound uint64, note []byte,
	genesisID, genesisHash string, index uint64) (types.Transaction, error)

MakeAssetTransferTxnWithFlatFee creates a tx for sending some asset from an asset holder to another user the recipient address must have previously issued an asset acceptance transaction for this asset - account is a checksummed, human-readable address that will send the transaction and assets - recipient is a checksummed, human-readable address what will receive the assets - closeAssetsTo is a checksummed, human-readable address that behaves as a close-to address for the asset transaction; the remaining assets not sent to recipient will be sent to closeAssetsTo. Leave blank for no close-to behavior. - amount is the number of assets to send - fee is a flat fee - firstRound is the first round this txn is valid (txn semantics unrelated to asset management) - lastRound is the last round this txn is valid - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network - index is the asset index

func MakeKeyRegTxn

func MakeKeyRegTxn(account string, feePerByte, firstRound, lastRound uint64, note []byte, genesisID string, genesisHash string,
	voteKey, selectionKey string, voteFirst, voteLast, voteKeyDilution uint64) (types.Transaction, error)

MakeKeyRegTxn constructs a keyreg transaction using the passed parameters. - account is a checksummed, human-readable address for which we register the given participation key. - fee is fee per byte as received from algod SuggestedFee API call. - firstRound is the first round this txn is valid (txn semantics unrelated to key registration) - lastRound is the last round this txn is valid - note is a byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network KeyReg parameters: - votePK is a base64-encoded string corresponding to the root participation public key - selectionKey is a base64-encoded string corresponding to the vrf public key - voteFirst is the first round this participation key is valid - voteLast is the last round this participation key is valid - voteKeyDilution is the dilution for the 2-level participation key Deprecated: next major version will use a Params object, see package future

func MakeKeyRegTxnWithFlatFee

func MakeKeyRegTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID string, genesisHash string,
	voteKey, selectionKey string, voteFirst, voteLast, voteKeyDilution uint64) (types.Transaction, error)

MakeKeyRegTxnWithFlatFee constructs a keyreg transaction using the passed parameters. - account is a checksummed, human-readable address for which we register the given participation key. - fee is a flat fee - firstRound is the first round this txn is valid (txn semantics unrelated to key registration) - lastRound is the last round this txn is valid - note is a byte array - genesis id corresponds to the id of the network - genesis hash corresponds to the base64-encoded hash of the genesis of the network KeyReg parameters: - votePK is a base64-encoded string corresponding to the root participation public key - selectionKey is a base64-encoded string corresponding to the vrf public key - voteFirst is the first round this participation key is valid - voteLast is the last round this participation key is valid - voteKeyDilution is the dilution for the 2-level participation key Deprecated: next major version will use a Params object, see package future

func MakePaymentTxn

func MakePaymentTxn(from, to string, fee, amount, firstRound, lastRound uint64, note []byte, closeRemainderTo, genesisID string, genesisHash []byte) (types.Transaction, error)

MakePaymentTxn constructs a payment transaction using the passed parameters. `from` and `to` addresses should be checksummed, human-readable addresses fee is fee per byte as received from algod SuggestedFee API call Deprecated: next major version will use a Params object, see package future

func MakePaymentTxnWithFlatFee

func MakePaymentTxnWithFlatFee(from, to string, fee, amount, firstRound, lastRound uint64, note []byte, closeRemainderTo, genesisID string, genesisHash []byte) (types.Transaction, error)

MakePaymentTxnWithFlatFee constructs a payment transaction using the passed parameters. `from` and `to` addresses should be checksummed, human-readable addresses fee is a flat fee Deprecated: next major version will use a Params object, see package future

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL