Git Product home page Git Product logo

sep6-client-php's Introduction

Whalestack SEP-6 Client (PHP)

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 PHP 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

  • PHP >=5.3.0
  • cURL extension for PHP
  • OpenSSL extension for PHP

Installation as Drop-In

Copy the contents of src into the include path of your project.

Usage Client

include('SEP6Client.class.php');
$client = new SEP6Client();

Examples

Deposit Bitcoin onto Stellar

$response = $client->get('/deposit', array(
    'asset_code' => 'BTC',
    'account' => 'GDONUHZKLSYLDOZWR2TDW25GFXOBWCCKTPK34DLUVSOMFHLGURX6FNU6',
    'memo' => 'Sent via SEP-6',
    'memo_type' => 'text'
));
// $response->responseBody -> {"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', array(
    'asset_code' => 'BTC',
    'dest' => 'bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23'
));
// $response->responseBody -> {"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/sep6-client-php/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

sep6-client-php's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.