Skip to content

whalestackhq/sep6-client-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Whalestack SEP-6 Client (Ruby)

This client communicates with Whalestack's Stellar SEP-6 transfer server documented here. It lets you on- and off-ramp Bitcoin on the Stellar Network. This client is written in Ruby but we also provide clients in different programming languages.

Read our stellar.toml to inspect available Whalestack assets on the Stellar Network. At the time of writing we support wrapped Bitcoin and Litecoin.

Requirements

  • Ruby >= 2.0.0
  • rest-client >= 2.1.0
  • json >= 2.3.0

Installation with gem

gem install sep6_client

Usage Client

require 'sep_client/client'
client = Sep6Client::Client.new()

Examples

Deposit Bitcoin onto Stellar

response = client.get('/deposit', {
    :asset_code => 'BTC',
    :account => 'GDONUHZKLSYLDOZWR2TDW25GFXOBWCCKTPK34DLUVSOMFHLGURX6FNU6',
    :memo => 'Sent via SEP-6',
    :memo_type => 'text',
})
// print response.body -> {"how":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23","id":"f2118ef4115642870638616a4372","eta":600,"min_amount":"0.00001","max_amount":"100.0000000","extra_info":{}}

Returns a Bitcoin deposit address alongside some additional context information documented here. Bitcoin sent to the received deposit address is tokenized onto Stellar and sent to above account. The tokenized Bitcoin can be sent and received on the Stellar Network, exchanged for other assets on the SDEX, or be deposited into Stellar's liquidity pools.

Withdraw Bitcoin from Stellar

response = client.get('/withdraw', {
    :asset_code => 'BTC',
    :dest => 'bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23'
})
// print response.body -> {"account_id":"GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT","memo_type":"text","memo":"010cdf0a41410d75b2797a6fa38f","id":"010cdf0a41410d75b2797a6fa38f","min_amount":"0.0005000","max_amount":"100.0000000","fee_fixed":0.0002,"fee_percent":0.2,"extra_info":{"message":"An amount above 100.0000000 will take longer to complete"}}

Returns a Stellar account and memo alongside some additional context information documented here. Tokenized Bitcoin sent to the given account is burned on the Stellar Network and released into the Bitcoin address given in the request.

Documentation

Please inspect our SEP-6 API docs or email us at service [at] whalestack.com if you have questions.

Support and Feedback

We'd love to hear your feedback. If you have specific problems or bugs with this SDK, please file an issue on GitHub. For general feedback and support requests please email service [at] whalestack.com.

Contributing

  1. Fork it ( https://github.com/whalestackhq/ruby-merchant-sdk/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request