fix: resolve type safety issues across contract, hooks, and wallet provider - #704
Merged
Austinaminu2 merged 1 commit intoAug 29, 2026
Merged
Conversation
|
@thelux134 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes four type safety issues identified across the codebase.
#678 —
lib/contract.ts: null guard on RPC poll resultAdded an explicit
if (!pollJson.result) continueguard before accessingpollJson.result.statusin the transaction polling loop. A transient missing-result RPC response previously caused a runtime throw via non-null assertion (!); now it gracefully skips the iteration and retries on the next poll cycle.#679 —
hooks/use-contract.ts: eliminate triple non-null assertion onmapped.detailsRefactored
showErrorToastso the truthy branch for theactionproperty capturesmapped.detailsinto a singleconst detailsvariable. All three subsequent references usedetailsinstead of repeatingmapped.details!, removing the redundant non-null assertions.#680 —
hooks/use-webhooks.ts: replaceobjectwith typedWebhookPayloadIntroduced an exported
WebhookPayloadinterface:Replaced the untyped
objectparameter in bothdeliverWithRetry(line 61) andfireEvent(line 123) withWebhookPayload, giving consumers a proper contract and enabling type-checking on webhook payloads.#681 —
components/providers/wallet-provider.tsx: replaceanywith proper interface typesThe module-level
_lobstrWcClientand_lobstrWcSessionvariables were typed asany. They are now typed using theWalletConnectClientandWalletConnectSessioninterfaces already defined earlier in the same file:.gitignoreimprovementstsconfig.tsbuildinfo→*.tsbuildinfo(wildcard catches all projects)dist/,.turbo/,*.local,.env,storybook-static/,.nyc_output/,junit.xmlCloses #678
Closes #679
Closes #680
Closes #681