Skip to content

Commit

Permalink
(L/N)i(n/)t
Browse files Browse the repository at this point in the history
  • Loading branch information
cranktakular committed Sep 29, 2024
1 parent 9925c88 commit c88b057
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions exchanges/coinbasepro/coinbasepro.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ const (
warnSequenceIssue = "Out of order sequence number. Received %v, expected %v"
warnAuth = "%v authenticated request failed, attempting unauthenticated"

ManyFills = 65535
ManyOrds = 2147483647
manyFills = 65535
manyOrds = 2147483647
)

// Constants defining whether a transfer is a deposit or withdrawal, used to simplify
Expand Down
4 changes: 2 additions & 2 deletions exchanges/coinbasepro/coinbasepro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func TestGetPaymentMethodByID(t *testing.T) {
sharedtestvalues.SkipTestIfCredentialsUnset(t, c)
pmID, err := c.GetAllPaymentMethods(context.Background())
assert.NoError(t, err)
if pmID == nil || len(pmID) == 0 {
if len(pmID) == 0 {
t.Skip(skipPayMethodNotFound)
}
resp, err := c.GetPaymentMethodByID(context.Background(), pmID[0].ID)
Expand Down Expand Up @@ -1832,7 +1832,7 @@ func transferTestHelper(t *testing.T, wallets *GetAllWalletsResponse) (srcWallet
}
pmID, err := c.GetAllPaymentMethods(context.Background())
assert.NoError(t, err)
if pmID == nil || len(pmID) == 0 {
if len(pmID) == 0 {
t.Skip(skipPayMethodNotFound)
}
return srcWalletID, pmID[0].ID
Expand Down
4 changes: 2 additions & 2 deletions exchanges/coinbasepro/coinbasepro_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,8 @@ type UnixTimestampMilli time.Time
// ServerTimeV3 holds information on the server's time, returned by GetV3Time
type ServerTimeV3 struct {
Iso time.Time `json:"iso"`
EpochSeconds UnixTimestamp `json:"epochSeconds,string"`
EpochMilliseconds UnixTimestampMilli `json:"epochMillis,string"`
EpochSeconds UnixTimestamp `json:"epochSeconds"`
EpochMilliseconds UnixTimestampMilli `json:"epochMillis"`
}

// PaymentMethodData is a sub-type that holds information on a payment method
Expand Down
18 changes: 9 additions & 9 deletions exchanges/coinbasepro/coinbasepro_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,13 @@ func (c *CoinbasePro) GetOrderInfo(ctx context.Context, orderID string, pair cur
return nil, err
}
response := c.getOrderRespToOrderDetail(genOrderDetail, pair, assetItem)
fillData, err := c.GetFills(ctx, orderID, "", "", time.Time{}, time.Now(), ManyFills)
fillData, err := c.GetFills(ctx, orderID, "", "", time.Time{}, time.Now(), manyFills)
if err != nil {
return nil, err
}
cursor := fillData.Cursor
for cursor != "" {
tempFillData, err := c.GetFills(ctx, orderID, "", cursor, time.Time{}, time.Now(), ManyFills)
tempFillData, err := c.GetFills(ctx, orderID, "", cursor, time.Time{}, time.Now(), manyFills)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -772,9 +772,9 @@ func (c *CoinbasePro) GetActiveOrders(ctx context.Context, req *order.MultiOrder
respOrders, err = c.iterativeGetAllOrders(ctx, pairIDs[0], req.Type.String(), req.Side.String(), req.AssetType.Upper(), ordStatus, 1000, req.StartTime, req.EndTime)
} else {
respOrders, err = c.iterativeGetAllOrders(ctx, "", req.Type.String(), req.Side.String(), req.AssetType.Upper(), ordStatus, 1000, req.StartTime, req.EndTime)
if err != nil {
return nil, err
}
}
if err != nil {
return nil, err
}
orders := make([]order.Detail, len(respOrders))
for i := range respOrders {
Expand Down Expand Up @@ -803,12 +803,12 @@ func (c *CoinbasePro) GetOrderHistory(ctx context.Context, req *order.MultiOrder
p = req.Pairs[0].String()
}
var ord []GetOrderResponse
interOrd, err := c.iterativeGetAllOrders(ctx, p, req.Type.String(), req.Side.String(), req.AssetType.Upper(), closedStatuses, ManyOrds, req.StartTime, req.EndTime)
interOrd, err := c.iterativeGetAllOrders(ctx, p, req.Type.String(), req.Side.String(), req.AssetType.Upper(), closedStatuses, manyOrds, req.StartTime, req.EndTime)
if err != nil {
return nil, err
}
ord = append(ord, interOrd...)
interOrd, err = c.iterativeGetAllOrders(ctx, p, req.Type.String(), req.Side.String(), req.AssetType.Upper(), openStatus, ManyOrds, req.StartTime, req.EndTime)
interOrd, err = c.iterativeGetAllOrders(ctx, p, req.Type.String(), req.Side.String(), req.AssetType.Upper(), openStatus, manyOrds, req.StartTime, req.EndTime)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -1094,7 +1094,7 @@ func (c *CoinbasePro) iterativeGetAllOrders(ctx context.Context, productID, orde
return resp, nil
}

// formatExchangeKlineIntervalV3 is a helper function used in GetHistoricCandles and GetHistoricCandlesExtended
// FormatExchangeKlineIntervalV3 is a helper function used in GetHistoricCandles and GetHistoricCandlesExtended
// to convert kline.Interval to the string format used by V3 of Coinbase's API
func FormatExchangeKlineIntervalV3(interval kline.Interval) string {
switch interval {
Expand Down Expand Up @@ -1289,7 +1289,7 @@ func generateIdempotency(am float64) string {
return strconv.FormatInt(t, 10)
}

// Formats asset items for outbound requests
// FormatAssetOutbound formats asset items for outbound requests
func FormatAssetOutbound(a asset.Item) string {
if a == asset.Futures {
return "FUTURE"
Expand Down

0 comments on commit c88b057

Please sign in to comment.