package
0.0.0-20230925091837-55f7a6b23beb
Repository: https://github.com/xdbfoundation/go.git
Documentation: pkg.go.dev

# README

frontierclient

frontierclient is a DigitalBits Go SDK package that provides client access to a frontier server. It supports all endpoints exposed by the frontier API.

This project is maintained by the XDB Foundation.

Getting Started

This library is aimed at developers building Go applications that interact with the DigitalBits 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 DigitalBits SDK.

Prerequisites

  • Go 1.14 or greater
  • Modules to manage dependencies

Installing

  • go get github.com/xdbfoundation/go/clients/frontierclient

Usage

    ...
    import hClient "github.com/xdbfoundation/go/clients/frontierclient"
    ...

    // 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 digitalbits 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.