简体   繁体   中英

Invalid scope error

I'm trying to send bitcons using coinbase ruby gem but I'm having a hard time getting it to work. I'm authenticating like this:

c = Coinbase::Wallet::Client.new(api_key: ENV["COINBASE_KEY"], api_secret: ENV["COINBASE_SECRET"])
ca = c.account(User.last.account.account_id)

ca.send(to: ENV["BITCOIN_ADDRESS"], amount: '0.0001', currency: 'BTC')

This is the error I'm getting back.

Coinbase::Wallet::InvalidScopeError: Api::BaseController::InvalidScopeError

To be clear, the API key has the required permission set in the dashboard. what could i be doing wrong?

The new Ruby gem uses API v2 which requires v2 scope, wallet:transactions:send instead of v1's send . Can you check that you have this enabled?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM