README

horizonclient

horizonclient is a Stellar Go SDK package that provides client access to a horizon server. It supports all endpoints exposed by the horizon API.

This project is maintained by the Stellar Development Foundation.

Getting Started

This library is aimed at developers building Go applications that interact with the Stellar network. It allows users to query the network and submit transactions to the network. The recommended transaction builder for Go programmers is txnbuild. Together, these two libraries provide a complete Stellar SDK.

Prerequisites
  • Go 1.14 or greater
  • Modules to manage dependencies
Installing
  • go get github.com/stellar/go/clients/horizonclient
Usage
    ...
    import hClient "github.com/stellar/go/clients/horizonclient"
    ...

    // Use the default pubnet client
    client := hClient.DefaultPublicNetClient

    // Create an account request
    accountRequest := hClient.AccountRequest{AccountID: "GCLWGQPMKXQSPF776IU33AH4PZNOOWNAWGGKVTBQMIC5IMKUNP3E6NVU"}

    // Load the account detail from the network
    account, err := client.AccountDetail(accountRequest)
    if err != nil {
        fmt.Println(err)
        return
    }
    // Account contains information about the stellar account
    fmt.Print(account)

For more examples, refer to the documentation.

Running the tests

Run the unit tests from the package directory: go test

Contributing

Please read Code of Conduct to understand this project's communication rules.

To submit improvements and fixes to this library, please see CONTRIBUTING.

License

This project is licensed under the Apache License - see the LICENSE file for details.

Expand ▾ Collapse ▴

Documentation

Overview

    Package horizonclient provides client access to a Horizon server, allowing an application to post transactions and look up ledger information.

    This library provides an interface to the Stellar Horizon service. It supports the building of Go applications on top of the Stellar network (https://www.stellar.org/). Transactions may be constructed using the sister package to this one, txnbuild (https://github.com/stellar/go/tree/master/txnbuild), and then submitted with this client to any Horizon instance for processing onto the ledger. Together, these two libraries provide a complete Stellar SDK.

    For more information and further examples, see https://www.stellar.org/developers/go/reference/index.html.

    Index

    Examples

    Constants

    View Source
    const (
    	// OrderAsc represents an ascending order parameter
    	OrderAsc Order = "asc"
    	// OrderDesc represents an descending order parameter
    	OrderDesc Order = "desc"
    	// AssetType4 represents an asset type that is 4 characters long
    	AssetType4 AssetType = "credit_alphanum4"
    	// AssetType12 represents an asset type that is 12 characters long
    	AssetType12 AssetType = "credit_alphanum12"
    	// AssetTypeNative represents the asset type for Stellar Lumens (XLM)
    	AssetTypeNative AssetType = "native"
    )

    Variables

    View Source
    var (
    	// ErrResultCodesNotPopulated is the error returned from a call to
    	// ResultCodes() against a `Problem` value that doesn't have the
    	// "result_codes" extra field populated when it is expected to be.
    	ErrResultCodesNotPopulated = errors.New("result_codes not populated")
    
    	// ErrEnvelopeNotPopulated is the error returned from a call to
    	// Envelope() against a `Problem` value that doesn't have the
    	// "envelope_xdr" extra field populated when it is expected to be.
    	ErrEnvelopeNotPopulated = errors.New("envelope_xdr not populated")
    
    	// ErrResultNotPopulated is the error returned from a call to
    	// Result() against a `Problem` value that doesn't have the
    	// "result_xdr" extra field populated when it is expected to be.
    	ErrResultNotPopulated = errors.New("result_xdr not populated")
    
    	// ErrAccountRequiresMemo is the error returned from a call to checkMemoRequired
    	// when any of the destination accounts required a memo in the transaction.
    	ErrAccountRequiresMemo = errors.New("destination account requires a memo in the transaction")
    
    	// HorizonTimeout is the default number of nanoseconds before a request to horizon times out.
    	HorizonTimeout = 60 * time.Second
    
    	// MinuteResolution represents 1 minute used as `resolution` parameter in trade aggregation
    	MinuteResolution = time.Duration(1 * time.Minute)
    
    	// FiveMinuteResolution represents 5 minutes used as `resolution` parameter in trade aggregation
    	FiveMinuteResolution = time.Duration(5 * time.Minute)
    
    	// FifteenMinuteResolution represents 15 minutes used as `resolution` parameter in trade aggregation
    	FifteenMinuteResolution = time.Duration(15 * time.Minute)
    
    	// HourResolution represents 1 hour used as `resolution` parameter in trade aggregation
    	HourResolution = time.Duration(1 * time.Hour)
    
    	// DayResolution represents 1 day used as `resolution` parameter in trade aggregation
    	DayResolution = time.Duration(24 * time.Hour)
    
    	// WeekResolution represents 1 week used as `resolution` parameter in trade aggregation
    	WeekResolution = time.Duration(168 * time.Hour)
    )
    View Source
    var DefaultPublicNetClient = &Client{
    	HorizonURL:     "https://horizon.stellar.org/",
    	HTTP:           http.DefaultClient,
    	horizonTimeout: HorizonTimeout,
    }

      DefaultPublicNetClient is a default client to connect to public network.

      View Source
      var DefaultTestNetClient = &Client{
      	HorizonURL:     "https://horizon-testnet.stellar.org/",
      	HTTP:           http.DefaultClient,
      	horizonTimeout: HorizonTimeout,
      	isTestNet:      true,
      }

        DefaultTestNetClient is a default client to connect to test network.

        View Source
        var ServerTimeMap = make(map[string]ServerTimeRecord)

          ServerTimeMap holds the ServerTimeRecord for different horizon instances.

          Functions

          func IsNotFoundError

          func IsNotFoundError(err error) bool

            IsNotFoundError returns true if the error is a horizonclient.Error with a not_found problem indicating that the resource is not found on Horizon.

            Types

            type AccountRequest

            type AccountRequest struct {
            	AccountID string
            	DataKey   string
            }

              AccountRequest struct contains data for making requests to the show account endpoint of a horizon server. "AccountID" and "DataKey" fields should both be set when retrieving AccountData. When getting the AccountDetail, only "AccountID" needs to be set.

              func (AccountRequest) BuildURL

              func (ar AccountRequest) BuildURL() (endpoint string, err error)

                BuildURL creates the endpoint to be queried based on the data in the AccountRequest struct. If only AccountID is present, then the endpoint for account details is returned. If both AccounId and DataKey are present, then the endpoint for getting account data is returned

                type AccountsRequest

                type AccountsRequest struct {
                	Signer string
                	Asset  string
                	Order  Order
                	Cursor string
                	Limit  uint
                }

                  AccountsRequest struct contains data for making requests to the accounts endpoint of a horizon server. Either "Signer" or "Asset" fields should be set when retrieving Accounts. At the moment, you can't use both filters at the same time.

                  func (AccountsRequest) BuildURL

                  func (r AccountsRequest) BuildURL() (endpoint string, err error)

                    BuildURL creates the endpoint to be queried based on the data in the AccountsRequest struct. Either "Signer" or "Asset" fields should be set when retrieving Accounts. At the moment, you can't use both filters at the same time.

                    type AssetRequest

                    type AssetRequest struct {
                    	ForAssetCode   string
                    	ForAssetIssuer string
                    	Order          Order
                    	Cursor         string
                    	Limit          uint
                    }

                      AssetRequest struct contains data for getting asset details from a horizon server. If "ForAssetCode" and "ForAssetIssuer" are not set, it returns all assets. The query parameters (Order, Cursor and Limit) are optional. All or none can be set.

                      func (AssetRequest) BuildURL

                      func (ar AssetRequest) BuildURL() (endpoint string, err error)

                        BuildURL creates the endpoint to be queried based on the data in the AssetRequest struct. If no data is set, it defaults to the build the URL for all assets

                        type AssetType

                        type AssetType string

                          AssetType represents `asset_type` param in queries

                          type ClaimableBalanceRequest

                          type ClaimableBalanceRequest struct {
                          	ID       string
                          	Asset    string
                          	Sponsor  string
                          	Claimant string
                          }

                            ClaimableBalanceRequest contains data about claimable balances. The filters are optional (all added except Asset)

                            func (ClaimableBalanceRequest) BuildURL

                            func (cbr ClaimableBalanceRequest) BuildURL() (endpoint string, err error)

                              Creates the URL to either request a specific claimable balance (CB) by ID, or request all CBs, possibly filtered by asset, claimant, or sponsor.

                              type Client

                              type Client struct {
                              	// URL of Horizon server to connect
                              	HorizonURL string
                              
                              	// HTTP client to make requests with
                              	HTTP HTTP
                              
                              	// AppName is the name of the application using the horizonclient package
                              	AppName string
                              
                              	// AppVersion is the version of the application using the horizonclient package
                              	AppVersion string
                              	// contains filtered or unexported fields
                              }

                                Client struct contains data for creating a horizon client that connects to the stellar network.

                                func (*Client) AccountData

                                func (c *Client) AccountData(request AccountRequest) (accountData hProtocol.AccountData, err error)

                                  AccountData returns a single data associated with a given account See https://www.stellar.org/developers/horizon/reference/endpoints/data-for-account.html

                                  func (*Client) AccountDetail

                                  func (c *Client) AccountDetail(request AccountRequest) (account hProtocol.Account, err error)

                                    AccountDetail returns information for a single account. See https://www.stellar.org/developers/horizon/reference/endpoints/accounts-single.html

                                    Example
                                    Output:
                                    
                                    

                                    func (*Client) Accounts

                                    func (c *Client) Accounts(request AccountsRequest) (accounts hProtocol.AccountsPage, err error)

                                      Accounts returns accounts who have a given signer or have a trustline to an asset. See https://www.stellar.org/developers/horizon/reference/endpoints/accounts.html

                                      Example
                                      Output:
                                      
                                      

                                      func (*Client) Assets

                                      func (c *Client) Assets(request AssetRequest) (assets hProtocol.AssetsPage, err error)

                                        Assets returns asset information. See https://www.stellar.org/developers/horizon/reference/endpoints/assets-all.html

                                        Example
                                        Output:
                                        
                                        

                                        func (*Client) ClaimableBalance

                                        func (c *Client) ClaimableBalance(id string) (cb hProtocol.ClaimableBalance, err error)

                                          ClaimableBalance returns details about a *specific*, unique claimable balance.

                                          func (*Client) ClaimableBalances

                                          func (c *Client) ClaimableBalances(cbr ClaimableBalanceRequest) (cb hProtocol.ClaimableBalances, err error)

                                            ClaimableBalances returns details about available claimable balances, possibly filtered to a specific sponsor or other parameters.

                                            func (*Client) Effects

                                            func (c *Client) Effects(request EffectRequest) (effects effects.EffectsPage, err error)

                                              Effects returns effects(https://www.stellar.org/developers/horizon/reference/resources/effect.html) It can be used to return effects for an account, a ledger, an operation, a transaction and all effects on the network.

                                              Example
                                              Output:
                                              
                                              

                                              func (*Client) FeeStats

                                              func (c *Client) FeeStats() (feestats hProtocol.FeeStats, err error)

                                                FeeStats returns information about fees in the last 5 ledgers. See https://www.stellar.org/developers/horizon/reference/endpoints/fee-stats.html

                                                Example
                                                Output:
                                                
                                                

                                                func (*Client) FetchTimebounds

                                                func (c *Client) FetchTimebounds(seconds int64) (txnbuild.Timebounds, error)

                                                  FetchTimebounds provides timebounds for N seconds from now using the server time of the horizon instance. It defaults to localtime when the server time is not available. Note that this will generate your timebounds when you init the transaction, not when you build or submit the transaction! So give yourself enough time to get the transaction built and signed before submitting.

                                                  func (*Client) Fund

                                                  func (c *Client) Fund(addr string) (tx hProtocol.Transaction, err error)

                                                    Fund creates a new account funded from friendbot. It only works on test networks. See https://www.stellar.org/developers/guides/get-started/create-account.html for more information.

                                                    Example
                                                    Output:
                                                    
                                                    

                                                    func (*Client) HomeDomainForAccount

                                                    func (c *Client) HomeDomainForAccount(aid string) (string, error)

                                                      HomeDomainForAccount returns the home domain for a single account.

                                                      func (*Client) HorizonTimeout

                                                      func (c *Client) HorizonTimeout() time.Duration

                                                        HorizonTimeout returns the current timeout for a horizon client

                                                        func (*Client) LedgerDetail

                                                        func (c *Client) LedgerDetail(sequence uint32) (ledger hProtocol.Ledger, err error)

                                                          LedgerDetail returns information about a particular ledger for a given sequence number See https://www.stellar.org/developers/horizon/reference/endpoints/ledgers-single.html

                                                          Example
                                                          Output:
                                                          
                                                          

                                                          func (*Client) Ledgers

                                                          func (c *Client) Ledgers(request LedgerRequest) (ledgers hProtocol.LedgersPage, err error)

                                                            Ledgers returns information about all ledgers. See https://www.stellar.org/developers/horizon/reference/endpoints/ledgers-all.html

                                                            func (*Client) NextAccountsPage

                                                            func (c *Client) NextAccountsPage(page hProtocol.AccountsPage) (accounts hProtocol.AccountsPage, err error)

                                                              NextAccountsPage returns the next page of accounts.

                                                              Example
                                                              Output:
                                                              
                                                              

                                                              func (*Client) NextAssetsPage

                                                              func (c *Client) NextAssetsPage(page hProtocol.AssetsPage) (assets hProtocol.AssetsPage, err error)

                                                                NextAssetsPage returns the next page of assets.

                                                                Example
                                                                Output:
                                                                
                                                                

                                                                func (*Client) NextEffectsPage

                                                                func (c *Client) NextEffectsPage(page effects.EffectsPage) (efp effects.EffectsPage, err error)

                                                                  NextEffectsPage returns the next page of effects.

                                                                  Example
                                                                  Output:
                                                                  
                                                                  

                                                                  func (*Client) NextLedgersPage

                                                                  func (c *Client) NextLedgersPage(page hProtocol.LedgersPage) (ledgers hProtocol.LedgersPage, err error)

                                                                    NextLedgersPage returns the next page of ledgers.

                                                                    Example
                                                                    Output:
                                                                    
                                                                    

                                                                    func (*Client) NextOffersPage

                                                                    func (c *Client) NextOffersPage(page hProtocol.OffersPage) (offers hProtocol.OffersPage, err error)

                                                                      NextOffersPage returns the next page of offers.

                                                                      Example
                                                                      Output:
                                                                      
                                                                      

                                                                      func (*Client) NextOperationsPage

                                                                      func (c *Client) NextOperationsPage(page operations.OperationsPage) (operations operations.OperationsPage, err error)

                                                                        NextOperationsPage returns the next page of operations.

                                                                        Example
                                                                        Output:
                                                                        
                                                                        

                                                                        func (*Client) NextPaymentsPage

                                                                        func (c *Client) NextPaymentsPage(page operations.OperationsPage) (operations.OperationsPage, error)

                                                                          NextPaymentsPage returns the next page of payments.

                                                                          func (*Client) NextTradeAggregationsPage

                                                                          func (c *Client) NextTradeAggregationsPage(page hProtocol.TradeAggregationsPage) (ta hProtocol.TradeAggregationsPage, err error)

                                                                            NextTradeAggregationsPage returns the next page of trade aggregations from the current trade aggregations response.

                                                                            Example
                                                                            Output:
                                                                            
                                                                            

                                                                            func (*Client) NextTradesPage

                                                                            func (c *Client) NextTradesPage(page hProtocol.TradesPage) (trades hProtocol.TradesPage, err error)

                                                                              NextTradesPage returns the next page of trades.

                                                                              Example
                                                                              Output:
                                                                              
                                                                              

                                                                              func (*Client) NextTransactionsPage

                                                                              func (c *Client) NextTransactionsPage(page hProtocol.TransactionsPage) (transactions hProtocol.TransactionsPage, err error)

                                                                                NextTransactionsPage returns the next page of transactions.

                                                                                Example
                                                                                Output:
                                                                                
                                                                                

                                                                                func (*Client) OfferDetails

                                                                                func (c *Client) OfferDetails(offerID string) (offer hProtocol.Offer, err error)

                                                                                  OfferDetails returns information for a single offer. See https://www.stellar.org/developers/horizon/reference/endpoints/offer-details.html

                                                                                  Example
                                                                                  Output:
                                                                                  
                                                                                  

                                                                                  func (*Client) Offers

                                                                                  func (c *Client) Offers(request OfferRequest) (offers hProtocol.OffersPage, err error)

                                                                                    Offers returns information about offers made on the SDEX. See https://www.stellar.org/developers/horizon/reference/endpoints/offers-for-account.html

                                                                                    Example
                                                                                    Output:
                                                                                    
                                                                                    

                                                                                    func (*Client) OperationDetail

                                                                                    func (c *Client) OperationDetail(id string) (ops operations.Operation, err error)

                                                                                      OperationDetail returns a single stellar operation for a given operation id See https://www.stellar.org/developers/horizon/reference/resources/operation.html

                                                                                      Example
                                                                                      Output:
                                                                                      
                                                                                      

                                                                                      func (*Client) Operations

                                                                                      func (c *Client) Operations(request OperationRequest) (ops operations.OperationsPage, err error)

                                                                                        Operations returns stellar operations (https://www.stellar.org/developers/horizon/reference/resources/operation.html) It can be used to return operations for an account, a ledger, a transaction and all operations on the network.

                                                                                        Example
                                                                                        Output:
                                                                                        
                                                                                        

                                                                                        func (*Client) OrderBook

                                                                                        func (c *Client) OrderBook(request OrderBookRequest) (obs hProtocol.OrderBookSummary, err error)

                                                                                          OrderBook returns the orderbook for an asset pair (https://www.stellar.org/developers/horizon/reference/resources/orderbook.html)

                                                                                          Example
                                                                                          Output:
                                                                                          
                                                                                          

                                                                                          func (*Client) Paths

                                                                                          func (c *Client) Paths(request PathsRequest) (paths hProtocol.PathsPage, err error)

                                                                                            Paths returns the available paths to make a strict receive path payment. See https://www.stellar.org/developers/horizon/reference/endpoints/path-finding-strict-receive.html This function is an alias for `client.StrictReceivePaths` and will be deprecated, use `client.StrictReceivePaths` instead.

                                                                                            Example
                                                                                            Output:
                                                                                            
                                                                                            

                                                                                            func (*Client) Payments

                                                                                            func (c *Client) Payments(request OperationRequest) (ops operations.OperationsPage, err error)

                                                                                              Payments returns stellar account_merge, create_account, path payment and payment operations. It can be used to return payments for an account, a ledger, a transaction and all payments on the network.

                                                                                              Example
                                                                                              Output:
                                                                                              
                                                                                              

                                                                                              func (*Client) PrevAssetsPage

                                                                                              func (c *Client) PrevAssetsPage(page hProtocol.AssetsPage) (assets hProtocol.AssetsPage, err error)

                                                                                                PrevAssetsPage returns the previous page of assets.

                                                                                                Example
                                                                                                Output:
                                                                                                
                                                                                                

                                                                                                func (*Client) PrevEffectsPage

                                                                                                func (c *Client) PrevEffectsPage(page effects.EffectsPage) (efp effects.EffectsPage, err error)

                                                                                                  PrevEffectsPage returns the previous page of effects.

                                                                                                  Example
                                                                                                  Output:
                                                                                                  
                                                                                                  

                                                                                                  func (*Client) PrevLedgersPage

                                                                                                  func (c *Client) PrevLedgersPage(page hProtocol.LedgersPage) (ledgers hProtocol.LedgersPage, err error)

                                                                                                    PrevLedgersPage returns the previous page of ledgers.

                                                                                                    Example
                                                                                                    Output:
                                                                                                    
                                                                                                    

                                                                                                    func (*Client) PrevOffersPage

                                                                                                    func (c *Client) PrevOffersPage(page hProtocol.OffersPage) (offers hProtocol.OffersPage, err error)

                                                                                                      PrevOffersPage returns the previous page of offers.

                                                                                                      Example
                                                                                                      Output:
                                                                                                      
                                                                                                      

                                                                                                      func (*Client) PrevOperationsPage

                                                                                                      func (c *Client) PrevOperationsPage(page operations.OperationsPage) (operations operations.OperationsPage, err error)

                                                                                                        PrevOperationsPage returns the previous page of operations.

                                                                                                        Example
                                                                                                        Output:
                                                                                                        
                                                                                                        

                                                                                                        func (*Client) PrevPaymentsPage

                                                                                                        func (c *Client) PrevPaymentsPage(page operations.OperationsPage) (operations.OperationsPage, error)

                                                                                                          PrevPaymentsPage returns the previous page of payments.

                                                                                                          func (*Client) PrevTradeAggregationsPage

                                                                                                          func (c *Client) PrevTradeAggregationsPage(page hProtocol.TradeAggregationsPage) (ta hProtocol.TradeAggregationsPage, err error)

                                                                                                            PrevTradeAggregationsPage returns the previous page of trade aggregations from the current trade aggregations response.

                                                                                                            Example
                                                                                                            Output:
                                                                                                            
                                                                                                            

                                                                                                            func (*Client) PrevTradesPage

                                                                                                            func (c *Client) PrevTradesPage(page hProtocol.TradesPage) (trades hProtocol.TradesPage, err error)

                                                                                                              PrevTradesPage returns the previous page of trades.

                                                                                                              Example
                                                                                                              Output:
                                                                                                              
                                                                                                              

                                                                                                              func (*Client) PrevTransactionsPage

                                                                                                              func (c *Client) PrevTransactionsPage(page hProtocol.TransactionsPage) (transactions hProtocol.TransactionsPage, err error)

                                                                                                                PrevTransactionsPage returns the previous page of transactions.

                                                                                                                Example
                                                                                                                Output:
                                                                                                                
                                                                                                                

                                                                                                                func (*Client) Root

                                                                                                                func (c *Client) Root() (root hProtocol.Root, err error)

                                                                                                                  Root loads the root endpoint of horizon

                                                                                                                  Example
                                                                                                                  Output:
                                                                                                                  
                                                                                                                  

                                                                                                                  func (*Client) SetHorizonTimeout

                                                                                                                  func (c *Client) SetHorizonTimeout(t time.Duration) *Client

                                                                                                                    SetHorizonTimeout allows users to set the timeout before a horizon request is cancelled. The timeout is specified as a time.Duration which is in nanoseconds.

                                                                                                                    Example
                                                                                                                    Output:
                                                                                                                    
                                                                                                                    

                                                                                                                    func (*Client) StreamEffects

                                                                                                                    func (c *Client) StreamEffects(ctx context.Context, request EffectRequest, handler EffectHandler) error

                                                                                                                      StreamEffects streams horizon effects. It can be used to stream all effects or account specific effects. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. EffectHandler is a user-supplied function that is executed for each streamed transaction received.

                                                                                                                      Example
                                                                                                                      Output:
                                                                                                                      
                                                                                                                      

                                                                                                                      func (*Client) StreamLedgers

                                                                                                                      func (c *Client) StreamLedgers(ctx context.Context, request LedgerRequest, handler LedgerHandler) error

                                                                                                                        StreamLedgers streams stellar ledgers. It can be used to stream all ledgers. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. LedgerHandler is a user-supplied function that is executed for each streamed ledger received.

                                                                                                                        Example
                                                                                                                        Output:
                                                                                                                        
                                                                                                                        

                                                                                                                        func (*Client) StreamOffers

                                                                                                                        func (c *Client) StreamOffers(ctx context.Context, request OfferRequest, handler OfferHandler) error

                                                                                                                          StreamOffers streams offers processed by the Stellar network for an account. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. OfferHandler is a user-supplied function that is executed for each streamed offer received.

                                                                                                                          Example
                                                                                                                          Output:
                                                                                                                          
                                                                                                                          

                                                                                                                          func (*Client) StreamOperations

                                                                                                                          func (c *Client) StreamOperations(ctx context.Context, request OperationRequest, handler OperationHandler) error

                                                                                                                            StreamOperations streams stellar operations. It can be used to stream all operations or operations for an account. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. OperationHandler is a user-supplied function that is executed for each streamed operation received.

                                                                                                                            Example
                                                                                                                            Output:
                                                                                                                            
                                                                                                                            

                                                                                                                            func (*Client) StreamOrderBooks

                                                                                                                            func (c *Client) StreamOrderBooks(ctx context.Context, request OrderBookRequest, handler OrderBookHandler) error

                                                                                                                              StreamOrderBooks streams the orderbook for a given asset pair. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. OrderBookHandler is a user-supplied function that is executed for each streamed order received.

                                                                                                                              Example
                                                                                                                              Output:
                                                                                                                              
                                                                                                                              

                                                                                                                              func (*Client) StreamPayments

                                                                                                                              func (c *Client) StreamPayments(ctx context.Context, request OperationRequest, handler OperationHandler) error

                                                                                                                                StreamPayments streams stellar payments. It can be used to stream all payments or payments for an account. Payments include create_account, payment, path_payment and account_merge operations. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. OperationHandler is a user-supplied function that is executed for each streamed operation received.

                                                                                                                                Example
                                                                                                                                Output:
                                                                                                                                
                                                                                                                                

                                                                                                                                func (*Client) StreamTrades

                                                                                                                                func (c *Client) StreamTrades(ctx context.Context, request TradeRequest, handler TradeHandler) (err error)

                                                                                                                                  StreamTrades streams executed trades. It can be used to stream all trades, trades for an account and trades for an offer. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. TradeHandler is a user-supplied function that is executed for each streamed trade received.

                                                                                                                                  Example
                                                                                                                                  Output:
                                                                                                                                  
                                                                                                                                  

                                                                                                                                  func (*Client) StreamTransactions

                                                                                                                                  func (c *Client) StreamTransactions(ctx context.Context, request TransactionRequest, handler TransactionHandler) error

                                                                                                                                    StreamTransactions streams processed transactions. It can be used to stream all transactions and transactions for an account. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. TransactionHandler is a user-supplied function that is executed for each streamed transaction received.

                                                                                                                                    Example
                                                                                                                                    Output:
                                                                                                                                    
                                                                                                                                    

                                                                                                                                    func (*Client) StrictReceivePaths

                                                                                                                                    func (c *Client) StrictReceivePaths(request PathsRequest) (paths hProtocol.PathsPage, err error)

                                                                                                                                      StrictReceivePaths returns the available paths to make a strict receive path payment. See https://www.stellar.org/developers/horizon/reference/endpoints/path-finding-strict-receive.html

                                                                                                                                      func (*Client) StrictSendPaths

                                                                                                                                      func (c *Client) StrictSendPaths(request StrictSendPathsRequest) (paths hProtocol.PathsPage, err error)

                                                                                                                                        StrictSendPaths returns the available paths to make a strict send path payment. See https://www.stellar.org/developers/horizon/reference/endpoints/path-finding-strict-send.html

                                                                                                                                        Example
                                                                                                                                        Output:
                                                                                                                                        
                                                                                                                                        

                                                                                                                                        func (*Client) SubmitFeeBumpTransaction

                                                                                                                                        func (c *Client) SubmitFeeBumpTransaction(transaction *txnbuild.FeeBumpTransaction) (tx hProtocol.Transaction, err error)

                                                                                                                                          SubmitFeeBumpTransaction submits a fee bump transaction to the network. err can be either an error object or a horizon.Error object.

                                                                                                                                          This function will always check if the destination account requires a memo in the transaction as defined in SEP0029: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md

                                                                                                                                          If you want to skip this check, use SubmitTransactionWithOptions.

                                                                                                                                          See https://www.stellar.org/developers/horizon/reference/endpoints/transactions-create.html

                                                                                                                                          Example
                                                                                                                                          Output:
                                                                                                                                          
                                                                                                                                          

                                                                                                                                          func (*Client) SubmitFeeBumpTransactionWithOptions

                                                                                                                                          func (c *Client) SubmitFeeBumpTransactionWithOptions(transaction *txnbuild.FeeBumpTransaction, opts SubmitTxOpts) (tx hProtocol.Transaction, err error)

                                                                                                                                            SubmitFeeBumpTransactionWithOptions submits a fee bump transaction to the network, allowing you to pass SubmitTxOpts. err can be either an error object or a horizon.Error object.

                                                                                                                                            See https://www.stellar.org/developers/horizon/reference/endpoints/transactions-create.html

                                                                                                                                            Example
                                                                                                                                            Output:
                                                                                                                                            
                                                                                                                                            

                                                                                                                                            func (*Client) SubmitTransaction

                                                                                                                                            func (c *Client) SubmitTransaction(transaction *txnbuild.Transaction) (tx hProtocol.Transaction, err error)

                                                                                                                                              SubmitTransaction submits a transaction to the network. err can be either an error object or a horizon.Error object.

                                                                                                                                              This function will always check if the destination account requires a memo in the transaction as defined in SEP0029: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md

                                                                                                                                              If you want to skip this check, use SubmitTransactionWithOptions.

                                                                                                                                              See https://www.stellar.org/developers/horizon/reference/endpoints/transactions-create.html

                                                                                                                                              Example
                                                                                                                                              Output:
                                                                                                                                              
                                                                                                                                              

                                                                                                                                              func (*Client) SubmitTransactionWithOptions

                                                                                                                                              func (c *Client) SubmitTransactionWithOptions(transaction *txnbuild.Transaction, opts SubmitTxOpts) (tx hProtocol.Transaction, err error)

                                                                                                                                                SubmitTransactionWithOptions submits a transaction to the network, allowing you to pass SubmitTxOpts. err can be either an error object or a horizon.Error object.

                                                                                                                                                See https://www.stellar.org/developers/horizon/reference/endpoints/transactions-create.html

                                                                                                                                                Example
                                                                                                                                                Output:
                                                                                                                                                
                                                                                                                                                
                                                                                                                                                Example (Skip_memo_required_check)
                                                                                                                                                Output:
                                                                                                                                                
                                                                                                                                                

                                                                                                                                                func (*Client) SubmitTransactionXDR

                                                                                                                                                func (c *Client) SubmitTransactionXDR(transactionXdr string) (tx hProtocol.Transaction,
                                                                                                                                                	err error)

                                                                                                                                                  SubmitTransactionXDR submits a transaction represented as a base64 XDR string to the network. err can be either error object or horizon.Error object. See https://www.stellar.org/developers/horizon/reference/endpoints/transactions-create.html

                                                                                                                                                  Example
                                                                                                                                                  Output:
                                                                                                                                                  
                                                                                                                                                  

                                                                                                                                                  func (*Client) TradeAggregations

                                                                                                                                                  func (c *Client) TradeAggregations(request TradeAggregationRequest) (tds hProtocol.TradeAggregationsPage, err error)

                                                                                                                                                    TradeAggregations returns stellar trade aggregations (https://www.stellar.org/developers/horizon/reference/resources/trade_aggregation.html)

                                                                                                                                                    Example
                                                                                                                                                    Output:
                                                                                                                                                    
                                                                                                                                                    

                                                                                                                                                    func (*Client) Trades

                                                                                                                                                    func (c *Client) Trades(request TradeRequest) (tds hProtocol.TradesPage, err error)

                                                                                                                                                      Trades returns stellar trades (https://www.stellar.org/developers/horizon/reference/resources/trade.html) It can be used to return trades for an account, an offer and all trades on the network.

                                                                                                                                                      Example
                                                                                                                                                      Output:
                                                                                                                                                      
                                                                                                                                                      

                                                                                                                                                      func (*Client) TransactionDetail

                                                                                                                                                      func (c *Client) TransactionDetail(txHash string) (tx hProtocol.Transaction, err error)

                                                                                                                                                        TransactionDetail returns information about a particular transaction for a given transaction hash See https://www.stellar.org/developers/horizon/reference/endpoints/transactions-single.html

                                                                                                                                                        func (*Client) Transactions

                                                                                                                                                        func (c *Client) Transactions(request TransactionRequest) (txs hProtocol.TransactionsPage, err error)

                                                                                                                                                          Transactions returns stellar transactions (https://www.stellar.org/developers/horizon/reference/resources/transaction.html) It can be used to return transactions for an account, a ledger,and all transactions on the network.

                                                                                                                                                          Example
                                                                                                                                                          Output:
                                                                                                                                                          
                                                                                                                                                          

                                                                                                                                                          func (*Client) Version

                                                                                                                                                          func (c *Client) Version() string

                                                                                                                                                            Version returns the current version.

                                                                                                                                                            type ClientInterface

                                                                                                                                                            type ClientInterface interface {
                                                                                                                                                            	Accounts(request AccountsRequest) (hProtocol.AccountsPage, error)
                                                                                                                                                            	AccountDetail(request AccountRequest) (hProtocol.Account, error)
                                                                                                                                                            	AccountData(request AccountRequest) (hProtocol.AccountData, error)
                                                                                                                                                            	Effects(request EffectRequest) (effects.EffectsPage, error)
                                                                                                                                                            	Assets(request AssetRequest) (hProtocol.AssetsPage, error)
                                                                                                                                                            	Ledgers(request LedgerRequest) (hProtocol.LedgersPage, error)
                                                                                                                                                            	LedgerDetail(sequence uint32) (hProtocol.Ledger, error)
                                                                                                                                                            	FeeStats() (hProtocol.FeeStats, error)
                                                                                                                                                            	Offers(request OfferRequest) (hProtocol.OffersPage, error)
                                                                                                                                                            	OfferDetails(offerID string) (offer hProtocol.Offer, err error)
                                                                                                                                                            	Operations(request OperationRequest) (operations.OperationsPage, error)
                                                                                                                                                            	OperationDetail(id string) (operations.Operation, error)
                                                                                                                                                            	SubmitTransactionXDR(transactionXdr string) (hProtocol.Transaction, error)
                                                                                                                                                            	SubmitFeeBumpTransactionWithOptions(transaction *txnbuild.FeeBumpTransaction, opts SubmitTxOpts) (hProtocol.Transaction, error)
                                                                                                                                                            	SubmitTransactionWithOptions(transaction *txnbuild.Transaction, opts SubmitTxOpts) (hProtocol.Transaction, error)
                                                                                                                                                            	SubmitFeeBumpTransaction(transaction *txnbuild.FeeBumpTransaction) (hProtocol.Transaction, error)
                                                                                                                                                            	SubmitTransaction(transaction *txnbuild.Transaction) (hProtocol.Transaction, error)
                                                                                                                                                            	Transactions(request TransactionRequest) (hProtocol.TransactionsPage, error)
                                                                                                                                                            	TransactionDetail(txHash string) (hProtocol.Transaction, error)
                                                                                                                                                            	OrderBook(request OrderBookRequest) (hProtocol.OrderBookSummary, error)
                                                                                                                                                            	Paths(request PathsRequest) (hProtocol.PathsPage, error)
                                                                                                                                                            	Payments(request OperationRequest) (operations.OperationsPage, error)
                                                                                                                                                            	TradeAggregations(request TradeAggregationRequest) (hProtocol.TradeAggregationsPage, error)
                                                                                                                                                            	Trades(request TradeRequest) (hProtocol.TradesPage, error)
                                                                                                                                                            	Fund(addr string) (hProtocol.Transaction, error)
                                                                                                                                                            	StreamTransactions(ctx context.Context, request TransactionRequest, handler TransactionHandler) error
                                                                                                                                                            	StreamTrades(ctx context.Context, request TradeRequest, handler TradeHandler) error
                                                                                                                                                            	StreamEffects(ctx context.Context, request EffectRequest, handler EffectHandler) error
                                                                                                                                                            	StreamOperations(ctx context.Context, request OperationRequest, handler OperationHandler) error
                                                                                                                                                            	StreamPayments(ctx context.Context, request OperationRequest, handler OperationHandler) error
                                                                                                                                                            	StreamOffers(ctx context.Context, request OfferRequest, handler OfferHandler) error
                                                                                                                                                            	StreamLedgers(ctx context.Context, request LedgerRequest, handler LedgerHandler) error
                                                                                                                                                            	StreamOrderBooks(ctx context.Context, request OrderBookRequest, handler OrderBookHandler) error
                                                                                                                                                            	Root() (hProtocol.Root, error)
                                                                                                                                                            	NextAccountsPage(hProtocol.AccountsPage) (hProtocol.AccountsPage, error)
                                                                                                                                                            	NextAssetsPage(hProtocol.AssetsPage) (hProtocol.AssetsPage, error)
                                                                                                                                                            	PrevAssetsPage(hProtocol.AssetsPage) (hProtocol.AssetsPage, error)
                                                                                                                                                            	NextLedgersPage(hProtocol.LedgersPage) (hProtocol.LedgersPage, error)
                                                                                                                                                            	PrevLedgersPage(hProtocol.LedgersPage) (hProtocol.LedgersPage, error)
                                                                                                                                                            	NextEffectsPage(effects.EffectsPage) (effects.EffectsPage, error)
                                                                                                                                                            	PrevEffectsPage(effects.EffectsPage) (effects.EffectsPage, error)
                                                                                                                                                            	NextTransactionsPage(hProtocol.TransactionsPage) (hProtocol.TransactionsPage, error)
                                                                                                                                                            	PrevTransactionsPage(hProtocol.TransactionsPage) (hProtocol.TransactionsPage, error)
                                                                                                                                                            	NextOperationsPage(operations.OperationsPage) (operations.OperationsPage, error)
                                                                                                                                                            	PrevOperationsPage(operations.OperationsPage) (operations.OperationsPage, error)
                                                                                                                                                            	NextPaymentsPage(operations.OperationsPage) (operations.OperationsPage, error)
                                                                                                                                                            	PrevPaymentsPage(operations.OperationsPage) (operations.OperationsPage, error)
                                                                                                                                                            	NextOffersPage(hProtocol.OffersPage) (hProtocol.OffersPage, error)
                                                                                                                                                            	PrevOffersPage(hProtocol.OffersPage) (hProtocol.OffersPage, error)
                                                                                                                                                            	NextTradesPage(hProtocol.TradesPage) (hProtocol.TradesPage, error)
                                                                                                                                                            	PrevTradesPage(hProtocol.TradesPage) (hProtocol.TradesPage, error)
                                                                                                                                                            	HomeDomainForAccount(aid string) (string, error)
                                                                                                                                                            	NextTradeAggregationsPage(hProtocol.TradeAggregationsPage) (hProtocol.TradeAggregationsPage, error)
                                                                                                                                                            	PrevTradeAggregationsPage(hProtocol.TradeAggregationsPage) (hProtocol.TradeAggregationsPage, error)
                                                                                                                                                            }

                                                                                                                                                              ClientInterface contains methods implemented by the horizon client

                                                                                                                                                              type EffectHandler

                                                                                                                                                              type EffectHandler func(effects.Effect)

                                                                                                                                                                EffectHandler is a function that is called when a new effect is received

                                                                                                                                                                type EffectRequest

                                                                                                                                                                type EffectRequest struct {
                                                                                                                                                                	ForAccount     string
                                                                                                                                                                	ForLedger      string
                                                                                                                                                                	ForOperation   string
                                                                                                                                                                	ForTransaction string
                                                                                                                                                                	Order          Order
                                                                                                                                                                	Cursor         string
                                                                                                                                                                	Limit          uint
                                                                                                                                                                }

                                                                                                                                                                  EffectRequest struct contains data for getting effects from a horizon server. "ForAccount", "ForLedger", "ForOperation" and "ForTransaction": Not more than one of these can be set at a time. If none are set, the default is to return all effects. The query parameters (Order, Cursor and Limit) are optional. All or none can be set.

                                                                                                                                                                  func (EffectRequest) BuildURL

                                                                                                                                                                  func (er EffectRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                    BuildURL creates the endpoint to be queried based on the data in the EffectRequest struct. If no data is set, it defaults to the build the URL for all effects

                                                                                                                                                                    func (EffectRequest) StreamEffects

                                                                                                                                                                    func (er EffectRequest) StreamEffects(ctx context.Context, client *Client, handler EffectHandler) error

                                                                                                                                                                      StreamEffects streams horizon effects. It can be used to stream all effects or account specific effects. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. EffectHandler is a user-supplied function that is executed for each streamed effect received.

                                                                                                                                                                      type Error

                                                                                                                                                                      type Error struct {
                                                                                                                                                                      	Response *http.Response
                                                                                                                                                                      	Problem  problem.P
                                                                                                                                                                      }

                                                                                                                                                                        Error struct contains the problem returned by Horizon

                                                                                                                                                                        func GetError

                                                                                                                                                                        func GetError(err error) *Error

                                                                                                                                                                          GetError returns an error that can be interpreted as a horizon-specific error. If err cannot be interpreted as a horizon-specific error, a nil error is returned. The caller should still check whether err is nil.

                                                                                                                                                                          func (*Error) Envelope

                                                                                                                                                                          func (herr *Error) Envelope() (*xdr.TransactionEnvelope, error)

                                                                                                                                                                            Envelope extracts the transaction envelope that triggered this error from the extra fields.

                                                                                                                                                                            func (*Error) EnvelopeXDR

                                                                                                                                                                            func (herr *Error) EnvelopeXDR() (string, error)

                                                                                                                                                                              EnvelopeXDR returns the base 64 serialised string representation of the XDR envelope. This can be stored, or decoded in the Stellar Laboratory XDR viewer for example.

                                                                                                                                                                              func (Error) Error

                                                                                                                                                                              func (herr Error) Error() string

                                                                                                                                                                              func (*Error) ResultCodes

                                                                                                                                                                              func (herr *Error) ResultCodes() (*hProtocol.TransactionResultCodes, error)

                                                                                                                                                                                ResultCodes extracts a result code summary from the error, if possible.

                                                                                                                                                                                func (*Error) ResultString

                                                                                                                                                                                func (herr *Error) ResultString() (string, error)

                                                                                                                                                                                  ResultString extracts the transaction result as a string.

                                                                                                                                                                                  type HTTP

                                                                                                                                                                                  type HTTP interface {
                                                                                                                                                                                  	Do(req *http.Request) (resp *http.Response, err error)
                                                                                                                                                                                  	Get(url string) (resp *http.Response, err error)
                                                                                                                                                                                  	PostForm(url string, data url.Values) (resp *http.Response, err error)
                                                                                                                                                                                  }

                                                                                                                                                                                    HTTP represents the HTTP client that a horizon client uses to communicate

                                                                                                                                                                                    type HorizonRequest

                                                                                                                                                                                    type HorizonRequest interface {
                                                                                                                                                                                    	BuildURL() (string, error)
                                                                                                                                                                                    }

                                                                                                                                                                                      HorizonRequest contains methods implemented by request structs for horizon endpoints.

                                                                                                                                                                                      type LedgerHandler

                                                                                                                                                                                      type LedgerHandler func(hProtocol.Ledger)

                                                                                                                                                                                        LedgerHandler is a function that is called when a new ledger is received

                                                                                                                                                                                        type LedgerRequest

                                                                                                                                                                                        type LedgerRequest struct {
                                                                                                                                                                                        	Order  Order
                                                                                                                                                                                        	Cursor string
                                                                                                                                                                                        	Limit  uint
                                                                                                                                                                                        	// contains filtered or unexported fields
                                                                                                                                                                                        }

                                                                                                                                                                                          LedgerRequest struct contains data for getting ledger details from a horizon server. The query parameters (Order, Cursor and Limit) are optional. All or none can be set.

                                                                                                                                                                                          func (LedgerRequest) BuildURL

                                                                                                                                                                                          func (lr LedgerRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                            BuildURL creates the endpoint to be queried based on the data in the LedgerRequest struct. If no data is set, it defaults to the build the URL for all ledgers

                                                                                                                                                                                            func (LedgerRequest) StreamLedgers

                                                                                                                                                                                            func (lr LedgerRequest) StreamLedgers(ctx context.Context, client *Client,
                                                                                                                                                                                            	handler LedgerHandler) (err error)

                                                                                                                                                                                              StreamLedgers streams stellar ledgers. It can be used to stream all ledgers. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. LedgerHandler is a user-supplied function that is executed for each streamed ledger received.

                                                                                                                                                                                              type MockClient

                                                                                                                                                                                              type MockClient struct {
                                                                                                                                                                                              	mock.Mock
                                                                                                                                                                                              }

                                                                                                                                                                                                MockClient is a mockable horizon client.

                                                                                                                                                                                                func (*MockClient) AccountData

                                                                                                                                                                                                func (m *MockClient) AccountData(request AccountRequest) (hProtocol.AccountData, error)

                                                                                                                                                                                                  AccountData is a mocking method

                                                                                                                                                                                                  func (*MockClient) AccountDetail

                                                                                                                                                                                                  func (m *MockClient) AccountDetail(request AccountRequest) (hProtocol.Account, error)

                                                                                                                                                                                                    AccountDetail is a mocking method

                                                                                                                                                                                                    func (*MockClient) Accounts

                                                                                                                                                                                                    func (m *MockClient) Accounts(request AccountsRequest) (hProtocol.AccountsPage, error)

                                                                                                                                                                                                      Accounts is a mocking method

                                                                                                                                                                                                      func (*MockClient) Assets

                                                                                                                                                                                                      func (m *MockClient) Assets(request AssetRequest) (hProtocol.AssetsPage, error)

                                                                                                                                                                                                        Assets is a mocking method

                                                                                                                                                                                                        func (*MockClient) Effects

                                                                                                                                                                                                        func (m *MockClient) Effects(request EffectRequest) (effects.EffectsPage, error)

                                                                                                                                                                                                          Effects is a mocking method

                                                                                                                                                                                                          func (*MockClient) FeeStats

                                                                                                                                                                                                          func (m *MockClient) FeeStats() (hProtocol.FeeStats, error)

                                                                                                                                                                                                            FeeStats is a mocking method

                                                                                                                                                                                                            func (*MockClient) Fund

                                                                                                                                                                                                            func (m *MockClient) Fund(addr string) (hProtocol.Transaction, error)

                                                                                                                                                                                                              Fund is a mocking method

                                                                                                                                                                                                              func (*MockClient) HomeDomainForAccount

                                                                                                                                                                                                              func (m *MockClient) HomeDomainForAccount(aid string) (string, error)

                                                                                                                                                                                                                HomeDomainForAccount is a mocking method

                                                                                                                                                                                                                func (*MockClient) LedgerDetail

                                                                                                                                                                                                                func (m *MockClient) LedgerDetail(sequence uint32) (hProtocol.Ledger, error)

                                                                                                                                                                                                                  LedgerDetail is a mocking method

                                                                                                                                                                                                                  func (*MockClient) Ledgers

                                                                                                                                                                                                                  func (m *MockClient) Ledgers(request LedgerRequest) (hProtocol.LedgersPage, error)

                                                                                                                                                                                                                    Ledgers is a mocking method

                                                                                                                                                                                                                    func (*MockClient) NextAccountsPage

                                                                                                                                                                                                                    func (m *MockClient) NextAccountsPage(page hProtocol.AccountsPage) (hProtocol.AccountsPage, error)

                                                                                                                                                                                                                      NextAccountsPage is a mocking method

                                                                                                                                                                                                                      func (*MockClient) NextAssetsPage

                                                                                                                                                                                                                      func (m *MockClient) NextAssetsPage(page hProtocol.AssetsPage) (hProtocol.AssetsPage, error)

                                                                                                                                                                                                                        NextAssetsPage is a mocking method

                                                                                                                                                                                                                        func (*MockClient) NextEffectsPage

                                                                                                                                                                                                                        func (m *MockClient) NextEffectsPage(page effects.EffectsPage) (effects.EffectsPage, error)

                                                                                                                                                                                                                          NextEffectsPage is a mocking method

                                                                                                                                                                                                                          func (*MockClient) NextLedgersPage

                                                                                                                                                                                                                          func (m *MockClient) NextLedgersPage(page hProtocol.LedgersPage) (hProtocol.LedgersPage, error)

                                                                                                                                                                                                                            NextLedgersPage is a mocking method

                                                                                                                                                                                                                            func (*MockClient) NextOffersPage

                                                                                                                                                                                                                            func (m *MockClient) NextOffersPage(page hProtocol.OffersPage) (hProtocol.OffersPage, error)

                                                                                                                                                                                                                              NextOffersPage is a mocking method

                                                                                                                                                                                                                              func (*MockClient) NextOperationsPage

                                                                                                                                                                                                                              func (m *MockClient) NextOperationsPage(page operations.OperationsPage) (operations.OperationsPage, error)

                                                                                                                                                                                                                                NextOperationsPage is a mocking method

                                                                                                                                                                                                                                func (*MockClient) NextPaymentsPage

                                                                                                                                                                                                                                func (m *MockClient) NextPaymentsPage(page operations.OperationsPage) (operations.OperationsPage, error)

                                                                                                                                                                                                                                  NextPaymentsPage is a mocking method

                                                                                                                                                                                                                                  func (*MockClient) NextTradeAggregationsPage

                                                                                                                                                                                                                                  func (m *MockClient) NextTradeAggregationsPage(page hProtocol.TradeAggregationsPage) (hProtocol.TradeAggregationsPage, error)

                                                                                                                                                                                                                                    NextTradeAggregationsPage is a mocking method

                                                                                                                                                                                                                                    func (*MockClient) NextTradesPage

                                                                                                                                                                                                                                    func (m *MockClient) NextTradesPage(page hProtocol.TradesPage) (hProtocol.TradesPage, error)

                                                                                                                                                                                                                                      NextTradesPage is a mocking method

                                                                                                                                                                                                                                      func (*MockClient) NextTransactionsPage

                                                                                                                                                                                                                                      func (m *MockClient) NextTransactionsPage(page hProtocol.TransactionsPage) (hProtocol.TransactionsPage, error)

                                                                                                                                                                                                                                        NextTransactionsPage is a mocking method

                                                                                                                                                                                                                                        func (*MockClient) OfferDetails

                                                                                                                                                                                                                                        func (m *MockClient) OfferDetails(offerID string) (hProtocol.Offer, error)

                                                                                                                                                                                                                                          OfferDetail is a mocking method

                                                                                                                                                                                                                                          func (*MockClient) Offers

                                                                                                                                                                                                                                          func (m *MockClient) Offers(request OfferRequest) (hProtocol.OffersPage, error)

                                                                                                                                                                                                                                            Offers is a mocking method

                                                                                                                                                                                                                                            func (*MockClient) OperationDetail

                                                                                                                                                                                                                                            func (m *MockClient) OperationDetail(id string) (operations.Operation, error)

                                                                                                                                                                                                                                              OperationDetail is a mocking method

                                                                                                                                                                                                                                              func (*MockClient) Operations

                                                                                                                                                                                                                                              func (m *MockClient) Operations(request OperationRequest) (operations.OperationsPage, error)

                                                                                                                                                                                                                                                Operations is a mocking method

                                                                                                                                                                                                                                                func (*MockClient) OrderBook

                                                                                                                                                                                                                                                func (m *MockClient) OrderBook(request OrderBookRequest) (hProtocol.OrderBookSummary, error)

                                                                                                                                                                                                                                                  OrderBook is a mocking method

                                                                                                                                                                                                                                                  func (*MockClient) Paths

                                                                                                                                                                                                                                                  func (m *MockClient) Paths(request PathsRequest) (hProtocol.PathsPage, error)

                                                                                                                                                                                                                                                    Paths is a mocking method

                                                                                                                                                                                                                                                    func (*MockClient) Payments

                                                                                                                                                                                                                                                    func (m *MockClient) Payments(request OperationRequest) (operations.OperationsPage, error)

                                                                                                                                                                                                                                                      Payments is a mocking method

                                                                                                                                                                                                                                                      func (*MockClient) PrevAssetsPage

                                                                                                                                                                                                                                                      func (m *MockClient) PrevAssetsPage(page hProtocol.AssetsPage) (hProtocol.AssetsPage, error)

                                                                                                                                                                                                                                                        PrevAssetsPage is a mocking method

                                                                                                                                                                                                                                                        func (*MockClient) PrevEffectsPage

                                                                                                                                                                                                                                                        func (m *MockClient) PrevEffectsPage(page effects.EffectsPage) (effects.EffectsPage, error)

                                                                                                                                                                                                                                                          PrevEffectsPage is a mocking method

                                                                                                                                                                                                                                                          func (*MockClient) PrevLedgersPage

                                                                                                                                                                                                                                                          func (m *MockClient) PrevLedgersPage(page hProtocol.LedgersPage) (hProtocol.LedgersPage, error)

                                                                                                                                                                                                                                                            PrevLedgersPage is a mocking method

                                                                                                                                                                                                                                                            func (*MockClient) PrevOffersPage

                                                                                                                                                                                                                                                            func (m *MockClient) PrevOffersPage(page hProtocol.OffersPage) (hProtocol.OffersPage, error)

                                                                                                                                                                                                                                                              PrevOffersPage is a mocking method

                                                                                                                                                                                                                                                              func (*MockClient) PrevOperationsPage

                                                                                                                                                                                                                                                              func (m *MockClient) PrevOperationsPage(page operations.OperationsPage) (operations.OperationsPage, error)

                                                                                                                                                                                                                                                                PrevOperationsPage is a mocking method

                                                                                                                                                                                                                                                                func (*MockClient) PrevPaymentsPage

                                                                                                                                                                                                                                                                func (m *MockClient) PrevPaymentsPage(page operations.OperationsPage) (operations.OperationsPage, error)

                                                                                                                                                                                                                                                                  PrevPaymentsPage is a mocking method

                                                                                                                                                                                                                                                                  func (*MockClient) PrevTradeAggregationsPage

                                                                                                                                                                                                                                                                  func (m *MockClient) PrevTradeAggregationsPage(page hProtocol.TradeAggregationsPage) (hProtocol.TradeAggregationsPage, error)

                                                                                                                                                                                                                                                                    PrevTradeAggregationsPage is a mocking method

                                                                                                                                                                                                                                                                    func (*MockClient) PrevTradesPage

                                                                                                                                                                                                                                                                    func (m *MockClient) PrevTradesPage(page hProtocol.TradesPage) (hProtocol.TradesPage, error)

                                                                                                                                                                                                                                                                      PrevTradesPage is a mocking method

                                                                                                                                                                                                                                                                      func (*MockClient) PrevTransactionsPage

                                                                                                                                                                                                                                                                      func (m *MockClient) PrevTransactionsPage(page hProtocol.TransactionsPage) (hProtocol.TransactionsPage, error)

                                                                                                                                                                                                                                                                        PrevTransactionsPage is a mocking method

                                                                                                                                                                                                                                                                        func (*MockClient) Root

                                                                                                                                                                                                                                                                        func (m *MockClient) Root() (hProtocol.Root, error)

                                                                                                                                                                                                                                                                          Root is a mocking method

                                                                                                                                                                                                                                                                          func (*MockClient) StreamEffects

                                                                                                                                                                                                                                                                          func (m *MockClient) StreamEffects(ctx context.Context, request EffectRequest, handler EffectHandler) error

                                                                                                                                                                                                                                                                            StreamEffects is a mocking method

                                                                                                                                                                                                                                                                            func (*MockClient) StreamLedgers

                                                                                                                                                                                                                                                                            func (m *MockClient) StreamLedgers(ctx context.Context, request LedgerRequest, handler LedgerHandler) error

                                                                                                                                                                                                                                                                              StreamLedgers is a mocking method

                                                                                                                                                                                                                                                                              func (*MockClient) StreamOffers

                                                                                                                                                                                                                                                                              func (m *MockClient) StreamOffers(ctx context.Context, request OfferRequest, handler OfferHandler) error

                                                                                                                                                                                                                                                                                StreamOffers is a mocking method

                                                                                                                                                                                                                                                                                func (*MockClient) StreamOperations

                                                                                                                                                                                                                                                                                func (m *MockClient) StreamOperations(ctx context.Context, request OperationRequest, handler OperationHandler) error

                                                                                                                                                                                                                                                                                  StreamOperations is a mocking method

                                                                                                                                                                                                                                                                                  func (*MockClient) StreamOrderBooks

                                                                                                                                                                                                                                                                                  func (m *MockClient) StreamOrderBooks(ctx context.Context, request OrderBookRequest, handler OrderBookHandler) error

                                                                                                                                                                                                                                                                                    StreamOrderBooks is a mocking method

                                                                                                                                                                                                                                                                                    func (*MockClient) StreamPayments

                                                                                                                                                                                                                                                                                    func (m *MockClient) StreamPayments(ctx context.Context, request OperationRequest, handler OperationHandler) error

                                                                                                                                                                                                                                                                                      StreamPayments is a mocking method

                                                                                                                                                                                                                                                                                      func (*MockClient) StreamTrades

                                                                                                                                                                                                                                                                                      func (m *MockClient) StreamTrades(ctx context.Context, request TradeRequest, handler TradeHandler) error

                                                                                                                                                                                                                                                                                        StreamTrades is a mocking method

                                                                                                                                                                                                                                                                                        func (*MockClient) StreamTransactions

                                                                                                                                                                                                                                                                                        func (m *MockClient) StreamTransactions(ctx context.Context, request TransactionRequest, handler TransactionHandler) error

                                                                                                                                                                                                                                                                                          StreamTransactions is a mocking method

                                                                                                                                                                                                                                                                                          func (*MockClient) SubmitFeeBumpTransaction

                                                                                                                                                                                                                                                                                          func (m *MockClient) SubmitFeeBumpTransaction(transaction *txnbuild.FeeBumpTransaction) (hProtocol.Transaction, error)

                                                                                                                                                                                                                                                                                            SubmitFeeBumpTransaction is a mocking method

                                                                                                                                                                                                                                                                                            func (*MockClient) SubmitFeeBumpTransactionWithOptions

                                                                                                                                                                                                                                                                                            func (m *MockClient) SubmitFeeBumpTransactionWithOptions(transaction *txnbuild.FeeBumpTransaction, opts SubmitTxOpts) (hProtocol.Transaction, error)

                                                                                                                                                                                                                                                                                              SubmitFeeBumpTransactionWithOptions is a mocking method

                                                                                                                                                                                                                                                                                              func (*MockClient) SubmitTransaction

                                                                                                                                                                                                                                                                                              func (m *MockClient) SubmitTransaction(transaction *txnbuild.Transaction) (hProtocol.Transaction, error)

                                                                                                                                                                                                                                                                                                SubmitTransaction is a mocking method

                                                                                                                                                                                                                                                                                                func (*MockClient) SubmitTransactionWithOptions

                                                                                                                                                                                                                                                                                                func (m *MockClient) SubmitTransactionWithOptions(transaction *txnbuild.Transaction, opts SubmitTxOpts) (hProtocol.Transaction, error)

                                                                                                                                                                                                                                                                                                  SubmitTransactionWithOptions is a mocking method

                                                                                                                                                                                                                                                                                                  func (*MockClient) SubmitTransactionXDR

                                                                                                                                                                                                                                                                                                  func (m *MockClient) SubmitTransactionXDR(transactionXdr string) (hProtocol.Transaction, error)

                                                                                                                                                                                                                                                                                                    SubmitTransactionXDR is a mocking method

                                                                                                                                                                                                                                                                                                    func (*MockClient) TradeAggregations

                                                                                                                                                                                                                                                                                                    func (m *MockClient) TradeAggregations(request TradeAggregationRequest) (hProtocol.TradeAggregationsPage, error)

                                                                                                                                                                                                                                                                                                      TradeAggregations is a mocking method

                                                                                                                                                                                                                                                                                                      func (*MockClient) Trades

                                                                                                                                                                                                                                                                                                      func (m *MockClient) Trades(request TradeRequest) (hProtocol.TradesPage, error)

                                                                                                                                                                                                                                                                                                        Trades is a mocking method

                                                                                                                                                                                                                                                                                                        func (*MockClient) TransactionDetail

                                                                                                                                                                                                                                                                                                        func (m *MockClient) TransactionDetail(txHash string) (hProtocol.Transaction, error)

                                                                                                                                                                                                                                                                                                          TransactionDetail is a mocking method

                                                                                                                                                                                                                                                                                                          func (*MockClient) Transactions

                                                                                                                                                                                                                                                                                                          func (m *MockClient) Transactions(request TransactionRequest) (hProtocol.TransactionsPage, error)

                                                                                                                                                                                                                                                                                                            Transactions is a mocking method

                                                                                                                                                                                                                                                                                                            type OfferHandler

                                                                                                                                                                                                                                                                                                            type OfferHandler func(hProtocol.Offer)

                                                                                                                                                                                                                                                                                                              OfferHandler is a function that is called when a new offer is received

                                                                                                                                                                                                                                                                                                              type OfferRequest

                                                                                                                                                                                                                                                                                                              type OfferRequest struct {
                                                                                                                                                                                                                                                                                                              	OfferID    string
                                                                                                                                                                                                                                                                                                              	ForAccount string
                                                                                                                                                                                                                                                                                                              	Selling    string
                                                                                                                                                                                                                                                                                                              	Seller     string
                                                                                                                                                                                                                                                                                                              	Buying     string
                                                                                                                                                                                                                                                                                                              	Order      Order
                                                                                                                                                                                                                                                                                                              	Cursor     string
                                                                                                                                                                                                                                                                                                              	Limit      uint
                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                OfferRequest struct contains data for getting offers made by an account from a horizon server. The query parameters (Order, Cursor and Limit) are optional. All or none can be set.

                                                                                                                                                                                                                                                                                                                func (OfferRequest) BuildURL

                                                                                                                                                                                                                                                                                                                func (or OfferRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                                                                                                                                                  BuildURL creates the endpoint to be queried based on the data in the OfferRequest struct.

                                                                                                                                                                                                                                                                                                                  func (OfferRequest) StreamOffers

                                                                                                                                                                                                                                                                                                                  func (or OfferRequest) StreamOffers(ctx context.Context, client *Client, handler OfferHandler) (err error)

                                                                                                                                                                                                                                                                                                                    StreamOffers streams offers processed by the Stellar network for an account. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. OfferHandler is a user-supplied function that is executed for each streamed offer received.

                                                                                                                                                                                                                                                                                                                    type OperationHandler

                                                                                                                                                                                                                                                                                                                    type OperationHandler func(operations.Operation)

                                                                                                                                                                                                                                                                                                                      OperationHandler is a function that is called when a new operation is received

                                                                                                                                                                                                                                                                                                                      type OperationRequest

                                                                                                                                                                                                                                                                                                                      type OperationRequest struct {
                                                                                                                                                                                                                                                                                                                      	ForAccount     string
                                                                                                                                                                                                                                                                                                                      	ForLedger      uint
                                                                                                                                                                                                                                                                                                                      	ForTransaction string
                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                      	Order         Order
                                                                                                                                                                                                                                                                                                                      	Cursor        string
                                                                                                                                                                                                                                                                                                                      	Limit         uint
                                                                                                                                                                                                                                                                                                                      	IncludeFailed bool
                                                                                                                                                                                                                                                                                                                      	Join          string
                                                                                                                                                                                                                                                                                                                      	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                        OperationRequest struct contains data for getting operation details from a horizon server. "ForAccount", "ForLedger", "ForTransaction": Only one of these can be set at a time. If none are provided, the default is to return all operations. The query parameters (Order, Cursor, Limit and IncludeFailed) are optional. All or none can be set.

                                                                                                                                                                                                                                                                                                                        func (OperationRequest) BuildURL

                                                                                                                                                                                                                                                                                                                        func (op OperationRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                                                                                                                                                          BuildURL creates the endpoint to be queried based on the data in the OperationRequest struct. If no data is set, it defaults to the build the URL for all operations or all payments; depending on thevalue of `op.endpoint`

                                                                                                                                                                                                                                                                                                                          func (*OperationRequest) SetOperationsEndpoint

                                                                                                                                                                                                                                                                                                                          func (op *OperationRequest) SetOperationsEndpoint() *OperationRequest

                                                                                                                                                                                                                                                                                                                            SetOperationsEndpoint is a helper function that sets the `endpoint` for OperationRequests to `operations`

                                                                                                                                                                                                                                                                                                                            func (*OperationRequest) SetPaymentsEndpoint

                                                                                                                                                                                                                                                                                                                            func (op *OperationRequest) SetPaymentsEndpoint() *OperationRequest

                                                                                                                                                                                                                                                                                                                              SetPaymentsEndpoint is a helper function that sets the `endpoint` for OperationRequests to `payments`

                                                                                                                                                                                                                                                                                                                              func (OperationRequest) StreamOperations

                                                                                                                                                                                                                                                                                                                              func (op OperationRequest) StreamOperations(ctx context.Context, client *Client, handler OperationHandler) error

                                                                                                                                                                                                                                                                                                                                StreamOperations streams stellar operations. It can be used to stream all operations or operations for and account. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. OperationHandler is a user-supplied function that is executed for each streamed operation received.

                                                                                                                                                                                                                                                                                                                                type Order

                                                                                                                                                                                                                                                                                                                                type Order string

                                                                                                                                                                                                                                                                                                                                  Order represents `order` param in queries

                                                                                                                                                                                                                                                                                                                                  type OrderBookHandler

                                                                                                                                                                                                                                                                                                                                  type OrderBookHandler func(hProtocol.OrderBookSummary)

                                                                                                                                                                                                                                                                                                                                    OrderBookHandler is a function that is called when a new order summary is received

                                                                                                                                                                                                                                                                                                                                    type OrderBookRequest

                                                                                                                                                                                                                                                                                                                                    type OrderBookRequest struct {
                                                                                                                                                                                                                                                                                                                                    	SellingAssetType   AssetType
                                                                                                                                                                                                                                                                                                                                    	SellingAssetCode   string
                                                                                                                                                                                                                                                                                                                                    	SellingAssetIssuer string
                                                                                                                                                                                                                                                                                                                                    	BuyingAssetType    AssetType
                                                                                                                                                                                                                                                                                                                                    	BuyingAssetCode    string
                                                                                                                                                                                                                                                                                                                                    	BuyingAssetIssuer  string
                                                                                                                                                                                                                                                                                                                                    	Limit              uint
                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                      OrderBookRequest struct contains data for getting the orderbook for an asset pair from a horizon server. Limit is optional. All other parameters are required.

                                                                                                                                                                                                                                                                                                                                      func (OrderBookRequest) BuildURL

                                                                                                                                                                                                                                                                                                                                      func (obr OrderBookRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                                                                                                                                                                        BuildURL creates the endpoint to be queried based on the data in the OrderBookRequest struct.

                                                                                                                                                                                                                                                                                                                                        func (OrderBookRequest) StreamOrderBooks

                                                                                                                                                                                                                                                                                                                                        func (obr OrderBookRequest) StreamOrderBooks(ctx context.Context, client *Client, handler OrderBookHandler) error

                                                                                                                                                                                                                                                                                                                                          StreamOrderBooks streams the orderbook for a given asset pair. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. OrderBookHandler is a user-supplied function that is executed for each streamed order received.

                                                                                                                                                                                                                                                                                                                                          type PathsRequest

                                                                                                                                                                                                                                                                                                                                          type PathsRequest struct {
                                                                                                                                                                                                                                                                                                                                          	DestinationAccount     string
                                                                                                                                                                                                                                                                                                                                          	DestinationAssetType   AssetType
                                                                                                                                                                                                                                                                                                                                          	DestinationAssetCode   string
                                                                                                                                                                                                                                                                                                                                          	DestinationAssetIssuer string
                                                                                                                                                                                                                                                                                                                                          	DestinationAmount      string
                                                                                                                                                                                                                                                                                                                                          	SourceAccount          string
                                                                                                                                                                                                                                                                                                                                          	SourceAssets           string
                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                            PathsRequest struct contains data for getting available strict receive path payments from a horizon server. All the Destination related parameters are required and you need to include either SourceAccount or SourceAssets. See https://www.stellar.org/developers/horizon/reference/endpoints/path-finding-strict-receive.html

                                                                                                                                                                                                                                                                                                                                            func (PathsRequest) BuildURL

                                                                                                                                                                                                                                                                                                                                            func (pr PathsRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                                                                                                                                                                              BuildURL creates the endpoint to be queried based on the data in the PathsRequest struct.

                                                                                                                                                                                                                                                                                                                                              type ServerTimeRecord

                                                                                                                                                                                                                                                                                                                                              type ServerTimeRecord struct {
                                                                                                                                                                                                                                                                                                                                              	ServerTime        int64
                                                                                                                                                                                                                                                                                                                                              	LocalTimeRecorded int64
                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                ServerTimeRecord contains data for the current unix time of a horizon server instance, and the local time when it was recorded.

                                                                                                                                                                                                                                                                                                                                                type StrictSendPathsRequest

                                                                                                                                                                                                                                                                                                                                                type StrictSendPathsRequest struct {
                                                                                                                                                                                                                                                                                                                                                	DestinationAccount string
                                                                                                                                                                                                                                                                                                                                                	DestinationAssets  string
                                                                                                                                                                                                                                                                                                                                                	SourceAssetType    AssetType
                                                                                                                                                                                                                                                                                                                                                	SourceAssetCode    string
                                                                                                                                                                                                                                                                                                                                                	SourceAssetIssuer  string
                                                                                                                                                                                                                                                                                                                                                	SourceAmount       string
                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                  StrictSendPathsRequest struct contains data for getting available strict send path payments from a horizon server. All the Source related parameters are required and you need to include either DestinationAccount or DestinationAssets. See https://www.stellar.org/developers/horizon/reference/endpoints/path-finding-strict-send.html

                                                                                                                                                                                                                                                                                                                                                  func (StrictSendPathsRequest) BuildURL

                                                                                                                                                                                                                                                                                                                                                  func (pr StrictSendPathsRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                                                                                                                                                                                    BuildURL creates the endpoint to be queried based on the data in the PathsRequest struct.

                                                                                                                                                                                                                                                                                                                                                    type SubmitTxOpts

                                                                                                                                                                                                                                                                                                                                                    type SubmitTxOpts struct {
                                                                                                                                                                                                                                                                                                                                                    	SkipMemoRequiredCheck bool
                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                      SubmitTxOpts represents the submit transaction options

                                                                                                                                                                                                                                                                                                                                                      type TradeAggregationRequest

                                                                                                                                                                                                                                                                                                                                                      type TradeAggregationRequest struct {
                                                                                                                                                                                                                                                                                                                                                      	StartTime          time.Time
                                                                                                                                                                                                                                                                                                                                                      	EndTime            time.Time
                                                                                                                                                                                                                                                                                                                                                      	Resolution         time.Duration
                                                                                                                                                                                                                                                                                                                                                      	Offset             time.Duration
                                                                                                                                                                                                                                                                                                                                                      	BaseAssetType      AssetType
                                                                                                                                                                                                                                                                                                                                                      	BaseAssetCode      string
                                                                                                                                                                                                                                                                                                                                                      	BaseAssetIssuer    string
                                                                                                                                                                                                                                                                                                                                                      	CounterAssetType   AssetType
                                                                                                                                                                                                                                                                                                                                                      	CounterAssetCode   string
                                                                                                                                                                                                                                                                                                                                                      	CounterAssetIssuer string
                                                                                                                                                                                                                                                                                                                                                      	Order              Order
                                                                                                                                                                                                                                                                                                                                                      	Limit              uint
                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                        TradeAggregationRequest struct contains data for getting trade aggregations from a horizon server. The query parameters (Order and Limit) are optional. All or none can be set. All other parameters are required.

                                                                                                                                                                                                                                                                                                                                                        func (TradeAggregationRequest) BuildURL

                                                                                                                                                                                                                                                                                                                                                        func (ta TradeAggregationRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                                                                                                                                                                                          BuildURL creates the endpoint to be queried based on the data in the TradeAggregationRequest struct.

                                                                                                                                                                                                                                                                                                                                                          type TradeHandler

                                                                                                                                                                                                                                                                                                                                                          type TradeHandler func(hProtocol.Trade)

                                                                                                                                                                                                                                                                                                                                                            TradeHandler is a function that is called when a new trade is received

                                                                                                                                                                                                                                                                                                                                                            type TradeRequest

                                                                                                                                                                                                                                                                                                                                                            type TradeRequest struct {
                                                                                                                                                                                                                                                                                                                                                            	ForOfferID         string
                                                                                                                                                                                                                                                                                                                                                            	ForAccount         string
                                                                                                                                                                                                                                                                                                                                                            	BaseAssetType      AssetType
                                                                                                                                                                                                                                                                                                                                                            	BaseAssetCode      string
                                                                                                                                                                                                                                                                                                                                                            	BaseAssetIssuer    string
                                                                                                                                                                                                                                                                                                                                                            	CounterAssetType   AssetType
                                                                                                                                                                                                                                                                                                                                                            	CounterAssetCode   string
                                                                                                                                                                                                                                                                                                                                                            	CounterAssetIssuer string
                                                                                                                                                                                                                                                                                                                                                            	Order              Order
                                                                                                                                                                                                                                                                                                                                                            	Cursor             string
                                                                                                                                                                                                                                                                                                                                                            	Limit              uint
                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                              TradeRequest struct contains data for getting trade details from a horizon server. "ForAccount", "ForOfferID": Only one of these can be set at a time. If none are provided, the default is to return all trades. All other query parameters are optional. All or none can be set.

                                                                                                                                                                                                                                                                                                                                                              func (TradeRequest) BuildURL

                                                                                                                                                                                                                                                                                                                                                              func (tr TradeRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                                                                                                                                                                                                BuildURL creates the endpoint to be queried based on the data in the TradeRequest struct. If no data is set, it defaults to the build the URL for all trades

                                                                                                                                                                                                                                                                                                                                                                func (TradeRequest) StreamTrades

                                                                                                                                                                                                                                                                                                                                                                func (tr TradeRequest) StreamTrades(ctx context.Context, client *Client,
                                                                                                                                                                                                                                                                                                                                                                	handler TradeHandler) (err error)

                                                                                                                                                                                                                                                                                                                                                                  StreamTrades streams executed trades. It can be used to stream all trades, trades for an account and trades for an offer. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. TradeHandler is a user-supplied function that is executed for each streamed trade received.

                                                                                                                                                                                                                                                                                                                                                                  type TransactionHandler

                                                                                                                                                                                                                                                                                                                                                                  type TransactionHandler func(hProtocol.Transaction)

                                                                                                                                                                                                                                                                                                                                                                    TransactionHandler is a function that is called when a new transaction is received

                                                                                                                                                                                                                                                                                                                                                                    type TransactionRequest

                                                                                                                                                                                                                                                                                                                                                                    type TransactionRequest struct {
                                                                                                                                                                                                                                                                                                                                                                    	ForAccount string
                                                                                                                                                                                                                                                                                                                                                                    	ForLedger  uint
                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                    	Order         Order
                                                                                                                                                                                                                                                                                                                                                                    	Cursor        string
                                                                                                                                                                                                                                                                                                                                                                    	Limit         uint
                                                                                                                                                                                                                                                                                                                                                                    	IncludeFailed bool
                                                                                                                                                                                                                                                                                                                                                                    	// contains filtered or unexported fields
                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                      TransactionRequest struct contains data for getting transaction details from a horizon server. "ForAccount", "ForLedger": Only one of these can be set at a time. If none are provided, the default is to return all transactions. The query parameters (Order, Cursor, Limit and IncludeFailed) are optional. All or none can be set.

                                                                                                                                                                                                                                                                                                                                                                      func (TransactionRequest) BuildURL

                                                                                                                                                                                                                                                                                                                                                                      func (tr TransactionRequest) BuildURL() (endpoint string, err error)

                                                                                                                                                                                                                                                                                                                                                                        BuildURL creates the endpoint to be queried based on the data in the TransactionRequest struct. If no data is set, it defaults to the build the URL for all transactions

                                                                                                                                                                                                                                                                                                                                                                        func (TransactionRequest) StreamTransactions

                                                                                                                                                                                                                                                                                                                                                                        func (tr TransactionRequest) StreamTransactions(ctx context.Context, client *Client,
                                                                                                                                                                                                                                                                                                                                                                        	handler TransactionHandler) (err error)

                                                                                                                                                                                                                                                                                                                                                                          StreamTransactions streams executed transactions. It can be used to stream all transactions and transactions for an account. Use context.WithCancel to stop streaming or context.Background() if you want to stream indefinitely. TransactionHandler is a user-supplied function that is executed for each streamed transaction received.

                                                                                                                                                                                                                                                                                                                                                                          type UniversalTimeHandler

                                                                                                                                                                                                                                                                                                                                                                          type UniversalTimeHandler func() int64

                                                                                                                                                                                                                                                                                                                                                                            UniversalTimeHandler is a function that is called to return the UTC unix time in seconds. This handler is used when getting the time from a horizon server, which can be used to calculate transaction timebounds.