Skip to main content

Core SDK

License: MIT build

A Python SDK to interact with the JPYCv2's core contracts. Ideal for those who want to interact with JPYC protocol in any Python-backend environments.

🪄 Usage

1. Install jpyc-core-sdk Package

# uv
$ uv add jpyc-core-sdk
# poetry
$ poetry add jpyc-core-sdk
# pip
$ pip install jpyc-core-sdk

2. Configure SDK Clients

from jpyc_core_sdk import JPYC, SdkClient

# Configure SDK client using default RPC endpoint
client = SdkClient(
    chain_name="ethereum",
    network_name="mainnet",
    private_key={PRIVATE_KEY},
)

# Or configure SDK client using custom RPC endpoint
client = SdkClient(
    chain_name="ethereum",
    network_name="mainnet",
    private_key={PRIVATE_KEY},
    rpc_endpoint={CUSTOM_RPC_ENDPOINT},
)

# Configure JPYC client
jpyc = JPYC(client=client)

3. Call JPYC Contracts

Use the configured JPYC client to call JPYC's contract functions wherever you would like.

from {CONFIG_FILE} import jpyc

...
# Call a contract function (e.g., transfer)
tx_hash = jpyc.transfer(
    to={TO_ADDRESS},
    value=2025,
)
...

⛓️ Supported Networks

Please use one of the combinations of chain-network names when configuring the SDK clients.

Chain Name Network Names
ethereum mainnet, sepolia
polygon mainnet, amoy
gnosis mainnet, chiado
avalanche mainnet, fuji
astar mainnet
shiden mainnet
localhost devnet

💬 Supported Providers

We're currently supporting HTTPProvider (the most simple & widely-used one) only. More providers (notably WebSocketProvider) are to be supported in the near future, so stay tuned!

🛠 Development

📦 Package Management

Add packages

# add packages for production
$ uv add {package_name}
# add packages for development
$ uv add --dev {package_name}

Remove packages

# remove production packages
$ uv remove {package_name}
# remove development packages
$ uv remove --dev {package_name}

🔎 Testing

Please see README at tests directory.

✅ Static Code Analysis

Linting

# run linter without fixing
$ uv run ruff check {dir_name}
# run linter & auto-fix (if available)
$ uv run ruff check {dir_name} --fix

Formatting

# run formatter without fixing
$ uv run ruff format {dir_name} --check
# run formatter & auto-fix
$ uv run ruff format {dir_name}

Type Checking

# run mypy
$ uv run mypy {dir_name}

Pre-Commit Hooks

Pre-commit script is configured at .pre-commit-config.yaml. This automatically runs the configured hooks before executing any git commit commands. You could also simulate the hooks by running the following.

# simulate pre-commit hooks without creating an actual commit
$ uv run pre-commit run --all-files

📝 Comments & Docstrings

Docstrings should be written in the Google-style.

Metadata

Release files for jpyc-core-sdk 1.0.5

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

Source distribution (sdist)

Source distribution for jpyc-core-sdk 1.0.5
File Size Uploaded
jpyc_core_sdk-1.0.5.tar.gz 25.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jpyc-core-sdk 1.0.5
File Interpreter ABI Platform
jpyc_core_sdk-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 53.2 kB

Release files / jpyc_core_sdk-1.0.5.tar.gz

Download URL jpyc_core_sdk-1.0.5.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0e9e752ffe9d6e1396e58355cc25be2283764d91c7e679b5102cb98071eff159
BLAKE2b-256 checksum
How to use checksums
b16b06bde38d00b6534faab0804f4662a733054c3096099885f216da94039f9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.6

Release files / jpyc_core_sdk-1.0.5-py3-none-any.whl

Download URL jpyc_core_sdk-1.0.5-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad42d463210d1ca0d3c10ecc7a5786ec5d4028903cc59f8319ac5fcb81da539f
BLAKE2b-256 checksum
How to use checksums
cd76ba46c2cb8cc9ba89268e6eb9c2e58c42c4e37a3f08d8c760c008ec3ff562
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.6

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

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