endpoint

package
v0.0.0-...-ddeaac2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: CC0-1.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotificationsUnsupported = errors.New("notifications not supported")
)

Functions

This section is empty.

Types

type EngineEth

type EngineEth struct {
	*endpoint.Endpoint
	// contains filtered or unexported fields
}

func NewEngineEth

func NewEngineEth(ep *endpoint.Endpoint) *EngineEth

func (*EngineEth) Call

Call executes a new message call immediately without creating a transaction on the blockchain

On failure to access engine or format error on the response, returns error code '-32000' with custom message.
If API is disabled, returns error code '-32601' with message 'the method does not exist/is not available'.
On missing or invalid param returns error code '-32602' with custom message.

func (*EngineEth) ChainId

func (e *EngineEth) ChainId(ctx context.Context) (*common.Uint256, error)

ChainId returns the chain id of the current network

On failure to access engine or format error on the response, returns error code '-32000' with custom message.
If API is disabled, returns error code '-32601' with message 'the method does not exist/is not available'.
On any param returns error code '-32602' with custom message.

func (*EngineEth) Close

func (e *EngineEth) Close()

func (*EngineEth) GetBalance

func (e *EngineEth) GetBalance(ctx context.Context, address common.Address, bNumOrHash *common.BlockNumberOrHash) (*common.Uint256, error)

GetBalance returns the balance of the account of given address

On failure to access engine or format error on the response, returns error code '-32000' with custom message.
If API is disabled, returns error code '-32601' with message 'the method does not exist/is not available'.
On missing or invalid param returns error code '-32602' with custom message.

func (*EngineEth) GetCode

func (e *EngineEth) GetCode(ctx context.Context, address common.Address, bNumOrHash *common.BlockNumberOrHash) (*string, error)

GetCode returns the compiled smart contract code, if any, at a given address

On failure to access engine or format error on the response, returns error code '-32000' with custom message.
If API is disabled, returns error code '-32601' with message 'the method does not exist/is not available'.
On missing or invalid param returns error code '-32602' with custom message.

func (*EngineEth) GetStorageAt

func (e *EngineEth) GetStorageAt(ctx context.Context, address common.Address, storageSlot common.Uint256, bNumOrHash *common.BlockNumberOrHash) (*string, error)

GetStorageAt returns the value from a storage position at a given address

On failure to access engine or format error on the response, returns error code '-32000' with custom message.
If API is disabled, returns error code '-32601' with message 'the method does not exist/is not available'.
On missing or invalid param returns error code '-32602' with custom message.

func (*EngineEth) GetTransactionCount

func (e *EngineEth) GetTransactionCount(ctx context.Context, address common.Address, bNumOrHash *common.BlockNumberOrHash) (*common.Uint256, error)

GetTransactionCount returns the number of transactions sent from an address

On failure to access engine or format error on the response, returns error code '-32000' with custom message.
If API is disabled, returns error code '-32601' with message 'the method does not exist/is not available'.
On missing or invalid param returns error code '-32602' with custom message.

func (*EngineEth) SendRawTransaction

func (e *EngineEth) SendRawTransaction(ctx context.Context, txs common.DataVec) (*string, error)

SendRawTransaction submits a raw transaction to engine either asynchronously or synchronously based on the configuration

On failure to access engine or format error on the response, returns error code '-32000' with custom message.
If API is disabled, returns error code '-32601' with message 'the method does not exist/is not available'.
On missing or invalid param returns error code '-32602' with custom message.

type EngineNet

type EngineNet struct {
	*EngineEth
}

func NewEngineNet

func NewEngineNet(eEth *EngineEth) *EngineNet

func (*EngineNet) Version

func (e *EngineNet) Version(ctx context.Context) (*string, error)

Version returns the chain id of the current network. Therefore, directly calls the `chainId“ method under `engineEth` endpoint

type EventsEth

type EventsEth struct {
	*endpoint.Endpoint
	// contains filtered or unexported fields
}

func NewEventsEth

func NewEventsEth(ep *endpoint.Endpoint, eb broker.Broker) *EventsEth

func (*EventsEth) Logs

func (e *EventsEth) Logs(ctx context.Context, subOpts request.LogSubscriptionOptions) (*rpc.ID, error)

Logs send a notification each time logs included in new imported block and match the given filter criteria.

func (*EventsEth) NewHeads

func (e *EventsEth) NewHeads(ctx context.Context) (*rpc.ID, error)

NewHeads send a notification each time a new block is appended to the chain, including chain reorganizations.

Jump to

Keyboard shortcuts

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