activity

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectionStrings

func DirectionStrings() []string

DirectionStrings returns a slice of all String values of the enum

Types

type Action

type Action struct {
	Tag         tag.Tag           `json:"tag"`
	Type        schema.Type       `json:"type"`
	Platform    string            `json:"platform,omitempty"`
	From        string            `json:"from"`
	To          string            `json:"to"`
	Metadata    metadata.Metadata `json:"metadata"`
	RelatedURLs []string          `json:"related_urls,omitempty"`
}

func (*Action) UnmarshalJSON

func (a *Action) UnmarshalJSON(bytes []byte) error

type Actions

type Actions []*Action

type Activities

type Activities []*Activity

func (*Activities) UnmarshalJSON

func (f *Activities) UnmarshalJSON(bytes []byte) error

type Activity

type Activity struct {
	ID           string          `json:"id"`
	Owner        string          `json:"owner,omitempty"`
	Network      network.Network `json:"network"`
	Index        uint            `json:"index"`
	From         string          `json:"from"`
	To           string          `json:"to"`
	Tag          tag.Tag         `json:"tag"`
	Type         schema.Type     `json:"type"`
	Platform     string          `json:"platform,omitempty"`
	Fee          *Fee            `json:"fee,omitempty"`
	Calldata     *Calldata       `json:"calldata,omitempty"`
	TotalActions uint            `json:"total_actions"`
	Actions      []*Action       `json:"actions"`
	Direction    Direction       `json:"direction,omitempty"`
	Status       bool            `json:"success"`
	Timestamp    uint64          `json:"timestamp"`
}

func NewUnknownActivity

func NewUnknownActivity(activity *Activity) *Activity

type Calldata

type Calldata struct {
	Raw            string `json:"raw,omitempty"`
	FunctionHash   string `json:"function_hash,omitempty"`
	ParsedFunction string `json:"parsed_function,omitempty"`
}

type Direction

type Direction uint64
const (
	DirectionIn Direction = iota + 1
	DirectionOut
	DirectionSelf
)

func DirectionString

func DirectionString(s string) (Direction, error)

DirectionString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func DirectionValues

func DirectionValues() []Direction

DirectionValues returns all values of the enum

func (Direction) IsADirection

func (i Direction) IsADirection() bool

IsADirection returns "true" if the value is listed in the enum definition. "false" otherwise

func (Direction) MarshalJSON

func (i Direction) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Direction

func (Direction) String

func (i Direction) String() string

func (*Direction) UnmarshalJSON

func (i *Direction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Direction

func (*Direction) UnmarshalParam

func (d *Direction) UnmarshalParam(param string) error

func (Direction) Values

func (Direction) Values() []string

type Fee

type Fee struct {
	Address *string         `json:"address,omitempty"`
	Amount  decimal.Decimal `json:"amount"`
	Decimal uint            `json:"decimal"`
}

type Option

type Option func(activity *Activity) error

Option is a function that can be used to modify an Activity, it is used in the activity builder.

func WithActivityPlatform

func WithActivityPlatform(platform string) Option

Jump to

Keyboard shortcuts

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