usdt_watcher

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

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

usdt-watcher

Watch for Tether (USDt) transaction in Ethereum blockchain using JSON-RPC API through WebSocket.

Usage

package main

import (
    "context"

    usdt_watcher "github.com/lalex/usdt-watcher"
    notifier "github.com/lalex/usdt-watcher/notifier"
)

func main() {
    w := usdt_watcher.New("wss://mainnet.infura.io/ws/v3/_projectId_")
    w.AddAddress("0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE")
    w.RegisterNotifier(notifier.NewConsoleNotifier())
    //w.RegisterNotifier(notifier.NewWebhookNotifier("https://webhook.site/_uuid_"))
    w.Run(context.Background())
}

License

Apache 2.0 License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UsdtWatcher

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

func New

func New(websocketUrl string) *UsdtWatcher

func (*UsdtWatcher) AddAddress

func (w *UsdtWatcher) AddAddress(address string)

func (*UsdtWatcher) RegisterNotifier

func (w *UsdtWatcher) RegisterNotifier(n notifier.Notifier)

func (*UsdtWatcher) Run

func (w *UsdtWatcher) Run(ctx context.Context)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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