templates

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SKIP_FIELD = "skip"

Variables

View Source
var EthereumChainsByID = map[string]*EthereumChain{
	"Mainnet": {
		DisplayName:            "Ethereum Mainnet",
		ExplorerLink:           "https://etherscan.io",
		ApiEndpoint:            "https://api.etherscan.io",
		DefaultContractAddress: "bc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
		DefaultContractName:    "Bored Ape Yacht Club",
		FirehoseEndpoint:       "mainnet.eth.streamingfast.io:443",
		Network:                "mainnet",
	},
	"BNB": {
		DisplayName:            "BNB",
		ExplorerLink:           "https://bscscan.com",
		ApiEndpoint:            "https://api.bscscan.com",
		DefaultContractAddress: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
		DefaultContractName:    "CAKE Token",
		FirehoseEndpoint:       "bnb.streamingfast.io:443",
		Network:                "bsc",
	},
	"Polygon": {
		DisplayName:            "Polygon",
		ExplorerLink:           "https://polygonscan.com",
		ApiEndpoint:            "https://api.polygonscan.com",
		DefaultContractAddress: "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
		DefaultContractName:    "WETH Token",
		FirehoseEndpoint:       "polygon.streamingfast.io:443",
		Network:                "polygon",
	},
	"Arbitrum": {
		DisplayName:            "Arbitrum",
		ExplorerLink:           "https://arbiscan.io",
		ApiEndpoint:            "https://api.arbiscan.io",
		DefaultContractAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
		DefaultContractName:    "WETH Token",
		FirehoseEndpoint:       "arb-one.streamingfast.io:443",
		Network:                "arbitrum",
	},
	"Goerli": {
		DisplayName:            "Goerli Testnet",
		ExplorerLink:           "https://goerli.etherscan.io",
		ApiEndpoint:            "https://api-goerli.etherscan.io",
		DefaultContractAddress: "0x4f7a67464b5976d7547c860109e4432d50afb38e",
		DefaultContractName:    "GETH Token",
		FirehoseEndpoint:       "goerli.eth.streamingfast.io:443",
		Network:                "goerli",
	},
	"Mumbai": {
		DisplayName:            "Mumbai Testnet",
		ExplorerLink:           "https://mumbai.polygonscan.com",
		ApiEndpoint:            "https://api-mumbai.polygonscan.com",
		DefaultContractAddress: "0xFCe7187B24FCDc9feFfE428Ec9977240C6F7006D",
		DefaultContractName:    "USDT Token",
		FirehoseEndpoint:       "mumbai.streamingfast.io:443",
		Network:                "mumbai",
	},
}
View Source
var ProjectGeneratorFuncs = template.FuncMap{
	"add": func(left int, right int) int {
		return left + right
	},
	"sanitizeProtoFieldName": sanitizeProtoFieldName,
	"toUpper":                strings.ToUpper,
	"capitalizeFirst":        strings.Title,
}

Functions

func BuildCallModels added in v1.3.5

func BuildCallModels(abi *eth.ABI) (out []codegenCall, err error)

func BuildEventModels added in v1.1.18

func BuildEventModels(abi *eth.ABI) (out []codegenEvent, err error)

Types

type DDSContract added in v1.3.4

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

func (*DDSContract) GetCalls added in v1.3.5

func (c *DDSContract) GetCalls() []codegenCall

func (*DDSContract) GetCreationAddressField added in v1.3.4

func (c *DDSContract) GetCreationAddressField() string

func (*DDSContract) GetCreationEvent added in v1.3.4

func (c *DDSContract) GetCreationEvent() string

func (*DDSContract) GetEvents added in v1.3.4

func (c *DDSContract) GetEvents() []codegenEvent

func (*DDSContract) GetName added in v1.3.4

func (c *DDSContract) GetName() string

func (*DDSContract) HasCalls added in v1.3.5

func (c *DDSContract) HasCalls() bool

type EthereumChain

type EthereumChain struct {
	ID                     string
	DisplayName            string
	ExplorerLink           string
	ApiEndpoint            string
	DefaultContractAddress string
	DefaultContractName    string
	FirehoseEndpoint       string
	Network                string
}

type EthereumContract added in v1.1.18

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

func NewEthereumContract added in v1.1.18

func NewEthereumContract(name string, address eth.Address, abi *eth.ABI, abiContent string) *EthereumContract

func (*EthereumContract) AddDynamicDataSource added in v1.3.4

func (e *EthereumContract) AddDynamicDataSource(
	name string,
	abi *eth.ABI,
	abiContent string,
	creationEvent string,
	creationAddressField string,

	withCalls bool,
) (err error)

func (*EthereumContract) GetAbi added in v1.1.18

func (e *EthereumContract) GetAbi() *eth.ABI

func (*EthereumContract) GetAddress added in v1.1.18

func (e *EthereumContract) GetAddress() eth.Address

func (*EthereumContract) GetCalls added in v1.3.5

func (e *EthereumContract) GetCalls() []codegenCall

func (*EthereumContract) GetDDS added in v1.3.4

func (e *EthereumContract) GetDDS() []*DDSContract

func (*EthereumContract) GetEvents added in v1.1.18

func (e *EthereumContract) GetEvents() []codegenEvent

func (*EthereumContract) GetName added in v1.1.18

func (e *EthereumContract) GetName() string

func (*EthereumContract) GetWithCalls added in v1.3.5

func (e *EthereumContract) GetWithCalls() bool

func (*EthereumContract) HasCalls added in v1.3.5

func (e *EthereumContract) HasCalls() bool

func (*EthereumContract) SetAbi added in v1.1.18

func (e *EthereumContract) SetAbi(abi *eth.ABI)

func (*EthereumContract) SetAbiContent added in v1.1.18

func (e *EthereumContract) SetAbiContent(abiContent string)

func (*EthereumContract) SetCalls added in v1.3.5

func (e *EthereumContract) SetCalls(calls []codegenCall)

func (*EthereumContract) SetEvents added in v1.1.18

func (e *EthereumContract) SetEvents(events []codegenEvent)

func (*EthereumContract) SetName added in v1.1.18

func (e *EthereumContract) SetName(name string)

func (*EthereumContract) SetWithCalls added in v1.3.5

func (e *EthereumContract) SetWithCalls(v bool)

type EthereumProject

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

func NewEthereumProject

func NewEthereumProject(name string, moduleName string, chain *EthereumChain, contracts []*EthereumContract, lowestStartBlock uint64) (*EthereumProject, error)

func (*EthereumProject) HasDDS added in v1.3.4

func (p *EthereumProject) HasDDS() bool

func (*EthereumProject) Render

func (p *EthereumProject) Render() (map[string][]byte, error)

type Project

type Project interface {
	Render() (map[string][]byte, error)
}

type ProjectFunc

type ProjectFunc func() (map[string][]byte, error)

func (ProjectFunc) Render

func (f ProjectFunc) Render() (map[string][]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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