@dynamic-labs/ethereum 2.1.0-alpha.16 → 2.1.0-alpha.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,13 @@
1
1
 
2
+ ## [2.1.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.17...v2.1.0-alpha.18) (2024-05-15)
3
+
4
+ ## [2.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.16...v2.1.0-alpha.17) (2024-05-15)
5
+
6
+
7
+ ### Features
8
+
9
+ * add coinbaseWalletPreference prop ([#5607](https://github.com/dynamic-labs/DynamicAuth/issues/5607)) ([1ac3b2c](https://github.com/dynamic-labs/DynamicAuth/commit/1ac3b2ce7abb136465f4aa88b045dfb70d99aad7))
10
+
2
11
  ## [2.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.15...v2.1.0-alpha.16) (2024-05-14)
3
12
 
4
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "2.1.0-alpha.16",
3
+ "version": "2.1.0-alpha.18",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -27,17 +27,17 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@dynamic-labs/sdk-api-core": "0.0.433",
30
- "@coinbase/wallet-sdk": "4.0.0-beta.12",
30
+ "@coinbase/wallet-sdk": "4.0.0-beta.14",
31
31
  "@walletconnect/ethereum-provider": "2.11.2",
32
32
  "eventemitter3": "5.0.1",
33
33
  "buffer": "6.0.3",
34
- "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.16",
35
- "@dynamic-labs/turnkey": "2.1.0-alpha.16",
36
- "@dynamic-labs/types": "2.1.0-alpha.16",
37
- "@dynamic-labs/utils": "2.1.0-alpha.16",
38
- "@dynamic-labs/viem-utils": "2.1.0-alpha.16",
39
- "@dynamic-labs/wallet-book": "2.1.0-alpha.16",
40
- "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.16",
34
+ "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.18",
35
+ "@dynamic-labs/turnkey": "2.1.0-alpha.18",
36
+ "@dynamic-labs/types": "2.1.0-alpha.18",
37
+ "@dynamic-labs/utils": "2.1.0-alpha.18",
38
+ "@dynamic-labs/viem-utils": "2.1.0-alpha.18",
39
+ "@dynamic-labs/wallet-book": "2.1.0-alpha.18",
40
+ "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.18",
41
41
  "stream": "0.0.2"
42
42
  },
43
43
  "peerDependencies": {
@@ -11,7 +11,7 @@ var helpers = require('./helpers.cjs');
11
11
 
12
12
  class Coinbase extends EthWalletConnector.EthWalletConnector {
13
13
  constructor(_a) {
14
- var { appName, appLogoUrl, evmNetworks } = _a, props = _tslib.__rest(_a, ["appName", "appLogoUrl", "evmNetworks"]);
14
+ var { appName, appLogoUrl, evmNetworks, coinbaseWalletPreference } = _a, props = _tslib.__rest(_a, ["appName", "appLogoUrl", "evmNetworks", "coinbaseWalletPreference"]);
15
15
  super(Object.assign({ evmNetworks }, props));
16
16
  this.name = 'Coinbase';
17
17
  this.overrideKey = 'coinbase';
@@ -24,6 +24,7 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
24
24
  appLogoUrl: appLogoUrl,
25
25
  appName: appName,
26
26
  evmNetworks: evmNetworks,
27
+ walletPreference: coinbaseWalletPreference,
27
28
  },
28
29
  });
29
30
  }
@@ -9,7 +9,7 @@ export declare class Coinbase extends EthWalletConnector {
9
9
  canConnectViaQrCode: boolean;
10
10
  canConnectViaCustodialService: boolean;
11
11
  private coinbaseProvider;
12
- constructor({ appName, appLogoUrl, evmNetworks, ...props }: CoinbaseOpts);
12
+ constructor({ appName, appLogoUrl, evmNetworks, coinbaseWalletPreference, ...props }: CoinbaseOpts);
13
13
  getAddress(): Promise<string | undefined>;
14
14
  signMessage(messageToSign: string): Promise<string | undefined>;
15
15
  setupEventListeners(): void;
@@ -7,7 +7,7 @@ import { getCoinbaseProvider } from './helpers.js';
7
7
 
8
8
  class Coinbase extends EthWalletConnector {
9
9
  constructor(_a) {
10
- var { appName, appLogoUrl, evmNetworks } = _a, props = __rest(_a, ["appName", "appLogoUrl", "evmNetworks"]);
10
+ var { appName, appLogoUrl, evmNetworks, coinbaseWalletPreference } = _a, props = __rest(_a, ["appName", "appLogoUrl", "evmNetworks", "coinbaseWalletPreference"]);
11
11
  super(Object.assign({ evmNetworks }, props));
12
12
  this.name = 'Coinbase';
13
13
  this.overrideKey = 'coinbase';
@@ -20,6 +20,7 @@ class Coinbase extends EthWalletConnector {
20
20
  appLogoUrl: appLogoUrl,
21
21
  appName: appName,
22
22
  evmNetworks: evmNetworks,
23
+ walletPreference: coinbaseWalletPreference,
23
24
  },
24
25
  });
25
26
  }
@@ -8,7 +8,7 @@ var walletSdk = require('@coinbase/wallet-sdk');
8
8
  // storing a reference to the coinbase provider because the provider methods work better when
9
9
  // they are called on the same instance
10
10
  let coinbaseProvider;
11
- const getCoinbaseProvider = ({ opts: { appLogoUrl, appName } = {}, }) => {
11
+ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName, walletPreference } = {}, }) => {
12
12
  if (!coinbaseProvider) {
13
13
  const coinbaseSdk = new walletSdk.CoinbaseWalletSDK({
14
14
  appChainIds: [
@@ -20,7 +20,7 @@ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName } = {}, }) => {
20
20
  appName,
21
21
  });
22
22
  coinbaseProvider = coinbaseSdk.makeWeb3Provider({
23
- options: 'all',
23
+ options: walletPreference !== null && walletPreference !== void 0 ? walletPreference : 'all',
24
24
  });
25
25
  }
26
26
  return coinbaseProvider;
@@ -4,7 +4,7 @@ import { CoinbaseWalletSDK } from '@coinbase/wallet-sdk';
4
4
  // storing a reference to the coinbase provider because the provider methods work better when
5
5
  // they are called on the same instance
6
6
  let coinbaseProvider;
7
- const getCoinbaseProvider = ({ opts: { appLogoUrl, appName } = {}, }) => {
7
+ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName, walletPreference } = {}, }) => {
8
8
  if (!coinbaseProvider) {
9
9
  const coinbaseSdk = new CoinbaseWalletSDK({
10
10
  appChainIds: [
@@ -16,7 +16,7 @@ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName } = {}, }) => {
16
16
  appName,
17
17
  });
18
18
  coinbaseProvider = coinbaseSdk.makeWeb3Provider({
19
- options: 'all',
19
+ options: walletPreference !== null && walletPreference !== void 0 ? walletPreference : 'all',
20
20
  });
21
21
  }
22
22
  return coinbaseProvider;
@@ -1,10 +1,11 @@
1
1
  import { type ProviderInterface } from '@coinbase/wallet-sdk';
2
- import { type GenericNetwork } from '@dynamic-labs/types';
2
+ import { type CoinbaseWalletPreference, type GenericNetwork } from '@dynamic-labs/types';
3
3
  import { type EthWalletConnectorOpts } from '../EthWalletConnector';
4
4
  export type GetCoinbaseProviderOpts = {
5
5
  appLogoUrl?: string;
6
6
  appName?: string;
7
7
  evmNetworks?: GenericNetwork[];
8
+ walletPreference?: CoinbaseWalletPreference;
8
9
  };
9
10
  export type CoinbaseProviderHandlerOpts = {
10
11
  onDisconnect(): Promise<void>;
@@ -16,4 +17,5 @@ export type GetCoinbaseProvider = (args: {
16
17
  export type CoinbaseOpts = EthWalletConnectorOpts & {
17
18
  appLogoUrl?: string;
18
19
  appName?: string;
20
+ coinbaseWalletPreference?: CoinbaseWalletPreference;
19
21
  };