Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
21bd64ae
Commit
21bd64ae
authored
Apr 03, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
21f3b6a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
Hadax.php
common/service/exchange/Hadax.php
+22
-1
No files found.
common/service/exchange/Hadax.php
View file @
21bd64ae
...
...
@@ -11,12 +11,17 @@ namespace common\service\exchange;
use
linslin\yii2\curl\Curl
;
use
Yii
;
class
Hadax
extends
HuoBi
class
Hadax
extends
Exchange
implements
ExchangeInterface
{
protected
$supported_symbol
=
'supported_symbol_hadax'
;
protected
$quotation_prefix
=
'quotation_hadax_'
;
protected
$base_url
=
'https://api.hadax.com'
;
public
function
formatSymbol
(
$tag
=
'BTC'
,
$aim
=
'USDT'
)
{
return
strtolower
(
trim
(
$tag
)
.
trim
(
$aim
));
}
public
function
setSupportedSymbol
()
{
$curl
=
new
Curl
();
...
...
@@ -30,4 +35,19 @@ class Hadax extends HuoBi
}
}
}
public
function
setQuotation
()
{
$curl
=
new
Curl
();
$api
=
$this
->
base_url
.
'/market/tickers'
;
$res
=
$curl
->
get
(
$api
,
false
);
if
(
$res
&&
$res
[
'status'
]
==
'ok'
)
{
$datas
=
$res
[
'data'
];
foreach
(
$datas
as
$item
)
{
$key
=
$this
->
quotation_prefix
.
$item
[
'symbol'
];
$this
->
redis
->
hmset
(
$key
,
'low'
,
$item
[
'low'
],
'high'
,
$item
[
'high'
],
'last'
,
$item
[
'close'
]);
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
$item
[
'symbol'
]);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment