Norway


I’ve recently been experimenting with the and I’ve been having issues a ’s Ethereum, Litecoin and Bitcoin Cash balances and historic transactions. Currently, I’ve only managed to do this with Bitcoin, USD and EUR, which seems to be consistent with the behaviour of the demo supplied by Coinbase.

I have configured an application on the Coinbase API Access page using OAuth2 and the generated client ID and secret are being used within the app.

The issue seems to stem from the fact that I modified the Coinbase iOS SDK to allow me to pass the account parameter as
‘all’. This, I had hoped, would allow me to view details of all user accounts (ETH, BTC, LTC etc.) however, I only get BTC, USD and EUR when calling ‘getAccountsList’ on the Coinbase object.

NSString *accessToken = [response objectForKey:@"access_token"];
Coinbase *client = [Coinbase coinbaseWithOAuthAccessToken:accessToken];

[client getAccountsList:^(NSArray *accounts, CoinbasePagingHelper *paging, NSError *error) {
    for (CoinbaseAccount *account in accounts) {
        // Only BTC, USD and EUR are in the accounts array at this point. 
    }
}];

I suspect a solution to this would be to use API keys, as you are able to specify exactly which accounts to grant access to. I plan to distribute the app however, so this technique should not be used.

enter image description here  - W3Lou - objective c – Retrieving All User Wallets through Coinbase iOS SDK

Here is an example of the URL I am sending:

https://www.coinbase.com/oauth/authorize?response_type=code&client_id=CLIENT_ID_GOES_HERE&account=all&scope=balance%20transactions%20user&redirect_uri=com.example-name.example-app.coinbase-oauth%3A%2F%2Fcoinbase-oauth

Does anyone know how I can request access to all of a users accounts using OAuth and be able to retrieve details for each? Is the scope I defined incorrect in some way? The only alternative I can think of would be to request access one by one to each wallet and store individual access tokens. This wouldn’t be a great user experience however.

Thanks!



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here