Skip to content

feat(prediction-markets): migrate prediction market examples to Dynamic JS SDK#51

Draft
avneesh0612 wants to merge 8 commits into
mainfrom
feat/prediction-markets-js-sdk
Draft

feat(prediction-markets): migrate prediction market examples to Dynamic JS SDK#51
avneesh0612 wants to merge 8 commits into
mainfrom
feat/prediction-markets-js-sdk

Conversation

@avneesh0612
Copy link
Copy Markdown
Contributor

Summary

  • Converts nextjs-polymarket-demo and nextjs-kalshi-demo from React SDK to JS SDK
  • Applies standard visual theme (Roboto font, #4779FF palette, custom DynamicButton)
  • Removes DynamicContextProvider, DynamicUserProfile, wagmi, WagmiProvider, and DynamicWagmiConnector
  • Adds custom auth dropdown with Google OAuth, email OTP, and wallet connect
  • Uses createWalletClientForWalletAccount from @dynamic-labs-sdk/evm/viem for Polymarket EVM trading
  • Uses signTransaction + getSolanaConnection from @dynamic-labs-sdk/solana for Kalshi Solana transactions

Test plan

  • Verify auth flow (email OTP, Google, wallet connect) in each app
  • Verify prediction market trading works after SDK migration (Polymarket on Polygon, Kalshi on Solana)
  • Verify custom DynamicButton shows address when connected, Sign in when disconnected
  • Verify standard light theme applied (white header, Roboto font, #4779FF accents, footer)
  • Verify LiFi cross-chain swap works in deposit flows

🤖 Generated with Claude Code

avneesh0612 and others added 7 commits May 4, 2026 21:34
Converts nextjs-bridge-mayan and nextjs-bridge-swaps-lifi from the
React SDK (@dynamic-labs/*) to the JS SDK (@dynamic-labs-sdk/*),
applying the standard visual theme and custom DynamicButton auth flow.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Converts nextjs-stablecoin-yield-aave, nextjs-defi-lending-morpho, and
nextjs-stablecoin-yield-pods from React SDK (@dynamic-labs/sdk-react-core,
@dynamic-labs/wagmi-connector) to the JS SDK (@dynamic-labs-sdk/client ^0.24.1
+ @dynamic-labs-sdk/evm ^0.24.1).

- Removes DynamicContextProvider, DynamicWagmiConnector, WagmiProvider,
  ThemeProvider and all wagmi hooks (useAccount, useChainId, useWriteContract,
  useSwitchChain, useReadContract, useReadContracts)
- Adds createDynamicClient + addEvmExtension pattern in src/lib/dynamic.ts
- Adds custom WalletContext with useWallet() hook in src/lib/providers.tsx
- Replaces wagmi contract hooks with direct viem publicClient reads and
  createWalletClientForWalletAccount for writes
- Applies standard visual theme (Roboto font, #4779FF palette, custom
  DynamicButton with Google/Email/Wallet auth flows)
- Removes theme-provider.tsx, mode-toggle.tsx, hamburger-menu.tsx, wagmi.ts

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Converts nextjs-iron-ramp from React SDK to JS SDK 0.24.1 with EVM extension, WalletContext, custom DynamicButton, and standard Roboto/light theme
- Upgrades nextjs-moneygram-ramp from JS SDK 0.12.1 to 0.24.1 using simpler addEvmExtension/addSolanaExtension pattern, adds standard theme, header, footer, and custom DynamicButton with multi-chain support

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…S SDK

- Converts nextjs-polymarket-demo from React SDK to @dynamic-labs-sdk/client + @dynamic-labs-sdk/evm
- Converts nextjs-kalshi-demo from React SDK to @dynamic-labs-sdk/client + @dynamic-labs-sdk/solana
- Removes DynamicContextProvider, DynamicUserProfile, wagmi, WagmiProvider, DynamicWagmiConnector
- Adds custom DynamicButton with Google OAuth, email OTP, and wallet connect
- Applies standard light theme (Roboto font, #4779FF palette, white header, footer)
- Uses createWalletClientForWalletAccount for EVM trading; signTransaction for Solana
- Updates lifi-provider to use JS SDK wallet accounts instead of React SDK hooks

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…anch

Strip out swaps (bridge-mayan, bridge-swaps-lifi), yield (morpho, aave, pods),
and ramps (iron-ramp, moneygram-ramp) — those belong in their own PRs.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@avneesh0612 avneesh0612 marked this pull request as draft May 13, 2026 22:32
Polymarket:
- Full light theme (white cards, #DADADA borders, #4779FF accent, #030303 text)
  across MarketCard, Navigation, TagsFilter, SortFilter, MarketStats, Header,
  Portfolio modal, PositionCard, OrderCard, SellModal, ConfirmModal, Toast,
  Skeleton, LogoIcon, globals.css Dynamic modal
- Full-width sticky header (moved max-width container out of layout into page)
- Expanded CATEGORY_MAP (30+ entries) so tab filters actually work
- Fix trading signer: replace Web3Provider wrapping with ViemEthersSigner that
  calls walletClient.signTypedData() directly — bypasses unreliable
  eth_signTypedData_v4 provider round-trip
- Await createWalletClientForWalletAccount (was using Promise as client)
- Fix lifi-provider: same await fix + remove invalid chain prop
- Fix LiFiView: swapParams undefined, b.address type narrowing
- Fix positions API: data-api.polymarket.com has mismatched TLS cert;
  use native https.Agent({ rejectUnauthorized: false }) scoped to that host

Kalshi:
- Full light theme matching Polymarket convention
- Add missing @dynamic-labs-sdk/solana + empty-module.js + transpilePackages
- Fix addSolanaExtension() SSR guard (typeof window)
- Fix DynamicButton: evmAccount → solanaAccount, ensureEvmWallet →
  ensureSolanaWallet, getEvmProviders → getSolanaProviders (excludes MetaMask),
  label "Choose an EVM wallet" → "Choose a Solana wallet"
- Fix LiFiView: b.address type narrowing

Kamino (also on fix/kamino-method-not-implemented-fallback):
- Move pnpm overrides from npm-style root key to pnpm.overrides — fixes
  Vercel building with two @solana/web3.js versions causing VersionedTransaction
  type conflict

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kamino Error Error May 14, 2026 10:03pm
predictions-market-demo Error Error May 14, 2026 10:03pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant