activity

package
v0.154.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NoLimitTimestampForPeriod = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

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

func GetActivityEntries

func GetActivityEntries(db *sql.DB, addresses []eth.Address, chainIDs []common.ChainID, filter Filter, offset int, limit int) ([]Entry, error)

GetActivityEntries returns query the transfers, pending_transactions, and multi_transactions tables based on filter parameters and arguments it returns metadata for all entries ordered by timestamp column

Adding a no-limit option was never considered or required.

func NewActivityEntryWithMultiTransaction

func NewActivityEntryWithMultiTransaction(id transfer.MultiTransactionIDType, timestamp int64, activityType Type, activityStatus Status) Entry

func NewActivityEntryWithTransaction

func NewActivityEntryWithTransaction(payloadType PayloadType, transaction *transfer.TransactionIdentity, timestamp int64, activityType Type, activityStatus Status) Entry

func (*Entry) MarshalJSON

func (e *Entry) MarshalJSON() ([]byte, error)

func (*Entry) PayloadType added in v0.152.2

func (e *Entry) PayloadType() PayloadType

func (*Entry) UnmarshalJSON

func (e *Entry) UnmarshalJSON(data []byte) error

type Filter

type Filter struct {
	Period                Period               `json:"period"`
	Types                 []Type               `json:"types"`
	Statuses              []Status             `json:"statuses"`
	Tokens                Tokens               `json:"tokens"`
	CounterpartyAddresses []eth_common.Address `json:"counterpartyAddresses"`
}

type PayloadType

type PayloadType = int
const (
	MultiTransactionPT PayloadType = iota + 1
	SimpleTransactionPT
	PendingTransactionPT
)

Beware if adding/removing please check if affected and update the functions below - NewActivityEntryWithTransaction - multiTransactionTypeToActivityType

type Period

type Period struct {
	StartTimestamp int64 `json:"startTimestamp"`
	EndTimestamp   int64 `json:"endTimestamp"`
}

type Status

type Status int
const (
	FailedAS Status = iota
	PendingAS
	CompleteAS
	FinalizedAS
)

type TokenCode added in v0.152.2

type TokenCode string

type TokenType

type TokenType int
const (
	AssetTT TokenType = iota
	CollectiblesTT
)

type Tokens added in v0.152.2

type Tokens struct {
	Assets       []TokenCode          `json:"assets"`
	Collectibles []eth_common.Address `json:"collectibles"`
	EnabledTypes []TokenType          `json:"enabledTypes"`
}

Tokens the following rules apply for its members: empty member: none is selected nil means all see allTokensFilter and noTokensFilter

type Type

type Type int
const (
	SendAT Type = iota
	ReceiveAT
	BuyAT
	SwapAT
	BridgeAT
)

Jump to

Keyboard shortcuts

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