Skip to content

Add BNS support when setting rewards address #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stjet
Copy link
Contributor

@stjet stjet commented Feb 7, 2025

Tested locally, working. This makes it more convenient for people with BNS (.ban) domains to login (no longer need to copy paste address from somewhere, which is especially inconvenient from other devices).

I tried to get it to work with the rollup thing, and make banani-bns a NPM dependency but couldn't get it working (sorry). Instead, added a script (bns.js) that sets the library on the window.bns property. The bns.js script is miniified, but can be reproduced by doing:

> git clone https://github.com/stjet/bns
> cd bns
> npm i
> npm run browser

Then checking the bns-browser.js file.

I wasn't sure what RPC to use, so it uses the kalium RPC for now, but can be changed easily.

Also edited the developer docs.

How to test

  1. Go to /rewards/address
  2. Type in a BNS domain, for example, nishina247.mictest.
  3. Choose either option.
  4. After a few seconds, the field will change to the Banano address resolved (in this case, ban_1o7ija3mdbmpzt8qfnck583tn99fiupgbyzxtbk5h4g6j57a7rawge6yzxqp), and the next step will use that address
    Success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant