質問内容
rubyの初心者です。
BitbankのAPIで注文を行いたいのですが
エラー番号:20001が出て発注できません。
ご指摘をおねがいいたします。
エラー
{"success":0,"data":{"code":20001}}
該当ソースコード
ruby
1 key = BB_KEY 2 secret = BB_SECRET 3 uri = URI.parse "https://api.bitbank.cc/v1/user/spot/order" 4 nonce = Time.now.to_i.to_s 5 6 body = { 7 "pair": "btc_jpy", 8 "amount": "0.01", 9 "price": "900000", 10 "side": "buy", 11 "type": "limit" 12 }.to_json 13 14 15 message = nonce + uri.to_s + body 16 signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new("sha256"), secret, message) 17 headers = { 18 "ACCESS-KEY" => key, 19 "ACCESS-NONCE" => nonce, 20 "ACCESS-SIGNATURE" => signature, 21 "Content-Type" => "application/json", 22 } 23 24 options = Net::HTTP::Post.new(uri.to_s, initheader = headers) 25 options.body = body 26 27 https = Net::HTTP.new(uri.host, uri.port) 28 https.use_ssl = true 29 response = https.request(options) 30 puts response.body 31

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。