internal

package
v0.0.0-...-821bc58 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubmitTransaction

func SubmitTransaction(minion *Minion, hclient *horizonclient.Client, tx string) (*hProtocol.TransactionSuccess, error)

SubmitTransaction should be passed to the Minion.

Types

type Account

type Account struct {
	AccountID string
	Sequence  xdr.SequenceNumber
}

Account implements the `txnbuild.Account` interface.

func (Account) GetAccountID

func (a Account) GetAccountID() string

GetAccountID returns the Account ID.

func (Account) IncrementSequenceNumber

func (a Account) IncrementSequenceNumber() (xdr.SequenceNumber, error)

IncrementSequenceNumber increments the internal record of the account's sequence number by 1.

func (*Account) RefreshSequenceNumber

func (a *Account) RefreshSequenceNumber(hclient *horizonclient.Client) error

RefreshSequenceNumber gets an Account's correct in-memory sequence number from Horizon.

type Bot

type Bot struct {
	Minions []Minion
	// contains filtered or unexported fields
}

Bot represents the friendbot subsystem and primarily delegates work to its Minions.

func (*Bot) Pay

func (bot *Bot) Pay(destAddress string) (*hProtocol.TransactionSuccess, error)

Pay funds the account at `destAddress`.

type FriendbotHandler

type FriendbotHandler struct {
	Friendbot *Bot
}

FriendbotHandler causes an account at `Address` to be created.

func (*FriendbotHandler) Handle

func (handler *FriendbotHandler) Handle(w http.ResponseWriter, r *http.Request)

Handle is a method that implements http.HandlerFunc

type Minion

type Minion struct {
	Account           Account
	Keypair           *keypair.Full
	BotAccount        txnbuild.Account
	BotKeypair        *keypair.Full
	Horizon           *horizonclient.Client
	Network           string
	StartingBalance   string
	SubmitTransaction func(minion *Minion, hclient *horizonclient.Client, tx string) (*hProtocol.TransactionSuccess, error)
	// contains filtered or unexported fields
}

Minion contains a Stellar channel account and Go channels to communicate with friendbot.

func (*Minion) Run

func (minion *Minion) Run(destAddress string, resultChan chan SubmitResult)

Run reads a payment destination address and an output channel. It attempts to pay that address and submits the result to the channel.

type SubmitResult

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

SubmitResult is the result from the asynchronous tx submission.

Jump to

Keyboard shortcuts

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