Skip to content
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

feat: add custom records to NWC connector #3172

Merged
merged 7 commits into from
Jul 4, 2024
Merged

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Jun 14, 2024

Adds custom records (mainly used for podcasting payments but could be other things) to the NWC connector.

There is no standard on how these should be passed. In the NIP-47 spec metadata can be returned, so I think it makes sense to keep the custom_records (custom TLVs) in a separate object inside the metadata object.

https://github.com/nostr-protocol/nips/blob/master/47.md

(I will link the NWC PR when it's ready)

Related: getAlby/hub#60
Related: getAlby/nostr-wallet-connect#251

image
image

@reneaaron
Copy link
Contributor

Great! Just one little thing I noticed in your screenshot?

Is the encoding somewhat wrong here? (see App metadata)

@rolznz
Copy link
Contributor Author

rolznz commented Jun 14, 2024

@reneaaron it's the ⚡ emoji. It seems to also be encoded wrongly using the LNDHub connector.

I also saw this check is wrong (it's checking the message but using the podcast) and I can't actually see where the message field is being used - edit: it looks like it's just a bad copy-paste (as per the screenshot the message was not shown)

{transaction.boostagram?.message && (
            <TransactionDetailRow
              title={t("boostagram.message")}
              content={transaction.boostagram?.podcast}
            />
          )}

@rolznz
Copy link
Contributor Author

rolznz commented Jun 14, 2024

@reneaaron I wonder if the emoji issue is some side effect of using base64 decoding, do you have any idea?

@reneaaron
Copy link
Contributor

@rolznz I'll try to debug it 👍

@@ -0,0 +1,10 @@
// https://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙀

src/extension/background-script/connectors/nwc.ts Outdated Show resolved Hide resolved
@rolznz rolznz disabled auto-merge July 4, 2024 03:26
@rolznz rolznz merged commit 4c892bb into master Jul 4, 2024
6 checks passed
@rolznz rolznz deleted the feat/nwc-custom-records branch July 4, 2024 03:40
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.

3 participants