Documentation ¶
Index ¶
- Constants
- Variables
- func NewBigInt(x uint64) *hexutil.Big
- func NewBigIntByRaw(x *big.Int) *hexutil.Big
- func NewBytes(input []byte) hexutil.Bytes
- func NewUint(x uint) *hexutil.Uint
- func NewUint64(x uint64) *hexutil.Uint64
- type AccessList
- type AccessTuple
- type AccountInfo
- type AccountPendingInfo
- type AccountPendingTransactions
- type ActionType
- type Address
- type Block
- type BlockHeader
- type BlockSummary
- type Bloom
- type Call
- type CallRequest
- type CallResult
- type CallType
- type CfxFilterChanges
- type ChainReorg
- type CheckBalanceAgainstTransactionResponse
- type ContractDeployOption
- type ContractMethodCallOption
- type ContractMethodSendOption
- type Create
- type CreateResult
- type CreateType
- type DepositInfo
- type Epoch
- type EpochOrBlockHash
- func (e *EpochOrBlockHash) IsBlockHash() (*common.Hash, bool, bool)
- func (e *EpochOrBlockHash) IsEpoch() (*Epoch, bool)
- func (e EpochOrBlockHash) MarshalJSON() ([]byte, error)
- func (e EpochOrBlockHash) MarshalText() ([]byte, error)
- func (e *EpochOrBlockHash) String() string
- func (e *EpochOrBlockHash) UnmarshalJSON(data []byte) error
- type EpochReceiptProof
- type EpochTrace
- type Estimate
- type FeeHistory
- type H128
- type Hash
- type HexOrDecimalUint64
- type InternalTransferAction
- type LocalizedBlockTrace
- type LocalizedTrace
- type LocalizedTraceNode
- type LocalizedTraceTire
- type LocalizedTransactionTrace
- type Log
- type LogFilter
- type NonceType
- type OutcomeType
- type PendingReason
- type PoSEconomics
- type PocketType
- type RewardInfo
- type SignedTransaction
- type SpaceType
- type SponsorInfo
- type Status
- type StorageChange
- type StorageCollateralInfo
- type StorageRoot
- type SubscriptionLog
- type TokenSupplyInfo
- type TraceCallWithResult
- type TraceCreateWithResult
- type TraceFilter
- type TraceType
- type Transaction
- type TransactionReceipt
- type TransactionStatus
- type TransactionType
- type TrieProof
- type TxPoolPendingNonceRange
- type TxPoolStatus
- type TxWithPoolInfo
- type UnsignedTransaction
- func (tx *UnsignedTransaction) ApplyDefault()
- func (tx *UnsignedTransaction) Decode(data []byte, networkID uint32) error
- func (tx *UnsignedTransaction) Encode() ([]byte, error)
- func (tx *UnsignedTransaction) EncodeWithSignature(v byte, r, s []byte) ([]byte, error)
- func (tx *UnsignedTransaction) Hash() ([]byte, error)
- type UnsignedTransactionBase
- type VanillaTrieNode
- type VoteStakeInfo
- type WebsocketEpochResponse
- type WrapTransaction
Constants ¶
const (
H128Length = 16
)
Variables ¶
var (
TRANSACTION_TYPE_PREFIX = []byte("cfx")
)
Functions ¶
func NewBigIntByRaw ¶ added in v0.1.1
NewBigIntByRaw creates a hexutil.big with specified big.int value.
Types ¶
type AccessList ¶ added in v1.5.10
type AccessList []AccessTuple
func ConvertEthAccessListToCfx ¶ added in v1.5.10
func ConvertEthAccessListToCfx(raw etypes.AccessList, networkID uint32) AccessList
func (AccessList) ToEthType ¶ added in v1.5.10
func (a AccessList) ToEthType() etypes.AccessList
type AccessTuple ¶ added in v1.5.10
type AccessTuple struct { Address cfxaddress.Address `json:"address"` StorageKeys []common.Hash `json:"storageKeys"` }
type AccountInfo ¶ added in v0.1.1
type AccountInfo struct { Address Address `json:"address"` Balance *hexutil.Big `json:"balance"` // : U256, Nonce *hexutil.Big `json:"nonce"` // : U256, CodeHash Hash `json:"codeHash"` // : H256, StakingBalance *hexutil.Big `json:"stakingBalance"` // : U256, CollateralForStorage *hexutil.Big `json:"collateralForStorage"` // : U256, AccumulatedInterestReturn *hexutil.Big `json:"accumulatedInterestReturn"` // : U256, Admin Address `json:"admin"` }
type AccountPendingInfo ¶ added in v0.1.1
type AccountPendingTransactions ¶ added in v0.1.1
type AccountPendingTransactions struct { PendingTransactions []Transaction `json:"pendingTransactions"` // type maybe string/Pending FirstTxStatus *TransactionStatus `json:"firstTxStatus"` PendingCount hexutil.Uint64 `json:"pendingCount"` }
type ActionType ¶ added in v0.1.1
type ActionType string
type Block ¶
type Block struct { BlockHeader Transactions []Transaction `json:"transactions"` }
Block represents a block in Conflux, including block header and a list of detailed transactions.
type BlockHeader ¶
type BlockHeader struct { Hash Hash `json:"hash"` ParentHash Hash `json:"parentHash"` Height *hexutil.Big `json:"height"` Miner Address `json:"miner"` DeferredStateRoot Hash `json:"deferredStateRoot"` DeferredReceiptsRoot Hash `json:"deferredReceiptsRoot"` DeferredLogsBloomHash Hash `json:"deferredLogsBloomHash"` Blame hexutil.Uint64 `json:"blame"` TransactionsRoot Hash `json:"transactionsRoot"` EpochNumber *hexutil.Big `json:"epochNumber"` BlockNumber *hexutil.Big `json:"blockNumber"` GasLimit *hexutil.Big `json:"gasLimit"` GasUsed *hexutil.Big `json:"gasUsed"` BaseFeePerGas *hexutil.Big `json:"baseFeePerGas,omitempty"` Timestamp *hexutil.Big `json:"timestamp"` Difficulty *hexutil.Big `json:"difficulty"` PowQuality *hexutil.Big `json:"powQuality"` RefereeHashes []Hash `json:"refereeHashes"` Adaptive bool `json:"adaptive"` Nonce *hexutil.Big `json:"nonce"` Size *hexutil.Big `json:"size"` Custom []cmptutil.Bytes `json:"custom"` PosReference *Hash `json:"posReference"` }
BlockHeader represents a block header in Conflux.
type BlockSummary ¶
type BlockSummary struct { BlockHeader Transactions []Hash `json:"transactions"` }
BlockSummary includes block header and a list of transaction hashes
type Call ¶ added in v0.1.1
type Call struct { Space SpaceType `json:"space"` From Address `json:"from"` To Address `json:"to"` Value hexutil.Big `json:"value"` Gas hexutil.Big `json:"gas"` Input hexutil.Bytes `json:"input"` CallType CallType `json:"callType"` }
independent action structs
type CallRequest ¶
type CallRequest struct { From *Address `json:"from,omitempty"` To *Address `json:"to,omitempty"` GasPrice *hexutil.Big `json:"gasPrice,omitempty"` Gas *hexutil.Big `json:"gas,omitempty"` Value *hexutil.Big `json:"value,omitempty"` // NOTE, cannot use *hexutil.Bytes or hexutil.Bytes here. // Otherwise, hexutil.Bytes.UnmarshalJSON will called to // unmarshal from nil and cause to errNonString error. Data *string `json:"data,omitempty"` Nonce *hexutil.Big `json:"nonce,omitempty"` StorageLimit *hexutil.Uint64 `json:"storageLimit,omitempty"` MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas,omitempty"` MaxFeePerGas *hexutil.Big `json:"maxFeePerGas,omitempty"` AccessList AccessList `json:"accessList,omitempty"` TransactionType *hexutil.Uint64 `json:"type,omitempty"` }
CallRequest represents a request to execute contract.
func (*CallRequest) FillByCallOption ¶ added in v0.1.1
func (request *CallRequest) FillByCallOption(option *ContractMethodCallOption)
FillByCallOption fills CallRequest fields by
func (*CallRequest) FillByUnsignedTx ¶
func (request *CallRequest) FillByUnsignedTx(tx *UnsignedTransaction)
FillByUnsignedTx fills CallRequest fields by tx
type CallResult ¶ added in v0.1.1
type CallResult struct { Outcome OutcomeType `json:"outcome"` GasLeft hexutil.Big `json:"gasLeft"` ReturnData hexutil.Bytes `json:"returnData"` }
type CfxFilterChanges ¶ added in v1.5.4
type CfxFilterChanges struct { Type string Logs []*SubscriptionLog Hashes []Hash }
func (CfxFilterChanges) MarshalJSON ¶ added in v1.5.4
func (u CfxFilterChanges) MarshalJSON() ([]byte, error)
func (*CfxFilterChanges) UnmarshalJSON ¶ added in v1.5.4
func (u *CfxFilterChanges) UnmarshalJSON(data []byte) error
type ChainReorg ¶ added in v0.1.1
type CheckBalanceAgainstTransactionResponse ¶ added in v0.1.1
type CheckBalanceAgainstTransactionResponse struct { /// Whether the account should pay transaction fee by self. WillPayTxFee bool `json:"willPayTxFee"` /// Whether the account should pay collateral by self. WillPayCollateral bool `json:"willPayCollateral"` /// Whether the account balance is enough for this transaction. IsBalanceEnough bool `json:"isBalanceEnough"` }
type ContractDeployOption ¶
type ContractDeployOption struct { UnsignedTransactionBase // TimeoutInSecond represents the timeout of deploy contract, // default value is 0 which means never timeout Timeout time.Duration }
ContractDeployOption for setting option when deploying contract
type ContractMethodCallOption ¶
type ContractMethodCallOption struct { From *Address Nonce *hexutil.Big GasPrice *hexutil.Big Gas *hexutil.Big Value *hexutil.Big StorageLimit *hexutil.Uint64 ChainID *hexutil.Big Epoch *Epoch }
ContractMethodCallOption for setting option when call contract method
type ContractMethodSendOption ¶
type ContractMethodSendOption UnsignedTransactionBase
ContractMethodSendOption for setting option when call contract method
type CreateResult ¶ added in v0.1.1
type CreateType ¶ added in v0.1.1
type CreateType string
const ( CREATE_NONE CreateType = "none" CREATE_CREATE CreateType = "create" CREATE_CREATE2 CreateType = "create2" )
type DepositInfo ¶ added in v0.1.1
type DepositInfo struct { AccumulatedInterestRate *hexutil.Big `json:"accumulatedInterestRate"` Amount *hexutil.Big `json:"amount"` DepositTime *hexutil.Big `json:"depositTime"` }
DepositInfo represents user deposit history
type Epoch ¶
type Epoch struct {
// contains filtered or unexported fields
}
Epoch represents an epoch in Conflux.
var ( EpochEarliest *Epoch = &Epoch{"earliest", nil} EpochLatestCheckpoint *Epoch = &Epoch{"latest_checkpoint", nil} EpochLatestConfirmed *Epoch = &Epoch{"latest_confirmed", nil} EpochLatestState *Epoch = &Epoch{"latest_state", nil} EpochLatestMined *Epoch = &Epoch{"latest_mined", nil} EpochLatestFinalized *Epoch = &Epoch{"latest_finalized", nil} )
Const epoch definitions
func NewEpochNumber ¶
NewEpochNumber creates an instance of Epoch with specified number.
func NewEpochNumberBig ¶ added in v0.1.1
NewEpochNumberBig creates an instance of Epoch with specified big number.
func NewEpochNumberUint64 ¶ added in v0.1.1
NewEpochNumberUint64 creates an instance of Epoch with specified uint64 number.
func (Epoch) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Epoch) UnmarshalJSON ¶ added in v0.1.1
UnmarshalJSON implements the json.Unmarshaler interface.
type EpochOrBlockHash ¶ added in v1.5.4
type EpochOrBlockHash struct {
// contains filtered or unexported fields
}
func NewEpochOrBlockHashWithBlockHash ¶ added in v1.5.4
func NewEpochOrBlockHashWithBlockHash(blockHash Hash, requirePivot ...bool) *EpochOrBlockHash
NewEpochOrBlockHashWithBlockHash creates an instance of Epoch with specified block hash.
func NewEpochOrBlockHashWithEpoch ¶ added in v1.5.4
func NewEpochOrBlockHashWithEpoch(epoch *Epoch) *EpochOrBlockHash
NewEpochOrBlockHashWithEpoch creates an instance of Epoch with specified epoch.
func (*EpochOrBlockHash) IsBlockHash ¶ added in v1.5.7
func (e *EpochOrBlockHash) IsBlockHash() (*common.Hash, bool, bool)
IsBlockHash returns "block hash" and "require pivot" if it is blockhash, and the 3rd return value represents if is block hash.
func (*EpochOrBlockHash) IsEpoch ¶ added in v1.5.7
func (e *EpochOrBlockHash) IsEpoch() (*Epoch, bool)
IsEpoch returns epoch if it is epoch, and the 2rd return value represents if is epoch.
func (EpochOrBlockHash) MarshalJSON ¶ added in v1.5.4
func (e EpochOrBlockHash) MarshalJSON() ([]byte, error)
func (EpochOrBlockHash) MarshalText ¶ added in v1.5.4
func (e EpochOrBlockHash) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*EpochOrBlockHash) String ¶ added in v1.5.4
func (e *EpochOrBlockHash) String() string
String implements the fmt.Stringer interface
func (*EpochOrBlockHash) UnmarshalJSON ¶ added in v1.5.4
func (e *EpochOrBlockHash) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type EpochReceiptProof ¶ added in v1.5.7
type EpochTrace ¶ added in v1.5.4
type EpochTrace struct { CfxTraces []*LocalizedTrace `json:"cfxTraces"` EthTraces []*web3gotypes.LocalizedTrace `json:"ethTraces"` MirrorAddressMap map[common.Address]cfxaddress.Address `json:"mirrorAddressMap"` }
type Estimate ¶
type Estimate struct { GasLimit *hexutil.Big `json:"gasLimit"` GasUsed *hexutil.Big `json:"gasUsed"` StorageCollateralized *hexutil.Big `json:"storageCollateralized"` }
Estimate represents estimated gas will be used and storage will be collateralized when transaction excutes
type FeeHistory ¶ added in v1.5.10
type FeeHistory struct { OldestEpoch *hexutil.Big `json:"oldestEpoch"` Reward [][]*hexutil.Big `json:"reward,omitempty"` BaseFee []*hexutil.Big `json:"baseFeePerGas,omitempty"` GasUsedRatio []float64 `json:"gasUsedRatio"` BlobBaseFee []*hexutil.Big `json:"baseFeePerBlobGas,omitempty"` BlobGasUsedRatio []float64 `json:"blobGasUsedRatio,omitempty"` }
type H128 ¶ added in v1.5.4
type H128 [H128Length]byte
func (H128) MarshalText ¶ added in v1.5.4
func (*H128) SetBytes ¶ added in v1.5.4
SetBytes sets the H128 to the value of b. If b is larger than len(h), b will be cropped from the left.
func (*H128) UnmarshalJSON ¶ added in v1.5.4
func (*H128) UnmarshalText ¶ added in v1.5.4
type Hash ¶
type Hash string
Hash represents the 32 byte Keccak256 hash of arbitrary data in HEX format.
func (Hash) ToCommonHash ¶ added in v0.1.1
ToCommonHash converts hash to common.Hash
func (*Hash) UnmarshalJSON ¶ added in v0.1.1
type HexOrDecimalUint64 ¶ added in v1.5.10
type HexOrDecimalUint64 uint64
func (HexOrDecimalUint64) MarshalJSON ¶ added in v1.5.10
func (u HexOrDecimalUint64) MarshalJSON() ([]byte, error)
func (*HexOrDecimalUint64) UnmarshalJSON ¶ added in v1.5.10
func (u *HexOrDecimalUint64) UnmarshalJSON(data []byte) error
type InternalTransferAction ¶ added in v0.1.1
type InternalTransferAction struct { From Address `json:"from"` FromPocket PocketType `json:"fromPocket"` FromSpace SpaceType `json:"fromSpace"` To Address `json:"to"` ToPocket PocketType `json:"toPocket"` ToSpace SpaceType `json:"toSpace"` Value hexutil.Big `json:"value"` }
type LocalizedBlockTrace ¶ added in v0.1.1
type LocalizedBlockTrace struct { TransactionTraces []LocalizedTransactionTrace `json:"transactionTraces"` EpochHash Hash `json:"epochHash"` EpochNumber hexutil.Big `json:"epochNumber"` BlockHash Hash `json:"blockHash"` }
type LocalizedTrace ¶ added in v0.1.1
type LocalizedTrace struct { Action interface{} `json:"action"` Valid bool `json:"valid"` Type TraceType `json:"type"` EpochHash *Hash `json:"epochHash,omitempty"` EpochNumber *hexutil.Big `json:"epochNumber,omitempty"` BlockHash *Hash `json:"blockHash,omitempty"` TransactionPosition *hexutil.Uint64 `json:"transactionPosition,omitempty"` TransactionHash *Hash `json:"transactionHash,omitempty"` }
func (*LocalizedTrace) UnmarshalJSON ¶ added in v0.1.1
func (l *LocalizedTrace) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals Input and Init type from []byte to hexutil.Bytes
type LocalizedTraceNode ¶ added in v0.1.1
type LocalizedTraceNode struct { Type TraceType `json:"type"` Valid bool `json:"valid"` EpochHash *Hash `json:"epochHash,omitempty"` EpochNumber *hexutil.Big `json:"epochNumber,omitempty"` BlockHash *Hash `json:"blockHash,omitempty"` TransactionPosition *hexutil.Uint64 `json:"transactionPosition,omitempty"` TransactionHash *Hash `json:"transactionHash,omitempty"` CallWithResult *TraceCallWithResult `json:"callWithResult,omitempty"` CreateWithResult *TraceCreateWithResult `json:"createWithResult,omitempty"` InternalTransferAction *InternalTransferAction `json:"internalTransferAction,omitempty"` Childs []*LocalizedTraceNode `json:"childs"` }
func (LocalizedTraceNode) Flatten ¶ added in v0.1.1
func (l LocalizedTraceNode) Flatten() (flattened []*LocalizedTraceNode)
type LocalizedTraceTire ¶ added in v0.1.1
type LocalizedTraceTire []*LocalizedTraceNode
func TraceInTire ¶ added in v0.1.1
func TraceInTire(traces []LocalizedTrace) (tier LocalizedTraceTire, err error)
TraceInTire convert flattened trace to trie, the convered tiers are stored in the order of the flattened trace like follow.
InternalTransfer call create createResult callResult InternalTransfer ============> InternalTransfer call + callResult |- create + createResult InternalTransfer
func (LocalizedTraceTire) Flatten ¶ added in v0.1.1
func (t LocalizedTraceTire) Flatten() (flattened []*LocalizedTraceNode)
type LocalizedTransactionTrace ¶ added in v0.1.1
type LocalizedTransactionTrace struct { Traces []LocalizedTrace `json:"traces"` TransactionPosition hexutil.Uint64 `json:"transactionPosition"` TransactionHash Hash `json:"transactionHash"` }
type Log ¶
type Log struct { Address Address `json:"address"` Topics []Hash `json:"topics"` Data hexutil.Bytes `json:"data"` BlockHash *Hash `json:"blockHash,omitempty"` EpochNumber *hexutil.Big `json:"epochNumber,omitempty"` TransactionHash *Hash `json:"transactionHash,omitempty"` TransactionIndex *hexutil.Big `json:"transactionIndex,omitempty"` LogIndex *hexutil.Big `json:"logIndex,omitempty"` TransactionLogIndex *hexutil.Big `json:"transactionLogIndex,omitempty"` Space *SpaceType `json:"space,omitempty"` }
Log represents the event in a smart contract
type LogFilter ¶
type LogFilter struct { FromEpoch *Epoch `json:"fromEpoch,omitempty"` ToEpoch *Epoch `json:"toEpoch,omitempty"` FromBlock *hexutil.Big `json:"fromBlock,omitempty"` ToBlock *hexutil.Big `json:"toBlock,omitempty"` BlockHashes []Hash `json:"blockHashes,omitempty"` Address []Address `json:"address,omitempty"` Topics [][]Hash `json:"topics,omitempty"` }
LogFilter represents the filter of event in a smart contract.
func (*LogFilter) UnmarshalJSON ¶ added in v0.1.1
UnmarshalJSON implements the json.Unmarshaler interface.
type OutcomeType ¶ added in v0.1.1
type OutcomeType string
const ( OUTCOME_SUCCESS OutcomeType = "success" OUTCOME_REVERTED OutcomeType = "reverted" OUTCOME_FAIL OutcomeType = "fail" )
type PendingReason ¶ added in v1.5.7
type PendingReason string
const ( PENDING_REASON_FUTURE_NONCE PendingReason = "futureNonce" PENDING_REASON_NOT_ENOUGH_CASH PendingReason = "notEnoughCash" PENDING_REASON_OLD_EPOCH_HEIGHT PendingReason = "oldEpochHeight" PENDING_REASON_OUTDATED_STATUS PendingReason = "outdatedStatus" )
type PoSEconomics ¶ added in v0.1.1
type PocketType ¶ added in v0.1.1
type PocketType string
const ( POCKET_BALANCE PocketType = "balance" POCKET_STAKING_BALANCE PocketType = "staking_balance" POCKET_STORAGE_COLLATERAL PocketType = "storage_collateral" POCKET_SPONSOR_BALANCE_FOR_GAS PocketType = "sponsor_balance_for_gas" POCKET_SPONSOR_BALANCE_FOR_STORAGE PocketType = "sponsor_balance_for_collateral" POCKET_MINT_BURN PocketType = "mint_or_burn" POCKET_GAS_PAYMENT PocketType = "gas_payment" )
type RewardInfo ¶ added in v0.1.1
type SignedTransaction ¶
type SignedTransaction struct { UnsignedTransaction UnsignedTransaction V byte R hexutil.Bytes S hexutil.Bytes }
SignedTransaction represents a transaction with signature, it is the transaction information for sending transaction.
func (*SignedTransaction) Decode ¶
func (tx *SignedTransaction) Decode(data []byte, networkID uint32) error
Decode decodes RLP encoded data to tx
func (*SignedTransaction) Encode ¶
func (tx *SignedTransaction) Encode() ([]byte, error)
Encode encodes tx and returns its RLP encoded data; Encode format is "cfx||tx_type||body_rlp"
func (*SignedTransaction) Hash ¶ added in v0.1.1
func (tx *SignedTransaction) Hash() ([]byte, error)
Hash calculates the hash of the transaction rlp encode result
func (*SignedTransaction) Sender ¶ added in v0.1.1
func (tx *SignedTransaction) Sender(networkId uint32) (Address, error)
Sender recovers the sender from a signed transaction
func (*SignedTransaction) Signature ¶ added in v0.1.1
func (tx *SignedTransaction) Signature() []byte
Signature returns the signature of the transaction
type SponsorInfo ¶ added in v0.1.1
type SponsorInfo struct { SponsorForGas Address `json:"sponsorForGas"` SponsorForCollateral Address `json:"sponsorForCollateral"` SponsorGasBound *hexutil.Big `json:"sponsorGasBound"` SponsorBalanceForGas *hexutil.Big `json:"sponsorBalanceForGas"` SponsorBalanceForCollateral *hexutil.Big `json:"sponsorBalanceForCollateral"` AvailableStoragePoints *hexutil.Big `json:"availableStoragePoints"` UsedStoragePoints *hexutil.Big `json:"usedStoragePoints"` }
type Status ¶ added in v0.1.1
type Status struct { BestHash Hash `json:"bestHash"` ChainID hexutil.Uint64 `json:"chainId"` EthereumSpaceChainId hexutil.Uint64 `json:"ethereumSpaceChainId"` NetworkID hexutil.Uint64 `json:"networkId"` EpochNumber hexutil.Uint64 `json:"epochNumber"` BlockNumber hexutil.Uint64 `json:"blockNumber"` PendingTxNumber hexutil.Uint64 `json:"pendingTxNumber"` LatestCheckpoint hexutil.Uint64 `json:"latestCheckpoint"` LatestConfirmed hexutil.Uint64 `json:"latestConfirmed"` LatestState hexutil.Uint64 `json:"latestState"` LatestFinalized hexutil.Uint64 `json:"latestFinalized"` }
Status represents current blockchain status
type StorageChange ¶ added in v0.1.1
type StorageChange struct { Address Address `json:"address"` /// Number of storage collateral units to deposit / refund (absolute value). Collaterals hexutil.Uint64 `json:"collaterals"` }
StorageChange represents storage change information of the address
type StorageCollateralInfo ¶ added in v1.5.7
type StorageRoot ¶ added in v0.1.1
type SubscriptionLog ¶ added in v0.1.1
type SubscriptionLog struct { *Log *ChainReorg }
func (*SubscriptionLog) DecodeRLP ¶ added in v0.1.1
func (s *SubscriptionLog) DecodeRLP(r *rlp.Stream) error
func (SubscriptionLog) EncodeRLP ¶ added in v0.1.1
func (s SubscriptionLog) EncodeRLP(w io.Writer) error
func (SubscriptionLog) IsRevertLog ¶ added in v0.1.1
func (s SubscriptionLog) IsRevertLog() bool
func (SubscriptionLog) MarshalJSON ¶ added in v0.1.1
func (s SubscriptionLog) MarshalJSON() ([]byte, error)
type TokenSupplyInfo ¶ added in v0.1.1
type TraceCallWithResult ¶ added in v0.1.1
type TraceCallWithResult struct { *Call `json:"call"` *CallResult `json:"callResult"` }
type TraceCreateWithResult ¶ added in v0.1.1
type TraceCreateWithResult struct { *Create `json:"create"` *CreateResult `json:"createResult"` }
type TraceFilter ¶ added in v0.1.1
type TraceFilter struct { FromEpoch *Epoch `json:"fromEpoch"` ToEpoch *Epoch `json:"toEpoch"` FromAddress []Address `json:"fromAddress"` ToAddress []Address `json:"toAddress"` BlockHashes []Hash `json:"blockHashes"` // action types could be "call","create","callResult","createResult","internalTransferAction" ActionTypes []TraceType `json:"actionTypes"` After *hexutil.Uint64 `json:"after"` Count *hexutil.Uint64 `json:"count"` }
type Transaction ¶
type Transaction struct { // Space *string `json:"space,omitempty"` //currently it is always "nil", so comment it now and uncomment it if need later TransactionType *hexutil.Uint64 `json:"type,omitempty"` Hash Hash `json:"hash"` Nonce *hexutil.Big `json:"nonce"` BlockHash *Hash `json:"blockHash"` TransactionIndex *hexutil.Uint64 `json:"transactionIndex"` From Address `json:"from"` To *Address `json:"to"` Value *hexutil.Big `json:"value"` GasPrice *hexutil.Big `json:"gasPrice,omitempty"` Gas *hexutil.Big `json:"gas"` ContractCreated *Address `json:"contractCreated"` Data string `json:"data"` StorageLimit *hexutil.Big `json:"storageLimit"` EpochHeight *hexutil.Big `json:"epochHeight"` ChainID *hexutil.Big `json:"chainId"` Status *hexutil.Uint64 `json:"status"` AccessList AccessList `json:"accessList,omitempty"` MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas,omitempty"` MaxFeePerGas *hexutil.Big `json:"maxFeePerGas,omitempty"` //signature V *hexutil.Big `json:"v"` R *hexutil.Big `json:"r"` S *hexutil.Big `json:"s"` YParity *hexutil.Uint64 `json:"yParity,omitempty"` }
Transaction represents a transaction with signature in Conflux. it is the response from conflux node when sending rpc request, such as cfx_getTransactionByHash
func (*Transaction) DecodeRLP ¶ added in v0.1.1
func (tx *Transaction) DecodeRLP(r *rlp.Stream) error
DecodeRLP implements the rlp.Decoder interface.
func (Transaction) EncodeRLP ¶ added in v0.1.1
func (tx Transaction) EncodeRLP(w io.Writer) error
EncodeRLP implements the rlp.Encoder interface.
func (Transaction) MarshalJSON ¶ added in v1.5.10
func (t Transaction) MarshalJSON() ([]byte, error)
The custom serialization method is designed so that the access list is not ignored when it is an array with zero elements.
type TransactionReceipt ¶
type TransactionReceipt struct { Type *hexutil.Uint64 `json:"type,omitempty"` TransactionHash Hash `json:"transactionHash"` Index hexutil.Uint64 `json:"index"` BlockHash Hash `json:"blockHash"` EpochNumber *hexutil.Uint64 `json:"epochNumber"` From Address `json:"from"` To *Address `json:"to"` GasUsed *hexutil.Big `json:"gasUsed"` AccumulatedGasUsed *hexutil.Big `json:"accumulatedGasUsed,omitempty"` GasFee *hexutil.Big `json:"gasFee"` EffectiveGasPrice *hexutil.Big `json:"effectiveGasPrice"` ContractCreated *Address `json:"contractCreated"` Logs []Log `json:"logs"` LogsBloom Bloom `json:"logsBloom"` StateRoot Hash `json:"stateRoot"` OutcomeStatus hexutil.Uint64 `json:"outcomeStatus"` TxExecErrorMsg *string `json:"txExecErrorMsg"` // Whether gas costs were covered by the sponsor. GasCoveredBySponsor bool `json:"gasCoveredBySponsor"` // Whether storage costs were covered by the sponsor. StorageCoveredBySponsor bool `json:"storageCoveredBySponsor"` // The amount of storage collateralized by the sender. StorageCollateralized hexutil.Uint64 `json:"storageCollateralized"` // Storage collaterals released during the execution of the transaction. StorageReleased []StorageChange `json:"storageReleased"` Space *SpaceType `json:"space,omitempty"` BurntGasFee *hexutil.Big `json:"burntGasFee,omitempty"` }
TransactionReceipt represents the transaction execution result in Conflux. it is the response from conflux node when sending rpc request, such as cfx_getTransactionReceipt
func (*TransactionReceipt) DecodeRLP ¶ added in v0.1.1
func (tr *TransactionReceipt) DecodeRLP(r *rlp.Stream) error
DecodeRLP implements the rlp.Decoder interface.
func (TransactionReceipt) EncodeRLP ¶ added in v0.1.1
func (tr TransactionReceipt) EncodeRLP(w io.Writer) error
EncodeRLP implements the rlp.Encoder interface.
func (*TransactionReceipt) GetOutcomeType ¶ added in v1.5.7
func (r *TransactionReceipt) GetOutcomeType() (enums.TransactionOutcome, error)
func (*TransactionReceipt) MustGetOutcomeType ¶ added in v1.5.7
func (r *TransactionReceipt) MustGetOutcomeType() enums.TransactionOutcome
type TransactionStatus ¶ added in v0.1.1
type TransactionStatus struct {
// contains filtered or unexported fields
}
func (*TransactionStatus) IsPending ¶ added in v0.1.1
func (ts *TransactionStatus) IsPending() (bool, PendingReason)
func (TransactionStatus) MarshalJSON ¶ added in v0.1.1
func (ts TransactionStatus) MarshalJSON() ([]byte, error)
func (TransactionStatus) String ¶ added in v0.1.1
func (ts TransactionStatus) String() string
func (*TransactionStatus) UnmarshalJSON ¶ added in v0.1.1
func (ts *TransactionStatus) UnmarshalJSON(data []byte) error
type TransactionType ¶ added in v1.5.10
type TransactionType uint
const ( TRANSACTION_TYPE_LEGACY TransactionType = iota TRANSACTION_TYPE_2930 TRANSACTION_TYPE_1559 )
func (TransactionType) Ptr ¶ added in v1.5.10
func (t TransactionType) Ptr() *TransactionType
type TrieProof ¶ added in v1.5.7
type TrieProof []VanillaTrieNode
type TxPoolPendingNonceRange ¶ added in v0.1.1
type TxPoolStatus ¶ added in v0.1.1
type TxWithPoolInfo ¶ added in v0.1.1
type TxWithPoolInfo struct { Exist bool `json:"exist"` Packed bool `json:"packed"` LocalNonce *hexutil.Big `json:"localNonce"` LocalBalance *hexutil.Big `json:"localBalance"` StateNonce *hexutil.Big `json:"stateNonce"` StateBalance *hexutil.Big `json:"stateBalance"` LocalBalanceEnough bool `json:"localBalanceEnough"` StateBalanceEnough bool `json:"stateBalanceEnough"` }
type UnsignedTransaction ¶
type UnsignedTransaction struct { UnsignedTransactionBase To *Address Data hexutil.Bytes }
UnsignedTransaction represents a transaction without signature, it is the transaction information for sending transaction.
func (*UnsignedTransaction) ApplyDefault ¶
func (tx *UnsignedTransaction) ApplyDefault()
ApplyDefault applys default value for these fields if they are empty
func (*UnsignedTransaction) Decode ¶
func (tx *UnsignedTransaction) Decode(data []byte, networkID uint32) error
Decode decodes RLP encoded data to tx
func (*UnsignedTransaction) Encode ¶
func (tx *UnsignedTransaction) Encode() ([]byte, error)
Encode encodes tx and returns its RLP encoded data
func (*UnsignedTransaction) EncodeWithSignature ¶
func (tx *UnsignedTransaction) EncodeWithSignature(v byte, r, s []byte) ([]byte, error)
EncodeWithSignature encodes tx with signature and return its RLP encoded data
func (*UnsignedTransaction) Hash ¶
func (tx *UnsignedTransaction) Hash() ([]byte, error)
Hash hashes the tx by keccak256 and returns the result
type UnsignedTransactionBase ¶
type UnsignedTransactionBase struct { From *Address Nonce *hexutil.Big GasPrice *hexutil.Big Gas *hexutil.Big Value *hexutil.Big StorageLimit *hexutil.Uint64 EpochHeight *hexutil.Uint64 ChainID *hexutil.Uint AccessList AccessList MaxPriorityFeePerGas *hexutil.Big MaxFeePerGas *hexutil.Big Type *TransactionType }
UnsignedTransactionBase represents a transaction without To, Data and signature
type VanillaTrieNode ¶ added in v1.5.7
type VanillaTrieNode struct { ChildrenTable []common.Hash `json:"childrenTable"` CompressedPath struct { PathMask hexutil.Uint `json:"pathMask"` PathSlice hexutil.Bytes `json:"pathSlice"` } `json:"compressedPath"` MerkleHash common.Hash `json:"merkleHash"` MptValue *hexutil.Bytes `json:"mptValue"` }
type VoteStakeInfo ¶ added in v0.1.1
type VoteStakeInfo struct { /// This is the number of tokens should be locked before /// `unlock_block_number`. Amount *hexutil.Big `json:"amount"` /// This is the timestamp when the vote right will be invalid, measured in /// the number of past blocks. UnlockBlockNumber uint64 `json:"unlockBlockNumber"` }
VoteStakeInfo represents user vote history
func (*VoteStakeInfo) UnmarshalJSON ¶ added in v0.1.1
func (v *VoteStakeInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type WebsocketEpochResponse ¶ added in v0.1.1
type WebsocketEpochResponse struct { EpochHashesOrdered []Hash `json:"epochHashesOrdered"` EpochNumber *hexutil.Big `json:"epochNumber"` }
WebsocketEpochResponse represents result of epoch websocket subscription
type WrapTransaction ¶ added in v1.5.4
type WrapTransaction struct { NativeTransaction *Transaction `json:"nativeTransaction"` EthTransaction *types.Transaction `json:"ethTransaction"` }