@dynamic-labs-sdk/wallet-connect 1.46.1 → 1.48.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.
@@ -0,0 +1,2 @@
1
+ export { withRelayConnectionTimeout } from './withRelayConnectionTimeout';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/withRelayConnectionTimeout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { DynamicClient } from '@dynamic-labs-sdk/client';
2
+ import type SignClient from '@walletconnect/sign-client';
3
+ /** How long creating a pairing may wait for the relay before giving up. */
4
+ export declare const RELAY_CONNECTION_TIMEOUT_MS = 10000;
5
+ type WithRelayConnectionTimeoutParams<T extends {
6
+ uri?: string;
7
+ }> = {
8
+ /** The Dynamic client instance, for logging. */
9
+ client: DynamicClient;
10
+ /** Creates the pairing, e.g. `signClient.connect(...)`. */
11
+ createPairing: () => Promise<T>;
12
+ /** The client the pairing is created on. */
13
+ signClient: SignClient;
14
+ /** Overrides {@link RELAY_CONNECTION_TIMEOUT_MS}. */
15
+ timeoutMs?: number;
16
+ };
17
+ /**
18
+ * Creates a WalletConnect pairing, failing with
19
+ * `WalletConnectRelayUnavailableError` when the relay can't be reached in time.
20
+ *
21
+ * Pairing waits for the relay connection with no timeout of its own, so an
22
+ * offline device or a refused app would otherwise wait forever. A pairing that
23
+ * lands after the timeout is disconnected, so nothing is left for a wallet to
24
+ * approve.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const { approval, uri } = await withRelayConnectionTimeout({
29
+ * client,
30
+ * createPairing: () => signClient.connect({ optionalNamespaces }),
31
+ * signClient,
32
+ * });
33
+ * ```
34
+ *
35
+ * @param params.client - The Dynamic client instance, for logging.
36
+ * @param params.createPairing - Creates the pairing.
37
+ * @param params.signClient - The client the pairing is created on.
38
+ * @param [params.timeoutMs] - How long to wait for the relay.
39
+ * @returns What `createPairing` resolved with.
40
+ * @throws WalletConnectRelayUnavailableError If pairing creation outlasts the timeout.
41
+ * @see getSignClient
42
+ * @see WalletConnectRelayUnavailableError
43
+ * @notInstrumented
44
+ */
45
+ export declare const withRelayConnectionTimeout: <T extends {
46
+ uri?: string;
47
+ }>({ client, createPairing, signClient, timeoutMs, }: WithRelayConnectionTimeoutParams<T>) => Promise<T>;
48
+ export {};
49
+ //# sourceMappingURL=withRelayConnectionTimeout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withRelayConnectionTimeout.d.ts","sourceRoot":"","sources":["../../src/withRelayConnectionTimeout/withRelayConnectionTimeout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AAKzD,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD,KAAK,gCAAgC,CAAC,CAAC,SAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,IAAI;IAClE,gDAAgD;IAChD,MAAM,EAAE,aAAa,CAAC;IACtB,2DAA2D;IAC3D,aAAa,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IAChC,4CAA4C;IAC5C,UAAU,EAAE,UAAU,CAAC;IACvB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,0BAA0B,GAAU,CAAC,SAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,qDAKxE,gCAAgC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAgDjD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs-sdk/wallet-connect",
3
- "version": "1.46.1",
3
+ "version": "1.48.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.esm.js",
@@ -22,13 +22,13 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@dynamic-labs/sdk-api-core": "0.125.0",
25
+ "@dynamic-labs/sdk-api-core": "0.142.0",
26
26
  "@walletconnect/sign-client": "2.23.10",
27
27
  "@walletconnect/types": "2.23.10",
28
28
  "@walletconnect/utils": "2.23.10",
29
- "zod": "4.0.5",
30
- "@dynamic-labs-sdk/assert-package-version": "1.46.1",
31
- "@dynamic-labs-sdk/client": "1.46.1"
29
+ "zod": "4.6.6",
30
+ "@dynamic-labs-sdk/client": "1.48.0",
31
+ "@dynamic-labs-sdk/assert-package-version": "1.48.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "eventemitter3": "5.0.1",
@@ -1,41 +0,0 @@
1
- const require_core = require('./core.cjs');
2
- let _dynamic_labs_sdk_client = require("@dynamic-labs-sdk/client");
3
-
4
- //#region package.json
5
- var name = "@dynamic-labs-sdk/wallet-connect";
6
- var version = "1.46.1";
7
-
8
- //#endregion
9
- //#region src/errors/SessionClosedUnexpectedlyError.ts
10
- var SessionClosedUnexpectedlyError = class extends _dynamic_labs_sdk_client.BaseError {
11
- constructor({ sessionTopic, walletDisplayName }) {
12
- super({
13
- cause: null,
14
- code: "session_closed_unexpectedly_error",
15
- docsUrl: null,
16
- name: "SessionClosedUnexpectedlyError",
17
- shortMessage: walletDisplayName ? `WalletConnect session ${sessionTopic} closed unexpectedly. Associated wallet was ${walletDisplayName}` : `WalletConnect session ${sessionTopic} closed unexpectedly`
18
- });
19
- }
20
- };
21
-
22
- //#endregion
23
- Object.defineProperty(exports, 'SessionClosedUnexpectedlyError', {
24
- enumerable: true,
25
- get: function () {
26
- return SessionClosedUnexpectedlyError;
27
- }
28
- });
29
- Object.defineProperty(exports, 'name', {
30
- enumerable: true,
31
- get: function () {
32
- return name;
33
- }
34
- });
35
- Object.defineProperty(exports, 'version', {
36
- enumerable: true,
37
- get: function () {
38
- return version;
39
- }
40
- });
41
- //# sourceMappingURL=SessionClosedUnexpectedlyError-BoPqdEP4.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SessionClosedUnexpectedlyError-BoPqdEP4.cjs","names":["BaseError"],"sources":["../package.json","../src/errors/SessionClosedUnexpectedlyError.ts"],"sourcesContent":["","import { BaseError } from '@dynamic-labs-sdk/client';\n\ntype SessionClosedUnexpectedlyErrorParams = {\n /**\n * The topic of the session that closed unexpectedly.\n */\n sessionTopic: string;\n\n /**\n * The display name of the wallet that was associated with the session that closed unexpectedly.\n */\n walletDisplayName: string | null | undefined;\n};\n\nexport class SessionClosedUnexpectedlyError extends BaseError {\n constructor({\n sessionTopic,\n walletDisplayName,\n }: SessionClosedUnexpectedlyErrorParams) {\n super({\n cause: null,\n code: 'session_closed_unexpectedly_error',\n docsUrl: null,\n name: 'SessionClosedUnexpectedlyError',\n shortMessage: walletDisplayName\n ? `WalletConnect session ${sessionTopic} closed unexpectedly. Associated wallet was ${walletDisplayName}`\n : `WalletConnect session ${sessionTopic} closed unexpectedly`,\n });\n }\n}\n"],"mappings":";;;;;;;;;ACcA,IAAa,iCAAb,cAAoDA,mCAAU;CAC5D,YAAY,EACV,cACA,qBACuC;AACvC,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,oBACV,yBAAyB,aAAa,8CAA8C,sBACpF,yBAAyB,aAAa;GAC3C,CAAC"}
@@ -1,23 +0,0 @@
1
- import { BaseError } from "@dynamic-labs-sdk/client";
2
-
3
- //#region package.json
4
- var name = "@dynamic-labs-sdk/wallet-connect";
5
- var version = "1.46.1";
6
-
7
- //#endregion
8
- //#region src/errors/SessionClosedUnexpectedlyError.ts
9
- var SessionClosedUnexpectedlyError = class extends BaseError {
10
- constructor({ sessionTopic, walletDisplayName }) {
11
- super({
12
- cause: null,
13
- code: "session_closed_unexpectedly_error",
14
- docsUrl: null,
15
- name: "SessionClosedUnexpectedlyError",
16
- shortMessage: walletDisplayName ? `WalletConnect session ${sessionTopic} closed unexpectedly. Associated wallet was ${walletDisplayName}` : `WalletConnect session ${sessionTopic} closed unexpectedly`
17
- });
18
- }
19
- };
20
-
21
- //#endregion
22
- export { name as n, version as r, SessionClosedUnexpectedlyError as t };
23
- //# sourceMappingURL=SessionClosedUnexpectedlyError-Deprq_6P.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SessionClosedUnexpectedlyError-Deprq_6P.esm.js","names":[],"sources":["../package.json","../src/errors/SessionClosedUnexpectedlyError.ts"],"sourcesContent":["","import { BaseError } from '@dynamic-labs-sdk/client';\n\ntype SessionClosedUnexpectedlyErrorParams = {\n /**\n * The topic of the session that closed unexpectedly.\n */\n sessionTopic: string;\n\n /**\n * The display name of the wallet that was associated with the session that closed unexpectedly.\n */\n walletDisplayName: string | null | undefined;\n};\n\nexport class SessionClosedUnexpectedlyError extends BaseError {\n constructor({\n sessionTopic,\n walletDisplayName,\n }: SessionClosedUnexpectedlyErrorParams) {\n super({\n cause: null,\n code: 'session_closed_unexpectedly_error',\n docsUrl: null,\n name: 'SessionClosedUnexpectedlyError',\n shortMessage: walletDisplayName\n ? `WalletConnect session ${sessionTopic} closed unexpectedly. Associated wallet was ${walletDisplayName}`\n : `WalletConnect session ${sessionTopic} closed unexpectedly`,\n });\n }\n}\n"],"mappings":";;;;;;;;ACcA,IAAa,iCAAb,cAAoD,UAAU;CAC5D,YAAY,EACV,cACA,qBACuC;AACvC,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,oBACV,yBAAyB,aAAa,8CAA8C,sBACpF,yBAAyB,aAAa;GAC3C,CAAC"}