@dynamic-labs/webview-messages 4.71.0 → 4.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/index.cjs +2 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +1 -0
- package/src/lib/GlobalWalletModuleMessages.cjs +20 -0
- package/src/lib/GlobalWalletModuleMessages.d.ts +223 -0
- package/src/lib/GlobalWalletModuleMessages.js +16 -0
- package/src/lib/SdkModuleMessages.d.ts +15 -0
- package/src/lib/StepUpAuthMessages.d.ts +49 -0
- package/src/lib/StoreKeys.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.73.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.72.0...v4.73.0) (2026-03-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* allow passing credentialId at call time for step-up auth methods ([#10795](https://github.com/dynamic-labs/dynamic-auth/issues/10795)) ([9746667](https://github.com/dynamic-labs/dynamic-auth/commit/974666758ad8b01584cf30efbf2cb64dbde63986))
|
|
8
|
+
* **waas:** preserve WaaS key shares on session expiry using LogoutReason ([#10714](https://github.com/dynamic-labs/dynamic-auth/issues/10714)) ([26f40f7](https://github.com/dynamic-labs/dynamic-auth/commit/26f40f722302b8cf4cc035886d4408393a785283))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* override handlebars to >=4.7.9 (CVE-2026-33937) ([#10805](https://github.com/dynamic-labs/dynamic-auth/issues/10805)) ([7aa40b8](https://github.com/dynamic-labs/dynamic-auth/commit/7aa40b8472487694b438ae3a64b14524c9c726e4))
|
|
14
|
+
* use currentColor in settings icons for dark mode support ([#10811](https://github.com/dynamic-labs/dynamic-auth/issues/10811)) ([8653e97](https://github.com/dynamic-labs/dynamic-auth/commit/8653e97759f0ea5126258c1ced36ae26af3a405c)), closes [#383C48](https://github.com/dynamic-labs/dynamic-auth/issues/383C48) [#ABACB2](https://github.com/dynamic-labs/dynamic-auth/issues/ABACB2)
|
|
15
|
+
|
|
16
|
+
## [4.72.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.71.0...v4.72.0) (2026-03-26)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* add action-based MFA check to wallet export ([#10774](https://github.com/dynamic-labs/dynamic-auth/issues/10774)) ([06aae8a](https://github.com/dynamic-labs/dynamic-auth/commit/06aae8a6365adde1658b8632c8caa11df409c646))
|
|
22
|
+
* integrate checkStepUpAuth into React SDK ([#10751](https://github.com/dynamic-labs/dynamic-auth/issues/10751)) ([7907557](https://github.com/dynamic-labs/dynamic-auth/commit/79075575086b89b9bfb405d75e7c6b3d573cc25d))
|
|
23
|
+
* **react-native:** expose setup auth state ([#10779](https://github.com/dynamic-labs/dynamic-auth/issues/10779)) ([9600e46](https://github.com/dynamic-labs/dynamic-auth/commit/9600e46028b446c88e682e7d842e65d691230b14))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* allow for connectors to inject icons into bridge view ([#10752](https://github.com/dynamic-labs/dynamic-auth/issues/10752)) ([94b5c3e](https://github.com/dynamic-labs/dynamic-auth/commit/94b5c3e78a1d92558ef316d9ca6761fdc4b788d5))
|
|
29
|
+
* react-native-extension build on iOS ([#10764](https://github.com/dynamic-labs/dynamic-auth/issues/10764)) ([b5eca2a](https://github.com/dynamic-labs/dynamic-auth/commit/b5eca2aa012e3da74361e28b4a41414710fdfa9c))
|
|
30
|
+
|
|
2
31
|
## [4.71.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.70.0...v4.71.0) (2026-03-24)
|
|
3
32
|
|
|
4
33
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/webview-messages",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.73.0",
|
|
4
4
|
"description": "A package to define messages for the webview-controller",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.909",
|
|
22
|
-
"@dynamic-labs-sdk/client": "0.
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
24
|
-
"@dynamic-labs/locale": "4.
|
|
25
|
-
"@dynamic-labs/logger": "4.
|
|
26
|
-
"@dynamic-labs/message-transport": "4.
|
|
27
|
-
"@dynamic-labs/types": "4.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
29
|
-
"@dynamic-labs/webauthn": "4.
|
|
22
|
+
"@dynamic-labs-sdk/client": "0.19.0",
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.73.0",
|
|
24
|
+
"@dynamic-labs/locale": "4.73.0",
|
|
25
|
+
"@dynamic-labs/logger": "4.73.0",
|
|
26
|
+
"@dynamic-labs/message-transport": "4.73.0",
|
|
27
|
+
"@dynamic-labs/types": "4.73.0",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.73.0",
|
|
29
|
+
"@dynamic-labs/webauthn": "4.73.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {}
|
|
32
32
|
}
|
package/src/index.cjs
CHANGED
|
@@ -7,6 +7,7 @@ var assertPackageVersion = require('@dynamic-labs/assert-package-version');
|
|
|
7
7
|
var _package = require('../package.cjs');
|
|
8
8
|
var AuthModuleMessages = require('./lib/AuthModuleMessages.cjs');
|
|
9
9
|
var EmbeddedWalletsModuleMessages = require('./lib/EmbeddedWalletsModuleMessages.cjs');
|
|
10
|
+
var GlobalWalletModuleMessages = require('./lib/GlobalWalletModuleMessages.cjs');
|
|
10
11
|
var MfaMessages = require('./lib/MfaMessages.cjs');
|
|
11
12
|
var OtpMessages = require('./lib/OtpMessages.cjs');
|
|
12
13
|
var PhantomModuleMessages = require('./lib/PhantomModuleMessages.cjs');
|
|
@@ -19,6 +20,7 @@ assertPackageVersion.assertPackageVersion('@dynamic-labs/webview-messages', _pac
|
|
|
19
20
|
|
|
20
21
|
exports.authEventNames = AuthModuleMessages.authEventNames;
|
|
21
22
|
exports.embeddedWalletsEventNames = EmbeddedWalletsModuleMessages.embeddedWalletsEventNames;
|
|
23
|
+
exports.globalWalletEventNames = GlobalWalletModuleMessages.globalWalletEventNames;
|
|
22
24
|
exports.mfaEventNames = MfaMessages.mfaEventNames;
|
|
23
25
|
exports.emailEventNames = OtpMessages.emailEventNames;
|
|
24
26
|
exports.smsEventNames = OtpMessages.smsEventNames;
|
package/src/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './lib/EmbeddedWalletsModuleMessages';
|
|
|
5
5
|
export * from './lib/EthMessages';
|
|
6
6
|
export * from './lib/ExternalAuthMessages';
|
|
7
7
|
export * from './lib/FetchMessages';
|
|
8
|
+
export * from './lib/GlobalWalletModuleMessages';
|
|
8
9
|
export * from './lib/LocaleModuleMessages';
|
|
9
10
|
export * from './lib/MfaMessages';
|
|
10
11
|
export * from './lib/NetworksModuleMessages';
|
|
@@ -15,6 +16,7 @@ export * from './lib/PlatformServiceMessages';
|
|
|
15
16
|
export * from './lib/SdkModuleMessages';
|
|
16
17
|
export * from './lib/SocialAuthModuleMessages';
|
|
17
18
|
export * from './lib/SolanaMessages';
|
|
19
|
+
export * from './lib/StepUpAuthMessages';
|
|
18
20
|
export * from './lib/StorageMessages';
|
|
19
21
|
export * from './lib/SuiMessages';
|
|
20
22
|
export * from './lib/TurnkeyIframeEventProxyMessages';
|
package/src/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
|
|
|
3
3
|
import { version } from '../package.js';
|
|
4
4
|
export { authEventNames } from './lib/AuthModuleMessages.js';
|
|
5
5
|
export { embeddedWalletsEventNames } from './lib/EmbeddedWalletsModuleMessages.js';
|
|
6
|
+
export { globalWalletEventNames } from './lib/GlobalWalletModuleMessages.js';
|
|
6
7
|
export { mfaEventNames } from './lib/MfaMessages.js';
|
|
7
8
|
export { emailEventNames, smsEventNames } from './lib/OtpMessages.js';
|
|
8
9
|
export { phantomEventNames } from './lib/PhantomModuleMessages.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* List of event message names in {@link GlobalWalletModuleMessages}.
|
|
8
|
+
*
|
|
9
|
+
* Used to distinguish events (webview -> native notifications) from
|
|
10
|
+
* request/response messages (native -> webview calls). This allows
|
|
11
|
+
* the message transport layer to route events to event listeners
|
|
12
|
+
* rather than treating them as request-response calls.
|
|
13
|
+
*/
|
|
14
|
+
const globalWalletEventNames = [
|
|
15
|
+
'onSessionProposal',
|
|
16
|
+
'onSessionRequest',
|
|
17
|
+
'onSessionDelete',
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
exports.globalWalletEventNames = globalWalletEventNames;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a WalletConnect session proposal from a dApp.
|
|
3
|
+
*
|
|
4
|
+
* When a dApp wants to connect via WalletConnect, it sends a session proposal
|
|
5
|
+
* containing its metadata and the blockchain namespaces it requires or optionally
|
|
6
|
+
* supports. The host (native app) uses this to display a pairing confirmation UI
|
|
7
|
+
* and decide which chains/methods/events to approve.
|
|
8
|
+
*/
|
|
9
|
+
export type WCSessionProposal = {
|
|
10
|
+
/** Unique identifier for this proposal, used when approving or rejecting */
|
|
11
|
+
id: number;
|
|
12
|
+
params: {
|
|
13
|
+
/** Information about the dApp requesting the connection */
|
|
14
|
+
proposer: {
|
|
15
|
+
metadata: {
|
|
16
|
+
/** Human-readable name of the dApp (e.g. "Uniswap") */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Short description of the dApp */
|
|
19
|
+
description: string;
|
|
20
|
+
/** Homepage URL of the dApp */
|
|
21
|
+
url: string;
|
|
22
|
+
/** Icon URLs for the dApp, used in the pairing confirmation UI */
|
|
23
|
+
icons: string[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Namespaces the dApp requires — the session will fail if these
|
|
28
|
+
* cannot be satisfied (e.g. `{ eip155: { chains: ["eip155:1"], ... } }`)
|
|
29
|
+
*/
|
|
30
|
+
requiredNamespaces?: Record<string, WCNamespace>;
|
|
31
|
+
/**
|
|
32
|
+
* Namespaces the dApp optionally supports — the session can still be
|
|
33
|
+
* established even if these are not fully satisfied
|
|
34
|
+
*/
|
|
35
|
+
optionalNamespaces?: Record<string, WCNamespace>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Describes the capabilities of a single blockchain namespace in WalletConnect.
|
|
40
|
+
*
|
|
41
|
+
* A namespace groups chains of the same family (e.g. `eip155` for EVM chains,
|
|
42
|
+
* `solana` for Solana chains) together with the JSON-RPC methods and events
|
|
43
|
+
* that the dApp wants to use on those chains.
|
|
44
|
+
*/
|
|
45
|
+
export type WCNamespace = {
|
|
46
|
+
/** CAIP-2 chain identifiers (e.g. `["eip155:1", "eip155:137"]`) */
|
|
47
|
+
chains?: string[];
|
|
48
|
+
/** JSON-RPC methods the dApp wants to call (e.g. `["eth_sendTransaction", "personal_sign"]`) */
|
|
49
|
+
methods: string[];
|
|
50
|
+
/** Events the dApp wants to listen to (e.g. `["chainChanged", "accountsChanged"]`) */
|
|
51
|
+
events: string[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Represents an incoming signing or transaction request from a connected dApp.
|
|
55
|
+
*
|
|
56
|
+
* After a WalletConnect session is established, the dApp can send requests
|
|
57
|
+
* (e.g. sign a message, send a transaction). This type carries the request
|
|
58
|
+
* payload from the webview to the native layer so it can be shown in a
|
|
59
|
+
* confirmation UI or processed directly.
|
|
60
|
+
*/
|
|
61
|
+
export type WCSessionRequest = {
|
|
62
|
+
/** Unique identifier for this request, used when responding */
|
|
63
|
+
id: number;
|
|
64
|
+
/** Session topic identifying which connected dApp sent this request */
|
|
65
|
+
topic: string;
|
|
66
|
+
params: {
|
|
67
|
+
/** The JSON-RPC request payload */
|
|
68
|
+
request: {
|
|
69
|
+
/** JSON-RPC method name (e.g. `"personal_sign"`, `"solana_signTransaction"`) */
|
|
70
|
+
method: string;
|
|
71
|
+
/** Method-specific parameters */
|
|
72
|
+
params: unknown[];
|
|
73
|
+
};
|
|
74
|
+
/** CAIP-2 chain the request targets (e.g. `"eip155:1"`, `"solana:5eykt4..."`) */
|
|
75
|
+
chainId: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Represents an active WalletConnect session with a connected dApp.
|
|
80
|
+
*
|
|
81
|
+
* Once a session proposal is approved, the session is established and persisted.
|
|
82
|
+
* Each session tracks the connected peer's metadata, the approved namespaces
|
|
83
|
+
* (including which accounts are exposed), and an expiry timestamp.
|
|
84
|
+
*/
|
|
85
|
+
export type WCSession = {
|
|
86
|
+
/** Unique topic identifier for this session, used for all subsequent communication */
|
|
87
|
+
topic: string;
|
|
88
|
+
/** Information about the connected dApp */
|
|
89
|
+
peer: {
|
|
90
|
+
metadata: {
|
|
91
|
+
/** Human-readable name of the connected dApp */
|
|
92
|
+
name: string;
|
|
93
|
+
/** Short description of the connected dApp */
|
|
94
|
+
description: string;
|
|
95
|
+
/** Homepage URL of the connected dApp */
|
|
96
|
+
url: string;
|
|
97
|
+
/** Icon URLs for the connected dApp */
|
|
98
|
+
icons: string[];
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Approved namespaces with the accounts exposed to the dApp.
|
|
103
|
+
* Keys are namespace identifiers (e.g. `"eip155"`, `"solana"`).
|
|
104
|
+
* Each value extends {@link WCNamespace} with an `accounts` array
|
|
105
|
+
* of CAIP-10 account IDs (e.g. `["eip155:1:0xabc..."]`).
|
|
106
|
+
*/
|
|
107
|
+
namespaces: Record<string, WCNamespace & {
|
|
108
|
+
accounts: string[];
|
|
109
|
+
}>;
|
|
110
|
+
/** Unix timestamp (seconds) when this session expires */
|
|
111
|
+
expiry: number;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* State synchronized from the webview to the native layer for the global
|
|
115
|
+
* wallet connectivity module.
|
|
116
|
+
*
|
|
117
|
+
* The webview controller pushes this state whenever sessions change, allowing
|
|
118
|
+
* the native app to reactively update its UI (e.g. show connected dApps).
|
|
119
|
+
*/
|
|
120
|
+
export type GlobalWalletModuleState = {
|
|
121
|
+
/** Map of active WC sessions keyed by their topic identifier */
|
|
122
|
+
sessions: Record<string, WCSession>;
|
|
123
|
+
/** Whether the WalletKit singleton and WC event listeners have been initialized */
|
|
124
|
+
initialized: boolean;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Message contract between the native host and the webview for global wallet
|
|
128
|
+
* WalletConnect connectivity.
|
|
129
|
+
*
|
|
130
|
+
* The native app uses request messages (`initGlobalWallet`, `pairWithWC`, etc.)
|
|
131
|
+
* to drive the WalletConnect lifecycle that runs inside the webview. The webview
|
|
132
|
+
* uses event messages (`onSessionProposal`, `onSessionRequest`, `onSessionDelete`)
|
|
133
|
+
* to notify the native layer of WC events so it can display native confirmation
|
|
134
|
+
* UIs or update state.
|
|
135
|
+
*/
|
|
136
|
+
export type GlobalWalletModuleMessages = {
|
|
137
|
+
/**
|
|
138
|
+
* Initialize the WalletKit singleton and start listening for WC session
|
|
139
|
+
* events. Must be called before any other global wallet operation.
|
|
140
|
+
*/
|
|
141
|
+
initGlobalWallet: () => Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Pair with a dApp using a WalletConnect URI obtained from a QR code scan
|
|
144
|
+
* or deep link. Triggers a session proposal from the dApp.
|
|
145
|
+
* @param params.uri - The WalletConnect pairing URI (e.g. `"wc:abc123..."`)
|
|
146
|
+
*/
|
|
147
|
+
pairWithWC: (params: {
|
|
148
|
+
uri: string;
|
|
149
|
+
}) => Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Approve or reject a pending session proposal.
|
|
152
|
+
* Called after the native app shows the pairing confirmation UI to the user.
|
|
153
|
+
* @param params.confirm - `true` to approve, `false` to reject
|
|
154
|
+
*/
|
|
155
|
+
confirmPairing: (params: {
|
|
156
|
+
confirm: boolean;
|
|
157
|
+
}) => Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Disconnect a specific WC session, removing it from active sessions
|
|
160
|
+
* and notifying the connected dApp.
|
|
161
|
+
* @param params.topic - The session topic to disconnect
|
|
162
|
+
*/
|
|
163
|
+
disconnectWCSession: (params: {
|
|
164
|
+
topic: string;
|
|
165
|
+
}) => Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* Retrieve all currently active WC sessions.
|
|
168
|
+
* Used by the native app to display a list of connected dApps.
|
|
169
|
+
*/
|
|
170
|
+
getConnectedWCSessions: () => Promise<{
|
|
171
|
+
sessions: Record<string, WCSession>;
|
|
172
|
+
}>;
|
|
173
|
+
/**
|
|
174
|
+
* Retrieve the pending session proposal, if one exists.
|
|
175
|
+
* Used to restore UI state if the native confirmation screen needs
|
|
176
|
+
* to be re-rendered (e.g. after a navigation event).
|
|
177
|
+
*/
|
|
178
|
+
getPendingPairing: () => Promise<{
|
|
179
|
+
proposal: WCSessionProposal | null;
|
|
180
|
+
}>;
|
|
181
|
+
/**
|
|
182
|
+
* Respond to a session request from a connected dApp.
|
|
183
|
+
* Used in the mobile flow where the native app shows its own confirmation UI
|
|
184
|
+
* for signing/transaction requests instead of the webview handling it directly.
|
|
185
|
+
* @param params.id - The request ID to respond to
|
|
186
|
+
* @param params.topic - The session topic the request belongs to
|
|
187
|
+
* @param params.approved - `true` to proceed with signing, `false` to reject
|
|
188
|
+
*/
|
|
189
|
+
respondSessionRequest: (params: {
|
|
190
|
+
id: number;
|
|
191
|
+
topic: string;
|
|
192
|
+
approved: boolean;
|
|
193
|
+
}) => Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* Event emitted by the webview when a dApp proposes a new session.
|
|
196
|
+
* The native app should display a pairing confirmation UI and
|
|
197
|
+
* call `confirmPairing` with the user's decision.
|
|
198
|
+
*/
|
|
199
|
+
onSessionProposal: (proposal: WCSessionProposal) => void;
|
|
200
|
+
/**
|
|
201
|
+
* Event emitted by the webview when a connected dApp sends a
|
|
202
|
+
* signing or transaction request. The native app should display
|
|
203
|
+
* a confirmation UI and call `respondSessionRequest` with the result.
|
|
204
|
+
*/
|
|
205
|
+
onSessionRequest: (request: WCSessionRequest) => void;
|
|
206
|
+
/**
|
|
207
|
+
* Event emitted by the webview when a session is deleted
|
|
208
|
+
* (either by the dApp or due to expiry). The native app should
|
|
209
|
+
* update its UI to reflect the disconnection.
|
|
210
|
+
*/
|
|
211
|
+
onSessionDelete: (params: {
|
|
212
|
+
topic: string;
|
|
213
|
+
}) => void;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* List of event message names in {@link GlobalWalletModuleMessages}.
|
|
217
|
+
*
|
|
218
|
+
* Used to distinguish events (webview -> native notifications) from
|
|
219
|
+
* request/response messages (native -> webview calls). This allows
|
|
220
|
+
* the message transport layer to route events to event listeners
|
|
221
|
+
* rather than treating them as request-response calls.
|
|
222
|
+
*/
|
|
223
|
+
export declare const globalWalletEventNames: ("onSessionProposal" | "onSessionRequest" | "onSessionDelete")[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/**
|
|
3
|
+
* List of event message names in {@link GlobalWalletModuleMessages}.
|
|
4
|
+
*
|
|
5
|
+
* Used to distinguish events (webview -> native notifications) from
|
|
6
|
+
* request/response messages (native -> webview calls). This allows
|
|
7
|
+
* the message transport layer to route events to event listeners
|
|
8
|
+
* rather than treating them as request-response calls.
|
|
9
|
+
*/
|
|
10
|
+
const globalWalletEventNames = [
|
|
11
|
+
'onSessionProposal',
|
|
12
|
+
'onSessionRequest',
|
|
13
|
+
'onSessionDelete',
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export { globalWalletEventNames };
|
|
@@ -34,6 +34,15 @@ export type ClientManifest = {
|
|
|
34
34
|
* you want to allow wallet connections without full authentication.
|
|
35
35
|
*/
|
|
36
36
|
connectOnly?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Controls the device registration modal behavior.
|
|
39
|
+
* When set to { enabled: false }, the SDK will not automatically show the
|
|
40
|
+
* device registration modal.
|
|
41
|
+
* @default { enabled: true }
|
|
42
|
+
*/
|
|
43
|
+
deviceRegistrationModal?: {
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
};
|
|
37
46
|
/**
|
|
38
47
|
* If true, use MetaMask SDK for MetaMask connections.
|
|
39
48
|
* If false or undefined, use WalletConnect for MetaMask connections.
|
|
@@ -41,6 +50,12 @@ export type ClientManifest = {
|
|
|
41
50
|
* @default false
|
|
42
51
|
*/
|
|
43
52
|
useMetamaskSdk?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* WalletConnect project ID for global wallet provider mode.
|
|
55
|
+
* When provided, enables the embedded wallet to act as a WalletConnect
|
|
56
|
+
* wallet provider, allowing external dApps to connect and send signing requests.
|
|
57
|
+
*/
|
|
58
|
+
walletConnectDappProjectId?: string;
|
|
44
59
|
};
|
|
45
60
|
export type SdkModuleState = {
|
|
46
61
|
/** Indicates the SDK is set up and ready for requests */
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { OTPVerification } from '@dynamic-labs-sdk/client';
|
|
2
|
+
import type { ProviderEnum, TokenScope, VerifyResponse } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
export type StepUpAuthState = {
|
|
4
|
+
error: string | null;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
otpVerification: OTPVerification | null;
|
|
7
|
+
};
|
|
8
|
+
export type StepUpAuthMessages = {
|
|
9
|
+
stepUpAuth_isStepUpRequired: (params: {
|
|
10
|
+
scope: TokenScope;
|
|
11
|
+
}) => Promise<boolean>;
|
|
12
|
+
stepUpAuth_promptStepUpAuth: (params?: {
|
|
13
|
+
createMfaToken?: boolean;
|
|
14
|
+
requestedScopes?: TokenScope[];
|
|
15
|
+
}) => Promise<string | null>;
|
|
16
|
+
stepUpAuth_promptMfa: (params?: {
|
|
17
|
+
createMfaToken?: boolean;
|
|
18
|
+
requestedScopes?: TokenScope[];
|
|
19
|
+
}) => Promise<string | null>;
|
|
20
|
+
stepUpAuth_promptReauthenticate: (params?: {
|
|
21
|
+
createMfaToken?: boolean;
|
|
22
|
+
requestedScopes?: TokenScope[];
|
|
23
|
+
}) => Promise<string | null>;
|
|
24
|
+
stepUpAuth_sendOtp: () => Promise<OTPVerification | null>;
|
|
25
|
+
stepUpAuth_verifyOtp: (params: {
|
|
26
|
+
requestedScopes?: TokenScope[];
|
|
27
|
+
verificationToken: string;
|
|
28
|
+
}) => Promise<VerifyResponse | null>;
|
|
29
|
+
stepUpAuth_verifyWallet: (params: {
|
|
30
|
+
requestedScopes?: TokenScope[];
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
stepUpAuth_verifyPasskeyMfa: (params: {
|
|
33
|
+
requestedScopes?: TokenScope[];
|
|
34
|
+
}) => Promise<VerifyResponse | null>;
|
|
35
|
+
stepUpAuth_verifyTotpMfa: (params: {
|
|
36
|
+
code: string;
|
|
37
|
+
deviceId?: string;
|
|
38
|
+
requestedScopes?: TokenScope[];
|
|
39
|
+
}) => Promise<VerifyResponse | null>;
|
|
40
|
+
stepUpAuth_verifyRecoveryCode: (params: {
|
|
41
|
+
code: string;
|
|
42
|
+
requestedScopes?: TokenScope[];
|
|
43
|
+
}) => Promise<VerifyResponse | null>;
|
|
44
|
+
stepUpAuth_verifySocial: (params: {
|
|
45
|
+
provider: ProviderEnum;
|
|
46
|
+
requestedScopes?: TokenScope[];
|
|
47
|
+
}) => Promise<void>;
|
|
48
|
+
stepUpAuth_resetState: () => Promise<void>;
|
|
49
|
+
};
|
package/src/lib/StoreKeys.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type StoreKeys = 'auth' | 'sdk' | 'wallets' | 'embeddedWallets' | 'platform' | 'userInterface' | 'otp' | 'networks' | 'delegatedAccess' | 'deviceRegistration';
|
|
1
|
+
export type StoreKeys = 'auth' | 'sdk' | 'wallets' | 'embeddedWallets' | 'platform' | 'userInterface' | 'otp' | 'networks' | 'delegatedAccess' | 'deviceRegistration' | 'stepUpAuth' | 'globalWallet';
|