clients_common

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Mainnet = iota
	Testnet
	Devnet
)
View Source
const (
	Http = iota
	WebSocket
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommunicationProtocol

type CommunicationProtocol uint8

type ContractClient

type ContractClient struct {
	EthClient *ethclient.Client
	Config    NetConfig
}

func NewContractClient

func NewContractClient(config NetConfig, communicationProtocol CommunicationProtocol) (*ContractClient, error)

func (*ContractClient) CreateNewTransactOpts

func (ContractClient *ContractClient) CreateNewTransactOpts(transactor *Transactor) (*bind.TransactOpts, error)

func (*ContractClient) NewTransactor

func (ContractClient *ContractClient) NewTransactor(privateKeyStr string) (*Transactor, error)

type NetConfig

type NetConfig struct {
	HttpUrl         string         `json:"http_url"`
	WsUrl           string         `json:"ws_url"`
	ChainID         *big.Int       `json:"chain_id"`
	ContractAddress common.Address `json:"contract_address"`
}

type Network

type Network uint8

type Transactor

type Transactor struct {
	TransactOpts *bind.TransactOpts
	Address      common.Address
	Nonce        uint64
}

Jump to

Keyboard shortcuts

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