Skip to main content

Tools for working with the Neo N3 blockchain.

Project description

Neo Toolbox

Small toolkit for interacting with the Neo N3 blockchain.

Available tools

  1. Data Transformation
  2. Create Owner Bytes
  3. Create Update Invocation File

Data Transformation

Lets you convert between wallet hashes and addresses.

Example
from neo_toolbox.data_transformation import encode_hash, decode_address

# Encode a wallet hash
original_hash_hex = 'a7271ccc82bb311db369719d1868e6ac19ece31f'
address = encode_hash(original_hash_hex)
print(address)
# Outputs: 'NNpbB25aNMY2pD5JkWeAEbsNfp7C3GoZF1'

# Decode a wallet address
original_address = 'NNpbB25aNMY2pD5JkWeAEbsNfp7C3GoZF1'
hash_hex = decode_address(original_address)
print(hash_hex)
# Outputs: 'a7271ccc82bb311db369719d1868e6ac19ece31f'

Create Owner Bytes

This helper function lets you convert a N3 wallet address to an python variable that can be used in your smart contract to verify the owner of the contract. This is very useful to add admin functionality to your smart contract.

Example
from neo_toolbox.create_owner_bytes import create_owner_bytes

original_address = 'NNpbB25aNMY2pD5JkWeAEbsNfp7C3GoZF1'
code_snippet = create_owner_bytes(original_address)
print(code_snippet)
# Outputs: 'OWNER = UInt160(b"\x1f\xe3\xec\x19\xac\xe6h\x18\x9dqi\xb3\x1d1\xbb\x82\xcc\x1c'\xa7")'

Create Update Invocation File

This helper function lets you create a Neo Express invocation file that can be used to update a smart contract.

Example
from neo_toolbox.create_update_invocation_file import create_update_invocation_file

nef_file = 'path/to/sample_contract.nef'
manifest_file = 'path/to/sample_contract.manifest.json'
template = create_update_invocation_file('your_contract_name', nef_file, manifest_file, operation='my_custom_update')
print(template)
# Outputs a JSON string: '[{"contract": ...'

Created and maintained by Adapted Consulting AS (Norway).

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

neo-toolbox-0.1.6.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

neo_toolbox-0.1.6-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file neo-toolbox-0.1.6.tar.gz.

File metadata

  • Download URL: neo-toolbox-0.1.6.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.11 Linux/4.15.0-76-generic

File hashes

Hashes for neo-toolbox-0.1.6.tar.gz
Algorithm Hash digest
SHA256 959d5bb2bfc0e419d0220ef770fa2c965a911d151347bb5c064ff4ba8a03eedc
MD5 b34fa010ae4e1a4037d01281a085433d
BLAKE2b-256 7271ede037632022f8871d37ef6e90fe56f001764cf5ebad64371bff0e6dfd3b

See more details on using hashes here.

File details

Details for the file neo_toolbox-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: neo_toolbox-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.11 Linux/4.15.0-76-generic

File hashes

Hashes for neo_toolbox-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 49f0264c857c00629146585f81cb59dca216dffd32cccbae3ae9b05e1157d3c4
MD5 82592f504a9905ecf4e908e3f05b1814
BLAKE2b-256 f9e98696c80ec6013e5626a176f7a605368e8c5d389180a7778b6929ec3ea66c

See more details on using hashes here.

Supported by

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