Skip to main content

build PyPI version License: MIT Code style: black

Pyonear

pyonear is a Python binding to the NEAR Rust API crates. It provides fast and robust wrappers for building, signing and (de)serializing transactions. The wrapped types come from the near-primitives, near-crypto and near-vm-errors crates.

Installation

pip install pyonear

Example usage

>>> from pyonear.crypto import InMemorySigner, KeyType
>>> from pyonear.account_id import AccountId
>>> from pyonear.crypto_hash import CryptoHash
>>> from pyonear.transaction import Transaction, TransferAction
>>> signer = InMemorySigner.from_random(AccountId("alice.near"), KeyType.ED25519)
>>> signer_id = AccountId("alice.near")
>>> signer = InMemorySigner.from_random(signer_id, KeyType.ED25519)
>>> public_key = signer.public_key
>>> nonce = 0
>>> receiver_id = AccountId("bob.near")
>>> block_hash = CryptoHash.default() # replace with a real blockhash
>>> actions = [TransferAction(1_000_000)]
>>> transaction = Transaction(signer_id, public_key, nonce, receiver_id, block_hash, actions).sign(signer)
>>> transaction.to_base64()
'CgAAAGFsaWNlLm5lYXIA++M56uPzUi8ezkHqJBLjc7ZCzJk88zoIpF5XkjUM13kAAAAAAAAAAAgAAABib2IubmVhcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAANAQg8AAAAAAAAAAAAAAAAAALK42W7t/vpUmDAgtChTUWEVvSE3cQZWRla8spN6KfNv9fWn16klROeblzH480b0a+NSL16YfnvWLnd2C9KLTQk='

Development

Pre-requisites: Rust >= 1.65, Python >= 3.7, Poetry >= 1.1.14

Steps

  1. poetry install (one time only)
  2. poetry shell
  3. maturin develop
  4. pytest
  5. make lint

Metadata

Release files for pyonear 0.1.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 pyonear 0.1.0
File Size Uploaded
pyonear-0.1.0.tar.gz 59.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyonear 0.1.0
File
pyonear-0.1.0-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
pyonear-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl CPython 3.7 abi3 Linux musl 1.2+ x86-64 Details
pyonear-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
pyonear-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.7 abi3 Linux glibc 2.17+ IBM System/390x Details
pyonear-0.1.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl CPython 3.7 abi3 Linux glibc 2.17+ PowerPC 64-be Details
pyonear-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.7 abi3 Linux glibc 2.17+ ARM64 Details
pyonear-0.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.7 abi3 macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64 Details

Total release size: 26.3 MB

Release files / pyonear-0.1.0.tar.gz

Download URL pyonear-0.1.0.tar.gz
Size 59.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ea4ba9c82ac0daab6013ccfce7928fcc66e378c0af226afece66c9e7b6a94524
BLAKE2b-256 checksum
How to use checksums
c01a0483a1287a1d054abdc1caaf50cce7ac19b5a87b2f2670c0f10d899338cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.5

Release files / pyonear-0.1.0-cp37-abi3-win_amd64.whl

Download URL pyonear-0.1.0-cp37-abi3-win_amd64.whl
Size 2.3 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
fe88c9f9883aebb6be5c3937950c0a9fe3a9c31108ad7920c5fa6e42cbf39fd0
BLAKE2b-256 checksum
How to use checksums
eb44c7b6abe76e24ad061139dec510e041080b48906797e3f4c10fda4836cebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.5

Release files / pyonear-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl

Download URL pyonear-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl
Size 3.7 MB
Tags CPython 3.7 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
96f31fc817a3e68a49279ad922d4d326d7760c8dc757516f1fb7927fa57bb44a
BLAKE2b-256 checksum
How to use checksums
d09dd375c5318f06c41a074dcff70ef39a0a0162daaf18a177efda72f6e4852d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.5

Release files / pyonear-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyonear-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.5 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d8ff4288002ed7d9992da6f1cd755b48c7f5a58080c8a9a7bdcafcb72e960799
BLAKE2b-256 checksum
How to use checksums
13a55d582273d664f03d3a5dc36b36050c53af4245e1a2a92a2bfc577e377f9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.5

Release files / pyonear-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL pyonear-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 4.1 MB
Tags CPython 3.7 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
eda3c7d24637612d418faca60afd7189b60e28b3c7680387853a9741262d1104
BLAKE2b-256 checksum
How to use checksums
944598387cdae9152013fc1da4255ac88caab80733edf7ef943ff3a04a3491d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.5

Release files / pyonear-0.1.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl

Download URL pyonear-0.1.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Size 4.0 MB
Tags CPython 3.7 Linux glibc 2.17+ PowerPC 64-be abi3
SHA-256 checksum
How to use checksums
e78972761da5ff8b9a31588fb7ef0cb4ac9563ac25d0316311a01d75665ba658
BLAKE2b-256 checksum
How to use checksums
55bfcde5caebb6d7790f245262ec80495ec7aa15e998bd1341289e9feb91e76c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.5

Release files / pyonear-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pyonear-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.5 MB
Tags CPython 3.7 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2202f97445bb674367b7b40dd72ac259961719caba7a6547aa0d39ae261cdab4
BLAKE2b-256 checksum
How to use checksums
de007aeb5d26114f27884461e0ad85590f1218079feae33c51c885123fb0548f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.5

Release files / pyonear-0.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL pyonear-0.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 5.0 MB
Tags CPython 3.7 abi3 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c5a1abbea5c8edcc463a713754850bf7e5868c65a373ae2def306741879e354c
BLAKE2b-256 checksum
How to use checksums
983f085ddcdbc70d775e136332e60d178046eaf39ad86845c8a9f30a0361100f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

8 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