tokenutil

package
v0.0.0-...-83323f8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERC20Abi                = `` /* 2177-byte string literal not displayed */
	ApproveERC20DefaultGas  = 60000
	TransferERC20DefaultGas = 60000
)

Variables

This section is empty.

Functions

func Allowance

func Allowance(client *ethclient.Client, token string, owner string, spender string) (*big.Int, error)

func Approve

func Approve(client *ethclient.Client, chainId *big.Int, priv *ecdsa.PrivateKey, token string, spender string, nonce uint64, gas uint64, gasPrice *big.Int) (string, error)

func BalanceOf

func BalanceOf(client *ethclient.Client, token string, account string) (*big.Int, error)

func ConvertAmount

func ConvertAmount(amount *big.Int, decimals int32) decimal.Decimal

func Decimals

func Decimals(client *ethclient.Client, token string) (int32, error)

func Name

func Name(client *ethclient.Client, token string) (string, error)

func Symbol

func Symbol(client *ethclient.Client, token string) (string, error)

func TotalSupply

func TotalSupply(client *ethclient.Client, token string) (*big.Int, error)

func Transfer

func Transfer(client *ethclient.Client, priv *ecdsa.PrivateKey, token string, to string, transferAmount *big.Int, nonce uint64, gas int64, gasPrice *big.Int) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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