Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 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" )
Variables ¶
View Source
var ( // ErrInsufficientBalance is an error that is used when there is insufficient balance ErrInsufficientBalance = errors.New("insufficient balance") // ErrAssetCodeNotSupported indicated the given asset code is not supported by this wallet ErrAssetCodeNotSupported = errors.New("asset code not supported") )
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, assetCode, horizonURL string) (*AddressValidator, error)
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 Asset ¶
type Asset string
Asset on the stellar network, both code and issuer in the form <CODE>:<ISSUER>
const (
TFTMainnet Asset = "TFT:GBOVQKJYHXRR3DX6NOX2RRYFRCUMSADGDESTDNBDS6CDVLGVESRTAC47"
)
Supported assets for the wallet. Assets are different based on testnet/mainnet
type PayoutInfo ¶
PayoutInfo holds information about which address needs to receive how many funds for payment commands which take multiple receivers
type Signers ¶
type Signers []string
Signers is a flag type for setting the signers on the escrow accounts
type Wallet ¶
type Wallet interface { AssetFromCode(code string) (Asset, error) PrecisionDigits() int PublicAddress() string CreateAccount() (encSeed string, address string, err error) GetBalance(address string, memo string, asset Asset) (xdr.Int64, []string, error) Refund(encryptedSeed string, memo string, asset Asset) error PayoutFarmers(encryptedSeed string, destinations []PayoutInfo, memo string, asset Asset) error GetAccountDetails(address string) (account hProtocol.Account, err error) GetHorizonClient() (*horizonclient.Client, error) GetNetworkPassPhrase() string }
Wallet interface
Click to show internal directories.
Click to hide internal directories.