@dynamic-labs/multi-wallet 0.17.0-RC.16 → 0.17.0-RC.18

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,41 @@
1
1
 
2
+ ## [0.17.0-RC.18](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.17...v0.17.0-RC.18) (2023-05-19)
3
+
4
+
5
+ ### Features
6
+
7
+ * add getReferencedAccount ([#2141](https://github.com/dynamic-labs/DynamicAuth/issues/2141)) ([ac170a6](https://github.com/dynamic-labs/DynamicAuth/commit/ac170a6dfac25ff9911feb390495974aa5dbede6))
8
+ * add reconnectSocialWallet ([#2142](https://github.com/dynamic-labs/DynamicAuth/issues/2142)) ([fefd759](https://github.com/dynamic-labs/DynamicAuth/commit/fefd759b816b286dd8a7673cf6c839fee59768ac))
9
+ * **DYN-2220:** add Transaction Successfully Sent view ([#2134](https://github.com/dynamic-labs/DynamicAuth/issues/2134)) ([7db96ad](https://github.com/dynamic-labs/DynamicAuth/commit/7db96adcd3b84aef29fbabe40a1e048ea629d2bb))
10
+ * **MagicSocialWalletConnector:** store public address from redirect result in local storage ([#2139](https://github.com/dynamic-labs/DynamicAuth/issues/2139)) ([90b60e4](https://github.com/dynamic-labs/DynamicAuth/commit/90b60e485a53ff29a0e52ef27a58383771490974))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * issue when linking from detect_new_wallet ([#2148](https://github.com/dynamic-labs/DynamicAuth/issues/2148)) ([98feb7b](https://github.com/dynamic-labs/DynamicAuth/commit/98feb7bde081a8107577ac7ec70d0f9c4b611a2b))
16
+ * multi-wallet flows ([#2150](https://github.com/dynamic-labs/DynamicAuth/issues/2150)) ([c82ef4a](https://github.com/dynamic-labs/DynamicAuth/commit/c82ef4a5cc75c9f8edb30620e32dd64bbdb0eb7f))
17
+ * starknet getConnectedAccounts should return an empty array if there's no address to return ([#2140](https://github.com/dynamic-labs/DynamicAuth/issues/2140)) ([ce39641](https://github.com/dynamic-labs/DynamicAuth/commit/ce39641a6dbec1d05d8d5cc611a02de8bd756351))
18
+
19
+ ## [0.17.0-RC.17](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.16...v0.17.0-RC.17) (2023-05-17)
20
+
21
+
22
+ ### Features
23
+
24
+ * distinguish walletconnect deeplink types ([#2093](https://github.com/dynamic-labs/DynamicAuth/issues/2093)) ([dcd29f7](https://github.com/dynamic-labs/DynamicAuth/commit/dcd29f7cfc5e6481aaaae502b3fc4e4d225f1fc1))
25
+ * **social:** pass did token to verify request ([#2124](https://github.com/dynamic-labs/DynamicAuth/issues/2124)) ([60d73a5](https://github.com/dynamic-labs/DynamicAuth/commit/60d73a5f432d488979f33fe29666d1afa8fc0e8e))
26
+ * support optional priority and stalltimeout for customer provided rpc urls ([#2091](https://github.com/dynamic-labs/DynamicAuth/issues/2091)) ([eebacda](https://github.com/dynamic-labs/DynamicAuth/commit/eebacda6a9d6ba583eff4e4e5a38eb9945c4825e))
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * add and remove event listeners for Solflare ([#2127](https://github.com/dynamic-labs/DynamicAuth/issues/2127)) ([978c7ba](https://github.com/dynamic-labs/DynamicAuth/commit/978c7ba0e3745e26d9dfc9b7c46a24adc913f02f))
32
+ * get publicKey from provider if no address and publicKey are returned on connect ([#2126](https://github.com/dynamic-labs/DynamicAuth/issues/2126)) ([c9c9b2a](https://github.com/dynamic-labs/DynamicAuth/commit/c9c9b2af81f660aa651fc4b0e01cd3c823bb0229))
33
+ * remove detect known secondary wallet modal ([#2117](https://github.com/dynamic-labs/DynamicAuth/issues/2117)) ([0e8bbd8](https://github.com/dynamic-labs/DynamicAuth/commit/0e8bbd8c385fe528a7af3ccc037812df9d6e0c84))
34
+ * revert changes for select wallet to work with solflare ([#2120](https://github.com/dynamic-labs/DynamicAuth/issues/2120)) ([76cf228](https://github.com/dynamic-labs/DynamicAuth/commit/76cf228c495d6592da4c88b8a0d5a5fc480861ae))
35
+ * setIsVerifying to false when selecting a connector ([#2133](https://github.com/dynamic-labs/DynamicAuth/issues/2133)) ([8ddeba3](https://github.com/dynamic-labs/DynamicAuth/commit/8ddeba377f35dfb4a104cd6bd7ee6315d574710f))
36
+ * setPrimaryWallet and useSyncPrimaryWallet updates ([#2128](https://github.com/dynamic-labs/DynamicAuth/issues/2128)) ([fb47b17](https://github.com/dynamic-labs/DynamicAuth/commit/fb47b17ddc7f41c29f140a1a85a1e47dbf017fff))
37
+ * update text color and add close button on extension not installed prompt ([#2122](https://github.com/dynamic-labs/DynamicAuth/issues/2122)) ([b4848a0](https://github.com/dynamic-labs/DynamicAuth/commit/b4848a0a8094b4ceac67e2667d277a9aa5e2e137))
38
+
2
39
  ## [0.17.0-RC.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.15...v0.17.0-RC.16) (2023-05-15)
3
40
 
4
41
 
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@dynamic-labs/multi-wallet",
3
- "version": "0.17.0-RC.16",
3
+ "version": "0.17.0-RC.18",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
7
7
  "directory": "packages/multi-wallet"
8
8
  },
9
9
  "dependencies": {
10
- "@dynamic-labs/sdk-api": "0.0.192",
10
+ "@dynamic-labs/sdk-api": "0.0.198",
11
11
  "@dynamic-labs/wallet-book": "^0.0.15",
12
12
  "ethers": "^5.7.2",
13
13
  "tslib": "^2.4.1",
14
- "@dynamic-labs/rpc-providers": "0.17.0-RC.16",
15
- "@dynamic-labs/types": "0.17.0-RC.16",
16
- "@dynamic-labs/utils": "0.17.0-RC.16",
17
- "@dynamic-labs/wallet-connector-core": "0.17.0-RC.16"
14
+ "@dynamic-labs/rpc-providers": "0.17.0-RC.18",
15
+ "@dynamic-labs/types": "0.17.0-RC.18",
16
+ "@dynamic-labs/utils": "0.17.0-RC.18",
17
+ "@dynamic-labs/wallet-connector-core": "0.17.0-RC.18"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@walletconnect/types": "^2.2.1"
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tslib = require('tslib');
6
5
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
7
6
  var walletBook = require('@dynamic-labs/wallet-book');
8
7
  var utils = require('@dynamic-labs/utils');
@@ -10,8 +9,8 @@ var getApiProviders = require('./utils/getApiProviders.cjs');
10
9
 
11
10
  let wallets = [];
12
11
  const defaultWalletUiUtils = {
13
- enableInternalSign: () => {
14
- throw Error('enableInternalSign, not implemented');
12
+ disabledConfirmationOnce: () => {
13
+ throw Error('disabledConfirmationOnce, not implemented');
15
14
  },
16
15
  sendTransaction: () => {
17
16
  throw Error('requestSendTransactionConfirmation not implemented');
@@ -20,7 +19,7 @@ const defaultWalletUiUtils = {
20
19
  throw Error('signMessage not implemented');
21
20
  },
22
21
  };
23
- const getSupportedWallets = (args) => tslib.__awaiter(void 0, void 0, void 0, function* () {
22
+ const getSupportedWallets = (args) => {
24
23
  const { appLogoUrl = '', appName = '', chainRpcProviders, flowNetwork, isWalletConnectV2Enabled = false, networkConfigurations = { cosmos: [], evm: [], solana: [], starknet: [] }, customerApiProviders = [], skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, } = args;
25
24
  if (!skipMemo && wallets.length > 0) {
26
25
  return wallets;
@@ -46,12 +45,11 @@ const getSupportedWallets = (args) => tslib.__awaiter(void 0, void 0, void 0, fu
46
45
  .map((walletConnector) => walletConnector(opts))
47
46
  .flat()
48
47
  .map((wallet) => new wallet(opts).getMobileOrInstalledWallet());
49
- yield Promise.all(allWallets.map((wallet) => { var _a; return (_a = wallet.init) === null || _a === void 0 ? void 0 : _a.call(wallet); }));
50
48
  // Memoize the wallets
51
49
  const filteredWallets = filterWalletsForPlatform(allWallets);
52
50
  wallets = applyLinksOverrides(filteredWallets);
53
51
  return wallets;
54
- });
52
+ };
55
53
  const applyLinksOverrides = (wallets) => wallets.map((wallet) => {
56
54
  const metadata = walletBook.getWalletBookWallet(wallet.name);
57
55
  if (metadata.switchNetworkOnlyFromWallet !== undefined) {
@@ -136,13 +134,13 @@ const getSupportedChainsForWalletConnector = (walletConnector) => {
136
134
  });
137
135
  return [...chainSet];
138
136
  };
139
- const getEnabledWallets = (props) => tslib.__awaiter(void 0, void 0, void 0, function* () {
140
- const supportedWallets = yield getSupportedWallets(props.getSupportedWalletOpts);
137
+ const getEnabledWallets = (props) => {
138
+ const supportedWallets = getSupportedWallets(props.getSupportedWalletOpts);
141
139
  const allEnabledWallets = supportedWallets.filter((wallet) => (props.enabledChains.some((chain) => getSupportedChainsForWalletConnector(wallet).includes(chain)) &&
142
140
  wallet.isInstalledOnBrowser() === props.installed) ||
143
141
  wallet.key === 'magiclink');
144
142
  return allEnabledWallets;
145
- });
143
+ };
146
144
 
147
145
  exports.getEnabledWallets = getEnabledWallets;
148
146
  exports.getSupportedChainsForWalletConnector = getSupportedChainsForWalletConnector;
@@ -6,4 +6,4 @@ export declare const getEnabledWallets: (props: {
6
6
  enabledChains: Chain[];
7
7
  getSupportedWalletOpts: GetSupportedWalletsOpts;
8
8
  installed: boolean;
9
- }) => Promise<WalletConnector[]>;
9
+ }) => WalletConnector[];
@@ -1,4 +1,3 @@
1
- import { __awaiter } from 'tslib';
2
1
  import { isEmailWalletConnector } from '@dynamic-labs/wallet-connector-core';
3
2
  import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
4
3
  import { isMobile, isIPad, isIPhone } from '@dynamic-labs/utils';
@@ -6,8 +5,8 @@ import { getApiProviders } from './utils/getApiProviders.js';
6
5
 
7
6
  let wallets = [];
8
7
  const defaultWalletUiUtils = {
9
- enableInternalSign: () => {
10
- throw Error('enableInternalSign, not implemented');
8
+ disabledConfirmationOnce: () => {
9
+ throw Error('disabledConfirmationOnce, not implemented');
11
10
  },
12
11
  sendTransaction: () => {
13
12
  throw Error('requestSendTransactionConfirmation not implemented');
@@ -16,7 +15,7 @@ const defaultWalletUiUtils = {
16
15
  throw Error('signMessage not implemented');
17
16
  },
18
17
  };
19
- const getSupportedWallets = (args) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const getSupportedWallets = (args) => {
20
19
  const { appLogoUrl = '', appName = '', chainRpcProviders, flowNetwork, isWalletConnectV2Enabled = false, networkConfigurations = { cosmos: [], evm: [], solana: [], starknet: [] }, customerApiProviders = [], skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, } = args;
21
20
  if (!skipMemo && wallets.length > 0) {
22
21
  return wallets;
@@ -42,12 +41,11 @@ const getSupportedWallets = (args) => __awaiter(void 0, void 0, void 0, function
42
41
  .map((walletConnector) => walletConnector(opts))
43
42
  .flat()
44
43
  .map((wallet) => new wallet(opts).getMobileOrInstalledWallet());
45
- yield Promise.all(allWallets.map((wallet) => { var _a; return (_a = wallet.init) === null || _a === void 0 ? void 0 : _a.call(wallet); }));
46
44
  // Memoize the wallets
47
45
  const filteredWallets = filterWalletsForPlatform(allWallets);
48
46
  wallets = applyLinksOverrides(filteredWallets);
49
47
  return wallets;
50
- });
48
+ };
51
49
  const applyLinksOverrides = (wallets) => wallets.map((wallet) => {
52
50
  const metadata = getWalletBookWallet(wallet.name);
53
51
  if (metadata.switchNetworkOnlyFromWallet !== undefined) {
@@ -132,12 +130,12 @@ const getSupportedChainsForWalletConnector = (walletConnector) => {
132
130
  });
133
131
  return [...chainSet];
134
132
  };
135
- const getEnabledWallets = (props) => __awaiter(void 0, void 0, void 0, function* () {
136
- const supportedWallets = yield getSupportedWallets(props.getSupportedWalletOpts);
133
+ const getEnabledWallets = (props) => {
134
+ const supportedWallets = getSupportedWallets(props.getSupportedWalletOpts);
137
135
  const allEnabledWallets = supportedWallets.filter((wallet) => (props.enabledChains.some((chain) => getSupportedChainsForWalletConnector(wallet).includes(chain)) &&
138
136
  wallet.isInstalledOnBrowser() === props.installed) ||
139
137
  wallet.key === 'magiclink');
140
138
  return allEnabledWallets;
141
- });
139
+ };
142
140
 
143
141
  export { getEnabledWallets, getSupportedChainsForWalletConnector, getSupportedWallets };
package/src/types.d.ts CHANGED
@@ -15,7 +15,7 @@ export type GetSupportedWalletsOpts = {
15
15
  walletConnectorsProp: WalletConnectorsMethod[];
16
16
  walletUiUtils?: WalletUiUtils;
17
17
  };
18
- export type GetSupportedWallets = (opts: GetSupportedWalletsOpts) => Promise<WalletConnector[]>;
18
+ export type GetSupportedWallets = (opts: GetSupportedWalletsOpts) => WalletConnector[];
19
19
  export type ChainInfo = {
20
20
  blockchainName: string;
21
21
  displayName: string;