@dynamic-labs/wallet-connector-core 4.5.0 → 4.5.2

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,26 @@
1
1
 
2
+ ### [4.5.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.1...v4.5.2) (2025-02-08)
3
+
4
+
5
+ ### Features
6
+
7
+ * add getEnabledNetworks method to wallet connectors ([#8000](https://github.com/dynamic-labs/dynamic-auth/issues/8000)) ([450cdcd](https://github.com/dynamic-labs/dynamic-auth/commit/450cdcd98b11c734fb9c9d97bb1813cf5538e85e))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * add fallback for exchange rate lookup failure ([#7994](https://github.com/dynamic-labs/dynamic-auth/issues/7994)) ([1359724](https://github.com/dynamic-labs/dynamic-auth/commit/1359724ec2931c61324bfe8d73110d862ebc016f))
13
+ * add USDT and USDC as hardcoded to 1 ([#8012](https://github.com/dynamic-labs/dynamic-auth/issues/8012)) ([92dcd2f](https://github.com/dynamic-labs/dynamic-auth/commit/92dcd2f6a90e8eeca034edf1682336896180281e))
14
+ * underflow bigint issue with small sol transfers ([#8006](https://github.com/dynamic-labs/dynamic-auth/issues/8006)) ([3fd00c2](https://github.com/dynamic-labs/dynamic-auth/commit/3fd00c2f0d0e10333f0206cb80197375de836003))
15
+ * view address react 17 compatibility ([#8002](https://github.com/dynamic-labs/dynamic-auth/issues/8002)) ([782e0f3](https://github.com/dynamic-labs/dynamic-auth/commit/782e0f323f388cac1d0773420ae45595aa806c26))
16
+
17
+ ### [4.5.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.5.0...v4.5.1) (2025-02-05)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * improve sdk performance ([#7992](https://github.com/dynamic-labs/dynamic-auth/issues/7992)) ([7c541d4](https://github.com/dynamic-labs/dynamic-auth/commit/7c541d498b3afe708e468327e53c839826029490))
23
+
2
24
  ## [4.5.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.4.4...v4.5.0) (2025-02-04)
3
25
 
4
26
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.5.0";
6
+ var version = "4.5.2";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.5.0";
2
+ var version = "4.5.2";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-connector-core",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "Core package for utilities and types for handling multiple wallet/chain support Dynamic SDK",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -18,13 +18,13 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/sdk-api-core": "0.0.607",
22
- "@dynamic-labs/assert-package-version": "4.5.0",
23
- "@dynamic-labs/logger": "4.5.0",
24
- "@dynamic-labs/rpc-providers": "4.5.0",
25
- "@dynamic-labs/types": "4.5.0",
26
- "@dynamic-labs/utils": "4.5.0",
27
- "@dynamic-labs/wallet-book": "4.5.0",
21
+ "@dynamic-labs/sdk-api-core": "0.0.613",
22
+ "@dynamic-labs/assert-package-version": "4.5.2",
23
+ "@dynamic-labs/logger": "4.5.2",
24
+ "@dynamic-labs/rpc-providers": "4.5.2",
25
+ "@dynamic-labs/types": "4.5.2",
26
+ "@dynamic-labs/utils": "4.5.2",
27
+ "@dynamic-labs/wallet-book": "4.5.2",
28
28
  "eventemitter3": "5.0.1"
29
29
  },
30
30
  "peerDependencies": {}
@@ -329,6 +329,14 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
329
329
  signMessage(messageToSign, options) {
330
330
  return Promise.resolve(undefined);
331
331
  }
332
+ /**
333
+ * Returns the array of block explorer URLs available for the current network
334
+ */
335
+ getBlockExplorerUrlsForCurrentNetwork() {
336
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
337
+ return [];
338
+ });
339
+ }
332
340
  /**
333
341
  * Whether the wallet supports network switching
334
342
  *
@@ -440,6 +448,13 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
440
448
  });
441
449
  });
442
450
  }
451
+ /**
452
+ * Get the enabled networks for the wallet
453
+ * @returns {GenericNetwork[]} The enabled networks
454
+ */
455
+ getEnabledNetworks() {
456
+ return [];
457
+ }
443
458
  }
444
459
  _WalletConnectorBase_registeredExtensions = new WeakMap();
445
460
 
@@ -1,7 +1,7 @@
1
1
  import EventEmitter from 'eventemitter3';
2
2
  import { IChainRpcProviders } from '@dynamic-labs/rpc-providers';
3
3
  import type { JwtVerifiedCredential, WalletAdditionalAddress } from '@dynamic-labs/sdk-api-core';
4
- import { MobileExperience } from '@dynamic-labs/types';
4
+ import { GenericNetwork, MobileExperience } from '@dynamic-labs/types';
5
5
  import { WalletBookSchema, WalletSchema } from '@dynamic-labs/wallet-book';
6
6
  import { WalletConnectorEventEmitter } from '../events';
7
7
  import { WalletMetadata } from '../types';
@@ -263,6 +263,10 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
263
263
  signMessage(messageToSign: string, options?: {
264
264
  address?: string;
265
265
  }): Promise<string | undefined>;
266
+ /**
267
+ * Returns the array of block explorer URLs available for the current network
268
+ */
269
+ getBlockExplorerUrlsForCurrentNetwork(): Promise<string[]>;
266
270
  /**
267
271
  * List of supported chains for this wallet
268
272
  */
@@ -327,4 +331,9 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
327
331
  * otherwise rejects with an error.
328
332
  */
329
333
  validateActiveWallet(expectedAddress: string): Promise<void>;
334
+ /**
335
+ * Get the enabled networks for the wallet
336
+ * @returns {GenericNetwork[]} The enabled networks
337
+ */
338
+ getEnabledNetworks(): GenericNetwork[];
330
339
  }
@@ -321,6 +321,14 @@ class WalletConnectorBase extends EventEmitter {
321
321
  signMessage(messageToSign, options) {
322
322
  return Promise.resolve(undefined);
323
323
  }
324
+ /**
325
+ * Returns the array of block explorer URLs available for the current network
326
+ */
327
+ getBlockExplorerUrlsForCurrentNetwork() {
328
+ return __awaiter(this, void 0, void 0, function* () {
329
+ return [];
330
+ });
331
+ }
324
332
  /**
325
333
  * Whether the wallet supports network switching
326
334
  *
@@ -432,6 +440,13 @@ class WalletConnectorBase extends EventEmitter {
432
440
  });
433
441
  });
434
442
  }
443
+ /**
444
+ * Get the enabled networks for the wallet
445
+ * @returns {GenericNetwork[]} The enabled networks
446
+ */
447
+ getEnabledNetworks() {
448
+ return [];
449
+ }
435
450
  }
436
451
  _WalletConnectorBase_registeredExtensions = new WeakMap();
437
452
 
@@ -22,7 +22,7 @@ export type NameServiceData = {
22
22
  name?: string;
23
23
  };
24
24
  export type InternalWalletConnector = WalletConnectorCore.WalletConnector;
25
- export type WalletConnector = Pick<InternalWalletConnector, 'canConnectViaCustodialService' | 'canConnectViaQrCode' | 'canConnectViaSocial' | 'chainRpcProviders' | 'connect' | 'connectedChain' | 'createWallet' | 'constructorProps' | 'endSession' | 'getAddress' | 'getAdditionalAddresses' | 'getConnectedAccounts' | 'getDeepLink' | 'getMobileOrInstalledWallet' | 'getNetwork' | 'getSession' | 'initEventListener' | 'isAvailable' | 'isEmbeddedWallet' | 'isInitialized' | 'isInstalledOnBrowser' | 'isTestnet' | 'isWalletConnect' | 'key' | 'metadata' | 'name' | 'parseAddress' | 'proveOwnership' | 'providerResources' | 'supportedChains' | 'supportsNetworkSwitching' | 'switchNetwork' | 'switchNetworkOnlyFromWallet' | 'teardownEventListeners'> & EventEmitter<WalletConnectorEventTypes>;
25
+ export type WalletConnector = Pick<InternalWalletConnector, 'canConnectViaCustodialService' | 'canConnectViaQrCode' | 'canConnectViaSocial' | 'chainRpcProviders' | 'connect' | 'connectedChain' | 'createWallet' | 'constructorProps' | 'endSession' | 'getAddress' | 'getAdditionalAddresses' | 'getConnectedAccounts' | 'getDeepLink' | 'getMobileOrInstalledWallet' | 'getNetwork' | 'getSession' | 'initEventListener' | 'isAvailable' | 'isEmbeddedWallet' | 'isInitialized' | 'isInstalledOnBrowser' | 'isTestnet' | 'isWalletConnect' | 'key' | 'metadata' | 'name' | 'parseAddress' | 'proveOwnership' | 'providerResources' | 'supportedChains' | 'supportsNetworkSwitching' | 'switchNetwork' | 'switchNetworkOnlyFromWallet' | 'teardownEventListeners' | 'getBlockExplorerUrlsForCurrentNetwork' | 'getEnabledNetworks'> & EventEmitter<WalletConnectorEventTypes>;
26
26
  export interface WalletConnectorConstructor {
27
27
  new (props?: any): InternalWalletConnector;
28
28
  }
package/src/index.cjs CHANGED
@@ -30,7 +30,6 @@ var eventListenerHandlers = require('./utils/eventListenerHandlers.cjs');
30
30
  var isHex = require('./utils/isHex/isHex.cjs');
31
31
  var isPhantomRedirectConnector = require('./utils/isPhantomRedirectConnector/isPhantomRedirectConnector.cjs');
32
32
  var getRpcUrlForChain = require('./utils/getRpcUrlForChain/getRpcUrlForChain.cjs');
33
- var isCoinbaseMpcWalletConnector = require('./utils/isCoinbaseMpcWalletConnector/isCoinbaseMpcWalletConnector.cjs');
34
33
  var isWalletConnectConnector = require('./utils/isWalletConnectConnector/isWalletConnectConnector.cjs');
35
34
  var isSendBalanceWalletConnector = require('./utils/isSendBalanceWalletConnector/isSendBalanceWalletConnector.cjs');
36
35
  var isSessionKeyCompatibleWallet = require('./utils/isSessionKeyCompatible/isSessionKeyCompatibleWallet/isSessionKeyCompatibleWallet.cjs');
@@ -77,7 +76,6 @@ exports.eventListenerHandlers = eventListenerHandlers.eventListenerHandlers;
77
76
  exports.isHex = isHex.isHex;
78
77
  exports.isPhantomRedirectConnector = isPhantomRedirectConnector.isPhantomRedirectConnector;
79
78
  exports.getRpcUrlForChain = getRpcUrlForChain.getRpcUrlForChain;
80
- exports.isCoinbaseMpcWalletConnector = isCoinbaseMpcWalletConnector.isCoinbaseMpcWalletConnector;
81
79
  exports.isWalletConnectConnector = isWalletConnectConnector.isWalletConnectConnector;
82
80
  exports.isSendBalanceWalletConnector = isSendBalanceWalletConnector.isSendBalanceWalletConnector;
83
81
  exports.isSessionKeyCompatibleWallet = isSessionKeyCompatibleWallet.isSessionKeyCompatibleWallet;
package/src/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { walletConnectorEvents } from './events';
2
- export { type Attestation, type AuthenticatorRecoveryHandler, type AuthenticatorType, type BitcoinSignPsbtRequest, type BitcoinSignPsbtRequestSignature, type BitcoinSignPsbtResponse, type ExportHandler, type ExtendedPrivateKey, type IAccountAbstractionWalletConnector, type IBitcoinWalletConnector, type ICoinbaseMPCWalletConnector, type IEmailOTPWalletConnector, type IEmailWalletConnector, type IHardwareWalletConnector, type IPasskeyWalletConnector, type IPhantomRedirectConnector, type IPhantomRedirectConnectorWithEvents, type ISendBalanceWalletConnector, type ISessionKeyCompatibleWalletConnector, type ISMSWalletConnector, type ITurnkeyWalletConnector, type ITurnkeyWalletConnectorStamper, type IWalletConnectConnector, type IZeroDevConnector, type RawPrivateKey, type RecoveryEmailParams, type RecoveryWebAuthnAttestation, type SignAllTransactionsListener, type SignAndSendTransactionListener, type SignMessageListener, type SignTransactionListener, type WebAuthnAttestation, type IEthereumConnector, type IPublicClient, type ISolanaConnection, } from './interfaces';
2
+ export { type Attestation, type AuthenticatorRecoveryHandler, type AuthenticatorType, type BitcoinSignPsbtRequest, type BitcoinSignPsbtRequestSignature, type BitcoinSignPsbtResponse, type ExportHandler, type IAccountAbstractionWalletConnector, type IBitcoinWalletConnector, type IEmailOTPWalletConnector, type IEmailWalletConnector, type IHardwareWalletConnector, type IPasskeyWalletConnector, type IPhantomRedirectConnector, type IPhantomRedirectConnectorWithEvents, type ISendBalanceWalletConnector, type ISessionKeyCompatibleWalletConnector, type ISMSWalletConnector, type ITurnkeyWalletConnector, type ITurnkeyWalletConnectorStamper, type IWalletConnectConnector, type IZeroDevConnector, type RecoveryEmailParams, type RecoveryWebAuthnAttestation, type SignAllTransactionsListener, type SignAndSendTransactionListener, type SignMessageListener, type SignTransactionListener, type WebAuthnAttestation, type IEthereumConnector, type IPublicClient, type ISolanaConnection, } from './interfaces';
3
3
  export type { AccountChangeEventHandler, ChainChangeEventHandler, DisconnectEventHandler, WalletConnectorCore, WalletMetadata, WalletDeepLinks, WalletDownloadLinks, WalletLimitations, WalletLinks, } from './types';
4
- export { addHexPrefix, bufferToHex, eventListenerHandlers, getChainInfo, getChainInfoWithOverrides, getDeepLink, getMobileExperience, getRpcUrlForChain, getWalletConnectorByKey, isAccountAbstractionConnector, isBitcoinConnector, isBloctoConnector, isCoinbaseMpcWalletConnector, isEmailOTPWalletConnector, isEmailWalletConnector, isEmbeddedConnector, isHardwareWalletConnector, isHex, isMagicConnector, isPasskeyWalletConnector, isPhantomRedirectConnector, isSameAddress, isSendBalanceWalletConnector, isSessionKeyCompatibleWallet, isSessionKeyCompatibleWalletConnector, isSocialWalletConnector, isTurnkeyWalletConnector, isWalletConnectConnector, isConnectorMethodSupported, isConnectorEventSupported, getWalletMetadataFromWalletBook, getWalletLinks, logger, performPlatformSpecificConnectionMethod, ProviderLookup, setChainInfoOverrides, shouldLowercaseAddress, utf8ToHex, convertWalletToBaseWallet, convertWalletToBaseWalletPartial, type ChainDisplayOverrides, type DeepLinkVariant, type ProviderCondition, } from './utils';
4
+ export { addHexPrefix, bufferToHex, eventListenerHandlers, getChainInfo, getChainInfoWithOverrides, getDeepLink, getMobileExperience, getRpcUrlForChain, getWalletConnectorByKey, isAccountAbstractionConnector, isBitcoinConnector, isBloctoConnector, isEmailOTPWalletConnector, isEmailWalletConnector, isEmbeddedConnector, isHardwareWalletConnector, isHex, isMagicConnector, isPasskeyWalletConnector, isPhantomRedirectConnector, isSameAddress, isSendBalanceWalletConnector, isSessionKeyCompatibleWallet, isSessionKeyCompatibleWalletConnector, isSocialWalletConnector, isTurnkeyWalletConnector, isWalletConnectConnector, isConnectorMethodSupported, isConnectorEventSupported, getWalletMetadataFromWalletBook, getWalletLinks, logger, performPlatformSpecificConnectionMethod, ProviderLookup, setChainInfoOverrides, shouldLowercaseAddress, utf8ToHex, convertWalletToBaseWallet, convertWalletToBaseWalletPartial, type ChainDisplayOverrides, type DeepLinkVariant, type ProviderCondition, } from './utils';
5
5
  export { Wallet, type WalletConstructor, type WalletProps } from './Wallet';
6
6
  export { Chains, socialProviders, WalletConnectorBase, type Chain, type ChainInfo, type GetAddressOpts, type InternalWalletConnector, type NameServiceData, type PayloadParams, type SocialProvider, type WalletConnector, type WalletConnectorConstructor, type WalletConnectorEventTypes, type WalletConnectorExtension, type WalletConnectorsMethod, } from './WalletConnectorBase';
7
7
  export { WalletBookSingleton } from './WalletBookSingleton';
package/src/index.js CHANGED
@@ -26,7 +26,6 @@ export { eventListenerHandlers } from './utils/eventListenerHandlers.js';
26
26
  export { isHex } from './utils/isHex/isHex.js';
27
27
  export { isPhantomRedirectConnector } from './utils/isPhantomRedirectConnector/isPhantomRedirectConnector.js';
28
28
  export { getRpcUrlForChain } from './utils/getRpcUrlForChain/getRpcUrlForChain.js';
29
- export { isCoinbaseMpcWalletConnector } from './utils/isCoinbaseMpcWalletConnector/isCoinbaseMpcWalletConnector.js';
30
29
  export { isWalletConnectConnector } from './utils/isWalletConnectConnector/isWalletConnectConnector.js';
31
30
  export { isSendBalanceWalletConnector } from './utils/isSendBalanceWalletConnector/isSendBalanceWalletConnector.js';
32
31
  export { isSessionKeyCompatibleWallet } from './utils/isSessionKeyCompatible/isSessionKeyCompatibleWallet/isSessionKeyCompatibleWallet.js';
@@ -1,6 +1,5 @@
1
1
  export * from './IAccountAbstractionWalletConnector';
2
2
  export * from './IBitcoinWalletConnector';
3
- export * from './ICoinbaseMPCWalletConnector';
4
3
  export * from './IEmailOTPWalletConnector';
5
4
  export * from './IEmailWalletConnector';
6
5
  export * from './IHardwareWalletConnector';
@@ -21,7 +21,6 @@ export * from './eventListenerHandlers';
21
21
  export * from './isHex';
22
22
  export * from './isPhantomRedirectConnector';
23
23
  export * from './getRpcUrlForChain';
24
- export * from './isCoinbaseMpcWalletConnector';
25
24
  export * from './isWalletConnectConnector';
26
25
  export * from './isSendBalanceWalletConnector';
27
26
  export * from './isSessionKeyCompatible';
@@ -1,21 +0,0 @@
1
- import { PasswordSourceTypeEnum } from '@dynamic-labs/sdk-api-core';
2
- import { WalletConnectorBase } from '..';
3
- export type RawPrivateKey = {
4
- keyPath: string;
5
- ecKeyPublic: string;
6
- ecKeyPrivate: string;
7
- };
8
- export type ExtendedPrivateKey = {
9
- keyPath: string;
10
- xPrivateKey: string;
11
- };
12
- export interface ICoinbaseMPCWalletConnector extends WalletConnectorBase {
13
- changePasscode(newPasscode: string, oldPasscode?: string): Promise<boolean>;
14
- exportWalletKeys(): Promise<ExtendedPrivateKey[] | RawPrivateKey[]>;
15
- generateWallet(source: PasswordSourceTypeEnum, passcode: string): Promise<string | undefined>;
16
- setAuthTokenFetcher(func: () => Promise<string>): void;
17
- setBackupCodeFetcher(func: () => Promise<string>): void;
18
- setPasscodeFetcher(func: () => Promise<string>): void;
19
- setRequiredPassword(isRequired: boolean): void;
20
- validatePasscode(passcode: string): Promise<boolean>;
21
- }
@@ -1 +0,0 @@
1
- export * from './isCoinbaseMpcWalletConnector';
@@ -1,12 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- const isCoinbaseMpcWalletConnector = (connector) => Boolean(connector) &&
7
- connector.key === 'coinbasempc' &&
8
- connector.generateWallet !== undefined &&
9
- connector.changePasscode !== undefined &&
10
- connector.exportWalletKeys !== undefined;
11
-
12
- exports.isCoinbaseMpcWalletConnector = isCoinbaseMpcWalletConnector;
@@ -1,2 +0,0 @@
1
- import { ICoinbaseMPCWalletConnector, WalletConnector } from '../..';
2
- export declare const isCoinbaseMpcWalletConnector: (connector?: WalletConnector | ICoinbaseMPCWalletConnector) => connector is ICoinbaseMPCWalletConnector;
@@ -1,8 +0,0 @@
1
- 'use client'
2
- const isCoinbaseMpcWalletConnector = (connector) => Boolean(connector) &&
3
- connector.key === 'coinbasempc' &&
4
- connector.generateWallet !== undefined &&
5
- connector.changePasscode !== undefined &&
6
- connector.exportWalletKeys !== undefined;
7
-
8
- export { isCoinbaseMpcWalletConnector };