Skip to content

Conversation

@samuael
Copy link
Collaborator

@samuael samuael commented Oct 28, 2023

ሰላም ወንድሞች፣

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested

  • go test ./... -race
  • golangci-lint run
  • Test X

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally and on Github Actions/AppVeyor with my changes
  • Any dependent changes have been merged and published in downstream modules

@gloriousCode gloriousCode requested a review from a team October 29, 2023 21:38
@gloriousCode gloriousCode added the review me This pull request is ready for review label Oct 29, 2023
Copy link
Collaborator

@shazbert shazbert left a 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. 👍

Comment on lines 40 to 43
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")
Copy link
Collaborator

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{}) {
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status -> transferType

Comment on lines 453 to 462
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
}
}
Copy link
Collaborator

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"`
Copy link
Collaborator

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
Copy link
Collaborator

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{
Copy link
Collaborator

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.

Comment on lines 574 to 577
if err != nil {
return err
}
return nil
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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

@codecov
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: Patch coverage is 26.20408% with 904 lines in your changes missing coverage. Please review.

Project coverage is 46.32%. Comparing base (98f025e) to head (b62bb26).
Report is 3 commits behind head on master.

Current head b62bb26 differs from pull request most recent head 1edc4d5

Please upload reports for the commit 1edc4d5 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1381       +/-   ##
===========================================
+ Coverage   36.26%   46.32%   +10.05%     
===========================================
  Files         419      366       -53     
  Lines      183133   120470    -62663     
===========================================
- Hits        66421    55806    -10615     
+ Misses     108605    56996    -51609     
+ Partials     8107     7668      -439     
Files Coverage Δ
engine/helpers.go 82.29% <100.00%> (+2.13%) ⬆️
exchanges/support.go 100.00% <ø> (ø)
...seinternational/coinbaseinternational_websocket.go 23.82% <23.82%> (ø)
...ges/coinbaseinternational/coinbaseinternational.go 18.47% <18.47%> (ø)
...baseinternational/coinbaseinternational_wrapper.go 32.31% <32.31%> (ø)

... and 408 files with indirect coverage changes

… into update_tif # Please enter a commit message to

explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting
with '#' will be ignored, and an empty message aborts # the commit.
… into coinbaseintx

branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
@samuael samuael requested a review from shazbert November 15, 2025 06:08
@github-actions
Copy link

This PR is stale because it has been open 21 days with no activity. Please provide an update on the progress of this PR.

@github-actions github-actions bot added the stale label Dec 22, 2025
@github-actions github-actions bot removed the stale label Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review me This pull request is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants