微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

XChange

程序名称:XChange

授权协议: MIT

操作系统: 跨平台

开发语言: Java

XChange 介绍

XChange 是一个提供简单和一致的 API 用于和多样化的金融安全交换数据,包括
Bitcoin支持

示例代码

package com.xeiam.xchange.examples.mtgox.v1.polling;

import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.ExchangeFactory;
import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.dto.Trade.AccountInfo;
import com.xeiam.xchange.service.Trade.polling.PollingTradeService;

/**
 * Demo requesting account info at MtGox
 */
public class AccountInfoDemo {

  private static PollingTradeService TradeService;

  public static void main(String[] args) {

    // Use the factory to get the version 1 MtGox exchange API using default settings
    ExchangeSpecification exchangeSpecification = new ExchangeSpecification("com.xeiam.xchange.mtgox.v1.MtGoxExchange");
    exchangeSpecification.setApiKey("150c6db9-e5ab-47ac-83d6-4440d1b9ce49");
    exchangeSpecification.setSecretKey("olHM/yl3CAuKMXFS2+xlP/MC0Hs1M9snHpaHwg0UZW52Ni0Tf4FhGFELO9cHcDNGKvFrj8CgyQUA4VsMTZ6dXg==");
    exchangeSpecification.setUri("https://mtgox.com");
    exchangeSpecification.setVersion("1");
    Exchange mtgox = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification);

    // Interested in the private Trading functionality (authentication)
    TradeService = mtgox.getPollingTradeService();

    // Get the account @R_844_4045@ion
    AccountInfo accountInfo = TradeService.getAccountInfo();
    System.out.println("AccountInfo as String: " + accountInfo.toString());
  }
}

XChange 官网

https://github.com/timmolter/XChange

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐