Documentation ¶
Index ¶
- func GetArweaveDataHTTP(ctx context.Context, id string) ([]byte, error)
- func GetArweaveDataHTTPReader(ctx context.Context, id string) (io.ReadCloser, error)
- func GetBalanceOfERC1155Token(ctx context.Context, pOwnerAddress, pContractAddress persist.EthereumAddress, ...) (*big.Int, error)
- func GetDataFromURIAsReader(ctx context.Context, turi persist.TokenURI, mediaType persist.MediaType, ...) (*util.FileHeaderReader, persist.MediaType, error)
- func GetHTTPHeaders(ctx context.Context, url string) (http.Header, error)
- func GetMetadataFromURI(ctx context.Context, turi persist.TokenURI, ipfsClient *shell.Shell, ...) (persist.TokenMetadata, error)
- func GetOwnerOfERC721Token(ctx context.Context, pContractAddress persist.EthereumAddress, ...) (persist.EthereumAddress, error)
- func GetTokenURI(ctx context.Context, pTokenType persist.TokenType, ...) (persist.TokenURI, error)
- func NewEthClient() *ethclient.Client
- func NewStorageClient(ctx context.Context) *storage.Client
- func RetryGetTokenURI(ctx context.Context, tokenType persist.TokenType, ...) (persist.TokenURI, error)
- func RewriteURIToHTTP(u string, isFxhash bool) string
- type ErrEthClient
- type ErrTokenURINotFound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 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 ¶
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