Running into List Accounts Problem(s)

Hello all,

I am running into a weird problem with List Accounts that I am hoping to track down.

  1. Note that the authorizing user can select a wallet, and one of the options is BTC:

  2. Next, select a non-BTC wallet. In this case, I select BSV:

  3. Getting the access token from authorized user, I run:

curl https://api.coinbase.com/v2/accounts -H "CB-VERSION: 2022-05-22" -H "Authorization: Bearer <access_token>"

This is where it gets weird. Note the results:

{
    "pagination": {
        "ending_before": null,
        "starting_after": null,
        "previous_ending_before": null,
        "next_starting_after": null,
        **"limit": 203,**
        "order": "desc",
        "previous_uri": null,
        "next_uri": null
    },
    "data": [{
            "id": "**ETC**",
            "name": "ETC Wallet",
            "primary": true,
            "type": "wallet",
            "currency": {
                "code": "ETC",
                "name": "Ethereum Classic",
                "color": "#59D4AF",
                "sort_index": 103,
                "exponent": 8,
                "type": "crypto",
                "address_regex": "^(?:0x)?[0-9a-fA-F]{40}$",
                "asset_id": "c16df856-0345-5358-8a70-2a78c804e61f",
                "slug": "ethereum-classic"
            },
            "balance": {
                "amount": "0.00000000",
                "currency": "ETC"
            },
            "created_at": null,
            "updated_at": null,
            "resource": "account",
            "resource_path": "/v2/accounts/ETC",
            "allow_deposits": true,
            "allow_withdrawals": true
        }, {
...
  1. Note that there are 203 returned records. This means all the records for the account, correct? And since there is no paging information, the returned result set is supposed to be 203 records? When counting all items, it seems that only 201 records are returned.

  2. Note further that ETC is the first account returned when according to this answer, it should be BSV since it was the selected wallet in the authorization screen, correct?

  3. As mentioned, there are actually only 201 items in the data in the result set. The BTC wallet shown earlier (and ETH) wallets are not listed/found in the results. In fact, none of the listed options of authorized wallet access are returned.

Any clarification/assistance that anyone can lend towards addressing these points of confusion would be greatly appreciated.

Hello @Mike-E! Thank you for taking an interest in trying out Coinbase APIs. For the details regarding your concern, we will check on this for you with our team. We will get back to you once we have more information. Keep in touch!

2 Likes

Note that this problem seems to go away if I request account=all. I get 207 returned accounts rather than 203, and BTC/ETH are among them. So it would seem this is a bug when account=select (the default value)

Hello @Mike-E! Thank you for reaching out to us. To make sure that we are on the same page, we would like to confirm the following:

  1. Are you asking why you are getting a result of 203 records and 201 records without the pagination when running the List Accounts using the access token?
  2. Are you asking if why the returned data of the List accounts includes unauthorized wallets after calling the List Accounts with the access token?

You also mentioned that when trying to call the list accounts, you were not able to receive the BSV wallet that the user authorized. Are you experiencing this issue only with the BSV wallet?

Hi @leo.lemuel.federico thank you for your patience here as I attempt to explain this issue, which is indeed nontrivial.

Note that this only occurs when using an access token created from the https://www.coinbase.com/oauth/authorize endpoint when account=select (default value). An access token created with the account=all appears to grab all accounts/wallets as expected.

To answer your questions (hopefully :grin:):

  1. When using an account=select access token the JSON results feature a limit:203 but if I actually count all returned elements, there are 201. Additionally, important non-selected wallets such as BTC/ETH are missing.
  2. No. I do appreciate your patience again as I attempt to explain this complex issue. It simply appears that the data returned does not match the described data in its own response. The JSON response declares a limit of 203 (which I interpret as the total expected count in the result list), but the actual results are 201.

Finally, as for BSV, please disregard this as I have not seen this since reporting it. When selecting a wallet that appears to work as expected now and I have not been able to reproduce this problem. I will continue to monitor it for you, however.

Please do let me know if there are any further questions I can answer or information that I can provide to further track down this issue for you.