types

package
v0.0.0-...-d98556b Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONMarshal

func JSONMarshal(v interface{}) (driver.Value, error)

func JSONUnmarshal

func JSONUnmarshal(value interface{}, v interface{}) error

Types

type Activity

type Activity struct {
	// Transaction hash of the activity.
	TxHash string `json:"txHash"`
	// Address of the recipient involved in the activity.
	Recipient string `json:"recipient"`
	// Pool address associated with the activity.
	PoolAddress string `json:"poolAddress"`
	// Amount of the asset being transferred from.
	FromAmount int `json:"fromAmount"`
	// Symbol of the asset being transferred from.
	FromSymbol string `json:"fromSymbol"`
	// Amount of the asset being transferred to.
	ToAmount int `json:"toAmount"`
	// Symbol of the asset being transferred to.
	ToSymbol string `json:"toSymbol"`
	// Type of the activity (buy, sell).
	Type ActivityType `json:"type"`
	// ID of the outcome associated with the activity.
	OutcomeID string `json:"outcomeId"`
	// ID of the campaign associated with the activity.
	CampaignID string `json:"campaignId"`
	// Total volume of the activity.
	TotalVolume int `json:"totalVolume"`
	// Timestamp of when the activity was created.
	CreatedAt time.Time `json:"createdAt"`
	// Content of the campaign associated with the activity.
	CampaignContent CampaignContent `json:"campaignContent"`
}

type ActivityType

type ActivityType string
const (
	ActivityTypeBuy  ActivityType = "buy"
	ActivityTypeSell ActivityType = "sell"
)

type Asset

type Asset struct {
	TotalSpent int    `json:"totalSpent"`
	Name       string `json:"name"`
}

type AssetMetadata

type AssetMetadata struct {
	Name                  string    `json:"name"`
	Price                 string    `json:"price"`
	PriceCreatedAt        time.Time `json:"priceCreatedAt"`
	HourAgoPrice          string    `json:"hourAgoPrice"`
	HourAgoPriceCreatedAt time.Time `json:"hourAgoPriceCreatedAt"`
}

type Campaign

type Campaign struct {
	ID                string                `gorm:"primaryKey"`
	CreatedAt         time.Time             `gorm:"autoCreateTime"`
	UpdatedAt         time.Time             `gorm:"autoUpdateTime"`
	Content           CampaignContent       `json:"content"`
	TotalVolume       int                   `json:"totalVolume"`
	InvestmentAmounts InvestmentAmountsList `json:"investmentAmounts" gorm:"type:jsonb"`
	LiquidityVested   int                   `json:"liquidityVested"`
	Shares            CampaignShares        `json:"shares" gorm:"type:jsonb"`
	Odds              Odds                  `json:"odds" gorm:"type:jsonb"`
}

type CampaignContent

type CampaignContent struct {
	// Name of the campaign.
	Name string `json:"name"`

	// Description of the campaign in simple text.
	Description string `json:"description"`

	// Picture of the campaign as base64 string.
	Picture *string `json:"picture"`

	// Categories associated with this campaign.
	Categories []string `json:"categories"`

	// Number to salt the identifier (id of the campaigns) of the outcome
	Seed int `json:"seed"`

	// Creator of the campaign.
	Creator *Wallet `json:"creator"`

	// Defines the method used to determine the winner of a campaign.
	Settlement string `json:"settlement"`

	// Oracle description defines under which conditions campaigns conclude if infra market used as settlement source
	OracleDescription *string `json:"oracleDescription"`

	// Oracle URLs are helper sources for documents when the infrastructure market is used as a settlement source.
	OracleUrls []*string `json:"oracleUrls"`

	// Pool address to purchase shares, and to receive the cost function.
	PoolAddress string `json:"poolAddress"`

	// Outcomes associated with this campaign.
	Outcomes OutcomeList `json:"outcomes"`

	// Ending date of the campaign. Unix timestamp in miliseconds.
	Ending int `json:"ending"`

	// Starting date of the campaign. Unix timestamp in miliseconds.
	Starting int `json:"starting"`

	// X/Twitter username.
	X *string `json:"x"`

	// Telegram username.
	Telegram *string `json:"telegram"`

	// Web url
	Web *string `json:"web"`

	// If any outcome declared as winner, it returns bytes8 id
	Winner *string `json:"winner"`

	// IsDpm for markets it is true, for amms false
	IsDpm *bool `json:"isDpm"`

	// IsDppm market?
	IsDppm *bool `json:"isDppm"`

	// PriceMetadata that's used for displaying to the frontend in a structured way.
	PriceMetadata *PriceMetadata `json:"priceMetadata"`
}

func (*CampaignContent) Scan

func (content *CampaignContent) Scan(value interface{}) error

func (CampaignContent) Value

func (content CampaignContent) Value() (driver.Value, error)

type CampaignInsertion

type CampaignInsertion struct {
	ID        string          `gorm:"primaryKey"`
	CreatedAt time.Time       `gorm:"autoCreateTime"`
	UpdatedAt time.Time       `gorm:"autoUpdateTime"`
	Content   CampaignContent `json:"content"`
}

type CampaignShare

type CampaignShare struct {
	Shares     string `json:"shares"`
	Identifier string `json:"identifier"`
}

func (*CampaignShare) Scan

func (cs *CampaignShare) Scan(value interface{}) error

func (CampaignShare) Value

func (cs CampaignShare) Value() (driver.Value, error)

type CampaignShares

type CampaignShares []*CampaignShare

func (*CampaignShares) Scan

func (css *CampaignShares) Scan(value interface{}) error

func (CampaignShares) Value

func (css CampaignShares) Value() (driver.Value, error)

type Claim

type Claim struct {
	ID string `json:"id"`

	SharesSpent string `json:"sharesSpent"`

	FusdcReceived string `json:"fusdcReceived"`

	Content CampaignContent `json:"content"`

	Winner string `json:"winner"`

	CreatedAt time.Time `json:"createdAt"`

	TransactionHash string `json:"txHash"`

	Pnl string `json:"pnl"`
}

type Comment

type Comment struct {
	Id            int                `gorm:"primaryKey"`
	CampaignId    string             `json:"campaignId"`
	CreatedAt     time.Time          `gorm:"autoCreateTime"`
	Content       string             `json:"content"`
	WalletAddress string             `json:"walletAddress"`
	Investments   CommentInvestments `json:"investments"`
}

type CommentInput

type CommentInput struct {
	Id            int       `gorm:"primaryKey"`
	CampaignId    string    `json:"campaignId"`
	CreatedAt     time.Time `gorm:"autoCreateTime"`
	Content       string    `json:"content"`
	WalletAddress string    `json:"walletAddress"`
}

type CommentInvestment

type CommentInvestment struct {
	Id     string `json:"id"`
	Amount int    `json:"amount"`
}

type CommentInvestments

type CommentInvestments []*CommentInvestment

func (*CommentInvestments) Scan

func (ccs *CommentInvestments) Scan(value interface{}) error

func (CommentInvestments) Value

func (ccs CommentInvestments) Value() (driver.Value, error)

type Frontpage

type Frontpage struct {
	Campaigns []Campaign `json:"campaigns"`
}

type InvestmentAmounts

type InvestmentAmounts struct {
	Id    string `json:"id"`
	USDC  int    `json:"usdc"`
	Share int    `json:"share"`
}

func (*InvestmentAmounts) Scan

func (ai *InvestmentAmounts) Scan(value interface{}) error

func (InvestmentAmounts) Value

func (ai InvestmentAmounts) Value() (driver.Value, error)

type InvestmentAmountsList

type InvestmentAmountsList []*InvestmentAmounts

func (*InvestmentAmountsList) Scan

func (ai *InvestmentAmountsList) Scan(value interface{}) error

func (InvestmentAmountsList) Value

func (ai InvestmentAmountsList) Value() (driver.Value, error)

type LP

type LP struct {
	Liquidity string `json:"liquidity"`
	Campaign
}

type Odds

type Odds map[string]string

func (Odds) MarshalGQL

func (o Odds) MarshalGQL(w io.Writer)

func (*Odds) Scan

func (o *Odds) Scan(value interface{}) error

func (*Odds) UnmarshalGQL

func (o *Odds) UnmarshalGQL(v interface{}) error

func (Odds) Value

func (o Odds) Value() (driver.Value, error)

type Outcome

type Outcome struct {
	// Name of this campaign.
	Name string `json:"name"`

	// Picture of the outcome as base64 string.
	Picture *string `json:"picture"`

	// Number to salt the identifier of the outcome
	Seed int `json:"seed"`

	// Identifier hex encoded associated with this outcome. Used to derive addresses.
	// Is of the form keccak256(name . description . seed)[:8]
	Identifier string `json:"identifier"`

	// Share address to trade this outcome.
	Share *Share `json:"share"`
}

func (*Outcome) Scan

func (o *Outcome) Scan(value interface{}) error

func (Outcome) Value

func (o Outcome) Value() (driver.Value, error)

type OutcomeIds

type OutcomeIds []string

func (*OutcomeIds) Scan

func (ois *OutcomeIds) Scan(value interface{}) error

func (OutcomeIds) Value

func (ois OutcomeIds) Value() (driver.Value, error)

type OutcomeList

type OutcomeList []Outcome

func (*OutcomeList) Scan

func (ol *OutcomeList) Scan(value interface{}) error

func (OutcomeList) Value

func (ol OutcomeList) Value() (driver.Value, error)

type Pnl

type Pnl struct {
	TotalPnl string `json:"totalPnl"`
	Volume   string `json:"volume"`
}

type Position

type Position struct {
	CampaignId string `json:"campaignId"`

	Content CampaignContent `json:"content"`
}

type PriceEvent

type PriceEvent struct {
	CreatedAt time.Time      `json:"createdAt"`
	Shares    CampaignShares `json:"shares"`
}

type PriceMetadata

type PriceMetadata struct {
	BaseAsset        string `json:"baseAsset"`
	QuoteAsset       string `json:"quoteAsset"`
	PriceTargetForUp string `json:"priceTargetForUp"`
}

type Profile

type Profile struct {
	WalletAddress string `json:"walletAddress"`

	Email string `json:"email"`

	Settings Settings `json:"settings" gorm:"serializer:json"`
}

type Settings

type Settings struct {
	Notification bool `json:"notification"`

	// Referrer is sent to the user with the address of the referrer.
	Referrer string `json:"referrer"`
}

type Share

type Share struct {
	// ERC20 address of this campaign.
	Address string `json:"address"`
}

Share representing the outcome of the current amount.

func (*Share) Scan

func (w *Share) Scan(value interface{}) error

func (Share) Value

func (w Share) Value() (driver.Value, error)

type TrackedTradingContract

type TrackedTradingContract struct {
	BlockHash       string `json:"block_hash"`
	TransactionHash string `json:"transaction_hash"`
	TradingAddr     string `json:"trading_addr"`
}

TrackedTradingContract that was created by the NewTrading event.

type UnclaimedCampaign

type UnclaimedCampaign struct {
	TotalSpent int `json:"totalSpent"`
	Campaign
}

type Wallet

type Wallet struct {
	// Wallet address of this wallet, in hex.
	Address string `json:"address"`
}

Wallet of the creator of a campaign.

func (*Wallet) Scan

func (w *Wallet) Scan(value interface{}) error

func (Wallet) Value

func (w Wallet) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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