clientapi

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 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 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

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

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

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

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 (api *EthereumAPI) MaxPriorityFeePerGas(_ context.Context) (*hexutil.Big, error)

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 NewFilterAPI

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

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

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(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 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.PublicBatch, 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) 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

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

GetTotalContractCount returns the number of recorded contracts on the network.

func (*ScanAPI) GetTotalTransactionCount

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

GetTotalTransactionCount returns the number of recorded transactions on the network.

func (*ScanAPI) GetTotalTransactionsQuery added in v0.24.1

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

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

func NewTenAPI(host host.Host) *TenAPI

func (*TenAPI) Config added in v0.26.1

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

func (*TenAPI) Health added in v0.26.1

func (api *TenAPI) Health(ctx context.Context) (*host.HealthCheck, error)

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

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