Download the PHP package arnezt/binancephpsdk without Composer

On this page you can find all versions of the php package arnezt/binancephpsdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package binancephpsdk

binance-php-sdk

(Fork from hammadtq/binance-php-sdk Porting to composer) This repository contains the PHP-SDK to interact with Binance DEX. It's supported by mostly pure PHP code. The documentation for Binance DEX supported methods is here.

Installation

At the moment, you will have to clone the repo and include it in your project. In the future, it will be available through composer. (Added: Available via composer):

composer require arnezt/binancephpsdk

The SDK relies on secp256k1-php. There is currently no easy method to install secp256k1-php extension, you will need compile it yourself.

To Install:

(First check (Ubuntu/Debian) if phpize has available: sudo apt install php7.x-dev)

libsecp256k1:

git clone [email protected]:bitcoin-core/secp256k1 && \
cd secp256k1 &&                                    \
./autogen.sh &&                                    \
./configure --enable-experimental --enable-module-{ecdh,recovery} && \
 make &&                                           \
 sudo make install &&                              \
 cd ../

secp256k1-php:

git clone [email protected]:Bit-Wasp/secp256k1-php && \
cd secp256k1-php/secp256k1 &&                      \
phpize &&                                          \ 
./configure --with-secp256k1 &&                    \  
make && sudo make install &&                       \
cd ../../

(Optional) - Enable extension by default!

If you're a heavy user, you can add this line to your php.ini files for php-cli, apache2, or php-fpm.

extension=secp256k1.so

(Added: Check php conf (php7.x-fpm if using fpm) change x with your php version):

$ sudo nano /etc/php/7.x/mods-available/secp256k1.ini

add: extension=secp256k1.so

$ sudo ln -s /etc/php/7.x/mods-available/secp256k1.ini /etc/php/7.x/fpm/conf.d/20-secp256k1.ini (for fpm)

$ sudo ln -s /etc/php/7.x/mods-available/secp256k1.ini /etc/php/7.x/cli/conf.d/20-secp256k1.ini (for cli)

The repository was made on Mac OSX using PHP version 7.15.3. You will also need a version above 7. It is advised to go with native PHP installation instead of going with XAMPP or WAMPP so to take advantage of secp256k1-php natively. Also, you may need gmp extension.

To handle big numbers, the SDK makes use of brick/math precision library. Please consider using this or another bcmath or gmp based solutions while dealing with blockchain based numbers.

Examples

Note: Please see Issue Tracker to understand what methods are currently available in the sdk.

You can find full example scripts in the src folder.

Few examples to interact with SDK are below:

Keystore reload and getting private key

Similary, if you want to see the hex of private key, simply use this method:

$keystore->getPrivateKey()->getHex();

A typical transfer request will look something like this:

Placing an order

Amino Encoding

The SDK uses Google proto3 generator to support Binance's aminor encoding/decoding. If you ever include new messages to the proto file, run following command to run the generator from the root:

protoc --proto_path=proto --php_out=./gen proto/dex.proto

Key Generation

Key generation is supported via secp256k1-php library as well.

Once you generate an address, make sure to send an amount on it as the Binance DEX will not make an account unless a transaction is received on an address.

Supported Methods

Many thanks to https://github.com/hammadtq/binance-php-sdk has provided the original source code.


All versions of binancephpsdk with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ~6.0
graze/guzzle-jsonrpc Version ^3.2
bitwasp/buffertools Version ^0.5.7
google/protobuf Version ^3.11
brick/math Version ^0.8.14
bitwasp/bitcoin Version ^1.0
ramsey/uuid Version ^4.0
php Version >=7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package arnezt/binancephpsdk contains the following files

Loading the files please wait ....