diff --git a/content/api/aggregations/order-books/single.mdx b/content/api/aggregations/order-books/single.mdx index e5f0d03b1..407b964be 100644 --- a/content/api/aggregations/order-books/single.mdx +++ b/content/api/aggregations/order-books/single.mdx @@ -75,6 +75,34 @@ server console.error(err); }); ``` + +```go +package main + +import ( + "fmt" + "log" + + "github.com/stellar/go/clients/horizonclient" +) + +func main() { + client := horizonclient.DefaultPublicNetClient + orderBookRequest := horizonclient.OrderBookRequest { + SellingAssetType: horizonclient.AssetTypeNative, + BuyingAssetType: horizonclient.AssetType4, + BuyingAssetCode: "BB1", + BuyingAssetIssuer: "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN", + } + + resp, err := client.OrderBook(orderBookRequest) + if err != nil { + log.Fatal(err) + return + } + fmt.Println(resp) +} +```