Skip to content

Files

horizonclient

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jan 9, 2024
Apr 22, 2022
Jun 1, 2021
Jun 28, 2019
Aug 25, 2021
Aug 25, 2021
May 12, 2022
May 12, 2022
Jun 1, 2021
Oct 22, 2019
Mar 28, 2022
Mar 28, 2022
Apr 26, 2024
Sep 7, 2021
Feb 21, 2024
Aug 25, 2021
Aug 25, 2021
May 24, 2021
Aug 26, 2020
Aug 26, 2020
May 24, 2021
Mar 25, 2022
Jun 1, 2021
Sep 20, 2024
Sep 23, 2022
Jun 1, 2021
Oct 22, 2019
Aug 26, 2021
Sep 23, 2021
Aug 19, 2021
Sep 23, 2021
Apr 26, 2024
Oct 2, 2024
Apr 26, 2024
Jun 1, 2021
Apr 7, 2020
Aug 25, 2021
Aug 25, 2021
Jun 1, 2021
Oct 22, 2019
Jun 1, 2021
Apr 7, 2020
Oct 22, 2019
Jun 1, 2021
Apr 7, 2020
Jun 1, 2021
Jun 28, 2019
Jun 1, 2021
Jan 20, 2020
Aug 25, 2021
Aug 25, 2021
Aug 25, 2021
Aug 25, 2021
Apr 7, 2020

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 (this repository is officially supported on the last two releases of Go)
  • 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.