clientapi

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChecksumFormattedObscuroNetworkConfig

type ChecksumFormattedObscuroNetworkConfig struct {
	ManagementContractAddress gethcommon.AddressEIP55
	L1StartHash               gethcommon.Hash
	SequencerID               gethcommon.AddressEIP55
	MessageBusAddress         gethcommon.AddressEIP55
	L2MessageBusAddress       gethcommon.AddressEIP55
	ImportantContracts        map[string]gethcommon.AddressEIP55 // map of contract name to address
}

ChecksumFormattedObscuroNetworkConfig 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

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

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

type FilterAPI struct {
	NewHeadsService *subscriptioncommon.NewHeadsService
	// contains filtered or unexported fields
}

FilterAPI exposes a subset of Geth's PublicFilterAPI operations.

func NewFilterAPI

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

func (*FilterAPI) GetLogs

GetLogs returns the logs matching the filter.

func (*FilterAPI) Logs

Logs exposes the "logs" rpc endpoint.

func (*FilterAPI) NewHeads added in v0.24.0

func (api *FilterAPI) NewHeads(ctx context.Context) (*rpc.Subscription, error)

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(_ context.Context, hash gethcommon.Hash) (interface{}, error)

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

func (*NetworkDebug) TraceTransaction

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

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

func (*ObscuroAPI) Health

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

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

type ScanAPI

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

ScanAPI implements metric specific RPC endpoints

func NewScanAPI

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

func (*ScanAPI) GetBatch added in v0.24.0

func (s *ScanAPI) GetBatch(batchHash gethcommon.Hash) (*common.ExtBatch, error)

GetBatch returns the `ExtBatch` with the given hash

func (*ScanAPI) GetBatchByHeight added in v0.24.0

func (s *ScanAPI) GetBatchByHeight(height *big.Int) (*common.BatchHeader, error)

GetBatchByHeight returns the `BatchHeader` with the given height

func (*ScanAPI) GetBatchByTx added in v0.24.0

func (s *ScanAPI) GetBatchByTx(txHash gethcommon.Hash) (*common.ExtBatch, error)

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) 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) 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) 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

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

GetTotalContractCount returns the number of recorded contracts on the network.

func (*ScanAPI) GetTotalTransactionCount

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

GetTotalTxCount 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