-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a24bd1
commit 45f98aa
Showing
4 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/** | ||
* @author lin <[email protected]> | ||
* */ | ||
use \Lin\Bybit\BybitV5; | ||
|
||
require __DIR__ .'../../../vendor/autoload.php'; | ||
|
||
include 'key_secret.php'; | ||
|
||
$bybit=new BybitV5($key,$secret); | ||
|
||
//You can set special needs | ||
$bybit->setOptions([ | ||
//Set the request timeout to 60 seconds by default | ||
'timeout'=>10, | ||
|
||
'headers'=>[ | ||
//X-Referer or Referer - 經紀商用戶專用的頭參數 | ||
//X-BAPI-RECV-WINDOW 默認值為5000 | ||
//cdn-request-id | ||
'X-BAPI-RECV-WINDOW'=>'6000', | ||
] | ||
]); | ||
|
||
|
||
try { | ||
$result=$bybit->asset()->getDeliveryRecord([ | ||
'category'=>'linear' | ||
]); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r($e->getMessage()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* @author lin <[email protected]> | ||
* */ | ||
use \Lin\Bybit\BybitV5; | ||
|
||
require __DIR__ .'../../../vendor/autoload.php'; | ||
|
||
include 'key_secret.php'; | ||
|
||
$bybit=new BybitV5(); | ||
|
||
//You can set special needs | ||
$bybit->setOptions([ | ||
//Set the request timeout to 60 seconds by default | ||
'timeout'=>10, | ||
|
||
'headers'=>[ | ||
//X-Referer or Referer - 經紀商用戶專用的頭參數 | ||
//X-BAPI-RECV-WINDOW 默認值為5000 | ||
//cdn-request-id | ||
'X-BAPI-RECV-WINDOW'=>'6000', | ||
] | ||
]); | ||
|
||
|
||
try { | ||
$result=$bybit->market()->getOrderBook([ | ||
'category'=>'spot', | ||
'symbol'=>'BTCUSDT', | ||
]); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r($e->getMessage()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* @author lin <[email protected]> | ||
* */ | ||
use \Lin\Bybit\BybitV5; | ||
|
||
require __DIR__ .'../../../vendor/autoload.php'; | ||
|
||
include 'key_secret.php'; | ||
|
||
$bybit=new BybitV5($key,$secret); | ||
|
||
//You can set special needs | ||
$bybit->setOptions([ | ||
//Set the request timeout to 60 seconds by default | ||
'timeout'=>10, | ||
|
||
'headers'=>[ | ||
//X-Referer or Referer - 經紀商用戶專用的頭參數 | ||
//X-BAPI-RECV-WINDOW 默認值為5000 | ||
//cdn-request-id | ||
'X-BAPI-RECV-WINDOW'=>'6000', | ||
] | ||
]); | ||
|
||
|
||
try { | ||
$result=$bybit->position()->getList([ | ||
'category'=>'linear', | ||
'symbol'=>'BTCUSDT', | ||
]); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r($e->getMessage()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* @author lin <[email protected]> | ||
* */ | ||
use \Lin\Bybit\BybitV5; | ||
|
||
require __DIR__ .'../../../vendor/autoload.php'; | ||
|
||
include 'key_secret.php'; | ||
|
||
$bybit=new BybitV5($key,$secret); | ||
|
||
//You can set special needs | ||
$bybit->setOptions([ | ||
//Set the request timeout to 60 seconds by default | ||
'timeout'=>10, | ||
|
||
'headers'=>[ | ||
//X-Referer or Referer - 經紀商用戶專用的頭參數 | ||
//X-BAPI-RECV-WINDOW 默認值為5000 | ||
//cdn-request-id | ||
'X-BAPI-RECV-WINDOW'=>'6000', | ||
] | ||
]); | ||
|
||
|
||
try { | ||
$result=$bybit->user()->getQueryApi(); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r($e->getMessage()); | ||
} |