Skip to main content

Python wrappers for permaswap

Project description

permaswap.py

python sdk for permaswap

install

pip install permaswap

usage

  1. perpare everpay account
import everpay
api_server = 'https://api-dev.everpay.io'

# eth account
pk = ''
signer = everpay.ETHSigner(pk)

# or ar account
#signer = everpay.ARSigner('arweave-keyfile-xxx.json')
account = everpay.Account(api_server, signer)
  1. init permaswap
router_host = 'wss://router0-dev.permaswap.network/'
swap = permaswap.Swap(router_host, account)
  1. query order
import permaswap
# get_order('token_in', 'token_out', 'amount_in')
# sell 1 tar for tusdc
order = swap.get_order('tAR', 'tUSDC', 10**12)
print(order)
  1. place order
result = swap.place_order(order)
print(result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

permaswap-0.1.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page