decentralized

package
v0.5.29 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRecentRequests = 10
View Source
const Name = "decentralized"

Variables

View Source
var (
	RecentRequests *cb.Queue
)

Functions

func GetRecentRequest added in v0.5.26

func GetRecentRequest() []string

GetRecentRequest returns the filtered recent requests.

func NewComponent

func NewComponent(_ context.Context, apiServer *echo.Echo, config *config.File, databaseClient database.Client, redisClient rueidis.Client) component.Component

Types

type AccountActivitiesRequest

type AccountActivitiesRequest struct {
	Account        string                   `param:"account" validate:"required"`
	Limit          int                      `query:"limit" validate:"min=1,max=100" default:"100"`
	ActionLimit    int                      `query:"action_limit" validate:"min=1,max=20" default:"10"`
	Cursor         *string                  `query:"cursor"`
	SinceTimestamp *uint64                  `query:"since_timestamp"`
	UntilTimestamp *uint64                  `query:"until_timestamp"`
	Status         *bool                    `query:"success"`
	Direction      *activityx.Direction     `query:"direction"`
	Network        []network.Network        `query:"network"`
	Tag            []tag.Tag                `query:"tag"`
	Type           []schema.Type            `query:"-"`
	Platform       []decentralized.Platform `query:"platform"`
}

type AccountsActivitiesRequest added in v0.5.21

type AccountsActivitiesRequest struct {
	Accounts       []string                 `json:"accounts" validate:"required"`
	Limit          int                      `json:"limit" validate:"min=1,max=100" default:"100"`
	ActionLimit    int                      `json:"action_limit" validate:"min=1,max=20" default:"10"`
	Cursor         *string                  `json:"cursor"`
	SinceTimestamp *uint64                  `json:"since_timestamp"`
	UntilTimestamp *uint64                  `json:"until_timestamp"`
	Status         *bool                    `json:"success"`
	Direction      *activityx.Direction     `json:"direction"`
	Network        []network.Network        `json:"network"`
	Tag            []tag.Tag                `json:"tag"`
	Type           []string                 `json:"type"`
	Platform       []decentralized.Platform `json:"platform"`
}

type ActivitiesResponse

type ActivitiesResponse struct {
	Data []*activityx.Activity `json:"data"`
	Meta *MetaCursor           `json:"meta,omitempty"`
}

type ActivityRequest

type ActivityRequest struct {
	ID          string `param:"id"`
	ActionLimit int    `query:"action_limit"  validate:"min=1,max=20" default:"10"`
	ActionPage  int    `query:"action_page" validate:"min=1" default:"1"`
}

type ActivityResponse

type ActivityResponse struct {
	Data *activityx.Activity `json:"data"`
	Meta *MetaTotalPages     `json:"meta"`
}

type Component

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

func (*Component) AddTransactionChainURL added in v0.5.18

func (c *Component) AddTransactionChainURL(_ context.Context, n network.Network, platform string, id string) []string

func (*Component) BatchGetAccountsActivities added in v0.5.21

func (c *Component) BatchGetAccountsActivities(ctx echo.Context) (err error)

BatchGetAccountsActivities returns the activities of multiple accounts in a single request

func (*Component) CollectMetric

func (c *Component) CollectMetric(ctx context.Context, path, value string)

func (*Component) CollectTrace added in v0.5.19

func (c *Component) CollectTrace(ctx context.Context, path, value string)

func (*Component) GetAccountActivities

func (c *Component) GetAccountActivities(ctx echo.Context) (err error)

func (*Component) GetActivity

func (c *Component) GetActivity(ctx echo.Context) error

func (*Component) GetNetworkActivities added in v0.5.21

func (c *Component) GetNetworkActivities(ctx echo.Context) (err error)

func (*Component) GetPlatformActivities added in v0.5.21

func (c *Component) GetPlatformActivities(ctx echo.Context) (err error)

func (*Component) InitMeter

func (c *Component) InitMeter() (err error)

func (*Component) Name

func (c *Component) Name() string

func (*Component) TransformActivities added in v0.5.21

func (c *Component) TransformActivities(ctx context.Context, activities []*activityx.Activity) []*activityx.Activity

func (*Component) TransformActivity added in v0.5.18

func (c *Component) TransformActivity(ctx context.Context, activity *activityx.Activity) (*activityx.Activity, error)

TransformActivity should add related URLs to the activity based on action tag, network and platform

func (*Component) TransformCollectibleType added in v0.5.18

func (c *Component) TransformCollectibleType(ctx context.Context, n network.Network, action activity.Action) (activity.Action, error)

TransformCollectibleType adds collectible token URLs in opensea, looksrare and other platforms

func (*Component) TransformSocialPost added in v0.5.18

func (c *Component) TransformSocialPost(ctx context.Context, network network.Network, platform string, action activity.Action) (activity.Action, error)

TransformSocialPost adds author url and note url to social post action

func (*Component) TransformSocialProfile added in v0.5.18

func (c *Component) TransformSocialProfile(ctx context.Context, platform string, action activity.Action) (activity.Action, error)

TransformSocialProfile adds author url to social profile action

func (*Component) TransformSocialProxy added in v0.5.18

func (c *Component) TransformSocialProxy(ctx context.Context, platform string, action activity.Action) (activity.Action, error)

TransformSocialProxy adds author url to social proxy action

func (*Component) TransformSocialType added in v0.5.18

func (c *Component) TransformSocialType(ctx context.Context, network network.Network, platform string, action activity.Action) (activity.Action, error)

TransformSocialType adds author url and note url to social actions based on type, network and platform

type MetaCursor

type MetaCursor struct {
	Cursor string `json:"cursor"`
}

type MetaTotalPages

type MetaTotalPages struct {
	TotalPages int `json:"totalPages"`
}

type NetworkActivitiesRequest added in v0.5.21

type NetworkActivitiesRequest struct {
	Network network.Network `param:"network" validate:"required"`

	Limit          int                      `query:"limit" validate:"min=1,max=100" default:"100"`
	ActionLimit    int                      `query:"action_limit" validate:"min=1,max=20" default:"10"`
	Cursor         *string                  `query:"cursor"`
	SinceTimestamp *uint64                  `query:"since_timestamp"`
	UntilTimestamp *uint64                  `query:"until_timestamp"`
	Status         *bool                    `query:"success"`
	Direction      *activityx.Direction     `query:"direction"`
	Tag            []tag.Tag                `query:"tag"`
	Type           []schema.Type            `query:"-"`
	Platform       []decentralized.Platform `query:"platform"`
}

type PlatformActivitiesRequest added in v0.5.21

type PlatformActivitiesRequest struct {
	Platform decentralized.Platform `param:"platform" validate:"required"`

	Limit          int                  `query:"limit" validate:"min=1,max=100" default:"100"`
	ActionLimit    int                  `query:"action_limit" validate:"min=1,max=20" default:"10"`
	Cursor         *string              `query:"cursor"`
	SinceTimestamp *uint64              `query:"since_timestamp"`
	UntilTimestamp *uint64              `query:"until_timestamp"`
	Status         *bool                `query:"success"`
	Direction      *activityx.Direction `query:"direction"`
	Tag            []tag.Tag            `query:"tag"`
	Type           []schema.Type        `query:"-"`
	Network        []network.Network    `query:"network"`
}

Jump to

Keyboard shortcuts

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