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 information AccountInfo accountInfo = tradeService.getAccountInfo(); System.out.println("AccountInfo as String: " + accountInfo.toString()); } }
XChange 官网
https://github.com/timmolter/XChange
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。