Ccxt: 找不到 Coinmarketcap 上的比特币黄金和 Nimiq

创建于 2018-01-10  ·  3评论  ·  资料来源: ccxt/ccxt

你好,

当我尝试获取比特币黄金和 nimiq 的当前价格时,我遇到了问题。
当我打电话给fetch_ticker我得到了 Bitgem 和 NetCoin。 这似乎与https://github.com/ccxt/ccxt/issues/348https://github.com/ccxt/ccxt/issues/1147
https://github.com/ccxt/ccxt/issues/867

目前 coinmarketcap 上有 1398 种货币。 我认为名称重叠在未来不是唯一的。 但是怎么对付他们呢?

https://github.com/ccxt/ccxt/issues/348你告诉过,市值较高的硬币获胜。 但它似乎在 PHP 中不起作用。

提前致谢

  • 操作系统:Debian
  • 编程语言:PHP
  • CCXT 版本:“1.10.579
  • 交易所:Coinmarketcap
  • 方法:fetch_ticker
$cmc = new \ccxt\coinmarketcap();
print_r($cmc->fetch_ticker('BTG/USD'));

print_r($cmc->fetch_ticker('NET/USD'));

$found = false;
foreach ($cmc->fetch_tickers() as $ticker) {
    if($ticker['info']['id'] == 'nimiq') {
        $found = true;
    }
}

var_export($found);
(
    [symbol] => BTG/USD
    [timestamp] => 1515601740000
    [datetime] => 2018-01-10T16:29:00.000+00:00
    [high] => 
    [low] => 
    [bid] => 
    [ask] => 
    [vwap] => 
    [open] => 
    [close] => 
    [first] => 
    [last] => 11.1172
    [change] => 11.21
    [percentage] => 
    [average] => 
    [baseVolume] => 
    [quoteVolume] => 17999.5
    [info] => Array
        (
            [id] => bitgem
            [name] => Bitgem
            [symbol] => BTG
            [rank] => 828
            [price_usd] => 11.1172
            [price_btc] => 0.00075009
            [24h_volume_usd] => 17999.5
            [market_cap_usd] => 664864.0
            [available_supply] => 59805.0
            [total_supply] => 59805.0
            [max_supply] => 
            [percent_change_1h] => 3.64
            [percent_change_24h] => 11.21
            [percent_change_7d] => 95.0
            [last_updated] => 1515601740
        )

)
Array
(
    [symbol] => NET/USD
    [timestamp] => 1515601741000
    [datetime] => 2018-01-10T16:29:01.000+00:00
    [high] => 
    [low] => 
    [bid] => 
    [ask] => 
    [vwap] => 
    [open] => 
    [close] => 
    [first] => 
    [last] => 0.00844807
    [change] => -11.78
    [percentage] => 
    [average] => 
    [baseVolume] => 
    [quoteVolume] => 112679
    [info] => Array
        (
            [id] => netcoin
            [name] => NetCoin
            [symbol] => NET
            [rank] => 568
            [price_usd] => 0.00844807
            [price_btc] => 0.00000057
            [24h_volume_usd] => 112679.0
            [market_cap_usd] => 6649702.0
            [available_supply] => 787126712.0
            [total_supply] => 787126712.0
            [max_supply] => 
            [percent_change_1h] => 3.11
            [percent_change_24h] => -11.78
            [percent_change_7d] => 298.4
            [last_updated] => 1515601741
        )

)
false

所有3条评论

非常感谢😄

@slideup-benni 感谢您的报告!

没问题
不幸的是,我刚刚找到了另一个:Basic Attention Token BAT,但它返回BatCoin。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

Fcl69 picture Fcl69  ·  3评论

werewere picture werewere  ·  3评论

jjhesk picture jjhesk  ·  3评论

nashse picture nashse  ·  3评论

luigikitten picture luigikitten  ·  3评论