Versions in this module Expand all Collapse all v0 v0.22.0 Aug 26, 2021 Changes in this version + const AccountKeyWeightThreshold + const AddressLength + const EventAccountAdded + const EventAccountContractAdded + const EventAccountContractRemoved + const EventAccountContractUpdated + const EventAccountCreated + const EventAccountKeyRemoved + var EmptyAddress = Address + var EmptyID = Identifier + var TransactionDomainTag = paddedDomainTag("FLOW-V0.0-transaction") + var UserDomainTag = paddedDomainTag("FLOW-V0.0-user") + func CalculateEventsHash(es []Event) (crypto.Hash, error) + func SignUserMessage(signer crypto.Signer, message []byte) ([]byte, error) + type Account struct + Address Address + Balance uint64 + Code []byte + Contracts map[string][]byte + Keys []*AccountKey + type AccountCreatedEvent Event + func (evt AccountCreatedEvent) Address() Address + type AccountKey struct + HashAlgo crypto.HashAlgorithm + Index int + PublicKey crypto.PublicKey + Revoked bool + SequenceNumber uint64 + SigAlgo crypto.SignatureAlgorithm + Weight int + func DecodeAccountKey(b []byte) (*AccountKey, error) + func NewAccountKey() *AccountKey + func (a *AccountKey) FromPrivateKey(privKey crypto.PrivateKey) *AccountKey + func (a *AccountKey) SetHashAlgo(hashAlgo crypto.HashAlgorithm) *AccountKey + func (a *AccountKey) SetPublicKey(pubKey crypto.PublicKey) *AccountKey + func (a *AccountKey) SetSigAlgo(sigAlgo crypto.SignatureAlgorithm) *AccountKey + func (a *AccountKey) SetWeight(weight int) *AccountKey + func (a AccountKey) Encode() []byte + func (a AccountKey) Validate() error + type Address [AddressLength]byte + func BytesToAddress(b []byte) Address + func HexToAddress(h string) Address + func ServiceAddress(chain ChainID) Address + func (a *Address) IsValid(chain ChainID) bool + func (a *Address) UnmarshalJSON(data []byte) error + func (a Address) Bytes() []byte + func (a Address) Hex() string + func (a Address) MarshalJSON() ([]byte, error) + func (a Address) String() string + type AddressGenerator struct + func NewAddressGenerator(chainID ChainID) *AddressGenerator + func (gen *AddressGenerator) Address() Address + func (gen *AddressGenerator) Next() *AddressGenerator + func (gen *AddressGenerator) NextAddress() Address + func (gen *AddressGenerator) SetIndex(i uint) *AddressGenerator + type Block struct + type BlockHeader struct + Height uint64 + ID Identifier + ParentID Identifier + Timestamp time.Time + type BlockPayload struct + CollectionGuarantees []*CollectionGuarantee + Seals []*BlockSeal + type BlockSeal struct + BlockID Identifier + ExecutionReceiptID Identifier + ExecutionReceiptSignatures [][]byte + ResultApprovalSignatures [][]byte + type ChainID string + const Emulator + const Mainnet + const Testnet + func (id ChainID) String() string + type Chunk struct + BlockID Identifier + CollectionIndex uint + EndState StateCommitment + EventCollection crypto.Hash + Index uint64 + NumberOfTransactions uint16 + StartState StateCommitment + TotalComputationUsed uint64 + type Collection struct + TransactionIDs []Identifier + func (c Collection) Encode() []byte + func (c Collection) ID() Identifier + type CollectionGuarantee struct + CollectionID Identifier + type Event struct + EventIndex int + Payload []byte + TransactionID Identifier + TransactionIndex int + Type string + Value cadence.Event + func (e *Event) Fingerprint() []byte + func (e Event) Encode() []byte + func (e Event) ID() string + func (e Event) String() string + type ExecutionResult struct + BlockID Identifier + Chunks []*Chunk + PreviousResultID Identifier + ServiceEvents []*ServiceEvent + type Identifier [32]byte + func BytesToID(b []byte) Identifier + func HashToID(hash []byte) Identifier + func HexToID(h string) Identifier + func (i Identifier) Bytes() []byte + func (i Identifier) Hex() string + func (i Identifier) String() string + type ProposalKey struct + Address Address + KeyIndex int + SequenceNumber uint64 + type ServiceEvent struct + Payload []byte + Type string + type StateCommitment Identifier + func BytesToStateCommitment(b []byte) StateCommitment + func HashToStateCommitment(hash []byte) StateCommitment + func HexToStateCommitment(h string) StateCommitment + type Transaction struct + Arguments [][]byte + Authorizers []Address + EnvelopeSignatures []TransactionSignature + GasLimit uint64 + Payer Address + PayloadSignatures []TransactionSignature + ProposalKey ProposalKey + ReferenceBlockID Identifier + Script []byte + func DecodeTransaction(transactionMessage []byte) (*Transaction, error) + func NewTransaction() *Transaction + func (t *Transaction) AddArgument(arg cadence.Value) error + func (t *Transaction) AddAuthorizer(address Address) *Transaction + func (t *Transaction) AddEnvelopeSignature(address Address, keyIndex int, sig []byte) *Transaction + func (t *Transaction) AddPayloadSignature(address Address, keyIndex int, sig []byte) *Transaction + func (t *Transaction) AddRawArgument(arg []byte) *Transaction + func (t *Transaction) Argument(i int) (cadence.Value, error) + func (t *Transaction) Encode() []byte + func (t *Transaction) EnvelopeMessage() []byte + func (t *Transaction) ID() Identifier + func (t *Transaction) PayloadMessage() []byte + func (t *Transaction) SetGasLimit(limit uint64) *Transaction + func (t *Transaction) SetPayer(address Address) *Transaction + func (t *Transaction) SetProposalKey(address Address, keyIndex int, sequenceNum uint64) *Transaction + func (t *Transaction) SetReferenceBlockID(blockID Identifier) *Transaction + func (t *Transaction) SetScript(script []byte) *Transaction + func (t *Transaction) SignEnvelope(address Address, keyIndex int, signer crypto.Signer) error + func (t *Transaction) SignPayload(address Address, keyIndex int, signer crypto.Signer) error + type TransactionResult struct + Error error + Events []Event + Status TransactionStatus + type TransactionSignature struct + Address Address + KeyIndex int + Signature []byte + SignerIndex int + type TransactionStatus int + const TransactionStatusExecuted + const TransactionStatusExpired + const TransactionStatusFinalized + const TransactionStatusPending + const TransactionStatusSealed + const TransactionStatusUnknown + func (s TransactionStatus) String() string