infrastructure

package
v0.0.0-...-76fd6e2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionReader

type CollectionReader interface {
	FindCollection(
		ctx context.Context,
		query entities.Collection,
		offset int,
		limit int,
	) (ec []entities.Collection, err error)
	GetCollectionLastSyncBlock(
		ctx context.Context,
		token common.Address,
	) (uint64, error)
}

type CollectionWriter

type CollectionWriter interface {
	CreateCollection(
		ctx context.Context,
		collection entities.Collection,
	) (ec entities.Collection, err error)
	UpdateCollectionLastSyncBlock(
		ctx context.Context,
		token common.Address,
		block uint64,
	) error
}

type EventReader

type EventReader interface {
	FindEvent(
		ctx context.Context,
		query entities.EventRead,
	) (events []entities.Event, err error)

	GetOffer(
		ctx context.Context,
		owner common.Address,
		from common.Address,
	) (offers []entities.Event, err error)
}

type EventWriter

type EventWriter interface {
	InsertEvent(
		ctx context.Context,
		event entities.Event,
	) (ee entities.Event, err error)
}

type FindOrderConsideration

type FindOrderConsideration struct {
	Token      common.Address
	Identifier *big.Int
}

type FindOrderOffer

type FindOrderOffer struct {
	Token      common.Address
	Identifier *big.Int
}

type MarketplaceReader

type MarketplaceReader interface {
	GetMarketplaceLastSyncBlock(
		ctx context.Context,
	) (uint64, error)

	GetMarketplaceSettings(
		ctx context.Context,
		marketplaceAddress common.Address,
	) (*entities.MarketplaceSettings, error)
}

type MarketplaceWriter

type MarketplaceWriter interface {
	UpdateMarketplaceLastSyncBlock(
		ctx context.Context,
		block uint64,
	) error

	UpdateMarketplaceSettings(
		ctx context.Context,
		marketplace common.Address,
		beneficiary common.Address,
		royalty float64,
	) (*entities.MarketplaceSettings, error)
}

type NftListing

type NftListing struct {
	OrderHash  common.Hash
	ItemType   entities.EnumItemType
	StartPrice *big.Int
	EndPrice   *big.Int
	StartTime  *big.Int
	EndTime    *big.Int
}

type NftReader

type NftReader interface {
	FindOneNft(
		ctx context.Context,
		token common.Address,
		identifier *big.Int,
	) (entities.Nft, error)
	FindNftsWithListings(
		ctx context.Context,
		token common.Address,
		identifier *big.Int,
		owner common.Address,
		isHidden *bool,
		offset int32,
		limit int32,
		listingLimit int32,
	) ([]NftWithListing, error)
}

type NftWithListing

type NftWithListing struct {
	entities.Nft
	Listings []NftListing
}

type NftWriter

type NftWriter interface {
	UpsertNftLatest(
		ctx context.Context,
		token common.Address,
		identifier *big.Int,
		owner common.Address,
		isBurned bool,
		blockNumber uint64,
		txIndex uint,
		token_uri string,
	) (entities.Nft, error)
	UpdateNft(
		ctx context.Context,
		token common.Address,
		identifier *big.Int,
		val UpdateNftNewValue,
	) (entities.Nft, error)
}

type NotificationReader

type NotificationReader interface {
	FindNotification(
		ctx context.Context,
		address common.Address,
		isViewed *bool,
	) (ns []entities.NotificationGet, err error)
}

type NotificationWriter

type NotificationWriter interface {
	InsertNotification(
		ctx context.Context,
		notification entities.NotificationPost,
	) error
	UpdateNotification(
		ctx context.Context,
		notification entities.NotificationUpdate,
	) error
}

type OrderReader

type OrderReader interface {
	FindOrder(
		ctx context.Context,
		offer FindOrderOffer,
		consideration FindOrderConsideration,
		orderHash common.Hash,
		offerer common.Address,
		IsFulfilled *bool,
		IsCancelled *bool,
		IsInvalid *bool,
	) ([]entities.Order, error)
	FindExpiredOrder(
		ctx context.Context,
	) ([]entities.ExpiredOrder, error)
}

type OrderWritter

type OrderWritter interface {
	InsertOneOrder(
		ctx context.Context,
		order entities.Order,
	) (entities.Order, error)
	UpdateOrderStatus(
		ctx context.Context,
		condition UpdateOrderCondition,
		value UpdateOrderValue,
	) error
	UpdateOrderStatusByOffer(
		ctx context.Context,
		condition UpdateOrderStatusByOfferCondition,
		value UpdateOrderValue,
	) error
}

type ProfileReader

type ProfileReader interface {
	FindOneProfile(
		ctx context.Context,
		address string,
	) (entities.Profile, error)
}

type ProfileWriter

type ProfileWriter interface {
	UpsertProfile(
		ctx context.Context,
		profile entities.Profile,
	) (entities.Profile, error)

	DeleteProfile(
		ctx context.Context,
		address common.Address,
	) error
}

type Searcher

type Searcher interface {
	FullTextSearch(
		ctx context.Context,
		token common.Address,
		owner common.Address,
		q string,
		isHidden *bool,
		offset int32,
		limit int32,
	) ([]*entities.NftRead, error)
}

type UpdateNftNewValue

type UpdateNftNewValue struct {
	Metadata map[string]any
	IsHidden *bool
	IsBurned *bool
}

type UpdateOrderCondition

type UpdateOrderCondition struct {
	OrderHash common.Hash
	Offerer   common.Address
}

type UpdateOrderStatusByOfferCondition

type UpdateOrderStatusByOfferCondition struct {
	Offerer    common.Address
	Token      common.Address
	Identifier *big.Int
}

type UpdateOrderValue

type UpdateOrderValue struct {
	IsValidated *bool
	IsCancelled *bool
	IsFulfilled *bool
	IsInvalid   *bool
}

type UserReader

type UserReader interface {
	FindOneUser(
		ctx context.Context,
		address string,
	) (*entities.User, error)

	FindUser(
		ctx context.Context,
		isBlock *bool,
		role string,
		offset int32,
		limit int32,
	) ([]*entities.User, error)

	FindRoles(
		ctx context.Context,
	) ([]*entities.Role, error)
}

type UserWriter

type UserWriter interface {
	InsertUser(
		ctx context.Context,
		user *entities.User,
	) (*entities.User, error)

	UpdateUserBlockState(
		ctx context.Context,
		address string,
		isBlock bool,
	) error

	InsertUserRole(
		ctx context.Context,
		address string,
		roleId int32,
	) (*entities.Role, error)

	DeleteUserRole(
		ctx context.Context,
		address string,
		roleId int32,
	) error

	TransferAdminRole(
		ctx context.Context,
		maker string,
		taker string,
	) (*entities.Role, error)

	UpdateUserNonce(
		ctx context.Context,
		address string,
		nonce string,
	) (*entities.User, error)
}

Jump to

Keyboard shortcuts

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