Documentation ¶
Index ¶
- func OAdd(a uint64, b uint64) (res uint64, overflowed bool)
- func OAdd16(a uint16, b uint16) (res uint16, overflowed bool)
- func OMul(a uint64, b uint64) (res uint64, overflowed bool)
- func OSub(a uint64, b uint64) (res uint64, overflowed bool)
- type Address
- type Bid
- type Digest
- type Header
- type KeyregTxnFields
- type MasterDerivationKey
- type MicroAlgos
- type MultisigSig
- type MultisigSubsig
- type NoteField
- type NoteFieldType
- type PaymentTxnFields
- type Round
- type Signature
- type SignedBid
- type SignedTxn
- type Transaction
- type TxType
- type VRFPK
- type VotePK
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address [hashLenBytes]byte
Address represents an Algorand address.
func DecodeAddress ¶
DecodeAddress turns a checksum address string into an Address object. It checks that the checksum is correct, and returns an error if it's not.
type Bid ¶
type Bid struct { // BidderKey identifies the bidder placing this bid. BidderKey Address `codec:"bidder"` // BidCurrency specifies how much external currency the bidder // is putting in with this bid. BidCurrency uint64 `codec:"cur"` // MaxPrice specifies the maximum price, in units of external // currency per Algo, that the bidder is willing to pay. // This must be at least as high as the current price of the // auction in the block in which this bid appears. MaxPrice uint64 `codec:"price"` // BidID identifies this bid. The first bid by a bidder (identified // by BidderKey) with a particular BidID on the blockchain will be // considered, preventing replay of bids. Specifying a different // BidID allows the bidder to place multiple bids in an auction. BidID uint64 `codec:"id"` // AuctionKey specifies the auction for this bid. AuctionKey Address `codec:"auc"` // AuctionID identifies the auction for which this bid is intended. AuctionID uint64 `codec:"aid"` // contains filtered or unexported fields }
Bid represents a bid by a user as part of an auction.
type Header ¶
type Header struct { Sender Address `codec:"snd"` Fee MicroAlgos `codec:"fee"` FirstValid Round `codec:"fv"` LastValid Round `codec:"lv"` Note []byte `codec:"note"` GenesisID string `codec:"gen"` GenesisHash Digest `codec:"gh"` // contains filtered or unexported fields }
Header captures the fields common to every transaction type.
type KeyregTxnFields ¶
type KeyregTxnFields struct { VotePK VotePK `codec:"votekey"` SelectionPK VRFPK `codec:"selkey"` VoteFirst Round `codec:"votefst"` VoteLast Round `codec:"votelst"` VoteKeyDilution uint64 `codec:"votekd"` // contains filtered or unexported fields }
KeyregTxnFields captures the fields used for key registration transactions.
type MasterDerivationKey ¶
type MasterDerivationKey [32]byte
MasterDerivationKey is the secret key used to derive keys in wallets
type MicroAlgos ¶
type MicroAlgos uint64
MicroAlgos are the base unit of currency in Algorand
func ToMicroAlgos ¶
func ToMicroAlgos(algos uint64) MicroAlgos
func (MicroAlgos) ToAlgos ¶
func (microalgos MicroAlgos) ToAlgos() uint64
type MultisigSig ¶
type MultisigSig struct { Version uint8 `codec:"v"` Threshold uint8 `codec:"thr"` Subsigs []MultisigSubsig `codec:"subsig"` // contains filtered or unexported fields }
MultisigSig holds multiple Subsigs, as well as threshold and version info
type MultisigSubsig ¶
type MultisigSubsig struct { Key ed25519.PublicKey `codec:"pk"` Sig Signature `codec:"s"` // contains filtered or unexported fields }
MultisigSubsig contains a single public key and, optionally, a signature
type NoteField ¶
type NoteField struct { // Type indicates which type of a message this is Type NoteFieldType `codec:"t"` // SignedBid, for NoteBid type SignedBid SignedBid `codec:"b"` // contains filtered or unexported fields }
NoteField is the struct that represents an auction message.
type NoteFieldType ¶
type NoteFieldType string
NoteFieldType indicates a type of auction message encoded into a transaction's Note field.
const ( // NoteDeposit indicates a SignedDeposit message. NoteDeposit NoteFieldType = "d" // NoteBid indicates a SignedBid message. NoteBid NoteFieldType = "b" // NoteSettlement indicates a SignedSettlement message. NoteSettlement NoteFieldType = "s" // NoteParams indicates a SignedParams message. NoteParams NoteFieldType = "p" )
type PaymentTxnFields ¶
type PaymentTxnFields struct { Receiver Address `codec:"rcv"` Amount 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 Address `codec:"close"` // contains filtered or unexported fields }
PaymentTxnFields captures the fields used by payment transactions.
type SignedBid ¶
type SignedBid struct { // Bid contains information about the bid. Bid Bid `codec:"bid"` // Sig is a signature by the bidder, as identified in the bid // (Bid.BidderKey) over the hash of the Bid. Sig Signature `codec:"sig"` // contains filtered or unexported fields }
SignedBid represents a signed bid by a bidder.
type SignedTxn ¶
type SignedTxn struct { Sig Signature `codec:"sig"` Msig MultisigSig `codec:"msig"` Txn Transaction `codec:"txn"` // contains filtered or unexported fields }
SignedTxn wraps a transaction and a signature. The encoding of this struct is suitable to broadcast on the network
type Transaction ¶
type Transaction struct { // Type of transaction Type TxType `codec:"type"` // Common fields for all types of transactions Header // Fields for different types of transactions KeyregTxnFields PaymentTxnFields // contains filtered or unexported fields }
Transaction describes a transaction that can appear in a block.