Skip to content

Align Connect with Dusk Send provider surface#1

Merged
HDauven merged 1 commit intomainfrom
feat/dusk-send-shielded-profiles
May 6, 2026
Merged

Align Connect with Dusk Send provider surface#1
HDauven merged 1 commit intomainfrom
feat/dusk-send-shielded-profiles

Conversation

@HDauven
Copy link
Copy Markdown
Member

@HDauven HDauven commented May 5, 2026

This pull request updates the Dusk wallet provider and integration documentation, demos, and reference implementations to use a new "profile"-based model instead of the previous "account"-based model. The main change is the introduction of profiles as the primary identity object, replacing accounts throughout the API, events, and documentation. This brings improved privacy and flexibility, especially around shielded addresses. The changes also expand and clarify the required provider methods, events, and conformance guidance for wallet implementers.

API and Identity Model Update

  • Replaced all references to accounts with profiles in the provider API, events, and documentation. The provider now exposes profiles instead of selectedAddress, and emits profilesChanged rather than accountsChanged. The primary connect method is now dusk_requestProfiles, and passive reads use dusk_profiles. [1] [2] [3] [4]
  • Introduced the DuskProfile type, which includes a profileId, account, and an optional shieldedAddress. Shielded receive addresses are now profile-scoped and must be explicitly requested. [1] [2] [3]

Provider and RPC Method Surface

  • Expanded the documented and implemented provider RPC surface to include new methods (dusk_requestProfiles, dusk_profiles, dusk_requestShieldedAddress, etc.) and clarified required features and event semantics. [1] [2] [3] [4]
  • Updated the provider event model: profilesChanged replaces accountsChanged, and emitting profilesChanged([]) is now the standard for lock or loss of visibility, not just disconnection. [1] [2] [3]

Documentation and Examples

  • Updated all guides (README.md, wallet-discovery.md, wallet-implementer.md) to reflect the new profiles model, including code samples, event descriptions, and conformance testing instructions. [1] [2] [3] [4] [5]
  • Improved the conformance testing section to focus on profiles and the new provider surface, and clarified the intended integration and testing patterns for wallet implementers.

Demo and Reference Implementation Updates

  • Updated the discovery demo and reference wallet implementation to use profiles, including UI text, provider mocks, and event handling. [1] [2] [3] [4]

Code and Example Cleanups

  • Removed obsolete methods and properties (such as enable() and selectedAddress) from provider implementations and examples. [1] [2]

These changes bring the Dusk wallet integration model in line with the new privacy-focused profile approach and provide clearer guidance and improved conformance tooling for wallet developers.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the Dusk wallet SDK to support “payment profiles” (public account + optional approved shielded receive address), selective disclosure bundles/receipts, settlement encryption keys, and gateway Phoenix withdraw flows, and threads these capabilities through the SDK, examples, mocks, tests, and docs.

Changes:

  • Added profile-aware connection and state (profiles, selectedProfile) plus new wallet APIs (requestProfiles, requestShieldedAddress, requestDisclosureBundle, requestSettlementEncryptionKey, requestShieldedSettlementReceipt, requestGatewayWithdraw).
  • Normalized contract-call transaction params before forwarding to the provider (privacy defaulting/validation, contractId normalization, fnName trimming, fnArgs hex encoding).
  • Updated UI components, mocks/reference wallet, tests, and documentation to reflect the new provider RPC surface and feature flags.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/wallet.ts Implements profile state + new RPC helpers; normalizes tx params before sending.
src/wallet.test.ts Adds test coverage for new profile/shielded/disclosure/gateway behaviors and tx normalization.
src/ui/modal.ts Allows passing connectOptions through the connect modal into wallet.connect(...).
src/ui/connect-button.ts Adds connectOptions plumbing from the connect button to the modal and connect call.
src/types.ts Introduces new profile/disclosure/settlement/gateway types and capability feature flags; adds privacy to transfer params.
src/test/referenceWallet.ts Extends the reference wallet test provider with new RPC methods/features.
src/test/mocks.ts Extends mock provider + mock UI wallet to support profiles, shielded address flows, disclosure, settlement keys, and gateway withdraw.
src/contract.ts Adds privacy to contract tx overrides so contract writes can request shielded calls.
src/contract.test.ts Updates contract facade tests to assert privacy is propagated.
src/app.ts Extends tx override parsing to include privacy.
README.md Documents the new RPC methods and shows updated usage examples for profiles, shielded addresses, and disclosure bundles.
examples/reference-wallet/main.js Updates the example wallet provider to implement the new profile/shielded RPCs and feature flag.
examples/discovery-demo/main.js Updates the discovery demo mock provider with profile/shielded RPCs and feature flag.
docs/wallet-implementer.md Adds implementer guidance and example code for profiles, shielded pairing, disclosure bundles, and signing requirements.
docs/wallet-discovery.md Updates discovery docs with the newly supported RPC methods.
Comments suppressed due to low confidence (1)

src/test/mocks.ts:452

  • createMockUiWallet.connect is typed as (options?: { shieldedReceiveAddress?: boolean }), but the production API now uses ConnectOptions (also includes reason/label). Keeping this narrower type can cause excess-property TypeScript errors in UI tests when passing the real connect options object. Consider reusing ConnectOptions here (or at least Partial<ConnectOptions>).
    connect: vi.fn(async (options?: { shieldedReceiveAddress?: boolean }) => {
      const accounts = state.accounts.length ? [...state.accounts] : ["dusk1connectedacct"];
      const profiles = [
        {
          profileId: "profile:0",
          account: accounts[0] ?? "dusk1connectedacct",
          ...(options?.shieldedReceiveAddress ? { shieldedAddress: "dusk1connectedshielded" } : {}),
        },
      ];
      state = {
        ...state,
        authorized: true,
        accounts,
        profiles,
        selectedAddress: accounts[0] ?? null,
        selectedProfile: profiles[0] ?? null,
        lastUpdated: Date.now(),
      };
      notify();
      return [...state.accounts];
    }),

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/wallet.ts Outdated
Comment thread src/test/mocks.ts
@HDauven HDauven force-pushed the feat/dusk-send-shielded-profiles branch from af30b5c to f3d7b93 Compare May 6, 2026 01:15
@HDauven HDauven changed the title Add shielded profile payment support Align Connect with Dusk Send provider surface May 6, 2026
@HDauven HDauven force-pushed the feat/dusk-send-shielded-profiles branch from f3d7b93 to 9493ee1 Compare May 6, 2026 08:23
@HDauven HDauven merged commit 2b43987 into main May 6, 2026
1 check passed
@HDauven HDauven deleted the feat/dusk-send-shielded-profiles branch May 6, 2026 12:04
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