From 8a444b5d48a18585a3c33cb7922b603c2e47d2b7 Mon Sep 17 00:00:00 2001 From: Abhimanyu Paldiwal Date: Fri, 6 Aug 2021 23:38:12 -0700 Subject: [PATCH] Update single.mdx --- .../api/aggregations/order-books/single.mdx | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) 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) +} +```