Documentation
¶
Index ¶
- func ConvertEventFilter(chain *chain.Chain, filter *EventFilter) (*logdb.EventFilter, error)
- func ConvertRange(chain *chain.Chain, r *Range) (*logdb.Range, error)
- type Account
- type BatchCallData
- type BatchCallResults
- type Beat2Message
- type BeatMessage
- type BlockMessage
- type CallData
- type CallResult
- type Clause
- type Clauses
- type Event
- type EventCriteria
- type EventFilter
- type EventMessage
- type FeesHistory
- type FeesPriority
- type FilteredEvent
- type FilteredTransfer
- type GetCodeResult
- type GetStorageResult
- type HealthStatus
- type JSONBlockSummary
- type JSONClause
- type JSONCollapsedBlock
- type JSONEmbeddedTx
- type JSONEvent
- type JSONExpandedBlock
- type JSONOutput
- type JSONRawBlockSummary
- type JSONTransfer
- type LogLevelRequest
- type LogLevelResponse
- type LogMeta
- type LogStatus
- type Network
- type Options
- type Output
- type PeerStats
- type PendingTxIDMessage
- type Range
- type RangeType
- type RawTransaction
- type RawTx
- type Receipt
- type ReceiptMeta
- type SendTxResult
- type Status
- type StorageEntry
- type StorageMap
- type StorageRangeOption
- type StorageRangeResult
- type SubscriptionEventFilter
- type SubscriptionTransferFilter
- type TopicSet
- type TraceCallOption
- type TraceClauseOption
- type Transfer
- type TransferFilter
- type TransferMessage
- type TxMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertEventFilter ¶ added in v2.3.1
func ConvertEventFilter(chain *chain.Chain, filter *EventFilter) (*logdb.EventFilter, error)
Types ¶
type Account ¶ added in v2.3.1
type Account struct {
Balance *math.HexOrDecimal256 `json:"balance"`
Energy *math.HexOrDecimal256 `json:"energy"`
HasCode bool `json:"hasCode"`
}
Account for marshal account
type BatchCallData ¶ added in v2.3.1
type BatchCallData struct {
Clauses Clauses `json:"clauses"`
Gas uint64 `json:"gas"`
GasPrice *math.HexOrDecimal256 `json:"gasPrice"`
ProvedWork *math.HexOrDecimal256 `json:"provedWork"`
Caller *thor.Address `json:"caller"`
GasPayer *thor.Address `json:"gasPayer"`
Expiration uint32 `json:"expiration"`
BlockRef string `json:"blockRef"`
}
BatchCallData executes a batch of codes
type BatchCallResults ¶ added in v2.3.1
type BatchCallResults []*CallResult
type Beat2Message ¶ added in v2.3.1
type Beat2Message struct {
Number uint32 `json:"number"`
ID thor.Bytes32 `json:"id"`
ParentID thor.Bytes32 `json:"parentID"`
Timestamp uint64 `json:"timestamp"`
TxsFeatures uint32 `json:"txsFeatures"`
BaseFeePerGas *math.HexOrDecimal256 `json:"baseFeePerGas,omitempty"`
GasLimit uint64 `json:"gasLimit"`
Bloom string `json:"bloom"`
K uint8 `json:"k"`
Obsolete bool `json:"obsolete"`
}
type BeatMessage ¶ added in v2.3.1
type BlockMessage ¶ added in v2.3.1
type BlockMessage struct {
Number uint32 `json:"number"`
ID thor.Bytes32 `json:"id"`
Size uint32 `json:"size"`
ParentID thor.Bytes32 `json:"parentID"`
Timestamp uint64 `json:"timestamp"`
GasLimit uint64 `json:"gasLimit"`
Beneficiary thor.Address `json:"beneficiary"`
GasUsed uint64 `json:"gasUsed"`
BaseFeePerGas *math.HexOrDecimal256 `json:"baseFeePerGas,omitempty"`
TotalScore uint64 `json:"totalScore"`
TxsRoot thor.Bytes32 `json:"txsRoot"`
TxsFeatures uint32 `json:"txsFeatures"`
StateRoot thor.Bytes32 `json:"stateRoot"`
ReceiptsRoot thor.Bytes32 `json:"receiptsRoot"`
COM bool `json:"com"`
Signer thor.Address `json:"signer"`
Transactions []thor.Bytes32 `json:"transactions"`
Obsolete bool `json:"obsolete"`
}
BlockMessage block piped by websocket
func ConvertBlock ¶ added in v2.3.1
func ConvertBlock(b *chain.ExtendedBlock) (*BlockMessage, error)
type CallData ¶ added in v2.3.1
type CallData struct {
Value *math.HexOrDecimal256 `json:"value"`
Data string `json:"data"`
Gas uint64 `json:"gas"`
GasPrice *math.HexOrDecimal256 `json:"gasPrice"`
Caller *thor.Address `json:"caller"`
}
CallData represents contract-call body
type CallResult ¶ added in v2.3.1
type CallResult struct {
Data string `json:"data"`
Events []*Event `json:"events"`
Transfers []*Transfer `json:"transfers"`
GasUsed uint64 `json:"gasUsed"`
Reverted bool `json:"reverted"`
VMError string `json:"vmError"`
}
func ConvertCallResultWithInputGas ¶ added in v2.3.1
func ConvertCallResultWithInputGas(vo *runtime.Output, inputGas uint64) *CallResult
type Clause ¶ added in v2.3.1
type Clause struct {
To *thor.Address `json:"to"`
Value *math.HexOrDecimal256 `json:"value"`
Data string `json:"data"`
}
func ConvertClause ¶ added in v2.3.1
ConvertClause convert a raw clause into a json format clause
type Event ¶ added in v2.3.1
type Event struct {
Address thor.Address `json:"address"`
Topics []thor.Bytes32 `json:"topics"`
Data string `json:"data"`
}
Event event.
type EventCriteria ¶ added in v2.3.1
type EventFilter ¶ added in v2.3.1
type EventFilter struct {
CriteriaSet []*EventCriteria `json:"criteriaSet,omitempty"`
Range *Range `json:"range,omitempty"`
Options *Options `json:"options,omitempty"`
Order logdb.Order `json:"order,omitempty"`
}
type EventMessage ¶ added in v2.3.1
type EventMessage struct {
Address thor.Address `json:"address"`
Topics []thor.Bytes32 `json:"topics"`
Data string `json:"data"`
Meta LogMeta `json:"meta"`
Obsolete bool `json:"obsolete"`
}
EventMessage event piped by websocket
func ConvertSubscriptionEvent ¶ added in v2.3.1
func ConvertSubscriptionEvent(header *block.Header, tx *tx.Transaction, clauseIndex uint32, event *tx.Event, obsolete bool) (*EventMessage, error)
type FeesHistory ¶ added in v2.3.1
type FeesPriority ¶ added in v2.3.1
type FilteredEvent ¶ added in v2.3.1
type FilteredEvent struct {
Address thor.Address `json:"address"`
Topics []*thor.Bytes32 `json:"topics"`
Data string `json:"data"`
Meta LogMeta `json:"meta"`
}
FilteredEvent only comes from one contract
func ConvertEvent ¶ added in v2.3.1
func ConvertEvent(event *logdb.Event, addIndexes bool) *FilteredEvent
Convert a logdb.Event into a json format Event
type FilteredTransfer ¶ added in v2.3.1
type FilteredTransfer struct {
Sender thor.Address `json:"sender"`
Recipient thor.Address `json:"recipient"`
Amount *math.HexOrDecimal256 `json:"amount"`
Meta LogMeta `json:"meta"`
}
func ConvertTransfer ¶ added in v2.3.1
func ConvertTransfer(transfer *logdb.Transfer, addIndexes bool) *FilteredTransfer
type GetCodeResult ¶ added in v2.3.1
type GetCodeResult struct {
Code string `json:"code"`
}
type GetStorageResult ¶ added in v2.3.1
type GetStorageResult struct {
Value string `json:"value"`
}
type HealthStatus ¶ added in v2.3.1
type JSONBlockSummary ¶ added in v2.3.1
type JSONBlockSummary struct {
Number uint32 `json:"number"`
ID thor.Bytes32 `json:"id"`
Size uint32 `json:"size"`
ParentID thor.Bytes32 `json:"parentID"`
Timestamp uint64 `json:"timestamp"`
GasLimit uint64 `json:"gasLimit"`
Beneficiary thor.Address `json:"beneficiary"`
GasUsed uint64 `json:"gasUsed"`
TotalScore uint64 `json:"totalScore"`
TxsRoot thor.Bytes32 `json:"txsRoot"`
TxsFeatures uint32 `json:"txsFeatures"`
StateRoot thor.Bytes32 `json:"stateRoot"`
ReceiptsRoot thor.Bytes32 `json:"receiptsRoot"`
COM bool `json:"com"`
Signer thor.Address `json:"signer"`
IsTrunk bool `json:"isTrunk"`
IsFinalized bool `json:"isFinalized"`
BaseFeePerGas *math.HexOrDecimal256 `json:"baseFeePerGas,omitempty"`
}
func BuildJSONBlockSummary ¶ added in v2.3.1
func BuildJSONBlockSummary(summary *chain.BlockSummary, isTrunk bool, isFinalized bool) *JSONBlockSummary
type JSONClause ¶ added in v2.3.1
type JSONClause struct {
To *thor.Address `json:"to"`
Value math.HexOrDecimal256 `json:"value"`
Data string `json:"data"`
}
type JSONCollapsedBlock ¶ added in v2.3.1
type JSONCollapsedBlock struct {
*JSONBlockSummary
Transactions []thor.Bytes32 `json:"transactions"`
}
type JSONEmbeddedTx ¶ added in v2.3.1
type JSONEmbeddedTx struct {
ID thor.Bytes32 `json:"id"`
Type uint8 `json:"type"`
ChainTag byte `json:"chainTag"`
BlockRef string `json:"blockRef"`
Expiration uint32 `json:"expiration"`
Clauses []*JSONClause `json:"clauses"`
GasPriceCoef *uint8 `json:"gasPriceCoef,omitempty"`
MaxFeePerGas *math.HexOrDecimal256 `json:"maxFeePerGas,omitempty"`
MaxPriorityFeePerGas *math.HexOrDecimal256 `json:"maxPriorityFeePerGas,omitempty"`
Gas uint64 `json:"gas"`
Origin thor.Address `json:"origin"`
Delegator *thor.Address `json:"delegator"`
Nonce math.HexOrDecimal64 `json:"nonce"`
DependsOn *thor.Bytes32 `json:"dependsOn"`
Size uint32 `json:"size"`
// receipt part
GasUsed uint64 `json:"gasUsed"`
GasPayer thor.Address `json:"gasPayer"`
Paid *math.HexOrDecimal256 `json:"paid"`
Reward *math.HexOrDecimal256 `json:"reward"`
Reverted bool `json:"reverted"`
Outputs []*JSONOutput `json:"outputs"`
}
func BuildJSONEmbeddedTxs ¶ added in v2.3.1
func BuildJSONEmbeddedTxs(txs tx.Transactions, receipts tx.Receipts) []*JSONEmbeddedTx
type JSONExpandedBlock ¶ added in v2.3.1
type JSONExpandedBlock struct {
*JSONBlockSummary
Transactions []*JSONEmbeddedTx `json:"transactions"`
}
type JSONOutput ¶ added in v2.3.1
type JSONOutput struct {
ContractAddress *thor.Address `json:"contractAddress"`
Events []*JSONEvent `json:"events"`
Transfers []*JSONTransfer `json:"transfers"`
}
type JSONRawBlockSummary ¶ added in v2.3.1
type JSONRawBlockSummary struct {
Raw string `json:"raw"`
}
type JSONTransfer ¶ added in v2.3.1
type LogLevelRequest ¶ added in v2.3.1
type LogLevelRequest struct {
Level string `json:"level"`
}
type LogLevelResponse ¶ added in v2.3.1
type LogLevelResponse struct {
CurrentLevel string `json:"currentLevel"`
}
type LogMeta ¶ added in v2.3.1
type LogMeta struct {
BlockID thor.Bytes32 `json:"blockID"`
BlockNumber uint32 `json:"blockNumber"`
BlockTimestamp uint64 `json:"blockTimestamp"`
TxID thor.Bytes32 `json:"txID"`
TxOrigin thor.Address `json:"txOrigin"`
ClauseIndex uint32 `json:"clauseIndex"`
TxIndex *uint32 `json:"txIndex,omitempty"`
LogIndex *uint32 `json:"logIndex,omitempty"`
}
type Options ¶ added in v2.3.1
type Output ¶ added in v2.3.1
type Output struct {
ContractAddress *thor.Address `json:"contractAddress"`
Events []*Event `json:"events"`
Transfers []*Transfer `json:"transfers"`
}
Output output of clause execution.
type PeerStats ¶ added in v2.3.1
type PeerStats struct {
Name string `json:"name"`
BestBlockID thor.Bytes32 `json:"bestBlockID"`
TotalScore uint64 `json:"totalScore"`
PeerID string `json:"peerID"`
NetAddr string `json:"netAddr"`
Inbound bool `json:"inbound"`
Duration uint64 `json:"duration"`
}
func ConvertPeersStats ¶ added in v2.3.1
type PendingTxIDMessage ¶ added in v2.3.1
type Range ¶ added in v2.3.1
type RawTransaction ¶ added in v2.3.1
type Receipt ¶ added in v2.3.1
type Receipt struct {
Type uint8 `json:"type,omitempty"`
GasUsed uint64 `json:"gasUsed"`
GasPayer thor.Address `json:"gasPayer"`
Paid *math.HexOrDecimal256 `json:"paid"`
Reward *math.HexOrDecimal256 `json:"reward"`
Reverted bool `json:"reverted"`
Meta ReceiptMeta `json:"meta"`
Outputs []*Output `json:"outputs"`
}
Receipt for json marshal
func ConvertReceipt ¶ added in v2.3.1
func ConvertReceipt(txReceipt *tx.Receipt, header *block.Header, tx *tx.Transaction) (*Receipt, error)
ConvertReceipt convert a raw clause into a jason format clause
type ReceiptMeta ¶ added in v2.3.1
type SendTxResult ¶ added in v2.3.1
SendTxResult is the response to the Send Tx method
type StorageEntry ¶ added in v2.3.1
type StorageMap ¶ added in v2.3.1
type StorageMap map[string]StorageEntry
type StorageRangeOption ¶ added in v2.3.1
type StorageRangeResult ¶ added in v2.3.1
type StorageRangeResult struct {
Storage StorageMap `json:"storage"`
NextKey *thor.Bytes32 `json:"nextKey"` // nil if Storage includes the last key in the trie.
}
type SubscriptionEventFilter ¶ added in v2.3.1
type SubscriptionEventFilter struct {
Address *thor.Address // restricts matches to events created by specific contracts
Topic0 *thor.Bytes32
Topic1 *thor.Bytes32
Topic2 *thor.Bytes32
Topic3 *thor.Bytes32
Topic4 *thor.Bytes32
}
SubscriptionEventFilter contains options for contract event filtering.
type SubscriptionTransferFilter ¶ added in v2.3.1
type SubscriptionTransferFilter struct {
TxOrigin *thor.Address // who send transaction
Sender *thor.Address // who transferred tokens
Recipient *thor.Address // who received tokens
}
SubscriptionTransferFilter contains options for contract transfer filtering.
type TraceCallOption ¶ added in v2.3.1
type TraceCallOption struct {
To *thor.Address `json:"to"`
Value *math.HexOrDecimal256 `json:"value"`
Data string `json:"data"`
Gas uint64 `json:"gas"`
GasPrice *math.HexOrDecimal256 `json:"gasPrice"`
ProvedWork *math.HexOrDecimal256 `json:"provedWork"`
Caller *thor.Address `json:"caller"`
GasPayer *thor.Address `json:"gasPayer"`
Expiration uint32 `json:"expiration"`
BlockRef string `json:"blockRef"`
Name string `json:"name"` // Tracer
Config json.RawMessage `json:"config"` // Config specific to given tracer.
}
type TraceClauseOption ¶ added in v2.3.1
type TraceClauseOption struct {
Name string `json:"name"`
Target string `json:"target"`
Config json.RawMessage `json:"config"` // Config specific to given tracer.
}
type Transfer ¶ added in v2.3.1
type Transfer struct {
Sender thor.Address `json:"sender"`
Recipient thor.Address `json:"recipient"`
Amount *math.HexOrDecimal256 `json:"amount"`
}
Transfer transfer log.
type TransferFilter ¶ added in v2.3.1
type TransferMessage ¶ added in v2.3.1
type TransferMessage struct {
Sender thor.Address `json:"sender"`
Recipient thor.Address `json:"recipient"`
Amount *math.HexOrDecimal256 `json:"amount"`
Meta LogMeta `json:"meta"`
Obsolete bool `json:"obsolete"`
}
TransferMessage transfer piped by websocket
func ConvertSubscriptionTransfer ¶ added in v2.3.1
func ConvertSubscriptionTransfer(header *block.Header, tx *tx.Transaction, clauseIndex uint32, transfer *tx.Transfer, obsolete bool) (*TransferMessage, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Distributed under the GNU Lesser General Public License v3.0 software license, see the accompanying file LICENSE or <https://www.gnu.org/licenses/lgpl-3.0.html>
|
Distributed under the GNU Lesser General Public License v3.0 software license, see the accompanying file LICENSE or <https://www.gnu.org/licenses/lgpl-3.0.html> |