Skip to content

Commit

Permalink
GCT: fix spelling (thrasher-corp#1164)
Browse files Browse the repository at this point in the history
* kodespull

* fix my spelling

* silly sausage, rm sneaky pointer
  • Loading branch information
gloriousCode authored Apr 2, 2023
1 parent 5df4876 commit 80b2136
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 101 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions contrib/spellcheck/exclude_lines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion currency/forexprovider/currencyconverterapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion currency/forexprovider/exchangerate.host/README.md
Original file line number Diff line number Diff line change
@@ -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">

Expand Down
2 changes: 1 addition & 1 deletion currency/forexprovider/exchangeratesapi.io/README.md
Original file line number Diff line number Diff line change
@@ -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">

Expand Down
2 changes: 1 addition & 1 deletion currency/forexprovider/fixer.io/README.md
Original file line number Diff line number Diff line change
@@ -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">

Expand Down
74 changes: 37 additions & 37 deletions engine/currency_state_manager.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# GoCryptoTrader package Currency state manager

<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">


[![Build Status](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml)
[![Software License](https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square)](https://github.com/thrasher-corp/gocryptotrader/blob/master/LICENSE)
[![GoDoc](https://godoc.org/github.com/thrasher-corp/gocryptotrader?status.svg)](https://godoc.org/github.com/thrasher-corp/gocryptotrader/engine/currency_state_manager)
[![Coverage Status](http://codecov.io/github/thrasher-corp/gocryptotrader/coverage.svg?branch=master)](http://codecov.io/github/thrasher-corp/gocryptotrader?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/thrasher-corp/gocryptotrader)](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">


[![Build Status](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml)
[![Software License](https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square)](https://github.com/thrasher-corp/gocryptotrader/blob/master/LICENSE)
[![GoDoc](https://godoc.org/github.com/thrasher-corp/gocryptotrader?status.svg)](https://godoc.org/github.com/thrasher-corp/gocryptotrader/engine/currency_state_manager)
[![Coverage Status](http://codecov.io/github/thrasher-corp/gocryptotrader/coverage.svg?branch=master)](http://codecov.io/github/thrasher-corp/gocryptotrader?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/thrasher-corp/gocryptotrader)](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:
Expand All @@ -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.

## 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:


## 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:

***bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc***
6 changes: 3 additions & 3 deletions exchanges/binance/binance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions exchanges/binanceus/binanceus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down
57 changes: 29 additions & 28 deletions exchanges/coinbasepro/coinbasepro_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,59 +601,60 @@ 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,
TID: strconv.FormatInt(fillResponse[i].TradeID, 10),
Price: fillResponse[i].Price,
Amount: fillResponse[i].Size,
Exchange: c.GetName(),
Type: tt,
Side: trSi,
Type: orderType,
Side: fillSide,
Fee: fillResponse[i].Fee,
})
}
Expand Down
2 changes: 1 addition & 1 deletion exchanges/gemini/gemini.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion exchanges/lbank/lbank_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 80b2136

Please sign in to comment.