nitronode

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the Nitrolite SDK client for faucet operations.

func NewClient

func NewClient(logger log.Logger, privateKeyHex, nitronodeURL, tokenSymbol string, tipAmount decimal.Decimal, minTransferCount int) (*Client, error)

NewClient creates a Client that wraps the Nitrolite SDK for faucet operations. privateKeyHex drives both message signing and tx signing. nitronodeURL is the WebSocket endpoint. The client is immediately connected and ready to use.

func (*Client) Close

func (c *Client) Close() error

Close shuts down the Nitronode connection. Uses write lock to serialise with reconnect and prevent closing a freshly installed client.

func (*Client) EnsureConnected

func (c *Client) EnsureConnected() error

EnsureConnected checks the connection and reconnects with exponential backoff if necessary.

func (*Client) EnsureOperational

func (c *Client) EnsureOperational() error

EnsureOperational validates token support and sufficient balance.

func (*Client) GetOwnerAddress

func (c *Client) GetOwnerAddress() string

GetOwnerAddress returns the faucet owner's Ethereum address. Derived from the immutable raw signer; cached at construction so no lock is needed.

func (*Client) Transfer

func (c *Client) Transfer(destination, asset string, amount decimal.Decimal) (*TransferResult, error)

Transfer sends tokens to the destination address.

type TransferResult

type TransferResult struct {
	TxID   string
	Amount string
	Asset  string
}

TransferResult holds the result of a token transfer.

Jump to

Keyboard shortcuts

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