@dynamic-labs/wallet-connector-core 2.0.0-alpha.10 → 2.0.0-alpha.12

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,43 @@
1
1
 
2
+ ## [2.0.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-03-13)
3
+
4
+
5
+ ### Features
6
+
7
+ * add sign-in with farcaster ([#4947](https://github.com/dynamic-labs/DynamicAuth/issues/4947)) ([3927d24](https://github.com/dynamic-labs/DynamicAuth/commit/3927d24392a8944997ca05431c6ab54757be62d9))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * wallet connect links with query params ([#4948](https://github.com/dynamic-labs/DynamicAuth/issues/4948)) ([0738130](https://github.com/dynamic-labs/DynamicAuth/commit/0738130f82473a197e035b8dd74d996bdbb24c11))
13
+
14
+ ## [2.0.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.10...v2.0.0-alpha.11) (2024-03-12)
15
+
16
+
17
+ ### ⚠ BREAKING CHANGES
18
+
19
+ * rename FetchPublicAddressOpts to GetAddressOpts (#4910)
20
+ * remove use effect in useWalletEventListeners (#4843)
21
+ * rename fetchPublicAddress to getAddress (#4851)
22
+
23
+ ### Features
24
+
25
+ * Add farcaster to iconic ([#4925](https://github.com/dynamic-labs/DynamicAuth/issues/4925)) ([ab282dc](https://github.com/dynamic-labs/DynamicAuth/commit/ab282dc9cdcc0fe11f014d002b056ef4d3b34234))
26
+ * use transaction confirmation ui on signAndSendTransaction for solana embedded wallets ([#4909](https://github.com/dynamic-labs/DynamicAuth/issues/4909)) ([d77e89e](https://github.com/dynamic-labs/DynamicAuth/commit/d77e89ecff9dfc67ed48537f541a9995b2662e1e))
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * add back connect button css variables ([#4922](https://github.com/dynamic-labs/DynamicAuth/issues/4922)) ([1119d62](https://github.com/dynamic-labs/DynamicAuth/commit/1119d62c2db6504952393060930524c3823e4a00))
32
+ * keep adaptive wallet list height ([#4916](https://github.com/dynamic-labs/DynamicAuth/issues/4916)) ([62aa54e](https://github.com/dynamic-labs/DynamicAuth/commit/62aa54e81d563082f7aa519f2ff2b5132e7dd83d))
33
+ * pass account and chain to walletClient ([#4865](https://github.com/dynamic-labs/DynamicAuth/issues/4865)) ([17a143f](https://github.com/dynamic-labs/DynamicAuth/commit/17a143f87a77e56227b2517038c20cf67f8e08bf))
34
+ * update walletbook to fix zerion in-app browser detection issue ([#4917](https://github.com/dynamic-labs/DynamicAuth/issues/4917)) ([48b05d7](https://github.com/dynamic-labs/DynamicAuth/commit/48b05d78e4f7add09787b64505723d4eca34d3e0))
35
+
36
+
37
+ * remove use effect in useWalletEventListeners ([#4843](https://github.com/dynamic-labs/DynamicAuth/issues/4843)) ([2e948bb](https://github.com/dynamic-labs/DynamicAuth/commit/2e948bbca0dbdceab7460a844d0988eacd47f581))
38
+ * rename fetchPublicAddress to getAddress ([#4851](https://github.com/dynamic-labs/DynamicAuth/issues/4851)) ([668e7dd](https://github.com/dynamic-labs/DynamicAuth/commit/668e7dd62e1f323dbe64209b5c59c2cd0ee45d61))
39
+ * rename FetchPublicAddressOpts to GetAddressOpts ([#4910](https://github.com/dynamic-labs/DynamicAuth/issues/4910)) ([e5e4b1b](https://github.com/dynamic-labs/DynamicAuth/commit/e5e4b1b08a4e010afa44f8abb0bf6af7f236a86a))
40
+
2
41
  ## [2.0.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.9...v2.0.0-alpha.10) (2024-03-08)
3
42
 
4
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-connector-core",
3
- "version": "2.0.0-alpha.10",
3
+ "version": "2.0.0-alpha.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,14 +26,14 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/sdk-api": "0.0.376"
29
+ "@dynamic-labs/sdk-api": "0.0.387"
30
30
  },
31
31
  "peerDependencies": {
32
- "@dynamic-labs/logger": "2.0.0-alpha.10",
33
- "@dynamic-labs/rpc-providers": "2.0.0-alpha.10",
34
- "@dynamic-labs/types": "2.0.0-alpha.10",
35
- "@dynamic-labs/utils": "2.0.0-alpha.10",
36
- "@dynamic-labs/wallet-book": "2.0.0-alpha.10",
32
+ "@dynamic-labs/logger": "2.0.0-alpha.12",
33
+ "@dynamic-labs/rpc-providers": "2.0.0-alpha.12",
34
+ "@dynamic-labs/types": "2.0.0-alpha.12",
35
+ "@dynamic-labs/utils": "2.0.0-alpha.12",
36
+ "@dynamic-labs/wallet-book": "2.0.0-alpha.12",
37
37
  "eventemitter3": "5.0.1"
38
38
  }
39
39
  }
@@ -159,7 +159,7 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
159
159
  }
160
160
  connect() {
161
161
  return _tslib.__awaiter(this, void 0, void 0, function* () {
162
- yield this.fetchPublicAddress();
162
+ yield this.getAddress();
163
163
  });
164
164
  }
165
165
  /**
@@ -177,7 +177,7 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
177
177
  *
178
178
  * @default Promise<undefined>
179
179
  */
180
- fetchPublicAddress(opts) {
180
+ getAddress(opts) {
181
181
  return Promise.resolve(undefined);
182
182
  }
183
183
  /**
@@ -242,7 +242,7 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
242
242
  getSigner() {
243
243
  return Promise.resolve(undefined);
244
244
  }
245
- getWalletClient() {
245
+ getWalletClient(chainId) {
246
246
  return undefined;
247
247
  }
248
248
  /**
@@ -16,7 +16,7 @@ export type PayloadParams = {
16
16
  message: string;
17
17
  }[];
18
18
  };
19
- export type FetchPublicAddressOpts = {
19
+ export type GetAddressOpts = {
20
20
  chainId?: string;
21
21
  onConnect?(payload: PayloadParams): void;
22
22
  onDesktopUri?(uri: string): void;
@@ -117,7 +117,7 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
117
117
  *
118
118
  * @default Promise<undefined>
119
119
  */
120
- fetchPublicAddress(opts?: FetchPublicAddressOpts): Promise<string | undefined>;
120
+ getAddress(opts?: GetAddressOpts): Promise<string | undefined>;
121
121
  /**
122
122
  * Gets the additional addresses of the wallet, given the main address
123
123
  *
@@ -175,8 +175,8 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
175
175
  * Get the wallet provider
176
176
  */
177
177
  getWeb3Provider: {
178
- (): unknown;
179
- <T>(): T;
178
+ (chainId?: string): unknown;
179
+ <T>(chainId?: string): T;
180
180
  };
181
181
  /**
182
182
  * @deprecated getRpcProvider has been renamed to getPublicClient
@@ -207,8 +207,8 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
207
207
  *
208
208
  * @default undefined
209
209
  */
210
- getWalletClient(): unknown;
211
- getWalletClient<T>(): T;
210
+ getWalletClient(chainId?: string): unknown;
211
+ getWalletClient<T>(chainId?: string): T;
212
212
  /**
213
213
  * Initialize the wallet connector with any async operations
214
214
  *
@@ -151,7 +151,7 @@ class WalletConnectorBase extends EventEmitter {
151
151
  }
152
152
  connect() {
153
153
  return __awaiter(this, void 0, void 0, function* () {
154
- yield this.fetchPublicAddress();
154
+ yield this.getAddress();
155
155
  });
156
156
  }
157
157
  /**
@@ -169,7 +169,7 @@ class WalletConnectorBase extends EventEmitter {
169
169
  *
170
170
  * @default Promise<undefined>
171
171
  */
172
- fetchPublicAddress(opts) {
172
+ getAddress(opts) {
173
173
  return Promise.resolve(undefined);
174
174
  }
175
175
  /**
@@ -234,7 +234,7 @@ class WalletConnectorBase extends EventEmitter {
234
234
  getSigner() {
235
235
  return Promise.resolve(undefined);
236
236
  }
237
- getWalletClient() {
237
+ getWalletClient(chainId) {
238
238
  return undefined;
239
239
  }
240
240
  /**
@@ -1,4 +1,4 @@
1
1
  import type { WalletSchema } from '@dynamic-labs/wallet-book';
2
- import type { FetchPublicAddressOpts } from '../../lib';
2
+ import type { GetAddressOpts } from '../../lib';
3
3
  import { DeepLinkVariant } from './walletConnectDeepLinks';
4
- export declare const performPlatformSpecificConnectionMethod: (uri: string, metadata: WalletSchema, opts: Pick<FetchPublicAddressOpts, 'onDesktopUri' | 'onDisplayUri'>, preference: DeepLinkVariant) => void;
4
+ export declare const performPlatformSpecificConnectionMethod: (uri: string, metadata: WalletSchema, opts: Pick<GetAddressOpts, 'onDesktopUri' | 'onDisplayUri'>, preference: DeepLinkVariant) => void;
@@ -11,7 +11,14 @@ const getConnectionDeepLink = (uri, metadata, preference) => {
11
11
  return uri;
12
12
  }
13
13
  const deepLink = getRegularDeepLink(uri, metadata, preference);
14
- return `${deepLink}?uri=${encodeURIComponent(uri)}`;
14
+ if (!deepLink) {
15
+ return `${deepLink}?uri=${encodeURIComponent(uri)}`;
16
+ }
17
+ const deepLinkUrl = new URL(deepLink);
18
+ const deepLinkParams = new URLSearchParams(deepLinkUrl.search);
19
+ deepLinkParams.set('uri', uri);
20
+ deepLinkUrl.search = deepLinkParams.toString();
21
+ return deepLinkUrl.toString();
15
22
  };
16
23
  const getRegularDeepLink = (uri, metadata, preference) => {
17
24
  var _a, _b, _c, _d;
@@ -7,7 +7,14 @@ const getConnectionDeepLink = (uri, metadata, preference) => {
7
7
  return uri;
8
8
  }
9
9
  const deepLink = getRegularDeepLink(uri, metadata, preference);
10
- return `${deepLink}?uri=${encodeURIComponent(uri)}`;
10
+ if (!deepLink) {
11
+ return `${deepLink}?uri=${encodeURIComponent(uri)}`;
12
+ }
13
+ const deepLinkUrl = new URL(deepLink);
14
+ const deepLinkParams = new URLSearchParams(deepLinkUrl.search);
15
+ deepLinkParams.set('uri', uri);
16
+ deepLinkUrl.search = deepLinkParams.toString();
17
+ return deepLinkUrl.toString();
11
18
  };
12
19
  const getRegularDeepLink = (uri, metadata, preference) => {
13
20
  var _a, _b, _c, _d;