rpc

package
v0.0.0-...-d2b7839 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetArweaveDataHTTP

func GetArweaveDataHTTP(ctx context.Context, id string) ([]byte, error)

func GetArweaveDataHTTPReader

func GetArweaveDataHTTPReader(ctx context.Context, id string) (io.ReadCloser, error)

func GetBalanceOfERC1155Token

func GetBalanceOfERC1155Token(ctx context.Context, pOwnerAddress, pContractAddress persist.EthereumAddress, pTokenID persist.HexTokenID, ethClient *ethclient.Client) (*big.Int, error)

GetBalanceOfERC1155Token returns the balance of an ERC1155 token

func GetDataFromURIAsReader

func GetDataFromURIAsReader(ctx context.Context, turi persist.TokenURI, mediaType persist.MediaType, ipfsClient *shell.Shell, arweaveClient *goar.Client, bufSize int, retrieveTimeout time.Duration, recurseRawReturns bool) (*util.FileHeaderReader, persist.MediaType, error)

GetDataFromURIAsReader calls URI and returns the data as an unread reader with the headers pre-read. retrieveTimeout is the timeout for just the retrieval of the reader, not the reading of the reader which will be handled by the context recurseRawReturns will cause the function to recursively call itself if the reader returned from any initial call is a "raw" URI (a URI that in itself contains the data to be retrieved, not a URI that points to the data to be retrieved)

func GetHTTPHeaders

func GetHTTPHeaders(ctx context.Context, url string) (http.Header, error)

GetHTTPHeaders returns the headers for the given URL

func GetMetadataFromURI

func GetMetadataFromURI(ctx context.Context, turi persist.TokenURI, ipfsClient *shell.Shell, arweaveClient *goar.Client) (persist.TokenMetadata, error)

GetMetadataFromURI parses and returns the NFT metadata for a given token URI

func GetOwnerOfERC721Token

func GetOwnerOfERC721Token(ctx context.Context, pContractAddress persist.EthereumAddress, pTokenID persist.HexTokenID, ethClient *ethclient.Client) (persist.EthereumAddress, error)

GetOwnerOfERC721Token returns the Owner of an ERC721 token

func GetTokenURI

func GetTokenURI(ctx context.Context, pTokenType persist.TokenType, pContractAddress persist.EthereumAddress, pTokenID persist.HexTokenID, ethClient *ethclient.Client) (persist.TokenURI, error)

GetTokenURI returns metadata URI for a given token address.

func NewEthClient

func NewEthClient() *ethclient.Client

NewEthClient returns an ethclient.Client

func NewStorageClient

func NewStorageClient(ctx context.Context) *storage.Client

func RetryGetTokenURI

func RetryGetTokenURI(ctx context.Context, tokenType persist.TokenType, contractAddress persist.EthereumAddress, tokenID persist.HexTokenID, ethClient *ethclient.Client) (persist.TokenURI, error)

RetryGetTokenURI calls GetTokenURI with backoff.

func RewriteURIToHTTP

func RewriteURIToHTTP(u string, isFxhash bool) string

Types

type ErrEthClient

type ErrEthClient struct {
	Err error
}

func (ErrEthClient) Error

func (e ErrEthClient) Error() string

type ErrTokenURINotFound

type ErrTokenURINotFound struct {
	Err error
}

func (ErrTokenURINotFound) Error

func (e ErrTokenURINotFound) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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