Getting Started

Stellar's SEP-6 (Stellar Ecosystem Proposal 6) defines the protocol for building a compliant bridge between the Stellar network and other blockchains or bank networks. This enables Stellar-based assets to be easily deposited into and withdrawn from a user's Stellar account using regular blockchain or bank transactions.

SEP-6 ensures that these processes are standardized, making it easier for wallet developers and other Stellar integrators to add support for multiple anchors without having to adjust their implementation for each one. It provides a defined set of API endpoints and expected behaviors, along with a specification of how assets should be represented.

It's worth noting that SEP-6 is part of a larger suite of Stellar Ecosystem Proposals, each of which defines a particular component of the Stellar ecosystem, aiming to ensure that the entire network remains interoperable and standardized.

Whalestack SEP-6

This Stellar SEP-6 transfer service enables you to tokenize (deposit) and detokenize (withdraw) Bitcoin and Litecoin on the Stellar Network. Access it programmatically or make deposits and withdrawals using our web interface.

Whalestack's Assets

Assets on the Stellar Network are digital (tokenized) representations of anything of value.
Whalestack issues assets for Bitcoin and Litecoin as listed below. Show more.

Transparency

Whalestack prioritizes full transparency with its SEP-6 transfer server. All transactions are openly auditable. For your peace of mind, we disclose details like circulating supply, hot and cold wallet addresses, account specifics, blockchain transaction IDs, and balances. Funds in our custody remain securely within our hot or cold wallets, used solely for SEP-6 transfers.

For Developers

The Stellar SEP-6 offers a standardized way for various Stellar applications, be it wallets, exchanges, or end-users, to seamlessly interact with asset issuers—whether referred to as anchors, bridges, or ramps. For comprehensive insights into Whalestack's SEP-6 implementation, see our developer documentation.

Market Makers and Arbitrageurs

Whalestack's assets are integrally woven into our payment processing platform. This ensures a steady stream of traffic to liquidity pools, thereby generating conversion fees and spurring arbitrage opportunities. Dive into our liquidity pool documentation or reach out for more information.

Trustlines

To interact with our SEP-6 transfer server, ensure you have a funded Stellar account and established trustlines for the desired asset. Notably, our SEP-6 service is permission-less, so there's no need for authentication or even a Whalestack account to begin.

Whalestack Assets

Assets are digital (tokenized) representations of anything of value on the Stellar Network. They are typically backed by fiat or cryptocurrencies. Whalestack issues assets for Bitcoin and Litecoin as listed below. Please note that Whalestack's only official and valid issuer web domain is whalestack.com.

Bitcoin (on Stellar) Create Trustline
BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT (copied)
Deposit Info Withdrawal Info
Min. amount: 0.0005 BTC
Max. amount: 100 BTC
Fee (fixed): 0 BTC
Fee (percent): 0 %
Min. amount: 0.0005 BTC
Max. amount: 100 BTC
Fee (fixed): 0 BTC
Fee (percent): 0 %

Trustlines

On the Stellar network, when you utilize a SEP-6 asset, you're essentially placing trust in the service provider, like Whalestack, to securely manage your deposits and honor your withdrawals. This notion of trust is embodied in Stellar through the concept of trustlines. Trustlines are markers added to your Stellar account that allow you to hold a particular token. They delineate the maximum quantity of that token you're prepared to hold.

To trade, receive, or even hold any asset on the Stellar network, a trustline with the asset's issuing account is mandatory. This issuing account pertains to the service provider's Stellar account that originated the asset. Trustlines are established via the change trust operation, and each incurs a base reserve fee of 0.5 XLM. Essentially, for every trustline you create, an unspendable reserve of 0.5 XLM is mandated until such a time the trustline is dissolved.

Assets by Whalestack

To set up trustlines, you'll require the asset code, the issuer account, and occasionally, the issuer domain as delineated below.

Bitcoin (on Stellar) Issuer Domain: whalestack.com
BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT (copied)

Adding Trustlines via Wallets

Many Stellar wallets and exchanges feature intuitive interfaces that facilitate the addition and removal of trustlines for various assets. Renowned Stellar platforms include Freighter, Albedo, xBull, StellarX, Rabet, Lumenswap, Scopuly, LOBSTR, and StellarTerm. For those seeking a custom approach, the Stellar Laboratory provides tools to craft personalized change trust operations securely.

It's worth mentioning that we don't endorse any external services. We advocate for either programmatic approaches (detailed below) or the use of the Stellar Laboratory.

Adding Trustlines Programmatically

If you wish to programmatically add a trustline, ensure you have access to one of the Stellar SDKs, a sufficiently funded Stellar account alongside its secret key, and code lines to implement the change trust operation. Here's a JavaScript snippet exemplifying the addition of trustlines for Whalestack's Bitcoin and Litecoin Stellar assets. Remember, if you aim to delete a trustline later, set the trustline limit parameter in your operation to 0, post clearing any asset balances (if present).

const sdk = require('stellar-sdk');
const server = new sdk.Horizon.Server('https://horizon.stellar.org');

// Whalestack's Assets
const BtcAsset = new sdk.Asset('BTC', 'GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT');
const LtcAsset = new sdk.Asset('LTC', 'GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT');

(async function main() {

    const keyPair = sdk.Keypair.fromSecret(process.env.secretKey);
    const account = await server.loadAccount(keyPair.publicKey());
    const fee = await server.fetchBaseFee();

    const transaction = new sdk.TransactionBuilder(account, {
        fee, networkPassphrase: sdk.Networks.PUBLIC
    })
    .addOperation(
        sdk.Operation.changeTrust({
            source: keyPair.publicKey(),
            asset: BtcAsset,
            amount: "922337203685.4775807"
        })
    )
    .addOperation(
        sdk.Operation.changeTrust({
            source: keyPair.publicKey(),
            asset: LtcAsset,
            amount: "922337203685.4775807"
        })
    )
    .setTimeout(30)
    .build();

    // sign the transaction
    transaction.sign(keyPair);

    try {
        const transactionResult = await server.submitTransaction(transaction);
        console.log(transactionResult);
    } catch (e) {
        console.error(e.message);
    }

})()

Liquidity Pools

Engaging in liquidity pools is open and permissionless. Whalestack's primary liquidity pools are XLM/BTC and BTC/LTC. These pools predominantly come into play during asset exchange transactions on Whalestack. Our selection of these pairs is twofold: Firstly, they're recognized trading pairs on mainstream centralized exchanges, facilitating ease of arbitrage mapping. Secondly, this choice ensures that BTC and LTC always have a route to other significant assets on the network via XLM.

BTC/XLM Pool ID View on Explorer
84cf93f8d1c22e150b8f0022b3c9a39d03976da6b5143818327bf298358ce5e7 (copied)
XLM 500312.1234567
BTC 2.3212345

Role of Market Makers and Arbitrageurs

On the Whalestack platform, actions such as checkouts, deposits, swaps, and withdrawals, tap into the liquidity of the aforementioned pools whenever there's an asset exchange. More often, this exchange is between Bitcoin or Litecoin and a fiat stablecoin, like USDC. As a result, the Whalestack platform consistently generates unidirectional pool traffic, paving the way for arbitrage opportunities. Alongside, general public trading on the Stellar Network also consumes liquidity and contributes to volume. If you're a market maker or an arbitrageur, we invite you to delve deeper and engage with us.

Engaging with Liquidity Pools

Before diving in, we advocate familiarizing yourself with liquidity pool concepts and understanding the risks associated with impermanent loss. Some insightful resources include: Liquidity, Liquidity, Liquidity, Introducing Automated Market Makers on Stellar, and AMMs in the Stellar Ecosystem.

Participation in liquidity pools requires no permissions. To effectively engage, you must establish trustlines for the assets and their respective liquidity pools. Several Stellar wallets, such as xBull, Lumenswap, LOBSTR, and StellarX, offer interfaces to facilitate deposits and withdrawals. However, we don't formally endorse any third-party platforms. We recommend directly engaging with pools programmatically or via the Stellar Laboratory to retain full control over keys, security, and customization.

Guidance for Developers

The Stellar Development Foundation has meticulously documented the nuances of programmatic liquidity pool participation. We suggest referencing this comprehensive guide. It encompasses examples ranging from liquidity pool creation and deposits to withdrawals and liquidity pool monitoring.

Deposit

Tokenizes and deposits Bitcoin or Litecoin onto the Stellar Network.

  • Select Source Network
  • Bitcoin
  • Target Asset (credited to you on Stellar)
Bitcoin (on Stellar) Create Trustline
BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT (copied)
Min. amount: 0.0005 BTC
Max. amount: 100 BTC
Fee (fixed): 0 BTC
Fee (percent): 0 %
  • Target Stellar Account (public key)
  • Stellar Account (found)
  • Memo (optional)
  • Memo Type (optional)

Your Deposit Address is Ready

Make the deposit to transfer funds into your Stellar account.

Deposit Address (send funds here)
bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23 (copied)

Target Account on Stellar (Memo: )
GBSY6HJZLWBUUNJHHDLDE3AIBSQCHI6UMIMWOLZ6GUWI3NPPLP6QNGI2 (copied)
Transfer Request ID (use this to query your transfer status)
085a2e4aca82edd52d12b37388da (copied)

View Transfer Status

Withdraw

Detokenizes Bitcoin or Litecoin assets on Stellar and redeems them to their native blockchain.

  • Select Target Network
  • Bitcoin
  • Source Asset (send this asset on Stellar to redeem onto )
Bitcoin (on Stellar)
BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT (copied)
Min. amount: 0.0005 BTC
Max. amount: 100 BTC
Fee (fixed): 0 BTC
Fee (percent): 0 %
  • Target Address

Your Stellar Withdrawal Account is Ready

Make a payment on Stellar to transfer funds to your address.

Stellar Withdrawal Account (send funds here)
GBSY6HJZLWBUUNJHHDLDE3AIBSQCHI6UMIMWOLZ6GUWI3NPPLP6QNGI2(copied)
Memo (mandatory)
memo (copied)
Memo Type
Text

Don't forget to include the memo

Please make sure to include the memo as indicated above in your Stellar withdrawal transaction. Payments without the memo cannot be identified.


Target Address on
bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23 (copied)
Transfer Request ID (use this to query your transfer status)
085a2e4aca82edd52d12b37388da (copied)

View Transfer Status

Transfer Status

Queries the SEP-6 transfer status for a given transfer request or blockchain transaction id.

  • Query by...
  • SEP-6 Transfer Request ID
    Stellar Tx ID
    Bitcoin or Litecoin Tx ID
  • SEP-6 Transfer Request ID

API Documentation

Whalestack's SEP-6 Transfer API allows you to seamlessly tokenize (deposit) and detokenize (withdraw) Bitcoin and Litecoin on the Stellar Network. This guide outlines the steps necessary to achieve that.

Introduction to Stellar SEP-6

Stellar SEP-6 establishes a standardized approach for wallets, exchanges, end-users, and Stellar applications to seamlessly interface with asset issuers, often referred to as anchors, bridges, or ramps, like Whalestack. For a comprehensive understanding, you can review its official documentation. However, if you're looking for a concise starting point, we've distilled the essentials for you below.

Whalestack's SEP-6 Transfer Server

The Whalestack SEP-6 transfer server is hosted at sep6.whalestack.com. Interacting with it is straightforward: send HTTP GET requests and interpret the responses. To facilitate this, employ a REST client tailored to your preferred programming language (we offer implementations for PHP, NodeJS, and Ruby) or utilities like cURL or wget. Notably, since all SEP-6 endpoints are accessed via HTTP GET, a browser window could suffice for rudimentary interactions. Whalestack operates under the domain whalestack.com. You can view our stellar.toml configuration here.

Getting Started

Before diving in, ensure you possess a funded Stellar account with established trustlines to the asset you intend to transact with. Our SEP-6 implementation is permissionless, negating the need for authentication or even a Whalestack account.

API Endpoints

The transfer server presents five endpoints, all conforming to the SEP-6 specification and accessible via HTTP GET. Detailed specifications for these endpoints can be explored here.

  • /info Provides a descriptive object detailing the features and context of the SEP-6 transfer server.
  • /deposit Offers an object containing essential deposit information, laying out the steps to transfer funds and receive tokenized assets on Stellar.
  • /withdraw Presents an object detailing withdrawal procedures, including how to redeem assets back to their native blockchain.
  • /transaction Retrieves information on a specific SEP-6 deposit or withdrawal transaction.
  • /transactions Lists all transactions associated with the SEP-6 transfer server.

Examples

Deposit Bitcoin onto Stellar

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

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

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

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

SEP-6 REST Clients

The SEP-6 transfer server works with any REST client in any programming language, and we've published SDKs for PHP, Ruby, and NodeJS on our GitHub to help you get started quickly.

GET/infopublic

Returns an object containing feature description and context information about the SEP-6 transfer server. Conforms to the official Stellar SEP-6 definitions described here.

Request

curl 'https://sep6.whalestack.com/info'

Success Response application/json

{
   "deposit":{
      "BTC":{
         "enabled":true,
         "min_amount":0.0001,
         "max_amount":100,
         "fee_fixed":0,
         "fee_percent":0,
         "authentication_required":false
      },
      "LTC":{
         "enabled":true,
         "min_amount":0.00001,
         "max_amount":10000,
         "fee_fixed":0,
         "fee_percent":0,
         "authentication_required":false
      }
   },
   "withdraw":{
      "BTC":{
         "enabled":true,
         "min_amount":0.0005,
         "max_amount":100,
         "fee_fixed":0.0002,
         "fee_percent":0.2,
         "authentication_required":false,
         "types":{
            "crypto":{
               "fields":{
                  "dest":{
                     "description":"The Bitcoin target address in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH).",
                     "optional":false
                  }
               }
            }
         }
      },
      "LTC":{
         "enabled":true,
         "min_amount":0.0005,
         "max_amount":10000,
         "fee_fixed":0.0002,
         "fee_percent":0.2,
         "authentication_required":false,
         "types":{
            "crypto":{
               "fields":{
                  "dest":{
                     "description":"The Litecoin target address in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH).",
                     "optional":false
                  }
               }
            }
         }
      }
   },
   "transaction":{
      "enabled":true,
      "authentication_required":false
   },
   "transactions":{
      "enabled":true,
      "authentication_required":false
   },
   "features":{
      "account_creation":false,
      "claimable_balances":false
   },
   "fee":{
      "enabled":false
   },
   "deposit-exchange":{
      "enabled":false
   },
   "withdraw-exchange":{
      "enabled":false
   },
   "supply":{
      "BTC":{
         "circulating_supply":5.671082,
         "circulating_supply_components":{
            "amount":1.0399347,
            "claimable_balances_amount":0,
            "liquidity_pools_amount":4.6311473
         },
         "hotwallet_reserves":1.6826130,
         "coldwallet_reserves":4.0000000,
         "total_reserves":5.6826130
      },
      "LTC":{
         "circulating_supply":318.5104129,
         "circulating_supply_components":{
            "amount":136.3382091,
            "claimable_balances_amount":0,
            "liquidity_pools_amount":182.1722038
         },
         "hotwallet_reserves":118.6363572,
         "coldwallet_reserves":200.0000000,
         "total_reserves":318.6363572
      }
   }
}

Success Response Attributes

Name Type Description Nullable
deposit object An object containing an associative list of assets available for deposit and additional context information about the assets. Each asset is identified by its key, which is the asset code. false
.ASSET_CODE object An object containing context information about the asset identified in the deposit object's key attribute. false
.enabled boolean Indicates whether deposit transactions are enabled. If set to false then this is the only attribute of the object. false
.min_amount float Indicates the minimum deposit amount on the /deposit endpoint. false
.max_amount float Indicates the maximum deposit amount on the /deposit endpoint. false
.fee_fixed float Indicates the fixed fee on the /deposit endpoint. In units of the deposited asset. false
.fee_percent float Indicates the percentage fee on the /deposit endpoint. In units of percentage points. false
.authentication_required boolean Indicates whether authentication for this asset is required on the /deposit endpoint. If set to true then requests must be authenticated via SEP-10. false
withdraw object An object containing an associative list of assets available for withdrawal and additional context information about the assets. Each asset is identified by its key, which is the asset code. false
.ASSET_CODE object An object containing context information about the asset identified in the withdraw object's key attribute. false
.enabled boolean Indicates whether withdrawal transactions are enabled. If set to false then this is the only attribute of the object. false
.min_amount float Indicates the minimum withdrawal amount on the /withdraw endpoint. false
.max_amount float Indicates the maximum withdrawal amount on the /withdraw endpoint. false
.fee_fixed float Indicates the fixed fee on the /withdraw endpoint. In units of the deposited asset. false
.fee_percent float Indicates the percentage fee on the /withdraw endpoint. In units of percentage points. false
.authentication_required boolean Indicates whether authentication for this asset is required on the /withdraw endpoint. If set to true then requests must be authenticated via SEP-10. false
.types object An object containing instructions for `dest` parameter on the /withdraw endpoint. false
transaction object An object containing information about the /transaction endpoint. false
.enabled boolean Indicates whether the /transaction is enabled. If set to false then this is the only attribute of the object. false
.authentication_required boolean Indicates whether the /transaction requires authentication. If set to true then requests must be authenticated via SEP-10. false
transactions object An object containing information about the /transactions endpoint. false
.enabled boolean Indicates whether the /transactions is enabled. If set to false then this is the only attribute of the object. false
.authentication_required boolean Indicates whether the /transactions requires authentication. If set to true then requests must be authenticated via SEP-10. false
features object An object containing information about possible additional features provided by the SEP-6 server. false
.account_creation boolean Indicates whether the SEP-6 transfer server supports creating accounts for users requesting deposits (Whalestack does not). false
.claimable_balances boolean Indicates whether the SEP-6 transfer server supports sending deposits as claimable balances to accounts that do not have a trustline established (Whalestack does not, a trustline is required prior to receiving a deposit address). false
fee object An object containing information about the optional SEP-6 /fee endpoint. false
.enabled boolean Indicates whether the /fee endpoint is enabled (in Whalestack SEP-6 it is not because we use the fee_fixed and fee_percent above in lieu of a dedicated fee endpoint). If set to false then this is the only attribute of the object. false
.authentication_required boolean Indicates whether the /fee requires authentication. If set to true then requests must be authenticated via SEP-10. false
deposit-exchange object An object containing information about the optional SEP-6 /deposit-exchange endpoint. false
.enabled boolean Indicates whether the /deposit-exchange endpoint is enabled (in Whalestack SEP-6 it is not). If set to false then this is the only attribute of the object. false
.authentication_required boolean Indicates whether the /deposit-exchange requires authentication. If set to true then requests must be authenticated via SEP-10. false
withdraw-exchange object An object containing information about the optional SEP-6 /withdraw-exchange endpoint. false
.enabled boolean Indicates whether the /withdraw-exchange endpoint is enabled (in Whalestack SEP-6 it is not). If set to false then this is the only attribute of the object. false
.authentication_required boolean Indicates whether the /withdraw-exchange requires authentication. If set to true then requests must be authenticated via SEP-10. false
supply object An object containing circulating supplies, hot wallet, and cold wallet reserves for above-mentioned assets. Cached five minutes. false

Error Response application/json

{
   "status":"400",
   "error":"invalid request (and more information explaining the error""
}

Error Response Params

Name Type Description Nullable
status string The issued HTTP status code. false
error string A human readable string explaining the error. false

GET/depositpublic

Returns an object with deposit information containing all the information needed to make payment and receive tokenized assets on Stellar. Conforms to the official Stellar SEP-6 definitions described here.

Request

curl 'https://sep6.whalestack.com/deposit?asset_code=BTC&account=GDONUHZKLSYLDOZWR2TDW25GFXOBWCCKTPK34DLUVSOMFHLGURX6FNU6'

Request Params (GET)

Key Type Description Nullable Mandatory
asset_code string The asset code of the asset you wish to deposit. false mandatory
account string The Stellar account to which you wish to deposit. As a prerequisite for receiving tokenized funds the account must have a trustline for the desired asset. false mandatory
type string Requests a specific Bitcoin or Litecoin address type. Allowed types are p2sh-segwit, bech32, legacy. Defaults to bech32. false optional
memo string An optional memo to be sent to the above Stellar account. If a memo is given its type must also be specified in memo_type. false optional
memo_type string A string specifying the given memo type. Valid options are text, id, and hash. false optional
email_address string Reserved for future use. An optional email address for receiving email updates related to this deposit transfer. false optional
on_change_callback string An optional URL listening for status updates related to this deposit transfer. The callback sends an HTTP POST request with a JSON object conforming to the one described in /transaction.

Your server should respond with a 200 OK HTTP status code upon to acknowledge the callback. If we don't see a 200 OK response we will keep re-sending the callback for a while until we encounter one and eventually give up (after 48 hours or so). Callbacks are signed via an HTTP header, as documented here.
false optional

Success Response application/json

{
   "how":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23",
   "id":"085a2e4aca82edd52d12b37388da",
   "eta":600,
   "min_amount":"0.0001000",
   "max_amount":"100.0000000",
   "fee_fixed":"0.0000000",
   "fee_fixed":"0.0000000",
   "extra_info":{}
}

Success Response Attributes

Name Type Description NullableNullable
how string The blockchain address to which the deposit should be sent. false
id string A unique identifier given by Whalestack. Save this client-side to reference and query this deposit and related blockchain transactions using the /transaction endpoint. false
eta integer An estimated time of fund transfer in seconds. The actual time can vary depending on underlying blockchain speed and used fees. false
min_amount string The minimum deposit amount for the fund transfer to trigger. Deposits below the minimum threshold stay pending until the sum of all made deposits matches or exceeds this amount. false
max_amount string The maximum deposit amount. false
fee_fixed string Indicates the fixed fee for this deposit. In units of the deposited asset. false
fee_percent string Indicates the percentage fee for this deposit. In units of percentage points. false
extra_info object An object optionally containing exactly one field message containing a human readable text string with additional information. false

Error Response application/json

{
   "status":"400",
   "error":"Account does not have a trustline for BTC-GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT."
}

Error Response Params

Name Type Description Nullable
status string The issued HTTP status code. false
error string A human readable string explaining the error. false

GET/withdrawpublic

Returns an object with withdrawal information containing all the information needed to redeem assets onto the underlying blockchain. Conforms to the official Stellar SEP-6 definitions described here.

Request

curl 'https://sep6.whalestack.com/withdraw?asset_code=BTC&dest=bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23'

Request Params (GET)

Key Type Description Nullable Mandatory
asset_code string The asset code of the asset you wish to redeem. false mandatory
dest string The Bitcoin (or Litecoin) target address in any format, i.e. native SegWit (bech32), SegWit (P2SH), or legacy (P2PKH). false mandatory
email_address string Reserved for future use. An optional email address for receiving email updates related to this withdrawal transfer. false optional
on_change_callback string An optional URL listening for status updates related to this withdrawal transfer. The callback sends an HTTP POST request with a JSON object conforming to the one described in /transaction.

Your server should respond with a 200 OK HTTP status code upon to acknowledge the callback. If we don't see a 200 OK response we will keep re-sending the callback for a while until we encounter one and eventually give up (after 48 hours or so). Callbacks are signed via an HTTP header, as documented here.
false optional
type string Optional parameter indicating the type of withdrawal. The only currently allowed value is crypto. false optional

Success Response application/json

{
   "account_id":"GCQVESTEG3MY2AA4LFF2J5K77IQP4G5WZCUDOJ5RUIPA6ZKRGQ7XXKBR",
   "memo_type":"text",
   "memo":"cf86a99b3e6ecd1359a0d2992e70",
   "id":"cf86a99b3e6ecd1359a0d2992e70",
   "min_amount":"0.0005000",
   "max_amount":"100.0000000",
   "fee_fixed":0.0002,
   "fee_percent":0.2,
   "extra_info":{
      "message":"An amount above 100.0000000 BTC will take longer to complete"
   }
}

Success Response Attributes

Name Type Description Nullable
account_id string The Stellar account to which the funds should be sent. false
memo string A mandatory memo to be included in the Stellar withdrawal transaction. It is vital to include the memo. Funds sent without the memo might not be able to be resolved or refunded. false
memo_type integer The memo type (always text). false
id string A unique identifier given by Whalestack. Save this client-side to reference and query this withdrawal and related blockchain transactions using the /transaction endpoint. false
min_amount string The minimum withdrawal amount for the fund transfer to trigger. Payment operations below the minimum threshold stay pending until the sum of all made payments matches or exceeds this amount. false
max_amount string The maximum withdrawal amount. false
fee_fixed string Indicates the fixed fee for this withdrawal. In units of the transferred asset. false
fee_percent string Indicates the percentage fee for this withdrawal. In units of percentage points. false
extra_info object An object optionally containing exactly one field message containing a human readable text string with additional information. false

Error Response application/json

{
   "status":"400",
   "error":"Invalid destination address."
}

Error Response Params

Name Type Description Nullable
status string The issued HTTP status code. false
error string A human readable string explaining the error. false

GET/transactionpublic

Returns an object with transaction information regarding a SEP-6 deposit or withdrawal. Conforms to the official Stellar SEP-6 definitions described here.

Requires either an external_transaction_id (i.e. the Bitcoin or Litecoin transaction id), a stellar_transaction_id, or an id as given by Whalestack in the HTTP response to a deposit, withdraw, or transactions request.

Request

curl 'https://sep6.whalestack.com/transaction?external_transaction_id=914f2fe1175101d5d1b3fc75c053cc090590bb0e251b938c255598c828742c43'

Request Params (GET)

Key Type Description Nullable Mandatory
id string A transfer id as given by Whalestack in the HTTP response to a /deposit, /withdraw, or /transactions request. true optional
stellar_transaction_id string A Stellar transaction id related to a SEP-6 deposit or withdrawal. true optional
external_transaction_id string An external transaction id (i.e. a Bitcoin or Litecoin transaction id) related to a SEP-6 deposit or withdrawal. true optional

Success Response application/json

{
   "transaction":{
      "id":"085a2e4aca82edd52d12b37388da-814f2fe117-0",
      "status":"completed",
      "message":"Transaction fully completed.",
      "kind":"deposit",
      "amount_in":"0.0001000",
      "amount_in_asset":"iso-24165:BTC",
      "amount_out":"0.0001000",
      "amount_out_asset":"stellar:BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
      "amount_fee":"0.0000000",
      "from":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23",
      "started_at":"2022-10-04T20:50:18.307Z",
      "completed_at":"2022-10-04T20:51:20.032Z",
      "stellar_transaction_id":"a426a057aaba5a5811d5ee243f76c767a6756df89f417610a4ebd114e162596a",
      "external_transaction_id":"814f2fe1175101d5d1b3fc75c053cc090590bb0e251b938c255598c828742c43",
   }
}

Success Response Attributes

Name Type Description Nullable
transaction object An object containing information about the transfer transaction. false
.id string A composite id combining the SEP-6 transfer id as given by Whalestack in the HTTP response to a deposit or withdrawal request with a conditional unique suffix in the format -[a-z0-9]{10}-[0-9] identifying a single SEP-6 transfer explicitly. false
.status string A transaction state as documented here. Possible states:

completed, pending_external, pending_anchor, pending_stellar, pending_trust, pending_user, pending_user_createaccount, pending_user_transfer_start, pending_user_transfer_complete, pending_customer_info_update, incomplete, expired, too_small, too_large, error.
false
.message string A human-readable text string explaining the status given above. false
.kind string The transaction type. Possible values are deposit and withdrawal. false
.amount_in string Amount received by transfer server at the start of the transaction. A string with up to 7 decimals. Excludes any fees charged before the transfer server received the funds. true
.amount_in_asset string The asset received or to be received by the transfer server. The value is in SEP-38 Asset Identification format. true
.amount_out string Amount sent by the transfer server to the user at end of transaction. A string with up to 7 decimals. true
.amount_out_asset string The asset delivered or to be delivered to the user. The value is in SEP-38 Asset Identification format. true
.amount_fee string Amount of fee charged by the transfer server. true
.from string A Stellar account in the case of withdrawal transactions or a comma-separated string with all UTXO inputs in the case of deposits. true
.started_at string Start date and time of transaction (UTC ISO 8601). true
.completed_at string Completion date and time of transaction (UTC ISO 8601). true
.stellar_transaction_id string Id on Stellar Network indicating the transaction that either completed the deposit or started the withdrawal. true
.external_transaction_id string Id of the blockchain transaction on the external network that either started the deposit or completed the withdrawal. true
.withdraw_anchor_account string If this is a withdrawal, this is the anchor's Stellar account that the user transferred (or will transfer) their issued asset to. true
.withdraw_memo string Mandatory withdrawal memo given by the transfer server. true
.withdraw_memo_type string Mandatory withdrawal memo type given by the transfer server. true
related_transactions object An optional list of additional transaction objects for situations in which more than one blockchain transaction is associated with a deposit or withdrawal. true

Error Response application/json

{
   "status":"404",
   "error":"not found"
}

Error Response Params

Name Type Description Nullable
status string The issued HTTP status code. false
error string A human readable string explaining the error. false

GET/transactionspublic

Returns a list of transaction objects as described in /transaction. Conforms to the official Stellar SEP-6 definitions described here.

Request

curl 'https://sep6.whalestack.com/transactions?asset_code=BTC&account=GACK3ODRMGCTRH6HNVETEOF2ZK5G5QUIGLDFFZQSLM6RZJ2LFY3VWQBT'

Request Params (GET)

Key Type Description Nullable Mandatory
asset_code string The asset code of interest, e.g. BTC or LTC. false mandatory
account string The stellar account id involved in the transactions. Without this filter the entire transaction history of the transfer server is queried. false optional
no_older_than string The response should only contain transactions starting on or after this date and time (UTC ISO 8601). true optional
limit string The response should contain at most limit transactions. true optional
kind string A comma-separated list containing the desired transaction kinds. Possible values are deposit and withdrawal. true optional
paging_id string The response should contain transactions starting prior to this ID (exclusive). true optional

Success Response application/json

{
   "transactions":[
      {
          "id": "30978809351d5e145b8a9bce49a8",
          "kind": "deposit",
          "status": "pending_user_transfer_start",
          "message": "Please initiate your transfer."
      },
      {
         "id":"085a2e4aca82edd52d12b37388da-814f2fe117-0",
         "status":"completed",
         "message":"Transaction fully completed.",
         "kind":"deposit",
         "amount_in":"0.0001000",
         "amount_in_asset":"iso-24165:BTC",
         "amount_out":"0.0001000",
         "amount_out_asset":"stellar:BTC:GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT",
         "amount_fee":"0.0000000",
         "from":"bc1qj633nx575jm28smgcp3mx6n3gh0zg6ndr0ew23",
         "started_at":"2022-10-04T20:50:18.307Z",
         "completed_at":"2022-10-04T20:51:20.032Z",
         "stellar_transaction_id":"a426a057aaba5a5811d5ee243f76c767a6756df89f417610a4ebd114e162596a",
         "external_transaction_id":"814f2fe1175101d5d1b3fc75c053cc090590bb0e251b938c255598c828742c43"
      },
      {
          "id":"9f5762bbbe11dc58be299b8d68e3-8348091630-0",
          "status":"completed",
          "message":"Transaction fully completed.",
          "kind":"withdraw",
          "amount_in":"0.0005000",
          "amount_in_asset":"stellar:LTCTEST:GBSY6HJZLWBUUNJHHDLDE3AIBSQCHI6UMIMWOLZ6GUWI3NPPLP6QNGI2",
          "amount_out":"0.0002990",
          "amount_out_asset":"iso24165:LTC",
          "amount_fee":"0.0002010",
          "from":"GACK3ODRMGCTRH6HNVETEOF2ZK5G5QUIGLDFFZQSLM6RZJ2LFY3VWQBT",
          "started_at":"2022-10-05T00:04:02.168Z",
          "completed_at":"2022-10-05T00:12:30.284Z",
          "stellar_transaction_id":"83480916303afa78b93831e3964eec748b6265148823d27fecb7c7648a9c87ec#184545592135122945",
          "external_transaction_id":"f09c0f9fcf7cf88727b20275b2b231b2a0dbb2563e3ad19fe97b839fe50dff50",
          "withdraw_memo":"9f5762bbbe11dc58be299b8d68e3",
          "withdraw_memo_type":"text",
          "withdraw_anchor_account":"GCQVEST7KIWV3KOSNDDUJKEPZLBFWKM7DUS4TCLW2VNVPCBGTDRVTEIT"
      }
   ]
}

Success Response Attributes

Name Type Description Nullable
transactions array An array of transaction objects as described in /transaction. false

Error Response application/json

{
   "status":"500",
   "error":"internal server error"
}

Error Response Params

Name Type Description Nullable
status string The issued HTTP status code. false
error string A human readable string explaining the error. false
Whalestack SEP-6 REST Client for PHP v1.0.0
https://github.com/whalestackhq/sep6-client-php

README.md

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
View on GitHub
Whalestack SEP-6 REST Client for NodeJS v0.0.4
https://github.com/whalestackhq/sep6-client-nodejs

README.md

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
View on GitHub
Whalestack SEP-6 REST Client for Ruby v0.0.2
https://github.com/whalestackhq/sep6-client-ruby

README.md

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
View on GitHub

Proof of Reserves

Whalestack's SEP-6 transfer server is transparent and auditable. Below is an itemized statement of the SEP-6 transfer server's recent deposit and withdrawal history. Use the /transactions endpoint to query and inspect the entire transfer server history and verify the indicated wallet reserves.

  • Select Network Circulating Supply Hot Wallet Cold Wallet Asset ID
  • Bitcoin 239,219.212123 BTC 239,219.212123 BTC 0 BTC BTCLN:G1234...G4321
ID Started At Completed At Amount Type Status Network
12121...32323 2022-10-04 20:50:18 2022-10-04 20:51:20 withdraw pending_user_transfer_complete Litecoin

Use the SEP-6 /transactions endpoint to query the entire transfer server history.

Tx ID Tx Time Destination Amount
12121...32323 2022-10-04 20:50:18 cold

Use https://sep6.whalestack.com/related-transfers to query all (non-SEP-6) transfers affecting hot wallets and cold wallets.