antispam

package
v1.10.21-0...-6c01c52 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guard

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

func NewGuard

func NewGuard(integration Integration) *Guard

func (*Guard) AllowDistribution

func (g *Guard) AllowDistribution(ctx context.Context, owner *common.Account, isPublic bool) (bool, error)

func (*Guard) AllowOpenAccounts

func (g *Guard) AllowOpenAccounts(ctx context.Context, owner *common.Account, accountSet transactionpb.OpenAccountsMetadata_AccountSet) (bool, error)

func (*Guard) AllowReceivePayments

func (g *Guard) AllowReceivePayments(ctx context.Context, owner *common.Account, isPublic bool) (bool, error)

func (*Guard) AllowSendPayment

func (g *Guard) AllowSendPayment(ctx context.Context, owner, destination *common.Account, isPublic bool) (bool, error)

func (*Guard) AllowSwap added in v1.3.0

func (g *Guard) AllowSwap(ctx context.Context, owner, fromMint, toMint *common.Account) (bool, error)

func (*Guard) AllowWelcomeBonus

func (g *Guard) AllowWelcomeBonus(ctx context.Context, owner *common.Account) (bool, error)

type Integration

type Integration interface {
	AllowOpenAccounts(ctx context.Context, owner *common.Account, accountSet transactionpb.OpenAccountsMetadata_AccountSet) (bool, string, error)

	AllowWelcomeBonus(ctx context.Context, owner *common.Account) (bool, string, error)

	AllowSendPayment(ctx context.Context, owner, destination *common.Account, isPublic bool) (bool, string, error)

	AllowReceivePayments(ctx context.Context, owner *common.Account, isPublic bool) (bool, string, error)

	AllowDistribution(ctx context.Context, owner *common.Account, isPublic bool) (bool, string, error)

	AllowSwap(ctx context.Context, owner, fromMint, toMint *common.Account) (bool, string, error)
}

Integration is an antispam guard integration that apps can implement to check whether operations of interest are allowed to be performed.

func NewAllowEverything

func NewAllowEverything() Integration

NewAllowEverything returns a default antispam integration that allows everything

Jump to

Keyboard shortcuts

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