Documentation
¶
Overview ¶
Copyright 2018 AMIS Technologies This file is part of the sol2proto
The sol2proto is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The sol2proto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the sol2proto. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func GenerateServiceProtoFile(srvName, pkgName string, contractABI abi.ABI, version string) (protoFile ProtoFile, msgs []Message)
- func ParseEvent(ev abi.Event) (Method, []Message)
- func ParseEvents(abiEvents map[string]abi.Event) (methods Methods, msgs []Message)
- func ParseMethod(m abi.Method) (Method, []Message)
- func ParseMethods(abiMethods map[string]abi.Method) (methods Methods, msgs []Message)
- type Argument
- type Message
- type MessageProtoFile
- type Messages
- type Method
- type Methods
- type ProtoFile
- type Sources
Constants ¶
This section is empty.
Variables ¶
var Empty = Message{
Name: "Empty",
}
var MessagesTemplate string = `` /* 287-byte string literal not displayed */
var ServiceTemplate string = `` /* 350-byte string literal not displayed */
var TransactOptsReq = Message{ Name: "TransactOpts", Args: []Argument{ { Name: "private_key", IsSlice: false, Type: "string", }, { Name: "nonce", IsSlice: false, Type: "int64", }, { Name: "value", IsSlice: false, Type: "int64", }, { Name: "gas_price", IsSlice: false, Type: "int64", }, { Name: "gas_limit", IsSlice: false, Type: "int64", }, }, }
var TransactionReq = Message{ Name: "TransactionReq", Args: []Argument{ { Name: "opts", Type: TransactOptsReq.Name, IsSlice: false, }, }, }
var TransactionResp = Message{ Name: "TransactionResp", Args: []Argument{ { Name: "hash", IsSlice: false, Type: "string", }, }, }
Functions ¶
func GenerateServiceProtoFile ¶
func GenerateServiceProtoFile(srvName, pkgName string, contractABI abi.ABI, version string) (protoFile ProtoFile, msgs []Message)
Generate a renderable object and required message types from an Ethereum contract ABI
func ParseEvent ¶
Parse gRPC method and required message types from an Ethereum event.
func ParseEvents ¶
Parse gRPC methods and required message types from events in an Ethereum contract ABI.
func ParseMethod ¶
Parse gRPC method and required message types from an Ethereum contract method.
Types ¶
type Argument ¶
func ToGrpcArgument ¶
type MessageProtoFile ¶
type MessageProtoFile struct { GeneratorVersion string Package string Name string Messages Messages Sources Sources }
func GenerateMessageProtoFile ¶
func GenerateMessageProtoFile(name, pkgName string, sources []string, messages []Message, version string) MessageProtoFile
Generate a renderable object from a list of messages
func (MessageProtoFile) Render ¶
func (p MessageProtoFile) Render(writer io.WriteCloser) error
type Messages ¶
type Messages []Message
type Methods ¶
type Methods []Method