@dynamic-labs-sdk/wallet-connect 0.1.0-alpha.17 → 0.1.0-alpha.18

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -2
  3. package/core.cjs.js +60 -0
  4. package/core.esm.js +58 -0
  5. package/index.cjs.js +17 -0
  6. package/index.esm.js +17 -0
  7. package/package.cjs.js +1 -1
  8. package/package.esm.js +1 -1
  9. package/package.json +8 -3
  10. package/src/exports/core.d.ts +5 -1
  11. package/src/exports/core.d.ts.map +1 -1
  12. package/src/exports/index.d.ts +2 -1
  13. package/src/exports/index.d.ts.map +1 -1
  14. package/src/isWalletConnectWalletProvider/index.d.ts +2 -0
  15. package/src/isWalletConnectWalletProvider/index.d.ts.map +1 -0
  16. package/src/isWalletConnectWalletProvider/isWalletConnectWalletProvider.d.ts +4 -0
  17. package/src/isWalletConnectWalletProvider/isWalletConnectWalletProvider.d.ts.map +1 -0
  18. package/src/namespaceRegistry/getNamespaceRegistry/createNamespaceRegistry/createNamespaceRegistry.d.ts +3 -0
  19. package/src/namespaceRegistry/getNamespaceRegistry/createNamespaceRegistry/createNamespaceRegistry.d.ts.map +1 -0
  20. package/src/namespaceRegistry/getNamespaceRegistry/createNamespaceRegistry/index.d.ts +2 -0
  21. package/src/namespaceRegistry/getNamespaceRegistry/createNamespaceRegistry/index.d.ts.map +1 -0
  22. package/src/namespaceRegistry/getNamespaceRegistry/getNamespaceRegistry.d.ts +2 -0
  23. package/src/namespaceRegistry/getNamespaceRegistry/getNamespaceRegistry.d.ts.map +1 -0
  24. package/src/namespaceRegistry/getNamespaceRegistry/index.d.ts +2 -0
  25. package/src/namespaceRegistry/getNamespaceRegistry/index.d.ts.map +1 -0
  26. package/src/namespaceRegistry/index.d.ts +3 -0
  27. package/src/namespaceRegistry/index.d.ts.map +1 -0
  28. package/src/namespaceRegistry/namespaceRegistry.types.d.ts +77 -0
  29. package/src/namespaceRegistry/namespaceRegistry.types.d.ts.map +1 -0
  30. package/src/sessionTopicsData/clearExternalSessions/clearExternalSessions.d.ts +13 -0
  31. package/src/sessionTopicsData/clearExternalSessions/clearExternalSessions.d.ts.map +1 -0
  32. package/src/sessionTopicsData/clearExternalSessions/index.d.ts +2 -0
  33. package/src/sessionTopicsData/clearExternalSessions/index.d.ts.map +1 -0
  34. package/src/sessionTopicsData/getSessionTopicsData/getSessionTopicsData.d.ts +9 -0
  35. package/src/sessionTopicsData/getSessionTopicsData/getSessionTopicsData.d.ts.map +1 -0
  36. package/src/sessionTopicsData/getSessionTopicsData/index.d.ts +2 -0
  37. package/src/sessionTopicsData/getSessionTopicsData/index.d.ts.map +1 -0
  38. package/src/sessionTopicsData/schema.d.ts +2 -0
  39. package/src/sessionTopicsData/schema.d.ts.map +1 -0
  40. package/src/sessionTopicsData/sessionTopicsData.types.d.ts +14 -0
  41. package/src/sessionTopicsData/sessionTopicsData.types.d.ts.map +1 -0
  42. package/src/sessionTopicsData/setSessionTopicsData/index.d.ts +2 -0
  43. package/src/sessionTopicsData/setSessionTopicsData/index.d.ts.map +1 -0
  44. package/src/sessionTopicsData/setSessionTopicsData/setSessionTopicsData.d.ts +16 -0
  45. package/src/sessionTopicsData/setSessionTopicsData/setSessionTopicsData.d.ts.map +1 -0
  46. package/src/signClient/consts.d.ts +10 -0
  47. package/src/signClient/consts.d.ts.map +1 -0
  48. package/src/signClient/getSignClient/createSignClient/createSignClient.d.ts +4 -0
  49. package/src/signClient/getSignClient/createSignClient/createSignClient.d.ts.map +1 -0
  50. package/src/signClient/getSignClient/createSignClient/index.d.ts +2 -0
  51. package/src/signClient/getSignClient/createSignClient/index.d.ts.map +1 -0
  52. package/src/signClient/getSignClient/getSignClient.d.ts +2 -0
  53. package/src/signClient/getSignClient/getSignClient.d.ts.map +1 -0
  54. package/src/signClient/getSignClient/index.d.ts +2 -0
  55. package/src/signClient/getSignClient/index.d.ts.map +1 -0
  56. package/src/walletConnectWalletProvider.types.d.ts +29 -0
  57. package/src/walletConnectWalletProvider.types.d.ts.map +1 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.0-alpha.18 (2025-10-08)
2
+
3
+ ### 🚀 Features
4
+
5
+ - Add TypeDoc for JavaScript SDK API Reference Documentation ([#512](https://github.com/dynamic-labs/dynamic-sdk/pull/512))
6
+
1
7
  ## 0.1.0-alpha.17 (2025-10-02)
2
8
 
3
9
  ### 🩹 Fixes
package/README.md CHANGED
@@ -5,8 +5,8 @@ This package contains the WalletConnect integration for the Dynamic SDK.
5
5
  ## Usage
6
6
 
7
7
  ```ts
8
- import { addWalletConnectEvmExtension } from '@dynamic-labs-sdk/wallet-connect/evm';
9
- import { addWalletConnectSolanaExtension } from '@dynamic-labs-sdk/wallet-connect/solana';
8
+ import { addWalletConnectEvmExtension } from '@dynamic-labs-sdk/evm/wallet-connect';
9
+ import { addWalletConnectSolanaExtension } from '@dynamic-labs-sdk/solana/wallet-connect';
10
10
  import { createDynamicClient } from '@dynamic-labs-sdk/client';
11
11
 
12
12
  const dynamicClient = createDynamicClient({
package/core.cjs.js CHANGED
@@ -2,5 +2,65 @@
2
2
 
3
3
  var assertPackageVersion = require('@dynamic-labs-sdk/assert-package-version');
4
4
  var _package = require('./package.cjs.js');
5
+ var core = require('@dynamic-labs-sdk/client/core');
6
+ var SignClient = require('@walletconnect/sign-client');
7
+
8
+ const createNamespaceRegistry = ()=>{
9
+ const namespaceConfigurationMap = new Map();
10
+ const walletProviderBuilderMap = new Map();
11
+ return {
12
+ getAllNamespaceConfigurations: ()=>Object.fromEntries(namespaceConfigurationMap.entries()),
13
+ getNamespaceConfiguration: (key)=>namespaceConfigurationMap.get(key),
14
+ getWalletProviderBuilder: (key)=>walletProviderBuilderMap.get(key),
15
+ registerNamespace: ({ createWalletProviderFromSession, namespaceConfiguration, namespaceKey })=>{
16
+ namespaceConfigurationMap.set(namespaceKey, namespaceConfiguration);
17
+ walletProviderBuilderMap.set(namespaceKey, createWalletProviderFromSession);
18
+ }
19
+ };
20
+ };
21
+
22
+ const getNamespaceRegistry = core.createRuntimeServiceAccessKey('walletConnectNamespaceRegistry', createNamespaceRegistry);
23
+
24
+ /**
25
+ * Reason for disconnection when the user disconnects from a WalletConnect session.
26
+ *
27
+ * Source: https://github.com/WalletConnect/walletconnect-monorepo/blob/cc3a9d26dcbd05c92d5ded935b29dc3b6063d147/packages/utils/src/errors.ts#L87
28
+ */ const USER_DISCONNECTED_REASON = {
29
+ code: 6000,
30
+ message: 'User disconnected.'
31
+ };
32
+
33
+ const createSignClient = async (client)=>{
34
+ var _client_projectSettings_sdk_walletConnect, _core_metadata, _core_metadata1;
35
+ const core$1 = core.getCore(client);
36
+ core.assertDefined(client.projectSettings, 'Project settings not available');
37
+ const generalSettings = client.projectSettings.general;
38
+ core.assertDefined(generalSettings.displayName, 'Please configure an app name in dashboard to use WalletConnect');
39
+ const projectId = (_client_projectSettings_sdk_walletConnect = client.projectSettings.sdk.walletConnect) == null ? void 0 : _client_projectSettings_sdk_walletConnect.projectId;
40
+ core.assertDefined(projectId, 'Please configure a project ID for WalletConnect in dashboard');
41
+ const customStoragePrefix = `dynamic_${core$1.environmentId}_walletconnect`;
42
+ var _core_metadata_name;
43
+ const displayName = (_core_metadata_name = (_core_metadata = core$1.metadata) == null ? void 0 : _core_metadata.name) != null ? _core_metadata_name : generalSettings.displayName;
44
+ var _core_metadata_iconUrl;
45
+ const appLogo = (_core_metadata_iconUrl = (_core_metadata1 = core$1.metadata) == null ? void 0 : _core_metadata1.iconUrl) != null ? _core_metadata_iconUrl : generalSettings.appLogo;
46
+ return SignClient.init({
47
+ customStoragePrefix,
48
+ metadata: {
49
+ description: '',
50
+ icons: appLogo ? [
51
+ appLogo
52
+ ] : [],
53
+ name: displayName,
54
+ url: ''
55
+ },
56
+ projectId
57
+ });
58
+ };
59
+
60
+ const getSignClient = core.createRuntimeServiceAccessKey('walletConnectSignClient', (client)=>createSignClient(client));
5
61
 
6
62
  assertPackageVersion.assertPackageVersion(_package.name, _package.version);
63
+
64
+ exports.USER_DISCONNECTED_REASON = USER_DISCONNECTED_REASON;
65
+ exports.getNamespaceRegistry = getNamespaceRegistry;
66
+ exports.getSignClient = getSignClient;
package/core.esm.js CHANGED
@@ -1,4 +1,62 @@
1
1
  import { assertPackageVersion } from '@dynamic-labs-sdk/assert-package-version';
2
2
  import { n as name, v as version } from './package.esm.js';
3
+ import { createRuntimeServiceAccessKey, getCore, assertDefined } from '@dynamic-labs-sdk/client/core';
4
+ import SignClient from '@walletconnect/sign-client';
5
+
6
+ const createNamespaceRegistry = ()=>{
7
+ const namespaceConfigurationMap = new Map();
8
+ const walletProviderBuilderMap = new Map();
9
+ return {
10
+ getAllNamespaceConfigurations: ()=>Object.fromEntries(namespaceConfigurationMap.entries()),
11
+ getNamespaceConfiguration: (key)=>namespaceConfigurationMap.get(key),
12
+ getWalletProviderBuilder: (key)=>walletProviderBuilderMap.get(key),
13
+ registerNamespace: ({ createWalletProviderFromSession, namespaceConfiguration, namespaceKey })=>{
14
+ namespaceConfigurationMap.set(namespaceKey, namespaceConfiguration);
15
+ walletProviderBuilderMap.set(namespaceKey, createWalletProviderFromSession);
16
+ }
17
+ };
18
+ };
19
+
20
+ const getNamespaceRegistry = createRuntimeServiceAccessKey('walletConnectNamespaceRegistry', createNamespaceRegistry);
21
+
22
+ /**
23
+ * Reason for disconnection when the user disconnects from a WalletConnect session.
24
+ *
25
+ * Source: https://github.com/WalletConnect/walletconnect-monorepo/blob/cc3a9d26dcbd05c92d5ded935b29dc3b6063d147/packages/utils/src/errors.ts#L87
26
+ */ const USER_DISCONNECTED_REASON = {
27
+ code: 6000,
28
+ message: 'User disconnected.'
29
+ };
30
+
31
+ const createSignClient = async (client)=>{
32
+ var _client_projectSettings_sdk_walletConnect, _core_metadata, _core_metadata1;
33
+ const core = getCore(client);
34
+ assertDefined(client.projectSettings, 'Project settings not available');
35
+ const generalSettings = client.projectSettings.general;
36
+ assertDefined(generalSettings.displayName, 'Please configure an app name in dashboard to use WalletConnect');
37
+ const projectId = (_client_projectSettings_sdk_walletConnect = client.projectSettings.sdk.walletConnect) == null ? void 0 : _client_projectSettings_sdk_walletConnect.projectId;
38
+ assertDefined(projectId, 'Please configure a project ID for WalletConnect in dashboard');
39
+ const customStoragePrefix = `dynamic_${core.environmentId}_walletconnect`;
40
+ var _core_metadata_name;
41
+ const displayName = (_core_metadata_name = (_core_metadata = core.metadata) == null ? void 0 : _core_metadata.name) != null ? _core_metadata_name : generalSettings.displayName;
42
+ var _core_metadata_iconUrl;
43
+ const appLogo = (_core_metadata_iconUrl = (_core_metadata1 = core.metadata) == null ? void 0 : _core_metadata1.iconUrl) != null ? _core_metadata_iconUrl : generalSettings.appLogo;
44
+ return SignClient.init({
45
+ customStoragePrefix,
46
+ metadata: {
47
+ description: '',
48
+ icons: appLogo ? [
49
+ appLogo
50
+ ] : [],
51
+ name: displayName,
52
+ url: ''
53
+ },
54
+ projectId
55
+ });
56
+ };
57
+
58
+ const getSignClient = createRuntimeServiceAccessKey('walletConnectSignClient', (client)=>createSignClient(client));
3
59
 
4
60
  assertPackageVersion(name, version);
61
+
62
+ export { USER_DISCONNECTED_REASON, getNamespaceRegistry, getSignClient };
package/index.cjs.js CHANGED
@@ -3,4 +3,21 @@
3
3
  var assertPackageVersion = require('@dynamic-labs-sdk/assert-package-version');
4
4
  var _package = require('./package.cjs.js');
5
5
 
6
+ /**
7
+ * This is a way to ensure Typescript will guard that all keys defined in
8
+ * WalletConnectWalletProvider are accounted for in this function.
9
+ *
10
+ * It will complain if any key is missing or if there are any extra keys.
11
+ */ const wcExclusiveKeysRecord = {
12
+ namespaceKey: null,
13
+ session: null,
14
+ topic: null
15
+ };
16
+ const wcExclusiveKeys = Object.keys(wcExclusiveKeysRecord);
17
+ const isWalletConnectWalletProvider = (walletProvider)=>{
18
+ return wcExclusiveKeys.every((key)=>key in walletProvider);
19
+ };
20
+
6
21
  assertPackageVersion.assertPackageVersion(_package.name, _package.version);
22
+
23
+ exports.isWalletConnectWalletProvider = isWalletConnectWalletProvider;
package/index.esm.js CHANGED
@@ -1,4 +1,21 @@
1
1
  import { assertPackageVersion } from '@dynamic-labs-sdk/assert-package-version';
2
2
  import { n as name, v as version } from './package.esm.js';
3
3
 
4
+ /**
5
+ * This is a way to ensure Typescript will guard that all keys defined in
6
+ * WalletConnectWalletProvider are accounted for in this function.
7
+ *
8
+ * It will complain if any key is missing or if there are any extra keys.
9
+ */ const wcExclusiveKeysRecord = {
10
+ namespaceKey: null,
11
+ session: null,
12
+ topic: null
13
+ };
14
+ const wcExclusiveKeys = Object.keys(wcExclusiveKeysRecord);
15
+ const isWalletConnectWalletProvider = (walletProvider)=>{
16
+ return wcExclusiveKeys.every((key)=>key in walletProvider);
17
+ };
18
+
4
19
  assertPackageVersion(name, version);
20
+
21
+ export { isWalletConnectWalletProvider };
package/package.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var name = "@dynamic-labs-sdk/wallet-connect";
4
- var version = "0.1.0-alpha.17";
4
+ var version = "0.1.0-alpha.18";
5
5
 
6
6
  exports.name = name;
7
7
  exports.version = version;
package/package.esm.js CHANGED
@@ -1,4 +1,4 @@
1
1
  var name = "@dynamic-labs-sdk/wallet-connect";
2
- var version = "0.1.0-alpha.17";
2
+ var version = "0.1.0-alpha.18";
3
3
 
4
4
  export { name as n, version as v };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs-sdk/wallet-connect",
3
- "version": "0.1.0-alpha.17",
3
+ "version": "0.1.0-alpha.18",
4
4
  "type": "module",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
@@ -19,10 +19,15 @@
19
19
  }
20
20
  },
21
21
  "dependencies": {
22
- "@dynamic-labs-sdk/assert-package-version": "0.1.0-alpha.17"
22
+ "@dynamic-labs-sdk/assert-package-version": "0.1.0-alpha.18",
23
+ "@dynamic-labs-sdk/client": "0.1.0-alpha.18",
24
+ "@walletconnect/sign-client": "2.21.8",
25
+ "@walletconnect/types": "2.21.8",
26
+ "zod": "4.0.5"
23
27
  },
24
28
  "devDependencies": {
25
29
  "eventemitter3": "5.0.1",
26
- "@walletconnect/types": "2.21.8"
30
+ "@walletconnect/types": "2.21.8",
31
+ "@dynamic-labs/sdk-api-core": "0.0.801"
27
32
  }
28
33
  }
@@ -1,2 +1,6 @@
1
- export {};
1
+ export { getNamespaceRegistry } from '../namespaceRegistry/getNamespaceRegistry';
2
+ export type { NamespaceRegistry } from '../namespaceRegistry/namespaceRegistry.types';
3
+ export { USER_DISCONNECTED_REASON } from '../signClient/consts';
4
+ export { getSignClient } from '../signClient/getSignClient';
5
+ export type { WalletProviderBuilder } from '../walletConnectWalletProvider.types';
2
6
  //# sourceMappingURL=core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/exports/core.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/exports/core.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,YAAY,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,YAAY,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC"}
@@ -1,2 +1,3 @@
1
- export {};
1
+ export { isWalletConnectWalletProvider } from '../isWalletConnectWalletProvider';
2
+ export type { WalletConnectWalletProvider } from '../walletConnectWalletProvider.types';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/exports/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/exports/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,YAAY,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { isWalletConnectWalletProvider } from './isWalletConnectWalletProvider';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/isWalletConnectWalletProvider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { WalletProvider } from '@dynamic-labs-sdk/client/core';
2
+ import type { WalletConnectWalletProvider } from '../walletConnectWalletProvider.types';
3
+ export declare const isWalletConnectWalletProvider: (walletProvider: WalletProvider) => walletProvider is WalletConnectWalletProvider;
4
+ //# sourceMappingURL=isWalletConnectWalletProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isWalletConnectWalletProvider.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/isWalletConnectWalletProvider/isWalletConnectWalletProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAmBxF,eAAO,MAAM,6BAA6B,mBACxB,cAAc,KAC7B,cAAc,IAAI,2BAEpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { NamespaceRegistry } from '../../namespaceRegistry.types';
2
+ export declare const createNamespaceRegistry: () => NamespaceRegistry;
3
+ //# sourceMappingURL=createNamespaceRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createNamespaceRegistry.d.ts","sourceRoot":"","sources":["../../../../../../../packages/wallet-connect/src/namespaceRegistry/getNamespaceRegistry/createNamespaceRegistry/createNamespaceRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,eAAO,MAAM,uBAAuB,QAAO,iBA6B1C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createNamespaceRegistry } from './createNamespaceRegistry';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/wallet-connect/src/namespaceRegistry/getNamespaceRegistry/createNamespaceRegistry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const getNamespaceRegistry: any;
2
+ //# sourceMappingURL=getNamespaceRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNamespaceRegistry.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/namespaceRegistry/getNamespaceRegistry/getNamespaceRegistry.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,KAGhC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getNamespaceRegistry } from './getNamespaceRegistry';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/namespaceRegistry/getNamespaceRegistry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { getNamespaceRegistry } from './getNamespaceRegistry';
2
+ export type { NamespaceRegistry } from './namespaceRegistry.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/namespaceRegistry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,77 @@
1
+ import type { ProposalTypes } from '@walletconnect/types';
2
+ import type { WalletProviderBuilder } from '../walletConnectWalletProvider.types';
3
+ /**
4
+ * A registry of all supported WalletConnect namespaces and their corresponding wallet provider builders.
5
+ *
6
+ * #### Namespace configurations
7
+ *
8
+ * The namespace configurations are used at the time a wallet application receives the connection URI.
9
+ * It will use the configurations we supply to understand which methods, events and networks it should provide.
10
+ *
11
+ * The wallet application will then accept the connection request and provide its own namespace configuration
12
+ * in return, which will contain the methods, events and networks it does in fact support, as well as
13
+ * which accounts are available.
14
+ *
15
+ * WalletConnect expects namespaces defined in the following format:
16
+ * ```typescript
17
+ * {
18
+ * <namespaceKey>: {
19
+ * "accounts": ["<account1>", "<account2>", "<account3>", ...],
20
+ * "events": ["accountsChanged", "chainChanged", "disconnected"],
21
+ * "methods": ["personal_sign", "eth_sendTransaction", "eth_accounts", ...],
22
+ * "chains": ["<chain1>", "<chain2>", "<chain3>", ...]
23
+ * },
24
+ * ...
25
+ * }
26
+ * ```
27
+ *
28
+ * Where each account is a CAIP-10 formatted string, for example: "eip155:1:0x1234567890"
29
+ * — see docs: https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-10.md
30
+ *
31
+ * Where each chain is a CAIP-2 formatted string, for example: "eip155:1"
32
+ * — see docs: https://chainagnostic.org/CAIPs/caip-2
33
+ *
34
+ * #### Wallet provider builders
35
+ *
36
+ * When a connection is established, WalletConnect supplies a session object, which contains the namespaces
37
+ * that are supported by the connected wallet application (ex: eip155, solana, etc.). For each namespace in the session
38
+ * we can build a wallet provider.
39
+ *
40
+ * Our chain packages define how to build a wallet provider for their corresponding namespace, which can then be used
41
+ * to create one wallet account for each unique address found in the "accounts" variable that is present in the session's namespace.
42
+ */
43
+ export type NamespaceRegistry = {
44
+ /**
45
+ * Retrieves all namespace configurations.
46
+ * @returns A record of namespace key to namespace configuration.
47
+ */
48
+ getAllNamespaceConfigurations: () => Record<string, Required<ProposalTypes.BaseRequiredNamespace>>;
49
+ /**
50
+ * Retrieves a namespace configuration by its key.
51
+ * @param namespaceKey - The key of the namespace.
52
+ * @returns The namespace configuration.
53
+ */
54
+ getNamespaceConfiguration: (namespaceKey: string) => Required<ProposalTypes.BaseRequiredNamespace> | undefined;
55
+ /**
56
+ * Retrieves a wallet provider builder by its corresponding namespace key.
57
+ * @param namespaceKey - The key of the namespace.
58
+ * @returns The wallet provider builder.
59
+ */
60
+ getWalletProviderBuilder: (namespaceKey: string) => WalletProviderBuilder | undefined;
61
+ /**
62
+ * Registers a namespace that will be supported for WalletConnect connections.
63
+ *
64
+ * What we refer to as "chains" in the SDK corresponds to "namespaces" in WalletConnect.
65
+ * For example, if we want to support EVM chains, we would register the "eip155" namespace.
66
+ *
67
+ * @param namespace - The namespace to register.
68
+ * @param createWalletProviderFromSession - A function that creates a wallet provider for a given WC session.
69
+ * @returns A promise that resolves when the namespace is registered.
70
+ */
71
+ registerNamespace: (args: {
72
+ createWalletProviderFromSession: WalletProviderBuilder;
73
+ namespaceConfiguration: Required<ProposalTypes.BaseRequiredNamespace>;
74
+ namespaceKey: string;
75
+ }) => void;
76
+ };
77
+ //# sourceMappingURL=namespaceRegistry.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespaceRegistry.types.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/namespaceRegistry/namespaceRegistry.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,6BAA6B,EAAE,MAAM,MAAM,CACzC,MAAM,EACN,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAC9C,CAAC;IAEF;;;;OAIG;IACH,yBAAyB,EAAE,CACzB,YAAY,EAAE,MAAM,KACjB,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAAC;IAE/D;;;;OAIG;IACH,wBAAwB,EAAE,CACxB,YAAY,EAAE,MAAM,KACjB,qBAAqB,GAAG,SAAS,CAAC;IAEvC;;;;;;;;;OASG;IACH,iBAAiB,EAAE,CAAC,IAAI,EAAE;QACxB,+BAA+B,EAAE,qBAAqB,CAAC;QAEvD,sBAAsB,EAAE,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;QAEtE,YAAY,EAAE,MAAM,CAAC;KACtB,KAAK,IAAI,CAAC;CACZ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { DynamicClient } from '@dynamic-labs-sdk/client';
2
+ /**
3
+ * Clears all external sessions and disconnects from them.
4
+ *
5
+ * External sessions are for WC sessions whose accounts are not supposed to be saved in
6
+ * the current dynamic's wallet accounts.
7
+ * Since we don't own the created wallet accounts, we must keep their corresponding WC sessions alive
8
+ * until the page is refreshed or the customer removes the wallet account.
9
+ *
10
+ * @param client - The client instance.
11
+ */
12
+ export declare const clearExternalSessions: (client: DynamicClient) => Promise<void>;
13
+ //# sourceMappingURL=clearExternalSessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clearExternalSessions.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/sessionTopicsData/clearExternalSessions/clearExternalSessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAO9D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,WAAkB,aAAa,kBAwBhE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { clearExternalSessions } from './clearExternalSessions';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/sessionTopicsData/clearExternalSessions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DynamicClient } from '@dynamic-labs-sdk/client';
2
+ /**
3
+ * Gets the session topics data.
4
+ *
5
+ * Read more about it in the sessionTopicsData.types.ts file.
6
+ * @param client - The client instance.
7
+ */
8
+ export declare const getSessionTopicsData: (client: DynamicClient) => Promise<any>;
9
+ //# sourceMappingURL=getSessionTopicsData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSessionTopicsData.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/sessionTopicsData/getSessionTopicsData/getSessionTopicsData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,WAAkB,aAAa,iBAQ/D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getSessionTopicsData } from './getSessionTopicsData';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/sessionTopicsData/getSessionTopicsData/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const sessionTopicsStorageKeySchema: any;
2
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/sessionTopicsData/schema.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,6BAA6B,KAqBxC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type * as z from 'zod/mini';
2
+ import type { sessionTopicsStorageKeySchema } from './schema';
3
+ /**
4
+ * Holds data on all connected sessions by mapping the session topic to the session data.
5
+ *
6
+ * Session topics data is used to track when the session topics were created and whether they are marked as externally owned.
7
+ *
8
+ * External sessions are not supposed to be saved to the dynamic's wallet accounts,
9
+ s * and we cannot clear them until the page is refreshed or the wallet account is removed
10
+ * by the external owner by calling removeWalletAccount.
11
+ * They are particularly useful for "one-time connections", such as when performing external wallet funding.
12
+ */
13
+ export type SessionTopicsData = z.infer<typeof sessionTopicsStorageKeySchema.schema>;
14
+ //# sourceMappingURL=sessionTopicsData.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionTopicsData.types.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/sessionTopicsData/sessionTopicsData.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAE9D;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CACrC,OAAO,6BAA6B,CAAC,MAAM,CAC5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { setSessionTopicsData } from './setSessionTopicsData';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/sessionTopicsData/setSessionTopicsData/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { DynamicClient } from '@dynamic-labs-sdk/client';
2
+ import type { SessionTopicsData } from '../sessionTopicsData.types';
3
+ type SetSessionTopicsDataParams = {
4
+ update: (topics: SessionTopicsData) => SessionTopicsData;
5
+ };
6
+ /**
7
+ * Sets the session topics data.
8
+ *
9
+ * Read more about it in the sessionTopicsData.types.ts file.
10
+ *
11
+ * @param update - The function to update the session topics data.
12
+ * @param client - The client instance.
13
+ */
14
+ export declare const setSessionTopicsData: ({ update }: SetSessionTopicsDataParams, client: DynamicClient) => Promise<any>;
15
+ export {};
16
+ //# sourceMappingURL=setSessionTopicsData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setSessionTopicsData.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/sessionTopicsData/setSessionTopicsData/setSessionTopicsData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,iBAAiB,CAAC;CAC1D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,eACnB,0BAA0B,UAC9B,aAAa,iBAetB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Reason for disconnection when the user disconnects from a WalletConnect session.
3
+ *
4
+ * Source: https://github.com/WalletConnect/walletconnect-monorepo/blob/cc3a9d26dcbd05c92d5ded935b29dc3b6063d147/packages/utils/src/errors.ts#L87
5
+ */
6
+ export declare const USER_DISCONNECTED_REASON: {
7
+ readonly code: 6000;
8
+ readonly message: "User disconnected.";
9
+ };
10
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../../../packages/wallet-connect/src/signClient/consts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DynamicClient } from '@dynamic-labs-sdk/client';
2
+ import SignClient from '@walletconnect/sign-client';
3
+ export declare const createSignClient: (client: DynamicClient) => Promise<SignClient>;
4
+ //# sourceMappingURL=createSignClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSignClient.d.ts","sourceRoot":"","sources":["../../../../../../../packages/wallet-connect/src/signClient/getSignClient/createSignClient/createSignClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAEpD,eAAO,MAAM,gBAAgB,WAAkB,aAAa,wBAmC3D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createSignClient } from './createSignClient';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/wallet-connect/src/signClient/getSignClient/createSignClient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const getSignClient: any;
2
+ //# sourceMappingURL=getSignClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSignClient.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/signClient/getSignClient/getSignClient.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,KAGzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getSignClient } from './getSignClient';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/wallet-connect/src/signClient/getSignClient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { DynamicClient } from '@dynamic-labs-sdk/client';
2
+ import type { WalletProvider } from '@dynamic-labs-sdk/client/core';
3
+ import type { SessionTypes } from '@walletconnect/types';
4
+ export type WalletConnectWalletProvider = WalletProvider & {
5
+ /**
6
+ * The key of the WC namespace that corresponds to this wallet provider's chain.
7
+ */
8
+ namespaceKey: string;
9
+ /**
10
+ * The WC session that originated this wallet provider.
11
+ * Note that the session might have originated multiple wallet providers — one for each namespace.
12
+ */
13
+ session: SessionTypes.Struct;
14
+ /**
15
+ * The topic of the WC session that originated this wallet provider.
16
+ */
17
+ topic: string;
18
+ };
19
+ /**
20
+ * A function that creates a wallet provider for a given WC session's namespace.
21
+ *
22
+ * @param session - The WC session.
23
+ * @param client - The client instance.
24
+ * @returns The wallet provider.
25
+ */
26
+ export type WalletProviderBuilder = (args: {
27
+ session: SessionTypes.Struct;
28
+ }, client: DynamicClient) => Promise<WalletConnectWalletProvider>;
29
+ //# sourceMappingURL=walletConnectWalletProvider.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletConnectWalletProvider.types.d.ts","sourceRoot":"","sources":["../../../../packages/wallet-connect/src/walletConnectWalletProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,2BAA2B,GAAG,cAAc,GAAG;IACzD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC;IAE7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,IAAI,EAAE;IAAE,OAAO,EAAE,YAAY,CAAC,MAAM,CAAA;CAAE,EACtC,MAAM,EAAE,aAAa,KAClB,OAAO,CAAC,2BAA2B,CAAC,CAAC"}