server

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const Erc20Transfer = "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" //Transfer(address,address,uint256)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockConverter

type BlockConverter struct {
	Config *agent.ChainConfig
	Client *client.BalancedClient
	Ctx    context.Context
	Srv    *EthServer
	Log    *slog.Logger
}

func (*BlockConverter) EthBlockToProto

func (c *BlockConverter) EthBlockToProto(block *ethtypes.HeaderWithBody) (*proto.Block, error)

type EthServer

func InitServer

func InitServer(ctx context.Context, config *agent.ChainConfig) *EthServer

func (*EthServer) AddressFromString added in v0.0.6

func (srv *EthServer) AddressFromString(address string) (common.Address, error)

func (*EthServer) AddressToString added in v0.0.6

func (srv *EthServer) AddressToString(address *common.Address) string

func (*EthServer) CombineTransaction

func (*EthServer) CreateTransfer

func (*EthServer) DeriveAccount

func (srv *EthServer) DeriveAccount(ctx context.Context, req *services.DeriveAccountRequest) (*proto.Account, error)

func (*EthServer) GetAccount

func (srv *EthServer) GetAccount(ctx context.Context, req *services.GetAccountRequest) (*proto.Account, error)

func (*EthServer) GetBlock

func (srv *EthServer) GetBlock(ctx context.Context, req *services.BlockRequest) (*proto.Block, error)

func (*EthServer) GetChain

func (srv *EthServer) GetChain(ctx context.Context, chainId *proto.ChainId) (*proto.Chain, error)

func (*EthServer) GetCurrency

func (srv *EthServer) GetCurrency(ctx context.Context, req *services.GetCurrencyRequest) (*proto.Currency, error)

func (*EthServer) Info added in v0.0.6

func (srv *EthServer) Info(ctx context.Context)

func (*EthServer) ListBlocks

func (*EthServer) SignTransaction

func (*EthServer) String

func (srv *EthServer) String() string

type Extensions added in v0.0.6

type Extensions struct {
	AddressFromString func(address string) (common.Address, error)
	AddressToString   func(address common.Address) string
}

extension hooks to tune behaviour of different eth-like chains

type NodeInfo added in v0.0.6

type NodeInfo struct {
	Listening bool
	ChainId   string
	Version   string

	SyncInfo NodeSyncInfo

	PeerCount        commons.UInt64HexString
	GenesisBlockHash string
}

type NodeSyncInfo

type NodeSyncInfo struct {
	StartingBlock commons.UInt64HexString
	CurrentBlock  commons.UInt64HexString
	HighestBlock  commons.UInt64HexString
}

type TxConverter added in v0.0.6

type TxConverter struct {
	Srv *EthServer

	Log *slog.Logger
}

func (*TxConverter) Convert added in v0.0.6

func (c *TxConverter) Convert(ethTx *ethtypes.RpcTx, logs []types.Log) (*proto.Transaction, error)

func (*TxConverter) ConvertERC20Transfer added in v0.0.6

func (c *TxConverter) ConvertERC20Transfer(ethTx *ethtypes.RpcTx, logs []types.Log) ([]*proto.Transfer, error)

func (*TxConverter) ConvertNativeTransfer added in v0.0.6

func (c *TxConverter) ConvertNativeTransfer(ethTx *ethtypes.RpcTx) (*proto.Transfer, error)

func (*TxConverter) DecodeLogAsTransfer added in v0.0.6

func (c *TxConverter) DecodeLogAsTransfer(ethTx *ethtypes.RpcTx, log types.Log) (*proto.Transfer, error)

Jump to

Keyboard shortcuts

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