server

package
v0.0.0-...-44f1c0e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMetadata

type FileMetadata struct {
	MediaType string   `json:"mediaType"`
	Name      string   `json:"name"`
	Src       []string `json:"src"`
}

type HydraClient

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

func NewHydraClientFromEnv

func NewHydraClientFromEnv() (*HydraClient, error)

type Leaders

type Leaders struct {
	MostWins    []Nft `json:"mostWins"`
	MostLosses  []Nft `json:"mostLoses"`
	BestPercent []Nft `json:"bestPercent"`
}

type NFTMetadata

type NFTMetadata struct {
	Name         string            `json:"name"`
	Image        []string          `json:"image"`
	Collection   *string           `json:"Project,omitempty"`
	Traits       map[string]string `json:"traits,omitempty"`
	Artist       *string           `json:"artist,omitempty"`
	Site         *string           `json:"website,omitempty"`
	Twitter      *string           `json:"twitter,omitempty"`
	Copyright    *string           `json:"copyright,omitempty"`
	Type         *string           `json:"type,omitempty"`
	FileMetadata []FileMetadata    `json:"files,omitempty"`
}

type NFTReturn

type NFTReturn struct {
	ReturnToAddress string `json:"ReturnToAddress"`
	FromUtxo        string `json:"FromUtxo"`
	FromUtxoAmount  int    `json:"FromUtxoAmount"`
}

type Nft

type Nft struct {
	ID             int
	Name           string `json:"name"`
	Type           string `json:"type"`
	IPFS           string `json:"image"`
	ListedPriceAda *int16 `json:"listedPriceAda,omitempty"`
	UserOwns       bool   `json:"userOwns"`
	Wins           int    `json:"wins"`
	Loses          int    `json:"loses"`
}

Zombie store my zombie info

type Server

type Server struct {
	BuildTime                 string
	Sha1ver                   string
	NftkeymeOauthConfig       *oauth2.Config
	Store                     db.Store
	NftkeymeClient            nftkeyme.NftkeymeClient
	ZombiePolicyId            string
	HunterPolicyId            string
	ZombieMeta                map[string]string
	ZombieMetaStruct          map[string]metadata.ZombieChain
	ZombieChainTraitStrength  metadata.ZombieChainTraitStrength
	HunterMeta                map[string]string
	HunterMetaStruct          map[string]metadata.ZombieHunter
	ZombieHunterTraitStrength metadata.ZombieHunterTraitStrength
	BaseCostAda               int
	PaymentAddress            string
	BlockfrostClient          bfg.APIClient
	ImageBuilderClient        imagebuilder.ImageBuilderClient
	BlockforstIpfsClient      blockfrost.BlockfrostClient
	NftStorageClient          nftstorage.NftstorageClient
	ZfcPolicyID               string
	AlienPolicyID             string
	BrianSplitAddress         string
	RoyaltySplitAddress       string
	LeaderCache               *cache.Cache
	HydraClient               HydraClient
}

Server struct

func (Server) CheckCookie

func (s Server) CheckCookie(next echo.HandlerFunc) echo.HandlerFunc

CheckCookie checks incoming cookie to verify authed

func (Server) CreateFight

func (s Server) CreateFight(c echo.Context) (err error)

CreateFight create new fight

func (Server) DeleteListedNft

func (s Server) DeleteListedNft(c echo.Context) (err error)

ListNftForFight list or update nft for fight

func (Server) GetAssetsForUser

func (s Server) GetAssetsForUser(ctx context.Context, zfcUser db.User) ([]Nft, error)

func (Server) GetFightById

func (s Server) GetFightById(c echo.Context) (err error)

GetFightById gets fight by id

func (Server) GetLeaders

func (s Server) GetLeaders(c echo.Context) (err error)

GetLeaders get all leaders

func (Server) GetMyFights

func (s Server) GetMyFights(c echo.Context) (err error)

GetMyFights get all of my fight

func (Server) GetMyNfts

func (s Server) GetMyNfts(c echo.Context) (err error)

GetMyNfts get all nfts I own

func (Server) GetNftsToFight

func (s Server) GetNftsToFight(c echo.Context) (err error)

GetMyNfts get all nfts I own

func (Server) GetVersion

func (s Server) GetVersion(c echo.Context) (err error)

GetVersion return build version info

func (Server) ListNftForFight

func (s Server) ListNftForFight(c echo.Context) (err error)

ListNftForFight list or update nft for fight

func (Server) Login

func (s Server) Login(c echo.Context) (err error)

Login accept auth code from server, exchange for access/refresh token, create session using gorilla session

func (Server) LoginCheck

func (s Server) LoginCheck(c echo.Context) (err error)

func (Server) RenderError

func (s Server) RenderError(errorMsg string, c echo.Context) error

RenderError renders an error page

func (Server) ReturnStuff

func (s Server) ReturnStuff(returns []NFTReturn) error

func (Server) RunMintingEngine

func (s Server) RunMintingEngine()

func (Server) Start

func (s Server) Start()

Start the server

type SignedTx

type SignedTx struct {
	Hex string `json:"cborHex"`
}

type Version

type Version struct {
	Sha       string `json:"sha"`
	BuildTime string `json:"buildTime"`
}

Version struct

Jump to

Keyboard shortcuts

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