api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(bc chain.BlockChain, name string) *API

func (*API) RPC

func (api *API) RPC(req *cborrpc.Req) *cborrpc.Res

RPC is the main entrypoint for the LDVM. https://ethereum.org/en/developers/docs/apis/json-rpc

func (*API) ServeHTTP

func (api *API) ServeHTTP(w http.ResponseWriter, r *http.Request)

type EncodeReply

type EncodeReply struct {
	Bytes    string              `json:"bytes"`
	Encoding formatting.Encoding `json:"encoding"` // hex
	Length   int                 `json:"length"`
}

func (*EncodeReply) SetTxData

func (r *EncodeReply) SetTxData(tx TxData) error

type NoArgs

type NoArgs struct{}

type PrevDataParams

type PrevDataParams struct {
	ID      util.DataID
	Version uint64
	// contains filtered or unexported fields
}

type TransactionArgs

type TransactionArgs struct {
	Type      uint16            `json:"type"`
	ChainID   uint64            `json:"chainID"`
	Nonce     uint64            `json:"nonce"`
	GasTip    uint64            `json:"gasTip"`
	GasFeeCap uint64            `json:"gasFeeCap"`
	From      util.Address      `json:"from"`
	To        *util.Address     `json:"to"`
	Token     *util.TokenSymbol `json:"token"`
	Amount    *big.Int          `json:"amount"`
	Data      json.RawMessage   `json:"data"`
}

type TxData

type TxData interface {
	SyntacticVerify() error
	Bytes() []byte
}

type VMAPI

type VMAPI struct{}

func NewVMAPI

func NewVMAPI() *VMAPI

func (*VMAPI) EncodeTx

func (api *VMAPI) EncodeTx(_ *http.Request, args *TransactionArgs, reply *EncodeReply) error

func (*VMAPI) Genesis

func (api *VMAPI) Genesis(_ *http.Request, args *NoArgs, reply *genesis.Genesis) error

Genesis returns the genesis data

Jump to

Keyboard shortcuts

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