Created
October 12, 2020 14:44
-
-
Save shredding/19d65894722d3da1096314f197171969 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from stellar_sdk import TransactionBuilder, Server, Network | |
import requests | |
STELLAR_TOML = 'https://api.dstoq.com/.well-known/stellar.toml' | |
PUBLIC_KEY = 'your-public-key' | |
APPROVAL_SERVER = 'https://api.dstoq.com/core/sign/tx' | |
server = Server(horizon_url='https://horizon.stellar.org') | |
builder = TransactionBuilder(server.load_account(PUBLIC_KEY), Network.PUBLIC_NETWORK_PASSPHRASE) | |
tx_xdr = builder.append_manage_buy_offer_op( | |
selling_code='XLM', | |
selling_issuer=None, | |
buying_code='DEMO', | |
buying_issuer='GDWHDCUYIA7LDEIL6XOPYBSRYG3JOFPC2ZF5ZHGTINU4T5E7YA6AMNH5', | |
amount='1.00', | |
price='1.00' | |
).build().to_xdr() | |
requests.post(APPROVAL_SERVER, data={'tx': tx_xdr}).json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment