client

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 13 Imported by: 4

Documentation

Overview

Package client provides a client for the screener-api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSignature added in v0.4.0

func GenerateSignature(
	secret,
	message string,
) string

GenerateSignature generates a signature for the request.

Types

type BlackListBody added in v0.4.0

type BlackListBody struct {
	Type    string `json:"type"`
	ID      string `json:"id"`
	Data    string `json:"data"`
	Address string `json:"address"`
	Network string `json:"network"`
	Tag     string `json:"tag"`
	Remark  string `json:"remark"`
}

BlackListBody is the json payload that represents a blacklisted address.

type ScreenerClient

type ScreenerClient interface {
	ScreenAddress(ctx context.Context, ruleset, address string) (blocked bool, err error)
	BlacklistAddress(ctx context.Context, appsecret string, appid string, body BlackListBody) (string, error)
}

ScreenerClient is an interface for the Screener API.

func NewClient

func NewClient(metricHandler metrics.Handler, screenerURL string) (ScreenerClient, error)

NewClient creates a new client for the Screener API.

func NewNoOpClient added in v0.0.13

func NewNoOpClient() (ScreenerClient, error)

NewNoOpClient creates a new no-op client for the Screener API. it returns false for every address.

Jump to

Keyboard shortcuts

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