From b9280f78608cfa5185062011425f5948cf3e9374 Mon Sep 17 00:00:00 2001 From: Abhimanyu Paldiwal Date: Fri, 6 Aug 2021 09:35:14 -0700 Subject: [PATCH] Update list.mdx --- content/api/resources/trades/list.mdx | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/content/api/resources/trades/list.mdx b/content/api/resources/trades/list.mdx index 273a5630f..47815dd06 100644 --- a/content/api/resources/trades/list.mdx +++ b/content/api/resources/trades/list.mdx @@ -88,6 +88,34 @@ server }); ``` +```go +package main + +import ( + "fmt" + "log" + + "github.com/stellar/go/clients/horizonclient" +) + +func main() { + client := horizonclient.DefaultPublicNetClient + tradeRequest := horizonclient.TradeRequest { + BaseAssetType: "credit_alphanum4", + BaseAssetCode: "USD", + BaseAssetIssuer: "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX", + CounterAssetType: "native", + } + + resp, err := client.Trades(tradeRequest) + if err != nil { + log.Fatal(err) + return + } + fmt.Println(resp) +} +``` +