Skip to main content

A python library to simplify sending and receiving Banano. Also a RPC wrapper.

Project description

A direct translation of the resolver bits of the BNS Typescript Library into Python. That Typescript library relies on the banani library, which was a translation of bananopie (a Python library for Banano). And this library relies on bananopie too... Seems like I've gone full circle.

See the BNS protocol spec for more details.

Published on pypi as bananopie-bns:

pip install bananopie-bns

Example from tests.py:

from bananopie_bns import *
from bananopie import RPC

rpc = RPC("https://kaliumapi.appditto.com/api")

#all the TLDs as of Nov 19 2024
test_tld_mapping = {
  "mictest": "ban_1dzpfrgi8t4byzmdeidh57p14h5jwbursf1t3ztbmeqnqqdcbpgp9x8j3cw6",
  "jtv": "ban_3gipeswotbnyemcc1dejyhy5a1zfgj35kw356dommbx4rdochiteajcsay56",
  "ban": "ban_1fdo6b4bqm6pp1w55duuqw5ebz455975o4qcp8of85fjcdw9qhuzxsd3tjb9",
}

resolver = Resolver(rpc, test_tld_mapping)

nishina247 = resolver.resolve("nishina247", "mictest")

print(nishina247["resolved_address"])
print(len(nishina247["history"]), nishina247["metadata_hash"])

print(resolver.resolve("doesnotexist19190836", "jtv") == None)
print(resolver.resolve("skip", "jtv")["resolved_address"])

print(resolver.resolve_backwards_ish("ban_1n4f89e93kkg5dchm1thgqcd6hchtidunbru3pwbq11iwn11qwbgyka8ruop", "mictest")["resolved_address"])

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

bananopie_bns-0.0.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

bananopie_bns-0.0.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file bananopie_bns-0.0.3.tar.gz.

File metadata

  • Download URL: bananopie_bns-0.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for bananopie_bns-0.0.3.tar.gz
Algorithm Hash digest
SHA256 98d9f3ca6d891f356c51b202915632d6115d7133fe1bffb7a971364a770a9cd7
MD5 2da97fd9e69c77d1facc0b7be4130fd4
BLAKE2b-256 dac5b47927bf5640b32159857928d774f44942cef13a11519a72b27f9805736c

See more details on using hashes here.

File details

Details for the file bananopie_bns-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: bananopie_bns-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for bananopie_bns-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 193f0c6185480bf2e64667e87331f7b8c9e6033d40e52ba5a2c8fb108edc62d2
MD5 bb7adfc1be68304acf3453e1db6d819a
BLAKE2b-256 30e47b95783467c3a4d5e57457704b4c0c21ca95d081e82dee0888e943b59619

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