Documentation ¶
Overview ¶
Package model defines generic datatypes for Flow blockchain data.
Index ¶
- Variables
- func TransactionEnvelopeHash(txn *entities.Transaction) ([]byte, error)
- func TransactionHash(txn *entities.Transaction) ([]byte, error)
- type BlockMeta
- func (b *BlockMeta) Clone() *BlockMeta
- func (*BlockMeta) Descriptor() ([]byte, []int)deprecated
- func (b *BlockMeta) Equal(other *BlockMeta) bool
- func (x *BlockMeta) GetHash() []byte
- func (x *BlockMeta) GetHeight() uint64
- func (x *BlockMeta) GetParent() []byte
- func (x *BlockMeta) GetTimestamp() uint64
- func (*BlockMeta) ProtoMessage()
- func (x *BlockMeta) ProtoReflect() protoreflect.Message
- func (x *BlockMeta) Reset()
- func (x *BlockMeta) String() string
- type ConstructOpts
- func (*ConstructOpts) Descriptor() ([]byte, []int)deprecated
- func (x *ConstructOpts) GetBlockHash() []byte
- func (x *ConstructOpts) GetBlockHashFromRemote() bool
- func (x *ConstructOpts) GetBlockHashRemoteServer() string
- func (x *ConstructOpts) GetExecutionEffort() uint64
- func (x *ConstructOpts) GetFees() uint64
- func (x *ConstructOpts) GetInclusionEffort() uint64
- func (x *ConstructOpts) GetInner() bool
- func (x *ConstructOpts) GetKeyId() uint32
- func (x *ConstructOpts) GetNewAccounts() uint64
- func (x *ConstructOpts) GetPayer() []byte
- func (x *ConstructOpts) GetProxyTransferPayload() string
- func (x *ConstructOpts) GetSequenceNumber() int64
- func (*ConstructOpts) ProtoMessage()
- func (x *ConstructOpts) ProtoReflect() protoreflect.Message
- func (x *ConstructOpts) Reset()
- func (x *ConstructOpts) String() string
- type IndexedBlock
- func (*IndexedBlock) Descriptor() ([]byte, []int)deprecated
- func (x *IndexedBlock) GetTimestamp() uint64
- func (x *IndexedBlock) GetTransactions() []*IndexedTransaction
- func (*IndexedBlock) ProtoMessage()
- func (x *IndexedBlock) ProtoReflect() protoreflect.Message
- func (x *IndexedBlock) Reset()
- func (x *IndexedBlock) String() string
- type IndexedTransaction
- func (*IndexedTransaction) Descriptor() ([]byte, []int)deprecated
- func (x *IndexedTransaction) GetErrorMessage() string
- func (x *IndexedTransaction) GetEvents() []*TransferEvent
- func (x *IndexedTransaction) GetFailed() bool
- func (x *IndexedTransaction) GetHash() []byte
- func (x *IndexedTransaction) GetOperations() []*Operation
- func (*IndexedTransaction) ProtoMessage()
- func (x *IndexedTransaction) ProtoReflect() protoreflect.Message
- func (x *IndexedTransaction) Reset()
- func (x *IndexedTransaction) String() string
- type Network
- type Operation
- func (*Operation) Descriptor() ([]byte, []int)deprecated
- func (x *Operation) GetAccount() []byte
- func (x *Operation) GetAmount() uint64
- func (x *Operation) GetProxyPublicKey() []byte
- func (x *Operation) GetReceiver() []byte
- func (x *Operation) GetTransferEvents() []*TransferEventdeprecated
- func (x *Operation) GetType() OperationType
- func (o *Operation) Pretty() string
- func (*Operation) ProtoMessage()
- func (x *Operation) ProtoReflect() protoreflect.Message
- func (x *Operation) Reset()
- func (x *Operation) String() string
- type OperationType
- func (OperationType) Descriptor() protoreflect.EnumDescriptor
- func (x OperationType) Enum() *OperationType
- func (OperationType) EnumDescriptor() ([]byte, []int)deprecated
- func (x OperationType) Number() protoreflect.EnumNumber
- func (x OperationType) String() string
- func (OperationType) Type() protoreflect.EnumType
- type TransferEvent
- func (*TransferEvent) Descriptor() ([]byte, []int)deprecated
- func (x *TransferEvent) GetAccount() []bytedeprecated
- func (x *TransferEvent) GetAmount() uint64
- func (x *TransferEvent) GetReceiver() []byte
- func (x *TransferEvent) GetSender() []byte
- func (x *TransferEvent) GetType() TransferType
- func (*TransferEvent) ProtoMessage()
- func (x *TransferEvent) ProtoReflect() protoreflect.Message
- func (x *TransferEvent) Reset()
- func (x *TransferEvent) String() string
- type TransferType
- func (TransferType) Descriptor() protoreflect.EnumDescriptor
- func (x TransferType) Enum() *TransferType
- func (TransferType) EnumDescriptor() ([]byte, []int)deprecated
- func (x TransferType) Number() protoreflect.EnumNumber
- func (x TransferType) String() string
- func (TransferType) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( Network_name = map[int32]string{ 0: "UNSPECIFIED_NETWORK", 1: "MAINNET", 2: "TESTNET", 3: "PREVIEWNET", } Network_value = map[string]int32{ "UNSPECIFIED_NETWORK": 0, "MAINNET": 1, "TESTNET": 2, "PREVIEWNET": 3, } )
Enum value maps for Network.
var ( OperationType_name = map[int32]string{ 0: "OPERATION_TYPE_UNSPECIFIED", 1: "CREATE_ACCOUNT", 2: "FEE", 3: "PROXY_TRANSFER", 4: "TRANSFER", } OperationType_value = map[string]int32{ "OPERATION_TYPE_UNSPECIFIED": 0, "CREATE_ACCOUNT": 1, "FEE": 2, "PROXY_TRANSFER": 3, "TRANSFER": 4, } )
Enum value maps for OperationType.
var ( TransferType_name = map[int32]string{ 0: "TRANSFER_TYPE_UNSPECIFIED", 1: "DEPOSIT", 3: "FEE_DEPOSIT", 4: "PROXY_DEPOSIT", 5: "PROXY_WITHDRAWAL", 2: "WITHDRAWAL", } TransferType_value = map[string]int32{ "TRANSFER_TYPE_UNSPECIFIED": 0, "DEPOSIT": 1, "FEE_DEPOSIT": 3, "PROXY_DEPOSIT": 4, "PROXY_WITHDRAWAL": 5, "WITHDRAWAL": 2, } )
Enum value maps for TransferType.
var File_model_proto protoreflect.FileDescriptor
Functions ¶
func TransactionEnvelopeHash ¶
func TransactionEnvelopeHash(txn *entities.Transaction) ([]byte, error)
TransactionEnvelopeHash computes the transaction's hash for use in transaction construction.
func TransactionHash ¶
func TransactionHash(txn *entities.Transaction) ([]byte, error)
TransactionHash computes the transaction's hash for use in computing a block's payload hash.
Types ¶
type BlockMeta ¶
type BlockMeta struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Parent []byte `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"` Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
BlockMeta represents the key block metadata for use in /network/status within the Rosetta API.
func (*BlockMeta) Descriptor
deprecated
func (*BlockMeta) Equal ¶
Equal returns whether the given BlockMeta has the same hash, height, and timestamp.
func (*BlockMeta) GetTimestamp ¶
func (*BlockMeta) ProtoMessage ¶
func (*BlockMeta) ProtoMessage()
func (*BlockMeta) ProtoReflect ¶
func (x *BlockMeta) ProtoReflect() protoreflect.Message
type ConstructOpts ¶
type ConstructOpts struct { BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` BlockHashFromRemote bool `protobuf:"varint,6,opt,name=block_hash_from_remote,json=blockHashFromRemote,proto3" json:"block_hash_from_remote,omitempty"` BlockHashRemoteServer string `` /* 128-byte string literal not displayed */ ExecutionEffort uint64 `protobuf:"varint,9,opt,name=execution_effort,json=executionEffort,proto3" json:"execution_effort,omitempty"` Fees uint64 `protobuf:"varint,8,opt,name=fees,proto3" json:"fees,omitempty"` KeyId uint32 `protobuf:"varint,12,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` InclusionEffort uint64 `protobuf:"varint,10,opt,name=inclusion_effort,json=inclusionEffort,proto3" json:"inclusion_effort,omitempty"` Inner bool `protobuf:"varint,2,opt,name=inner,proto3" json:"inner,omitempty"` NewAccounts uint64 `protobuf:"varint,11,opt,name=new_accounts,json=newAccounts,proto3" json:"new_accounts,omitempty"` Payer []byte `protobuf:"bytes,3,opt,name=payer,proto3" json:"payer,omitempty"` ProxyTransferPayload string `protobuf:"bytes,4,opt,name=proxy_transfer_payload,json=proxyTransferPayload,proto3" json:"proxy_transfer_payload,omitempty"` // hex-encoded SequenceNumber int64 `protobuf:"varint,5,opt,name=sequence_number,json=sequenceNumber,proto3" json:"sequence_number,omitempty"` // contains filtered or unexported fields }
ConstructOpts defines the options for Rosetta construction calls.
func (*ConstructOpts) Descriptor
deprecated
func (*ConstructOpts) Descriptor() ([]byte, []int)
Deprecated: Use ConstructOpts.ProtoReflect.Descriptor instead.
func (*ConstructOpts) GetBlockHash ¶
func (x *ConstructOpts) GetBlockHash() []byte
func (*ConstructOpts) GetBlockHashFromRemote ¶
func (x *ConstructOpts) GetBlockHashFromRemote() bool
func (*ConstructOpts) GetBlockHashRemoteServer ¶
func (x *ConstructOpts) GetBlockHashRemoteServer() string
func (*ConstructOpts) GetExecutionEffort ¶
func (x *ConstructOpts) GetExecutionEffort() uint64
func (*ConstructOpts) GetFees ¶
func (x *ConstructOpts) GetFees() uint64
func (*ConstructOpts) GetInclusionEffort ¶
func (x *ConstructOpts) GetInclusionEffort() uint64
func (*ConstructOpts) GetInner ¶
func (x *ConstructOpts) GetInner() bool
func (*ConstructOpts) GetKeyId ¶ added in v0.4.23
func (x *ConstructOpts) GetKeyId() uint32
func (*ConstructOpts) GetNewAccounts ¶
func (x *ConstructOpts) GetNewAccounts() uint64
func (*ConstructOpts) GetPayer ¶
func (x *ConstructOpts) GetPayer() []byte
func (*ConstructOpts) GetProxyTransferPayload ¶
func (x *ConstructOpts) GetProxyTransferPayload() string
func (*ConstructOpts) GetSequenceNumber ¶
func (x *ConstructOpts) GetSequenceNumber() int64
func (*ConstructOpts) ProtoMessage ¶
func (*ConstructOpts) ProtoMessage()
func (*ConstructOpts) ProtoReflect ¶
func (x *ConstructOpts) ProtoReflect() protoreflect.Message
func (*ConstructOpts) Reset ¶
func (x *ConstructOpts) Reset()
func (*ConstructOpts) String ¶
func (x *ConstructOpts) String() string
type IndexedBlock ¶
type IndexedBlock struct { Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Transactions []*IndexedTransaction `protobuf:"bytes,2,rep,name=transactions,proto3" json:"transactions,omitempty"` // contains filtered or unexported fields }
IndexedBlock represents a sealed block at a specific height.
func (*IndexedBlock) Descriptor
deprecated
func (*IndexedBlock) Descriptor() ([]byte, []int)
Deprecated: Use IndexedBlock.ProtoReflect.Descriptor instead.
func (*IndexedBlock) GetTimestamp ¶
func (x *IndexedBlock) GetTimestamp() uint64
func (*IndexedBlock) GetTransactions ¶
func (x *IndexedBlock) GetTransactions() []*IndexedTransaction
func (*IndexedBlock) ProtoMessage ¶
func (*IndexedBlock) ProtoMessage()
func (*IndexedBlock) ProtoReflect ¶
func (x *IndexedBlock) ProtoReflect() protoreflect.Message
func (*IndexedBlock) Reset ¶
func (x *IndexedBlock) Reset()
func (*IndexedBlock) String ¶
func (x *IndexedBlock) String() string
type IndexedTransaction ¶
type IndexedTransaction struct { ErrorMessage string `protobuf:"bytes,5,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` Events []*TransferEvent `protobuf:"bytes,4,rep,name=events,proto3" json:"events,omitempty"` Failed bool `protobuf:"varint,1,opt,name=failed,proto3" json:"failed,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` Operations []*Operation `protobuf:"bytes,3,rep,name=operations,proto3" json:"operations,omitempty"` // contains filtered or unexported fields }
IndexedTransaction represents a transaction within a sealed block.
func (*IndexedTransaction) Descriptor
deprecated
func (*IndexedTransaction) Descriptor() ([]byte, []int)
Deprecated: Use IndexedTransaction.ProtoReflect.Descriptor instead.
func (*IndexedTransaction) GetErrorMessage ¶
func (x *IndexedTransaction) GetErrorMessage() string
func (*IndexedTransaction) GetEvents ¶
func (x *IndexedTransaction) GetEvents() []*TransferEvent
func (*IndexedTransaction) GetFailed ¶
func (x *IndexedTransaction) GetFailed() bool
func (*IndexedTransaction) GetHash ¶
func (x *IndexedTransaction) GetHash() []byte
func (*IndexedTransaction) GetOperations ¶
func (x *IndexedTransaction) GetOperations() []*Operation
func (*IndexedTransaction) ProtoMessage ¶
func (*IndexedTransaction) ProtoMessage()
func (*IndexedTransaction) ProtoReflect ¶
func (x *IndexedTransaction) ProtoReflect() protoreflect.Message
func (*IndexedTransaction) Reset ¶
func (x *IndexedTransaction) Reset()
func (*IndexedTransaction) String ¶
func (x *IndexedTransaction) String() string
type Network ¶
type Network int32
Network specifies the Flow network.
func (Network) Descriptor ¶
func (Network) Descriptor() protoreflect.EnumDescriptor
func (Network) EnumDescriptor
deprecated
func (Network) Number ¶
func (x Network) Number() protoreflect.EnumNumber
func (Network) Type ¶
func (Network) Type() protoreflect.EnumType
type Operation ¶
type Operation struct { Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` ProxyPublicKey []byte `protobuf:"bytes,3,opt,name=proxy_public_key,json=proxyPublicKey,proto3" json:"proxy_public_key,omitempty"` Receiver []byte `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"` // Deprecated: Do not use. TransferEvents []*TransferEvent `protobuf:"bytes,5,rep,name=transfer_events,json=transferEvents,proto3" json:"transfer_events,omitempty"` Type OperationType `protobuf:"varint,6,opt,name=type,proto3,enum=model.OperationType" json:"type,omitempty"` // contains filtered or unexported fields }
Operation represents an individual operation within a transaction.
- CREATE_ACCOUNT type operations have account specified, and if it happens to be an account created with a Proxy.Vault, then the proxy_public_key will also be specified.
* FEE type operations have sender account, amount, and receiver specified.
- PROXY_TRANSFER and TRANSFER type operations have sender account, amount, and receiver specified. They might also include transfer_events if there are non-originator accounts involved in the transfer.
func (*Operation) Descriptor
deprecated
func (*Operation) GetAccount ¶
func (*Operation) GetProxyPublicKey ¶
func (*Operation) GetReceiver ¶
func (*Operation) GetTransferEvents
deprecated
func (x *Operation) GetTransferEvents() []*TransferEvent
Deprecated: Do not use.
func (*Operation) GetType ¶
func (x *Operation) GetType() OperationType
func (*Operation) Pretty ¶ added in v0.4.22
Pretty generates a custom-formatted representation of an operation.
func (*Operation) ProtoMessage ¶
func (*Operation) ProtoMessage()
func (*Operation) ProtoReflect ¶
func (x *Operation) ProtoReflect() protoreflect.Message
type OperationType ¶
type OperationType int32
OperationType specifies the type of an operation within an indexed transaction.
const ( OperationType_OPERATION_TYPE_UNSPECIFIED OperationType = 0 OperationType_CREATE_ACCOUNT OperationType = 1 OperationType_FEE OperationType = 2 OperationType_PROXY_TRANSFER OperationType = 3 OperationType_TRANSFER OperationType = 4 )
func (OperationType) Descriptor ¶
func (OperationType) Descriptor() protoreflect.EnumDescriptor
func (OperationType) Enum ¶
func (x OperationType) Enum() *OperationType
func (OperationType) EnumDescriptor
deprecated
func (OperationType) EnumDescriptor() ([]byte, []int)
Deprecated: Use OperationType.Descriptor instead.
func (OperationType) Number ¶
func (x OperationType) Number() protoreflect.EnumNumber
func (OperationType) String ¶
func (x OperationType) String() string
func (OperationType) Type ¶
func (OperationType) Type() protoreflect.EnumType
type TransferEvent ¶
type TransferEvent struct { // Deprecated: Do not use. Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` Receiver []byte `protobuf:"bytes,4,opt,name=receiver,proto3" json:"receiver,omitempty"` Sender []byte `protobuf:"bytes,5,opt,name=sender,proto3" json:"sender,omitempty"` Type TransferType `protobuf:"varint,3,opt,name=type,proto3,enum=model.TransferType" json:"type,omitempty"` // contains filtered or unexported fields }
TransferEvent represents an event corresponding to a transfer of FLOW within a transaction.
func (*TransferEvent) Descriptor
deprecated
func (*TransferEvent) Descriptor() ([]byte, []int)
Deprecated: Use TransferEvent.ProtoReflect.Descriptor instead.
func (*TransferEvent) GetAccount
deprecated
func (x *TransferEvent) GetAccount() []byte
Deprecated: Do not use.
func (*TransferEvent) GetAmount ¶
func (x *TransferEvent) GetAmount() uint64
func (*TransferEvent) GetReceiver ¶
func (x *TransferEvent) GetReceiver() []byte
func (*TransferEvent) GetSender ¶
func (x *TransferEvent) GetSender() []byte
func (*TransferEvent) GetType ¶
func (x *TransferEvent) GetType() TransferType
func (*TransferEvent) ProtoMessage ¶
func (*TransferEvent) ProtoMessage()
func (*TransferEvent) ProtoReflect ¶
func (x *TransferEvent) ProtoReflect() protoreflect.Message
func (*TransferEvent) Reset ¶
func (x *TransferEvent) Reset()
func (*TransferEvent) String ¶
func (x *TransferEvent) String() string
type TransferType ¶
type TransferType int32
TransferType specifies the type of a TransferEvent.
const ( TransferType_TRANSFER_TYPE_UNSPECIFIED TransferType = 0 TransferType_DEPOSIT TransferType = 1 TransferType_FEE_DEPOSIT TransferType = 3 TransferType_PROXY_DEPOSIT TransferType = 4 TransferType_PROXY_WITHDRAWAL TransferType = 5 TransferType_WITHDRAWAL TransferType = 2 )
func (TransferType) Descriptor ¶
func (TransferType) Descriptor() protoreflect.EnumDescriptor
func (TransferType) Enum ¶
func (x TransferType) Enum() *TransferType
func (TransferType) EnumDescriptor
deprecated
func (TransferType) EnumDescriptor() ([]byte, []int)
Deprecated: Use TransferType.Descriptor instead.
func (TransferType) Number ¶
func (x TransferType) Number() protoreflect.EnumNumber
func (TransferType) String ¶
func (x TransferType) String() string
func (TransferType) Type ¶
func (TransferType) Type() protoreflect.EnumType