Package: xmrto-wrapper
XMR.to wrapperInteract with XMR.to.This is built according to the XMR.toAPI documentation.Withhttps://test.xmr.toyou can pay testnet BTC with stagenet XMR (including lightning payments).How toGet helpxmrto_wrapper -hGeneral usageCreate an order for an amount inBTC:# Create an order for 0.001 BTC:
    xmrto_wrapper create-order --destination 3K1jSVxYqzqj7c9oLKXC7uJnwgACuTEZrY --btc-amount 0.001
    # Result:
    {"uuid": "xmrto-p4XtrP", "state": "TO_BE_CREATED", "btc_dest_address": "3K1jSVxYqzqj7c9oLKXC7uJnwgACuTEZrY", "btc_amount": "0.001", "uses_lightning": false}
    # If XMR.to is fast enough with the order processing, the result can also be:
    {"uuid": "xmrto-LAYDkk", "state": "UNPAID", "btc_dest_address": "3K1jSVxYqzqj7c9oLKXC7uJnwgACuTEZrY", "btc_amount": "0.001", "uses_lightning": false, "receiving_subaddress": "86hZP8Qddg2KXyvjLPTRs9a7C5zwAgC21RcwGtEjD3RPCzfbu4aKBeYgqFgpcsNNCcP5iGuswbMKRFXLHiSu45sWMuRYrxc", "incoming_amount_total": "0.1373", "remaining_amount_incoming": "0.1373", "incoming_price_btc": "0.00728332", "btc_amount_partial": "0", "seconds_till_timeout": 2697, "created_at": "2020-05-01T18:47:57Z"}--btcis the equivalent of--btc-amountand can be used interchangeably.It's possible to give the amount inXMR, where--xmris the equivalent of--xmr-amount(They can be used interchangeably).# Create an order for 1 XMR:
    xmrto_wrapper create-order --destination 3K1jSVxYqzqj7c9oLKXC7uJnwgACuTEZrY --xmr-amount 1
    # Result:
    {"uuid": "xmrto-JSSqo3", "state": "TO_BE_CREATED", "btc_dest_address": "3K1jSVxYqzqj7c9oLKXC7uJnwgACuTEZrY", "btc_amount": "0.00722172", "uses_lightning": false}Use--followto keep tracking the order.Prior tov0.1there used to be a separate sub command:--create-and-track-order.--followprovides the same behaviour.Track an existing order:xmrto_wrapper track-order --secret-key xmrto-ebmA9q--secretand--keyare the equivalents of--secret-keyand can be used interchangeably.Use--followto keep tracking the order.Confirm an underpaid order (for an underpaid order):xmrto_wrapper confirm-partial-payment --secret-key xmrto-ebmA9q--secretand--keyare the equivalents of--secret-keyand can be used interchangeably.Use--followto keep tracking the order.Get the recent price for an amount inBTC:xmrto_wrapper check-price --btc-amount 0.01--btcis the equivalent of--btc-amountand can be used interchangeably.It's possible to give the amount inXMR, where--xmris the equivalent of--xmr-amount(They can be used interchangeably).xmrto_wrapper check-price --xmr-amount 1Use--followto keep tracking the order.The API used is--api v3by default, so no need to actually set that parameter.The URL used is--url https://xmr.toby default, so no need to actually set that parameter.There also is--url https://test.xmr.tofor stagenet XMR.Oftenhttps://test.xmr.tohas some new features available for testing.More infoxmrto_wrapper.py --versionxmrto_wrapper.py --logoThe option--debugshows debug information.See:xmrto_wrapper --help.xmrto_wrapper create-order --help...When importing as modulefrom xmrto_wrapper import xmrto_wrapperenvironment variables are considered:cli optionenvironment variable--urlXMRTO_URL--apiAPI_VERSION--destinationDESTINATION_ADDRESS--btc-amount,--btcBTC_AMOUNT--xmr-amount,--xmrXMR_AMOUNT--secret-key,--secret,--keySECRET_KEY--invoiceLN_INVOICErequirements.txt vs. setup.pyAccording to these sources:python documentationstackoverflow - second answer by jonathan HansonI try to stick to:requirements.txtlists the necessary packages to make a deployment work.setup.pydeclares the loosest possible dependency versions.Creatingrequirements.txtYou won't ever need this probably - This is helpful when developing.pip-toolsis used to createrequirements.txt.There isrequirements.inwhere dependencies are set and pinned.To create therequirements.txt, runupdate_requirements.shwhich basically just callspip-compile.Note:There also isbuild_requirements.txtwhich only containspip-tools. I found, when working with virtual environments, it is necessary to installpip-toolsinside the virtual environment as well. Otherwisepip-syncwould install outside the virtual environment.A development environment can be created like this:# Create a virtual environment 'venv'.python-mvenvvenv# Activate the virtual environment 'venv'../venv/bin/activate# Install 'pip-tools'.pipinstall--upgrade-rbuild_requirements.txt# Install dependencies.pip-syncrequirements.txt...python-mxmrto_wrapper.xmrto_wrappercreate-order--urlhttps://test.xmr.to--apiv3--destination="tb1qkw6npn7ann5nw9f7l94qkqhh8pdtnsuxlw3v8q"--btc0.5--follow...# Deactivate the virtual environment 'venv'.deactivateUse as modulemodule_example.pyshows how to import as module.ExecutableIf installed usingpip, a system executable will be installed as well.
This way, you can just use the tool like every executable on your system.xmrto_wrapper --helpIf you would like to donate - Thanks:86Avv8siJc1fG85FmNaUNK4iGMXUHLGBY2QwR3zybFMELXrNA34ioEahrupu16v6mZb2hqp2f89YH78oTvyKaha4QRVk2Rb