api

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 13 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) OnError added in v0.0.4

func (api *API) OnError(ctx context.Context, err *cborrpc.Error)

func (*API) ServeRPC added in v0.0.4

func (api *API) ServeRPC(ctx context.Context, req *cborrpc.Request) *cborrpc.Response

ServeRPC is the main entrypoint for the LDVM.

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      ids.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      ids.Address      `json:"from"`
	To        *ids.Address     `json:"to"`
	Token     *ids.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