-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add connected uma/wallet screens, show uma in button, persist uma in local storage #119
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @bsiaotickchong and the rest of your teammates on Graphite |
8f84962
to
3f09615
Compare
3f09615
to
c398805
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very exciting stuff!!
|
||
export const ConnectionCard = ({ connection, uma, balance }: Props) => { | ||
const handleCopyUma = () => { | ||
navigator.clipboard.writeText(uma || ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do the little "copied" notification thing we do on cn2 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i think so, or just a change in icon/animation will probably work so it's not as heavy. Will ask design
// const discoveryDocument = await fetch(`https://${umaDomain}/.well-known/uma-configuration`); | ||
// const discoveryDocumentJson = await discoveryDocument.json<DiscoveryDocument>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to just do this now if you've got the code written out? Pinkdrink works with this now at least, I think? I assume it was just making testing easy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I didn't know it was already being served, i'll fix it in a followup (and i need to try running the backend locally)
authorization_endpoint: "http://localhost:3000/apps/new", | ||
}; | ||
|
||
// TODO: get real client_id from vasp? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client ID doesn't come from the VASP, it needs to be passed in by the client application as a configuration. They should set their client app identity npub and identity relay in a configuration somewhere.
const clientId = | ||
"npub1u2zfe9zpq2gcuduxatqa5k3alq5yny9qdeq8yrjfqxh4qywa6ejq8daqq6 wss://nos.lol"; | ||
|
||
// TODO: generate redirectUri based on current page or have it provided by client app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would guess we want to allow client apps to set this themselves, but maybe you're right we could default to the current window.location.href.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i'm assuming they might change the query params esp if it's a checkout page or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah exactly - probably need to have some state there.
kind="secondary" | ||
externalLink={ | ||
uma | ||
? `https://nwc.${getUmaDomain(uma)}/connection/${connection.connectionId}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of using nwc.umadomain here, we might need to load this from the uma-configuration too 🤔. Fine for now, but we'll likely need to update that for flexibility.
with uma, balance permission, spending limit, renewal, and expiration date
no uma:
no balance permission:
no spending limit:
no expiration: