christopherhaws / gdax-dotnet Goto Github PK
View Code? Open in Web Editor NEWDotNet Core GDAX Exchange API
License: MIT License
DotNet Core GDAX Exchange API
License: MIT License
Only have the most recent SDK on my machine
>dotnet --list-sdks 1.1.0 [C:\Program Files\dotnet\sdk] 2.2.101 [C:\Program Files\dotnet\sdk]
And receive the following error when attempting to open Solution/repository
A compatible SDK version for global.json version: [2.0.0-preview2-006497] from [C:\gdax-dotnet\global.json] was not found Did you mean to run dotnet SDK commands? Please install dotnet SDK from: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 Done: 2147516561.
Able to fix by changing global.json to support newest stable version of .NET Core
{
"sdk": {
"version": "2.2.101"
}
}
Working on a PR
I know you have not implemented any Post requests, but when I am sending a post request for an order or withdrawal, it does not seem to pass any params.
I have added the params, and also tried with no Post params at all, and the error is always ;
{"message":"Missing product_id"}
{"message":"currency is required"}
`public async Task<Order> SubmitMarketOrderCrypto(Side side, String productID, Double size, Double funds, OrderType orderType = OrderType.Market)
{
var request = new GdaxRequestBuilder("/orders", HttpMethod.Post)
.AddParameterIfNotNull("side", ((Side)side).ToString())
.AddParameterIfNotNull("product_id", productID)
.AddParameterIfNotNull("type", ((OrderType)orderType).ToString())
.AddParameterIfNotNull("size", ((Double)size).ToString())
.AddParameterIfNotNull("funds", ((double)size).ToString())
.Build();
return (await this.GetResponse<Order>(request).ConfigureAwait(false)).Value;
}`
This was working in my Branch, its no longer working.
Inner Exception 1:
JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Gdax.Models.PaymentMethodLimit' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '[0].limits.buy', line 1, position 416.
GetProductTicker
does work as expected. I've doubled checked my key, passphrase and secret and have all the permissions set. Any idea what might cause this?
GetAccounts
is also failing.
I'm not using the Sandbox.
Have set up sandbox correctly and modified secrets. All tests pass except one. I do have orders in the sandbox account. Noob dev here so troubleshooting tests is challenging. Output of failing test:
Test Name: Gdax.Tests.Orders.GetOrdersQueryTests.GetOrders_ShouldAllowOlderAndNewerPage
Test FullName: Gdax.Tests.Orders.GetOrdersQueryTests.GetOrders_ShouldAllowOlderAndNewerPage (88cce4e0ae8de4f259a987a892197b44a7dffbd8)
Test Source: C:\Users\delan\Documents\GitHub\gdax-dotnet\Gdax.Tests\Orders\GetOrdersQueryTests.cs : line 26
Test Outcome: Failed
Test Duration: 0:00:00.783
Result StackTrace:
at Gdax.PagedResults2.PreviousPage() in C:\Users\delan\Documents\GitHub\gdax-dotnet\Gdax\Paging\PagedResults.cs:line 30
at Gdax.Tests.Orders.GetOrdersQueryTests.<GetOrders_ShouldAllowOlderAndNewerPage>d__1.MoveNext() in C:\Users\delan\Documents\GitHub\gdax-dotnet\Gdax.Tests\Orders\GetOrdersQueryTests.cs:line 39
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Result Message: Gdax.GdaxException : Cannot determine before page.
Guessing this is perhaps an API change since they've added so many new Products. But need Product now to perform this.
Fixing this with client.GetFills(productId: "BTC-USD", paging: new PagingOptions<Int32?>
.
Working on PR.
Test Name: Gdax.Fills.GetFillsQueryTests.GetFills_ShouldAllowOlderAndNewerPage
Test FullName: Gdax.Fills.GetFillsQueryTests.GetFills_ShouldAllowOlderAndNewerPage
Test Source: C:\gdax-dotnet\Gdax.Tests\Fills\GetFillsQueryTests.cs : line 26
Test Outcome: Failed
Test Duration: 0:00:24.669
Result StackTrace:
at Gdax.GdaxClient.GetResponse(GdaxRequest request) in C:\gdax-dotnet\Gdax\GdaxClient.cs:line 75
at Gdax.GdaxClient.GetResponse[TResponse](GdaxRequest request) in C:\gdax-dotnet\Gdax\GdaxClient.cs:line 50
at Gdax.GdaxClient.GetFills(String orderId, String productId, PagingOptions`1 paging) in C:\gdax-dotnet\Gdax\GdaxClient.Fills.cs:line 18
at Gdax.Fills.GetFillsQueryTests.GetFills_ShouldAllowOlderAndNewerPage() in C:\gdax-dotnet\Gdax.Tests\Fills\GetFillsQueryTests.cs:line 51
--- End of stack trace from previous location where exception was thrown ---
Result Message: Gdax.GdaxException : query must contained either product_id or order_id
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.