New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

25 mBTC Bounty - Refactor xchange-btcchina module #297

Closed
timmolter opened this Issue Feb 7, 2014 · 13 comments

Comments

Projects
None yet
3 participants
@timmolter
Member

timmolter commented Feb 7, 2014

Rules for bounties and the explanation of the refactor can be found here: #270

Classes that need to be split:

BTCChinaAccountService
BTCChinaMarketDataService
BTCChinaTradeService

Relevant example classes should also be updated to show both raw and generic polling functions

@ObsessiveOrange

This comment has been minimized.

Show comment
Hide comment
@ObsessiveOrange

ObsessiveOrange Feb 13, 2014

Contributor

I'll take it.

Contributor

ObsessiveOrange commented Feb 13, 2014

I'll take it.

@timmolter

This comment has been minimized.

Show comment
Hide comment
@timmolter

timmolter Feb 13, 2014

Member

@ObsessiveOrange make sure pull in the latest changes to the develop branch first.

Member

timmolter commented Feb 13, 2014

@ObsessiveOrange make sure pull in the latest changes to the develop branch first.

@timmolter

This comment has been minimized.

Show comment
Hide comment
@timmolter

timmolter Feb 13, 2014

Member

Pull request #312, BTC Address: 16HQ6vU58THxHvLS7Qx9Es8uvTWAtwHyGr

Member

timmolter commented Feb 13, 2014

Pull request #312, BTC Address: 16HQ6vU58THxHvLS7Qx9Es8uvTWAtwHyGr

@timmolter

This comment has been minimized.

Show comment
Hide comment
@timmolter

timmolter Feb 13, 2014

Member

25 mBTC sent to 16HQ6vU58THxHvLS7Qx9Es8uvTWAtwHyGr
https://blockchain.info/address/16HQ6vU58THxHvLS7Qx9Es8uvTWAtwHyGr

Member

timmolter commented Feb 13, 2014

25 mBTC sent to 16HQ6vU58THxHvLS7Qx9Es8uvTWAtwHyGr
https://blockchain.info/address/16HQ6vU58THxHvLS7Qx9Es8uvTWAtwHyGr

@timmolter timmolter closed this Feb 13, 2014

@ObsessiveOrange

This comment has been minimized.

Show comment
Hide comment
@ObsessiveOrange

ObsessiveOrange Feb 13, 2014

Contributor

Thank you very much. You've been most kind, helping me get the hang of this.

Contributor

ObsessiveOrange commented Feb 13, 2014

Thank you very much. You've been most kind, helping me get the hang of this.

@timmolter

This comment has been minimized.

Show comment
Hide comment
@timmolter

timmolter Feb 13, 2014

Member

My pleasure. Thank you!

Member

timmolter commented Feb 13, 2014

My pleasure. Thank you!

@jheusser

This comment has been minimized.

Show comment
Hide comment
@jheusser

jheusser Feb 24, 2014

Collaborator

@ObsessiveOrange I just tested this and it seems market data functions only work when replacing the host "api.btcchina.com" with "data.btcchina.com" and vice-versa, otherwise I get json deserialisation errors (which would make sense since this is what the API docs say). Do the market data examples work for you with api.btcchina.com?

Thanks!

Collaborator

jheusser commented Feb 24, 2014

@ObsessiveOrange I just tested this and it seems market data functions only work when replacing the host "api.btcchina.com" with "data.btcchina.com" and vice-versa, otherwise I get json deserialisation errors (which would make sense since this is what the API docs say). Do the market data examples work for you with api.btcchina.com?

Thanks!

@ObsessiveOrange

This comment has been minimized.

Show comment
Hide comment
@ObsessiveOrange

ObsessiveOrange Feb 25, 2014

Contributor

Hmm. I tested it again, and it still seems to work for me on
api.btcchina.com. The last time I updated my copy of the xchange library
was 9 days ago. could there be some changes since that made it not work?

First few lines of the console output for trades;
13:35:24.473 [default] [main] DEBUG
com.xeiam.xchange.ExchangeFactory - Creating default exchange from class
name
Trades
[trade=Trade [type=ASK, tradableAmount=0.009, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3282.05, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785781, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.009, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.69, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785782, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.97, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.05, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785783, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=1, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.03, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785784, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.05, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.01, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785785, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.5, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.01, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785786, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.5, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280, timestamp=Tue Feb 25 13:32:58 SGT
2014, id=4785787, orderId=null]]

Ticker:
13:39:00.730 [default] [main] DEBUG
com.xeiam.xchange.ExchangeFactory - Creating default exchange from class
name
Last: CNY 3253.99
Volume: 16641.60900000
High: CNY 3637.99
Low: CNY 3250.00
Last: 3253.99
Volume: 16641.60900000
High: 3637.99
Low: 3250.00

Depth:
Asks:
100000000000000, 0.046,
27182818300000, 0.001,
10000000000000, 0.02,
1000000000000, 0.001,
999999999999, 0.02,
666666667000, 0.001,
271828183000, 0.001,

On Tue, Feb 25, 2014 at 5:55 AM, jheusser notifications@github.com wrote:

@ObsessiveOrange https://github.com/ObsessiveOrange I just tested this
and it seems market data functions only work when replacing the host "
api.btcchina.com" with "data.btcchina.com" and vice-versa, otherwise I
get json deserialisation errors (which would make sense since this is what
the API docs say). Do the market data examples work for you with
api.btcchina.com?

Thanks!


Reply to this email directly or view it on GitHubhttps://github.com/timmolter/XChange/issues/297#issuecomment-35944177
.

Contributor

ObsessiveOrange commented Feb 25, 2014

Hmm. I tested it again, and it still seems to work for me on
api.btcchina.com. The last time I updated my copy of the xchange library
was 9 days ago. could there be some changes since that made it not work?

First few lines of the console output for trades;
13:35:24.473 [default] [main] DEBUG
com.xeiam.xchange.ExchangeFactory - Creating default exchange from class
name
Trades
[trade=Trade [type=ASK, tradableAmount=0.009, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3282.05, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785781, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.009, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.69, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785782, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.97, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.05, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785783, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=1, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.03, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785784, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.05, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.01, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785785, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.5, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280.01, timestamp=Tue Feb 25 13:32:58
SGT 2014, id=4785786, orderId=null]]
[trade=Trade [type=ASK, tradableAmount=0.5, tradableIdentifier=BTC,
transactionCurrency=CNY, price=CNY 3280, timestamp=Tue Feb 25 13:32:58 SGT
2014, id=4785787, orderId=null]]

Ticker:
13:39:00.730 [default] [main] DEBUG
com.xeiam.xchange.ExchangeFactory - Creating default exchange from class
name
Last: CNY 3253.99
Volume: 16641.60900000
High: CNY 3637.99
Low: CNY 3250.00
Last: 3253.99
Volume: 16641.60900000
High: 3637.99
Low: 3250.00

Depth:
Asks:
100000000000000, 0.046,
27182818300000, 0.001,
10000000000000, 0.02,
1000000000000, 0.001,
999999999999, 0.02,
666666667000, 0.001,
271828183000, 0.001,

On Tue, Feb 25, 2014 at 5:55 AM, jheusser notifications@github.com wrote:

@ObsessiveOrange https://github.com/ObsessiveOrange I just tested this
and it seems market data functions only work when replacing the host "
api.btcchina.com" with "data.btcchina.com" and vice-versa, otherwise I
get json deserialisation errors (which would make sense since this is what
the API docs say). Do the market data examples work for you with
api.btcchina.com?

Thanks!


Reply to this email directly or view it on GitHubhttps://github.com/timmolter/XChange/issues/297#issuecomment-35944177
.

@timmolter

This comment has been minimized.

Show comment
Hide comment
@timmolter

timmolter Feb 25, 2014

Member

There was a commit a while ago changing data to api: fd1c72d

I confirmed with the BTC-China's docs that that was a valid change. Now looking at the docs again today, they say to use data.

http://btcchina.org/api-market-data-documentation-en

It could be that the private API uses api and the public data API uses data now.

http://btcchina.org/api-trade-documentation-en

Member

timmolter commented Feb 25, 2014

There was a commit a while ago changing data to api: fd1c72d

I confirmed with the BTC-China's docs that that was a valid change. Now looking at the docs again today, they say to use data.

http://btcchina.org/api-market-data-documentation-en

It could be that the private API uses api and the public data API uses data now.

http://btcchina.org/api-trade-documentation-en

@jheusser

This comment has been minimized.

Show comment
Hide comment
@jheusser

jheusser Feb 25, 2014

Collaborator

Yes, that's how it looks like. All market data work only with data, all authenticated and trade functions only work with api. I can make a PR for it to feed through the different hosts to the RestProxyFactory via the exchangeSpecificParameters if we agree that's the right solution.

Collaborator

jheusser commented Feb 25, 2014

Yes, that's how it looks like. All market data work only with data, all authenticated and trade functions only work with api. I can make a PR for it to feed through the different hosts to the RestProxyFactory via the exchangeSpecificParameters if we agree that's the right solution.

@ObsessiveOrange

This comment has been minimized.

Show comment
Hide comment
@ObsessiveOrange

ObsessiveOrange Feb 25, 2014

Contributor

Hmm. Interesting. I just updated all the files to the ones on the develop
branch, then it stopped working. I'm trying to roll the changes to my fork
back to before I pulled the new changes in, but I can't figure out how to
do it for the life of me.

It worked just before I pulled and updated my files.
On Feb 25, 2014 7:57 PM, "jheusser" notifications@github.com wrote:

Yes, that's how it looks like. All market data work only with data, all
authenticated and trade functions only work with api. I can make a PR for
it to feed through the different hosts to the RestProxyFactory via the
exchangeSpecificParameters if we agree that's the right solution.

Reply to this email directly or view it on GitHubhttps://github.com/timmolter/XChange/issues/297#issuecomment-36000353
.

Contributor

ObsessiveOrange commented Feb 25, 2014

Hmm. Interesting. I just updated all the files to the ones on the develop
branch, then it stopped working. I'm trying to roll the changes to my fork
back to before I pulled the new changes in, but I can't figure out how to
do it for the life of me.

It worked just before I pulled and updated my files.
On Feb 25, 2014 7:57 PM, "jheusser" notifications@github.com wrote:

Yes, that's how it looks like. All market data work only with data, all
authenticated and trade functions only work with api. I can make a PR for
it to feed through the different hosts to the RestProxyFactory via the
exchangeSpecificParameters if we agree that's the right solution.

Reply to this email directly or view it on GitHubhttps://github.com/timmolter/XChange/issues/297#issuecomment-36000353
.

@timmolter

This comment has been minimized.

Show comment
Hide comment
@timmolter

timmolter Feb 25, 2014

Member

@jheusser sounds good to me.

Member

timmolter commented Feb 25, 2014

@jheusser sounds good to me.

@jheusser

This comment has been minimized.

Show comment
Hide comment
Collaborator

jheusser commented Feb 25, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment