Last active
January 20, 2021 08:33
-
-
Save shredding/9f808f9e447ad53cb1f32940710702a3 to your computer and use it in GitHub Desktop.
This file contains 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 | |
server = Server(horizon_url='https://horizon.stellar.org') | |
builder = TransactionBuilder(server.load_account(<ADD YOUR PUBLIC_KEY>), Network.PUBLIC_NETWORK_PASSPHRASE) | |
tx_xdr = builder.append_manage_buy_offer_op( | |
selling_code='USD', | |
selling_issuer='GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX', | |
buying_code='TSLA', | |
buying_issuer='GBRDHSZL4ZKOI2PTUMM53N3NICZXC5OX3KPCD4WD4NG4XGCBC2ZA3KAG', | |
amount='1.00', | |
price=’826.00' | |
).build().to_xdr() | |
tx = requests.post('https://dsq.technology/sep-8/tx-approve/', data={'tx': tx_xdr}).json()[‘tx’] | |
server.submit_transaction( | |
requests.post('https://dsq.technology/sep-8/tx-approve/', data={'tx': tx_xdr}).json()[‘tx’] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment