Binance REST API Wrapper for Laravel 5

in #utopian-io7 years ago (edited)

I needed to grab data from Binance Exchange today and decided to find a composer-friendly Laravel wrapper. It's a fine and lightweight source but some improvements could make it better. I had to improve and add something to the repository. My pull request approved by repo owner today.

Bug Fixes

  • PHPDoc lines
    If you use an IDE (for sure), documenting your code is pretty good for you and the developers, who comes after you. I redefined / created / changed all the variables carefully, exceptions and descriptions so on.
    PHPDoc.PNG

  • SSL Issue for local development
    Some users potentially experience SSL based security issue while they are requesting to the API. So I made it settable in the .env file but it is true by default. There is no risk, but if you face this issue, set if false to by-pass.

Exception
CURL error: SSL certificate problem: unable to get local issuer certificate

SSL Verify.PNG

New Features

  • recvWindow is important for safe trading over the API.
    As in the official documentation openly described, you should take care of unstable and unreliable networks. So you can set your parameter in .env file but as it written, it's 5000 by default.
  • getRecentTrades() function added
    v3/myTrades endpoint is available to use now. It grabs last max. 500 trades of a symbol.

Improvements

  • Unused lines removed
    It's always good and important for the performance and the following developer to keep the code clean.
    Removed Lines.PNG
  • The code is much readable (it depends on your coding style) but I try to follow PHP-FIG — PHP Framework Interop Group rules.
  • I replaced most of " characters to ' for better performance if we do not output something with variables.

You can find my pull-request here:
https://github.com/adman9000/laravel-binance/commit/2aaa77d6163d7de2a70ab8b67883a8ccc3cee81c#diff-caecf4a2aa32b8d7e6dda2bfb7fd4740R25

As an user of this repo, if you give a hand to add more endpoints, I will love it.

Kind regards!



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

Please provide proof of work, since your steem id and github id do not match.

The code does look better now, it is easier to read.

You're explanations of your improvements are well done.

You can contact us on Discord.
[utopian-moderator]

Thank you! Please find steemit profile link in my bio and match my name after - dash. If you need any update on my profile, I can update to prove my work.

Hey @helo, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Useful! Thanks a lot :)

Hey @ikidnapmyself I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 80610.66
ETH 3119.79
USDT 1.00
SBD 2.71