Skip to main content

SKALE client tools

Project description

skale.py

PyPI version GitHub Workflow Status codecov Libraries.io dependency status for GitHub repo Discord

Python client library used in SKALE network components.

  • Python 3.11+ support
  • Compatibility with web3.py v7

Installation

pip install skale.py

Usage

Supported wallets

  • Ledger Wallet (works with Ledger Nano S and other models)
  • RPC Wallet (works with SKALE Transactions Manager)
  • SGX Wallet (works with SKALE SGX Wallet)
  • Web3 Wallet (works with web3.py providers and private keys in memory)

Library initialization

With Web3Wallet (private key in memory):

from skale import SkaleManager
from skale.wallets import Web3Wallet
from skale.utils.web3_utils import init_web3

web3 = init_web3(ENDPOINT)
wallet = Web3Wallet(private_key, web3)
skale = Skale(ENDPOINT, ABI_FILEPATH, wallet)

With external transactions manager:

from skale import SkaleManager
from skale.wallets import RPCWallet

web3 = init_web3(ENDPOINT)
wallet = RPCWallet(TM_URL)
skale = Skale(ENDPOINT, ABI_FILEPATH, wallet)

Interactions with SKALE contracts

active_nodes = skale.nodes.active_node_ips()
schains = skale.schains.schains_for_owner('0x...')

Working in multiple threads

Due to the web3.py v5 limitations you have to create separate instances of the skale.py for the each thread.
Take a look on the tests/multithreading_test.py for the reference.

Development

Add pre-commit hook:
nano .git/hooks/pre-commit
uv run ruff check skale/
uv run mypy skale/
Install local version
uv sync --all-extras
Export environment variables

To export environment variables for running tests locally, run:

. ./scripts/export_env.sh

Build and publish library

bash build_and_publish.sh major/minor/patch

If you're using .env file

 export $(cat .env | xargs) && bash build_and_publish.sh major/minor/patch

Versioning

The version scheme for this repo is {major}.{minor}.{patch} For more details see: https://semver.org/

License

GitHub

All contributions are made under the GNU Affero General Public License v3. See LICENSE.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

skale_py-7.14.dev0.tar.gz (165.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skale_py-7.14.dev0-py3-none-any.whl (187.1 kB view details)

Uploaded Python 3

File details

Details for the file skale_py-7.14.dev0.tar.gz.

File metadata

  • Download URL: skale_py-7.14.dev0.tar.gz
  • Upload date:
  • Size: 165.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for skale_py-7.14.dev0.tar.gz
Algorithm Hash digest
SHA256 48f657e47226d53b39d7395363745f31e9de1fcaf047ffa3731a6a0ecc8bbf50
MD5 70b4dd631920a4df3e5b8cfd84f49af5
BLAKE2b-256 69ff5aac7eab60078f7866ac93c169998240fd486444a537934dbaa6981974e2

See more details on using hashes here.

File details

Details for the file skale_py-7.14.dev0-py3-none-any.whl.

File metadata

  • Download URL: skale_py-7.14.dev0-py3-none-any.whl
  • Upload date:
  • Size: 187.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for skale_py-7.14.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 228d0fdccb573c9bac8d8b494d030364b872de53fc92ad577172cb2dc3add123
MD5 9482f59b6f25d12d866d9cf54f173d26
BLAKE2b-256 59d0bc5ded961e9f336559fc893d30e613023d0bb54fd6b8df21c8ab36907576

See more details on using hashes here.

Supported by

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