@dynamic-labs/global-wallet 3.0.0-alpha.58 → 3.0.0-alpha.59
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 +3 -0
- package/package.json +5 -3
- package/src/GlobalWalletConnector.d.ts +2 -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) || {};
|
|
@@ -196,6 +198,7 @@ const GlobalWalletExtension = {
|
|
|
196
198
|
pairWithWC: (uri) => __awaiter(void 0, void 0, void 0, function* () {
|
|
197
199
|
yield web3wallet.pair({ uri });
|
|
198
200
|
}),
|
|
201
|
+
qrScanner: (data, width, height, providedOptions) => jsQR(data, width, height, providedOptions),
|
|
199
202
|
};
|
|
200
203
|
connector.globalWallet = globalWallet;
|
|
201
204
|
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.59",
|
|
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.59"
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Options, QRCode } from 'jsqr';
|
|
1
2
|
import { WalletConnectorExtension } from '@dynamic-labs/wallet-connector-core';
|
|
2
3
|
declare module '@dynamic-labs/wallet-connector-core' {
|
|
3
4
|
namespace WalletConnectorCore {
|
|
@@ -12,6 +13,7 @@ declare module '@dynamic-labs/wallet-connector-core' {
|
|
|
12
13
|
initWeb3Wallet: () => Promise<void>;
|
|
13
14
|
confirmPairing: (confirm: boolean) => Promise<void>;
|
|
14
15
|
getPendingPairing: () => object;
|
|
16
|
+
qrScanner: (data: Uint8ClampedArray, width: number, height: number, providedOptions?: Options) => QRCode | null;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
}
|