Documentation
¶
Index ¶
- Constants
- Variables
- type ApplicationCallTxnFields
- func (ac *ApplicationCallTxnFields) AddressByIndex(accountIdx uint64, sender basics.Address) (basics.Address, error)
- func (_ *ApplicationCallTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *ApplicationCallTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (ac *ApplicationCallTxnFields) Empty() bool
- func (ac *ApplicationCallTxnFields) IndexByAddress(target basics.Address, sender basics.Address) (uint64, error)
- func (z *ApplicationCallTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *ApplicationCallTxnFields) MsgIsZero() bool
- func (z *ApplicationCallTxnFields) Msgsize() (s int)
- func (z *ApplicationCallTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- type ApplyData
- func (_ *ApplyData) CanMarshalMsg(z interface{}) bool
- func (_ *ApplyData) CanUnmarshalMsg(z interface{}) bool
- func (ad ApplyData) Equal(o ApplyData) bool
- func (z *ApplyData) MarshalMsg(b []byte) (o []byte)
- func (z *ApplyData) MsgIsZero() bool
- func (z *ApplyData) Msgsize() (s int)
- func (z *ApplyData) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AssetConfigTxnFields
- func (_ *AssetConfigTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *AssetConfigTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *AssetConfigTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *AssetConfigTxnFields) MsgIsZero() bool
- func (z *AssetConfigTxnFields) Msgsize() (s int)
- func (z *AssetConfigTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AssetFreezeTxnFields
- func (_ *AssetFreezeTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *AssetFreezeTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *AssetFreezeTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *AssetFreezeTxnFields) MsgIsZero() bool
- func (z *AssetFreezeTxnFields) Msgsize() (s int)
- func (z *AssetFreezeTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AssetTransferTxnFields
- func (_ *AssetTransferTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *AssetTransferTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *AssetTransferTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *AssetTransferTxnFields) MsgIsZero() bool
- func (z *AssetTransferTxnFields) Msgsize() (s int)
- func (z *AssetTransferTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- type CompactCertTxnFields
- func (_ *CompactCertTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *CompactCertTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (cc CompactCertTxnFields) Empty() bool
- func (z *CompactCertTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *CompactCertTxnFields) MsgIsZero() bool
- func (z *CompactCertTxnFields) Msgsize() (s int)
- func (z *CompactCertTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- type ExplicitTxnContext
- type Header
- func (tx Header) Alive(tc TxnContext) error
- func (tx Header) Aux() []byte
- func (_ *Header) CanMarshalMsg(z interface{}) bool
- func (_ *Header) CanUnmarshalMsg(z interface{}) bool
- func (tx Header) First() basics.Round
- func (tx Header) Last() basics.Round
- func (z *Header) MarshalMsg(b []byte) (o []byte)
- func (z *Header) MsgIsZero() bool
- func (z *Header) Msgsize() (s int)
- func (tx Header) Src() basics.Address
- func (tx Header) TxFee() basics.MicroAlgos
- func (z *Header) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Input
- func (_ *Input) CanMarshalMsg(z interface{}) bool
- func (_ *Input) CanUnmarshalMsg(z interface{}) bool
- func (in Input) Digest(dst basics.Address) []byte
- func (in Input) Empty() bool
- func (z *Input) MarshalMsg(b []byte) (o []byte)
- func (z *Input) MsgIsZero() bool
- func (z *Input) Msgsize() (s int)
- func (z *Input) UnmarshalMsg(bts []byte) (o []byte, err error)
- type KeyregTxnFields
- func (_ *KeyregTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *KeyregTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *KeyregTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *KeyregTxnFields) MsgIsZero() bool
- func (z *KeyregTxnFields) Msgsize() (s int)
- func (z *KeyregTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- type LogicSig
- func (lsig *LogicSig) Blank() bool
- func (_ *LogicSig) CanMarshalMsg(z interface{}) bool
- func (_ *LogicSig) CanUnmarshalMsg(z interface{}) bool
- func (lsig *LogicSig) Equal(b *LogicSig) bool
- func (lsig *LogicSig) Len() int
- func (z *LogicSig) MarshalMsg(b []byte) (o []byte)
- func (z *LogicSig) MsgIsZero() bool
- func (z *LogicSig) Msgsize() (s int)
- func (z *LogicSig) UnmarshalMsg(bts []byte) (o []byte, err error)
- type MinFeeError
- func (_ MinFeeError) CanMarshalMsg(z interface{}) bool
- func (_ *MinFeeError) CanUnmarshalMsg(z interface{}) bool
- func (err MinFeeError) Error() string
- func (z MinFeeError) MarshalMsg(b []byte) (o []byte)
- func (z MinFeeError) MsgIsZero() bool
- func (z MinFeeError) Msgsize() (s int)
- func (z *MinFeeError) UnmarshalMsg(bts []byte) (o []byte, err error)
- type OnCompletion
- func (_ OnCompletion) CanMarshalMsg(z interface{}) bool
- func (_ *OnCompletion) CanUnmarshalMsg(z interface{}) bool
- func (z OnCompletion) MarshalMsg(b []byte) (o []byte)
- func (z OnCompletion) MsgIsZero() bool
- func (z OnCompletion) Msgsize() (s int)
- func (i OnCompletion) String() string
- func (z *OnCompletion) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PaymentTxnFields
- func (_ *PaymentTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *PaymentTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (payment PaymentTxnFields) Empty() bool
- func (z *PaymentTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *PaymentTxnFields) MsgIsZero() bool
- func (z *PaymentTxnFields) Msgsize() (s int)
- func (z *PaymentTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Payset
- func (_ Payset) CanMarshalMsg(z interface{}) bool
- func (_ *Payset) CanUnmarshalMsg(z interface{}) bool
- func (payset Payset) CommitFlat() crypto.Digest
- func (payset Payset) CommitGenesis() crypto.Digest
- func (z Payset) MarshalMsg(b []byte) (o []byte)
- func (z Payset) MsgIsZero() bool
- func (z Payset) Msgsize() (s int)
- func (payset Payset) ToBeHashed() (protocol.HashID, []byte)
- func (z *Payset) UnmarshalMsg(bts []byte) (o []byte, err error)
- type SignedTxn
- func (s SignedTxn) Authorizer() basics.Address
- func (_ *SignedTxn) CanMarshalMsg(z interface{}) bool
- func (_ *SignedTxn) CanUnmarshalMsg(z interface{}) bool
- func (s SignedTxn) GetEncodedLength() int
- func (s SignedTxn) ID() Txid
- func (z *SignedTxn) MarshalMsg(b []byte) (o []byte)
- func (stxn *SignedTxn) MessUpSigForTesting()
- func (z *SignedTxn) MsgIsZero() bool
- func (z *SignedTxn) Msgsize() (s int)
- func (z *SignedTxn) UnmarshalMsg(bts []byte) (o []byte, err error)
- type SignedTxnInBlock
- func (_ *SignedTxnInBlock) CanMarshalMsg(z interface{}) bool
- func (_ *SignedTxnInBlock) CanUnmarshalMsg(z interface{}) bool
- func (s SignedTxnInBlock) GetEncodedLength() int
- func (s *SignedTxnInBlock) Hash() crypto.Digest
- func (s SignedTxnInBlock) ID()
- func (z *SignedTxnInBlock) MarshalMsg(b []byte) (o []byte)
- func (z *SignedTxnInBlock) MsgIsZero() bool
- func (z *SignedTxnInBlock) Msgsize() (s int)
- func (s *SignedTxnInBlock) ToBeHashed() (protocol.HashID, []byte)
- func (z *SignedTxnInBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
- type SignedTxnWithAD
- func (_ *SignedTxnWithAD) CanMarshalMsg(z interface{}) bool
- func (_ *SignedTxnWithAD) CanUnmarshalMsg(z interface{}) bool
- func (z *SignedTxnWithAD) MarshalMsg(b []byte) (o []byte)
- func (z *SignedTxnWithAD) MsgIsZero() bool
- func (z *SignedTxnWithAD) Msgsize() (s int)
- func (z *SignedTxnWithAD) UnmarshalMsg(bts []byte) (o []byte, err error)
- type SpecialAddresses
- type Transaction
- func (_ *Transaction) CanMarshalMsg(z interface{}) bool
- func (_ *Transaction) CanUnmarshalMsg(z interface{}) bool
- func (tx Transaction) EstimateEncodedSize() int
- func (tx Transaction) GetReceiverAddress() basics.Address
- func (tx Transaction) ID() Txid
- func (z *Transaction) MarshalMsg(b []byte) (o []byte)
- func (tx Transaction) MatchAddress(addr basics.Address, spec SpecialAddresses) bool
- func (z *Transaction) MsgIsZero() bool
- func (z *Transaction) Msgsize() (s int)
- func (tx Transaction) RelevantAddrs(spec SpecialAddresses) []basics.Address
- func (tx Transaction) Sign(secrets *crypto.SignatureSecrets) SignedTxn
- func (tx Transaction) ToBeHashed() (protocol.HashID, []byte)
- func (tx Transaction) TxAmount() basics.MicroAlgos
- func (z *Transaction) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (tx Transaction) WellFormed(spec SpecialAddresses, proto config.ConsensusParams) error
- type TxGroup
- func (_ *TxGroup) CanMarshalMsg(z interface{}) bool
- func (_ *TxGroup) CanUnmarshalMsg(z interface{}) bool
- func (z *TxGroup) MarshalMsg(b []byte) (o []byte)
- func (z *TxGroup) MsgIsZero() bool
- func (z *TxGroup) Msgsize() (s int)
- func (tg TxGroup) ToBeHashed() (protocol.HashID, []byte)
- func (z *TxGroup) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Txid
- func (_ *Txid) CanMarshalMsg(z interface{}) bool
- func (_ *Txid) CanUnmarshalMsg(z interface{}) bool
- func (z *Txid) MarshalMsg(b []byte) []byte
- func (z *Txid) MsgIsZero() bool
- func (z *Txid) Msgsize() int
- func (txid Txid) String() string
- func (z *Txid) UnmarshalMsg(bts []byte) ([]byte, error)
- func (txid *Txid) UnmarshalText(text []byte) error
- type TxnContext
- type TxnDeadError
Constants ¶
const EvalMaxArgs = 255
EvalMaxArgs is the maximum number of arguments to an LSig
Variables ¶
var CompactCertSender basics.Address
CompactCertSender is the computed address for sending out compact certs.
Functions ¶
This section is empty.
Types ¶
type ApplicationCallTxnFields ¶
type ApplicationCallTxnFields struct { // ApplicationID is 0 when creating an application, and nonzero when // calling an existing application. ApplicationID basics.AppIndex `codec:"apid"` // OnCompletion specifies an optional side-effect that this transaction // will have on the balance record of the sender or the application's // creator. See the documentation for the OnCompletion type for more // information on each possible value. OnCompletion OnCompletion `codec:"apan"` // ApplicationArgs are arguments accessible to the executing // ApprovalProgram or ClearStateProgram. ApplicationArgs [][]byte `codec:"apaa,allocbound=encodedMaxApplicationArgs"` // Accounts are accounts whose balance records are accessible by the // executing ApprovalProgram or ClearStateProgram. To access LocalState // for an account besides the sender, that account's address must be // listed here. Accounts []basics.Address `codec:"apat,allocbound=encodedMaxAccounts"` // ForeignApps are application IDs for applications besides this one // whose GlobalState may be read by the executing ApprovalProgram or // ClearStateProgram. ForeignApps []basics.AppIndex `codec:"apfa,allocbound=encodedMaxForeignApps"` // ForeignAssets are asset IDs for assets whose AssetParams may be read // by the executing ApprovalProgram or ClearStateProgram. ForeignAssets []basics.AssetIndex `codec:"apas,allocbound=encodedMaxForeignAssets"` // LocalStateSchema specifies the maximum number of each type that may // appear in the local key/value store of users who opt in to this // application. This field is only used during application creation // (when the ApplicationID field is 0), LocalStateSchema basics.StateSchema `codec:"apls"` // GlobalStateSchema specifies the maximum number of each type that may // appear in the global key/value store associated with this // application. This field is only used during application creation // (when the ApplicationID field is 0). GlobalStateSchema basics.StateSchema `codec:"apgs"` // ApprovalProgram is the stateful TEAL bytecode that executes on all // ApplicationCall transactions associated with this application, // except for those where OnCompletion is equal to ClearStateOC. If // this program fails, the transaction is rejected. This program may // read and write local and global state for this application. ApprovalProgram []byte `codec:"apap,allocbound=config.MaxAvailableAppProgramLen"` // ClearStateProgram is the stateful TEAL bytecode that executes on // ApplicationCall transactions associated with this application when // OnCompletion is equal to ClearStateOC. This program will not cause // the transaction to be rejected, even if it fails. This program may // read and write local and global state for this application. ClearStateProgram []byte `codec:"apsu,allocbound=config.MaxAvailableAppProgramLen"` // ExtraProgramPages specifies the additional app program len requested in pages. // A page is MaxAppProgramLen bytes. This field enables execution of app programs // larger than the default config, MaxAppProgramLen. ExtraProgramPages uint32 `codec:"apep,omitempty"` // contains filtered or unexported fields }
ApplicationCallTxnFields captures the transaction fields used for all interactions with applications
func (*ApplicationCallTxnFields) AddressByIndex ¶
func (ac *ApplicationCallTxnFields) AddressByIndex(accountIdx uint64, sender basics.Address) (basics.Address, error)
AddressByIndex converts an integer index into an address associated with the transaction. Index 0 corresponds to the transaction sender, and an index > 0 corresponds to an offset into txn.Accounts. Returns an error if the index is not valid.
func (*ApplicationCallTxnFields) CanMarshalMsg ¶
func (_ *ApplicationCallTxnFields) CanMarshalMsg(z interface{}) bool
func (*ApplicationCallTxnFields) CanUnmarshalMsg ¶
func (_ *ApplicationCallTxnFields) CanUnmarshalMsg(z interface{}) bool
func (*ApplicationCallTxnFields) Empty ¶
func (ac *ApplicationCallTxnFields) Empty() bool
Empty indicates whether or not all the fields in the ApplicationCallTxnFields are zeroed out
func (*ApplicationCallTxnFields) IndexByAddress ¶
func (ac *ApplicationCallTxnFields) IndexByAddress(target basics.Address, sender basics.Address) (uint64, error)
IndexByAddress converts an address into an integer offset into [txn.Sender, txn.Accounts[0], ...], returning the index at the first match. It returns an error if there is no such match.
func (*ApplicationCallTxnFields) MarshalMsg ¶
func (z *ApplicationCallTxnFields) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*ApplicationCallTxnFields) MsgIsZero ¶
func (z *ApplicationCallTxnFields) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*ApplicationCallTxnFields) Msgsize ¶
func (z *ApplicationCallTxnFields) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ApplicationCallTxnFields) UnmarshalMsg ¶
func (z *ApplicationCallTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type ApplyData ¶
type ApplyData struct { // Closing amount for transaction. ClosingAmount basics.MicroAlgos `codec:"ca"` // Closing amount for asset transaction. AssetClosingAmount uint64 `codec:"aca"` // Rewards applied to the Sender, Receiver, and CloseRemainderTo accounts. SenderRewards basics.MicroAlgos `codec:"rs"` ReceiverRewards basics.MicroAlgos `codec:"rr"` CloseRewards basics.MicroAlgos `codec:"rc"` EvalDelta basics.EvalDelta `codec:"dt"` // contains filtered or unexported fields }
ApplyData contains information about the transaction's execution.
func (*ApplyData) CanMarshalMsg ¶
func (*ApplyData) CanUnmarshalMsg ¶
func (ApplyData) Equal ¶
Equal returns true if two ApplyDatas are equal, ignoring nilness equality on EvalDelta's internal deltas (see EvalDelta.Equal for more information)
func (*ApplyData) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type AssetConfigTxnFields ¶
type AssetConfigTxnFields struct { // ConfigAsset is the asset being configured or destroyed. // A zero value means allocation ConfigAsset basics.AssetIndex `codec:"caid"` // AssetParams are the parameters for the asset being // created or re-configured. A zero value means destruction. AssetParams basics.AssetParams `codec:"apar"` // contains filtered or unexported fields }
AssetConfigTxnFields captures the fields used for asset allocation, re-configuration, and destruction.
func (*AssetConfigTxnFields) CanMarshalMsg ¶
func (_ *AssetConfigTxnFields) CanMarshalMsg(z interface{}) bool
func (*AssetConfigTxnFields) CanUnmarshalMsg ¶
func (_ *AssetConfigTxnFields) CanUnmarshalMsg(z interface{}) bool
func (*AssetConfigTxnFields) MarshalMsg ¶
func (z *AssetConfigTxnFields) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*AssetConfigTxnFields) MsgIsZero ¶
func (z *AssetConfigTxnFields) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*AssetConfigTxnFields) Msgsize ¶
func (z *AssetConfigTxnFields) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AssetConfigTxnFields) UnmarshalMsg ¶
func (z *AssetConfigTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type AssetFreezeTxnFields ¶
type AssetFreezeTxnFields struct { // FreezeAccount is the address of the account whose asset // slot is being frozen or un-frozen. FreezeAccount basics.Address `codec:"fadd"` // FreezeAsset is the asset ID being frozen or un-frozen. FreezeAsset basics.AssetIndex `codec:"faid"` // AssetFrozen is the new frozen value. AssetFrozen bool `codec:"afrz"` // contains filtered or unexported fields }
AssetFreezeTxnFields captures the fields used for freezing asset slots.
func (*AssetFreezeTxnFields) CanMarshalMsg ¶
func (_ *AssetFreezeTxnFields) CanMarshalMsg(z interface{}) bool
func (*AssetFreezeTxnFields) CanUnmarshalMsg ¶
func (_ *AssetFreezeTxnFields) CanUnmarshalMsg(z interface{}) bool
func (*AssetFreezeTxnFields) MarshalMsg ¶
func (z *AssetFreezeTxnFields) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*AssetFreezeTxnFields) MsgIsZero ¶
func (z *AssetFreezeTxnFields) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*AssetFreezeTxnFields) Msgsize ¶
func (z *AssetFreezeTxnFields) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AssetFreezeTxnFields) UnmarshalMsg ¶
func (z *AssetFreezeTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type AssetTransferTxnFields ¶
type AssetTransferTxnFields struct { XferAsset basics.AssetIndex `codec:"xaid"` // AssetAmount is the amount of asset to transfer. // A zero amount transferred to self allocates that asset // in the account's Assets map. AssetAmount uint64 `codec:"aamt"` // AssetSender is 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. AssetSender basics.Address `codec:"asnd"` // AssetReceiver is the recipient of the transfer. AssetReceiver basics.Address `codec:"arcv"` // 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 creator account. AssetCloseTo basics.Address `codec:"aclose"` // contains filtered or unexported fields }
AssetTransferTxnFields captures the fields used for asset transfers.
func (*AssetTransferTxnFields) CanMarshalMsg ¶
func (_ *AssetTransferTxnFields) CanMarshalMsg(z interface{}) bool
func (*AssetTransferTxnFields) CanUnmarshalMsg ¶
func (_ *AssetTransferTxnFields) CanUnmarshalMsg(z interface{}) bool
func (*AssetTransferTxnFields) MarshalMsg ¶
func (z *AssetTransferTxnFields) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*AssetTransferTxnFields) MsgIsZero ¶
func (z *AssetTransferTxnFields) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*AssetTransferTxnFields) Msgsize ¶
func (z *AssetTransferTxnFields) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AssetTransferTxnFields) UnmarshalMsg ¶
func (z *AssetTransferTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type CompactCertTxnFields ¶
type CompactCertTxnFields struct { CertRound basics.Round `codec:"certrnd"` CertType protocol.CompactCertType `codec:"certtype"` Cert compactcert.Cert `codec:"cert"` // contains filtered or unexported fields }
CompactCertTxnFields captures the fields used for compact cert transactions.
func (*CompactCertTxnFields) CanMarshalMsg ¶
func (_ *CompactCertTxnFields) CanMarshalMsg(z interface{}) bool
func (*CompactCertTxnFields) CanUnmarshalMsg ¶
func (_ *CompactCertTxnFields) CanUnmarshalMsg(z interface{}) bool
func (CompactCertTxnFields) Empty ¶
func (cc CompactCertTxnFields) Empty() bool
Empty returns whether the CompactCertTxnFields are all zero, in the sense of being omitted in a msgpack encoding.
func (*CompactCertTxnFields) MarshalMsg ¶
func (z *CompactCertTxnFields) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*CompactCertTxnFields) MsgIsZero ¶
func (z *CompactCertTxnFields) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*CompactCertTxnFields) Msgsize ¶
func (z *CompactCertTxnFields) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CompactCertTxnFields) UnmarshalMsg ¶
func (z *CompactCertTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type ExplicitTxnContext ¶
type ExplicitTxnContext struct { ExplicitRound basics.Round Proto config.ConsensusParams GenID string GenHash crypto.Digest }
ExplicitTxnContext is a struct that implements TxnContext with explicit fields for everything.
func (ExplicitTxnContext) ConsensusProtocol ¶
func (tc ExplicitTxnContext) ConsensusProtocol() config.ConsensusParams
ConsensusProtocol implements the TxnContext interface
func (ExplicitTxnContext) GenesisHash ¶
func (tc ExplicitTxnContext) GenesisHash() crypto.Digest
GenesisHash implements the TxnContext interface
func (ExplicitTxnContext) GenesisID ¶
func (tc ExplicitTxnContext) GenesisID() string
GenesisID implements the TxnContext interface
func (ExplicitTxnContext) Round ¶
func (tc ExplicitTxnContext) Round() basics.Round
Round implements the TxnContext interface
type Header ¶
type Header struct { Sender basics.Address `codec:"snd"` Fee basics.MicroAlgos `codec:"fee"` FirstValid basics.Round `codec:"fv"` LastValid basics.Round `codec:"lv"` Note []byte `codec:"note,allocbound=config.MaxTxnNoteBytes"` // Uniqueness or app-level data about txn GenesisID string `codec:"gen"` GenesisHash crypto.Digest `codec:"gh"` // Group specifies that this transaction is part of a // transaction group (and, if so, specifies the hash // of a TxGroup). Group crypto.Digest `codec:"grp"` // Lease enforces mutual exclusion of transactions. If this field is // nonzero, then once the transaction is confirmed, it acquires the // lease identified by the (Sender, Lease) pair of the transaction until // the LastValid round passes. While this transaction possesses the // lease, no other transaction specifying this lease can be confirmed. Lease [32]byte `codec:"lx"` // RekeyTo, if nonzero, sets the sender's AuthAddr to the given address // If the RekeyTo address is the sender's actual address, the AuthAddr is set to zero // This allows "re-keying" a long-lived account -- rotating the signing key, changing // membership of a multisig account, etc. RekeyTo basics.Address `codec:"rekey"` // contains filtered or unexported fields }
Header captures the fields common to every transaction type.
func (Header) Alive ¶
func (tx Header) Alive(tc TxnContext) error
Alive checks to see if the transaction is still alive (can be applied) at the specified Round.
func (*Header) CanMarshalMsg ¶
func (*Header) CanUnmarshalMsg ¶
func (*Header) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Header) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Header) Src ¶
Src returns the address that posted the transaction. This is the account that pays the associated Fee.
func (Header) TxFee ¶
func (tx Header) TxFee() basics.MicroAlgos
TxFee returns the fee associated with this transaction.
type Input ¶
type Input struct { Source basics.InputAddress `codec:"src"` PublicKey []byte `codec:"key,allocbound=maxPublicKeyBytes"` Sig []byte `codec:"sig,allocbound=maxSignatureBytes"` // contains filtered or unexported fields }
func (*Input) CanMarshalMsg ¶
func (*Input) CanUnmarshalMsg ¶
func (*Input) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type KeyregTxnFields ¶
type KeyregTxnFields struct { VotePK crypto.OneTimeSignatureVerifier `codec:"votekey"` SelectionPK crypto.VRFVerifier `codec:"selkey"` VoteFirst basics.Round `codec:"votefst"` VoteLast basics.Round `codec:"votelst"` VoteKeyDilution uint64 `codec:"votekd"` Nonparticipation bool `codec:"nonpart"` // contains filtered or unexported fields }
KeyregTxnFields captures the fields used for key registration transactions.
func (*KeyregTxnFields) CanMarshalMsg ¶
func (_ *KeyregTxnFields) CanMarshalMsg(z interface{}) bool
func (*KeyregTxnFields) CanUnmarshalMsg ¶
func (_ *KeyregTxnFields) CanUnmarshalMsg(z interface{}) bool
func (*KeyregTxnFields) MarshalMsg ¶
func (z *KeyregTxnFields) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*KeyregTxnFields) MsgIsZero ¶
func (z *KeyregTxnFields) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*KeyregTxnFields) Msgsize ¶
func (z *KeyregTxnFields) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*KeyregTxnFields) UnmarshalMsg ¶
func (z *KeyregTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type LogicSig ¶
type LogicSig struct { // Logic signed by Sig or Msig, OR hashed to be the Address of an account. Logic []byte `codec:"l,allocbound=config.MaxLogicSigMaxSize"` Sig crypto.Signature `codec:"sig"` Msig crypto.MultisigSig `codec:"msig"` // Args are not signed, but checked by Logic Args [][]byte `codec:"arg,allocbound=EvalMaxArgs,allocbound=config.MaxLogicSigMaxSize"` // contains filtered or unexported fields }
LogicSig contains logic for validating a transaction. LogicSig is signed by an account, allowing delegation of operations. OR LogicSig defines a contract account.
func (*LogicSig) CanMarshalMsg ¶
func (*LogicSig) CanUnmarshalMsg ¶
func (*LogicSig) Equal ¶
Equal returns true if both LogicSig are equivalent.
Out of paranoia, Equal distinguishes zero-length byte slices from byte slice-typed nil values as they may have subtly different behaviors within the evaluation of a LogicSig, due to differences in msgpack encoding behavior.
func (*LogicSig) Len ¶
Len returns the length of Logic plus the length of the Args This is limited by config.ConsensusParams.LogicSigMaxSize
func (*LogicSig) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type MinFeeError ¶
type MinFeeError string
MinFeeError defines an error type which could be returned from the method WellFormed
func (MinFeeError) CanMarshalMsg ¶
func (_ MinFeeError) CanMarshalMsg(z interface{}) bool
func (*MinFeeError) CanUnmarshalMsg ¶
func (_ *MinFeeError) CanUnmarshalMsg(z interface{}) bool
func (MinFeeError) Error ¶
func (err MinFeeError) Error() string
func (MinFeeError) MarshalMsg ¶
func (z MinFeeError) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (MinFeeError) MsgIsZero ¶
func (z MinFeeError) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (MinFeeError) Msgsize ¶
func (z MinFeeError) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MinFeeError) UnmarshalMsg ¶
func (z *MinFeeError) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type OnCompletion ¶
type OnCompletion uint64
OnCompletion is an enum representing some layer 1 side effect that an ApplicationCall transaction will have if it is included in a block.
const ( // NoOpOC indicates that an application transaction will simply call its // ApprovalProgram NoOpOC OnCompletion = 0 // OptInOC indicates that an application transaction will allocate some // LocalState for the application in the sender's account OptInOC OnCompletion = 1 // CloseOutOC indicates that an application transaction will deallocate // some LocalState for the application from the user's account CloseOutOC OnCompletion = 2 // ClearStateOC is similar to CloseOutOC, but may never fail. This // allows users to reclaim their minimum balance from an application // they no longer wish to opt in to. When an ApplicationCall // transaction's OnCompletion is ClearStateOC, the ClearStateProgram // executes instead of the ApprovalProgram ClearStateOC OnCompletion = 3 // UpdateApplicationOC indicates that an application transaction will // update the ApprovalProgram and ClearStateProgram for the application UpdateApplicationOC OnCompletion = 4 // DeleteApplicationOC indicates that an application transaction will // delete the AppParams for the application from the creator's balance // record DeleteApplicationOC OnCompletion = 5 )
func (OnCompletion) CanMarshalMsg ¶
func (_ OnCompletion) CanMarshalMsg(z interface{}) bool
func (*OnCompletion) CanUnmarshalMsg ¶
func (_ *OnCompletion) CanUnmarshalMsg(z interface{}) bool
func (OnCompletion) MarshalMsg ¶
func (z OnCompletion) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (OnCompletion) MsgIsZero ¶
func (z OnCompletion) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (OnCompletion) Msgsize ¶
func (z OnCompletion) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (OnCompletion) String ¶
func (i OnCompletion) String() string
func (*OnCompletion) UnmarshalMsg ¶
func (z *OnCompletion) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type PaymentTxnFields ¶
type PaymentTxnFields struct { Receiver basics.Address `codec:"rcv"` Amount basics.MicroAlgos `codec:"amt"` // When CloseRemainderTo is set, it indicates that the // transaction is requesting that the account should be // closed, and all remaining funds be transferred to this // address. CloseRemainderTo basics.Address `codec:"close"` Input Input `codec:"input,allocbound=encodedMaxInputs"` // contains filtered or unexported fields }
PaymentTxnFields captures the fields used by payment transactions.
func (*PaymentTxnFields) CanMarshalMsg ¶
func (_ *PaymentTxnFields) CanMarshalMsg(z interface{}) bool
func (*PaymentTxnFields) CanUnmarshalMsg ¶
func (_ *PaymentTxnFields) CanUnmarshalMsg(z interface{}) bool
func (PaymentTxnFields) Empty ¶
func (payment PaymentTxnFields) Empty() bool
func (*PaymentTxnFields) MarshalMsg ¶
func (z *PaymentTxnFields) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*PaymentTxnFields) MsgIsZero ¶
func (z *PaymentTxnFields) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*PaymentTxnFields) Msgsize ¶
func (z *PaymentTxnFields) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PaymentTxnFields) UnmarshalMsg ¶
func (z *PaymentTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Payset ¶
type Payset []SignedTxnInBlock
A Payset represents a common, unforgeable, consistent, ordered set of SignedTxn objects.
func (Payset) CanMarshalMsg ¶
func (*Payset) CanUnmarshalMsg ¶
func (Payset) CommitFlat ¶
CommitFlat returns a commitment to the Payset, as a flat array.
func (Payset) CommitGenesis ¶
CommitGenesis is like Commit, but with special handling for zero-length but non-nil paysets.
func (Payset) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Payset) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Payset) ToBeHashed ¶
ToBeHashed implements the crypto.Hashable interface
type SignedTxn ¶
type SignedTxn struct { Sig crypto.Signature `codec:"sig"` Msig crypto.MultisigSig `codec:"msig"` Lsig LogicSig `codec:"lsig"` Txn Transaction `codec:"txn"` AuthAddr basics.Address `codec:"sgnr"` // contains filtered or unexported fields }
SignedTxn wraps a transaction and a signature. It exposes a Verify() method that verifies the signature and checks that the underlying transaction is well-formed. TODO: update this documentation now that there's multisig
func AssembleSignedTxn ¶
func AssembleSignedTxn(txn Transaction, sig crypto.Signature, msig crypto.MultisigSig) (SignedTxn, error)
AssembleSignedTxn assembles a multisig-signed transaction from a transaction an optional sig, and an optional multisig. No signature checking is done -- for example, this might only be a partial multisig TODO: is this method used anywhere, or is it safe to remove?
func (SignedTxn) Authorizer ¶
Authorizer returns the address against which the signature/msig/lsig should be checked, or so the SignedTxn claims. This is just s.AuthAddr or, if s.AuthAddr is zero, s.Txn.Sender. It's provided as a convenience method.
func (*SignedTxn) CanMarshalMsg ¶
func (*SignedTxn) CanUnmarshalMsg ¶
func (SignedTxn) GetEncodedLength ¶
GetEncodedLength returns the length in bytes of the encoded transaction
func (*SignedTxn) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*SignedTxn) MessUpSigForTesting ¶
func (stxn *SignedTxn) MessUpSigForTesting()
MessUpSigForTesting will mess up the signature so that Verify() will fail on the signed transaction. Intended to be used in tests outside the transactions package (e.g., block validation tests) where we want to check whether we're verifying signatures.
type SignedTxnInBlock ¶
type SignedTxnInBlock struct { SignedTxnWithAD HasGenesisID bool `codec:"hgi"` HasGenesisHash bool `codec:"hgh"` // contains filtered or unexported fields }
SignedTxnInBlock is how a signed transaction is encoded in a block.
func (*SignedTxnInBlock) CanMarshalMsg ¶
func (_ *SignedTxnInBlock) CanMarshalMsg(z interface{}) bool
func (*SignedTxnInBlock) CanUnmarshalMsg ¶
func (_ *SignedTxnInBlock) CanUnmarshalMsg(z interface{}) bool
func (SignedTxnInBlock) GetEncodedLength ¶
func (s SignedTxnInBlock) GetEncodedLength() int
GetEncodedLength returns the length in bytes of the encoded transaction
func (*SignedTxnInBlock) Hash ¶
func (s *SignedTxnInBlock) Hash() crypto.Digest
Hash implements an optimized version of crypto.HashObj(s).
func (SignedTxnInBlock) ID ¶
func (s SignedTxnInBlock) ID()
ID on SignedTxnInBlock should never be called, because the ID depends on the block from which this transaction will be decoded. By having a different return value from SignedTxn.ID(), we will catch errors at compile-time.
func (*SignedTxnInBlock) MarshalMsg ¶
func (z *SignedTxnInBlock) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*SignedTxnInBlock) MsgIsZero ¶
func (z *SignedTxnInBlock) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*SignedTxnInBlock) Msgsize ¶
func (z *SignedTxnInBlock) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*SignedTxnInBlock) ToBeHashed ¶
func (s *SignedTxnInBlock) ToBeHashed() (protocol.HashID, []byte)
ToBeHashed implements the crypto.Hashable interface.
func (*SignedTxnInBlock) UnmarshalMsg ¶
func (z *SignedTxnInBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type SignedTxnWithAD ¶
SignedTxnWithAD is a (decoded) SignedTxn with associated ApplyData
func WrapSignedTxnsWithAD ¶
func WrapSignedTxnsWithAD(txgroup []SignedTxn) []SignedTxnWithAD
WrapSignedTxnsWithAD takes an array SignedTxn and returns the same as SignedTxnWithAD Each txn's ApplyData is the default empty state.
func (*SignedTxnWithAD) CanMarshalMsg ¶
func (_ *SignedTxnWithAD) CanMarshalMsg(z interface{}) bool
func (*SignedTxnWithAD) CanUnmarshalMsg ¶
func (_ *SignedTxnWithAD) CanUnmarshalMsg(z interface{}) bool
func (*SignedTxnWithAD) MarshalMsg ¶
func (z *SignedTxnWithAD) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*SignedTxnWithAD) MsgIsZero ¶
func (z *SignedTxnWithAD) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*SignedTxnWithAD) Msgsize ¶
func (z *SignedTxnWithAD) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*SignedTxnWithAD) UnmarshalMsg ¶
func (z *SignedTxnWithAD) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type SpecialAddresses ¶
type SpecialAddresses struct { FeeSink basics.Address RewardsPool basics.Address InputPool basics.Address }
SpecialAddresses holds addresses with nonstandard properties.
type Transaction ¶
type Transaction struct { // Type of transaction Type protocol.TxType `codec:"type"` // Common fields for all types of transactions Header // Fields for different types of transactions KeyregTxnFields PaymentTxnFields AssetConfigTxnFields AssetTransferTxnFields AssetFreezeTxnFields ApplicationCallTxnFields CompactCertTxnFields // contains filtered or unexported fields }
Transaction describes a transaction that can appear in a block.
func (*Transaction) CanMarshalMsg ¶
func (_ *Transaction) CanMarshalMsg(z interface{}) bool
func (*Transaction) CanUnmarshalMsg ¶
func (_ *Transaction) CanUnmarshalMsg(z interface{}) bool
func (Transaction) EstimateEncodedSize ¶
func (tx Transaction) EstimateEncodedSize() int
EstimateEncodedSize returns the estimated encoded size of the transaction including the signature. This function is to be used for calculating the fee Note that it may be an underestimate if the transaction is signed in an unusual way (e.g., with an authaddr or via multisig or logicsig)
func (Transaction) GetReceiverAddress ¶
func (tx Transaction) GetReceiverAddress() basics.Address
GetReceiverAddress returns the address of the receiver. If the transaction has no receiver, it returns the empty address.
func (Transaction) ID ¶
func (tx Transaction) ID() Txid
ID returns the Txid (i.e., hash) of the transaction.
func (*Transaction) MarshalMsg ¶
func (z *Transaction) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (Transaction) MatchAddress ¶
func (tx Transaction) MatchAddress(addr basics.Address, spec SpecialAddresses) bool
MatchAddress checks if the transaction touches a given address.
func (*Transaction) MsgIsZero ¶
func (z *Transaction) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*Transaction) Msgsize ¶
func (z *Transaction) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Transaction) RelevantAddrs ¶
func (tx Transaction) RelevantAddrs(spec SpecialAddresses) []basics.Address
RelevantAddrs returns the addresses whose balance records this transaction will need to access. The header's default is to return just the sender and the fee sink.
func (Transaction) Sign ¶
func (tx Transaction) Sign(secrets *crypto.SignatureSecrets) SignedTxn
Sign signs a transaction using a given Account's secrets.
func (Transaction) ToBeHashed ¶
func (tx Transaction) ToBeHashed() (protocol.HashID, []byte)
ToBeHashed implements the crypto.Hashable interface.
func (Transaction) TxAmount ¶
func (tx Transaction) TxAmount() basics.MicroAlgos
TxAmount returns the amount paid to the recipient in this payment
func (*Transaction) UnmarshalMsg ¶
func (z *Transaction) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
func (Transaction) WellFormed ¶
func (tx Transaction) WellFormed(spec SpecialAddresses, proto config.ConsensusParams) error
WellFormed checks that the transaction looks reasonable on its own (but not necessarily valid against the actual ledger). It does not check signatures.
type TxGroup ¶
type TxGroup struct { // TxGroupHashes specifies a list of hashes of transactions that must appear // together, sequentially, in a block in order for the group to be // valid. Each hash in the list is a hash of a transaction with // the `Group` field omitted. TxGroupHashes []crypto.Digest `codec:"txlist,allocbound=config.MaxTxGroupSize"` // contains filtered or unexported fields }
TxGroup describes a group of transactions that must appear together in a specific order in a block.
func (*TxGroup) CanMarshalMsg ¶
func (*TxGroup) CanUnmarshalMsg ¶
func (*TxGroup) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*TxGroup) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (TxGroup) ToBeHashed ¶
ToBeHashed implements the crypto.Hashable interface.
type Txid ¶
Txid is a hash used to uniquely identify individual transactions
func (*Txid) CanMarshalMsg ¶
func (*Txid) CanUnmarshalMsg ¶
func (*Txid) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Txid) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Txid) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
func (*Txid) UnmarshalText ¶
UnmarshalText initializes the Address from an array of bytes.
type TxnContext ¶
type TxnContext interface { Round() basics.Round ConsensusProtocol() config.ConsensusParams GenesisID() string GenesisHash() crypto.Digest }
TxnContext describes the context in which a transaction can appear (pretty much, a block, but we don't have the definition of a block here, since that would be a circular dependency). This is used to decide if a transaction is alive or not.