chainalysis

package module
v0.0.0-...-f58359d Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 5 Imported by: 0

README

chainalysis-go

Chainalysis Golang SDK

https://chainalysis.com/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressIdentification

type AddressIdentification struct {
	Name        string `json:"name"`
	Address     string `json:"address"`
	Category    string `json:"category"`
	Description string `json:"description"`
	Url         string `json:"url"`
	CreatedAt   int64  `json:"createdAt"` // unix*1e3
}

type Category

type Category struct {
	CategoryId   int64  `json:"categoryId"`
	CategoryName string `json:"categoryName"`
}

type Client

type Client interface {
	EntityAddressRegister(address string) (resp EntityAddressRegisterResp, err error)
	EntityAddressRetrieve(address string) (resp EntityAddressRetrieveResp, err error)

	KYTRegisterTransfer(userId string, param KYTRegisterTransferParam) (resp KYTRegisterTransferResp, err error)
	KYTGetTransferSummary(externalId string) (resp KYTGetTransferSummaryResp, err error)
	KYTGetTransferAlerts(externalId string) (resp KYTGetTransferAlertsResp, err error)

	KYTRegisterWithdrawalAttempt(userId string, param KYTRegisterWithdrawalAttemptParam) (resp KYTRegisterWithdrawalAttemptResp, err error)
	KYTGetWithdrawalAttemptSummary(externalId string) (resp KYTGetWithdrawalAttemptSummaryResp, err error)
	KYTGetWithdrawalAttemptAlerts(externalId string) (resp KYTGetTransferAlertsResp, err error)

	RetrieveCategories() (resp RetrieveCategoriesResp, err error)
}

type ClientImpl

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

func NewClient

func NewClient(apiKey string, host ...string) *ClientImpl

func (*ClientImpl) EntityAddressRegister

func (c *ClientImpl) EntityAddressRegister(address string) (resp EntityAddressRegisterResp, err error)

func (*ClientImpl) EntityAddressRetrieve

func (c *ClientImpl) EntityAddressRetrieve(address string) (resp EntityAddressRetrieveResp, err error)

func (*ClientImpl) KYTGetTransferAlerts

func (c *ClientImpl) KYTGetTransferAlerts(externalId string) (resp KYTGetTransferAlertsResp, err error)

func (*ClientImpl) KYTGetTransferSummary

func (c *ClientImpl) KYTGetTransferSummary(externalId string) (resp KYTGetTransferSummaryResp, err error)

func (*ClientImpl) KYTGetWithdrawalAttemptAlerts

func (c *ClientImpl) KYTGetWithdrawalAttemptAlerts(externalId string) (resp KYTGetTransferAlertsResp, err error)

func (*ClientImpl) KYTGetWithdrawalAttemptSummary

func (c *ClientImpl) KYTGetWithdrawalAttemptSummary(externalId string) (resp KYTGetWithdrawalAttemptSummaryResp, err error)

func (*ClientImpl) KYTRegisterTransfer

func (c *ClientImpl) KYTRegisterTransfer(userId string, param KYTRegisterTransferParam) (resp KYTRegisterTransferResp, err error)

func (*ClientImpl) KYTRegisterWithdrawalAttempt

func (c *ClientImpl) KYTRegisterWithdrawalAttempt(userId string, param KYTRegisterWithdrawalAttemptParam) (resp KYTRegisterWithdrawalAttemptResp, err error)

func (*ClientImpl) RetrieveCategories

func (c *ClientImpl) RetrieveCategories() (resp RetrieveCategoriesResp, err error)

func (*ClientImpl) SetDebug

func (c *ClientImpl) SetDebug(debug bool)

func (*ClientImpl) SetTimeout

func (c *ClientImpl) SetTimeout(timeout time.Duration)

func (*ClientImpl) SetTransport

func (c *ClientImpl) SetTransport(transport http.RoundTripper)

SetTransport Used to set Transport for rate limit

type EntityAddressRegisterResp

type EntityAddressRegisterResp struct {
	ErrorResp
	Address string `json:"address"`
}

type EntityAddressRetrieveResp

type EntityAddressRetrieveResp struct {
	Message string `json:"message"`

	Address    string `json:"address"`
	Risk       string `json:"risk"` // Severe, High, Medium, Low
	RiskReason string `json:"riskReason"`
	Cluster    struct {
		Name     string `json:"name"`
		Category string `json:"category"`
	} `json:"cluster"` // VASP?
	AddressType            string                  `json:"addressType"`
	AddressIdentifications []AddressIdentification `json:"addressIdentifications"` // if an address is sanctioned
	Exposures              []Exposure              `json:"exposures"`
	Triggers               []Trigger               `json:"triggers"`
}

type ErrorResp

type ErrorResp struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type Exposure

type Exposure struct {
	Category string  `json:"category"`
	Value    float64 `json:"value"`
}

type KYTGetTransferAlertsResp

type KYTGetTransferAlertsResp struct {
	ErrorResp
	Alerts []KYTTransferAlert `json:"alerts"`
}

type KYTGetTransferSummaryResp

type KYTGetTransferSummaryResp struct {
	ErrorResp
	UpdatedAt         string  `json:"updatedAt"`
	Asset             string  `json:"asset"`
	AssetId           string  `json:"assetId"`
	Network           string  `json:"network"`
	TransferReference string  `json:"transferReference"`
	Tx                string  `json:"tx"`
	Idx               int     `json:"idx"`
	UsdAmount         float64 `json:"usdAmount"`
	AssetAmount       float64 `json:"assetAmount"`
	Timestamp         string  `json:"timestamp"`
	OutputAddress     string  `json:"outputAddress"`
	ExternalId        string  `json:"externalId"`
}

type KYTGetWithdrawalAttemptSummaryResp

type KYTGetWithdrawalAttemptSummaryResp struct {
	ErrorResp
	Asset             string  `json:"asset"`
	AssetId           string  `json:"assetId"`
	Network           string  `json:"network"`
	Address           string  `json:"address"`
	AttemptIdentifier string  `json:"attemptIdentifier"`
	AssetAmount       float64 `json:"assetAmount"`
	UsdAmount         float64 `json:"usdAmount"`
	UpdatedAt         string  `json:"updatedAt"`
	ExternalId        string  `json:"externalId"`
}

type KYTRegisterTransferParam

type KYTRegisterTransferParam struct {
	Network           string `json:"network"`
	Asset             string `json:"asset"`
	TransferReference string `json:"transferReference"`
	Direction         string `json:"direction"`
	// optional
	AssetId           string   `json:"assetId,omitempty"`
	TransferTimestamp string   `json:"transferTimestamp,omitempty"` // ISO8601 2022-03-10T20:37:32+00:00
	AssetAmount       string   `json:"assetAmount,omitempty"`
	OutputAddress     string   `json:"outputAddress,omitempty"`
	InputAddresses    []string `json:"inputAddress,omitempty"`
	AssetPrice        float64  `json:"assetPrice,omitempty"`
	AssetDenomination string   `json:"assetDenomination,omitempty"`
}

type KYTRegisterTransferResp

type KYTRegisterTransferResp struct {
	ErrorResp
	UpdatedAt         string  `json:"updatedAt"`
	Asset             string  `json:"asset"`
	AssetId           string  `json:"assetId"`
	Network           string  `json:"network"`
	TransferReference string  `json:"transferReference"`
	Tx                string  `json:"tx"`
	Idx               int     `json:"idx"`
	UsdAmount         float64 `json:"usdAmount"`
	AssetAmount       float64 `json:"assetAmount"`
	Timestamp         string  `json:"timestamp"`
	OutputAddress     string  `json:"outputAddress"`
	ExternalId        string  `json:"externalId"`
}

type KYTRegisterWithdrawalAttemptParam

type KYTRegisterWithdrawalAttemptParam struct {
	Network           string  `json:"network"`
	Asset             string  `json:"asset"`
	Address           string  `json:"address"`
	AttemptIdentifier string  `json:"attemptIdentifier"`
	AssetAmount       float64 `json:"assetAmount"`
	AttemptTimestamp  string  `json:"attemptTimestamp"` // UTC ISO 8601: 2020-12-09T17:25:40.008307
	// Optional
	AssetId           string  `json:"assetId,omitempty"`
	AssetPrice        float64 `json:"assetPrice,omitempty"`
	AssetDenomination string  `json:"assetDenomination,omitempty"`
}

type KYTRegisterWithdrawalAttemptResp

type KYTRegisterWithdrawalAttemptResp struct {
	ErrorResp
	Asset             string  `json:"asset"`
	AssetId           string  `json:"assetId"`
	Network           string  `json:"network"`
	Address           string  `json:"address"`
	AttemptIdentifier string  `json:"attemptIdentifier"`
	AssetAmount       float64 `json:"assetAmount"`
	UsdAmount         float64 `json:"usdAmount"`
	UpdatedAt         string  `json:"updatedAt"`
	ExternalId        string  `json:"externalId"`
}

type KYTTransferAlert

type KYTTransferAlert struct {
	AlertLevel   string  `json:"alertLevel"` // SEVERE, HIGH, MEDIUM, LOW
	Service      string  `json:"service"`
	ExternalId   string  `json:"externalId"`
	AlertAmount  float64 `json:"alertAmount"`
	ExposureType string  `json:"exposureType"`
	CategoryId   int64   `json:"categoryId"`
}

type RetrieveCategoriesResp

type RetrieveCategoriesResp struct {
	ErrorResp
	Categories []Category `json:"categories"`
}

type Trigger

type Trigger struct {
	Category      string  `json:"category"`
	Percentage    float64 `json:"percentage"`
	Message       string  `json:"message"`
	RuleTriggered struct {
		Risk         string  `json:"risk"`
		MinThreshold float64 `json:"minThreshold"`
		MaxThreshold float64 `json:"maxThreshold"`
		ExposureType string  `json:"exposureType"`
		Direction    string  `json:"direction"`
	} `json:"ruleTriggered"`
}

Jump to

Keyboard shortcuts

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