Faucet service & Iframe integration#661
Conversation
Deploying happychain with
|
| Latest commit: |
2337b9f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b2aef1c5.happychain.pages.dev |
| Branch Preview URL: | https://gabriel-faucet.happychain.pages.dev |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
HAPPY-436 Embed faucet in wallet
This would be a nice touch — will need syncing with Caldera considering the captcha system. |
There was a problem hiding this comment.
Viem seems to still be a peer deps of the common package, but wasn't actually used.
The issue is that because this is exported from the main index.ts, then it forces any consumer of common to have viem installed.
The fix is to have a separate lib/viem.ts that exports viem stuff, and then make a different subpath export in package.json — then people will import viem stuff via import { isAddress } from @happy.tech/common/viem and the main path will not require viem.
I was actually meaning to do that change, I want to move a new signTransaction function here that has our optimization for avoid the eth_getChainID call on walletClient.signTransaction.
There was a problem hiding this comment.
There was a problem hiding this comment.
f8c945c to
28aa40c
Compare
… getting the token
apps/faucet/src/errors.ts
Outdated
|
|
||
| export class FaucetCaptchaError extends HappyFaucetError { | ||
| constructor(message?: string, options?: ErrorOptions) { | ||
| super(403, message || "Captcha verification failed", options) |
There was a problem hiding this comment.
| super(403, message || "Captcha verification failed", options) | |
| super(403, message || "Captcha verification failed on the faucet service", options) |
I ran into this and I thought the error layed with Cloudflare but it was with the service
There was a problem hiding this comment.
I think the service should await inclusion of the tx, so we can simply await response from the server on the wallet and invalidate the token balance query when the faucet completes. This will lead to a smooth flow: click > sending... > token sents, balance is updated.
There was a problem hiding this comment.
|
The server is giving me a forbidden 403 (both before and after the changes I made. I didn't try to redeploy, maybe that would solve it? Once this is resolved, let's merge this! Main followup issue: |
Solved. The problem occurred because the deployed faucet didn't have the latest environment variables |

Linked Issues
Description
This PR introduces a new faucet service that allows users to receive tokens on HappyChain. Additionally, this service is integrated within the iframe.
Toggle Checklist
Checklist
Basics
norswap/build-system-caching).Reminder: PR review guidelines
Correctness
testnet, mainnet, standalone wallet, ...).
< INDICATE BROWSER, DEMO APP & OTHER ENV DETAILS USED FOR TESTING HERE >
< INDICATE TESTED SCENARIOS (USER INTERFACE INTERACTION, CODE FLOWS) HERE >
and have updated the code & comments accordingly.
Architecture & Documentation
(2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
comments.
in a Markdown document.
packages/coreandpackages/react), see here for more info.