Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
52
- Provide a thin SDK that lets Para-connected wallets drive Miden WebClient flows (account bootstrap + remote signing) and expose the same experience to React apps and sample integrations.
Loading actions...
src/, then layer ergonomics (useParaMiden) and runnable demos (examples/react) on top.@miden-sdk/miden-para) — exports createParaMidenClient, low-level helpers (signCb, modal helpers, key/seed utilities) and type definitions. Builds ship as dual CJS/ESM bundles generated by scripts/build.mjs.packages/use-miden-para-react, published as @miden-sdk/use-miden-para-react) — useParaMiden watches Para React SDK state, instantiates createParaMidenClient, and hands back { client, accountId, para, evmWallets } for UI code.examples/react) — Vite + React starter that wires ParaProvider, the hook, and a ConsumeAllNotes component showing how to sync, fetch, and consume notes against https://rpc.testnet.miden.io.tests/) — Node’s built-in test runner validates the DOM modals by transpiling src/modalClient.ts on the fly.yarn install (Yarn 1.22.22 is pinned).yarn build → runs esbuild per-format + tsc for d.ts generation. Outputs land in dist/{esm,cjs,types}.cd packages/use-miden-para-react && yarn build (tsup).yarn test (root). Example app: cd examples/react && yarn dev.npm run publish (root) invokes prepack/postpack, moving miden-sdk-miden-para-<version>.tgz into build/.src/midenClient.ts)
createParaMidenClient(para, wallets, opts) filters wallet list to EVM entries, fetches uncompressed public keys (getUncompressedPublicKeyFromWallet), and lets the user choose one (accountSelectionModal).WebClient.createClientWithExternalKeystore, injecting signCb to pipe signing prompts through Para’s signMessage.createAccount guarantees a Miden account exists for the chosen wallet using commitment data derived via evmPkToCommitment.src/modalClient.ts)
typeof document).tests/modalClient.test.cjs) assert rendering, resolution semantics, and cleanup.packages/use-miden-para-react/src/useParaMiden.ts)
useClient, useAccount, useWallet (Para React SDK) to watch connection state.@miden-sdk/miden-sdk for AccountType, spins up the Para-backed WebClient once wallets resolve, and memoizes the resulting client in a ref.@miden-sdk/miden-para).examples/react/src/components/ConsumeAllNotes.tsx)
ParaProvider + TanStack Query.Buffer/process (examples/react/src/polyfills.ts) so the SDK can run in Vite.@miden-sdk/miden-para) and the react integration (@miden-sdk/use-miden-para-react).src/; export via src/index.ts. Run yarn build + yarn test. Keep browser safety in mind (no Node globals, guard for window).packages/use-miden-para-react/src/useParaMiden.ts, ensure types remain framework-agnostic (only React in this package). Update README + bump version when API changes.src/modalClient.ts and extend tests to pin desired behavior. Ensure no external CSS dependencies.examples/react as a playground; document new flows in its README so developers can replicate steps in their apps.@getpara/web-sdk, @getpara/react-sdk) — provide wallet discovery, JWT issuance, and signing.@miden-sdk/miden-sdk) — supplies WebClient, account builders, Felt/RPO utilities, and transaction helpers.@noble/hashes) — used for keccak hashing + hex conversions during signing.Keep peer dependency versions aligned with package.json to avoid duplicated SDK copies inside consuming apps.