@dynamic-labs/ethereum 4.19.0 → 4.19.1

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/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ### [4.19.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.0...v4.19.1) (2025-05-26)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **react-native:** reload webview when disconnected ([#8765](https://github.com/dynamic-labs/dynamic-auth/issues/8765)) ([addf90b](https://github.com/dynamic-labs/dynamic-auth/commit/addf90b6fccbe4b883e9778cf7a07e0471f85318))
8
+
2
9
  ## [4.19.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.8...v4.19.0) (2025-05-23)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.19.0";
6
+ var version = "4.19.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.19.0";
2
+ var version = "4.19.1";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "4.19.0",
3
+ "version": "4.19.1",
4
4
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -23,15 +23,15 @@
23
23
  "eventemitter3": "5.0.1",
24
24
  "buffer": "6.0.3",
25
25
  "@metamask/sdk": "0.33.0",
26
- "@dynamic-labs/assert-package-version": "4.19.0",
27
- "@dynamic-labs/embedded-wallet-evm": "4.19.0",
28
- "@dynamic-labs/ethereum-core": "4.19.0",
29
- "@dynamic-labs/logger": "4.19.0",
30
- "@dynamic-labs/rpc-providers": "4.19.0",
31
- "@dynamic-labs/types": "4.19.0",
32
- "@dynamic-labs/utils": "4.19.0",
33
- "@dynamic-labs/wallet-book": "4.19.0",
34
- "@dynamic-labs/wallet-connector-core": "4.19.0"
26
+ "@dynamic-labs/assert-package-version": "4.19.1",
27
+ "@dynamic-labs/embedded-wallet-evm": "4.19.1",
28
+ "@dynamic-labs/ethereum-core": "4.19.1",
29
+ "@dynamic-labs/logger": "4.19.1",
30
+ "@dynamic-labs/rpc-providers": "4.19.1",
31
+ "@dynamic-labs/types": "4.19.1",
32
+ "@dynamic-labs/utils": "4.19.1",
33
+ "@dynamic-labs/wallet-book": "4.19.1",
34
+ "@dynamic-labs/wallet-connector-core": "4.19.1"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "viem": "^2.28.4"
@@ -9,7 +9,6 @@ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
9
  var walletBook = require('@dynamic-labs/wallet-book');
10
10
  var utils = require('@dynamic-labs/utils');
11
11
  var ethereumCore = require('@dynamic-labs/ethereum-core');
12
- var normalizeRpcError = require('./utils/normalizeRpcError/normalizeRpcError.cjs');
13
12
 
14
13
  class EthProviderHelper {
15
14
  constructor(connector) {
@@ -89,7 +88,7 @@ class EthProviderHelper {
89
88
  account: this.connector.getActiveAccount(),
90
89
  chain: chainId ? ethereumCore.chainsMap[chainId] : this.connector.getActiveChain(),
91
90
  transport: viem.custom({
92
- request: (args) => provider.request(args).catch(normalizeRpcError.normalizeRpcError),
91
+ request: (args) => provider.request(args).catch(ethereumCore.normalizeRpcError),
93
92
  }, this.connector.providersConfig.httpTransportConfig),
94
93
  });
95
94
  }
@@ -4,8 +4,7 @@ import { createWalletClient, custom, getAddress } from 'viem';
4
4
  import { ProviderLookup, logger, eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
5
5
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
6
6
  import { getProvidersFromWindow, Eip6963ProviderSingleton } from '@dynamic-labs/utils';
7
- import { chainsMap } from '@dynamic-labs/ethereum-core';
8
- import { normalizeRpcError } from './utils/normalizeRpcError/normalizeRpcError.js';
7
+ import { chainsMap, normalizeRpcError } from '@dynamic-labs/ethereum-core';
9
8
 
10
9
  class EthProviderHelper {
11
10
  constructor(connector) {
@@ -9,7 +9,6 @@ var accounts = require('viem/accounts');
9
9
  var ethereumCore = require('@dynamic-labs/ethereum-core');
10
10
  var utils = require('@dynamic-labs/utils');
11
11
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
12
- var normalizeRpcError = require('../../utils/normalizeRpcError/normalizeRpcError.cjs');
13
12
  var WalletConnectProvider = require('../WalletConnectProvider/WalletConnectProvider.cjs');
14
13
 
15
14
  const WC_CURRENT_CHAIN_KEY = 'dynamic-wc2-current-chain';
@@ -122,7 +121,7 @@ class WalletConnectConnector extends ethereumCore.EthereumWalletConnector {
122
121
  transport: viem.custom({
123
122
  request: (args) => {
124
123
  this.deepLinkIfApplicable(args.method);
125
- return provider.request(args).catch(normalizeRpcError.normalizeRpcError);
124
+ return provider.request(args).catch(ethereumCore.normalizeRpcError);
126
125
  },
127
126
  }, this.providersConfig.httpTransportConfig),
128
127
  });
@@ -2,10 +2,9 @@
2
2
  import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import { createWalletClient, custom } from 'viem';
4
4
  import { toAccount } from 'viem/accounts';
5
- import { EthereumWalletConnector, chainsMap } from '@dynamic-labs/ethereum-core';
5
+ import { EthereumWalletConnector, chainsMap, normalizeRpcError } from '@dynamic-labs/ethereum-core';
6
6
  import { StorageService, parseIntSafe, DynamicError, isMobile, PlatformService } from '@dynamic-labs/utils';
7
7
  import { logger, getDeepLink } from '@dynamic-labs/wallet-connector-core';
8
- import { normalizeRpcError } from '../../utils/normalizeRpcError/normalizeRpcError.js';
9
8
  import { WalletConnectProvider } from '../WalletConnectProvider/WalletConnectProvider.js';
10
9
 
11
10
  const WC_CURRENT_CHAIN_KEY = 'dynamic-wc2-current-chain';
@@ -1 +0,0 @@
1
- export { normalizeRpcError } from './normalizeRpcError';
@@ -1,51 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var viem = require('viem');
7
-
8
- /**
9
- * Some wallets may not reject some operations following the EIP-1193 standard.
10
- * This function normalizes the errors to follow the EIP-1193 standard.
11
- */
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- const normalizeRpcError = (err) => {
14
- /**
15
- * When the error already comply with the EIP-1193 standard, we don't need to normalize it
16
- */
17
- if (err.code === 4001) {
18
- throw err;
19
- }
20
- let mappedError = null;
21
- try {
22
- mappedError = mapRpcError(err);
23
- }
24
- catch (e) {
25
- // ignore errors when mapping
26
- }
27
- if (mappedError) {
28
- throw mappedError;
29
- }
30
- /**
31
- * If no error is mapped, we rethrow the original error
32
- */
33
- throw err;
34
- };
35
- const mapRpcError = (err) => {
36
- /**
37
- * Checks for user rejection error message
38
- * Rainbow Extension will return a message like "User rejected the request"
39
- * BitGet will return a message like "user reject this request"
40
- * Keplr will return a message that matches "Request rejected"
41
- */
42
- if (typeof err.message === 'string' &&
43
- (err.message.includes('User rejected the request') ||
44
- err.message.includes('user reject this request') ||
45
- err.message === 'Request rejected')) {
46
- return new viem.UserRejectedRequestError(err);
47
- }
48
- return null;
49
- };
50
-
51
- exports.normalizeRpcError = normalizeRpcError;
@@ -1,5 +0,0 @@
1
- /**
2
- * Some wallets may not reject some operations following the EIP-1193 standard.
3
- * This function normalizes the errors to follow the EIP-1193 standard.
4
- */
5
- export declare const normalizeRpcError: (err: any) => never;
@@ -1,47 +0,0 @@
1
- 'use client'
2
- import { UserRejectedRequestError } from 'viem';
3
-
4
- /**
5
- * Some wallets may not reject some operations following the EIP-1193 standard.
6
- * This function normalizes the errors to follow the EIP-1193 standard.
7
- */
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- const normalizeRpcError = (err) => {
10
- /**
11
- * When the error already comply with the EIP-1193 standard, we don't need to normalize it
12
- */
13
- if (err.code === 4001) {
14
- throw err;
15
- }
16
- let mappedError = null;
17
- try {
18
- mappedError = mapRpcError(err);
19
- }
20
- catch (e) {
21
- // ignore errors when mapping
22
- }
23
- if (mappedError) {
24
- throw mappedError;
25
- }
26
- /**
27
- * If no error is mapped, we rethrow the original error
28
- */
29
- throw err;
30
- };
31
- const mapRpcError = (err) => {
32
- /**
33
- * Checks for user rejection error message
34
- * Rainbow Extension will return a message like "User rejected the request"
35
- * BitGet will return a message like "user reject this request"
36
- * Keplr will return a message that matches "Request rejected"
37
- */
38
- if (typeof err.message === 'string' &&
39
- (err.message.includes('User rejected the request') ||
40
- err.message.includes('user reject this request') ||
41
- err.message === 'Request rejected')) {
42
- return new UserRejectedRequestError(err);
43
- }
44
- return null;
45
- };
46
-
47
- export { normalizeRpcError };