Conversation
This branch has not been deployed
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.
Why
The Vite example reads its Blockfrost key from
VITE_BLOCKFROST_PROJECT_ID, and Vite copies everyVITE_variable into the JavaScript the browser downloads. A build with a dummy key shows it indist/assets/index-*.js. The wallet security guide lists this as a common mistake ("Wrong: Provider Keys in Frontend") and recommends the server-builds, browser-signs split, which the example did not follow.Two smaller bugs sat next to it: ADA amounts were truncated (1.005 ADA sent 1,004,999 lovelace), and the wallet's network limit followed the build mode, so a production build refused testnet wallets even with
VITE_NETWORK=preprod.What changes
server/payments.tsbuilds the payment with the key and submits the signed transaction, following the sample inclients/architecture/frontend-backend. The browser client uses onlywithCip30.pnpm devserves the API through a small Vite plugin;pnpm build && pnpm startserves it with the built app. No new runtime dependency.VITE_NETWORK.BLOCKFROST_PROJECT_IDreplacesVITE_BLOCKFROST_PROJECT_ID, and the README shows the new flow.Verified
type-checkandbuildpass, the files pass the repo's ESLint and Prettier, andpnpm install --frozen-lockfileworks with the updated lockfile.dist/.