Skip to content

ui for send flow#331

Merged
jbojcic1 merged 1 commit intomasterfrom
send-ui
Apr 17, 2025
Merged

ui for send flow#331
jbojcic1 merged 1 commit intomasterfrom
send-ui

Conversation

@gudnuf
Copy link
Contributor

@gudnuf gudnuf commented Mar 22, 2025

This adds the UI and flow for sending with cashu accounts.

Users can scan/paste invoices or cashu requests, or they can simply enter an amount to send a token.

  • Cashu token: get proofs (may require a swap) that match the amount and then encode as a token that the user can copy
  • invoice: get proofs that match the amount and melt them to pay the invoice
  • cashu request (NUT-18): create proofs that match the request (requested mint and amount) then send over some transport

@gudnuf gudnuf requested a review from jbojcic1 March 22, 2025 00:06
@vercel
Copy link

vercel bot commented Mar 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
boardwalk ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 17, 2025 7:10pm

@supabase
Copy link

supabase bot commented Mar 22, 2025

Updates to Preview Branch (send-ui) ↗︎

Deployments Status Updated
Database Thu, 17 Apr 2025 19:11:00 UTC
Services Thu, 17 Apr 2025 19:11:00 UTC
APIs Thu, 17 Apr 2025 19:11:00 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Thu, 17 Apr 2025 19:11:02 UTC
Migrations Thu, 17 Apr 2025 19:11:02 UTC
Seeding Thu, 17 Apr 2025 19:11:02 UTC
Edge Functions Thu, 17 Apr 2025 19:11:02 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@jbojcic1
Copy link
Collaborator

rebased it on latest master

});
}

const sendAmount = convert(amount);
Copy link
Collaborator

Choose a reason for hiding this comment

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

thinking about this now and I am not sure I understand it.

so if account is in USD and I paste the ln invoice the amount will be in btc and here we will convert it to usd according to our rate and then usd value will be stored. isn't that usd value then ignored because we need to pay exact btc amount for invoice to be actually paid and the actual dollar value will depend on the mint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea the idea here is that the user will then be redirected to /send/confirm and the send amount should be set to their input currency. So it might be ignored, but this sets it for the UI.

Copy link
Collaborator

Choose a reason for hiding this comment

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

why don't we just set it in bitcoin without the conversion?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and disable the input so user can't change the amt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should definitely disable the input

why don't we just set it in bitcoin without the conversion?

I think that would work as long as we change these sendAccounts to sendAmount in the send-input:

  } = useMoneyInput({
    initialRawInputValue: sendAmount?.toString(sendCurrencyUnit) || '0',
    initialInputCurrency: sendAccount.currency,
    initialOtherCurrency: sendAccount.currency === 'BTC' ? 'USD' : 'BTC',
  });

Copy link
Collaborator

Choose a reason for hiding this comment

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

added todo. we will try to improve it in a new pr

@jbojcic1 jbojcic1 merged commit cb46774 into master Apr 17, 2025
5 checks passed
@jbojcic1 jbojcic1 deleted the send-ui branch April 17, 2025 19:16
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.

2 participants