service

package
v0.0.0-...-2b78ec0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentData

type AgentData struct {
	Pending       bool               `json:"pending"`
	Address       string             `json:"address"`
	Creator       string             `json:"creator"`
	Token         string             `json:"token"`
	Name          string             `json:"name"`
	SystemPrompt  string             `json:"system_prompt"`
	PromptPrice   string             `json:"prompt_price"`
	Balance       string             `json:"balance"`
	EndTime       string             `json:"end_time"`
	Model         string             `json:"model"`
	IsDrained     bool               `json:"is_drained"`
	DrainAmount   string             `json:"drain_amount"`
	IsFinalized   bool               `json:"is_finalized"`
	IsWithdrawn   bool               `json:"is_withdrawn"`
	BreakAttempts string             `json:"break_attempts"`
	LatestPrompts []*AgentDataPrompt `json:"latest_prompts"`
	DrainPrompt   *AgentDataPrompt   `json:"drain_prompt"`
}

type AgentDataPrompt

type AgentDataPrompt struct {
	PromptID  string `json:"prompt_id"`
	TweetID   string `json:"tweet_id"`
	Prompt    string `json:"prompt"`
	User      string `json:"user"`
	IsSuccess bool   `json:"is_success"`
	DrainedTo string `json:"drained_to"`
}

type AgentPageResponse

type AgentPageResponse struct {
	Agents    []*AgentData `json:"agents"`
	Total     int          `json:"total"`
	Page      int          `json:"page"`
	PageSize  int          `json:"page_size"`
	LastBlock int          `json:"last_block"`
}

type GetUsageResponse

type GetUsageResponse struct {
	RegisteredAgents uint64                     `json:"registered_agents"`
	Attempts         *GetUsageResponseAttempts  `json:"attempts"`
	PrizePools       GetUsageResponsePrizePools `json:"prize_pools"`
}

type GetUsageResponseAttempts

type GetUsageResponseAttempts struct {
	Total     uint64 `json:"total"`
	Successes uint64 `json:"successes"`
}

type GetUsageResponsePrizePools

type GetUsageResponsePrizePools = map[string]string

type PromptData

type PromptData struct {
	Pending     bool   `json:"pending"`
	PromptID    string `json:"prompt_id"`
	AgentAddr   string `json:"agent_addr"`
	IsDrain     bool   `json:"is_drain"`
	Prompt      string `json:"prompt"`
	Response    string `json:"response,omitempty"`
	Error       string `json:"error,omitempty"`
	BlockNumber string `json:"block_number"`
	UserAddr    string `json:"user_addr"`
}

type PromptPageResponse

type PromptPageResponse struct {
	Prompts   []*PromptData `json:"prompts"`
	Total     int           `json:"total"`
	Page      int           `json:"page"`
	PageSize  int           `json:"page_size"`
	LastBlock int           `json:"last_block"`
}

type RegisterPromptResponseRequest

type RegisterPromptResponseRequest struct {
	PromptID    *uint64 `json:"prompt_id" binding:"required"`
	AgentAddr   *string `json:"agent_addr" binding:"required"`
	Price       *string `json:"price" binding:"required"`
	IsDrain     *bool   `json:"is_drain" binding:"required"`
	Prompt      *string `json:"prompt" binding:"required"`
	Response    *string `json:"response"`
	Error       *string `json:"error"`
	BlockNumber *uint64 `json:"block_number" binding:"required"`
	UserAddr    *string `json:"user_addr" binding:"required"`
}

RegisterPromptResponseRequest represents the request body for registering a prompt response

type UIService

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

func NewUIService

func NewUIService(config *UIServiceConfig) (*UIService, error)

func (*UIService) HandleGetAgent

func (s *UIService) HandleGetAgent(c *gin.Context)

func (*UIService) HandleGetLeaderboard

func (s *UIService) HandleGetLeaderboard(c *gin.Context)

func (*UIService) HandleGetPromptResponse

func (s *UIService) HandleGetPromptResponse(c *gin.Context)

func (*UIService) HandleGetUsage

func (s *UIService) HandleGetUsage(c *gin.Context)

func (*UIService) HandleGetUserAgents

func (s *UIService) HandleGetUserAgents(c *gin.Context)

func (*UIService) HandleGetUserLeaderboard

func (s *UIService) HandleGetUserLeaderboard(c *gin.Context)

func (*UIService) HandleGetUserPrompts

func (s *UIService) HandleGetUserPrompts(c *gin.Context)

func (*UIService) HandleRegisterPromptResponse

func (s *UIService) HandleRegisterPromptResponse(c *gin.Context)

func (*UIService) HandleSearchAgents

func (s *UIService) HandleSearchAgents(c *gin.Context)

func (*UIService) Run

func (s *UIService) Run(ctx context.Context) error

type UIServiceConfig

type UIServiceConfig struct {
	Client               starknet.ProviderWrapper
	MaxPageSize          int
	ServerAddr           string
	RegistryAddress      *felt.Felt
	StartingBlock        uint64
	TokenRates           map[[32]byte]*big.Int
	PriceTickRate        time.Duration
	EventTickRate        time.Duration
	EventStartupTickRate time.Duration
	UserTickRate         time.Duration
	AgentBalanceTickRate time.Duration
	PromptIndexerDBPath  string
	PromptIndexerApiKey  string
}

type UserData

type UserData struct {
	Address         string            `json:"address"`
	AccruedBalances map[string]string `json:"accrued_balances"`
	PromptCount     int               `json:"prompt_count"`
	BreakCount      int               `json:"break_count"`
}

type UserPageResponse

type UserPageResponse struct {
	Users     []*UserData `json:"users"`
	Total     int         `json:"total"`
	Page      int         `json:"page"`
	PageSize  int         `json:"page_size"`
	LastBlock int         `json:"last_block"`
}

Jump to

Keyboard shortcuts

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