@dynamic-labs/wallet-connector-core 4.0.0-alpha.26 → 4.0.0-alpha.28

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,37 @@
1
1
 
2
+ ## [4.0.0-alpha.28](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.27...v4.0.0-alpha.28) (2024-11-07)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * upgrade to starknet v6
8
+ See this guide for more details: https://starknetjs.com/docs/guides/migrate/
9
+ There are no code changes required on the Dynamic SDK side, however if you have installed the `starknet` package, you will need to upgrade to >= v6.11.0.
10
+
11
+ ### Features
12
+
13
+ * new transaction modal and ui for sign/signAll ([#7296](https://github.com/dynamic-labs/dynamic-auth/issues/7296)) ([05a8af1](https://github.com/dynamic-labs/dynamic-auth/commit/05a8af1eb772b2b8087ed96a54caf4b6ae8b79d2)), closes [#7297](https://github.com/dynamic-labs/dynamic-auth/issues/7297) [#7298](https://github.com/dynamic-labs/dynamic-auth/issues/7298)
14
+ * upgrade to starknet v6 ([#7189](https://github.com/dynamic-labs/dynamic-auth/issues/7189)) ([2a6e24e](https://github.com/dynamic-labs/dynamic-auth/commit/2a6e24e4178fcee671b381c28f6a681f4ce52c62))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * transaction confirmation modal popup ([#7368](https://github.com/dynamic-labs/dynamic-auth/issues/7368)) ([3c48658](https://github.com/dynamic-labs/dynamic-auth/commit/3c48658a62874d908bba8f06fb092ff5983ede16))
20
+
21
+ ## [4.0.0-alpha.27](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.26...v4.0.0-alpha.27) (2024-11-06)
22
+
23
+
24
+ ### Features
25
+
26
+ * allows adding connection configuration for solana connectors ([#7354](https://github.com/dynamic-labs/dynamic-auth/issues/7354)) ([01e35ee](https://github.com/dynamic-labs/dynamic-auth/commit/01e35ee5bfe4605df48e4188a753111efe483048))
27
+ * allows passing solana connection config to dynamic client ([#7357](https://github.com/dynamic-labs/dynamic-auth/issues/7357)) ([6da14ce](https://github.com/dynamic-labs/dynamic-auth/commit/6da14ceb481147aea31d192fe268be43a8af80e9))
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * check legacy vs eip1599 tx in global connectivity ([#7341](https://github.com/dynamic-labs/dynamic-auth/issues/7341)) ([b223ea7](https://github.com/dynamic-labs/dynamic-auth/commit/b223ea7a5ed5637e11da1040c631c48bc23ba76d))
33
+ * global connectivity multiple transactions in a row ([#7342](https://github.com/dynamic-labs/dynamic-auth/issues/7342)) ([d13c1af](https://github.com/dynamic-labs/dynamic-auth/commit/d13c1afec6b3680961621d8317f55549b3ed428f))
34
+
2
35
  ## [4.0.0-alpha.26](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.25...v4.0.0-alpha.26) (2024-11-04)
3
36
 
4
37
  ## [4.0.0-alpha.25](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.24...v4.0.0-alpha.25) (2024-11-01)
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.26";
6
+ var version = "4.0.0-alpha.28";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.26";
2
+ var version = "4.0.0-alpha.28";
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.0.0-alpha.26",
3
+ "version": "4.0.0-alpha.28",
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",
@@ -21,12 +21,12 @@
21
21
  "@dynamic-labs/sdk-api-core": "0.0.559"
22
22
  },
23
23
  "peerDependencies": {
24
- "@dynamic-labs/assert-package-version": "4.0.0-alpha.26",
25
- "@dynamic-labs/logger": "4.0.0-alpha.26",
26
- "@dynamic-labs/rpc-providers": "4.0.0-alpha.26",
27
- "@dynamic-labs/types": "4.0.0-alpha.26",
28
- "@dynamic-labs/utils": "4.0.0-alpha.26",
29
- "@dynamic-labs/wallet-book": "4.0.0-alpha.26",
24
+ "@dynamic-labs/assert-package-version": "4.0.0-alpha.28",
25
+ "@dynamic-labs/logger": "4.0.0-alpha.28",
26
+ "@dynamic-labs/rpc-providers": "4.0.0-alpha.28",
27
+ "@dynamic-labs/types": "4.0.0-alpha.28",
28
+ "@dynamic-labs/utils": "4.0.0-alpha.28",
29
+ "@dynamic-labs/wallet-book": "4.0.0-alpha.28",
30
30
  "eventemitter3": "5.0.1"
31
31
  }
32
32
  }
@@ -11,6 +11,7 @@ var walletConnectorEvents = require('../events/walletConnectorEvents.cjs');
11
11
  var logger = require('../utils/logger.cjs');
12
12
  var isSameAddress = require('../utils/isSameAddress/isSameAddress.cjs');
13
13
  var getMobileExperience = require('../utils/getMobileExperience/getMobileExperience.cjs');
14
+ var getWalletMetadataFromWalletBook = require('../utils/getWalletMetadataFromWalletBook/getWalletMetadataFromWalletBook.cjs');
14
15
  var isConnectorMethodSupported = require('../utils/isConnectorMethodSupported/isConnectorMethodSupported.cjs');
15
16
  var WalletBookSingleton = require('../WalletBookSingleton/WalletBookSingleton.cjs');
16
17
 
@@ -289,7 +290,13 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
289
290
  }
290
291
  get metadata() {
291
292
  var _a;
292
- return (_a = this._metadata) !== null && _a !== void 0 ? _a : { id: this.key };
293
+ if (!this._metadata) {
294
+ this._metadata = getWalletMetadataFromWalletBook.getWalletMetadataFromWalletBook({
295
+ walletBook: this.walletBook,
296
+ walletKey: this.key,
297
+ });
298
+ }
299
+ return (_a = this._metadata) !== null && _a !== void 0 ? _a : { icon: '', id: this.key, name: this.name };
293
300
  }
294
301
  /**
295
302
  * Whether the wallet connector should fall back to a different wallet connector
@@ -220,9 +220,7 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
220
220
  * Override key or the normalized wallet name if needed
221
221
  */
222
222
  get key(): string;
223
- get metadata(): WalletMetadata | {
224
- id: string;
225
- };
223
+ get metadata(): WalletMetadata;
226
224
  /**
227
225
  * Wallet name
228
226
  */
@@ -7,6 +7,7 @@ import { walletConnectorEvents } from '../events/walletConnectorEvents.js';
7
7
  import { logger } from '../utils/logger.js';
8
8
  import { isSameAddress } from '../utils/isSameAddress/isSameAddress.js';
9
9
  import { getMobileExperience } from '../utils/getMobileExperience/getMobileExperience.js';
10
+ import { getWalletMetadataFromWalletBook } from '../utils/getWalletMetadataFromWalletBook/getWalletMetadataFromWalletBook.js';
10
11
  import { isConnectorMethodSupported } from '../utils/isConnectorMethodSupported/isConnectorMethodSupported.js';
11
12
  import { WalletBookSingleton } from '../WalletBookSingleton/WalletBookSingleton.js';
12
13
 
@@ -281,7 +282,13 @@ class WalletConnectorBase extends EventEmitter {
281
282
  }
282
283
  get metadata() {
283
284
  var _a;
284
- return (_a = this._metadata) !== null && _a !== void 0 ? _a : { id: this.key };
285
+ if (!this._metadata) {
286
+ this._metadata = getWalletMetadataFromWalletBook({
287
+ walletBook: this.walletBook,
288
+ walletKey: this.key,
289
+ });
290
+ }
291
+ return (_a = this._metadata) !== null && _a !== void 0 ? _a : { icon: '', id: this.key, name: this.name };
285
292
  }
286
293
  /**
287
294
  * Whether the wallet connector should fall back to a different wallet connector
@@ -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' | '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'> & EventEmitter<WalletConnectorEventTypes>;
26
26
  export interface WalletConnectorConstructor {
27
27
  new (props?: any): InternalWalletConnector;
28
28
  }
package/src/types.d.ts CHANGED
@@ -30,6 +30,7 @@ export type WalletDeepLinks = {
30
30
  * @property icon - The url or data for the wallet icon
31
31
  * @property brandColor - The hex valye for the wallet brand color
32
32
  * @property groupKey - Key used to group wallets together, for example, by chain
33
+ * @property inAppBrowserUrl - The url to open the wallet in the in-app browser
33
34
  * @property deepLinks - The mobile deep links of the wallet
34
35
  * @property downloadLinks - The ids to download the wallet in the different browsers and mobile stores
35
36
  * @property walletLimitations - The limitations of the wallet in regards to methods and events
@@ -41,6 +42,7 @@ export type WalletMetadata = {
41
42
  icon: string;
42
43
  brandColor?: `#${string}`;
43
44
  groupKey?: string;
45
+ inAppBrowserUrl?: string;
44
46
  deepLinks?: WalletDeepLinks;
45
47
  downloadLinks?: WalletDownloadLinks;
46
48
  walletLimitations?: WalletLimitations;
@@ -10,12 +10,12 @@ var getDeepLinks = require('./getDeepLinks/getDeepLinks.cjs');
10
10
  var getDownloadLinks = require('./getDownloadLinks/getDownloadLinks.cjs');
11
11
  var getWalletLimitations = require('./getWalletLimitations/getWalletLimitations.cjs');
12
12
 
13
- const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBook: walletBook$1, }) => {
14
- var _a, _b, _c, _d, _e;
15
- if (!walletBook$1) {
13
+ const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBook: walletBook$1, walletFallback, }) => {
14
+ var _a, _b, _c, _d, _e, _f, _g;
15
+ if (!walletBook$1 && !walletFallback) {
16
16
  throw new Error('Wallet book is required');
17
17
  }
18
- const wallet = walletBookWallet !== null && walletBookWallet !== void 0 ? walletBookWallet : walletBook.findWalletBookWallet(walletBook$1, walletKey);
18
+ const wallet = walletBookWallet !== null && walletBookWallet !== void 0 ? walletBookWallet : walletBook.getWalletBookWallet(walletBook$1, walletKey, walletFallback);
19
19
  // if no walletBookWallet is provided and no wallet is found in the wallet book, throw an error
20
20
  if (!wallet) {
21
21
  throw new Error('Wallet not found in wallet book');
@@ -27,8 +27,9 @@ const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBo
27
27
  groupKey: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.chainGroup) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.walletGroup,
28
28
  icon: (_d = getIconUrl.getIconUrl((_c = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _c === void 0 ? void 0 : _c.spriteId)) !== null && _d !== void 0 ? _d : '',
29
29
  id: walletKey,
30
+ inAppBrowserUrl: (_f = (_e = wallet.mobile) === null || _e === void 0 ? void 0 : _e.inAppBrowser) !== null && _f !== void 0 ? _f : undefined,
30
31
  name: wallet.name,
31
- rdns: (_e = wallet.eip6963Config) === null || _e === void 0 ? void 0 : _e.rdns,
32
+ rdns: (_g = wallet.eip6963Config) === null || _g === void 0 ? void 0 : _g.rdns,
32
33
  walletLimitations: getWalletLimitations.getWalletLimitations(wallet.walletLimitations),
33
34
  };
34
35
  };
@@ -4,6 +4,7 @@ type GetWalletMetadataFromWalletBookOpts = {
4
4
  walletKey: string;
5
5
  walletBookWallet?: WalletSchema;
6
6
  walletBook?: WalletBookSchema;
7
+ walletFallback?: WalletSchema;
7
8
  };
8
- export declare const getWalletMetadataFromWalletBook: ({ walletKey, walletBookWallet, walletBook, }: GetWalletMetadataFromWalletBookOpts) => WalletMetadata;
9
+ export declare const getWalletMetadataFromWalletBook: ({ walletKey, walletBookWallet, walletBook, walletFallback, }: GetWalletMetadataFromWalletBookOpts) => WalletMetadata;
9
10
  export {};
@@ -1,17 +1,17 @@
1
1
  'use client'
2
- import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
2
+ import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
3
3
  import { getIconUrl } from './getIconUrl/getIconUrl.js';
4
4
  import { getValidHexColor } from './getValidHexColor/getValidHexColor.js';
5
5
  import { getDeepLinks } from './getDeepLinks/getDeepLinks.js';
6
6
  import { getDownloadLinks } from './getDownloadLinks/getDownloadLinks.js';
7
7
  import { getWalletLimitations } from './getWalletLimitations/getWalletLimitations.js';
8
8
 
9
- const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBook, }) => {
10
- var _a, _b, _c, _d, _e;
11
- if (!walletBook) {
9
+ const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBook, walletFallback, }) => {
10
+ var _a, _b, _c, _d, _e, _f, _g;
11
+ if (!walletBook && !walletFallback) {
12
12
  throw new Error('Wallet book is required');
13
13
  }
14
- const wallet = walletBookWallet !== null && walletBookWallet !== void 0 ? walletBookWallet : findWalletBookWallet(walletBook, walletKey);
14
+ const wallet = walletBookWallet !== null && walletBookWallet !== void 0 ? walletBookWallet : getWalletBookWallet(walletBook, walletKey, walletFallback);
15
15
  // if no walletBookWallet is provided and no wallet is found in the wallet book, throw an error
16
16
  if (!wallet) {
17
17
  throw new Error('Wallet not found in wallet book');
@@ -23,8 +23,9 @@ const getWalletMetadataFromWalletBook = ({ walletKey, walletBookWallet, walletBo
23
23
  groupKey: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.chainGroup) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.walletGroup,
24
24
  icon: (_d = getIconUrl((_c = wallet === null || wallet === void 0 ? void 0 : wallet.brand) === null || _c === void 0 ? void 0 : _c.spriteId)) !== null && _d !== void 0 ? _d : '',
25
25
  id: walletKey,
26
+ inAppBrowserUrl: (_f = (_e = wallet.mobile) === null || _e === void 0 ? void 0 : _e.inAppBrowser) !== null && _f !== void 0 ? _f : undefined,
26
27
  name: wallet.name,
27
- rdns: (_e = wallet.eip6963Config) === null || _e === void 0 ? void 0 : _e.rdns,
28
+ rdns: (_g = wallet.eip6963Config) === null || _g === void 0 ? void 0 : _g.rdns,
28
29
  walletLimitations: getWalletLimitations(wallet.walletLimitations),
29
30
  };
30
31
  };