controllers

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParseBigInt error = errors.New("parse error")

Functions

func HexToBigInt

func HexToBigInt(s string) (*big.Int, bool)

Types

type AuthenticateReq

type AuthenticateReq struct {
	Address   string `json:"address" validate:"eth_addr"`
	Message   string `json:"message"`
	Signature string `json:"signature"`
}

type AuthenticateRes

type AuthenticateRes struct {
	IsAuthenticated bool   `json:"is_authenticated"`
	Address         string `json:"address"`
	Nonce           string `json:"nonce"`
	AuthToken       string `json:"auth_token"`
}

type AuthenticationController

type AuthenticationController interface {
	GetUserNonce(c echo.Context) error
	Login(c echo.Context) error
	Test(c echo.Context) error
}

type AuthorizationController

type AuthorizationController interface {
}

type Controller

type Controller interface {
	PostOrder(c echo.Context) error
	GetOrder(c echo.Context) error

	PostCollection(c echo.Context) error
	GetCollection(c echo.Context) error
	GetCollectionWithCategory(c echo.Context) error

	UpdateNftStatus(c echo.Context) error
	GetNFTsWithListings(c echo.Context) error

	ProfileController
	SearchController
	MarketplaceSettingsController
	AuthenticationController
	AuthorizationController
	UserController
	RoleController

	GetEvent(c echo.Context) error

	GetNotification(c echo.Context) error
	UpdateNotification(c echo.Context) error
}

type Controls

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

func New

func New(service services.Servicer) *Controls

func (*Controls) CreateRole

func (ctl *Controls) CreateRole(c echo.Context) error

func (*Controls) CreateUserRole

func (ctl *Controls) CreateUserRole(c echo.Context) error

func (*Controls) DeleteUserRole

func (ctl *Controls) DeleteUserRole(c echo.Context) error

func (*Controls) GetCollection

func (ctl *Controls) GetCollection(c echo.Context) error

func (*Controls) GetCollectionWithCategory

func (ctl *Controls) GetCollectionWithCategory(c echo.Context) error

func (*Controls) GetEvent

func (ctl *Controls) GetEvent(c echo.Context) error

func (*Controls) GetMarketplaceSettings

func (ctl *Controls) GetMarketplaceSettings(c echo.Context) error

func (*Controls) GetNFTsWithListings

func (ctl *Controls) GetNFTsWithListings(c echo.Context) error

func (*Controls) GetNotification

func (ctl *Controls) GetNotification(c echo.Context) error

func (*Controls) GetOffer

func (ctl *Controls) GetOffer(c echo.Context) error

func (*Controls) GetOrder

func (ctl *Controls) GetOrder(c echo.Context) error

func (*Controls) GetProfile

func (ctl *Controls) GetProfile(c echo.Context) error

func (*Controls) GetRoles

func (ctl *Controls) GetRoles(c echo.Context) error

func (*Controls) GetRolesByUser

func (ctl *Controls) GetRolesByUser(c echo.Context) error

func (*Controls) GetUser

func (ctl *Controls) GetUser(c echo.Context) error

func (*Controls) GetUserNonce

func (ctl *Controls) GetUserNonce(c echo.Context) error

func (*Controls) GetUsers

func (ctl *Controls) GetUsers(c echo.Context) error

func (*Controls) Login

func (ctl *Controls) Login(c echo.Context) error

func (*Controls) PostCollection

func (ctl *Controls) PostCollection(c echo.Context) error

func (*Controls) PostOrder

func (ctl *Controls) PostOrder(c echo.Context) error

func (*Controls) PostProfile

func (ctl *Controls) PostProfile(c echo.Context) error

func (*Controls) SearchNFTs

func (ctl *Controls) SearchNFTs(c echo.Context) error

func (*Controls) SetUserRole

func (ctl *Controls) SetUserRole(c echo.Context) error

func (*Controls) Test

func (ctl *Controls) Test(c echo.Context) error

func (*Controls) UpdateBlockState

func (ctl *Controls) UpdateBlockState(c echo.Context) error

func (*Controls) UpdateMarketplaceSettings

func (ctl *Controls) UpdateMarketplaceSettings(c echo.Context) error

func (*Controls) UpdateNftStatus

func (ctl *Controls) UpdateNftStatus(c echo.Context) error

func (*Controls) UpdateNotification

func (ctl *Controls) UpdateNotification(c echo.Context) error

type CreateUserRoleReq

type CreateUserRoleReq struct {
	Address string `json:"address" validate:"required,eth_addr"`
	RoleId  int32  `json:"role_id" validate:"required"`
}

type CreateUserRoleRes

type CreateUserRoleRes struct {
	IsSuccess bool   `json:"is_success"`
	Address   string `json:"address"`
	RoleId    int32  `json:"role_id"`
}

type DeleteUserRoleReq

type DeleteUserRoleReq struct {
	Address string `json:"address" validate:"required,eth_addr"`
	RoleId  int32  `json:"role_id" validate:"required"`
}

type DeleteUserRoleRes

type DeleteUserRoleRes struct {
	IsSuccess bool   `json:"is_success"`
	Address   string `json:"address"`
}

type GetMarketplaceSettingsReq

type GetMarketplaceSettingsReq struct {
	Marketplace string `query:"marketplace" validate:"eth_addr"`
}

type GetMarketplaceSettingsResp

type GetMarketplaceSettingsResp struct {
	Id          int64   `json:"id"`
	Marketplace string  `json:"marketplace"`
	Beneficiary string  `json:"beneficiary"`
	Royalty     float64 `json:"royalty"`
}

type GetOffer

type GetOffer struct {
	Owner string `query:"owner" validate:"omitempty,eth_addr"`
	From  string `query:"from" validate:"omitempty,eth_addr"`
}

type GetOfferRes

type GetOfferRes struct {
	OfferList []OfferRes `json:"offer_list"`
}

type GetProfileReq

type GetProfileReq struct {
	Address string `param:"address" validation:"eth_addr"`
}

type GetProfileResp

type GetProfileResp struct {
	Address   string         `json:"address,omitempty"`
	Username  string         `json:"username"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	Signature string         `json:"signature,omitempty"`
}

type GetUserNonceReq

type GetUserNonceReq struct {
	Address string `param:"address" validate:"required,eth_addr"`
}

type GetUserNonceRes

type GetUserNonceRes struct {
	Nonce   string `json:"nonce"`
	Address string `json:"address"`
}

type GetUserReq

type GetUserReq struct {
	Address string `param:"address" validate:"required,eth_addr"`
}

type GetUserRes

type GetUserRes struct {
	User *entities.User `json:"user"`
}

type GetUsersReq

type GetUsersReq struct {
	Offset  int32  `query:"offset" validate:"gte=0"`
	Limit   int32  `query:"limit" validate:"gte=0,lte=100"`
	IsBlock *bool  `query:"is_block"`
	Role    string `query:"role"`
}

type GetUsersRes

type GetUsersRes struct {
	Users  []*entities.User `json:"users"`
	Offset int32            `json:"offset"`
	Limit  int32            `json:"limit"`
}

type MarketplaceSettingsController

type MarketplaceSettingsController interface {
	GetMarketplaceSettings(c echo.Context) error
	UpdateMarketplaceSettings(c echo.Context) error
}

type OfferRes

type OfferRes struct {
	Name        string `json:"name"`
	Token       string `json:"token"`
	TokenId     string `json:"token_id"`
	Quantity    int    `json:"quantity,omitempty"`
	Type        string `json:"type"`
	Price       string `json:"price,omitempty"`
	From        string `json:"from"`
	To          string `json:"to,omitempty"`
	Link        string `json:"link,omitempty"`
	OrderHash   string `json:"order_hash,omitempty"`
	NftImage    string `json:"nft_image"`
	NftName     string `json:"nft_name"`
	EndTime     string `json:"end_time,omitempty"`
	IsCancelled bool   `json:"is_cancelled"`
	IsFulfilled bool   `json:"is_fulfilled"`
	IsExpired   bool   `json:"is_expired"`
	Owner       string `json:"owner,omitempty"`
}

type PostProfileReq

type PostProfileReq struct {
	Address   string         `json:"address" validation:"eth_addr"`
	Username  string         `json:"username"`
	Metadata  map[string]any `json:"metadata"`
	Signature string         `json:"signature" validation:"hexadecimal,startswith=0x"`
}

type PostProfileResp

type PostProfileResp struct {
	Address   string         `json:"address"`
	Username  string         `json:"username,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	Signature string         `json:"signature,omitempty"`
}

type ProfileController

type ProfileController interface {
	GetProfile(c echo.Context) error
	PostProfile(c echo.Context) error
	GetOffer(c echo.Context) error
}

type RoleController

type RoleController interface {
	GetRoles(c echo.Context) error
}

type SearchController

type SearchController interface {
	SearchNFTs(c echo.Context) error
}

type UpdateBlockStateReq

type UpdateBlockStateReq struct {
	Address string `json:"address" validate:"required,eth_addr"`
	IsBlock *bool  `json:"is_block" validate:"required"`
}

type UpdateBlockStateRes

type UpdateBlockStateRes struct {
	IsSuccess bool `json:"is_success"`
}

type UpdateMarketplaceSettingsReq

type UpdateMarketplaceSettingsReq struct {
	Marketplace string  `json:"marketplace" validate:"eth_addr"`
	Beneficiary string  `json:"beneficiary" validate:"eth_addr"`
	Royalty     float64 `json:"royalty" validate:"required,gte=0,lte=1"`
}

type UpdateMarketplaceSettingsRes

type UpdateMarketplaceSettingsRes struct {
	Id          int64   `json:"id"`
	Marketplace string  `json:"marketplace"`
	Beneficiary string  `json:"beneficiary"`
	Royalty     float64 `json:"royalty"`
}

type UserController

type UserController interface {
	GetUsers(c echo.Context) error
	GetUser(c echo.Context) error
	UpdateBlockState(c echo.Context) error
	CreateUserRole(c echo.Context) error
	DeleteUserRole(c echo.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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