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

mod: erc-20 #147

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

mod: erc-20 #147

wants to merge 26 commits into from

Conversation

stephancill
Copy link
Contributor

@stephancill stephancill commented Jan 11, 2024

Change Summary

This mod introduces a representation for ERC-20 tokens

  • Holder info based on current user
  • Price info
  • Token metadata
  • Swap transaction
  • Swap fee
  • Cache token information endpoint responses (/api/erc-20)
  • Refine styling
  • Transaction progress states (tx hash, success)

Depends on #135 (PR #150)

v2 suggestions

  • Optimize order routing speed
  • Custom buy amount
  • Sell action

Preview

No wallet connected state

Screenshot 2024-01-19 at 15 43 40

Wallet connected state

Screenshot 2024-01-19 at 11 59 24

Buy state

Available options depends on wallet eth balance on the specified chain
Screenshot 2024-01-19 at 15 45 12

Transaction initiated state

Screenshot 2024-01-19 at 11 59 38

Transaction complete state

Screenshot 2024-01-19 at 11 59 58

Additional changes

  • feat(core): add SETSTATE action
  • feat(core+react-ui-shadcn): add Padding element
  • feat(core): support multiple parellel async actions

Merge Checklist

  • PR has a changeset
  • PR includes documentation if necessary
  • PR updates the rich-embed examples if necessary
  • includes a parallel PR for Mod-starter and the gateway if necessary

Copy link

changeset-bot bot commented Jan 11, 2024

🦋 Changeset detected

Latest commit: 869c9d0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@mods/zora-nft-minter Minor
@mod-protocol/react-ui-shadcn Patch
@mod-protocol/react Patch
@mod-protocol/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 11, 2024

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

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2024 2:32pm
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2024 2:32pm
example-nextjs-shadcn ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2024 2:32pm

@qbig
Copy link

qbig commented Jan 26, 2024

is this about to get shipped?

@davidfurlong
Copy link
Contributor

is this about to get shipped?

do you have some urgency to use this @qbig? feel free to DM me

@stephancill
Copy link
Contributor Author

Update:

  • Implemented uniswap transactions with referral fee (feat: mod/client referrals #152 activates rev share). This takes noticeably longer to calculate swap routes than the 1inch API, so have introduced an intermediate "calculating best swap route" screen. There are caching options, but none that are serverless-compatible from what I can tell.
  • Refactored token info endpoints
  • Investigated the pagination issue with Airstack - don't think they will be implementing in-query filtering any time soon
  • Added an href property to the avatar element to also link to the token's page

I think the holders you follow feature is valuable despite the relatively long initial loading time (can be optimized in a future update)

Let me know what your thoughts are on merge readiness @davidfurlong

@davidfurlong
Copy link
Contributor

I'm getting 500s on localhost. There's something going wrong where in the example only one of the ERC20s loads

@davidfurlong
Copy link
Contributor

seems to almost be like the two requests for the two different erc20s compete with eachother

@stephancill
Copy link
Contributor Author

I think it's a rate limiting issue with the 1inch API that we're using for spot prices. Need to replace with uniswap SDK as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants