eth

package
v0.0.0-...-9a83fbb Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainId_Main    string = "1"
	ChianId_Polygon string = "137"
)
View Source
const BaseURL = "https://api.polygonscan.com/api"
View Source
const IsValidSignatureABI = "" /* 328-byte string literal not displayed */
View Source
const UnipassMessagePrefix = "\x18UniPass Signed Message:\n"

Variables

View Source
var EIP1271_SELECTOR = [32]byte{22, 38, 186, 126}

0x1626ba7e

Functions

func CheckAddress

func CheckAddress(addr string)

func GetClient

func GetClient(options *EthOptions) (*ethclient.Client, error)

func IsValidSignature

func IsValidSignature(
	ctx context.Context,
	client *ethclient.Client,
	account common.Address,
	msg, sig []byte,
) (bool, error)

func IsValidTypedSignature

func IsValidTypedSignature(
	ctx context.Context,
	client *ethclient.Client,
	account common.Address,
	data apitypes.TypedData,
	sig []byte,
) (bool, error)

func NormalizeAddress

func NormalizeAddress(addr string) string

func ToFiles

func ToFiles(path string) shell.AddOpts

func UnipassHashMessage

func UnipassHashMessage(message []byte) []byte

func WrapWithDirectory

func WrapWithDirectory(wrap bool) shell.AddOpts

Types

type Erc1155Subscription

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

func NewErc1155TransferWatcher

func NewErc1155TransferWatcher(handler Erc1155TransferHandleFunc) *Erc1155Subscription

func (*Erc1155Subscription) BalanceOf

func (sub *Erc1155Subscription) BalanceOf(contract common.Address, account common.Address, tokenId *big.Int) *big.Int

func (*Erc1155Subscription) Subscribe

func (esub *Erc1155Subscription) Subscribe(addresses []common.Address)

type Erc1155TranferInfo

type Erc1155TranferInfo struct {
	Address  common.Address
	Operator common.Address
	From     common.Address
	To       common.Address
	Id       *big.Int
	Value    *big.Int
	Tx       common.Hash
}

type Erc1155TransferHandleFunc

type Erc1155TransferHandleFunc func(sub *Erc1155Subscription, logs []*Erc1155TranferInfo)

type EthClientConfig

type EthClientConfig struct {
	ChainId string
	Url     string
}

type EthClientFactory

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

func NewEthClientFactory

func NewEthClientFactory(options *EthOptions) *EthClientFactory

func (*EthClientFactory) Create

func (ef *EthClientFactory) Create(chainId string) *ethclient.Client

type EthOptions

type EthOptions struct {
	DailUrl string
	Main    *EthClientConfig
	Polygon *EthClientConfig
}

func NewEthOptions

func NewEthOptions() *EthOptions

func (*EthOptions) GetEthConfig

func (eo *EthOptions) GetEthConfig(chainId string) *EthClientConfig

type FilesApi

type FilesApi httpapi.HttpApi

type Filter

type Filter struct {
	From    uint64
	To      *uint64
	Address *common.Address
	Topic0  *common.Hash
}

type Ipfs

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

func NewIpfsClient

func NewIpfsClient(options *IpfsOptions) *Ipfs

func (*Ipfs) Files

func (ip *Ipfs) Files() *FilesApi

func (*Ipfs) RemotePin

func (ip *Ipfs) RemotePin() *RemotePinApi

func (*Ipfs) Shell

func (ip *Ipfs) Shell() *shell.Shell

type IpfsOptions

type IpfsOptions struct {
	Url string
}

type PolygonscanClient

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

func NewPolygonscanClient

func NewPolygonscanClient(apiKey string) *PolygonscanClient

func (*PolygonscanClient) GetLogs

func (pc *PolygonscanClient) GetLogs(filter *Filter) []types.Log

type RemotePinApi

type RemotePinApi httpapi.HttpApi

func (*RemotePinApi) Add

func (rp *RemotePinApi) Add(ctx context.Context, p *shell.LsLink) error

func (*RemotePinApi) Remove

func (rp *RemotePinApi) Remove(ctx context.Context, name string) error

type TokenMeta

type TokenMeta map[string]string

func (TokenMeta) ID

func (t TokenMeta) ID() string

func (TokenMeta) Name

func (t TokenMeta) Name() string

Jump to

Keyboard shortcuts

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