queball99 / CoinbasePro-Recurring-Buy

A Python app to automate buying cryptocurrency on the Coinbase Pro exchange. Runs in a Docker container for convenience.
GNU General Public License v3.0
42 stars 4 forks source link

Getting InvalidAuthorization #10

Open cesalo opened 3 years ago

cesalo commented 3 years ago

This the error I'm getting:

Traceback (most recent call last):
  File "/app/./recurring-buy.py", line 165, in <module>
    schedule.run_pending()
  File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 780, in run_pending
    default_scheduler.run_pending()
  File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 100, in run_pending
    self._run_job(job)
  File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 172, in _run_job
    ret = job.run()
  File "/usr/local/lib/python3.9/site-packages/schedule/__init__.py", line 661, in run
    ret = self.job_func()
  File "/app/./recurring-buy.py", line 122, in recurring_buy
    result = add_funds(buy_total, current_funds, max_fund, fund_source, currency)
  File "/app/./recurring-buy.py", line 77, in add_funds
    deposit = auth_client.deposit(amount=fund_amount, currency=currency, payment_method_id=payment_id)
  File "/usr/local/lib/python3.9/site-packages/coinbasepro/auth_client.py", line 774, in deposit
    r = self._send_message(
  File "/usr/local/lib/python3.9/site-packages/coinbasepro/public_client.py", line 474, in _send_message
    self._check_errors_and_raise(r)
  File "/usr/local/lib/python3.9/site-packages/coinbasepro/public_client.py", line 433, in _check_errors_and_raise
    raise InvalidAuthorization(message)
coinbasepro.exceptions.InvalidAuthorization: Forbidden

The key seems to be ok - Wondering if maybe the issue is with this part: "Fund-Source" : "default" Is there a way to specify an account? Thanks.