When my app requests wallet:accounts:read permission
using v2 of Coinbase API, the user is presented with a drop-down list of all accounts where he can choose only one of the three possible wallets. If my app wants to work with all three wallets (e.g. BTC, ETC, LTC), what is an elegant solution? Connecting with OAuth three times, each time requesting the user to grant access to a specific wallet is not a clean workaround. How can the app request permission to all of the accounts with a single request?
Asked
Active
Viewed 1,047 times
5

sherlock
- 2,397
- 3
- 27
- 44
-
I have this same question! I emailed CoinBase yesterday, will update if they get back to me before you get an answer. – Ruben Martinez Jr. Dec 17 '17 at 20:02
-
Please do, it's ridiculous – sherlock Dec 17 '17 at 21:48
-
I strongly feel they messed up. There's no way I can pull info from multiple accounts as shown here: https://developers.coinbase.com/api/v2?shell#list-accounts – sherlock Dec 19 '17 at 06:23
-
Yeah, I know what you mean. Super frustrating...Still haven't heard back from them. – Ruben Martinez Jr. Dec 20 '17 at 15:11
-
I'm finally in touch with them, we're working to figure out what the issue is...I'll keep this updated if we get to the bottom of it. – Ruben Martinez Jr. Dec 30 '17 at 00:08
-
@RubenMartinezJr. Thanks a lot for the update :-) Please keep posting here. – sherlock Dec 30 '17 at 01:02
-
Still working on it—probably gonna be waiting another week for their response — but seems to be related to the scope permissions grant. If you create a Developer Access Token from the API portal, giving it permissions "wallet:accounts:read", using that on the `accounts` API returns all of my accounts, like we'd expect it to with the access token granted during oauth. – Ruben Martinez Jr. Dec 30 '17 at 02:55
-
I noticed it earlier. Access token, indeed, has access to all of the accounts. However, OAuth2 is preferred over access tokens for an user-facing application as per the guideline. – sherlock Dec 30 '17 at 04:14
-
Yep, that was just a clue that the issue was with the oauth flow. I figured it out! Posting answer. – Ruben Martinez Jr. Dec 30 '17 at 05:11
1 Answers
5
According to the Coinbase docs, in the GET https://www.coinbase.com/oauth/authorize
portion of the Oauth flow, you can optionally specify the parameter accounts
to configure which accounts your application has access to.
Change the account access the application will receive. Available values:
select
(default) Allow user to pick the wallet associated with the application
new
Application will create a new wallet (named after the application)
all
Application will get access to all of user’s walletsFor backward compatibility all is used as default for applications created prior to this change
Adding this parameter allowed me to get access to all accounts associated with a user!

Ruben Martinez Jr.
- 3,199
- 5
- 42
- 76
-
-
I've forked the Coinbase iOS SDK repo and added the `account=all` parameter which successfully requests the user to grant access to all accounts. I'm still having issues actually accessing the account details however. Using `getAccountsList` on the Coinbase object returns only the BTC, GBP and EUR accounts (no LTC, ETH or BCH). Any suggestions as to why this might be? Scope is defined as `@"user balance, transactions"`. – user3746428 Jan 05 '18 at 16:53
-
It's worth mentioning that the Coinbase example app produces the same results (only BTC and fiat wallets). – user3746428 Jan 05 '18 at 17:33
-
Coinbase official SDK points to v1.0 endpoints. I had to fork the repo and repoint the functionality that I needed such as balance and transaction queries to v2. I have also added the 'accounts' param as described above as well – Dmitry Miller Jan 23 '18 at 20:50
-
I'm using the original Coinbase SDK. No fork. in stead, next to the `wallet:accounts:read` scope, I also add `["accounts": "all"] ` as meta argument to the `startAuthentication ` method and I use the .doGet method with the api v2 accounts endpoint as argument (so `coinbase.doGet("https://api.coinbase.com/v2/accounts", parameters: nil) {(response, error) -> Void in ` to get details for all accounts. – guido Mar 12 '18 at 18:33