Skip to content
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

Coinbase: Update exchange implementation #1480

Open
wants to merge 104 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
a006163
Slight enhance of Coinbase tests
cranktakular Sep 12, 2023
074f367
Merge branch 'master' into coinbase_api_revamp
cranktakular Oct 8, 2023
bd9f2dd
Coinbase revamp; CreateReport is still WIP
cranktakular Oct 9, 2023
25fcd2e
More coinbase improvements; onto sandbox testing
cranktakular Oct 16, 2023
5d3fd99
Coinbase revamp continues
cranktakular Oct 23, 2023
3aca36b
Coinbase revamp continues
cranktakular Oct 23, 2023
f58b76d
Merge branch 'coinbase_api_revamp' of github.com:cranktakular/gocrypt…
cranktakular Oct 23, 2023
eded160
Coinbasepro revamp is ceaseless
cranktakular Oct 24, 2023
5a0ba23
Coinbase revamp, starting on advanced trade API
cranktakular Nov 1, 2023
88e6713
Coinbase Advanced Trade Starts in Ernest
cranktakular Nov 7, 2023
aa2efef
Coinbase revamp stage wrapper
cranktakular Nov 28, 2023
3560599
Merge branch 'master' into coinbase_api_revamp
cranktakular Nov 28, 2023
4593828
Coinbase wrapper coherence continues
cranktakular Nov 28, 2023
a8cae40
Coinbase wrapper continues writhing
cranktakular Dec 5, 2023
0564e45
Coinbase wrapper & codebase cleanup
cranktakular Dec 11, 2023
4f5ccb5
Coinbase updates & wrap progress
cranktakular Dec 19, 2023
9a6c7e6
More Coinbase wrapper progress
cranktakular Dec 27, 2023
2896b3e
Wrapper is wrapped, kinda
cranktakular Jan 2, 2024
ffb43d8
Test & type checking
cranktakular Jan 9, 2024
7dd4589
Coinbase REST revamp finished
cranktakular Jan 16, 2024
6d7ac5f
Merge branch 'master' into coinbase_api_revamp
cranktakular Jan 16, 2024
2881841
Post-merge fix
cranktakular Jan 16, 2024
2166886
WS revamp begins
cranktakular Jan 16, 2024
35eda67
WS Main Revamp Done?
cranktakular Jan 22, 2024
6ac86cd
CB websocket tidying up
cranktakular Jan 31, 2024
cfe6e11
Coinbase WS wrapperupperer
cranktakular Feb 6, 2024
2f770d5
Coinbase revamp done??
cranktakular Feb 14, 2024
3e54528
Merge branch 'master' into coinbase_api_revamp
cranktakular Feb 14, 2024
2f05c05
Linter progress
cranktakular Feb 20, 2024
005af4a
Continued lint cleanup
cranktakular Feb 20, 2024
2b5df7c
Further lint cleanup
cranktakular Feb 20, 2024
93d6722
Increased lint coverage
cranktakular Feb 20, 2024
529f7f3
Does this fix all sloppy reassigns & shadowing?
cranktakular Feb 20, 2024
8bb2561
Undoing retry policy change
cranktakular Feb 20, 2024
5f813e3
Documentation regeneration
cranktakular Feb 20, 2024
c7d7ac2
Coinbase code improvements
cranktakular Feb 27, 2024
8cdc78a
Providing warning about known issue
cranktakular Feb 27, 2024
19245e3
Merge branch 'master' into coinbase_api_revamp
cranktakular Feb 27, 2024
79ac205
Updating an error to new format
cranktakular Feb 27, 2024
e073757
Making gocritic happy
cranktakular Feb 27, 2024
a65fc38
Review adherence
cranktakular Mar 7, 2024
254efe7
Merge branch 'master' into coinbase_api_revamp
cranktakular Mar 7, 2024
14ab490
Endpoints moved to V3 & nil pointer fixes
cranktakular Mar 7, 2024
bee2878
Removing seemingly superfluous constant
cranktakular Mar 8, 2024
1d51a2e
Glorious improvements
cranktakular Apr 9, 2024
90e20e1
Merge master, resolving conflict
cranktakular Apr 14, 2024
4d1afc2
Removing unused error
cranktakular Apr 14, 2024
55596d8
Partial public endpoint addition
cranktakular Apr 15, 2024
343052b
Slight improvements
cranktakular Apr 22, 2024
ea43046
Wrapper improvements; still a few errors left in other packages
cranktakular Apr 30, 2024
6dbb243
A lil Coinbase progress
cranktakular May 7, 2024
f3fc162
Merge with master + improvements
cranktakular May 7, 2024
a5a3bad
Json cleaning
cranktakular May 7, 2024
742b21e
Lint appeasement
cranktakular May 7, 2024
71e0fa5
Config repair
cranktakular May 7, 2024
01ccd01
Config fix (real)
cranktakular May 7, 2024
228c3ba
Merge master maybe?
cranktakular May 30, 2024
91d4b24
Little fix
cranktakular May 30, 2024
75425fd
New public endpoint incorporation
cranktakular Jun 11, 2024
44ff400
Merge branch 'master' into coinbase_api_revamp
cranktakular Jun 11, 2024
eec8a5d
Additional fixes
cranktakular Jun 11, 2024
bbcc27b
Improvements & Appeasements
cranktakular Jun 11, 2024
e8a06e8
LineSaver
cranktakular Jun 11, 2024
d70d599
Merge branch 'master' into coinbase_api_revamp
cranktakular Jun 18, 2024
4b79d3f
Merge branch 'master' into coinbase_api_revamp
cranktakular Jul 30, 2024
d699631
Additional fixes
cranktakular Jul 30, 2024
0f18f8c
Another fix
cranktakular Jul 30, 2024
c0aa9a4
Fixing picked nits
cranktakular Aug 7, 2024
ac98019
Quick fixies
cranktakular Aug 7, 2024
8e1b87b
Merge branch 'master' into coinbase_api_revamp
cranktakular Aug 13, 2024
e372aea
Lil fixes
cranktakular Aug 13, 2024
d384ec2
Subscriptions: Add List.Enabled
gbjk Aug 23, 2024
9205394
CoinbasePro: Add subscription templating
gbjk Aug 21, 2024
13a3faf
fixup! CoinbasePro: Add subscription templating
gbjk Aug 27, 2024
62c48af
fixup! CoinbasePro: Add subscription templating
gbjk Aug 27, 2024
1dac1c1
Merge pull request #3 from gbjk/feature/coinbase_sub_conf_v2
cranktakular Aug 27, 2024
2e814d5
Comment fix
cranktakular Aug 27, 2024
57567f8
Merge branch 'coinbase_api_revamp' of github.com:cranktakular/gocrypt…
cranktakular Aug 27, 2024
02b88c4
Merge branch 'master' into coinbase_api_revamp
cranktakular Aug 27, 2024
06f8a6a
Subsequent fixes
cranktakular Aug 27, 2024
0e0c09e
Merge branch 'master' into coinbase_api_revamp
cranktakular Sep 2, 2024
9edf0c9
Issues hopefully fixed
cranktakular Sep 3, 2024
7e30794
Lint fix
cranktakular Sep 3, 2024
242efa3
Merge branch 'master' into coinbase_api_revamp
cranktakular Sep 17, 2024
329e039
Glorious fixes
cranktakular Sep 17, 2024
d797e69
Json formatting
cranktakular Sep 17, 2024
9925c88
ShazNits
cranktakular Sep 24, 2024
c88b057
(L/N)i(n/)t
cranktakular Sep 29, 2024
0eeb73c
Merge master and minor fixes
cranktakular Oct 8, 2024
4acb64d
Merge master and minor fixes
cranktakular Oct 16, 2024
5974421
Adding a test
cranktakular Oct 16, 2024
2a90b5d
Tiny test improvement
cranktakular Oct 16, 2024
3f6976c
Merge branch 'master' into coinbase_api_revamp
cranktakular Oct 29, 2024
3eb15db
Template patch testing
cranktakular Nov 5, 2024
38f2765
Fixes
cranktakular Nov 5, 2024
2cc9d0c
Merge branch 'master' into coinbase_api_revamp
cranktakular Nov 5, 2024
2fd8bb1
Further shaznits
cranktakular Nov 12, 2024
1229376
Merge branch 'master' into coinbase_api_revamp
cranktakular Nov 12, 2024
a4252ec
Lint nit
cranktakular Nov 12, 2024
ff6ce5f
JWT move and other fixes
cranktakular Nov 27, 2024
19fbf09
Small nits
cranktakular Dec 3, 2024
e1ba339
Shaznit, singular
cranktakular Dec 11, 2024
59a9d7b
Merge branch 'master' into coinbase_api_revamp
cranktakular Dec 12, 2024
80cb272
Post-merge fix
cranktakular Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding a test
cranktakular committed Oct 16, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 59744219d7d40d39bd32f624edcb054210c978b1
43 changes: 43 additions & 0 deletions exchanges/coinbasepro/coinbasepro_test.go
Original file line number Diff line number Diff line change
@@ -1372,6 +1372,49 @@ func TestUpdateOrderExecutionLimits(t *testing.T) {
assert.NoError(t, err)
}

func TestGetOrderRespToOrderDetail(t *testing.T) {
t.Parallel()
mockData := &GetOrderResponse{
OrderConfiguration: OrderConfiguration{
MarketMarketIOC: &MarketMarketIOC{},
LimitLimitGTC: &LimitLimitGTC{},
LimitLimitGTD: &LimitLimitGTD{},
StopLimitStopLimitGTC: &StopLimitStopLimitGTC{},
StopLimitStopLimitGTD: &StopLimitStopLimitGTD{},
},
SizeInQuote: false,
Side: "BUY",
Status: "OPEN",
Settled: true,
EditHistory: []EditHistory{(EditHistory{})},
}
resp := c.getOrderRespToOrderDetail(mockData, testPair, asset.Spot)
expected := &order.Detail{ImmediateOrCancel: true, Exchange: "CoinbasePro", Type: 0x40, Side: 0x2, Status: 0x8000, AssetType: 0x2, Date: time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), CloseTime: time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), LastUpdated: time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), Pair: testPair}
assert.EqualValues(t, expected, resp)
mockData.Side = "SELL"
mockData.Status = "FILLED"
resp = c.getOrderRespToOrderDetail(mockData, testPair, asset.Spot)
expected.Side = 0x4
expected.Status = 0x80
assert.EqualValues(t, expected, resp)
mockData.Status = "CANCELLED"
resp = c.getOrderRespToOrderDetail(mockData, testPair, asset.Spot)
expected.Status = 0x100
assert.EqualValues(t, expected, resp)
mockData.Status = "EXPIRED"
resp = c.getOrderRespToOrderDetail(mockData, testPair, asset.Spot)
expected.Status = 0x2000
assert.EqualValues(t, expected, resp)
mockData.Status = "FAILED"
resp = c.getOrderRespToOrderDetail(mockData, testPair, asset.Spot)
expected.Status = 0x1000
assert.EqualValues(t, expected, resp)
mockData.Status = "UNKNOWN_ORDER_STATUS"
resp = c.getOrderRespToOrderDetail(mockData, testPair, asset.Spot)
expected.Status = 0x0
assert.EqualValues(t, expected, resp)
}

func TestFiatTransferTypeString(t *testing.T) {
t.Parallel()
var f FiatTransferType