Skip to content

fix: resolve type safety issues across contract, hooks, and wallet provider - #704

Merged
Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
thelux134:fix/678-679-680-681-type-safety
Aug 29, 2026
Merged

fix: resolve type safety issues across contract, hooks, and wallet provider#704
Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
thelux134:fix/678-679-680-681-type-safety

Conversation

@thelux134

Copy link
Copy Markdown
Contributor

Summary

Fixes four type safety issues identified across the codebase.


#678lib/contract.ts: null guard on RPC poll result

Added an explicit if (!pollJson.result) continue guard before accessing pollJson.result.status in 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.

#679hooks/use-contract.ts: eliminate triple non-null assertion on mapped.details

Refactored showErrorToast so the truthy branch for the action property captures mapped.details into a single const details variable. All three subsequent references use details instead of repeating mapped.details!, removing the redundant non-null assertions.

#680hooks/use-webhooks.ts: replace object with typed WebhookPayload

Introduced an exported WebhookPayload interface:

export interface WebhookPayload {
  event: WebhookEventType | string
  timestamp: string
  data: Record<string, unknown>
}

Replaced the untyped object parameter in both deliverWithRetry (line 61) and fireEvent (line 123) with WebhookPayload, giving consumers a proper contract and enabling type-checking on webhook payloads.

#681components/providers/wallet-provider.tsx: replace any with proper interface types

The module-level _lobstrWcClient and _lobstrWcSession variables were typed as any. They are now typed using the WalletConnectClient and WalletConnectSession interfaces already defined earlier in the same file:

let _lobstrWcClient: WalletConnectClient | null = null;
let _lobstrWcSession: WalletConnectSession | null = null;

.gitignore improvements

  • Changed tsconfig.tsbuildinfo*.tsbuildinfo (wildcard catches all projects)
  • Added dist/, .turbo/, *.local, .env, storybook-static/, .nyc_output/, junit.xml

Closes #678
Closes #679
Closes #680
Closes #681

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Austinaminu2
Austinaminu2 merged commit ac4ac0f into FlowwStar:main Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment