Skip to content

Qns module loader - #481

Open
0xalank wants to merge 2 commits into
PelagusWallet:1.0from
0xalank:qns-module-loader
Open

Qns module loader#481
0xalank wants to merge 2 commits into
PelagusWallet:1.0from
0xalank:qns-module-loader

Conversation

@0xalank

@0xalank 0xalank commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 23, 2026 02:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-renderer webpack entry and a new qns-renderer.html extension 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)
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.

2 participants