Documentation ¶
Index ¶
- Constants
- type BlockConverter
- type EthServer
- func (srv *EthServer) AddressFromString(address string) (common.Address, error)
- func (srv *EthServer) AddressToString(address *common.Address) string
- func (srv *EthServer) CombineTransaction(ctx context.Context, req *services.TransactionCombineRequest) (*services.SignedTransaction, error)
- func (srv *EthServer) CreateTransfer(ctx context.Context, req *services.CreateTransferRequest) (*services.TransactionIntent, error)
- func (srv *EthServer) DeriveAccount(ctx context.Context, req *services.DeriveAccountRequest) (*proto.Account, error)
- func (srv *EthServer) GetAccount(ctx context.Context, req *services.GetAccountRequest) (*proto.Account, error)
- func (srv *EthServer) GetBlock(ctx context.Context, req *services.BlockRequest) (*proto.Block, error)
- func (srv *EthServer) GetChain(ctx context.Context, chainId *proto.ChainId) (*proto.Chain, error)
- func (srv *EthServer) GetCurrency(ctx context.Context, req *services.GetCurrencyRequest) (*proto.Currency, error)
- func (srv *EthServer) Info(ctx context.Context)
- func (srv *EthServer) ListBlocks(req *services.ListBlocksRequest, res services.UbtBlockService_ListBlocksServer) error
- func (srv *EthServer) ListChains(req *services.ListChainsRequest, s services.UbtChainService_ListChainsServer) error
- func (srv *EthServer) Send(ctx context.Context, req *services.TransactionSendRequest) (*services.TransactionSendResponse, error)
- func (srv *EthServer) SignTransaction(ctx context.Context, req *services.TransactionSignRequest) (*services.SignedTransaction, error)
- func (srv *EthServer) String() string
- type Extensions
- type NodeInfo
- type NodeSyncInfo
- type TxConverter
- func (c *TxConverter) Convert(ethTx *ethtypes.RpcTx, logs []types.Log) (*proto.Transaction, error)
- func (c *TxConverter) ConvertERC20Transfer(ethTx *ethtypes.RpcTx, logs []types.Log) ([]*proto.Transfer, error)
- func (c *TxConverter) ConvertNativeTransfer(ethTx *ethtypes.RpcTx) (*proto.Transfer, error)
- func (c *TxConverter) DecodeLogAsTransfer(ethTx *ethtypes.RpcTx, log types.Log) (*proto.Transfer, error)
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 ¶
type EthServer struct { services.UnimplementedUbtChainServiceServer services.UnimplementedUbtBlockServiceServer services.UnimplementedUbtConstructServiceServer services.UnimplementedUbtCurrencyServiceServer C *client.BalancedClient Config agent.ChainConfig Chain blockchain.Blockchain ChainId *big.Int CurrencyCache cache.CacheInterface[*proto.Currency] Log *slog.Logger Extensions Extensions }
func InitServer ¶
func InitServer(ctx context.Context, config *agent.ChainConfig) *EthServer
func (*EthServer) AddressFromString ¶ added in v0.0.6
func (*EthServer) AddressToString ¶ added in v0.0.6
func (*EthServer) CombineTransaction ¶
func (srv *EthServer) CombineTransaction(ctx context.Context, req *services.TransactionCombineRequest) (*services.SignedTransaction, error)
func (*EthServer) CreateTransfer ¶
func (srv *EthServer) CreateTransfer(ctx context.Context, req *services.CreateTransferRequest) (*services.TransactionIntent, error)
func (*EthServer) DeriveAccount ¶
func (*EthServer) GetAccount ¶
func (*EthServer) GetCurrency ¶
func (*EthServer) ListBlocks ¶
func (srv *EthServer) ListBlocks(req *services.ListBlocksRequest, res services.UbtBlockService_ListBlocksServer) error
func (*EthServer) ListChains ¶
func (srv *EthServer) ListChains(req *services.ListChainsRequest, s services.UbtChainService_ListChainsServer) error
func (*EthServer) Send ¶
func (srv *EthServer) Send(ctx context.Context, req *services.TransactionSendRequest) (*services.TransactionSendResponse, error)
func (*EthServer) SignTransaction ¶
func (srv *EthServer) SignTransaction(ctx context.Context, req *services.TransactionSignRequest) (*services.SignedTransaction, error)
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
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 (*TxConverter) ConvertNativeTransfer ¶ added in v0.0.6
func (*TxConverter) DecodeLogAsTransfer ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.