stellar

package
v0.0.0-...-57c21f4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountAlreadyExists = errors.New("Account already exists")
View Source
var ErrInvalidAddress = errors.New("Invalid Stellar address")

Functions

func AccountAdressFromSecret

func AccountAdressFromSecret(secret string) (address string, err error)

func GetHorizonClient

func GetHorizonClient(network string) (*horizonclient.Client, error)

GetHorizonClient gets an horizon client for a specific network

func GetNetworkPassPhrase

func GetNetworkPassPhrase(ntwrk string) string

GetNetworkPassPhrase gets the Stellar network passphrase based on a network input

func IsValidStellarAddress

func IsValidStellarAddress(address string) bool

func IsValidStellarSecret

func IsValidStellarSecret(secret string) bool

Types

type TransactionStorage

type TransactionStorage struct {

	// sentTransactionMemos keeps the memo's of outgoing transactions of the addressToScan account
	// this is used to check if an accountactivation has already been executed
	TransactionMemos map[string]bool
	// contains filtered or unexported fields
}

func NewTransactionStorage

func NewTransactionStorage(network, addressToScan string) *TransactionStorage

func (*TransactionStorage) ScanAccount

func (s *TransactionStorage) ScanAccount(ctx context.Context) error

func (*TransactionStorage) StoreTransaction

func (s *TransactionStorage) StoreTransaction(tx hProtocol.Transaction)

StoreTransaction stores a transaction in the cache If there is a memo of type hash and the transaction is created by the account being watched, the memo is kept as well to know that an activation already happened.

func (*TransactionStorage) TransactionWithMemoExists

func (s *TransactionStorage) TransactionWithMemoExists(ctx context.Context, memo string) (exists bool, err error)

TransactionWithMemoExists checks if a transaction with the given memo exists Will return a context.Canceled error if the context is canceled

type Wallet

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

func NewWallet

func NewWallet(secret string, network string) Wallet

func (*Wallet) ActivateAccount

func (w *Wallet) ActivateAccount(account string, memoHash [32]byte) (err error)

Jump to

Keyboard shortcuts

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