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: support for issued currencies on Escrows and PaymentChannels #587

Open
wants to merge 3 commits into
base: staging
Choose a base branch
from

Conversation

dangell7
Copy link

@dangell7 dangell7 commented Feb 7, 2023

High Level Overview of Change

Updates to the explorer to reflect the changes made by amendment xls34d.

Context of Change

Updated the Tx Description to reflect both XPR and currencies
Updated the account to update the escrow when the user changes the primary (current) currency.

Proposed XLS-34d spec can be found here: XRPLF/XRPL-Standards#112

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

TypeScript/Hooks Update

  • Updated files to React Hooks
  • Updated files to TypeScript

Before / After

Test Plan

Please review. I didn't do paychannels as I wanted to get your thoughts on the escrow. I dont like how its only the currency and not the issuer but the explorer only uses the currency so I think it might suffice unless you add that additional functionality.

If you do want to add that functionality in rippled we use USD/rIssuerAddress for the Amount string.

@dangell7
Copy link
Author

dangell7 commented Feb 7, 2023

A small video showing the functionality.. Please let me know if this is what were looking for.

Screen.Recording.2023-02-07.at.4.47.31.PM.mov

@mvadari mvadari requested a review from ckniffen February 7, 2023 21:51
@mvadari
Copy link
Collaborator

mvadari commented Feb 7, 2023

Please add testcases.

@ckniffen
Copy link
Collaborator

ckniffen commented Feb 8, 2023

I think the PR should be broken out into transaction updates and then one for account page changes.

For the account page I agree with you that grouping by currency is odd. That is one reason we created the assets tab.

@bugsbunnies do you think it makes sense to add an Escrows and Paychannel tabs so that we can show the breakdowns there? This would be similar to the account page for XRPScan. The amount column would show what currency and issuer it is using the component we use else where.

Monosnap rLSn6Z3T8uCxbcd1oxwfGQN1Fdn5CyGujK - XRP Account | XRPSCAN 2023-02-08 14-43-47

@bugsbunnies
Copy link
Collaborator

bugsbunnies commented Feb 10, 2023

Concept after discussion with @ckniffen

Transactions
image

Escrow as a separate tab
image

@dangell7
Copy link
Author

Concept after discussion with @ckniffen

Transactions image

Escrow as a separate tab image

This looks really amazing!

@mvadari
Copy link
Collaborator

mvadari commented Feb 15, 2023

Concept after discussion with @ckniffen

Transactions image

Escrow as a separate tab image

A thought: could the tabs not appear when a user doesn't have escrows or payment channels? Since most users won't have either.

@ckniffen
Copy link
Collaborator

A thought: could the tabs not appear when a user doesn't have escrows or payment channels? Since most users won't have either.

I like the idea of them always being there. That way we don't have to make requests to get them everytime the user visits an account page like we currently do. This will speed up load time.

@mvadari
Copy link
Collaborator

mvadari commented Feb 15, 2023

A thought: could the tabs not appear when a user doesn't have escrows or payment channels? Since most users won't have either.

I like the idea of them always being there. That way we don't have to make requests to get them everytime the user visits an account page like we currently do. This will speed up load time.

We already make the requests every time the user visits an account page.

@ckniffen
Copy link
Collaborator

We already make the requests every time the user visits an account page.

Only because we currently show the escrow and paychannel information outside of the tabs. I am suggesting this change could move it out.

Comment on lines +234 to +239
try {
if (!date) {
return null
}
return new Intl.DateTimeFormat(lang, options).format(date)
} catch {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this try-catch block catch that wasn't caught before? Seems better to solve the root cause instead of using this blanket fix.

@mvadari
Copy link
Collaborator

mvadari commented Jun 1, 2023

Looks like tests are currently failing on this PR.

@intelliot
Copy link
Collaborator

For reference: PaychanAndEscrowForTokens amendment in rippled - XRPLF/rippled#4396

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.

5 participants