bchavez / Coinbase

:moneybag: A .NET/C# implementation of the Coinbase API.

Home Page:https://developers.coinbase.com/api/v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transaction type Sell response...

Tjossul opened this issue · comments

Hello,

sadly, I have no experience with these responses but surely you have and could advice me.

Every transaction seems to have an ID to find the Buy/Sell information of it. I can find the Buy ID in transactions under

"buy": {
"id": XXX,
"resource": "buy",
"resource_path": "/v2/accounts/XXX"
}

But what about Sells?

I can receive all transactions calling something like

...await client.Transactions.ListTransactionsAsync(accountId, new Coinbase.PaginationOptions { Limit = 100 })...

The Buy ID is: transaction.Buy.Id.

But the transaction has no transaction.Sell.Id.

Does this mean that the Sell ID is transaction.Buy.Id too?

Thanks and regards.
Sebastian.

Hello again,

after reading again the transaction part of the CB doc I think this sentence proved me right, doesn't it?

"For certain types of transactions, also linked resources with type value as field will be included in the payload (example buy and sell)."

That's why we get a field "buy" with information for transaction types "buy" and should get a field "sell" for transaction types "sell".

What do you think?

Regards.
Sebastian.

I have no idea.

  1. Enable Fiddler debugging: https://github.com/bchavez/Coinbase/wiki/Debugging-with-Fiddler
  2. Inspect the JSON data returned from the Coinbase server using Fiddler.
  3. Determine if a Buy.Id or Sell.Id is present in the JSON data.
    Usually, you can access .ExtraJson property on any response object to retrieve JSON that has not been parsed into a C# type.
  4. If you find there is "extra json" not parsed, then submit a PR 1) with proof that the JSON property does exist; 2) the required changes to match the C# model with the JSON.