app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	AppAccount     *blockchain.Account
	ClientInstance *horizon.Client
	UserAccount    *blockchain.Account
}

App defines an interface to the user in a DApp

func Build

func Build(developerSecret, address string) (*App, error)

Build fetches information from the Stellar Network, and returns an instance of a connected DApp

func (*App) Account

func (a *App) Account() *blockchain.Account

AppAccount returns the associated app account

func (*App) AppKeypair

func (a *App) AppKeypair() keypair.KP

AppKeypair returns keypair associated with app account

func (*App) Authorized

func (a *App) Authorized() bool

Authorized confirms the connected developer is authorized to use app

func (*App) Balance

func (a *App) Balance() float64

Balance returns the app balance

func (*App) Charge

func (a *App) Charge(amount float64, destination ...string) (horizon.TransactionSuccess, error)

Charge charges specified amount from user account and then optionally transfers it from app account to a thrid party in same transaction

func (*App) GetUserAccount

func (a *App) GetUserAccount() *blockchain.Account

GetUserAccount returns the user account authenticated to app

func (*App) Payout

func (a *App) Payout(amount float64, destination ...string) (horizon.TransactionSuccess, error)

Payout sends money from application account to a user or third party.

func (*App) Transfer

func (a *App) Transfer(amount float64, destination string) (horizon.TransactionSuccess, error)

Transfer sends money from the user account to a thrid party directly

func (*App) UserBalance

func (a *App) UserBalance() float64

UserBalance reutrns the app user balance

func (*App) UserKeypair

func (a *App) UserKeypair() keypair.KP

UserKeypair returns keypair associated with connected user

Jump to

Keyboard shortcuts

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