Skip to content

Commit

Permalink
Merge pull request #32 from semsaksoy/master
Browse files Browse the repository at this point in the history
Current average price for a symbol.
  • Loading branch information
0xjmp authored Apr 6, 2022
2 parents 0755c99 + 6388038 commit 7a9cdbb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/binance/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ def trades!(symbol: nil, limit: 500, api_key: nil, api_secret_key: nil)
Request.send!(api_key_type: :read_info, path: "/api/v1/trades", params: params,
api_key: api_key, api_secret_key: api_secret_key)
end

def avg!(symbol: nil, api_key: nil, api_secret_key: nil)
raise Error.new(message: "symbol is required") unless symbol
params = { symbol: symbol }
Request.send!(api_key_type: :read_info, path: "/api/v3/avgPrice", params: params,
api_key: api_key, api_secret_key: api_secret_key)
end

private

Expand Down

0 comments on commit 7a9cdbb

Please sign in to comment.