structs

package
v0.0.0-...-5b1178b Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 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 AllowanceRes

type AllowanceRes struct {
	Allowance *lib.BigInt `json:"allowance" example:"100000000" swaggertype:"integer"`
}

type AmountReq

type AmountReq struct {
	Amount *lib.BigInt `json:"amount" binding:"required" validate:"number,gt=0" swaggertype:"integer"`
}

type BalanceRes

type BalanceRes struct {
	Balance *lib.BigInt `json:"balance" swaggertype:"string"`
}

type Bid

type Bid struct {
	Id             common.Hash
	Provider       common.Address
	ModelAgentId   common.Hash
	PricePerSecond *lib.BigInt `swaggertype:"integer"`
	Nonce          *lib.BigInt `swaggertype:"integer"`
	CreatedAt      *lib.BigInt `swaggertype:"integer"`
	DeletedAt      *lib.BigInt `swaggertype:"integer"`
}

type BidRes

type BidRes struct {
	Bid *Bid `json:"bid"`
}

type BidsRes

type BidsRes struct {
	Bids []*Bid `json:"bids"`
}

type BlockRes

type BlockRes struct {
	Block uint64 `json:"block" example:"1234"`
}

type BudgetRes

type BudgetRes struct {
	Budget *lib.BigInt `json:"budget" example:"100000000" swaggertype:"integer"`
}

type ContractInteraction

type ContractInteraction struct {
	ContractAddress common.Address `json:"contractAddress"`
	ContractName    string         `json:"contractName"`
	MethodName      string         `json:"methodName"`
	DecodedInput    []InputEntry   `json:"decodedInput"`
}

type CreateBidRequest

type CreateBidRequest struct {
	ModelID        string      `json:"modelID" binding:"required" validate:"hex32"`
	PricePerSecond *lib.BigInt `json:"pricePerSecond" binding:"required" validate:"number,gt=0" swaggertype:"integer"`
}

type CreateModelRequest

type CreateModelRequest struct {
	ID     string      `json:"id" binding:"omitempty" validate:"hex32" example:"0x1234"`
	IpfsID string      `json:"ipfsID" binding:"required" validate:"hex32" example:"0x1234"`
	Fee    *lib.BigInt `json:"fee" binding:"required" validate:"number" example:"123000000000" swaggertype:"integer"`
	Stake  *lib.BigInt `json:"stake" binding:"required" validate:"number" example:"123000000000" swaggertype:"integer"`
	Name   string      `json:"name" binding:"required" validate:"min=1,max=64" example:"Llama 2.0"`
	Tags   []string    `json:"tags" binding:"required" validate:"min=1,max=64,dive,min=1,max=64" example:"LLM"`
}

type CreateProviderRequest

type CreateProviderRequest struct {
	Stake    *lib.BigInt `json:"stake" binding:"required" validate:"number" example:"123000000000" swaggertype:"integer"`
	Endpoint string      `json:"endpoint" binding:"required" validate:"string" example:"mycoolmornode.domain.com:3989"`
}

type ErrRes

type ErrRes struct {
	Error string `json:"error" example:"error message"`
}

type InputEntry

type InputEntry struct {
	Key   string      `json:"key"`
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

type MappedTransaction

type MappedTransaction struct {
	Hash      common.Hash          `json:"hash"`
	From      common.Address       `json:"from"`
	To        common.Address       `json:"to"`
	Contract  *ContractInteraction `json:"contract"`
	Transfers []TokenTransfer      `json:"transfers"`
	Timestamp string               `json:"timestamp"`
}

type Model

type Model struct {
	Id        common.Hash
	IpfsCID   common.Hash
	Fee       *big.Int `swaggertype:"integer"`
	Stake     *big.Int `swaggertype:"integer"`
	Owner     common.Address
	Name      string
	Tags      []string
	CreatedAt *big.Int `swaggertype:"integer"`
	IsDeleted bool
	ModelType ModelType // Type of the model (LLM, STT, TTS, EMBEDDING)
}

type ModelRes

type ModelRes struct {
	Model *Model `json:"model"`
}

type ModelType

type ModelType string

ModelType is "LLM" or "STT" or "TTS" or "EMBEDDING" ModelType represents the type of model, such as LLM (Large Language Model), STT (Speech-to-Text), TTS (Text-to-Speech), or EMBEDDING. It is used to categorize models based on their functionality.

const (
	ModelTypeLLM       ModelType = "LLM"
	ModelTypeSTT       ModelType = "STT"
	ModelTypeTTS       ModelType = "TTS"
	ModelTypeEMBEDDING ModelType = "EMBEDDING"
	ModelTypeUnknown   ModelType = "UNKNOWN" // Default type for unknown models
)

type ModelsRes

type ModelsRes struct {
	Models []*Model `json:"models"`
}

type OpenSessionRequest

type OpenSessionRequest struct {
	Approval      lib.HexString `json:"approval" binding:"required" validate:"hexadecimal" format:"hex" example:"0x1234" swaggertype:"string"`
	ApprovalSig   lib.HexString `json:"approvalSig" binding:"required" validate:"hexadecimal" format:"hex" example:"0x1234" swaggertype:"string"`
	Stake         *lib.BigInt   `json:"stake" binding:"required" validate:"number,gt=0" example:"123000000000" swaggertype:"integer"`
	DirectPayment bool          `json:"directPayment" binding:"omitempty"`
}

type OpenSessionRes

type OpenSessionRes struct {
	SessionID common.Hash `json:"sessionID" example:"0x1234"`
}

type OpenSessionWithDurationRequest

type OpenSessionWithDurationRequest struct {
	SessionDuration *lib.BigInt `json:"sessionDuration" swaggertype:"integer"`
}

type OpenSessionWithFailover

type OpenSessionWithFailover struct {
	SessionDuration *lib.BigInt `json:"sessionDuration" swaggertype:"integer"`
	DirectPayment   bool        `json:"directPayment" binding:"omitempty"`
	Failover        bool        `json:"failover" binding:"omitempty"`
}

type PathEthAddrID

type PathEthAddrID struct {
	ID lib.Address `uri:"id" binding:"required" validate:"eth_addr"`
}

type PathHex32ID

type PathHex32ID struct {
	ID lib.Hash `uri:"id" binding:"required" validate:"hex32" format:"hex" example:"0x1234"`
}

type Provider

type Provider struct {
	Address   common.Address
	Endpoint  string
	Stake     *lib.BigInt `swaggertype:"integer"`
	CreatedAt *lib.BigInt `swaggertype:"integer"`
	IsDeleted bool
}

type ProviderRes

type ProviderRes struct {
	Provider *Provider `json:"provider"`
}

type ProvidersRes

type ProvidersRes struct {
	Providers []*Provider `json:"providers"`
}

type QueryApprove

type QueryApprove struct {
	*QuerySpender
	Amount *lib.BigInt `form:"amount" binding:"required" validate:"number,gt=0" swaggertype:"integer"`
}

type QueryOffsetLimitOrder

type QueryOffsetLimitOrder struct {
	Offset lib.BigInt `form:"offset,default=0" binding:"omitempty" validate:"number,gte=0" example:"0" swaggertype:"integer"`
	Limit  uint8      `form:"limit,default=10" binding:"omitempty" validate:"number,gte=1" example:"10"`
	Order  string     `form:"order,default=asc" binding:"omitempty" validate:"oneof=asc desc" example:"asc"`
}

type QueryOffsetLimitOrderNoDefault

type QueryOffsetLimitOrderNoDefault struct {
	Offset lib.BigInt `form:"offset,default=0" binding:"omitempty" validate:"number,gte=0" example:"0" swaggertype:"integer"`
	Limit  uint8      `form:"limit,default=0" binding:"omitempty" validate:"number,gte=1" example:"10"`
	Order  string     `form:"order,default=asc" binding:"omitempty" validate:"oneof=asc desc" example:"asc"`
}

type QueryPageLimit

type QueryPageLimit struct {
	Page  uint64 `form:"page,default=0"   binding:"omitempty" validate:"number"`
	Limit uint8  `form:"limit,default=10" binding:"omitempty" validate:"number"`
}

type QueryProvider

type QueryProvider struct {
	Provider lib.Address `form:"provider" binding:"required" validate:"eth_addr"`
}

type QuerySpender

type QuerySpender struct {
	Spender lib.Address `form:"spender" binding:"required" validate:"eth_addr"`
}

type QueryUser

type QueryUser struct {
	User lib.Address `form:"user" binding:"required" validate:"eth_addr"`
}

type RawEthTransactionResponse

type RawEthTransactionResponse struct {
	Status  string          `json:"status"`
	Message string          `json:"message"`
	Result  json.RawMessage `json:"result"`
}

type RawTransaction

type RawTransaction struct {
	BlockHash         string `json:"blockHash"`
	BlockNumber       string `json:"blockNumber"`
	Confirmations     string `json:"confirmations"`
	ContractAddress   string `json:"contractAddress"`
	CumulativeGasUsed string `json:"cumulativeGasUsed"`

	From             string `json:"from"`
	FunctionName     string `json:"functionName"`
	Gas              string `json:"gas"`
	GasPrice         string `json:"gasPrice"`
	GasPriceBid      string `json:"gasPriceBid"`
	GasUsed          string `json:"gasUsed"`
	Hash             string `json:"hash"`
	Input            string `json:"input"`
	IsError          string `json:"isError"`
	MethodId         string `json:"methodId"`
	Nonce            string `json:"nonce"`
	TimeStamp        string `json:"timeStamp"`
	To               string `json:"to"`
	TransactionIndex string `json:"transactionIndex"`
	TxReceiptStatus  string `json:"txreceipt_status"`
	Value            string `json:"value"`
}

type ScoredBid

type ScoredBid struct {
	ID    common.Hash
	Bid   Bid
	Score float64
}

type ScoredBidsRes

type ScoredBidsRes struct {
	Bids []ScoredBid `json:"bids"`
}

type SendRequest

type SendRequest struct {
	To     common.Address `json:"to" binding:"required" validate:"eth_addr"`
	Amount *lib.BigInt    `json:"amount" binding:"required" validate:"number,gt=0" swaggertype:"integer"`
}

type Session

type Session struct {
	Id                      string
	User                    common.Address
	Provider                common.Address
	ModelAgentId            string
	BidID                   string
	Stake                   *big.Int `swaggertype:"integer"`
	PricePerSecond          *big.Int `swaggertype:"integer"`
	CloseoutReceipt         string
	CloseoutType            *big.Int `swaggertype:"integer"`
	ProviderWithdrawnAmount *big.Int `swaggertype:"integer"`
	OpenedAt                *big.Int `swaggertype:"integer"`
	EndsAt                  *big.Int `swaggertype:"integer"`
	ClosedAt                *big.Int `swaggertype:"integer"`
}

type SessionRes

type SessionRes struct {
	Session *Session `json:"session"`
}

type SessionsRes

type SessionsRes struct {
	Sessions []*Session `json:"sessions"`
}

type SupplyRes

type SupplyRes struct {
	Supply *lib.BigInt `json:"supply" example:"100000000" swaggertype:"integer"`
}

type TokenBalanceRes

type TokenBalanceRes struct {
	MOR *lib.BigInt `json:"mor" example:"100000000" swaggertype:"integer"`
	ETH *lib.BigInt `json:"eth" example:"100000000" swaggertype:"integer"`
}

type TokenTransfer

type TokenTransfer struct {
	From          common.Address  `json:"from"`
	To            common.Address  `json:"to"`
	Value         string          `json:"value"`
	TokenAddress  *common.Address `json:"tokenAddress"` // nil for eth transfers
	TokenSymbol   string          `json:"tokenSymbol"`
	TokenName     string          `json:"tokenName"`
	TokenIcon     string          `json:"tokenIcon"`
	TokenDecimals int             `json:"tokenDecimals"`
}

type TransactionsRes

type TransactionsRes struct {
	Transactions []MappedTransaction `json:"transactions"`
}

type TxRes

type TxRes struct {
	Tx common.Hash `json:"tx" example:"0x1234"`
}

type TxType

type TxType string
const (
	Transfer TxType = "Transfer"
	Approve  TxType = "Approve"
)

Jump to

Keyboard shortcuts

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