Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransferEventSig  = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
	TransferSingleSig = "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62"
	TransferBatchSig  = "0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb"
)

Variables

View Source
var (
	ERC20ABI, ERC721ABI, ERC1155ABI abi.ABI
	ERC20ABIStr                     = `` /* 2177-byte string literal not displayed */
	ERC721ABIStr                    = `` /* 3892-byte string literal not displayed */
	ERC1155ABIStr                   = `` /* 3584-byte string literal not displayed */
)

Functions

func GetLastestBlockFromChainUrl

func GetLastestBlockFromChainUrl(url string) (uint64, error)

func InitChainClient

func InitChainClient(chain models.Chain) (*ethclient.Client, error)

func InitNewRPCClient

func InitNewRPCClient(url string) (*rpc.Client, error)

Types

type AddressSet

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

AddressSet holds unique Ethereum addresses using a map

func NewAddressSet

func NewAddressSet() *AddressSet

NewAddressSet initializes a new AddressSet

func (*AddressSet) AddAddress

func (a *AddressSet) AddAddress(addr common.Address)

AddAddress adds a new address to the set if it doesn't already exist

func (*AddressSet) GetAddresses

func (a *AddressSet) GetAddresses() []common.Address

GetAddresses returns the list of unique addresses

func (*AddressSet) Reset

func (a *AddressSet) Reset()

Reset clears all addresses in the AddressSet

type Erc20TransferEvent

type Erc20TransferEvent struct {
	From  common.Address
	To    common.Address
	Value *big.Int
}

Erc20TransferEvent represents the structure of the Transfer event in the contract

type Erc721TransferEvent

type Erc721TransferEvent struct {
	From    common.Address
	To      common.Address
	TokenID *big.Int
}

Erc721TransferEvent represents the structure of the ERC721 Transfer event

type Erc1155TransferBatchEvent

type Erc1155TransferBatchEvent struct {
	Operator common.Address
	From     common.Address
	To       common.Address
	Ids      []*big.Int
	Values   []*big.Int
}

Erc1155TransferBatchEvent represents the structure of the ERC1155 TransferBatch event

type Erc1155TransferSingleEvent

type Erc1155TransferSingleEvent struct {
	Operator common.Address
	From     common.Address
	To       common.Address
	Id       *big.Int
	Value    *big.Int
}

Erc1155TransferSingleEvent represents the structure of the ERC1155 TransferSingle event

type TokenIdContractAddressSet

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

TokenIdContractAddressSet holds unique token ID and contract address pairs using a map of values

func NewTokenIdContractAddressSet

func NewTokenIdContractAddressSet() *TokenIdContractAddressSet

NewTokenIdContractAddressSet initializes a new TokenIdContractAddressSet

func (*TokenIdContractAddressSet) AddTokenIdContractAddress

func (t *TokenIdContractAddressSet) AddTokenIdContractAddress(tokenId *big.Int, contractAddress string)

AddTokenId adds a new token ID and contract address pair to the set if it doesn't already exist

func (*TokenIdContractAddressSet) GetTokenIdContractAddressses

func (t *TokenIdContractAddressSet) GetTokenIdContractAddressses() []struct {
	TokenId         *big.Int
	ContractAddress string
}

GetTokenIds returns the list of unique token ID and contract address pairs

func (*TokenIdContractAddressSet) Reset

func (t *TokenIdContractAddressSet) Reset()

Reset clears all token ID and contract address pairs in the TokenIdContractAddressSet

type TokenIdSet

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

TokenIdSet holds unique token IDs using a map of values

func NewTokenIdSet

func NewTokenIdSet() *TokenIdSet

NewTokenIdSet initializes a new TokenIdSet

func (*TokenIdSet) AddTokenId

func (t *TokenIdSet) AddTokenId(tokenId *big.Int)

AddTokenId adds a new token ID to the set if it doesn't already exist

func (*TokenIdSet) GetTokenIds

func (t *TokenIdSet) GetTokenIds() []*big.Int

GetTokenIds returns the list of unique token IDs

func (*TokenIdSet) Reset

func (t *TokenIdSet) Reset()

Reset clears all token IDs in the TokenIdSet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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