mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
GCT: fix spelling (#1164)
* kodespull * fix my spelling * silly sausage, rm sneaky pointer
This commit is contained in:
@@ -143,10 +143,10 @@ Binaries will be published once the codebase reaches a stable condition.
|
||||
|
||||
|User|Contribution Amount|
|
||||
|--|--|
|
||||
| [thrasher-](https://github.com/thrasher-) | 670 |
|
||||
| [shazbert](https://github.com/shazbert) | 269 |
|
||||
| [gloriousCode](https://github.com/gloriousCode) | 205 |
|
||||
| [dependabot[bot]](https://github.com/apps/dependabot) | 139 |
|
||||
| [thrasher-](https://github.com/thrasher-) | 675 |
|
||||
| [shazbert](https://github.com/shazbert) | 273 |
|
||||
| [gloriousCode](https://github.com/gloriousCode) | 208 |
|
||||
| [dependabot[bot]](https://github.com/apps/dependabot) | 157 |
|
||||
| [dependabot-preview[bot]](https://github.com/apps/dependabot-preview) | 88 |
|
||||
| [xtda](https://github.com/xtda) | 47 |
|
||||
| [lrascao](https://github.com/lrascao) | 27 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.Name}}
|
||||
|
||||
+ Fetches up to date curency data from [Currency Coverter API](https://free.currencyconverterapi.com/)
|
||||
+ Fetches up to date curency data from [Currency Converter API](https://free.currencyconverterapi.com/)
|
||||
|
||||
### How to enable
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
currency.HAV: 10,
|
||||
currency.GARD: 100,
|
||||
currency.DASHS: 0.01,
|
||||
currency.ALIS: 0.05,
|
||||
const pressXToJSON = `[0,"bu",[4131.85,4131.85]]`
|
||||
wsTradeExecuted = "te"
|
||||
wsBalanceUpdate = "bu"
|
||||
|
||||
@@ -20,7 +20,7 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader
|
||||
|
||||
## Current Features for currencyconverterapi
|
||||
|
||||
+ Fetches up to date curency data from [Currency Coverter API](https://free.currencyconverterapi.com/)
|
||||
+ Fetches up to date curency data from [Currency Converter API](https://free.currencyconverterapi.com/)
|
||||
|
||||
### How to enable
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# GoCryptoTrader package Exchangerate.Host
|
||||
# GoCryptoTrader package Exchangerate.host
|
||||
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# GoCryptoTrader package Exchangeratesapi.Io
|
||||
# GoCryptoTrader package Exchangeratesapi.io
|
||||
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# GoCryptoTrader package Fixer.Io
|
||||
# GoCryptoTrader package Fixer.io
|
||||
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
# GoCryptoTrader package Currency state manager
|
||||
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml)
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/blob/master/LICENSE)
|
||||
[](https://godoc.org/github.com/thrasher-corp/gocryptotrader/engine/currency_state_manager)
|
||||
[](http://codecov.io/github/thrasher-corp/gocryptotrader?branch=master)
|
||||
[](https://goreportcard.com/report/github.com/thrasher-corp/gocryptotrader)
|
||||
|
||||
|
||||
This currency_state_manager package is part of the GoCryptoTrader codebase.
|
||||
|
||||
## This is still in active development
|
||||
|
||||
You can track ideas, planned features and what's in progress on this Trello board: [https://trello.com/b/ZAhMhpOy/gocryptotrader](https://trello.com/b/ZAhMhpOy/gocryptotrader).
|
||||
|
||||
Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader Slack](https://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
|
||||
# GoCryptoTrader package Currency state manager
|
||||
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml)
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/blob/master/LICENSE)
|
||||
[](https://godoc.org/github.com/thrasher-corp/gocryptotrader/engine/currency_state_manager)
|
||||
[](http://codecov.io/github/thrasher-corp/gocryptotrader?branch=master)
|
||||
[](https://goreportcard.com/report/github.com/thrasher-corp/gocryptotrader)
|
||||
|
||||
|
||||
This currency_state_manager package is part of the GoCryptoTrader codebase.
|
||||
|
||||
## This is still in active development
|
||||
|
||||
You can track ideas, planned features and what's in progress on this Trello board: [https://trello.com/b/ZAhMhpOy/gocryptotrader](https://trello.com/b/ZAhMhpOy/gocryptotrader).
|
||||
|
||||
Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader Slack](https://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
|
||||
|
||||
## Current Features for Currency state manager
|
||||
+ The state manager keeps currency states up to date, which include:
|
||||
@@ -27,22 +27,22 @@ Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader
|
||||
+ This allows for an internal state check to compliment internal and external
|
||||
strategies.
|
||||
|
||||
|
||||
## Contribution
|
||||
|
||||
Please feel free to submit any pull requests or suggest any desired features to be added.
|
||||
|
||||
When submitting a PR, please abide by our coding guidelines:
|
||||
|
||||
+ Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).
|
||||
+ Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
|
||||
+ Code must adhere to our [coding style](https://github.com/thrasher-corp/gocryptotrader/blob/master/doc/coding_style.md).
|
||||
+ Pull requests need to be based on and opened against the `master` branch.
|
||||
|
||||
## Contribution
|
||||
|
||||
Please feel free to submit any pull requests or suggest any desired features to be added.
|
||||
|
||||
When submitting a PR, please abide by our coding guidelines:
|
||||
|
||||
+ Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).
|
||||
+ Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
|
||||
+ Code must adhere to our [coding style](https://github.com/thrasher-corp/gocryptotrader/blob/master/doc/coding_style.md).
|
||||
+ Pull requests need to be based on and opened against the `master` branch.
|
||||
|
||||
## Donations
|
||||
|
||||
<img src="https://github.com/thrasher-corp/gocryptotrader/blob/master/web/src/assets/donate.png?raw=true" hspace="70">
|
||||
|
||||
If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:
|
||||
|
||||
## Donations
|
||||
|
||||
<img src="https://github.com/thrasher-corp/gocryptotrader/blob/master/web/src/assets/donate.png?raw=true" hspace="70">
|
||||
|
||||
If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:
|
||||
|
||||
***bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc***
|
||||
|
||||
@@ -2638,7 +2638,7 @@ func TestWsOrderExecutionReport(t *testing.T) {
|
||||
// cannot run in parallel due to inspecting the DataHandler result
|
||||
payload := []byte(`{"stream":"jTfvpakT2yT0hVIo5gYWVihZhdM2PrBgJUZ5PyfZ4EVpCkx4Uoxk5timcrQc","data":{"e":"executionReport","E":1616627567900,"s":"BTCUSDT","c":"c4wyKsIhoAaittTYlIVLqk","S":"BUY","o":"LIMIT","f":"GTC","q":"0.00028400","p":"52789.10000000","P":"0.00000000","F":"0.00000000","g":-1,"C":"","x":"NEW","X":"NEW","r":"NONE","i":5340845958,"l":"0.00000000","z":"0.00000000","L":"0.00000000","n":"0","N":"BTC","T":1616627567900,"t":-1,"I":11388173160,"w":true,"m":false,"M":false,"O":1616627567900,"Z":"0.00000000","Y":"0.00000000","Q":"0.00000000"}}`)
|
||||
// this is a buy BTC order, normally commission is charged in BTC, vice versa.
|
||||
expRes := order.Detail{
|
||||
expectedResult := order.Detail{
|
||||
Price: 52789.1,
|
||||
Amount: 0.00028400,
|
||||
AverageExecutedPrice: 0,
|
||||
@@ -2672,8 +2672,8 @@ func TestWsOrderExecutionReport(t *testing.T) {
|
||||
res := <-b.Websocket.DataHandler
|
||||
switch r := res.(type) {
|
||||
case *order.Detail:
|
||||
if !reflect.DeepEqual(expRes, *r) {
|
||||
t.Errorf("Results do not match:\nexpected: %v\nreceived: %v", expRes, *r)
|
||||
if !reflect.DeepEqual(expectedResult, *r) {
|
||||
t.Errorf("Results do not match:\nexpected: %v\nreceived: %v", expectedResult, *r)
|
||||
}
|
||||
default:
|
||||
t.Fatalf("expected type order.Detail, found %T", res)
|
||||
|
||||
@@ -1862,7 +1862,7 @@ func TestProcessUpdate(t *testing.T) {
|
||||
|
||||
func TestWebsocketOrderExecutionReport(t *testing.T) {
|
||||
payload := []byte(`{"stream":"jTfvpakT2yT0hVIo5gYWVihZhdM2PrBgJUZ5PyfZ4EVpCkx4Uoxk5timcrQc","data":{"e":"executionReport","E":1616627567900,"s":"BTCUSDT","c":"c4wyKsIhoAaittTYlIVLqk","S":"BUY","o":"LIMIT","f":"GTC","q":"0.00028400","p":"52789.10000000","P":"0.00000000","F":"0.00000000","g":-1,"C":"","x":"NEW","X":"NEW","r":"NONE","i":5340845958,"l":"0.00000000","z":"0.00000000","L":"0.00000000","n":"0","N":"BTC","T":1616627567900,"t":-1,"I":11388173160,"w":true,"m":false,"M":false,"O":1616627567900,"Z":"0.00000000","Y":"0.00000000","Q":"0.00000000"}}`)
|
||||
expRes := order.Detail{
|
||||
expectedResult := order.Detail{
|
||||
Price: 52789.1,
|
||||
Amount: 0.00028400,
|
||||
RemainingAmount: 0.00028400,
|
||||
@@ -1889,8 +1889,8 @@ func TestWebsocketOrderExecutionReport(t *testing.T) {
|
||||
res := <-bi.Websocket.DataHandler
|
||||
switch r := res.(type) {
|
||||
case *order.Detail:
|
||||
if !reflects.DeepEqual(expRes, *r) {
|
||||
t.Errorf("Binanceus Results do not match:\nexpected: %v\nreceived: %v", expRes, *r)
|
||||
if !reflects.DeepEqual(expectedResult, *r) {
|
||||
t.Errorf("Binanceus Results do not match:\nexpected: %v\nreceived: %v", expectedResult, *r)
|
||||
}
|
||||
default:
|
||||
t.Fatalf("Binanceus expected type order.Detail, found %T", res)
|
||||
|
||||
@@ -601,50 +601,51 @@ func (c *CoinbasePro) CancelAllOrders(ctx context.Context, _ *order.Cancel) (ord
|
||||
}
|
||||
|
||||
// GetOrderInfo returns order information based on order ID
|
||||
func (c *CoinbasePro) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (order.Detail, error) {
|
||||
genOrderDetail, errGo := c.GetOrder(ctx, orderID)
|
||||
if errGo != nil {
|
||||
return order.Detail{}, fmt.Errorf("error retrieving order %s : %s", orderID, errGo)
|
||||
func (c *CoinbasePro) GetOrderInfo(ctx context.Context, orderID string, _ currency.Pair, _ asset.Item) (order.Detail, error) {
|
||||
genOrderDetail, err := c.GetOrder(ctx, orderID)
|
||||
if err != nil {
|
||||
return order.Detail{}, fmt.Errorf("error retrieving order %s : %w", orderID, err)
|
||||
}
|
||||
os, errOs := order.StringToOrderStatus(genOrderDetail.Status)
|
||||
if errOs != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing order status: %s", errOs)
|
||||
orderStatus, err := order.StringToOrderStatus(genOrderDetail.Status)
|
||||
if err != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing order status: %w", err)
|
||||
}
|
||||
tt, errOt := order.StringToOrderType(genOrderDetail.Type)
|
||||
if errOt != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing order type: %s", errOt)
|
||||
orderType, err := order.StringToOrderType(genOrderDetail.Type)
|
||||
if err != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing order type: %w", err)
|
||||
}
|
||||
ss, errOss := order.StringToOrderSide(genOrderDetail.Side)
|
||||
if errOss != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing order side: %s", errOss)
|
||||
orderSide, err := order.StringToOrderSide(genOrderDetail.Side)
|
||||
if err != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing order side: %w", err)
|
||||
}
|
||||
p, errP := currency.NewPairDelimiter(genOrderDetail.ProductID, "-")
|
||||
if errP != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing order side: %s", errP)
|
||||
pair, err := currency.NewPairDelimiter(genOrderDetail.ProductID, "-")
|
||||
if err != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing order side: %w", err)
|
||||
}
|
||||
|
||||
response := order.Detail{
|
||||
Exchange: c.GetName(),
|
||||
OrderID: genOrderDetail.ID,
|
||||
Pair: p,
|
||||
Side: ss,
|
||||
Type: tt,
|
||||
Pair: pair,
|
||||
Side: orderSide,
|
||||
Type: orderType,
|
||||
Date: genOrderDetail.DoneAt,
|
||||
Status: os,
|
||||
Status: orderStatus,
|
||||
Price: genOrderDetail.Price,
|
||||
Amount: genOrderDetail.Size,
|
||||
ExecutedAmount: genOrderDetail.FilledSize,
|
||||
RemainingAmount: genOrderDetail.Size - genOrderDetail.FilledSize,
|
||||
Fee: genOrderDetail.FillFees,
|
||||
}
|
||||
fillResponse, errGF := c.GetFills(ctx, orderID, genOrderDetail.ProductID)
|
||||
if errGF != nil {
|
||||
return response, fmt.Errorf("error retrieving the order fills: %s", errGF)
|
||||
fillResponse, err := c.GetFills(ctx, orderID, genOrderDetail.ProductID)
|
||||
if err != nil {
|
||||
return order.Detail{}, fmt.Errorf("error retrieving the order fills: %w", err)
|
||||
}
|
||||
for i := range fillResponse {
|
||||
trSi, errTSi := order.StringToOrderSide(fillResponse[i].Side)
|
||||
if errTSi != nil {
|
||||
return response, fmt.Errorf("error parsing order Side: %s", errTSi)
|
||||
var fillSide order.Side
|
||||
fillSide, err = order.StringToOrderSide(fillResponse[i].Side)
|
||||
if err != nil {
|
||||
return order.Detail{}, fmt.Errorf("error parsing fill Side: %w", err)
|
||||
}
|
||||
response.Trades = append(response.Trades, order.TradeHistory{
|
||||
Timestamp: fillResponse[i].CreatedAt,
|
||||
@@ -652,8 +653,8 @@ func (c *CoinbasePro) GetOrderInfo(ctx context.Context, orderID string, pair cur
|
||||
Price: fillResponse[i].Price,
|
||||
Amount: fillResponse[i].Size,
|
||||
Exchange: c.GetName(),
|
||||
Type: tt,
|
||||
Side: trSi,
|
||||
Type: orderType,
|
||||
Side: fillSide,
|
||||
Fee: fillResponse[i].Fee,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ func (g *Gemini) WithdrawCrypto(ctx context.Context, address, currency string, a
|
||||
}
|
||||
|
||||
// PostHeartbeat sends a maintenance heartbeat to the exchange for all heartbeat
|
||||
// maintaned sessions
|
||||
// maintained sessions
|
||||
func (g *Gemini) PostHeartbeat(ctx context.Context) (string, error) {
|
||||
type Response struct {
|
||||
Result string `json:"result"`
|
||||
|
||||
@@ -24,7 +24,7 @@ type TickerResponse struct {
|
||||
Ticker Ticker `json:"ticker"`
|
||||
}
|
||||
|
||||
// MarketDepthResponse stores arrays for asks, bids and a timestamp for a currecy pair
|
||||
// MarketDepthResponse stores arrays for asks, bids and a timestamp for a currency pair
|
||||
type MarketDepthResponse struct {
|
||||
ErrCapture `json:",omitempty"`
|
||||
Data struct {
|
||||
|
||||
@@ -1450,9 +1450,9 @@ func TestMatchFilter(t *testing.T) {
|
||||
}
|
||||
|
||||
tests := map[int]struct {
|
||||
f Filter
|
||||
o Detail
|
||||
expRes bool
|
||||
f Filter
|
||||
o Detail
|
||||
expectedResult bool
|
||||
}{
|
||||
0: {filters[1], orders[1], true},
|
||||
1: {filters[1], orders[0], false},
|
||||
@@ -1495,7 +1495,7 @@ func TestMatchFilter(t *testing.T) {
|
||||
}
|
||||
// specific tests
|
||||
for num, tt := range tests {
|
||||
if tt.o.MatchFilter(&tt.f) != tt.expRes {
|
||||
if tt.o.MatchFilter(&tt.f) != tt.expectedResult {
|
||||
t.Errorf("tests[%v] failed", num)
|
||||
}
|
||||
}
|
||||
@@ -1510,8 +1510,8 @@ func TestIsActive(t *testing.T) {
|
||||
}
|
||||
|
||||
amountTests := map[int]struct {
|
||||
o Detail
|
||||
expRes bool
|
||||
o Detail
|
||||
expectedResult bool
|
||||
}{
|
||||
0: {orders[0], false},
|
||||
1: {orders[1], true},
|
||||
@@ -1520,14 +1520,14 @@ func TestIsActive(t *testing.T) {
|
||||
}
|
||||
// specific tests
|
||||
for num, tt := range amountTests {
|
||||
if tt.o.IsActive() != tt.expRes {
|
||||
if tt.o.IsActive() != tt.expectedResult {
|
||||
t.Errorf("amountTests[%v] failed", num)
|
||||
}
|
||||
}
|
||||
|
||||
statusTests := map[int]struct {
|
||||
o Detail
|
||||
expRes bool
|
||||
o Detail
|
||||
expectedResult bool
|
||||
}{
|
||||
// For now force inactive on any status
|
||||
0: {Detail{Amount: 1.0, ExecutedAmount: 0.0, Status: AnyStatus}, false},
|
||||
@@ -1552,7 +1552,7 @@ func TestIsActive(t *testing.T) {
|
||||
}
|
||||
// specific tests
|
||||
for num, tt := range statusTests {
|
||||
if tt.o.IsActive() != tt.expRes {
|
||||
if tt.o.IsActive() != tt.expectedResult {
|
||||
t.Fatalf("statusTests[%v] failed", num)
|
||||
}
|
||||
}
|
||||
@@ -1579,8 +1579,8 @@ func TestIsInactive(t *testing.T) {
|
||||
}
|
||||
|
||||
amountTests := map[int]struct {
|
||||
o Detail
|
||||
expRes bool
|
||||
o Detail
|
||||
expectedResult bool
|
||||
}{
|
||||
0: {orders[0], true},
|
||||
1: {orders[1], false},
|
||||
@@ -1589,14 +1589,14 @@ func TestIsInactive(t *testing.T) {
|
||||
}
|
||||
// specific tests
|
||||
for num, tt := range amountTests {
|
||||
if tt.o.IsInactive() != tt.expRes {
|
||||
if tt.o.IsInactive() != tt.expectedResult {
|
||||
t.Errorf("amountTests[%v] failed", num)
|
||||
}
|
||||
}
|
||||
|
||||
statusTests := map[int]struct {
|
||||
o Detail
|
||||
expRes bool
|
||||
o Detail
|
||||
expectedResult bool
|
||||
}{
|
||||
// For now force inactive on any status
|
||||
0: {Detail{Amount: 1.0, ExecutedAmount: 0.0, Status: AnyStatus}, true},
|
||||
@@ -1621,7 +1621,7 @@ func TestIsInactive(t *testing.T) {
|
||||
}
|
||||
// specific tests
|
||||
for num, tt := range statusTests {
|
||||
if tt.o.IsInactive() != tt.expRes {
|
||||
if tt.o.IsInactive() != tt.expectedResult {
|
||||
t.Errorf("statusTests[%v] failed", num)
|
||||
}
|
||||
}
|
||||
@@ -1641,8 +1641,8 @@ func BenchmarkIsInactive(b *testing.B) {
|
||||
func TestIsOrderPlaced(t *testing.T) {
|
||||
t.Parallel()
|
||||
statusTests := map[int]struct {
|
||||
o Detail
|
||||
expRes bool
|
||||
o Detail
|
||||
expectedResult bool
|
||||
}{
|
||||
0: {Detail{Amount: 1.0, ExecutedAmount: 0.0, Status: AnyStatus}, false},
|
||||
1: {Detail{Amount: 1.0, ExecutedAmount: 0.0, Status: New}, true},
|
||||
@@ -1669,7 +1669,7 @@ func TestIsOrderPlaced(t *testing.T) {
|
||||
tt := tt
|
||||
t.Run(fmt.Sprintf("TEST CASE: %d", num), func(t *testing.T) {
|
||||
t.Parallel()
|
||||
if tt.o.WasOrderPlaced() != tt.expRes {
|
||||
if tt.o.WasOrderPlaced() != tt.expectedResult {
|
||||
t.Errorf("statusTests[%v] failed", num)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user