feat: SEP-10 login, version tracking, mempool averages, build fixes#1
Merged
feat: SEP-10 login, version tracking, mempool averages, build fixes#1
Conversation
The Stellar Wallets Kit has transitive deps (near-js, hot-wallet)
that use CJS require("buffer") and reference Node globals (global,
process). These fail in browser ESM bundles.
- Add buffer to import map for esbuild resolution
- Inject shim that sets globalThis.Buffer, global, and process
- Post-build patch: intercept __require("buffer") in esbuild's CJS shim
- Inject app version via esbuild define for build-time inlining
Import StellarWalletsKit, WalletNetwork, FreighterModule, and the modal component from specific subpaths instead of the barrel export. The barrel re-exports all wallet modules (NEAR, Solana, etc.) which pull in heavy, browser-incompatible deps.
The Stellar Wallets Kit modal uses inline styles (Lit web components) and loads wallet icons from stellar.creit.tech. Update CSP to permit both.
Freighter's signMessage doesn't work on custom/standalone networks. Use the existing SEP-10 challenge flow (/stellar/auth) which uses signTransaction — supported on all networks. The SEP-10 JWT uses the same signing key as the dashboard JWT, so it's accepted by all dashboard endpoints.
Read version from deno.json at build time via esbuild define, display as a badge next to the "Provider Console" brand text. The version is inlined at compile time — no runtime file reads.
Render the extended mempool endpoint response: live stats, historical averages (queue depth, processing time, throughput), and the platform version badge. Averages are computed server-side from the last hour of metric snapshots.
Automatically bump the version in deno.json on every merge to main, driven by conventional commit prefixes: - feat: → minor bump - fix:/chore:/anything else → patch bump - BREAKING CHANGE/feat!: → major bump Commits the version change and creates a git tag. Skips runs triggered by its own commits to prevent loops.
- HIGH: fail build loudly if __require buffer patch doesn't match - Remove redundant 'unsafe-hashes' from CSP, document 'unsafe-inline' - URL-encode publicKey in stellar auth query param - Update getMempool() return type to match new response shape - Escape appVersion in nav for consistency with other views - Fix hint text to reflect Freighter-only module loading - Remove debug console.error from login error handler - Add null-safety for averages/live in mempool view
- Define MempoolLive, MempoolAverages, MempoolConfig interfaces in api.ts - Remove `as` cast in mempool view, use typed response directly - Add test task to deno.json - Tests for: build patch regex matching, API URL encoding and payload, mempool view null-safety (all fields, missing live, missing averages, missing platformVersion)
- Escape averages.windowMinutes and averages.sampleCount in innerHTML - Make live and averages optional in MempoolResponse to match runtime null-safety handling in the view - Remove unused assertThrows import from build_test.ts - Remove unused createEl() from mempool_test.ts
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
signMessage(unsupported on custom networks) tosignTransactionvia the existing/stellar/authchallenge flowdeno.jsoninjected at build time, shown in the nav bardeno.jsonversion on every merge to main based on conventional commit prefix (feat→minor, fix→patch, breaking→major)Commits
fix: add buffer and Node.js polyfills for wallets kit buildfix: import wallets kit from subpaths to reduce bundle sizefix: allow inline styles and wallet icons in CSPfeat: switch login to SEP-10 transaction signingfeat: display app version in nav barfeat: add mempool averages and platform version to mempool viewfeat: add auto-version workflow on merge to mainTest plan