github.com/bitfinexcom/bitfinex-api-go@v0.0.0-20210608095005-9e0b26f200fb/examples/v2/rest-status/main.go (about)

     1  package main
     2  
     3  import (
     4  	"log"
     5  
     6  	"github.com/bitfinexcom/bitfinex-api-go/v2/rest"
     7  	"github.com/davecgh/go-spew/spew"
     8  )
     9  
    10  func main() {
    11  	c := rest.NewClient()
    12  	derivativeStatus(c)
    13  	derivativeStatusMulti(c)
    14  	derivativeStatusAll(c)
    15  }
    16  
    17  func derivativeStatus(c *rest.Client) {
    18  	ds, err := c.Status.DerivativeStatus("tBTCF0:USTF0")
    19  	if err != nil {
    20  		log.Fatalf("derivativeStatus: %s", err)
    21  	}
    22  
    23  	spew.Dump(ds)
    24  }
    25  
    26  func derivativeStatusMulti(c *rest.Client) {
    27  	ds, err := c.Status.DerivativeStatusMulti([]string{"tBTCF0:USTF0", "tETHF0:USTF0"})
    28  	if err != nil {
    29  		log.Fatalf("derivativeStatusMulti: %s", err)
    30  	}
    31  
    32  	spew.Dump(ds)
    33  }
    34  
    35  func derivativeStatusAll(c *rest.Client) {
    36  	ds, err := c.Status.DerivativeStatusAll()
    37  	if err != nil {
    38  		log.Fatalf("DerivativeStatusAll: %s", err)
    39  	}
    40  
    41  	spew.Dump(ds)
    42  }