resources

package
v1.9.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractionAccount added in v1.7.2

type AbstractionAccount struct {
	Key
	Attributes AbstractionAccountAttributes `json:"attributes"`
}

type AbstractionAccountAttributes added in v1.7.2

type AbstractionAccountAttributes struct {
	// Account abstraction address.
	Address string `json:"address"`
}

type AbstractionAccountListResponse added in v1.7.2

type AbstractionAccountListResponse struct {
	Data     []AbstractionAccount `json:"data"`
	Included Included             `json:"included"`
	Links    *Links               `json:"links"`
	Meta     json.RawMessage      `json:"meta,omitempty"`
}

func (*AbstractionAccountListResponse) GetMeta added in v1.7.2

func (r *AbstractionAccountListResponse) GetMeta(out interface{}) error

func (*AbstractionAccountListResponse) PutMeta added in v1.7.2

func (r *AbstractionAccountListResponse) PutMeta(v interface{}) (err error)

type AbstractionAccountResponse added in v1.7.2

type AbstractionAccountResponse struct {
	Data     AbstractionAccount `json:"data"`
	Included Included           `json:"included"`
}

type ActivateBalance added in v1.1.0

type ActivateBalance struct {
	Key
	Attributes ActivateBalanceAttributes `json:"attributes"`
}

type ActivateBalanceAttributes added in v1.1.0

type ActivateBalanceAttributes struct {
	// Referral code from the link
	ReferredBy string `json:"referred_by"`
}

type ActivateBalanceListRequest added in v1.1.0

type ActivateBalanceListRequest struct {
	Data     []ActivateBalance `json:"data"`
	Included Included          `json:"included"`
	Links    *Links            `json:"links"`
	Meta     json.RawMessage   `json:"meta,omitempty"`
}

func (*ActivateBalanceListRequest) GetMeta added in v1.1.0

func (r *ActivateBalanceListRequest) GetMeta(out interface{}) error

func (*ActivateBalanceListRequest) PutMeta added in v1.1.0

func (r *ActivateBalanceListRequest) PutMeta(v interface{}) (err error)

type ActivateBalanceRequest added in v1.1.0

type ActivateBalanceRequest struct {
	Data     ActivateBalance `json:"data"`
	Included Included        `json:"included"`
}

type Balance

type Balance struct {
	Key
	Attributes BalanceAttributes `json:"attributes"`
}

type BalanceAttributes

type BalanceAttributes struct {
	// Amount of points
	Amount int64 `json:"amount"`
	// Unix timestamp of balance creation
	CreatedAt int32 `json:"created_at"`
	// Whether the user was not referred with some code. If it wasn't - balance is disabled and very limited in functionality.
	IsDisabled *bool `json:"is_disabled,omitempty"`
	// Whether the user has scanned passport. Returned only for the single user.
	IsVerified *bool `json:"is_verified,omitempty"`
	// The level indicates user permissions and features
	Level int `json:"level"`
	// Rank of the user in the full leaderboard. Returned only for the single user.
	Rank *int `json:"rank,omitempty"`
	// Referral codes. Returned only for the single active balance.
	ReferralCodes *[]ReferralCode `json:"referral_codes,omitempty"`
	// Number of invited users. Returned only for the single active balance.
	ReferredUsersCount *int `json:"referred_users_count,omitempty"`
	// Number of users for whom the reward was received. Returned only for the single active balance.
	RewardedReferredUsersCount *int `json:"rewarded_referred_users_count,omitempty"`
	// Unix timestamp of the last points accruing
	UpdatedAt int32 `json:"updated_at"`
}

type BalanceListResponse

type BalanceListResponse struct {
	Data     []Balance       `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*BalanceListResponse) GetMeta

func (r *BalanceListResponse) GetMeta(out interface{}) error

func (*BalanceListResponse) PutMeta

func (r *BalanceListResponse) PutMeta(v interface{}) (err error)

type BalanceResponse

type BalanceResponse struct {
	Data     Balance  `json:"data"`
	Included Included `json:"included"`
}

type BonusCode added in v1.9.0

type BonusCode struct {
	Key
	Attributes BonusCodeAttributes `json:"attributes"`
}

type BonusCodeAttributes added in v1.9.0

type BonusCodeAttributes struct {
	// For creating personal bonus codes
	Nullifier *string `json:"nullifier,omitempty"`
	// Reward for this bonus code
	Reward *int `json:"reward,omitempty"`
	// Specify how many times bonus code can be scaned. Omit if bonus code must have infinity usage count
	UsageCount *int `json:"usage_count,omitempty"`
}

type BonusCodeListRequest added in v1.9.0

type BonusCodeListRequest struct {
	Data     []BonusCode     `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*BonusCodeListRequest) GetMeta added in v1.9.0

func (r *BonusCodeListRequest) GetMeta(out interface{}) error

func (*BonusCodeListRequest) PutMeta added in v1.9.0

func (r *BonusCodeListRequest) PutMeta(v interface{}) (err error)

type BonusCodeRequest added in v1.9.0

type BonusCodeRequest struct {
	Data     BonusCode `json:"data"`
	Included Included  `json:"included"`
}

type CreateAbstractionAccount added in v1.7.2

type CreateAbstractionAccount struct {
	Key
	Attributes CreateAbstractionAccountAttributes `json:"attributes"`
}

type CreateAbstractionAccountAttributes added in v1.7.2

type CreateAbstractionAccountAttributes struct {
	// Query ZK passport verification proof.
	Proof types.ZKProof `json:"proof"`
}

type CreateAbstractionAccountListRequest added in v1.7.2

type CreateAbstractionAccountListRequest struct {
	Data     []CreateAbstractionAccount `json:"data"`
	Included Included                   `json:"included"`
	Links    *Links                     `json:"links"`
	Meta     json.RawMessage            `json:"meta,omitempty"`
}

func (*CreateAbstractionAccountListRequest) GetMeta added in v1.7.2

func (r *CreateAbstractionAccountListRequest) GetMeta(out interface{}) error

func (*CreateAbstractionAccountListRequest) PutMeta added in v1.7.2

func (r *CreateAbstractionAccountListRequest) PutMeta(v interface{}) (err error)

type CreateAbstractionAccountRequest added in v1.7.2

type CreateAbstractionAccountRequest struct {
	Data     CreateAbstractionAccount `json:"data"`
	Included Included                 `json:"included"`
}

type CreateBalance

type CreateBalance struct {
	Key
	Attributes CreateBalanceAttributes `json:"attributes"`
}

type CreateBalanceAttributes

type CreateBalanceAttributes struct {
	// Referral code from the link. Supply it to create the active balance, otherwise disabled balance is created, and it can be activated later.  Disabled balance is only allowed to verify passport and get.
	ReferredBy *string `json:"referred_by,omitempty"`
}

type CreateBalanceListRequest

type CreateBalanceListRequest struct {
	Data     []CreateBalance `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*CreateBalanceListRequest) GetMeta

func (r *CreateBalanceListRequest) GetMeta(out interface{}) error

func (*CreateBalanceListRequest) PutMeta

func (r *CreateBalanceListRequest) PutMeta(v interface{}) (err error)

type CreateBalanceRequest

type CreateBalanceRequest struct {
	Data     CreateBalance `json:"data"`
	Included Included      `json:"included"`
}

type DailyQuestionAnswers added in v1.5.0

type DailyQuestionAnswers struct {
	Key
	Attributes DailyQuestionAnswersAttributes `json:"attributes"`
}

type DailyQuestionAnswersAttributes added in v1.5.0

type DailyQuestionAnswersAttributes struct {
	// Selected/correct answer option
	Answer int64 `json:"answer"`
}

type DailyQuestionAnswersListResponse added in v1.5.0

type DailyQuestionAnswersListResponse struct {
	Data     []DailyQuestionAnswers `json:"data"`
	Included Included               `json:"included"`
	Links    *Links                 `json:"links"`
	Meta     json.RawMessage        `json:"meta,omitempty"`
}

func (*DailyQuestionAnswersListResponse) GetMeta added in v1.5.0

func (r *DailyQuestionAnswersListResponse) GetMeta(out interface{}) error

func (*DailyQuestionAnswersListResponse) PutMeta added in v1.5.0

func (r *DailyQuestionAnswersListResponse) PutMeta(v interface{}) (err error)

type DailyQuestionAnswersResponse added in v1.5.0

type DailyQuestionAnswersResponse struct {
	Data     DailyQuestionAnswers `json:"data"`
	Included Included             `json:"included"`
}

type DailyQuestionCreate added in v1.6.0

type DailyQuestionCreate struct {
	Key
	Attributes DailyQuestionCreateAttributes `json:"attributes"`
}

type DailyQuestionCreateAttributes added in v1.6.0

type DailyQuestionCreateAttributes struct {
	// Correct answer ID
	CorrectAnswer int64 `json:"correct_answer"`
	// Answer options. Minimum 2, maximum 6
	Options []DailyQuestionOptions `json:"options"`
	// Reward for a correct answer
	Reward int64 `json:"reward"`
	// Start date when this question is available, hours and minutes are always 0
	StartsAt string `json:"starts_at"`
	// Time for answer
	TimeForAnswer int64 `json:"time_for_answer"`
	// Question title
	Title string `json:"title"`
}

type DailyQuestionCreateListResponse added in v1.6.0

type DailyQuestionCreateListResponse struct {
	Data     []DailyQuestionCreate `json:"data"`
	Included Included              `json:"included"`
	Links    *Links                `json:"links"`
	Meta     json.RawMessage       `json:"meta,omitempty"`
}

func (*DailyQuestionCreateListResponse) GetMeta added in v1.6.0

func (r *DailyQuestionCreateListResponse) GetMeta(out interface{}) error

func (*DailyQuestionCreateListResponse) PutMeta added in v1.6.0

func (r *DailyQuestionCreateListResponse) PutMeta(v interface{}) (err error)

type DailyQuestionCreateResponse added in v1.6.0

type DailyQuestionCreateResponse struct {
	Data     DailyQuestionCreate `json:"data"`
	Included Included            `json:"included"`
}

type DailyQuestionDel added in v1.6.0

type DailyQuestionDel struct {
	Key
	Attributes DailyQuestionDelAttributes `json:"attributes"`
}

type DailyQuestionDelAttributes added in v1.6.0

type DailyQuestionDelAttributes struct {
	// Question title
	Title string `json:"title"`
}

type DailyQuestionDelListResponse added in v1.6.0

type DailyQuestionDelListResponse struct {
	Data     []DailyQuestionDel `json:"data"`
	Included Included           `json:"included"`
	Links    *Links             `json:"links"`
	Meta     json.RawMessage    `json:"meta,omitempty"`
}

func (*DailyQuestionDelListResponse) GetMeta added in v1.6.0

func (r *DailyQuestionDelListResponse) GetMeta(out interface{}) error

func (*DailyQuestionDelListResponse) PutMeta added in v1.6.0

func (r *DailyQuestionDelListResponse) PutMeta(v interface{}) (err error)

type DailyQuestionDelResponse added in v1.6.0

type DailyQuestionDelResponse struct {
	Data     DailyQuestionDel `json:"data"`
	Included Included         `json:"included"`
}

type DailyQuestionDetails added in v1.6.0

type DailyQuestionDetails struct {
	Key
	Attributes DailyQuestionDetailsAttributes `json:"attributes"`
}

type DailyQuestionDetailsAttributes added in v1.6.0

type DailyQuestionDetailsAttributes struct {
	// Correct answer ID
	CorrectAnswer int64 `json:"correct_answer"`
	// Users who received the question, those who answered and those who did not answer in the time given to them
	NumAllParticipants int64 `json:"num_all_participants"`
	// Number of correct answers
	NumCorrectAnswers int64 `json:"num_correct_answers"`
	// Number of incorrect answers
	NumIncorrectAnswers int64 `json:"num_incorrect_answers"`
	// Answer options. Minimum 2, maximum 6
	Options []DailyQuestionOptions `json:"options"`
	// Reward for a correct answer
	Reward int64 `json:"reward"`
	// Start date when this question is available, hours and minutes are always 0
	StartsAt string `json:"starts_at"`
	// Time for answer
	TimeForAnswer int64 `json:"time_for_answer"`
	// Question title
	Title string `json:"title"`
}

type DailyQuestionDetailsListResponse added in v1.6.0

type DailyQuestionDetailsListResponse struct {
	Data     []DailyQuestionDetails `json:"data"`
	Included Included               `json:"included"`
	Links    *Links                 `json:"links"`
	Meta     json.RawMessage        `json:"meta,omitempty"`
}

func (*DailyQuestionDetailsListResponse) GetMeta added in v1.6.0

func (r *DailyQuestionDetailsListResponse) GetMeta(out interface{}) error

func (*DailyQuestionDetailsListResponse) PutMeta added in v1.6.0

func (r *DailyQuestionDetailsListResponse) PutMeta(v interface{}) (err error)

type DailyQuestionDetailsResponse added in v1.6.0

type DailyQuestionDetailsResponse struct {
	Data     DailyQuestionDetails `json:"data"`
	Included Included             `json:"included"`
}

type DailyQuestionEdit added in v1.6.0

type DailyQuestionEdit struct {
	Key
	Attributes DailyQuestionEditAttributes `json:"attributes"`
}

type DailyQuestionEditAttributes added in v1.6.0

type DailyQuestionEditAttributes struct {
	// Correct answer ID
	CorrectAnswer *int64 `json:"correct_answer,omitempty"`
	// Answer options. Minimum 2, maximum 6
	Options *[]DailyQuestionOptions `json:"options,omitempty"`
	// Reward for a correct answer
	Reward *int64 `json:"reward,omitempty"`
	// Start date when this question is available, hours and minutes are always 0
	StartsAt *string `json:"starts_at,omitempty"`
	// Time for answer
	TimeForAnswer *int64 `json:"time_for_answer,omitempty"`
	// Question title
	Title *string `json:"title,omitempty"`
}

type DailyQuestionEditListResponse added in v1.6.0

type DailyQuestionEditListResponse struct {
	Data     []DailyQuestionEdit `json:"data"`
	Included Included            `json:"included"`
	Links    *Links              `json:"links"`
	Meta     json.RawMessage     `json:"meta,omitempty"`
}

func (*DailyQuestionEditListResponse) GetMeta added in v1.6.0

func (r *DailyQuestionEditListResponse) GetMeta(out interface{}) error

func (*DailyQuestionEditListResponse) PutMeta added in v1.6.0

func (r *DailyQuestionEditListResponse) PutMeta(v interface{}) (err error)

type DailyQuestionEditResponse added in v1.6.0

type DailyQuestionEditResponse struct {
	Data     DailyQuestionEdit `json:"data"`
	Included Included          `json:"included"`
}

type DailyQuestionOptions added in v1.5.0

type DailyQuestionOptions struct {
	// Answer number for the question
	Id int `json:"id"`
	// Answer text
	Title string `json:"title"`
}

type DailyQuestions added in v1.5.0

type DailyQuestions struct {
	Key
	Attributes DailyQuestionsAttributes `json:"attributes"`
}

type DailyQuestionsAttributes added in v1.5.0

type DailyQuestionsAttributes struct {
	// Answer options. Minimum 2, maximum 6
	Options []DailyQuestionOptions `json:"options"`
	// Question title
	Title string `json:"title"`
}

type DailyQuestionsListResponse added in v1.5.0

type DailyQuestionsListResponse struct {
	Data     []DailyQuestions `json:"data"`
	Included Included         `json:"included"`
	Links    *Links           `json:"links"`
	Meta     json.RawMessage  `json:"meta,omitempty"`
}

func (*DailyQuestionsListResponse) GetMeta added in v1.5.0

func (r *DailyQuestionsListResponse) GetMeta(out interface{}) error

func (*DailyQuestionsListResponse) PutMeta added in v1.5.0

func (r *DailyQuestionsListResponse) PutMeta(v interface{}) (err error)

type DailyQuestionsResponse added in v1.5.0

type DailyQuestionsResponse struct {
	Data     DailyQuestions `json:"data"`
	Included Included       `json:"included"`
}

type DailyQuestionsStatus added in v1.5.0

type DailyQuestionsStatus struct {
	Key
	Attributes DailyQuestionsStatusAttributes `json:"attributes"`
}

type DailyQuestionsStatusAttributes added in v1.5.0

type DailyQuestionsStatusAttributes struct {
	// Time when the next question will be available.  If the time is in the past, then there is a question  on this day and the user has not yet answered it.  If the time is in the future, then the user has either  already answered the question on the current day or  there was no question on the current day.
	NextQuestionDate int64 `json:"next_question_date"`
	// The number of points the user will receive if they answer the question correctly.
	Reward int64 `json:"reward"`
	// The time within which the user has to answer this question after receiving it.
	TimeForAnswer int64 `json:"time_for_answer"`
}

type DailyQuestionsStatusListResponse added in v1.5.0

type DailyQuestionsStatusListResponse struct {
	Data     []DailyQuestionsStatus `json:"data"`
	Included Included               `json:"included"`
	Links    *Links                 `json:"links"`
	Meta     json.RawMessage        `json:"meta,omitempty"`
}

func (*DailyQuestionsStatusListResponse) GetMeta added in v1.5.0

func (r *DailyQuestionsStatusListResponse) GetMeta(out interface{}) error

func (*DailyQuestionsStatusListResponse) PutMeta added in v1.5.0

func (r *DailyQuestionsStatusListResponse) PutMeta(v interface{}) (err error)

type DailyQuestionsStatusResponse added in v1.5.0

type DailyQuestionsStatusResponse struct {
	Data     DailyQuestionsStatus `json:"data"`
	Included Included             `json:"included"`
}

type Details

type Details json.RawMessage

func (Details) MarshalJSON

func (d Details) MarshalJSON() ([]byte, error)

MarshalJSON - casts Details to []byte

func (*Details) Scan

func (r *Details) Scan(src interface{}) error

Scan - implements db driver method for auto unmarshal

func (Details) String

func (d Details) String() string

func (*Details) UnmarshalJSON

func (d *Details) UnmarshalJSON(data []byte) error

UnmarshalJSON - casts data to Details

func (Details) Value

func (r Details) Value() (driver.Value, error)

Value - implements db driver method for auto marshal

type Event

type Event struct {
	Key
	Attributes    EventAttributes     `json:"attributes"`
	Relationships *EventRelationships `json:"relationships,omitempty"`
}

type EventAttributes

type EventAttributes struct {
	// Unix timestamp of event creation
	CreatedAt int32 `json:"created_at"`
	// Whether this event may become expired.
	HasExpiration bool      `json:"has_expiration"`
	Meta          EventMeta `json:"meta"`
	// How many points were accrued. Required only for `claimed` events. This is necessary, as the reward might change over time, while the certain balance should be left intact.
	PointsAmount *int64 `json:"points_amount,omitempty"`
	// See `filter[status]` parameter for explanation
	Status string `json:"status"`
	// Unix timestamp of the event status change
	UpdatedAt int32 `json:"updated_at"`
}

type EventClaimingState

type EventClaimingState struct {
	Key
	Attributes EventClaimingStateAttributes `json:"attributes"`
}

type EventClaimingStateAttributes

type EventClaimingStateAttributes struct {
	// If passport scan event was automatically claimed
	Claimed bool `json:"claimed"`
	// Reward amount in points
	Reward int64 `json:"reward"`
}

type EventClaimingStateListResponse

type EventClaimingStateListResponse struct {
	Data     []EventClaimingState `json:"data"`
	Included Included             `json:"included"`
	Links    *Links               `json:"links"`
	Meta     json.RawMessage      `json:"meta,omitempty"`
}

func (*EventClaimingStateListResponse) GetMeta

func (r *EventClaimingStateListResponse) GetMeta(out interface{}) error

func (*EventClaimingStateListResponse) PutMeta

func (r *EventClaimingStateListResponse) PutMeta(v interface{}) (err error)

type EventClaimingStateResponse

type EventClaimingStateResponse struct {
	Data     EventClaimingState `json:"data"`
	Included Included           `json:"included"`
}

type EventListResponse

type EventListResponse struct {
	Data     []Event         `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*EventListResponse) GetMeta

func (r *EventListResponse) GetMeta(out interface{}) error

func (*EventListResponse) PutMeta

func (r *EventListResponse) PutMeta(v interface{}) (err error)

type EventMeta

type EventMeta struct {
	// Some events require dynamic data, which can be filled into `static` template.
	Dynamic *json.RawMessage `json:"dynamic,omitempty"`
	Static  EventStaticMeta  `json:"static"`
}

type EventRelationships

type EventRelationships struct {
	Balance Relation `json:"balance"`
}

type EventResponse

type EventResponse struct {
	Data     Event    `json:"data"`
	Included Included `json:"included"`
}

type EventStaticMeta

type EventStaticMeta struct {
	// Page where you can fulfill the event
	ActionUrl *string `json:"action_url,omitempty"`
	// Whether the event is automatically claimed on fulfillment, or requires manual claim
	AutoClaim   bool   `json:"auto_claim"`
	Description string `json:"description"`
	// Whether the event is disabled in the system. Disabled events can only be retrieved.
	Disabled bool `json:"disabled"`
	// General event expiration date (UTC RFC3339)
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// Event configuration flag:   - active: Events can be opened, fulfilled, claimed   - not_started: Event are not available yet, see `starts_at`   - expired: Event is not available, as it has already expired, see `expires_at`   - disabled: Event is disabled in the system  If event is disabled, it doesn't matter if it's expired or not started: it has `disabled` flag.  Do not specify this field on creation: this structure is reused for request body too.
	Flag string `json:"flag"`
	// Event frequency, which means how often you can fulfill certain task and claim the reward.
	Frequency string `json:"frequency"`
	Logo *string `json:"logo,omitempty"`
	// Unique event code name
	Name string `json:"name"`
	// Hex voting contract address with 0x.
	PollContract *string `json:"poll_contract,omitempty"`
	// Decimal value of the Event ID
	PollEventId *string `json:"poll_event_id,omitempty"`
	// Base64-encoded QR code. Must match the code provided in event type.
	QrCodeValue *string `json:"qr_code_value,omitempty"`
	// Reward amount in points
	Reward           int64  `json:"reward"`
	ShortDescription string `json:"short_description"`
	// General event starting date (UTC RFC3339)
	StartsAt *time.Time `json:"starts_at,omitempty"`
	Title    string     `json:"title"`
	// Number of uses. Only available to the administrator.
	UsageCount *int `json:"usage_count,omitempty"`
}

Primary event metadata in plain JSON. This is a template to be filled by `dynamic` when it's present. This structure is also reused as request body to event type creation and update.

type EventType

type EventType struct {
	Key
	Attributes EventStaticMeta `json:"attributes"`
}

type EventTypeListResponse

type EventTypeListResponse struct {
	Data     []EventType     `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*EventTypeListResponse) GetMeta

func (r *EventTypeListResponse) GetMeta(out interface{}) error

func (*EventTypeListResponse) PutMeta

func (r *EventTypeListResponse) PutMeta(v interface{}) (err error)

type EventTypeResponse

type EventTypeResponse struct {
	Data     EventType `json:"data"`
	Included Included  `json:"included"`
}

type Flag

type Flag struct {
	Name  string `json:"name"`
	Value int32  `json:"value"`
}

type Flagger

type Flagger interface {
	IsFlag() bool
}

type Flags

type Flags struct {
	Mask   int32  `json:"mask"`
	Values []Flag `json:"flags"`
}

func FlagsFromMask

func FlagsFromMask(mask int32, allFlags map[int32]string) Flags

type FulfillPollEvent added in v1.3.0

type FulfillPollEvent struct {
	Key
	Attributes FulfillPollEventAttributes `json:"attributes"`
}

type FulfillPollEventAttributes added in v1.3.0

type FulfillPollEventAttributes struct {
	// Proof of voting in some poll.
	Proof types.ZKProof `json:"proof"`
	// Vote proposal id
	ProposalId string `json:"proposal_id"`
}

type FulfillPollEventListRequest added in v1.3.0

type FulfillPollEventListRequest struct {
	Data     []FulfillPollEvent `json:"data"`
	Included Included           `json:"included"`
	Links    *Links             `json:"links"`
	Meta     json.RawMessage    `json:"meta,omitempty"`
}

func (*FulfillPollEventListRequest) GetMeta added in v1.3.0

func (r *FulfillPollEventListRequest) GetMeta(out interface{}) error

func (*FulfillPollEventListRequest) PutMeta added in v1.3.0

func (r *FulfillPollEventListRequest) PutMeta(v interface{}) (err error)

type FulfillPollEventRequest added in v1.3.0

type FulfillPollEventRequest struct {
	Data     FulfillPollEvent `json:"data"`
	Included Included         `json:"included"`
}

type FulfillQrEvent

type FulfillQrEvent struct {
	Key
	Attributes FulfillQrEventAttributes `json:"attributes"`
}

type FulfillQrEventAttributes

type FulfillQrEventAttributes struct {
	// Base64-encoded QR code
	QrCode string `json:"qr_code"`
}

type FulfillQrEventListRequest

type FulfillQrEventListRequest struct {
	Data     []FulfillQrEvent `json:"data"`
	Included Included         `json:"included"`
	Links    *Links           `json:"links"`
	Meta     json.RawMessage  `json:"meta,omitempty"`
}

func (*FulfillQrEventListRequest) GetMeta

func (r *FulfillQrEventListRequest) GetMeta(out interface{}) error

func (*FulfillQrEventListRequest) PutMeta

func (r *FulfillQrEventListRequest) PutMeta(v interface{}) (err error)

type FulfillQrEventRequest

type FulfillQrEventRequest struct {
	Data     FulfillQrEvent `json:"data"`
	Included Included       `json:"included"`
}

type Included

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

Included - an array of Resource objects that are related to the primary data and/or each other (“included resources”).

func (*Included) Add

func (c *Included) Add(includes ...Resource)

Add - adds new include into collection. If one already present - skips it

func (Included) MarshalJSON

func (c Included) MarshalJSON() ([]byte, error)

MarshalJSON - marshals include collection as array of json objects

func (*Included) MustAbstractionAccount added in v1.7.2

func (c *Included) MustAbstractionAccount(key Key) *AbstractionAccount

MustAbstractionAccount - returns AbstractionAccount from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustActivateBalance added in v1.1.0

func (c *Included) MustActivateBalance(key Key) *ActivateBalance

MustActivateBalance - returns ActivateBalance from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustBalance

func (c *Included) MustBalance(key Key) *Balance

MustBalance - returns Balance from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustBonusCode added in v1.9.0

func (c *Included) MustBonusCode(key Key) *BonusCode

MustBonusCode - returns BonusCode from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustCreateAbstractionAccount added in v1.7.2

func (c *Included) MustCreateAbstractionAccount(key Key) *CreateAbstractionAccount

MustCreateAbstractionAccount - returns CreateAbstractionAccount from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustCreateBalance

func (c *Included) MustCreateBalance(key Key) *CreateBalance

MustCreateBalance - returns CreateBalance from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustDailyQuestionAnswers added in v1.5.0

func (c *Included) MustDailyQuestionAnswers(key Key) *DailyQuestionAnswers

MustDailyQuestionAnswers - returns DailyQuestionAnswers from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustDailyQuestionCreate added in v1.6.0

func (c *Included) MustDailyQuestionCreate(key Key) *DailyQuestionCreate

MustDailyQuestionCreate - returns DailyQuestionCreate from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustDailyQuestionDel added in v1.6.0

func (c *Included) MustDailyQuestionDel(key Key) *DailyQuestionDel

MustDailyQuestionDel - returns DailyQuestionDel from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustDailyQuestionDetails added in v1.6.0

func (c *Included) MustDailyQuestionDetails(key Key) *DailyQuestionDetails

MustDailyQuestionDetails - returns DailyQuestionDetails from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustDailyQuestionEdit added in v1.6.0

func (c *Included) MustDailyQuestionEdit(key Key) *DailyQuestionEdit

MustDailyQuestionEdit - returns DailyQuestionEdit from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustDailyQuestions added in v1.5.0

func (c *Included) MustDailyQuestions(key Key) *DailyQuestions

MustDailyQuestions - returns DailyQuestions from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustDailyQuestionsStatus added in v1.5.0

func (c *Included) MustDailyQuestionsStatus(key Key) *DailyQuestionsStatus

MustDailyQuestionsStatus - returns DailyQuestionsStatus from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustEvent

func (c *Included) MustEvent(key Key) *Event

MustEvent - returns Event from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustEventClaimingState

func (c *Included) MustEventClaimingState(key Key) *EventClaimingState

MustEventClaimingState - returns EventClaimingState from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustEventType

func (c *Included) MustEventType(key Key) *EventType

MustEventType - returns EventType from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustFulfillPollEvent added in v1.3.0

func (c *Included) MustFulfillPollEvent(key Key) *FulfillPollEvent

MustFulfillPollEvent - returns FulfillPollEvent from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustFulfillQrEvent

func (c *Included) MustFulfillQrEvent(key Key) *FulfillQrEvent

MustFulfillQrEvent - returns FulfillQrEvent from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustVerifyPassport

func (c *Included) MustVerifyPassport(key Key) *VerifyPassport

MustVerifyPassport - returns VerifyPassport from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) MustWithdraw added in v1.7.1

func (c *Included) MustWithdraw(key Key) *Withdraw

MustWithdraw - returns Withdraw from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics

func (*Included) UnmarshalJSON

func (c *Included) UnmarshalJSON(data []byte) error

UmarshalJSON - unmarshal array of json objects into include collection

type Key

type Key struct {
	ID   string       `json:"id"`
	Type ResourceType `json:"type"`
}

func NewKeyInt64

func NewKeyInt64(id int64, resourceType ResourceType) Key

func (Key) AsRelation

func (r Key) AsRelation() *Relation

func (*Key) GetKey

func (r *Key) GetKey() Key

func (Key) GetKeyP

func (r Key) GetKeyP() *Key
type Links struct {
	First string `json:"first,omitempty"`
	Last  string `json:"last,omitempty"`
	Next  string `json:"next,omitempty"`
	Prev  string `json:"prev,omitempty"`
	Self  string `json:"self,omitempty"`
}

type ReferralCode

type ReferralCode struct {
	// Referral code itself, unique identifier
	Id string `json:"id"`
	// Status of the code, belonging to this user (referrer):   1. infinity: the code have unlimited usage count and user can get points for each user who scanned passport   2. active: the code is not used yet by another user (referee)   3. awaiting: the code is used by referee who has scanned passport, but the referrer hasn't yet   4. rewarded: the code is used, both referee and referrer have scanned passports   5. consumed: the code is used by referee who has not scanned passport yet  The list is sorted by priority. E.g. if the referee has scanned passport, but referrer not, the status would be `consumed`. If both not scann passport yet status would be `awaiting`.
	Status string `json:"status"`
}

type Relation

type Relation struct {
	Data  *Key   `json:"data,omitempty"`
	Links *Links `json:"links,omitempty"`
}

type RelationCollection

type RelationCollection struct {
	Data  []Key  `json:"data"`
	Links *Links `json:"links,omitempty"`
}

func (RelationCollection) MarshalJSON

func (r RelationCollection) MarshalJSON() ([]byte, error)

type Resource

type Resource interface {
	//GetKey - returns key of the Resource
	GetKey() Key
}

type ResourceType

type ResourceType string
const (
	ABSTRACTION_ACCOUNT    ResourceType = "abstraction_account"
	ACTIVATE_BALANCE       ResourceType = "activate_balance"
	BALANCE                ResourceType = "balance"
	BONUS_CODE             ResourceType = "bonus_code"
	CLAIM_EVENT            ResourceType = "claim_event"
	CREATE_BALANCE         ResourceType = "create_balance"
	DAILY_QUESTIONS        ResourceType = "daily_questions"
	DAILY_QUESTIONS_STATUS ResourceType = "daily_questions_status"
	EVENT_CLAIMING_STATE   ResourceType = "event_claiming_state"
	EVENT                  ResourceType = "event"
	EVENT_TYPE             ResourceType = "event_type"
	FULFILL_POLL_EVENT     ResourceType = "fulfill_poll_event"
	FULFILL_QR_EVENT       ResourceType = "fulfill_qr_event"
	VERIFY_PASSPORT        ResourceType = "verify_passport"
	WITHDRAW               ResourceType = "withdraw"
)

List of ResourceType

type VerifyPassport

type VerifyPassport struct {
	Key
	Attributes VerifyPassportAttributes `json:"attributes"`
}

type VerifyPassportAttributes

type VerifyPassportAttributes struct {
	// Unique identifier of the passport.
	AnonymousId string `json:"anonymous_id"`
	// Query ZK passport verification proof. Required for passport verification endpoint.
	Proof *types.ZKProof `json:"proof,omitempty"`
	// Unique identifier for linking internal and external passports
	SharedHash *string `json:"shared_hash,omitempty"`
}

type VerifyPassportListRequest

type VerifyPassportListRequest struct {
	Data     []VerifyPassport `json:"data"`
	Included Included         `json:"included"`
	Links    *Links           `json:"links"`
	Meta     json.RawMessage  `json:"meta,omitempty"`
}

func (*VerifyPassportListRequest) GetMeta

func (r *VerifyPassportListRequest) GetMeta(out interface{}) error

func (*VerifyPassportListRequest) PutMeta

func (r *VerifyPassportListRequest) PutMeta(v interface{}) (err error)

type VerifyPassportRequest

type VerifyPassportRequest struct {
	Data     VerifyPassport `json:"data"`
	Included Included       `json:"included"`
}

type Withdraw added in v1.7.1

type Withdraw struct {
	Key
	Attributes WithdrawAttributes `json:"attributes"`
}

type WithdrawAttributes added in v1.7.1

type WithdrawAttributes struct {
	// Amount of points to withdraw
	Amount int64 `json:"amount"`
	// Query ZK passport verification proof.
	Proof types.ZKProof `json:"proof"`
}

type WithdrawListRequest added in v1.7.1

type WithdrawListRequest struct {
	Data     []Withdraw      `json:"data"`
	Included Included        `json:"included"`
	Links    *Links          `json:"links"`
	Meta     json.RawMessage `json:"meta,omitempty"`
}

func (*WithdrawListRequest) GetMeta added in v1.7.1

func (r *WithdrawListRequest) GetMeta(out interface{}) error

func (*WithdrawListRequest) PutMeta added in v1.7.1

func (r *WithdrawListRequest) PutMeta(v interface{}) (err error)

type WithdrawRequest added in v1.7.1

type WithdrawRequest struct {
	Data     Withdraw `json:"data"`
	Included Included `json:"included"`
}

Source Files

Jump to

Keyboard shortcuts

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