tzgen

command module
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 1 Imported by: 0

README

tzgen

Go binding to Tezos smart contracts, using code generation.

Installation

go install github.com/jeanschmitt/tzgen@latest

Usage

From a deployed contract
tzgen --name Hello --pkg contracts --address KT1K3ZqbYq1bCwpSPNX9xBgQd8CaYxRVXd4P -o ./contracts/Hello.go

The endpoint is https://mainnet.smartpy.io by default, but can be overridden with --endpoint.

From a micheline file
tzgen --name Hello --pkg contracts --src ./Hello.json -o ./contracts/Hello.go

Renaming structs

Some structs don't have annotations in the contract's script. In this case, an auto-generated name is given.

It is possible to give a configuration map to tzgen, to map these auto-generated names to the one you want.

To do so, pass a yaml to tzgen with the -f flag.

Example of a fixup file:

FA2NFTRecord3:
  name: OperatorForAll
  fields:
    Field0: Addr
    Field1: Owner

FA2NFTRecord5:
  name: BalanceOfRequest

FA2NFTRequest:
  equals: FA2NFTRecord5

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg
ast
bind
Package bind contains utility functions and types that are used by generated contract code.
Package bind contains utility functions and types that are used by generated contract code.

Jump to

Keyboard shortcuts

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