PHP code example of kurisu / laravel-exincore-sdk

1. Go to this page and download the library: Download kurisu/laravel-exincore-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kurisu / laravel-exincore-sdk example snippets


'providers' => [
    ...
    Kurisu\ExinCore\ExinCoreServiceProvider::class,
],
'aliases' => [
    ...
    'MixinSDK' => Kurisu\ExinCore\Facades\ExinCore::class,
]

        // 账号配置信息
           'mixin_id'      => env('MIXIN_SDK_MIXIN_ID'),       //
           'client_id'     => env('MIXIN_SDK_CLIENT_ID'),      //
           'client_secret' => env('MIXIN_SDK_CLIENT_SECRET'),  //
           'pin'           => env('MIXIN_SDK_PIN'),            //
           'pin_token'     => env('MIXIN_SDK_PIN_TOKEN'),      //
           'session_id'    => env('MIXIN_SDK_SESSION_ID'),     //
           'private_key'   => '',                              //import your private_key
        

        // 使用 setConfig 方法,保存配置
        ExinCore::getMixinSDK()->setConfig('default',$config);
        

// 1. 查询指定交易对的行情
$baseAsset     = 'c94ac88f-4671-3976-b60a-09064f1811e8';   // uuid
$exchangeAsset = '815b0b1a-2764-3736-8faa-42d694fa620a';   // uuid

ExinCore::readExchangeList();                              // 查询全部交易对的行情
ExinCore::readExchangeList($baseAsset);                    // 查询 baseAsset 为 $baseAsset 的交易对的行情
ExinCore::readExchangeList($baseAsset, $exchangeAsset);    // 查询 baseAsset 为 $baseAsset , exchangeAsset 为 $exchangeAsset 的交易对的行情


// 2. 创建订单
ExinCore::createOrder($baseAsset, $exchangeAsset, 1);

    ExinCore::setRaw(true);    // or false , 默认为 false
    

    ExinCore::setBoom(false);  // or true , 默认为 true
    

    ExinCore::setTimeout(6);   // 默认为 10
    
bash 
$ php artisan vendor:publish --provider="Kurisu\ExinCore\ExinCoreServiceProvider"