-
Notifications
You must be signed in to change notification settings - Fork 17
/
spot_margin_test.go
68 lines (56 loc) · 1.56 KB
/
spot_margin_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package goftx
import (
"os"
"testing"
"github.com/joho/godotenv"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestSpotMargin(t *testing.T) {
_ = godotenv.Load()
ftx := New(
WithAuth(os.Getenv("FTX_KEY"), os.Getenv("FTX_SECRET")),
)
err := ftx.SetServerTimeDiff()
require.NoError(t, err)
t.Run("GetBorrowRates", func(t *testing.T) {
result, err := ftx.SpotMargin.GetBorrowRates()
assert.NoError(t, err)
assert.NotNil(t, result)
})
t.Run("GetLendingRates", func(t *testing.T) {
result, err := ftx.SpotMargin.GetLendingRates()
assert.NoError(t, err)
assert.NotNil(t, result)
})
t.Run("GetDailyBorrowedAmounts", func(t *testing.T) {
result, err := ftx.SpotMargin.GetDailyBorrowedAmounts()
assert.NoError(t, err)
assert.NotNil(t, result)
})
t.Run("GetMarketInfo", func(t *testing.T) {
result, err := ftx.SpotMargin.GetMarketInfo("ETH/BTC")
assert.NoError(t, err)
assert.Nil(t, result)
})
t.Run("GetBorrowHistory", func(t *testing.T) {
result, err := ftx.SpotMargin.GetBorrowHistory()
assert.NoError(t, err)
assert.NotNil(t, result)
})
t.Run("GetLendingHistory", func(t *testing.T) {
result, err := ftx.SpotMargin.GetLendingHistory()
assert.NoError(t, err)
assert.NotNil(t, result)
})
t.Run("GetLendingOffers", func(t *testing.T) {
result, err := ftx.SpotMargin.GetLendingOffers()
assert.NoError(t, err)
assert.NotNil(t, result)
})
t.Run("GetLendingInfo", func(t *testing.T) {
result, err := ftx.SpotMargin.GetLendingInfo()
assert.NoError(t, err)
assert.NotNil(t, result)
})
}