Documentation ¶
Index ¶
- Constants
- Variables
- type AddressValidator
- type PayoutInfo
- type Wallet
- func (w *Wallet) CreateAccount() (string, string, error)
- func (w *Wallet) GetBalance(address string, id schema.ID) (xdr.Int64, []string, error)
- func (w *Wallet) PayoutFarmers(encryptedSeed string, destinations []PayoutInfo, id schema.ID) error
- func (w *Wallet) Refund(encryptedSeed string, id schema.ID) error
Constants ¶
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" )
const ( // TFT assetcode TFT assetCodeEnum = TFTCode // FreeTFT assetcode FreeTFT assetCodeEnum = FreeTFTCode )
Variables ¶
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 ¶
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 (*Wallet) CreateAccount ¶
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 ¶
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 ¶
PayoutFarmers pays a group of farmers, from an escrow account. The escrow account must be provided as the encrypted string of the seed.