transaction

package
v0.0.0-...-f36aa9e Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MinTxnFee = 1000

MinTxnFee is v5 consensus params, in microAlgos

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 MakeAssetAcceptanceTxn

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

MakeAssetAcceptanceTransaction 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 - creator is the address of the asset creator - index is the asset index

func MakeAssetAcceptanceTxnWithFlatFee

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

MakeAssetAcceptanceTransactionWithFlatFee 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 - creator is the address of the asset creator - index is the asset index

func MakeAssetConfigTxn

func MakeAssetConfigTxn(account string, feePerByte, firstRound, lastRound uint64, note []byte, genesisID string, genesisHash string, creator string,
	index uint64, newManager, newReserve, newFreeze, newClawback string) (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 - creator the address of the asset creator - index is the asset index id - for newManager, newReserve, newFreeze, newClawback see asset.go

func MakeAssetConfigTxnWithFlatFee

func MakeAssetConfigTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID, genesisHash, creator string,
	index uint64, newManager, newReserve, newFreeze, newClawback string) (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.

func MakeAssetCreateTxn

func MakeAssetCreateTxn(account string, feePerByte, firstRound, lastRound uint64, note []byte, genesisID string, genesisHash string,
	total uint64, defaultFrozen bool, manager string, reserve string, freeze string, clawback string, unitName string, assetName 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

func MakeAssetCreateTxnWithFlatFee

func MakeAssetCreateTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID string, genesisHash string,
	total uint64, defaultFrozen bool, manager string, reserve string, freeze string, clawback string, unitName string, assetName 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

func MakeAssetDestroyTxn

func MakeAssetDestroyTxn(account string, feePerByte, firstRound, lastRound uint64, note []byte, genesisID string, genesisHash string,
	creator 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 - creator is the address of the asset creator - index is the asset index

func MakeAssetDestroyTxnWithFlatFee

func MakeAssetDestroyTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID string, 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

func MakeAssetFreezeTxn

func MakeAssetFreezeTxn(account string, fee, firstRound, lastRound uint64, note []byte, genesisID string, genesisHash string,
	creator 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 - creator is the creator address for the asset - 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

func MakeAssetFreezeTxnWithFlatFee

func MakeAssetFreezeTxnWithFlatFee(account string, fee, firstRound, lastRound uint64, note []byte, genesisID string, 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.

func MakeAssetRevocationTxn

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

MakeAssetRevocationTransaction 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 - creator is the address of the asset creator - index is the asset index

func MakeAssetRevocationTxnWithFlatFee

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

MakeAssetRevocationTransactionWithFlatFee 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 - creator is the address of the asset creator - index is the asset index

func MakeAssetTransferTxn

func MakeAssetTransferTxn(account, recipient, closeAssetsTo string, amount, feePerByte, firstRound, lastRound uint64, note []byte,
	genesisID, genesisHash, creator 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 - creator is the address of the asset creator - index is the asset index

func MakeAssetTransferTxnWithFlatFee

func MakeAssetTransferTxnWithFlatFee(account, recipient, closeAssetsTo string, amount, fee, firstRound, lastRound uint64, note []byte,
	genesisID, genesisHash, creator 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 - creator is the address of the asset creator - index is the asset index

func MakeCmdTxn

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

MakeCmdTxn constructs an admin command 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

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

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

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

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

func MakeReviewTxn

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

func ValidateAddrs

func ValidateAddrs(from, to string) (types.Address, types.Address, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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