Skip to main content

Adapy library

The library now supports create address, push and get transactions for both python 2.7 and 3.x

Installation

Linux

# create virtual environment
mkdir -p ~/envs/adaspy
virtualenv ~/envs/adapy
# activate the environment
source ~/envs/eospy/bin/activate
# install from github
# look [here](https://github.com/khanhct/adapy/releases) for the latest release.
pip install git+https://github.com/khanhct/adapy.git@<release>
# install the library from pip
pip install adapy

Docker Container

docker-compose up

API Endpoints

For a more complete list of API endpoints check out: https://cardanodocs.com/technical/wallet/api/

Example

Create Address

from adapy.nodeada import NodeAda
from adapy.wallet import Wallet
import hashlib
no = NodeAda(url='https://localhost:8090/api', version='v1')
wl = Wallet(url='https://localhost:8090/api', version='v1')
print(no.create_address(2520553453, "46734b4a5a6454556c6137356c616171797573793549676864445a6741756c55","2cWKMJemoBakEUmdoCBWmG3b1ya6aa9hcmGF5UY6eqZbXcpzkcwNuEoXMrGvcRW1mDxjA"))

Get transactions

from adapy.nodeada import NodeAda
from adapy.wallet import Wallet
import hashlib
no = NodeAda(url='https://localhost:8090/api', version='v1')
wl = Wallet(url='https://localhost:8090/api', version='v1')
params = {'wallet_id': '2cWKMJemoBakEUmdoCBWmG3b1ya6aa9hcmGF5UY6eqZbXcpzkcwNuEoXMrGvcRW1mDxjA', 'account_index': 2520553453, 'created_at': 'RANGE[2019-12-24T07:25:18.788036, 2019-12-24T07:25:18.788036]', 'page': 1, 'sort_by': 'DES', 'per_page': 20}
print(no.get_trxs(params))

Push transaction

from adapy.nodeada import NodeAda
from adapy.wallet import Wallet
import hashlib
no = NodeAda(url='https://localhost:8090/api', version='v1')
wl = Wallet(url='https://localhost:8090/api', version='v1')
trx = {
    "destinations": [
        {
        "address": "37btjrVyb4KDhZhhAQ2yK2RoJ1k4fQAxoFZJ78sgPhsZiQWV2KwgDhqRsjhA2JsiKs6N74V98GPVwSGdjopFv22ksggjCc5xVyW3pGQ954okXPQ5Yj",
        "amount": 500 * 1000000
        }
    ],
    "groupingPolicy": "OptimizeForHighThroughput",
    "source": {
        "accountIndex":2520553453,
        "walletId": "2cWKMJemoBakEUmdoCBWmG3b1ya6aa9hcmGF5UY6eqZbXcpzkcwNuEoXMrGvcRW1mDxjA"
    },
    "spendingPassword": "46734b4a5a6454556c6137356c616171797573793549676864445a6741756c55"
}
try:
    result = no.send_trx(trx_data=trx)
    print(result)
except Exception as ex:
    print(ex)

Metadata

Release files for python-ada 1.0.0

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

Source distribution (sdist)

Source distribution for python-ada 1.0.0
File Size Uploaded
python-ada-1.0.0.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-ada 1.0.0
File Interpreter ABI Platform
python_ada-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / python-ada-1.0.0.tar.gz

Download URL python-ada-1.0.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
76831d131da878019bce8c135b955de2929d2d264c6062b8f92203efde29f46f
BLAKE2b-256 checksum
How to use checksums
308a84f3367b17c092f903308681311bbcbc5ab706af19d452c61bc19240c323
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.5

Release files / python_ada-1.0.0-py3-none-any.whl

Download URL python_ada-1.0.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed7830a28616e500e871a7bca6dfd9147677c71b414aa34de00a206b27b8154f
BLAKE2b-256 checksum
How to use checksums
d2bb6fe749e4863bc020703fdd9625bf3b5d30e2fb8a898f3e1f9de412f2c15e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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