Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 3.51 KB

README.md

File metadata and controls

64 lines (48 loc) · 3.51 KB

Whalestack SEP-6 Client (Node JS)

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 Node JS 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

  • NodeJS >= 10.14.0
  • axios >= 0.21.1

Installation with npm

npm install sep6-client

Usage Client

const Sep6Client = require('sep6-client');
const client = new Sep6Client();

Examples

Deposit Bitcoin onto Stellar

let response = await client.get('/deposit', {
    'asset_code': 'BTC',
    'account': 'GDONUHZKLSYLDOZWR2TDW25GFXOBWCCKTPK34DLUVSOMFHLGURX6FNU6',
    'memo': 'Sent via SEP-6',
    'memo_type': 'text'
});
// console.log(response.data) -> {"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

let response = await client.get('/withdraw', {
    'asset_code': 'BTC',
    'dest': 'bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23'
});
// console.log(response.data) -> {"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/nodejs-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