Qns module loader - #481
Open
0xalank wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a QNS module “loader” surface to the extension (renderer page + URL interception + provider methods), and introduces a popup-confirmed Qi send flow for dapps (qi_sendToOutputs / qi_sendTransaction) with UI support for showing dapp-requested Qi outputs.
Changes:
- Adds a new
qns-rendererwebpack entry and a newqns-renderer.htmlextension page to load/render QNS static-site modules. - Adds background interception for
.quai/qns://-style routes plus an omnibox keyword (qns) to open the renderer. - Adds wallet-owned QNS provider methods (
pelagus_qnsResolveName,pelagus_qnsGetModule,pelagus_qnsOpen) and a new dapp-confirmation pipeline for Qi sends.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.ts | Adds qns-renderer as a new build entrypoint. |
| ui/public/qns-renderer.html | New extension page shell for the QNS renderer bundle. |
| ui/pages/_NewDesign/ConfirmTransactionPage.tsx | Adds UI branch for dapp-driven Qi-send confirmations and rejection handling. |
| src/qns-renderer.ts | Implements a static-safe QNS module loader/renderer with basic sanitization and chunk loading. |
| src/background.ts | Adds QNS URL/host interception and omnibox integration. |
| QNS_MODULE_PROVIDER.md | Documents the intended QNS provider integration and security model. |
| provider-bridge-shared/types.ts | Adds typed payload/result contracts for QNS provider methods. |
| provider-bridge-shared/runtime-typechecks.ts | Adds an allowed popup route for Qi-send confirmations. |
| provider-bridge-shared/constants.ts | Adds constants for QNS provider method names. |
| manifest/manifest.json | Adds omnibox keyword + webNavigation + .quai host permissions. |
| background/services/transactions/types/index.ts | Adds request/normalized types for Qi send-to-outputs. |
| background/services/transactions/index.ts | Adds request normalization + new Qi send-to-outputs implementation. |
| background/services/provider-bridge/qns-modules.ts | New implementation of QNS provider methods and gateway URL generation. |
| background/services/provider-bridge/index.ts | Routes QNS provider methods and Qi send methods through popup confirmation. |
| background/services/internal-quai-provider/index.ts | Adds Qi RPC handling and emits dapp Qi-send confirmation events. |
| background/redux-slices/qiSend.ts | Stores pending dapp Qi-send requests; adds thunks/events for send/reject. |
| background/main.ts | Wires internal provider Qi-send events to the redux slice + UI resolution. |
| .env.example / .env.defaults | Adds QNS-related environment configuration defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fallback: string, | ||
| label: string | ||
| ): string { | ||
| const selected = typeof value === "string" && value ? value : fallback |
Comment on lines
+233
to
+237
| zone, | ||
| account: | ||
| input.account === undefined || input.account === null | ||
| ? 0 | ||
| : Number(input.account), |
Comment on lines
+639
to
+640
| return new Promise<string>((resolve, reject) => { | ||
| this.qiSendRejecters.set(origin, reject) |
Comment on lines
+626
to
+635
| case "qi_getReceiveAddresses": | ||
| return await this.internalQuaiProviderService.routeSafeRPCRequest( | ||
| method, | ||
| params, | ||
| origin | ||
| ) | ||
|
|
||
| case "qi_sendToOutputs": | ||
| case "qi_sendTransaction": | ||
| return await this.routeQiSendRequest(method, params, origin) |
Comment on lines
+240
to
+247
| case "qi_getReceiveAddresses": | ||
| return this.transactionsService.getQiReceiveAddresses( | ||
| (params[0] as { count?: number; zone?: string; account?: number }) || {} | ||
| ) | ||
|
|
||
| case "qi_sendToOutputs": | ||
| case "qi_sendTransaction": | ||
| return this.sendQiToOutputs(params[0] as QiSendToOutputsRequest, origin) |
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.
No description provided.