mukan-ignite/ignite/pkg/cosmostxcollector/query/event.go
Mukan Erkin Törük 26b204bd04
Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
feat: fork Ignite CLI v29 as Mukan Ignite — remove cosmos-sdk restrictions
2026-05-11 03:31:37 +03:00

54 lines
1 KiB
Go

package query
import (
"encoding/json"
"time"
)
// Event defines a transaction event.
type Event struct {
ID int64
TXHash string
Index uint64
Type string
Attributes []Attribute
CreatedAt time.Time
}
// NewAttribute creates a new transaction event attribute.
func NewAttribute(name string, value []byte) Attribute {
return Attribute{
value: value,
Name: name,
}
}
// Attribute defines a transaction event attribute.
type Attribute struct {
value []byte
Name string
}
// Value returns the attribute value.
// Event attribute values are originally encoded as JSON.
// This method decodes the event value into its Go representation.
func (a Attribute) Value() (v any, err error) {
if a.value == nil {
return
}
err = json.Unmarshal(a.value, &v)
return
}
// NewEventQuery creates a new query that selects events.
func NewEventQuery(options ...Option) EventQuery {
return New("event", options...)
}
// EventQuery describes how to select event values from a data backend.
type EventQuery interface {
Pager
Filterer
}