Ccxt: How to enable sandbox?

Created on 22 Oct 2017  路  3Comments  路  Source: ccxt/ccxt

Hi,
newbie here :) How can I force the usage of the exchange sandbox? I would like to test a bit before trading with real cryptomoney..

Thanks!
Luigi

enhancement question

Most helpful comment

Hi, Luigi!

Most often you should just change the API URL of the exchange to its sandbox URL, like shown in the example bellow:

    // move to testnet/sandbox if possible
    if (exchange.urls['test'])
        exchange.urls['api'] = exchange.urls['test'];

The caveat here is that test/sandbox URLs are not fully covered in ccxt yet, and not all exchanges offer them at all, so you will have to put correct URLs there by hand for now (until we unify that part completely). But if you feel like you want to help us to unify that functionality and you want to contribute by adding test URLs where they are missing 鈥撀爓e will be happy for your help, feel free to make a PR.

Let us know if this answers your question.

All 3 comments

Hi, Luigi!

Most often you should just change the API URL of the exchange to its sandbox URL, like shown in the example bellow:

    // move to testnet/sandbox if possible
    if (exchange.urls['test'])
        exchange.urls['api'] = exchange.urls['test'];

The caveat here is that test/sandbox URLs are not fully covered in ccxt yet, and not all exchanges offer them at all, so you will have to put correct URLs there by hand for now (until we unify that part completely). But if you feel like you want to help us to unify that functionality and you want to contribute by adding test URLs where they are missing 鈥撀爓e will be happy for your help, feel free to make a PR.

Let us know if this answers your question.

Thanks! I will try

I'm closing this for now, let us know if you have difficulties with it, feel free to reopen this if needed, or just ask your questions! Cheers!

Was this page helpful?
0 / 5 - 0 ratings