-
-
Notifications
You must be signed in to change notification settings - Fork 3
[Example] Invitation link #57
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
base: main
Are you sure you want to change the base?
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. It is recommended to resolve "Warn" alerts too. Learn more about Socket for GitHub.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Async Client Initialization Causes Null Assertion Errors
The ClaimRewardButton component's handleRedeemDelegation function uses non-null assertions (!) on pimlicoClient and bundlerClient. These clients, returned by usePimlicoServices, are initialized asynchronously and are initially undefined, creating a race condition that can lead to runtime errors if the function is called before they are ready.
examples/invitation-link-example/src/components/ClaimRewardButton.tsx#L46-L65
gator-examples/examples/invitation-link-example/src/components/ClaimRewardButton.tsx
Lines 46 to 65 in c391305
| ); | |
| const { fast: fee } = await pimlicoClient!.getUserOperationGasPrice(); | |
| const hash = await bundlerClient!.sendUserOperation({ | |
| account: smartAccount, | |
| calls: [ | |
| { | |
| to: getDeleGatorEnvironment(chain.id).DelegationManager, | |
| data: redeemData, | |
| }, | |
| ], | |
| ...fee, | |
| paymaster: paymasterClient, | |
| }); | |
| setUserOperationHash(hash); | |
| setWaitingForReceipt(true); | |
| setLoading(false); | |
| const { receipt } = await bundlerClient!.waitForUserOperationReceipt({ |
examples/invitation-link-example/src/components/ClaimRewardButton.tsx#L30-L32
gator-examples/examples/invitation-link-example/src/components/ClaimRewardButton.tsx
Lines 30 to 32 in c391305
| const chain = sepolia; | |
| const { bundlerClient, paymasterClient, pimlicoClient } = | |
| usePimlicoServices(); |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Description
Adds invitation link example