parser

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABI

type ABI struct {
	Methods        []GetMethod `xml:"get_method"`
	Internals      []Message   `xml:"internal"`
	ExtOut         []Message   `xml:"ext_out"`
	ExtIn          []Message   `xml:"ext_in"`
	JettonPayloads []Message   `xml:"jetton_payload"`
	NFTPayloads    []Message   `xml:"nft_payload"`
	Interfaces     []Interface `xml:"interface"`
	Types          []string    `xml:"types"`
}

func ParseABI

func ParseABI(s []byte) (ABI, error)

type Generator

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

func NewGenerator

func NewGenerator(knownTypes map[string]tlbParser.DefaultType, abi ABI) (*Generator, error)

func (*Generator) CollectedTypes

func (g *Generator) CollectedTypes() string

func (*Generator) GenerateMsgDecoder

func (g *Generator) GenerateMsgDecoder() string

func (*Generator) GetMethods

func (g *Generator) GetMethods() (string, []string, error)

func (*Generator) RenderInvocationOrderList

func (g *Generator) RenderInvocationOrderList(simpleMethods []string) (string, error)

func (*Generator) RenderJetton added in v1.3.0

func (g *Generator) RenderJetton() (string, error)

func (*Generator) RenderMessagesMD added in v1.4.2

func (g *Generator) RenderMessagesMD() (string, error)

RenderMessagesMD renders messages.md file with messages and their names + opcodes.

func (*Generator) RenderNFT added in v1.3.0

func (g *Generator) RenderNFT() (string, error)

type GetMethod

type GetMethod struct {
	Tag   xml.Name
	Input struct {
		StackValues []StackRecord `xml:",any"`
	} `xml:"input"`
	Name   string            `xml:"name,attr"`
	ID     int               `xml:"id,attr"`
	Output []GetMethodOutput `xml:"output"`
}

func ParseMethod

func ParseMethod(s []byte) (GetMethod, error)

func (GetMethod) GolangFunctionName

func (m GetMethod) GolangFunctionName() string

func (GetMethod) UsedByIntrospection

func (m GetMethod) UsedByIntrospection() bool

type GetMethodOutput

type GetMethodOutput struct {
	Version     string        `xml:"version,attr"`
	FixedLength bool          `xml:"fixed_length,attr"`
	Stack       []StackRecord `xml:",any"`
}

func (GetMethodOutput) FullResultName

func (o GetMethodOutput) FullResultName(methodName string) string

type Interface added in v1.3.0

type Interface struct {
	Name    string `xml:"name,attr"`
	Methods []struct {
		Name    string `xml:"name,attr"`
		Version string `xml:"version,attr"`
	} `xml:"get_method"`
	Input struct {
		Internals []InterfaceMessage `xml:"internal"`
		Externals []InterfaceMessage `xml:"ext_in"`
	} `xml:"msg_in"`
	Output struct {
		Internals []InterfaceMessage `xml:"internal"`
		Externals []InterfaceMessage `xml:"ext_out"`
	} `xml:"msg_out"`
	CodeHashes []string `xml:"code_hash"`
	Inherits   string   `xml:"inherits,attr"`
}

type InterfaceMessage added in v1.3.0

type InterfaceMessage struct {
	Name string `xml:"name,attr"`
}

type Message

type Message struct {
	Name  string `xml:"name,attr"`
	Input string `xml:",chardata"`
	// FixedLength means that a destination type must have the same size in bits as the number of bits in a cell.
	FixedLength bool `xml:"fixed_length,attr"`
}

type MsgType added in v1.5.0

type MsgType int
const (
	MsgTypeIn            MsgType = 0
	MsgTypeExtIn         MsgType = 1
	MsgTypeExtOut        MsgType = 2
	MsgTypeJettonPayload MsgType = 3
	MsgTypeNFTPayload    MsgType = 4
)

type StackRecord

type StackRecord struct {
	XMLName       xml.Name
	Name          string        `xml:"name,attr"`
	Nullable      bool          `xml:"nullable,attr"`
	List          bool          `xml:"list,attr"`
	Type          string        `xml:",chardata"`
	RequiredValue string        `xml:"required_value,attr"`
	SubStack      []StackRecord `xml:",any"`
}

type TLBMsgBody

type TLBMsgBody struct {
	Type             MsgType
	GolangTypeName   string
	GolangOpcodeName string
	OperationName    string
	Tag              uint64
	Code             string
	FixedLength      bool
}

Jump to

Keyboard shortcuts

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