Skip to content

Commit de17221

Browse files
committed
docs: add Dusk Connect integration path
1 parent 5fae310 commit de17221

9 files changed

Lines changed: 60 additions & 53 deletions

File tree

‎public/llms-full.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Dusk should be understood as a stack:
1313
- DuskVM: the WASM execution environment for native Dusk smart contracts.
1414
- Rusk: the Rust node implementation that runs DuskDS.
1515
- Citadel: identity and access primitives for selective disclosure and regulated workflows.
16-
- Dusk Connect: wallet discovery and account connection for Dusk applications.
16+
- Dusk Connect: wallet-extension discovery, profile access, and user-approved transactions for browser dApps.
1717
- Dusk Trade: application-layer market infrastructure for tokenized financial assets.
1818

1919
## Key Concepts

‎public/llms.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- [Native Dusk Overview](https://docs.dusk.network/developer/duskds/overview/): understand native Rust/WASM contract development.
1919
- [Native Dusk Quickstart](https://docs.dusk.network/developer/duskds/quickstart/): create, test, build, and deploy a native contract.
2020
- [Native Contract Reference](https://docs.dusk.network/developer/duskds/reference/): understand the native contract, ABI, state, event, and deployment model.
21-
- [Dusk Connect](https://docs.dusk.network/developer/integrations/dusk-connect/): integrate wallet discovery and account connection.
21+
- [Dusk Connect](https://docs.dusk.network/developer/integrations/dusk-connect/): discover wallet extensions, request profile access, and submit user-approved transactions from browser dApps.
2222
- [Dusk Wallet Extension](https://docs.dusk.network/developer/integrations/wallet-extension/): integrate with the first-party browser wallet provider.
2323
- [Transaction Lifecycle](https://docs.dusk.network/developer/integrations/tx-lifecycle/): understand transaction flow.
2424
- [HTTP API](https://docs.dusk.network/developer/integrations/http-api/): integrate with Dusk APIs.

‎src/content/docs/developer/duskds/overview.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ Both environments are general-purpose. The choice is primarily about the executi
2323
| [Forge](https://github.com/dusk-network/forge) | Scaffolds contracts and generates ABI exports, schemas, and data drivers from annotated Rust |
2424
| [DuskVM](/learn/deep-dive/dusk-vm/) | Executes contract WASM and persists contract state |
2525
| [Rusk Wallet](/learn/rusk-wallet/) | Signs and submits deployment and contract-call transactions |
26+
| [Dusk Connect](/developer/integrations/dusk-connect/) | Connects browser dApps to compatible Dusk wallet extensions for account access and transaction approval |
2627
| [W3sper](/developer/integrations/w3sper/) | Connects JavaScript applications to Dusk nodes and contract data drivers |
2728

2829
A typical workflow is:
2930

3031
1. Scaffold a contract with Forge.
3132
2. Implement and test it locally against DuskVM.
3233
3. Build and verify the contract and data-driver WASM artifacts.
33-
4. Deploy the contract and submit calls through Rusk Wallet or an SDK.
34+
4. Deploy the contract, then connect applications through Dusk Connect, W3sper, or the HTTP API.
3435

3536
Start with the [native Dusk quickstart](/developer/duskds/quickstart/). Use the [contract reference](/developer/duskds/reference/) when you need the ABI, state, serialization, event, or deployment details.

‎src/content/docs/developer/duskds/quickstart.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ rusk-wallet --network testnet contract-call \
112112
--fn-args "${ARGS#0x}"
113113
```
114114

115-
`contract-call` submits a transaction and waits for inclusion. For read-only queries and application integration, use [W3sper](/developer/integrations/w3sper/) or the [Rusk HTTP API](/developer/integrations/http-api/).
115+
`contract-call` submits a transaction and waits for inclusion. In a browser dApp, use [Dusk Connect](/developer/integrations/dusk-connect/) to discover wallet extensions, request account access, and ask the selected wallet to approve transactions. Use [W3sper](/developer/integrations/w3sper/) or the [Rusk HTTP API](/developer/integrations/http-api/) for direct node queries and contract data-driver integration.
116116

117117
Before building a production contract, read the [native contract reference](/developer/duskds/reference/).

‎src/content/docs/developer/duskds/reference.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,5 @@ Both deployment and contract calls submitted as transactions consume gas, whethe
119119
- [DuskVM source](https://github.com/dusk-network/rusk/tree/master/vm)
120120
- [Dusk contract ABI](https://docs.rs/dusk-core/latest/dusk_core/abi/)
121121
- [Rusk Wallet](/learn/rusk-wallet/)
122+
- [Dusk Connect](/developer/integrations/dusk-connect/)
122123
- [W3sper SDK](/developer/integrations/w3sper/)
Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,63 @@
11
---
22
title: Dusk Connect
3-
description: Integrate Dusk wallet discovery and account connection into applications.
3+
description: Connect Dusk applications to compatible wallet extensions with @dusk/connect.
44
---
55

6-
Dusk Connect is the wallet integration layer for Dusk applications. It gives dApps a consistent way to discover compatible wallets, request accounts, and build connection flows around Dusk accounts.
6+
Dusk Connect (`@dusk/connect`) is the wallet integration layer for browser dApps on Dusk. It discovers compatible wallet extensions, requests profile access, tracks the active wallet and network, and sends user-approved transactions through the selected wallet.
77

8-
Use Dusk Connect when your application needs to:
8+
The SDK is framework-agnostic, typed, and has no runtime dependencies. An optional modal and `<dusk-connect-button>` are available from `@dusk/connect/ui`.
99

10-
- detect compatible Dusk wallet providers
11-
- let users select a wallet
12-
- request account access
13-
- handle public and shielded account flows in a consistent UI
14-
- integrate with Dusk wallet software without hardcoding one provider
10+
## Install
1511

16-
## Where it fits
12+
Dusk Connect is published on JSR:
13+
14+
```bash
15+
npx jsr add @dusk/connect
16+
```
17+
18+
For Deno:
1719

18-
Dusk applications often need two kinds of integration:
20+
```bash
21+
deno add jsr:@dusk/connect
22+
```
1923

20-
- **Network integration**: read chain data, submit transactions, and observe events.
21-
- **Wallet integration**: ask a user to connect an account and approve actions.
24+
## Connect a wallet
2225

23-
Dusk Connect is for the wallet side. For network APIs and transaction flow, see [Transaction Lifecycle](/developer/integrations/tx-lifecycle), [HTTP API](/developer/integrations/http-api), and [W3sper SDK](/developer/integrations/w3sper).
26+
`createDuskWallet()` starts wallet discovery and exposes a reactive view of the connection:
2427

25-
If you are testing against the first-party browser wallet, use the [Dusk Wallet Extension](/developer/integrations/wallet-extension) as one compatible provider.
28+
```js
29+
import { createDuskWallet } from "@dusk/connect";
2630

27-
## Typical flow
31+
const wallet = createDuskWallet();
32+
await wallet.ready();
2833

29-
A dApp integration usually follows this shape:
34+
if (wallet.state.availableProviders.length > 1 && !wallet.state.providerId) {
35+
await wallet.selectProvider(wallet.state.availableProviders[0].uuid);
36+
}
3037

31-
1. Discover available Dusk wallet providers.
32-
2. Show the user the compatible wallets.
33-
3. Request account access from the selected wallet.
34-
4. Store the active account and provider for the session.
35-
5. Ask the wallet to approve transactions or account actions when needed.
38+
const profiles = await wallet.connect();
39+
console.log(profiles[0]);
40+
```
41+
42+
`wallet.connect()` opens the selected wallet's approval flow. The wallet state updates when the user changes profile, account access, or network. Use `wallet.subscribe()` to update application state reactively.
43+
44+
## Where it fits
3645

37-
The exact API depends on the version of Dusk Connect you integrate.
46+
Use Dusk Connect for user-facing wallet flows:
3847

39-
## Repository
48+
- discover one or more compatible wallet extensions
49+
- let the user select a wallet and grant profile access
50+
- access public accounts and request shielded receive addresses
51+
- request message signatures and user-approved transactions
52+
- react to profile, authorization, and network changes
4053

41-
The Dusk Connect SDK is developed in the Dusk Network GitHub organization:
54+
For a native smart-contract dApp, `createDuskApp()` adds read-only contract calls, data-driver loading, and prepared contract writes to the same wallet connection. Use [W3sper](/developer/integrations/w3sper/) or the [HTTP API](/developer/integrations/http-api/) when an application or backend needs direct node access without an injected wallet.
4255

43-
- <a href="https://github.com/dusk-network/connect" target="_blank" rel="noreferrer">dusk-network/connect</a>
56+
The [Dusk Wallet Extension](/developer/integrations/wallet-extension/) is the first-party wallet provider for testing this flow. Dusk Connect uses the Dusk discovery protocol instead of hardcoding a particular extension.
4457

45-
## Read next
58+
## Next steps
4659

47-
- [Dusk Wallet Extension](/developer/integrations/wallet-extension)
48-
- [Web Wallet](/learn/web-wallet)
49-
- [Transaction Lifecycle](/developer/integrations/tx-lifecycle)
50-
- [W3sper SDK](/developer/integrations/w3sper)
60+
- [Dusk Connect repository and API reference](https://github.com/dusk-network/connect)
61+
- [Dusk Wallet Extension](/developer/integrations/wallet-extension/)
62+
- [Transaction Lifecycle](/developer/integrations/tx-lifecycle/)
63+
- [W3sper SDK](/developer/integrations/w3sper/)

‎src/content/docs/developer/integrations/w3sper.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ console.log(await counter.call.get_count());
8686
await network.disconnect();
8787
```
8888

89-
The driver for this example is the file produced at `target/data-driver/wasm32-unknown-unknown/release/dusk_counter.wasm`. Methods under `contract.call` are read-only; submitting contract transactions also requires a synced profile and `Bookkeeper`.
89+
The driver for this example is the file produced at `target/data-driver/wasm32-unknown-unknown/release/dusk_counter.wasm`. Methods under `contract.call` are read-only; submitting contract transactions directly through W3sper also requires a synced profile and `Bookkeeper`. For browser dApps where the user's wallet should approve the transaction, use [Dusk Connect](/developer/integrations/dusk-connect/).
9090

9191
## Query GraphQL
9292

‎src/content/docs/developer/integrations/wallet-extension.md‎

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,19 @@ See [Dusk Connect](/developer/integrations/dusk-connect) for the SDK-level integ
3030

3131
If you are building the application side, start with Dusk Connect. If you are testing or documenting the wallet-provider side, use this page together with the wallet provider API.
3232

33-
## Provider discovery
33+
## Connect from a dApp
3434

35-
The extension announces an EIP-1193-style provider through Dusk discovery events. Dusk is not an EVM chain, so wallet methods use Dusk-specific names.
35+
Use `@dusk/connect` to discover the extension and request profile access. This also handles multiple compatible Dusk wallets without binding the application to this extension:
3636

3737
```js
38-
const providers = [];
38+
import { createDuskWallet } from "@dusk/connect";
3939

40-
window.addEventListener("dusk:announceProvider", (event) => {
41-
providers.push(event.detail);
42-
});
43-
44-
window.dispatchEvent(new Event("dusk:requestProvider"));
45-
46-
const dusk = providers[0]?.provider;
47-
const [account] = await dusk.request({ method: "dusk_requestAccounts" });
48-
49-
dusk.on("accountsChanged", console.log);
50-
dusk.on("chainChanged", console.log);
40+
const wallet = createDuskWallet();
41+
await wallet.ready();
42+
const profiles = await wallet.connect();
5143
```
5244

53-
For the canonical provider API, see the wallet repository:
45+
See [Dusk Connect](/developer/integrations/dusk-connect/) for installation, provider selection, and application integration. The extension still exposes the lower-level Dusk provider API for wallet authors and specialized integrations:
5446

5547
- <a href="https://github.com/dusk-network/wallet/blob/main/docs/provider-api.md" target="_blank" rel="noreferrer">Dusk Wallet provider API</a>
5648

‎src/content/docs/developer/overview.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ As a builder, choose the path based on what your product needs and which tooling
2929
description="Write general-purpose Rust/WASM contracts directly on Dusk's native execution layer."
3030
/>
3131
<LinkCard
32-
title="Integrate with DuskDS"
33-
href="/developer/integrations/tx-lifecycle"
34-
description="Use HTTP APIs, W3sper, and events to integrate wallets, exchanges, and backends."
32+
title="Integrate a Dusk dApp"
33+
href="/developer/integrations/dusk-connect"
34+
description="Connect wallet extensions with Dusk Connect, and use W3sper or HTTP APIs for direct network access."
3535
/>
3636
<LinkCard
3737
title="Dusk Improvement Proposals"

0 commit comments

Comments
 (0)