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

[BX-890] GET addys url for user assets #745

Merged
merged 7 commits into from
Jul 12, 2023
Merged

Conversation

derHowie
Copy link
Member

What changed (plus any additional context for devs)

I removed the web socket code we were using to request user assets by chain. I replaced this a GET request to addys. I also fixed how we were grabbing cached data from react-query in the event of an error or bad request.

Screen recordings / screenshots

Screen Shot 2023-07-10 at 11 07 19 AM Screen Shot 2023-07-10 at 11 08 53 AM Screen Shot 2023-07-10 at 11 09 03 AM Screen Shot 2023-07-10 at 11 09 11 AM

What to test

There shouldn't be any change in behavior. Just make sure that the user's assets are showing up correctly.

Final checklist

  • I have tested my changes in a LavaMoat bundle (yarn build).
  • I have tested my changes in Chrome & Brave.
  • If your changes are visual, did you check both the light and dark themes?

@linear
Copy link

linear bot commented Jul 10, 2023

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-2334be60b85b94c25cb90c4ad01bc18f3cb0b508.zip

@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-537981161079ac6ad7e9a252047d1d2390f071ec.zip

Comment on lines 100 to 101
const response = await addysHttp.get(url);
const data = response.data as AddressAssetsReceivedMessage;
Copy link
Contributor

Choose a reason for hiding this comment

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

btw you can also pass the type as a generic
it's still casting internally 😆 not a change request, just a note cause I added it not long ago

const { data } = await addysHttp.get<AddressAssetsReceivedMessage>(url);

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooo, yeah. Much cleaner. Ty sir

Comment on lines 132 to 135
const a: Record<string, ParsedAddressAsset> = {};
newParsedUserAssetsByUniqueId.forEach(
(parseAsset) => (a[parseAsset.uniqueId] = parseAsset),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd find a reduce easier to understand here, but up to you

return newParsedUserAssetsByUniqueId.reduce((acc, parsedAsset) => {
  acc[parsedAsset.uniqueId] = parsedAsset
  return acc
}, {})

@derHowie derHowie force-pushed the @chris/addys-user-assets branch from 4b6936a to 8dfa0c1 Compare July 10, 2023 21:53
Copy link
Contributor

@greg-schrammel greg-schrammel left a comment

Choose a reason for hiding this comment

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

🤌

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-306b3d540934396a0760b872897ad617b20b80a5.zip

} catch (e) {
logger.error(
new RainbowError(
`userAssetsByChain.ts - chain: ${chain} - address: ${address}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't have set to stone patterns for this but i believe we're using a different one

{location without .ts}: {message}

Copy link
Contributor

@estebanmino estebanmino left a comment

Choose a reason for hiding this comment

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

🔥 🔥 🔥 🔥 🔥

@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-60daa631160fdf24a0d1839cebd26b95ef315498.zip

@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-cbfea96180dee5d2f9a38803e776de077b1921cd.zip

@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-d6574a1913c780309fd99d98693723553701de7b.zip

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-f9c92ee8bdbfe7fcd6201e2947715e539ea8e8b5.zip

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-f9c92ee8bdbfe7fcd6201e2947715e539ea8e8b5.zip

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-f9c92ee8bdbfe7fcd6201e2947715e539ea8e8b5.zip

@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-f9c92ee8bdbfe7fcd6201e2947715e539ea8e8b5.zip

@derHowie derHowie merged commit ce98f5b into master Jul 12, 2023
@derHowie derHowie deleted the @chris/addys-user-assets branch July 12, 2023 19:12
@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-ce98f5bb63036869d52b3a0f6b2f528199a131e0.zip

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