Documentation ¶
Index ¶
- type ArbitrumProvider
- type BaseProvider
- type ChainProvider
- type ContractOwnerResult
- type ErrProviderFailed
- type EthereumProvider
- type OptimismProvider
- type PoapProvider
- type PolygonProvider
- type Provider
- func (p *Provider) AddTokensToUserUnchecked(ctx context.Context, userID persist.DBID, ...) ([]op.TokenFullDetails, error)
- func (p *Provider) GetTokenMetadataByTokenIdentifiers(ctx context.Context, contractAddress persist.Address, ...) (persist.TokenMetadata, error)
- func (p *Provider) GetTokenMetadataByTokenIdentifiersBatch(ctx context.Context, chain persist.Chain, ...) ([]persist.TokenMetadata, error)
- func (p *Provider) GetTokensOfContractForWallet(ctx context.Context, contractAddress persist.ChainAddress, ...) ([]op.TokenFullDetails, error)
- func (p *Provider) RefreshContract(ctx context.Context, ci persist.ContractIdentifiers) error
- func (p *Provider) RefreshToken(ctx context.Context, ti persist.TokenIdentifiers) error
- func (p *Provider) RefreshTokenDescriptorsByTokenIdentifiers(ctx context.Context, ti persist.TokenIdentifiers) (db.TokenDefinition, error)
- func (p *Provider) SyncCreatedTokensForExistingContract(ctx context.Context, userID persist.DBID, contractID persist.DBID) error
- func (p *Provider) SyncCreatedTokensForNewContracts(ctx context.Context, userID persist.DBID, chains []persist.Chain) error
- func (p *Provider) SyncTokenByUserWalletsAndTokenIdentifiersRetry(ctx context.Context, userID persist.DBID, t persist.TokenIdentifiers, ...) (token op.TokenFullDetails, err error)
- func (p *Provider) SyncTokensByUserID(ctx context.Context, userID persist.DBID, chains []persist.Chain) error
- func (p *Provider) SyncTokensByUserIDAndTokenIdentifiers(ctx context.Context, userID persist.DBID, ...) ([]op.TokenFullDetails, error)
- func (p *Provider) TokenExists(ctx context.Context, token persist.TokenIdentifiers, r retry.Retry) (td db.TokenDefinition, err error)
- func (p *Provider) VerifySignature(ctx context.Context, pSig string, pMessage string, ...) (bool, error)
- type ProviderLookup
- type TezosProvider
- type ZoraProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArbitrumProvider ¶
type ArbitrumProvider struct { common.ContractFetcher common.ContractsCreatorFetcher common.TokenDescriptorsFetcher common.TokenIdentifierOwnerFetcher common.TokenMetadataBatcher common.TokenMetadataFetcher common.TokensByContractWalletFetcher common.TokensByTokenIdentifiersFetcher common.TokensIncrementalContractFetcher common.TokensIncrementalOwnerFetcher }
type BaseProvider ¶
type BaseProvider struct { common.ContractFetcher common.ContractsCreatorFetcher common.TokenDescriptorsFetcher common.TokenIdentifierOwnerFetcher common.TokenMetadataBatcher common.TokenMetadataFetcher common.TokensByContractWalletFetcher common.TokensByTokenIdentifiersFetcher common.TokensIncrementalContractFetcher common.TokensIncrementalOwnerFetcher }
type ChainProvider ¶
type ChainProvider struct { Ethereum *EthereumProvider Tezos *TezosProvider Optimism *OptimismProvider Arbitrum *ArbitrumProvider Poap *PoapProvider Zora *ZoraProvider Base *BaseProvider Polygon *PolygonProvider }
type ContractOwnerResult ¶
type ContractOwnerResult struct { Contracts []common.ChainAgnosticContract Chain persist.Chain }
type ErrProviderFailed ¶
type ErrProviderFailed struct{ Err error }
func (ErrProviderFailed) Error ¶
func (e ErrProviderFailed) Error() string
func (ErrProviderFailed) Unwrap ¶
func (e ErrProviderFailed) Unwrap() error
type EthereumProvider ¶
type EthereumProvider struct { common.ContractFetcher common.ContractsCreatorFetcher common.TokenDescriptorsFetcher common.TokenIdentifierOwnerFetcher common.TokenMetadataBatcher common.TokenMetadataFetcher common.TokensByContractWalletFetcher common.TokensByTokenIdentifiersFetcher common.TokensIncrementalContractFetcher common.TokensIncrementalOwnerFetcher common.Verifier }
type OptimismProvider ¶
type OptimismProvider struct { common.ContractFetcher common.ContractsCreatorFetcher common.TokenDescriptorsFetcher common.TokenIdentifierOwnerFetcher common.TokenMetadataBatcher common.TokenMetadataFetcher common.TokensByContractWalletFetcher common.TokensByTokenIdentifiersFetcher common.TokensIncrementalContractFetcher common.TokensIncrementalOwnerFetcher }
type PoapProvider ¶
type PoapProvider struct { common.TokenDescriptorsFetcher common.TokenMetadataFetcher common.TokensIncrementalOwnerFetcher common.TokenIdentifierOwnerFetcher }
type PolygonProvider ¶
type PolygonProvider struct { common.ContractFetcher common.ContractsCreatorFetcher common.TokenDescriptorsFetcher common.TokenIdentifierOwnerFetcher common.TokenMetadataBatcher common.TokenMetadataFetcher common.TokensByContractWalletFetcher common.TokensByTokenIdentifiersFetcher common.TokensIncrementalContractFetcher common.TokensIncrementalOwnerFetcher }
type Provider ¶
type Provider struct { Repos *postgres.Repositories Queries *db.Queries Chains ProviderLookup Submitter tokenmanage.Submitter }
func NewMultichainProvider ¶
func NewMultichainProvider(contextContext context.Context, repositories *postgres.Repositories, queries *coredb.Queries, client *ethclient.Client, taskClient *task.Client, cache *redis.Cache) *Provider
NewMultichainProvider is a wire injector that sets up a multichain provider instance ethClient.Client and task.Client are expensive to initialize so they're passed as an arg.
func (*Provider) AddTokensToUserUnchecked ¶
func (p *Provider) AddTokensToUserUnchecked(ctx context.Context, userID persist.DBID, tIDs []persist.TokenUniqueIdentifiers, newQuantities []persist.HexString) ([]op.TokenFullDetails, error)
AddTokensToUserUnchecked adds tokens to a user with the requested quantities. AddTokensToUserUnchecked does not make any effort to validate that the user owns the tokens, only that the tokens exist and are fetchable on chain. This is useful for adding tokens to a user when it's already known beforehand that the user owns the token via a trusted source, skipping the potentially expensive operation of fetching a token by its owner.
func (*Provider) GetTokenMetadataByTokenIdentifiers ¶
func (*Provider) GetTokenMetadataByTokenIdentifiersBatch ¶
func (p *Provider) GetTokenMetadataByTokenIdentifiersBatch(ctx context.Context, chain persist.Chain, tIDs []common.ChainAgnosticIdentifiers) ([]persist.TokenMetadata, error)
func (*Provider) GetTokensOfContractForWallet ¶
func (p *Provider) GetTokensOfContractForWallet(ctx context.Context, contractAddress persist.ChainAddress, wallet persist.L1ChainAddress) ([]op.TokenFullDetails, error)
func (*Provider) RefreshContract ¶
RefreshContract refreshes a contract on the given chain using the chain provider for that chain
func (*Provider) RefreshToken ¶
RefreshToken refreshes a token on the given chain using the chain provider for that chain
func (*Provider) RefreshTokenDescriptorsByTokenIdentifiers ¶
func (p *Provider) RefreshTokenDescriptorsByTokenIdentifiers(ctx context.Context, ti persist.TokenIdentifiers) (db.TokenDefinition, error)
RefreshTokenDescriptorsByTokenIdentifiers will refresh the token descriptors for a token by its identifiers.
func (*Provider) SyncCreatedTokensForExistingContract ¶
func (*Provider) SyncCreatedTokensForNewContracts ¶
func (p *Provider) SyncCreatedTokensForNewContracts(ctx context.Context, userID persist.DBID, chains []persist.Chain) error
SyncCreatedTokensForNewContracts syncs tokens for contracts that the user created but does not currently have any tokens for.
func (*Provider) SyncTokenByUserWalletsAndTokenIdentifiersRetry ¶
func (p *Provider) SyncTokenByUserWalletsAndTokenIdentifiersRetry(ctx context.Context, userID persist.DBID, t persist.TokenIdentifiers, r retry.Retry) (token op.TokenFullDetails, err error)
SyncTokenByUserWalletsAndTokenIdentifiersRetry attempts to sync a token for a user by their wallets and token identifiers.
func (*Provider) SyncTokensByUserID ¶
func (p *Provider) SyncTokensByUserID(ctx context.Context, userID persist.DBID, chains []persist.Chain) error
SyncTokensByUserID updates the media for all tokens for a user
func (*Provider) SyncTokensByUserIDAndTokenIdentifiers ¶
func (p *Provider) SyncTokensByUserIDAndTokenIdentifiers(ctx context.Context, userID persist.DBID, tokenIdentifiers []persist.TokenUniqueIdentifiers) ([]op.TokenFullDetails, error)
SyncTokensByUserIDAndTokenIdentifiers updates the media for specific tokens for a user
func (*Provider) TokenExists ¶
func (p *Provider) TokenExists(ctx context.Context, token persist.TokenIdentifiers, r retry.Retry) (td db.TokenDefinition, err error)
TokenExists checks if a token exists according to any provider by its identifiers. It returns nil if the token exists. If a token exists, it will also update its contract and its descriptors in the database.
func (*Provider) VerifySignature ¶
func (p *Provider) VerifySignature(ctx context.Context, pSig string, pMessage string, pChainAddress persist.ChainPubKey, pWalletType persist.WalletType) (bool, error)
VerifySignature verifies a signature for a wallet address
type ProviderLookup ¶
type TezosProvider ¶
type TezosProvider struct { common.ContractFetcher common.ContractsCreatorFetcher common.TokenDescriptorsFetcher common.TokenIdentifierOwnerFetcher common.TokenMetadataBatcher common.TokenMetadataFetcher common.TokensByContractWalletFetcher common.TokensByTokenIdentifiersFetcher common.TokensIncrementalContractFetcher common.TokensIncrementalOwnerFetcher common.Verifier }
type ZoraProvider ¶
type ZoraProvider struct { common.ContractFetcher common.ContractsCreatorFetcher common.TokenDescriptorsFetcher common.TokenIdentifierOwnerFetcher common.TokenMetadataBatcher common.TokenMetadataFetcher common.TokensByContractWalletFetcher common.TokensByTokenIdentifiersFetcher common.TokensIncrementalContractFetcher common.TokensIncrementalOwnerFetcher }