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

Remove deprecated endpoints and enhanced transaction information by expanding Buy and Sell resources #89

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

astrohart
Copy link
Contributor

Removed the following endpoints, as they are totally offline (calling them gives a HTTP 410 Gone response:

  • Buys
  • Sells
  • Users

and their associated unit tests.

Update the List Transactions and Show Transaction methods in the Transactions endpoint, along with the Transaction model, to expand Buy and Sell resources inline.

* Now the Buy and Sell objects have been subsumed under the 'expanded' transaction object.  ShouldSerializeBuy() and ShouldSerializeSell() methods are used by Newtonsoft to conditionally deserialize transaction data.  They're automatically called.  If they return FALSE, then the corresponding property is not serialized.  For example, if a property is named Foo (the C# property name), then the corresponding method ShouldSerializeFoo() will dictate whether the corresponding 'Foo' property is serialized.
* Add a call to ListTransactionsAsync and GetTransactionAsync, respectively, to pass the ?expand=all query param.

This allows us to obtain full transaction and fees information.
@astrohart
Copy link
Contributor Author

Commit: 87f3d3e

image
Figure 1. The `TransactionTests are all passing.

As shown in Figure 1 above, the TransactionTests are passing. Commit 87f3d3e consists of the changes to make this so.

@astrohart
Copy link
Contributor Author

At 15:33 hours MST on 01/05/2024, I am moving on to fix the WithdrawTests. Usual notes on technique to fix.

* Also fixed the spelling of 'WithdrawlTests' to 'WithdrawalTests'
@astrohart
Copy link
Contributor Author

Commit: 8e6fa2f

image
Figure 1. The WithdrawalTests are passing.

As of 15:48 hours MST on 01/05/2024, I have made all the unit tests in WithdrawalTests pass, as shown in Figure 1.

@astrohart
Copy link
Contributor Author

Commit: 98b7443

image
Figure 1. Current API version.

I noticed, when logging into my coinbase.com account, that the API Version is 2021-06-05. I suggest that the value of the Coinbase.CoinbaseClient.ApiVersionDate constant be modified to reflect this value. See commit 98b7443.

@astrohart
Copy link
Contributor Author

image
Figure 1. Results of running the GitHubIssues suite of unit tests.

See *Figure 1. As of 15:56 hours MST on 01/05/2024, the GitHubIssues unit tests appear to pass with no further code changes.

@astrohart
Copy link
Contributor Author

astrohart commented Jan 5, 2024

As of 15:59 hours MST on 01/05/2024, I am now moving on to get all the DataTests to pass. I am working off of the usual assumption that the changes that need to be made are in a similar vein to those above. Any different root causes, I will document here.

@astrohart
Copy link
Contributor Author

As of 16:09 hours MST on 01/05/2024, I found that the unit test DataTests.can_get_currencies is failing partially because the line usd.Name.Should().StartWith("US Dollar"); is wrong. The Name property is now filled with United States Dollar. I propose that the testing line be changed to say usd.Name.Should().StartWith("United States Dollar");.

@astrohart
Copy link
Contributor Author

astrohart commented Jan 5, 2024

Commit: 078b3d2c76a32ae2f1fbb3ed4952cba4cb675fa1

image
Figure 1. All the DataTests are now passing.

As shown in Figure 1, all the DataTests are now passing. I cannot do the OAuthTests as they require a secrets.txt file to which I do not have access.

@astrohart
Copy link
Contributor Author

As of 16:17 hours MST on 01/05/2024, I deleted the entire UserTests fixture since Coinbase has sunsetted the Users endpoint. See commit c280012.

@astrohart
Copy link
Contributor Author

As of 16:21 hours MST on 01/05/2024, all the tests are passing except the OAuthTests since those are dependent on secrets you possess and I do not.

I am pushing commit f9d111e which deletes the [TestFixture] attribute from the CoinbaseApiKeyTests class. The [TestFixture] attribute is not needed. This class does not contain any unit tests.

@astrohart
Copy link
Contributor Author

@bchavez I am going to close this PR and recommend you merge it. I have gotten AppVeyor to stop yelling at me! :-)

@astrohart astrohart closed this Jan 5, 2024
@astrohart astrohart reopened this Jan 5, 2024
@astrohart
Copy link
Contributor Author

@bchavez Whoops, I think that closing the PR is not advisable since it will be difficult for you to merge it.

@astrohart
Copy link
Contributor Author

@bchavez Well, I am not sure what exactly the error

Could not detect any platforms from 'net6.0' in 'C:\Users\appveyor\.nuget\packages\fake.dotnet.nuget\6.0.0\lib\net6.0\Fake.DotNet.NuGet.dll', please tell the package authors

and those like it in AppVeyor mean, but could have something to do with this PR targeting Net 7.0 and not 6.0. Anyhow, can you please look into this? I would appreciate you considering this PR for merge. Thank you.

@astrohart
Copy link
Contributor Author

log.txt
File 1. AppVeyor logs from the latest build.

I am unsure of what to do at this juncture. It builds just fine on my PC, and all the unit tests (except the ones I cannot run due to not having the secrets.txt) pass. I am betting it's a configuration on the AppVeyor instance.

@astrohart
Copy link
Contributor Author

@bchavez I had an inspiration. Upon looking at the AppVeyor logs I found where it was locking down the versions of the SharpCompress, FSharp.Data, and secure-file NuGet packages to 0.22.0, 2.4.6, and 1.0.31, respectively.

Consulting the nuget.org website for each of those packages, I found that, while secure-file has not had a version upgrade recently, both SharpCompress and FSharp.Data have, to versions 0.35.0 and 6.3.0, respectively. I figured it would not hurt to upgrade the package versions in build.fsx under the Builder project.

I pushed commit 58681d9, which includes these changes.

@astrohart
Copy link
Contributor Author

@bchavez In the AppVeyor log, I see:

Script is not valid:
	C:\projects\coinbase\Source\Builder\Utils.fsx (3,10)-(3,17): Error FS0039: The namespace 'Runtime' is not defined.
	C:\projects\coinbase\Source\Builder\Utils.fsx (16,10)-(16,17): Error FS0039: The namespace 'Runtime' is not defined.

Other than that, I give up. I ask for your assistance. I simply do not know F# and I think I need to prevail upon yourself to fix the config for the new .NET targets.

Thank you!

@astrohart
Copy link
Contributor Author

As of 16:54 hours MST on 01/05/2024, I decided to re-target the .NET COre multi-targeting of the Coinbase project to .NET 6 to see if that will make it play nicer with AppVeyor. I think .NET Core 7 has not been released on AppVeyor yet.

@bchavez
Copy link
Owner

bchavez commented Jan 6, 2024

Thanks for the investigation and PR.

Yes, the problem is the F# Builder tooling. F# FAKE build https://fake.build has been a bit of a pain because of the exact problems you're running into. I've recently migrated my open-source projects to NUKE build: https://nuke.build

A more recent example of Builder using NUKE build can be found here: https://github.com/BitArmory/Turnstile/tree/master/Builder

Basically, migrating to NUKE build is the first step in getting this repo running/building again. The NUKE build migration will have to be done in a separate PR when I can get to it. As you can see, there's a bit of maintenance work to keep things going.

@bchavez
Copy link
Owner

bchavez commented Jan 6, 2024

Just merged PR #91 to get the repo building again.

@astrohart
Copy link
Contributor Author

Please review my PR and merge what you deem appropriate! I tried to be super thorough in my comments and I tried to be prodigious about writing down which Commit SHA each comment goes with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants