@dynamic-labs/global-wallet 3.0.0-alpha.58 → 3.0.0-alpha.60
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/index.js +4 -0
- package/package.json +5 -3
- package/src/GlobalWalletConnector.d.ts +4 -0
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Core } from '@walletconnect/core';
|
|
|
2
2
|
import { getSdkError, buildApprovedNamespaces } from '@walletconnect/utils';
|
|
3
3
|
import { Web3Wallet } from '@walletconnect/web3wallet';
|
|
4
4
|
import { fromHex } from 'viem';
|
|
5
|
+
import jsQR from 'jsqr';
|
|
5
6
|
|
|
6
7
|
/******************************************************************************
|
|
7
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -33,6 +34,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
33
34
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
34
35
|
};
|
|
35
36
|
|
|
37
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
36
38
|
const buildCombinedNamespaces = (params) => {
|
|
37
39
|
var _a, _b;
|
|
38
40
|
const requiredEip155 = ((_a = params.requiredNamespaces) === null || _a === void 0 ? void 0 : _a.eip155) || {};
|
|
@@ -99,6 +101,7 @@ const GlobalWalletExtension = {
|
|
|
99
101
|
// topic => session mapping, with peer metadata in the session
|
|
100
102
|
getConnectedWCSessions: () => __awaiter(void 0, void 0, void 0, function* () { return web3wallet.getActiveSessions(); }),
|
|
101
103
|
getPendingPairing: () => pendingSessionProposal,
|
|
104
|
+
getWeb3Wallet: () => web3wallet,
|
|
102
105
|
initWeb3Wallet: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
103
106
|
if (!web3wallet) {
|
|
104
107
|
const core = new Core({
|
|
@@ -196,6 +199,7 @@ const GlobalWalletExtension = {
|
|
|
196
199
|
pairWithWC: (uri) => __awaiter(void 0, void 0, void 0, function* () {
|
|
197
200
|
yield web3wallet.pair({ uri });
|
|
198
201
|
}),
|
|
202
|
+
qrScanner: (data, width, height, providedOptions) => jsQR(data, width, height, providedOptions),
|
|
199
203
|
};
|
|
200
204
|
connector.globalWallet = globalWallet;
|
|
201
205
|
yield globalWallet.initializeListeners();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/global-wallet",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.60",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -28,10 +28,12 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@walletconnect/core": "2.13.1",
|
|
30
30
|
"@walletconnect/utils": "2.13.1",
|
|
31
|
-
"@walletconnect/web3wallet": "1.12.1"
|
|
31
|
+
"@walletconnect/web3wallet": "1.12.1",
|
|
32
|
+
"jsqr": "1.4.0"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"viem": "2.7.6",
|
|
35
|
-
"
|
|
36
|
+
"react": "^18.0.0",
|
|
37
|
+
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.60"
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import Client from '@walletconnect/web3wallet';
|
|
2
|
+
import { Options, QRCode } from 'jsqr';
|
|
1
3
|
import { WalletConnectorExtension } from '@dynamic-labs/wallet-connector-core';
|
|
2
4
|
declare module '@dynamic-labs/wallet-connector-core' {
|
|
3
5
|
namespace WalletConnectorCore {
|
|
@@ -12,6 +14,8 @@ declare module '@dynamic-labs/wallet-connector-core' {
|
|
|
12
14
|
initWeb3Wallet: () => Promise<void>;
|
|
13
15
|
confirmPairing: (confirm: boolean) => Promise<void>;
|
|
14
16
|
getPendingPairing: () => object;
|
|
17
|
+
qrScanner: (data: Uint8ClampedArray, width: number, height: number, providedOptions?: Options) => QRCode | null;
|
|
18
|
+
getWeb3Wallet: () => Client | undefined;
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
21
|
}
|