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 ¶
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.
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.