mnin / coinbase-moneymoney

Fetches balances from Coinbase API and returns them as securities
MIT License
23 stars 3 forks source link

Setup fails: API endpoint /accounts/primary not found #7

Closed panique closed 3 years ago

panique commented 3 years ago

Hey there, this extension doesnt work with latest MoneyMoney for me, when setting it up I get a successful call to api.coinbase.com/v2/user like below (it then shows my correct real name etc) ....

 Web Banking Engine: Using user-supplied extension Coinbase.lua version 1.50.
  Protocol version: Web Scraping
  Server address: https://api.coinbase.com
  Sending: GET https://api.coinbase.com/v2/user

but then fails to get any further date with the call to /v2/accounts/primary. Any ideas what's happening? API keys are correct and there are balances on the account.

Web Banking account: Coinbase (Main)
Lade Wertpapierbestand für Coinbase ...
Sending: GET https://api.coinbase.com/v2/accounts/primary
The server responded with the error message: Not Found. Retrying...
Sending: GET https://api.coinbase.com/v2/accounts/primary
HTTPS response: Not Found
mnin commented 3 years ago

I looked at the Coinbase website for a while, unfortunately it doesn't really describe why the /accounts call doesn't just return all accounts. Then I saw the trick they do themselves on their website: limit=100.

I posted the bug fix in the src/ directory and will push this new version signed soon.

If you want, you can try it with the beta version of MoneyMoney.

mnin commented 3 years ago

@panique the signed version is updated, feel free to try it out https://github.com/mnin/coinbase-moneymoney/blob/master/dist/Coinbase.lua

panique commented 3 years ago

@mnin Thank you so much! Works perfectly for me! Little side-note: The API key needs to have all the coin wallets listed that the user wants to see (I needed some time to find out why i could only see 2 of 3 wallets inside MoneyMoney)

mnin commented 3 years ago

@panique I have now added the screenshots to the README.md which show you how you can or should configure the API Key.