-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exchanges: Add Coinbase International support #1381
base: master
Are you sure you want to change the base?
Conversation
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, just had a quick look over code. 👍
errAddressIsRequired = errors.New("err: missing address") | ||
errAssetIdentifierRequired = errors.New("err: asset identified is required") | ||
errEmptyArgument = errors.New("err: empty argument") | ||
errTimeInForceRequired = errors.New("err: time_in_force is required") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably RM err:
string
if orderID == "" { | ||
return nil, order.ErrOrderIDNotSet | ||
} | ||
if arg == (&ModifyOrderParam{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a nil check
if arg == nil || *arg == (ModifyOrderParam{}) {
params.Set("status", status) | ||
} | ||
if transferType != "" { | ||
params.Set("type", status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status -> transferType
value := reflect.ValueOf(data) | ||
var payload []byte | ||
if value != (reflect.Value{}) && !value.IsNil() && value.Kind() != reflect.Ptr { | ||
return errArgumentMustBeInterface | ||
} else if value != (reflect.Value{}) && !value.IsNil() { | ||
payload, err = json.Marshal(data) | ||
if err != nil { | ||
return err | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of stuff going on here. I think we could just go about doing a if data != nil {}
check.
Or if the pointer value is really needed:
var payload []byte
if data != nil {
if reflectlite.ValueOf(data).Kind() != reflectlite.Ptr {
return errArgumentMustBePointer
}
payload, err = json.Marshal(data)
if err != nil {
return err
}
}
QuoteAssetUUID string `json:"quote_asset_uuid"` | ||
QuoteAssetName string `json:"quote_asset_name"` | ||
BaseIncrement string `json:"base_increment"` | ||
QuoteIncrement string `json:"quote_increment"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you go over these string values across this file and convert them to float64 values? I will highlight a few if they come up.
|
||
// GetRecentTrades returns the most recent trades for a currency and asset | ||
func (co *CoinbaseInternational) GetRecentTrades(_ context.Context, _ currency.Pair, _ asset.Item) ([]trade.Data, error) { | ||
return nil, common.ErrNotYetImplemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not supported? and below?
if err != nil { | ||
return nil, err | ||
} | ||
return &order.SubmitResponse{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: can use method on S to get default order.SubmitResponse if you want.
if err != nil { | ||
return err | ||
} | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return err
|
||
// CancelBatchOrders cancels orders by their corresponding ID numbers | ||
func (co *CoinbaseInternational) CancelBatchOrders(context.Context, []order.Cancel) (*order.CancelBatchResponse, error) { | ||
return nil, common.ErrNotYetImplemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
// WithdrawFiatFunds returns a withdrawal ID when a withdrawal is | ||
// submitted | ||
func (co *CoinbaseInternational) WithdrawFiatFunds(context.Context, *withdraw.Request) (*withdraw.ExchangeResponse, error) { | ||
return nil, common.ErrNotYetImplemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will stop mentioning this but common.ErrNotSupported
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
… into coinbaseintx
ሰላም ወንድሞች፣
PR Description
This pull request Included a code implementation for the Coinbase International exchange version 1; with REST and web socket support. All the Websocket and Wrapper functions are tested. My code follows the style guidelines of other exchanges of GCT. Fixed all linter issues errors with the help of golangci-lint. Endpoint methods that have no support from the GCT wrapper are also implemented for future use.
Fixes # (issue)
Type of change
How has this been tested
Checklist