clientapi

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

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

EstimateGas requests the enclave the gas estimation based on the callMsg supplied params (encrypted)

func (*EthereumAPI) FeeHistory

FeeHistory is a placeholder for an RPC method required by MetaMask/Remix. rpc.DecimalOrHex -> []byte

func (*EthereumAPI) GasPrice

func (api *EthereumAPI) GasPrice(context.Context) (*hexutil.Big, error)

GasPrice is a placeholder for an RPC method required by MetaMask/Remix.

func (*EthereumAPI) GetBalance

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(_ 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 added in v0.14.0

func (api *EthereumAPI) GetStorageAt(_ context.Context, encryptedParams common.EncryptedParamsGetStorageAt) (*responses.Receipts, error)

GetStorageAt is a reused method for listing the users transactions

func (*EthereumAPI) GetTransactionByHash

func (api *EthereumAPI) GetTransactionByHash(_ 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(_ context.Context, encryptedParams common.EncryptedParamsGetTxCount) (responses.EnclaveResponse, error)

func (*EthereumAPI) GetTransactionReceipt

func (api *EthereumAPI) GetTransactionReceipt(_ 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) SendRawTransaction

func (api *EthereumAPI) SendRawTransaction(_ 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 added in v0.4.0

type FilterAPI struct {
	// contains filtered or unexported fields
}

FilterAPI exposes a subset of Geth's PublicFilterAPI operations.

func NewFilterAPI added in v0.4.0

func NewFilterAPI(host host.Host, logger gethlog.Logger) *FilterAPI

func (*FilterAPI) GetLogs added in v0.5.0

GetLogs returns the logs matching the filter.

func (*FilterAPI) Logs added in v0.4.0

Logs returns a log subscription.

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 added in v0.12.0

type NetworkDebug struct {
	// contains filtered or unexported fields
}

NetworkDebug implements a subset of the Ethereum network JSON RPC operations.

func NewNetworkDebug added in v0.12.0

func NewNetworkDebug(host host.Host) *NetworkDebug

func (*NetworkDebug) EventLogRelevancy added in v0.13.0

func (api *NetworkDebug) EventLogRelevancy(_ context.Context, hash gethcommon.Hash) (interface{}, error)

EventLogRelevancy returns the events for a given transactions and the revelancy params

func (*NetworkDebug) TraceTransaction added in v0.12.0

func (api *NetworkDebug) TraceTransaction(_ 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 ObscuroAPI

type ObscuroAPI struct {
	// contains filtered or unexported fields
}

ObscuroAPI implements Obscuro-specific JSON RPC operations.

func NewObscuroAPI

func NewObscuroAPI(host host.Host) *ObscuroAPI

func (*ObscuroAPI) Config added in v0.17.0

func (api *ObscuroAPI) Config() (*common.ObscuroNetworkInfo, error)

Config returns the config status of obscuro host + enclave + db

func (*ObscuroAPI) Health added in v0.7.0

func (api *ObscuroAPI) Health() (*host.HealthCheck, error)

Health returns the health status of obscuro host + enclave + db

type ObscuroScanAPI

type ObscuroScanAPI struct {
	// contains filtered or unexported fields
}

ObscuroScanAPI implements ObscuroScan-specific JSON RPC operations.

func NewObscuroScanAPI

func NewObscuroScanAPI(host host.Host) *ObscuroScanAPI

func (*ObscuroScanAPI) Attestation

func (api *ObscuroScanAPI) Attestation() (*common.AttestationReport, error)

Attestation returns the node's attestation details.

func (*ObscuroScanAPI) GetBatch added in v0.8.0

func (api *ObscuroScanAPI) GetBatch(batchHash gethcommon.Hash) (*common.ExtBatch, error)

GetBatch returns the batch with the given hash. Unlike `EthereumAPI.GetBlockByHash()`, returns the full `ExtBatch`, and not just the header.

func (*ObscuroScanAPI) GetBatchForTx added in v0.8.0

func (api *ObscuroScanAPI) GetBatchForTx(txHash gethcommon.Hash) (*common.ExtBatch, error)

GetBatchForTx returns the batch containing a given transaction hash.

func (*ObscuroScanAPI) GetBlockHeaderByHash

func (api *ObscuroScanAPI) GetBlockHeaderByHash(blockHash gethcommon.Hash) (*types.Header, error)

GetBlockHeaderByHash returns the header for the block with the given hash.

func (*ObscuroScanAPI) GetLatestTransactions

func (api *ObscuroScanAPI) GetLatestTransactions(num int) ([]gethcommon.Hash, error)

GetLatestTransactions returns the hashes of the latest `num` transactions confirmed in batches (or all the transactions if there are less than `num` total transactions).

func (*ObscuroScanAPI) GetTotalTransactions

func (api *ObscuroScanAPI) GetTotalTransactions() (*big.Int, error)

GetTotalTransactions returns the number of recorded transactions on the network.

type ScanAPI added in v0.14.0

type ScanAPI struct {
	// contains filtered or unexported fields
}

ScanAPI implements metric specific RPC endpoints

func NewScanAPI added in v0.14.0

func NewScanAPI(host host.Host, logger log.Logger) *ScanAPI

func (*ScanAPI) GetBatchByHash added in v0.16.0

func (s *ScanAPI) GetBatchByHash(hash gethcommon.Hash) (*common.ExtBatch, error)

func (*ScanAPI) GetBatchListing added in v0.15.0

func (s *ScanAPI) GetBatchListing(pagination *common.QueryPagination) (*common.BatchListingResponse, error)

func (*ScanAPI) GetBlockListing added in v0.15.0

func (s *ScanAPI) GetBlockListing(pagination *common.QueryPagination) (*common.BlockListingResponse, error)

func (*ScanAPI) GetLatestRollupHeader added in v0.14.0

func (s *ScanAPI) GetLatestRollupHeader() (*common.RollupHeader, error)

func (*ScanAPI) GetPublicTransactionData added in v0.14.0

func (s *ScanAPI) GetPublicTransactionData(pagination *common.QueryPagination) (*common.TransactionListingResponse, error)

func (*ScanAPI) GetTotalContractCount added in v0.14.0

func (s *ScanAPI) GetTotalContractCount() (*big.Int, error)

GetTotalContractCount returns the number of recorded contracts on the network.

func (*ScanAPI) GetTotalTransactionCount added in v0.14.0

func (s *ScanAPI) GetTotalTransactionCount() (*big.Int, error)

GetTotalTransactionCount returns the number of recorded transactions on the network.

type TestAPI

type TestAPI struct {
	// contains filtered or unexported fields
}

TestAPI implements JSON RPC operations required for testing.

func NewTestAPI

func NewTestAPI(container container.Container) *TestAPI

func (*TestAPI) StopHost

func (api *TestAPI) StopHost() error

StopHost gracefully stops the host.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL