@dynamic-labs/starknet 4.0.0-alpha.29 → 4.0.0-alpha.30

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,21 @@
1
1
 
2
+ ## [4.0.0-alpha.30](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.29...v4.0.0-alpha.30) (2024-11-13)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * check wallet limitations from metadata (#7413)
8
+
9
+ ### Bug Fixes
10
+
11
+ * confirmation ui disabled for solana signall and signTransaction ([#7403](https://github.com/dynamic-labs/dynamic-auth/issues/7403)) ([98a352a](https://github.com/dynamic-labs/dynamic-auth/commit/98a352a826202abad734f00df1b3d19080ecf1e2))
12
+ * get starknet wallets directly from window ([#7421](https://github.com/dynamic-labs/dynamic-auth/issues/7421)) ([13e24f7](https://github.com/dynamic-labs/dynamic-auth/commit/13e24f70accf7747f5137fc3f2b05c00939c3af3))
13
+ * issue with SollanaWalletConnectorWithConfig embedded wallets ([#7405](https://github.com/dynamic-labs/dynamic-auth/issues/7405)) ([f08ecd6](https://github.com/dynamic-labs/dynamic-auth/commit/f08ecd6955faf191177bb9833b7a594637a6c4cc))
14
+ * set override key in starknet injected connector ([#7420](https://github.com/dynamic-labs/dynamic-auth/issues/7420)) ([74b2887](https://github.com/dynamic-labs/dynamic-auth/commit/74b28874661b3bad1e0a0f92aa9d3c987dc71225))
15
+
16
+
17
+ * check wallet limitations from metadata ([#7413](https://github.com/dynamic-labs/dynamic-auth/issues/7413)) ([a419de6](https://github.com/dynamic-labs/dynamic-auth/commit/a419de643ea4ff240a27825c10670ba92589b71b))
18
+
2
19
  ## [4.0.0-alpha.29](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.28...v4.0.0-alpha.29) (2024-11-07)
3
20
 
4
21
  ## [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)
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.29";
6
+ var version = "4.0.0-alpha.30";
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.29";
2
+ var version = "4.0.0-alpha.30";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/starknet",
3
- "version": "4.0.0-alpha.29",
3
+ "version": "4.0.0-alpha.30",
4
4
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -18,20 +18,19 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@starknet-io/get-starknet-core": "4.0.3",
22
21
  "@starknet-io/types-js": "0.7.7",
23
22
  "starknet": "6.11.0",
24
23
  "starknetkit": "2.3.3",
25
24
  "text-encoding": "0.7.0",
26
25
  "@dynamic-labs/sdk-api-core": "0.0.563",
27
26
  "@module-federation/runtime": "0.1.18",
28
- "@dynamic-labs/assert-package-version": "4.0.0-alpha.29",
29
- "@dynamic-labs/logger": "4.0.0-alpha.29",
30
- "@dynamic-labs/rpc-providers": "4.0.0-alpha.29",
31
- "@dynamic-labs/starknet-core": "4.0.0-alpha.29",
32
- "@dynamic-labs/utils": "4.0.0-alpha.29",
33
- "@dynamic-labs/wallet-book": "4.0.0-alpha.29",
34
- "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.29",
27
+ "@dynamic-labs/assert-package-version": "4.0.0-alpha.30",
28
+ "@dynamic-labs/logger": "4.0.0-alpha.30",
29
+ "@dynamic-labs/rpc-providers": "4.0.0-alpha.30",
30
+ "@dynamic-labs/starknet-core": "4.0.0-alpha.30",
31
+ "@dynamic-labs/utils": "4.0.0-alpha.30",
32
+ "@dynamic-labs/wallet-book": "4.0.0-alpha.30",
33
+ "@dynamic-labs/wallet-connector-core": "4.0.0-alpha.30",
35
34
  "assert": "2.1.0"
36
35
  },
37
36
  "peerDependencies": {}
@@ -12,7 +12,6 @@ var constants = require('./constants.cjs');
12
12
  var ethereumContractAbi = require('./ethereumContractAbi.cjs');
13
13
  var convertors = require('./utils/convertors.cjs');
14
14
  var StarknetWallet = require('./wallet/StarknetWallet.cjs');
15
- var getAvailableWallets = require('./getAvailableWallets.cjs');
16
15
 
17
16
  class StarknetWalletConnector extends walletConnectorCore.WalletConnectorBase {
18
17
  constructor(name, id, opts) {
@@ -134,7 +133,7 @@ class StarknetWalletConnector extends walletConnectorCore.WalletConnectorBase {
134
133
  });
135
134
  }
136
135
  isInstalledOnBrowser() {
137
- return Boolean(getAvailableWallets.availableWallets.find((wallet) => wallet.id === this.id));
136
+ return Boolean(window[`starknet_${this.id}`]);
138
137
  }
139
138
  endSession() {
140
139
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -8,7 +8,6 @@ import { ETH_STARKNET_ADDRESS } from './constants.js';
8
8
  import ETH_CONTRACT_ABI from './ethereumContractAbi.js';
9
9
  import { formatTypedDataMessage } from './utils/convertors.js';
10
10
  import { StarknetWallet } from './wallet/StarknetWallet.js';
11
- import { availableWallets } from './getAvailableWallets.js';
12
11
 
13
12
  class StarknetWalletConnector extends WalletConnectorBase {
14
13
  constructor(name, id, opts) {
@@ -130,7 +129,7 @@ class StarknetWalletConnector extends WalletConnectorBase {
130
129
  });
131
130
  }
132
131
  isInstalledOnBrowser() {
133
- return Boolean(availableWallets.find((wallet) => wallet.id === this.id));
132
+ return Boolean(window[`starknet_${this.id}`]);
134
133
  }
135
134
  endSession() {
136
135
  return __awaiter(this, void 0, void 0, function* () {
package/src/index.cjs CHANGED
@@ -9,7 +9,6 @@ var argentx = require('./wallets/argent/injected/argentx.cjs');
9
9
  var argentMobile = require('./wallets/argent/argentMobile/argentMobile.cjs');
10
10
  var webwallet = require('./wallets/argent/webwallet/webwallet.cjs');
11
11
  var fetchStarknetInjectedWalletConnectors = require('./wallets/injected/fetchStarknetInjectedWalletConnectors.cjs');
12
- require('./getAvailableWallets.cjs');
13
12
  require('@dynamic-labs/starknet-core');
14
13
  var StarknetWallet = require('./wallet/StarknetWallet.cjs');
15
14
  var isStarknetWallet = require('./wallet/isStarknetWallet/isStarknetWallet.cjs');
package/src/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { WebWallet } from './wallets/argent/webwallet/webwallet';
2
2
  import type { ArgentMobileWalletConnectorType } from './wallets/argent/argentMobile/argentMobile';
3
3
  import type { WebWalletConnectorType } from './wallets/argent/webwallet/webwallet';
4
- import './getAvailableWallets';
5
4
  import '@dynamic-labs/starknet-core';
6
5
  export declare const StarknetWalletConnectors: (props: any) => (import("dist/packages/wallet-connector-core/src").WalletConnectorConstructor | typeof WebWallet)[];
7
6
  export type { StarknetWalletConnectorType } from './StarknetWalletConnector';
package/src/index.js CHANGED
@@ -5,7 +5,6 @@ import { ArgentX } from './wallets/argent/injected/argentx.js';
5
5
  import { ArgentMobile } from './wallets/argent/argentMobile/argentMobile.js';
6
6
  import { WebWallet } from './wallets/argent/webwallet/webwallet.js';
7
7
  import { fetchStarknetInjectedWalletConnectors } from './wallets/injected/fetchStarknetInjectedWalletConnectors.js';
8
- import './getAvailableWallets.js';
9
8
  import '@dynamic-labs/starknet-core';
10
9
  export { StarknetWallet } from './wallet/StarknetWallet.js';
11
10
  export { isStarknetWallet } from './wallet/isStarknetWallet/isStarknetWallet.js';
@@ -7,9 +7,12 @@ var _tslib = require('../../../_virtual/_tslib.cjs');
7
7
  var typesJs = require('@starknet-io/types-js');
8
8
  var utils = require('@dynamic-labs/utils');
9
9
  var StarknetWalletConnector = require('../../StarknetWalletConnector.cjs');
10
- var getAvailableWallets = require('../../getAvailableWallets.cjs');
11
10
 
12
11
  class Injected extends StarknetWalletConnector.StarknetWalletConnector {
12
+ constructor(name, id, props) {
13
+ super(name, id, props);
14
+ this.overrideKey = props.overrideKey;
15
+ }
13
16
  prompt(options) {
14
17
  return _tslib.__awaiter(this, void 0, void 0, function* () {
15
18
  const wallet = this.getWindowWallet();
@@ -128,8 +131,8 @@ class Injected extends StarknetWalletConnector.StarknetWalletConnector {
128
131
  });
129
132
  }
130
133
  getWindowWallet() {
131
- this.logger.debug('[getWindowWallet] Looking for wallet from get-starknet-core:', this.id);
132
- const wallet = getAvailableWallets.availableWallets.find((wallet) => wallet.id === this.id);
134
+ this.logger.debug('[getWindowWallet] Looking for wallet from window:', this.id);
135
+ const wallet = window[`starknet_${this.id}`];
133
136
  this.logger.debug('[getWindowWallet] Lookup result:', wallet);
134
137
  return wallet;
135
138
  }
@@ -1,6 +1,7 @@
1
1
  import { StarknetWalletConnector } from '../../StarknetWalletConnector';
2
2
  import { PromptOptions, PromptResult } from '../../types';
3
3
  export declare class Injected extends StarknetWalletConnector {
4
+ constructor(name: string, id: string, props: any);
4
5
  prompt(options: PromptOptions): Promise<PromptResult>;
5
6
  getAddress(): Promise<string | undefined>;
6
7
  getConnectedAccounts(): Promise<string[]>;
@@ -3,9 +3,12 @@ import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import { WALLET_API } from '@starknet-io/types-js';
4
4
  import { DynamicError, isMobile, template } from '@dynamic-labs/utils';
5
5
  import { StarknetWalletConnector } from '../../StarknetWalletConnector.js';
6
- import { availableWallets } from '../../getAvailableWallets.js';
7
6
 
8
7
  class Injected extends StarknetWalletConnector {
8
+ constructor(name, id, props) {
9
+ super(name, id, props);
10
+ this.overrideKey = props.overrideKey;
11
+ }
9
12
  prompt(options) {
10
13
  return __awaiter(this, void 0, void 0, function* () {
11
14
  const wallet = this.getWindowWallet();
@@ -124,8 +127,8 @@ class Injected extends StarknetWalletConnector {
124
127
  });
125
128
  }
126
129
  getWindowWallet() {
127
- this.logger.debug('[getWindowWallet] Looking for wallet from get-starknet-core:', this.id);
128
- const wallet = availableWallets.find((wallet) => wallet.id === this.id);
130
+ this.logger.debug('[getWindowWallet] Looking for wallet from window:', this.id);
131
+ const wallet = window[`starknet_${this.id}`];
129
132
  this.logger.debug('[getWindowWallet] Lookup result:', wallet);
130
133
  return wallet;
131
134
  }
@@ -1,27 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var starknetCore = require('@starknet-io/get-starknet-core');
7
- var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var starknetCore__default = /*#__PURE__*/_interopDefaultLegacy(starknetCore);
12
-
13
- /**
14
- * side effect. figure out a better way to do this
15
- * this is used in the `isInstalledOnBrowser` check
16
- * `availableWallets` will be asyncronously populated with starknet wallets
17
- * that are found on the `window`
18
- */
19
- exports.availableWallets = [];
20
- starknetCore__default["default"]
21
- .getAvailableWallets()
22
- .then((wallets) => {
23
- exports.availableWallets = wallets;
24
- })
25
- .catch((error) => {
26
- walletConnectorCore.logger.error('Failed to initialize Starknet wallets:', error);
27
- });
@@ -1,8 +0,0 @@
1
- import { StarknetWindowObject } from 'starknetkit';
2
- /**
3
- * side effect. figure out a better way to do this
4
- * this is used in the `isInstalledOnBrowser` check
5
- * `availableWallets` will be asyncronously populated with starknet wallets
6
- * that are found on the `window`
7
- */
8
- export declare let availableWallets: StarknetWindowObject[];
@@ -1,21 +0,0 @@
1
- 'use client'
2
- import starknetCore from '@starknet-io/get-starknet-core';
3
- import { logger } from '@dynamic-labs/wallet-connector-core';
4
-
5
- /**
6
- * side effect. figure out a better way to do this
7
- * this is used in the `isInstalledOnBrowser` check
8
- * `availableWallets` will be asyncronously populated with starknet wallets
9
- * that are found on the `window`
10
- */
11
- let availableWallets = [];
12
- starknetCore
13
- .getAvailableWallets()
14
- .then((wallets) => {
15
- availableWallets = wallets;
16
- })
17
- .catch((error) => {
18
- logger.error('Failed to initialize Starknet wallets:', error);
19
- });
20
-
21
- export { availableWallets };