processor

package
v0.0.0-...-3befcbb Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaleBody         uint8  = 0
	FemaleBody       uint8  = 1
	MaleHair         uint8  = 2
	FemaleHair       uint8  = 3
	Beard            uint8  = 4
	OldestHustlerAge uint64 = 1637443660
)

Variables

This section is empty.

Functions

func CleanJsonString

func CleanJsonString(json string) string

Nasty Hustlers put bad unicode and null chars in things. We have to clean it up or it breaks our system.

func GetHustlerSvg

func GetHustlerSvg(h *bindings.Hustler, big *big.Int, log *zerolog.Logger) (string, error)

Tries to get hustler svg from chain, if it fails, it tries to get it from offchain

func RefreshHustlerEquipment

func RefreshHustlerEquipment(
	ctx context.Context,
	eth interface {
		bind.ContractBackend
		ethereum.ChainStateReader
		ethereum.TransactionReader
	},
	tx *ent.Tx,
	id string,
	address common.Address,
	blockNumber *big.Int,
) error

Types

type Attribute

type Attribute struct {
	Type        string          `json:"trait_type"`
	DisplayType string          `json:"display_type"`
	Value       json.RawMessage `json:"value"`
}

type DopeProcessor

type DopeProcessor struct {
	bindings.BaseDopeProcessor
}

func (*DopeProcessor) ProcessTransfer

func (p *DopeProcessor) ProcessTransfer(ctx context.Context, e bindings.DopeTransfer) (func(tx *ent.Tx) error, error)

type HustlerProcessor

type HustlerProcessor struct {
	bindings.BaseHustlerProcessor
	// contains filtered or unexported fields
}

func (*HustlerProcessor) ProcessAddRles

func (p *HustlerProcessor) ProcessAddRles(ctx context.Context, e bindings.HustlerAddRles) (func(tx *ent.Tx) error, error)

func (*HustlerProcessor) ProcessMetadataUpdate

func (p *HustlerProcessor) ProcessMetadataUpdate(
	ctx context.Context,
	e bindings.HustlerMetadataUpdate,
) (func(tx *ent.Tx) error, error)

func (*HustlerProcessor) ProcessTransferBatch

func (p *HustlerProcessor) ProcessTransferBatch(
	ctx context.Context,
	e bindings.HustlerTransferBatch,
) (func(tx *ent.Tx) error, error)

func (*HustlerProcessor) ProcessTransferSingle

func (p *HustlerProcessor) ProcessTransferSingle(
	ctx context.Context,
	e bindings.HustlerTransferSingle,
) (func(tx *ent.Tx) error, error)

func (*HustlerProcessor) Setup

func (p *HustlerProcessor) Setup(address common.Address, eth interface {
	ethereum.ChainReader
	ethereum.ChainStateReader
	ethereum.TransactionReader
	bind.ContractBackend
}) error

type InitiatorProcessor

type InitiatorProcessor struct {
	bindings.BaseInitiatorProcessor
}

func (*InitiatorProcessor) ProcessOpened

func (p *InitiatorProcessor) ProcessOpened(ctx context.Context, e bindings.InitiatorOpened) (func(tx *ent.Tx) error, error)

type Metadata

type Metadata struct {
	Image      string      `json:"image"`
	Attributes []Attribute `json:"attributes"`
}

type PaperProcessor

type PaperProcessor struct {
	bindings.BasePaperProcessor
}

func (*PaperProcessor) ProcessTransfer

func (p *PaperProcessor) ProcessTransfer(ctx context.Context, e bindings.PaperTransfer) (func(tx *ent.Tx) error, error)

type Processor

type Processor interface {
	Setup(common.Address, interface {
		ethereum.ChainReader
		ethereum.ChainStateReader
		ethereum.TransactionReader
		bind.ContractBackend
	}) error
	ProcessElement(interface{}) func(context.Context, types.Log) (func(*ent.Tx) error, error)
}

type Slots

type Slots struct {
	Weapon    *big.Int
	Clothes   *big.Int
	Vehicle   *big.Int
	Waist     *big.Int
	Foot      *big.Int
	Hand      *big.Int
	Drug      *big.Int
	Neck      *big.Int
	Ring      *big.Int
	Accessory *big.Int
}

type SwapMeetProcessor

type SwapMeetProcessor struct {
	bindings.BaseSwapMeetProcessor
	// contains filtered or unexported fields
}

func (*SwapMeetProcessor) ProcessSetRle

func (p *SwapMeetProcessor) ProcessSetRle(ctx context.Context, e bindings.SwapMeetSetRle) (func(tx *ent.Tx) error, error)

func (*SwapMeetProcessor) ProcessTransferBatch

func (p *SwapMeetProcessor) ProcessTransferBatch(
	ctx context.Context,
	e bindings.SwapMeetTransferBatch) (func(tx *ent.Tx) error, error)

func (*SwapMeetProcessor) ProcessTransferSingle

func (p *SwapMeetProcessor) ProcessTransferSingle(
	ctx context.Context,
	e bindings.SwapMeetTransferSingle) (func(tx *ent.Tx) error, error)

func (*SwapMeetProcessor) Setup

func (p *SwapMeetProcessor) Setup(address common.Address, eth interface {
	ethereum.ChainReader
	ethereum.ChainStateReader
	ethereum.TransactionReader
	bind.ContractBackend
}) error

Jump to

Keyboard shortcuts

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