Skip to main content

Official Python SDK for NEXUM Protocol on Solana

Project description

nexum-sdk (Python)

Official Python SDK for NEXUM Protocol — a decentralized freelance marketplace built on Solana.

Installation

pip install nexum-sdk

Requirements

  • Python 3.10+
  • Dependencies: httpx, base58, solders

Quick Start

from nexum_sdk import NexumClient, Network

# Connect to devnet
client = NexumClient.devnet()

# Connect to mainnet
client = NexumClient.mainnet()

# Custom RPC
client = NexumClient(network=Network.DEVNET, rpc_url="https://your-custom-rpc.com")

Tasks (async)

import asyncio
from nexum_sdk import NexumClient, TaskStatus

client = NexumClient.devnet()

async def main():
    # Fetch all open tasks
    tasks = await client.get_open_tasks()
    for task in tasks:
        print(task.title, task.reward_sol, "SOL")
        print(task.skills_list)   # ['Rust', 'Solana']

    # Fetch a specific task
    task = await client.get_task(1)
    if task:
        print(task.title)
        print(task.status)        # TaskStatus.OPEN

    # Fetch all tasks
    all_tasks = await client.get_all_tasks()

    # Total value locked
    tvl = await client.get_tvl()
    print(f"TVL: {tvl:.2f} SOL")

asyncio.run(main())

Tasks (sync helpers)

client = NexumClient.devnet()

# Synchronous wrappers — no async/await needed
tasks = client.get_all_tasks_sync()
tvl   = client.get_tvl_sync()

Utilities

from nexum_sdk import (
    sol_to_lamports,
    lamports_to_sol,
    get_sbt_level,
    get_sbt_label,
    days_left,
    short_address,
)

sol_to_lamports(1.5)          # 1500000000
lamports_to_sol(1_000_000_000) # 1.0

get_sbt_level(20)             # 3
get_sbt_label(3)              # "Expert"

days_left(deadline_unix)      # 7

short_address("7yn8tuqH...NNzA")  # "7yn8...NNzA"

Constants

from nexum_sdk import (
    NEXUM_PROGRAM_ID,
    NEXUM_DEVNET_RPC,
    PLATFORM_FEE_BPS,
    SBT_LEVELS,
)

Types

from nexum_sdk import NexumTask, NexumProfile, NexumDispute, TaskStatus, Network, TaskFilter

# Filter tasks
filter_ = TaskFilter(status=TaskStatus.IN_PROGRESS)
tasks = await client.get_all_tasks(filter_)

Links

License

MIT

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

nexum_sdk-0.1.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

nexum_sdk-0.1.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file nexum_sdk-0.1.4.tar.gz.

File metadata

  • Download URL: nexum_sdk-0.1.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nexum_sdk-0.1.4.tar.gz
Algorithm Hash digest
SHA256 99f5f1c39f9c7dee8f97a6dfc70e54c0cd9a8cb0b54240a6fea4a55748b8a3e7
MD5 1908faca6c6e44ef7ba5dc38f6434d78
BLAKE2b-256 21f368a43883c0aca75a7f1d57f9909c2587d3433c429a2e82de9f618df63809

See more details on using hashes here.

File details

Details for the file nexum_sdk-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: nexum_sdk-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nexum_sdk-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ffb5ed7f9441a5fb5c48f2e698b9738d021df56e53c125217be78618d8f81e92
MD5 51c6828c3ae3cd0dbe7dd44a90b16d51
BLAKE2b-256 5e91dd7d5b5e0ccec33e1e2ce97426af58dcca67ce7a54f5f2e30d6a078f8a65

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