Skip to main content

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"])

Release files for bananopie-bns 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bananopie-bns 0.0.3
File Size Uploaded
bananopie_bns-0.0.3.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bananopie-bns 0.0.3
File Interpreter ABI Platform
bananopie_bns-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / bananopie_bns-0.0.3.tar.gz

Download URL bananopie_bns-0.0.3.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
98d9f3ca6d891f356c51b202915632d6115d7133fe1bffb7a971364a770a9cd7
BLAKE2b-256 checksum
How to use checksums
dac5b47927bf5640b32159857928d774f44942cef13a11519a72b27f9805736c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / bananopie_bns-0.0.3-py3-none-any.whl

Download URL bananopie_bns-0.0.3-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
193f0c6185480bf2e64667e87331f7b8c9e6033d40e52ba5a2c8fb108edc62d2
BLAKE2b-256 checksum
How to use checksums
30e47b95783467c3a4d5e57457704b4c0c21ca95d081e82dee0888e943b59619
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 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