core

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubjectDaoCreated = "core.dao.created"
	SubjectDaoUpdated = "core.dao.updated"

	SubjectCheckActivitySince     = "core.dao.check.activity_since"
	SubjectPopularityIndexUpdated = "core.dao.popularity_index.updated"
)
View Source
const (
	SubjectEnsResolverRequest  = "core.ens.request"
	SubjectEnsResolverResolved = "core.ens.resolved"
)
View Source
const (
	SubjectProposalCreated      = "core.proposal.created"
	SubjectProposalUpdated      = "core.proposal.updated"
	SubjectProposalUpdatedState = "core.proposal.updated.state"

	SubjectProposalVotingStarted       = "core.proposal.voting.started"
	SubjectProposalVotingEnded         = "core.proposal.voting.ended"
	SubjectProposalVotingQuorumReached = "core.proposal.voting.quorum_reached"
	SubjectProposalVotingStartsSoon    = "core.proposal.voting.starts_soon"
	SubjectProposalVotingEndsSoon      = "core.proposal.voting.ends_soon"
)
View Source
const (
	SubjectCallback = "core.callback"
)
View Source
const (
	SubjectDelegateCreateProposal = "core.delegates.create_proposal"
)
View Source
const (
	SubjectTimelineUpdate = "core.timeline.updated"
)
View Source
const (
	SubjectVoteCreated = "core.vote.created"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackHandler

type CallbackHandler = events.Handler[CallbackPayload]

type CallbackPayload

type CallbackPayload struct {
	WebhookURL string          `json:"webhook_url"`
	Body       json.RawMessage `json:"body"`
}

type DaoHandler

type DaoHandler = events.Handler[DaoPayload]

type DaoPayload

type DaoPayload struct {
	ID              uuid.UUID         `json:"id"`
	Alias           string            `json:"alias"`
	Name            string            `json:"name"`
	Private         bool              `json:"private"`
	About           string            `json:"about"`
	Avatar          string            `json:"avatar"`
	Terms           string            `json:"terms"`
	Location        string            `json:"location"`
	Website         string            `json:"website"`
	Twitter         string            `json:"twitter"`
	Github          string            `json:"github"`
	Coingecko       string            `json:"coingecko"`
	Email           string            `json:"email"`
	Network         string            `json:"network"`
	Symbol          string            `json:"symbol"`
	Skin            string            `json:"skin"`
	Domain          string            `json:"domain"`
	Strategies      []StrategyPayload `json:"strategies"`
	Admins          []string          `json:"admins"`
	Members         []string          `json:"members"`
	Moderators      []string          `json:"moderators"`
	Voting          VotingPayload     `json:"voting"`
	Categories      []string          `json:"categories"`
	Treasures       []TreasuryPayload `json:"treasures"`
	FollowersCount  int               `json:"followers_count"`
	ProposalsCount  int               `json:"proposals_count"`
	Guidelines      string            `json:"guidelines"`
	Template        string            `json:"template"`
	ParentID        *uuid.UUID        `json:"parent_id,omitempty"`
	ActiveSince     *int              `json:"active_since,omitempty"`
	PopularityIndex *float64          `json:"popularity_index,omitempty"`
}

type DelegatePayload added in v0.3.0

type DelegatePayload struct {
	// Initiator is delegate address who initiate the event
	Initiator string `json:"initiator"`
	// Delegator is delegator address (delegator delegate voting power to the initiator)
	Delegator string `json:"delegator"`
	// DaoID is internal dao identifier
	DaoID uuid.UUID `json:"dao_id"`
	// ProposalID is internal proposal identifier
	ProposalID string `json:"proposal_id"`
}

type DelegatesHandler added in v0.3.4

type DelegatesHandler = events.Handler[DelegatePayload]

type EnsNamePayload

type EnsNamePayload struct {
	Address string `json:"address"`
	Name    string `json:"name"`
}

type EnsNamesHandler

type EnsNamesHandler = events.Handler[EnsNamesPayload]

type EnsNamesPayload

type EnsNamesPayload []EnsNamePayload

type ProposalHandler

type ProposalHandler = events.Handler[ProposalPayload]

type ProposalPayload

type ProposalPayload struct {
	ID            string            `json:"id"`
	Ipfs          string            `json:"ipfs"`
	Author        string            `json:"author"`
	Created       int               `json:"created"`
	DaoID         uuid.UUID         `json:"dao_id"`
	Network       string            `json:"network"`
	Symbol        string            `json:"symbol"`
	Type          string            `json:"type"`
	Strategies    []StrategyPayload `json:"strategies"`
	Title         string            `json:"title"`
	Body          string            `json:"body"`
	Discussion    string            `json:"discussion"`
	Choices       []string          `json:"choices"`
	Start         int               `json:"start"`
	End           int               `json:"end"`
	Quorum        float64           `json:"quorum"`
	Privacy       string            `json:"privacy"`
	Snapshot      string            `json:"snapshot"`
	State         string            `json:"state"`
	Link          string            `json:"link"`
	App           string            `json:"app"`
	Scores        []float32         `json:"scores"`
	ScoresState   string            `json:"scores_state"`
	ScoresTotal   float32           `json:"scores_total"`
	ScoresUpdated int               `json:"scores_updated"`
	Votes         int               `json:"votes"`
	EnsName       string            `json:"ens_name"`
	Spam          bool              `json:"spam"`
}

type StrategyPayload

type StrategyPayload struct {
	Name    string                 `json:"name"`
	Network string                 `json:"network"`
	Params  map[string]interface{} `json:"params"`
}

type TimelineAction

type TimelineAction string

type TimelineHandler

type TimelineHandler = events.Handler[TimelinePayload]

type TimelineItem

type TimelineItem struct {
	CreatedAt time.Time      `json:"created_at"`
	Action    TimelineAction `json:"action"`
}

type TimelinePayload

type TimelinePayload struct {
	DaoID        uuid.UUID      `json:"dao_id"`
	ProposalID   string         `json:"proposal_id,omitempty"`
	DiscussionID string         `json:"discussion_id,omitempty"`
	Timeline     []TimelineItem `json:"timeline"`
}

type TreasuryPayload

type TreasuryPayload struct {
	Name    string `json:"name"`
	Address string `json:"address"`
	Network string `json:"network"`
}

type VotePayload

type VotePayload struct {
	ID           string          `json:"id"`
	Ipfs         string          `json:"ipfs"`
	Voter        string          `json:"voter"`
	Created      int             `json:"created"`
	DaoID        uuid.UUID       `json:"dao_id"`
	ProposalID   string          `json:"proposal_id"`
	Choice       json.RawMessage `json:"choice"`
	Reason       string          `json:"reason"`
	App          string          `json:"app"`
	Vp           float64         `json:"vp"`
	VpByStrategy []float64       `json:"vp_by_strategy"`
	VpState      string          `json:"vp_state"`
}

type VotesHandler

type VotesHandler = events.Handler[VotesPayload]

type VotesPayload

type VotesPayload []VotePayload

type VotingPayload

type VotingPayload struct {
	Delay       int     `json:"delay"`
	Period      int     `json:"period"`
	Type        string  `json:"type"`
	Quorum      float32 `json:"quorum"`
	Blind       bool    `json:"blind"`
	HideAbstain bool    `json:"hide_abstain"`
	Privacy     string  `json:"privacy"`
	Aliased     bool    `json:"aliased"`
}

Jump to

Keyboard shortcuts

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