Skip to main content

ao.py

python sdk for ao https://ao.arweave.dev/

install

pip install aodotpy

Example

import ao

# ao cred process id
ar = 'xU9zFkq3X2ZQ6olwNVvr1vUWIjc3kXTWr7xKQD6dh10'
signer = ao.ARSigner('your ar wallet json file')

# use dry run to get your cred balance
result = ao.dry_run(ar, '', {'Action':'Balance'})
print(result)

# transfer
recipient = 'your recipient ar address'
message_id, result = ao.send_and_get(signer, ar, '', {'Action':'Transfer', 'Recipient':recipient, 'Quantity':'1000000000000'})
print(message_id)
print(result)

# swap on permaswap(ao)

# ar-llama pool, 
pool = 'aGF7BWB_9B924sBXoirHy4KOceoCX72B77yh1nllMPA'

# swap 0.01 ar for llama
message_id, result = ao.send_and_get(signer, ar, '', 
    {'Action':'Transfer', 'Recipient':pool, 'Quantity':'10000000000', 'X-PS-For':'Swap', 'X-PS-MinAmountOut':'1000000000000'}
)

# checkout out swap result, permaswap use message_id as order_id.
result = ao.dry_run(pool, '', {'Action':'GetOrder', 'OrderId':message_id})
print(result)

Metadata

Release files for aodotpy 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aodotpy 0.2.4
File Size Uploaded
aodotpy-0.2.4.tar.gz 3.6 kB Details

Release files / aodotpy-0.2.4.tar.gz

Download URL aodotpy-0.2.4.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7deb62a482d15e3ea9add0aabb35794b45fb6d85f2ca83067536d5c1e2e3799d
BLAKE2b-256 checksum
How to use checksums
e34091f9c7b3f983ae2835c433abc7ae7f7ac62c423cd1df4c41bbbc86d0a4e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.16

Release history Release notifications | RSS feed

This release

0.2.4 This release

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page