Skip to main content

PyPI Package - near-collection-py

Project description

near-collection-py

Python client for managing collections on the NEAR Protocol blockchain.

Requirements

  • Python 3.9+

Installation

pip install near-collection-py

Quick Start

from near_collection_py import NearCollectionPyClient

client = NearCollectionPyClient()

Custom RPC endpoint:

client = NearCollectionPyClient(rpc_url="https://rpc.testnet.near.org", timeout=60)

API Reference

NearCollectionPyClient(rpc_url, timeout)

Parameter Default Description
rpc_url mainnet RPC NEAR RPC endpoint URL
timeout 30 Request timeout in seconds

Methods

Method Description
get_account(account_id) Fetch account details
get_block(block_id) Retrieve block by ID or hash
get_transaction(tx_hash, sender_id) Look up a transaction
get_collection(collection_id) Get a single collection
list_collections(account_id) List all collections for an account
get_collection_items(collection_id) Retrieve items in a collection
get_item(collection_id, item_id) Fetch a specific item
send_transaction(signed_tx) Broadcast a signed transaction
send_transaction_async(signed_tx) Broadcast without waiting for result
create_collection(account_id, metadata) Create a new collection

Example

client = NearCollectionPyClient()

account = client.get_account("alice.near") collections = client.list_collections("alice.near") items = client.get_collection_items(collections[0]["id"])

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

near_collection_py-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

near_collection_py-1.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file near_collection_py-1.0.0.tar.gz.

File metadata

  • Download URL: near_collection_py-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for near_collection_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5aacd1bb804375534744b5587046412ecc7f20277cfafacc690fe7d2ea890a8f
MD5 e80c0121f483d9f59eb5265beaf57240
BLAKE2b-256 5e46fb6325ddb4e9e83673208833335ecc5af403cf6153d27ab718059e7d86d9

See more details on using hashes here.

File details

Details for the file near_collection_py-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for near_collection_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0098f259945e08f4703d6a5ba2f41d7061237573f98243d85cafc7c31a8a681c
MD5 bcf538ea678814307da3104ba3c4fb5a
BLAKE2b-256 d1762dbe4a2d87dc982091be65e29e2b49b2bd0474136345c1cb6fa9a8c14155

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