service

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(Rpc string) (error, *ethclient.Client)

func EthBalance added in v0.0.4

func EthBalance(cli *ethclient.Client, wallet string) (*big.Int, error)

func GetAuth

func GetAuth(cli *ethclient.Client, priKey string, chainId int64) (*bind.TransactOpts, error)

Types

type Erc20

type Erc20 struct {
	Cli      *ethclient.Client
	Contract *erc20.Erc20
}

func NewErc20

func NewErc20(cli *ethclient.Client, erc20Token string) *Erc20

func (Erc20) Allowance

func (e Erc20) Allowance(owner, spender string) (*big.Int, error)

func (Erc20) Approve

func (e Erc20) Approve(cli *ethclient.Client, chainId int64, priKey, spender string, amount int64) (*types.Transaction, error)

func (Erc20) BalanceOf

func (e Erc20) BalanceOf(wallet string) (*big.Int, error)

func (Erc20) Decimals

func (e Erc20) Decimals() (uint8, error)

func (Erc20) Transfer added in v0.0.4

func (e Erc20) Transfer(cli *ethclient.Client, chainId int64, priKey, to string, amount string) (*types.Transaction, error)

Jump to

Keyboard shortcuts

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