utils

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTP = &HTTPClient{}

Functions

func CreateHTTPClient added in v0.4.0

func CreateHTTPClient(requestTimeout time.Duration, tlsVersion uint16) (*http.Client, error)

func EtherToWei added in v0.4.0

func EtherToWei(ether *big.Float) *big.Float
func GetDexscreenerLink(contractAddress string) string

func GetEtherscanTokenURL added in v0.4.0

func GetEtherscanTokenURL(txHash string) string

etherscan.io.

func GetEtherscanTxURL added in v0.4.0

func GetEtherscanTxURL(txHash string) string

etherscan.io.

func GetLinks(txHash common.Hash, contractAddress common.Address, tokenID int64) (string, string, string)

GetLinks returns the links to etherscan, opensea and blur.

func GetOpenseaLink(contractAddress string, tokenID int64) string

opensea.io.

func GetTokenSnifferLink(contractAddress string) string

func ParseFirstTopic added in v0.4.0

func ParseFirstTopic(topics []common.Hash) topic.Topic

func ParseTopics

func ParseTopics(topics []common.Hash) (topic.Topic, common.Address, common.Address, *big.Int)

func PrepareURL added in v0.4.0

func PrepareURL(url string) string

PrepareURL removes not allowed characters and replaces the ipfs:// scheme or "https://ipfs.io" with the configured ipfs gateway.

func WalletShortAddress

func WalletShortAddress(address common.Address) string

func WeiToEther added in v0.4.0

func WeiToEther(wei *big.Int) *big.Float

func WeiToGwei added in v0.4.0

func WeiToGwei(wei *big.Int) *big.Float

Types

type HTTPClient

type HTTPClient struct{}

func (*HTTPClient) Get

func (h *HTTPClient) Get(ctx context.Context, url string) (*http.Response, error)

func (*HTTPClient) GetWithHeader

func (h *HTTPClient) GetWithHeader(ctx context.Context, url string, customHeader http.Header) (*http.Response, error)

func (*HTTPClient) GetWithTLS12

func (h *HTTPClient) GetWithTLS12(ctx context.Context, url string) (*http.Response, error)

func (*HTTPClient) Head added in v0.4.0

func (h *HTTPClient) Head(ctx context.Context, url string) (*http.Response, error)

func (*HTTPClient) Post added in v0.4.0

func (h *HTTPClient) Post(ctx context.Context, url string, payload *strings.Reader) (*http.Response, error)

func (*HTTPClient) PostWithHeader added in v0.4.0

func (h *HTTPClient) PostWithHeader(ctx context.Context, url string, customHeader http.Header, payload *strings.Reader) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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