tatum

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenHeader = "x-api-key"
	EthTestnet  = "ethereum-goerli"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BasePath   string
	APIKey     string `yaml:"api_key" env:"TATUM_API_KEY" env-description:"Tatum API Key"`
	TestAPIKey string `yaml:"test_api_key" env:"TATUM_TEST_API_KEY" env-description:"Tatum Test API Key"`
	HMACSecret string `yaml:"tatum_hmac_secret" env:"TATUM_HMAC_SECRET" env-description:"Tatum HMAC Secret. Use any random string with 8+ chars"`

	// HMACForceSet will make "set hmac set" request on every service start. Useful if HMAC secret was changed.
	HMACForceSet bool `yaml:"tatum_hmac_force_set" env:"TATUM_HMAC_FORCE_SET" env-description:"Internal variable"`
}

type Provider

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

func New

func New(config Config, registryService *registry.Service, logger *zerolog.Logger) *Provider

func (*Provider) BinanceSmartChainRPC added in v0.3.0

func (p *Provider) BinanceSmartChainRPC(ctx context.Context, isTest bool) (*ethclient.Client, error)

func (*Provider) EthereumRPC

func (p *Provider) EthereumRPC(ctx context.Context, isTest bool) (*ethclient.Client, error)

func (*Provider) Main

func (p *Provider) Main() *tatum.APIClient

func (*Provider) MaticRPC

func (p *Provider) MaticRPC(ctx context.Context, isTest bool) (*ethclient.Client, error)

func (*Provider) SubscribeToWebhook

func (p *Provider) SubscribeToWebhook(ctx context.Context, params SubscriptionParams) (string, error)

SubscribeToWebhook auto-generated sdk throws an error on this request, so it's rewritten manually.

func (*Provider) Test

func (p *Provider) Test() *tatum.APIClient

func (*Provider) ValidateHMAC

func (p *Provider) ValidateHMAC(body []byte, hash string) bool

type SubscriptionParams

type SubscriptionParams struct {
	Blockchain money.Blockchain
	Address    string
	IsTest     bool
	WebhookURL string
}

type SubscriptionResponse

type SubscriptionResponse struct {
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

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