BitShares Forum

Main => Technical Support => Topic started by: bulletproof on August 04, 2015, 01:13:08 pm

Title: Testing client 0.x Ruby API
Post by: bulletproof on August 04, 2015, 01:13:08 pm
Hi

I'm writing a Ruby version of xeroc's excellent Python API (https://github.com/xeroc/python-bitsharesrpc) and before I go placing live orders using my own account  :o I need a test account. Is there such a thing & if so what config (url/port/credentials) do I use?

Happy to grapheneise the API as required in due course

Cheers
Title: Re: Testing client 0.x Ruby API
Post by: Riverhead on August 04, 2015, 01:20:23 pm

Interesting project.

The safest way I have found is to just create a new wallet and a throw away account. Populate the throwaway account with a few BTS and have at it. With the CLI it's easy to open/close different wallets on the same chain. Only the GUI is hard(ish) coded to the "default" wallet.
Title: Re: Testing client 0.x Ruby API
Post by: bulletproof on August 04, 2015, 01:30:02 pm
Thanks for the suggestion Riverhead, I'll try that
Title: Re: Testing client 0.x Ruby API
Post by: bulletproof on August 04, 2015, 03:24:07 pm
OK, so need a helping hand with orders on the CLI please. CLI 0.9.2 built on Mac OS X, blockchain synced and works fine otherwise. I'm using it successfully to get blockchain data, wallet data etc, but stuck submitting orders. Wallet is open and unlocked and I'd have expected the following to place an order:-

Code: [Select]
wallet_market_submit_bid <my account> 1 BTC 1 BTS
I expect this to be a order to buy 1 BTC at limit price of 1 BTS - so unlikely to be filled  ;). I get this error:

Code: [Select]
37001 invalid_market: invalid market
Tried different market (asset pairs), searched wiki & professor Google, no joy. Any pointers much appreciated..
 
Title: Re: Testing client 0.x Ruby API
Post by: xeroc on August 04, 2015, 03:51:47 pm
afaik bids are working the other way round:
Code: [Select]
wallet_market_submit_bid <my account> 1 BTS 1 BTC
Title: Re: Testing client 0.x Ruby API
Post by: roadscape on August 04, 2015, 04:52:13 pm
If you're working in Ruby, you may find this useful: https://github.com/bitshares/web_services/blob/master/faucet/lib/BitShares/bitshares_api.rb
Title: Re: Testing client 0.x Ruby API
Post by: bulletproof on August 04, 2015, 05:24:17 pm
will try that @xeroc, best to get that right..

thanks @roadscape, hadn't seen that code!
Am planning on packaging the API as a Gem so Ruby/Rails projects can integrate the BitShares client :D
Title: Re: Testing client 0.x Ruby API
Post by: roadscape on August 04, 2015, 05:46:33 pm
Awesome, keep us updated. I'll soon need to update http://cryptofresh.com to work with Graphene and it would be great to use your gem.
Here's my repo: https://github.com/roadscape/cryptofresh