bchavez / Coinbase

:moneybag: A .NET/C# implementation of the Coinbase API.
https://developers.coinbase.com/api/v2
MIT License
170 stars 92 forks source link

Adding Validations #50

Open granthoff1107 opened 5 years ago

granthoff1107 commented 5 years ago

We should Add validations for certain things such as creating transactions. When creating transactions amounts should be fixed at 8 decimal places, etc

bchavez commented 5 years ago

Does Coinbase give back an error if the number of decimal places is off?

I prefer not to have any (or very little) validation in the client and have all validation being done on their servers. Mostly for maintenance reasons, as their limits/validation-rules can change over time wont require us to change too.

It could be helpful to have the client throw before an HTTP request gets sent; however, if the consumer gets the same error result client-side as they do server-side, then I think it would just be duplicate validation work.

IMHO, we should just provide the minimum transport mechanism to get requests on-boarded to their server network to do work.

What other validation did you have in mind besides the fixed 8 decimal places?

granthoff1107 commented 5 years ago

Good point, yeah I was getting an error when trying to send from the server.

I don't remember what it was but, but I think it was vague like incorrect amount instead of, the amount has too much precision.

It was a vague error so I figured we could save others the headache.

But it's not too important

On Fri, Jan 4, 2019, 3:32 PM Brian Chavez <notifications@github.com wrote:

Does Coinbase give back an error if the number of decimal places is off?

I prefer not to have any (or very little) validation in the client and have all validation being done on their servers. Mostly for maintenance reasons, as their limits/validation-rules can change over time wont require us to change too.

It could be helpful to have the client throw before an HTTP request gets sent; however, if the consumer gets the same error result client-side as they do server-side, then I think it would just be duplicate validation work.

IMHO, we should just provide the minimum transport mechanism to get requests on-boarded to their server network to do work.

What other validation did you have in mind besides the fixed 8 decimal places?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bchavez/Coinbase/issues/50#issuecomment-451560172, or mute the thread https://github.com/notifications/unsubscribe-auth/AMsMnT8kzfjwau_b71VdzhoCtS-AC_Naks5u_7pWgaJpZM4ZkYNR .