Untitled
unknown
plain_text
3 years ago
805 B
7
Indexable
package main
import (
"context"
"fmt"
"os"
"github.com/luno/luno-go"
"github.com/luno/luno-go/decimal"
)
func main() {
// Initialize Luno client
cl := luno.NewClient()
cl.SetAuth(os.Getenv("LUNO_API_ID"), os.Getenv("LUNO_API_SECRET"))
// Create a PostLimitOrderRequest
req := luno.PostLimitOrderRequest{
Pair: "XBTZAR",
Price: decimal.NewFromFloat64(10000.00, 2),
Type: "BID",
Volume: decimal.NewFromFloat64(0.0005, 4),
ClientOrderId: "Lunobuy",
PostOnly: true,
TimeInForce: "GTC",
}
// Send the request to the Luno API
ctx := context.Background()
resp, err := cl.PostLimitOrder(ctx, &req)
if err != nil {
// Handle error
}
// Handle response
fmt.Printf("Order ID: %s", resp.OrderId)
}
Editor is loading...