@dynamic-labs/wallet-connect 4.39.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Dynamic Labs, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @dynamic-labs/wallet-connect
2
+
3
+ Contains logic for the Dynamic Wallet Connect provider.
@@ -0,0 +1,36 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ /******************************************************************************
7
+ Copyright (c) Microsoft Corporation.
8
+
9
+ Permission to use, copy, modify, and/or distribute this software for any
10
+ purpose with or without fee is hereby granted.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
+ PERFORMANCE OF THIS SOFTWARE.
19
+ ***************************************************************************** */
20
+
21
+ function __awaiter(thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ }
30
+
31
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
32
+ var e = new Error(message);
33
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
34
+ };
35
+
36
+ exports.__awaiter = __awaiter;
@@ -0,0 +1,32 @@
1
+ 'use client'
2
+ /******************************************************************************
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
15
+ ***************************************************************************** */
16
+
17
+ function __awaiter(thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ }
26
+
27
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
28
+ var e = new Error(message);
29
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
30
+ };
31
+
32
+ export { __awaiter };
package/package.cjs ADDED
@@ -0,0 +1,8 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var version = "4.39.0";
7
+
8
+ exports.version = version;
package/package.js ADDED
@@ -0,0 +1,4 @@
1
+ 'use client'
2
+ var version = "4.39.0";
3
+
4
+ export { version };
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@dynamic-labs/wallet-connect",
3
+ "version": "4.39.0",
4
+ "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
+ "author": "Dynamic Labs, Inc.",
6
+ "license": "MIT",
7
+ "main": "./src/index.cjs",
8
+ "module": "./src/index.js",
9
+ "types": "./src/index.d.ts",
10
+ "type": "module",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./src/index.d.ts",
14
+ "import": "./src/index.js",
15
+ "require": "./src/index.cjs"
16
+ },
17
+ "./package.json": "./package.json"
18
+ },
19
+ "homepage": "https://www.dynamic.xyz/",
20
+ "dependencies": {
21
+ "@walletconnect/sign-client": "2.22.4",
22
+ "@dynamic-labs/assert-package-version": "4.39.0",
23
+ "@dynamic-labs/logger": "4.39.0"
24
+ },
25
+ "peerDependencies": {}
26
+ }
@@ -0,0 +1,36 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../_virtual/_tslib.cjs');
7
+ var SignClient = require('@walletconnect/sign-client');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var SignClient__default = /*#__PURE__*/_interopDefaultLegacy(SignClient);
12
+
13
+ /**
14
+ * WalletConnect's SignClient would already internally share its core if we had
15
+ * multiple instances of it, so instead we will just use a singleton already.
16
+ *
17
+ * A SignClient is able to handle multiple sessions and multi chain connections.
18
+ */
19
+ let signClientSingleton = undefined;
20
+ const getSignClientSingleton = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ projectId, appIcon, appName, }) {
21
+ if (!signClientSingleton) {
22
+ signClientSingleton = yield SignClient__default["default"].init({
23
+ customStoragePrefix: `dynamicauth_${projectId}_walletconnect`,
24
+ metadata: {
25
+ description: '',
26
+ icons: [appIcon],
27
+ name: appName,
28
+ url: '',
29
+ },
30
+ projectId,
31
+ });
32
+ }
33
+ return signClientSingleton;
34
+ });
35
+
36
+ exports.getSignClientSingleton = getSignClientSingleton;
@@ -0,0 +1,9 @@
1
+ import SignClient from '@walletconnect/sign-client';
2
+ type GetSignClientSingletonParams = {
3
+ projectId: string;
4
+ appIcon: string;
5
+ appName: string;
6
+ };
7
+ export declare const getSignClientSingleton: ({ projectId, appIcon, appName, }: GetSignClientSingletonParams) => Promise<SignClient>;
8
+ export declare const _testOnly__resetSignClientSingleton: () => void;
9
+ export {};
@@ -0,0 +1,28 @@
1
+ 'use client'
2
+ import { __awaiter } from '../../_virtual/_tslib.js';
3
+ import SignClient from '@walletconnect/sign-client';
4
+
5
+ /**
6
+ * WalletConnect's SignClient would already internally share its core if we had
7
+ * multiple instances of it, so instead we will just use a singleton already.
8
+ *
9
+ * A SignClient is able to handle multiple sessions and multi chain connections.
10
+ */
11
+ let signClientSingleton = undefined;
12
+ const getSignClientSingleton = (_a) => __awaiter(void 0, [_a], void 0, function* ({ projectId, appIcon, appName, }) {
13
+ if (!signClientSingleton) {
14
+ signClientSingleton = yield SignClient.init({
15
+ customStoragePrefix: `dynamicauth_${projectId}_walletconnect`,
16
+ metadata: {
17
+ description: '',
18
+ icons: [appIcon],
19
+ name: appName,
20
+ url: '',
21
+ },
22
+ projectId,
23
+ });
24
+ }
25
+ return signClientSingleton;
26
+ });
27
+
28
+ export { getSignClientSingleton };
@@ -0,0 +1 @@
1
+ export { getSignClientSingleton } from './getSignClientSingleton';
package/src/index.cjs ADDED
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var assertPackageVersion = require('@dynamic-labs/assert-package-version');
7
+ var _package = require('../package.cjs');
8
+ var getSignClientSingleton = require('./getSignClientSingleton/getSignClientSingleton.cjs');
9
+
10
+ assertPackageVersion.assertPackageVersion('@dynamic-labs/wallet-connect', _package.version);
11
+
12
+ exports.getSignClientSingleton = getSignClientSingleton.getSignClientSingleton;
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { getSignClientSingleton } from './getSignClientSingleton';
package/src/index.js ADDED
@@ -0,0 +1,6 @@
1
+ 'use client'
2
+ import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
3
+ import { version } from '../package.js';
4
+ export { getSignClientSingleton } from './getSignClientSingleton/getSignClientSingleton.js';
5
+
6
+ assertPackageVersion('@dynamic-labs/wallet-connect', version);