Documentation ¶
Index ¶
- type ChecksumFormattedTenNetworkConfig
- type EthereumAPI
- func (api *EthereumAPI) BlockNumber() hexutil.Uint64
- func (api *EthereumAPI) Call(ctx context.Context, encryptedParams common.EncryptedParamsCall) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) ChainId() (*hexutil.Big, error)
- func (api *EthereumAPI) EstimateGas(ctx context.Context, encryptedParams common.EncryptedParamsEstimateGas) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) FeeHistory(context.Context, string, rpc.BlockNumber, []float64) (*FeeHistoryResult, error)
- func (api *EthereumAPI) GasPrice(context.Context) (*hexutil.Big, error)
- func (api *EthereumAPI) GetBalance(ctx context.Context, encryptedParams common.EncryptedParamsGetBalance) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) GetBlockByHash(_ context.Context, hash gethcommon.Hash, _ bool) (*common.BatchHeader, error)
- func (api *EthereumAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, _ bool) (*common.BatchHeader, error)
- func (api *EthereumAPI) GetCode(ctx context.Context, address gethcommon.Address, ...) (hexutil.Bytes, error)
- func (api *EthereumAPI) GetStorageAt(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageSlot) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) GetTransactionByHash(ctx context.Context, encryptedParams common.EncryptedParamsGetTxByHash) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) GetTransactionCount(ctx context.Context, encryptedParams common.EncryptedParamsGetTxCount) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) GetTransactionReceipt(ctx context.Context, encryptedParams common.EncryptedParamsGetTxReceipt) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) MaxPriorityFeePerGas(_ context.Context) (*hexutil.Big, error)
- func (api *EthereumAPI) SendRawTransaction(ctx context.Context, encryptedParams common.EncryptedParamsSendRawTx) (responses.EnclaveResponse, error)
- type FeeHistoryResult
- type FilterAPI
- func (api *FilterAPI) GetLogs(ctx context.Context, encryptedParams common.EncryptedParamsGetLogs) (responses.EnclaveResponse, error)
- func (api *FilterAPI) Logs(ctx context.Context, encryptedParams common.EncryptedParamsLogSubscription) (*rpc.Subscription, error)
- func (api *FilterAPI) NewHeads(ctx context.Context) (*rpc.Subscription, error)
- type NetworkAPI
- type NetworkDebug
- type ScanAPI
- func (s *ScanAPI) GetBatch(batchHash gethcommon.Hash) (*common.ExtBatch, error)
- func (s *ScanAPI) GetBatchByHeight(height *big.Int) (*common.PublicBatch, error)
- func (s *ScanAPI) GetBatchByTx(txHash gethcommon.Hash) (*common.ExtBatch, error)
- func (s *ScanAPI) GetBatchListing(pagination *common.QueryPagination) (*common.BatchListingResponseDeprecated, error)
- func (s *ScanAPI) GetBatchListingNew(pagination *common.QueryPagination) (*common.BatchListingResponse, error)
- func (s *ScanAPI) GetBatchTransactions(batchHash gethcommon.Hash) (*common.TransactionListingResponse, error)
- func (s *ScanAPI) GetBlockListing(pagination *common.QueryPagination) (*common.BlockListingResponse, error)
- func (s *ScanAPI) GetLatestBatch() (*common.BatchHeader, error)
- func (s *ScanAPI) GetLatestRollupHeader() (*common.RollupHeader, error)
- func (s *ScanAPI) GetPersonalTransactions(ctx context.Context, ...) (*responses.Receipts, error)
- func (s *ScanAPI) GetPublicBatchByHash(hash common.L2BatchHash) (*common.PublicBatch, error)
- func (s *ScanAPI) GetPublicTransactionData(pagination *common.QueryPagination) (*common.TransactionListingResponse, error)
- func (s *ScanAPI) GetRollupBatches(rollupHash gethcommon.Hash) (*common.BatchListingResponse, error)
- func (s *ScanAPI) GetRollupByHash(rollupHash gethcommon.Hash) (*common.PublicRollup, error)
- func (s *ScanAPI) GetRollupBySeqNo(seqNo uint64) (*common.PublicRollup, error)
- func (s *ScanAPI) GetRollupListing(pagination *common.QueryPagination) (*common.RollupListingResponse, error)
- func (s *ScanAPI) GetTotalContractCount(ctx context.Context) (*big.Int, error)
- func (s *ScanAPI) GetTotalTransactionCount() (*big.Int, error)
- func (s *ScanAPI) GetTotalTransactionsQuery() (*big.Int, error)
- func (s *ScanAPI) GetTransaction(hash gethcommon.Hash) (*common.PublicTransaction, error)
- type TenAPI
- type TestAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksumFormattedTenNetworkConfig ¶ added in v0.26.1
type ChecksumFormattedTenNetworkConfig struct { ManagementContractAddress gethcommon.AddressEIP55 L1StartHash gethcommon.Hash MessageBusAddress gethcommon.AddressEIP55 L2MessageBusAddress gethcommon.AddressEIP55 ImportantContracts map[string]gethcommon.AddressEIP55 // map of contract name to address TransactionPostProcessorAddress gethcommon.AddressEIP55 }
ChecksumFormattedTenNetworkConfig serialises the addresses as EIP55 checksum addresses.
type EthereumAPI ¶
type EthereumAPI struct {
// contains filtered or unexported fields
}
EthereumAPI implements a subset of the Ethereum JSON RPC operations. All the method signatures are copied from the corresponding Geth implementations.
func NewEthereumAPI ¶
func NewEthereumAPI(host host.Host, logger gethlog.Logger) *EthereumAPI
func (*EthereumAPI) BlockNumber ¶
func (api *EthereumAPI) BlockNumber() hexutil.Uint64
BlockNumber returns the height of the current head batch.
func (*EthereumAPI) Call ¶
func (api *EthereumAPI) Call(ctx context.Context, encryptedParams common.EncryptedParamsCall) (responses.EnclaveResponse, error)
Call returns the result of executing the smart contract as a user, encrypted with the viewing key corresponding to the `from` field and encoded as hex.
func (*EthereumAPI) ChainId ¶
func (api *EthereumAPI) ChainId() (*hexutil.Big, error)
ChainId returns the Obscuro chain ID.
func (*EthereumAPI) EstimateGas ¶
func (api *EthereumAPI) EstimateGas(ctx context.Context, encryptedParams common.EncryptedParamsEstimateGas) (responses.EnclaveResponse, error)
EstimateGas requests the enclave the gas estimation based on the callMsg supplied params (encrypted)
func (*EthereumAPI) FeeHistory ¶
func (api *EthereumAPI) FeeHistory(context.Context, string, rpc.BlockNumber, []float64) (*FeeHistoryResult, error)
FeeHistory is a placeholder for an RPC method required by MetaMask/Remix. rpc.DecimalOrHex -> []byte
func (*EthereumAPI) GasPrice ¶
GasPrice is a placeholder for an RPC method required by MetaMask/Remix.
func (*EthereumAPI) GetBalance ¶
func (api *EthereumAPI) GetBalance(ctx context.Context, encryptedParams common.EncryptedParamsGetBalance) (responses.EnclaveResponse, error)
GetBalance returns the address's balance on the Obscuro network, encrypted with the viewing key corresponding to the `address` field and encoded as hex.
func (*EthereumAPI) GetBlockByHash ¶
func (api *EthereumAPI) GetBlockByHash(_ context.Context, hash gethcommon.Hash, _ bool) (*common.BatchHeader, error)
GetBlockByHash returns the header of the batch with the given hash.
func (*EthereumAPI) GetBlockByNumber ¶
func (api *EthereumAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, _ bool) (*common.BatchHeader, error)
GetBlockByNumber returns the header of the batch with the given height.
func (*EthereumAPI) GetCode ¶
func (api *EthereumAPI) GetCode(ctx context.Context, address gethcommon.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
GetCode returns the code stored at the given address in the state for the given batch height or batch hash. todo (#1620) - instead of converting the block number of hash client-side, do it on the enclave
func (*EthereumAPI) GetStorageAt ¶
func (api *EthereumAPI) GetStorageAt(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageSlot) (responses.EnclaveResponse, error)
GetStorageAt is not currently supported (some narrow version of it may be supported in the future for proxy contracts).
func (*EthereumAPI) GetTransactionByHash ¶
func (api *EthereumAPI) GetTransactionByHash(ctx context.Context, encryptedParams common.EncryptedParamsGetTxByHash) (responses.EnclaveResponse, error)
GetTransactionByHash returns the transaction with the given hash, encrypted with the viewing key corresponding to the `from` field and encoded as hex, or nil if no matching transaction exists.
func (*EthereumAPI) GetTransactionCount ¶
func (api *EthereumAPI) GetTransactionCount(ctx context.Context, encryptedParams common.EncryptedParamsGetTxCount) (responses.EnclaveResponse, error)
func (*EthereumAPI) GetTransactionReceipt ¶
func (api *EthereumAPI) GetTransactionReceipt(ctx context.Context, encryptedParams common.EncryptedParamsGetTxReceipt) (responses.EnclaveResponse, error)
GetTransactionReceipt returns the transaction receipt for the given transaction hash, encrypted with the viewing key corresponding to the original transaction submitter and encoded as hex, or nil if no matching transaction exists.
func (*EthereumAPI) MaxPriorityFeePerGas ¶ added in v0.26.0
func (*EthereumAPI) SendRawTransaction ¶
func (api *EthereumAPI) SendRawTransaction(ctx context.Context, encryptedParams common.EncryptedParamsSendRawTx) (responses.EnclaveResponse, error)
SendRawTransaction sends the encrypted transaction.
type FeeHistoryResult ¶
type FeeHistoryResult struct { OldestBlock *hexutil.Big `json:"oldestBlock"` Reward [][]*hexutil.Big `json:"reward,omitempty"` BaseFee []*hexutil.Big `json:"baseFeePerGas,omitempty"` GasUsedRatio []float64 `json:"gasUsedRatio"` }
FeeHistoryResult is the structure returned by Geth `eth_feeHistory` API.
type FilterAPI ¶
type FilterAPI struct { NewHeadsService *subscriptioncommon.NewHeadsService // contains filtered or unexported fields }
FilterAPI exposes a subset of Geth's PublicFilterAPI operations.
func (*FilterAPI) GetLogs ¶
func (api *FilterAPI) GetLogs(ctx context.Context, encryptedParams common.EncryptedParamsGetLogs) (responses.EnclaveResponse, error)
GetLogs returns the logs matching the filter.
func (*FilterAPI) Logs ¶
func (api *FilterAPI) Logs(ctx context.Context, encryptedParams common.EncryptedParamsLogSubscription) (*rpc.Subscription, error)
Logs exposes the "logs" rpc endpoint.
type NetworkAPI ¶
type NetworkAPI struct {
// contains filtered or unexported fields
}
NetworkAPI implements a subset of the Ethereum network JSON RPC operations.
func NewNetworkAPI ¶
func NewNetworkAPI(host host.Host) *NetworkAPI
func (*NetworkAPI) Version ¶
func (api *NetworkAPI) Version() string
Version returns the protocol version of the Obscuro network.
type NetworkDebug ¶
type NetworkDebug struct {
// contains filtered or unexported fields
}
NetworkDebug implements a subset of the Ethereum network JSON RPC operations.
func NewNetworkDebug ¶
func NewNetworkDebug(host host.Host) *NetworkDebug
func (*NetworkDebug) EventLogRelevancy ¶
func (api *NetworkDebug) EventLogRelevancy(ctx context.Context, encryptedParams common.EncryptedParamsDebugLogRelevancy) (responses.DebugLogs, error)
func (*NetworkDebug) TraceTransaction ¶
func (api *NetworkDebug) TraceTransaction(ctx context.Context, hash gethcommon.Hash, config *tracers.TraceConfig) (interface{}, error)
TraceTransaction returns the structured logs created during the execution of EVM and returns them as a JSON object.
type ScanAPI ¶
type ScanAPI struct {
// contains filtered or unexported fields
}
ScanAPI implements metric specific RPC endpoints
func (*ScanAPI) GetBatchByHeight ¶ added in v0.24.0
GetBatchByHeight returns the `BatchHeader` with the given height
func (*ScanAPI) GetBatchByTx ¶ added in v0.24.0
GetBatchByTx returns the `ExtBatch` with the given tx hash
func (*ScanAPI) GetBatchListing ¶
func (s *ScanAPI) GetBatchListing(pagination *common.QueryPagination) (*common.BatchListingResponseDeprecated, error)
GetBatchListing returns the deprecated version of batch listing
func (*ScanAPI) GetBatchListingNew ¶ added in v0.24.0
func (s *ScanAPI) GetBatchListingNew(pagination *common.QueryPagination) (*common.BatchListingResponse, error)
GetBatchListingNew returns a paginated list of batches
func (*ScanAPI) GetBatchTransactions ¶ added in v0.24.1
func (s *ScanAPI) GetBatchTransactions(batchHash gethcommon.Hash) (*common.TransactionListingResponse, error)
GetBatchTransactions returns the public tx data of all txs present in a rollup given its hash
func (*ScanAPI) GetBlockListing ¶
func (s *ScanAPI) GetBlockListing(pagination *common.QueryPagination) (*common.BlockListingResponse, error)
GetBlockListing returns a paginated list of blocks that include rollups
func (*ScanAPI) GetLatestBatch ¶ added in v0.24.0
func (s *ScanAPI) GetLatestBatch() (*common.BatchHeader, error)
GetLatestBatch returns the head `BatchHeader`
func (*ScanAPI) GetLatestRollupHeader ¶
func (s *ScanAPI) GetLatestRollupHeader() (*common.RollupHeader, error)
GetLatestRollupHeader returns the head `RollupHeader`
func (*ScanAPI) GetPersonalTransactions ¶ added in v0.26.0
func (s *ScanAPI) GetPersonalTransactions(ctx context.Context, encryptedParams common.EncryptedParamsGetPersonalTransactions) (*responses.Receipts, error)
GetPersonalTransactions gets the private transactions data for a given user
func (*ScanAPI) GetPublicBatchByHash ¶ added in v0.24.0
func (s *ScanAPI) GetPublicBatchByHash(hash common.L2BatchHash) (*common.PublicBatch, error)
GetPublicBatchByHash returns the public batch
func (*ScanAPI) GetPublicTransactionData ¶
func (s *ScanAPI) GetPublicTransactionData(pagination *common.QueryPagination) (*common.TransactionListingResponse, error)
GetPublicTransactionData returns a paginated list of transaction data
func (*ScanAPI) GetRollupBatches ¶ added in v0.24.1
func (s *ScanAPI) GetRollupBatches(rollupHash gethcommon.Hash) (*common.BatchListingResponse, error)
GetRollupBatches returns the list of batches included in a rollup given its hash
func (*ScanAPI) GetRollupByHash ¶ added in v0.24.1
func (s *ScanAPI) GetRollupByHash(rollupHash gethcommon.Hash) (*common.PublicRollup, error)
GetRollupByHash returns the public rollup data given its hash
func (*ScanAPI) GetRollupBySeqNo ¶ added in v0.24.1
func (s *ScanAPI) GetRollupBySeqNo(seqNo uint64) (*common.PublicRollup, error)
GetRollupBySeqNo returns the `PublicRollup` that contains the batch with the given sequence number
func (*ScanAPI) GetRollupListing ¶ added in v0.24.0
func (s *ScanAPI) GetRollupListing(pagination *common.QueryPagination) (*common.RollupListingResponse, error)
GetRollupListing returns a paginated list of Rollups
func (*ScanAPI) GetTotalContractCount ¶
GetTotalContractCount returns the number of recorded contracts on the network.
func (*ScanAPI) GetTotalTransactionCount ¶
GetTotalTransactionCount returns the number of recorded transactions on the network.
func (*ScanAPI) GetTotalTransactionsQuery ¶ added in v0.24.1
GetTotalTransactionsQuery returns the number of recorded transactions on the network.
func (*ScanAPI) GetTransaction ¶ added in v0.24.1
func (s *ScanAPI) GetTransaction(hash gethcommon.Hash) (*common.PublicTransaction, error)
GetTransaction returns the transaction given its hash.
type TenAPI ¶ added in v0.26.1
type TenAPI struct {
// contains filtered or unexported fields
}
TenAPI implements Ten-specific JSON RPC operations.
func (*TenAPI) Config ¶ added in v0.26.1
func (api *TenAPI) Config() (*ChecksumFormattedTenNetworkConfig, error)
Config returns the config status of TEN host + enclave + db
type TestAPI ¶
type TestAPI struct {
// contains filtered or unexported fields
}
TestAPI implements JSON RPC operations required for testing.