stellar

package
v0.2.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TFTCode is the asset code for TFT on stellar
	TFTCode = "TFT"

	// FreeTFTCode is the asset code for TFT on stellar
	FreeTFTCode = "FreeTFT"

	// NetworkProduction uses stellar production network
	NetworkProduction = "production"
	// NetworkTest uses stellar test network
	NetworkTest = "testnet"
	// NetworkDebug doesn't do validation, and always address validation is skipped
	// Only supported by the AddressValidator
	NetworkDebug = "debug"
)
View Source
const (
	// TFT assetcode
	TFT assetCodeEnum = TFTCode
	// FreeTFT assetcode
	FreeTFT assetCodeEnum = FreeTFTCode
)

Variables

View Source
var ErrInsuficientBalance = errors.New("insuficient balance")

ErrInsuficientBalance is an error that is used when there is insufficient balance

Functions

This section is empty.

Types

type AddressValidator

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

AddressValidator validates stellar address

func NewAddressValidator

func NewAddressValidator(network, asset string) *AddressValidator

NewAddressValidator creates an address validator instance

func (*AddressValidator) Valid

func (a *AddressValidator) Valid(address string) error

Valid validates a stellar address, and only return nil if address is valid

type PayoutInfo

type PayoutInfo struct {
	Address string
	Amount  xdr.Int64
}

PayoutInfo holds information about which address needs to receive how many funds for payment commands which take multiple receivers

type Wallet

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

Wallet is the foundation wallet Payments will be funded and fees will be taken with this wallet

func New

func New(seed string, network string, asset string) (*Wallet, error)

New from seed

func (*Wallet) CreateAccount

func (w *Wallet) CreateAccount() (string, string, error)

CreateAccount and activate it, so that it is ready to be used The encrypted seed of the wallet is returned, together with the public address

func (*Wallet) GetBalance

func (w *Wallet) GetBalance(address string, id schema.ID) (xdr.Int64, []string, error)

GetBalance gets balance for an address and a given reservation id. It also returns a list of addresses which funded the given address.

func (*Wallet) PayoutFarmers

func (w *Wallet) PayoutFarmers(encryptedSeed string, destinations []PayoutInfo, id schema.ID) error

PayoutFarmers pays a group of farmers, from an escrow account. The escrow account must be provided as the encrypted string of the seed.

func (*Wallet) Refund

func (w *Wallet) Refund(encryptedSeed string, id schema.ID) error

Refund an escrow address for a reservation. This will transfer all funds for this reservation that are currently on the address (if any), to (some of) the addresses which these funds came from.

Jump to

Keyboard shortcuts

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