@dynamic-labs/starknet 2.0.0-alpha.2 → 2.0.0-alpha.4

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,39 @@
1
1
 
2
+ ## [2.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2024-02-22)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * remove wallet connector from callback types (#4730)
8
+ * drop support for walletconnect v1 (#4666)
9
+
10
+ ### Features
11
+
12
+ * add coin98 evm ([1d64f5f](https://github.com/dynamic-labs/DynamicAuth/commit/1d64f5f00885ff671358651fd0251b77a2e05739))
13
+ * add support for solana versioned transactions ([#4721](https://github.com/dynamic-labs/DynamicAuth/issues/4721)) ([25b1643](https://github.com/dynamic-labs/DynamicAuth/commit/25b1643f8addbada09fff5d22e988bdf22038170))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * allow rpc-providers package to use exports based on usage ([#4539](https://github.com/dynamic-labs/DynamicAuth/issues/4539)) ([abdc196](https://github.com/dynamic-labs/DynamicAuth/commit/abdc19641580cbcfe8f9e357c645f8291bc9ed66))
19
+ * coinbasesocial should display coinbase in profile linking section ([#4680](https://github.com/dynamic-labs/DynamicAuth/issues/4680)) ([21cbe2e](https://github.com/dynamic-labs/DynamicAuth/commit/21cbe2e24345a33bc927428c01cc7b5c724e40e5))
20
+ * improve on transaction confirmation step ([#4704](https://github.com/dynamic-labs/DynamicAuth/issues/4704)) ([f2b27cf](https://github.com/dynamic-labs/DynamicAuth/commit/f2b27cfd94452be2eb7e88a298f61ef56985931f))
21
+ * prevent the DynamicMultiWalletPromptsWidget from opening if useris not logged in ([#4701](https://github.com/dynamic-labs/DynamicAuth/issues/4701)) ([2bb35fd](https://github.com/dynamic-labs/DynamicAuth/commit/2bb35fd29b60677e893390f7d47857cd76c73adc))
22
+ * reduce isPreauthorized calls when starknet wallet is connected ([#4710](https://github.com/dynamic-labs/DynamicAuth/issues/4710)) ([ca6a630](https://github.com/dynamic-labs/DynamicAuth/commit/ca6a630dd47a1c116afcd63fe7256ffc745532ab))
23
+ * update sepolia currency symbol ([#4728](https://github.com/dynamic-labs/DynamicAuth/issues/4728)) ([3c228a0](https://github.com/dynamic-labs/DynamicAuth/commit/3c228a03ccc962374ad1dac3ab45af92732ba61a))
24
+ * use overflow clip when available, use hidden by default ([#4696](https://github.com/dynamic-labs/DynamicAuth/issues/4696)) ([29fb2a1](https://github.com/dynamic-labs/DynamicAuth/commit/29fb2a1e48b010c6c1d525403fbdcf7ded068466))
25
+
26
+
27
+ * drop support for walletconnect v1 ([#4666](https://github.com/dynamic-labs/DynamicAuth/issues/4666)) ([4af93e4](https://github.com/dynamic-labs/DynamicAuth/commit/4af93e4f9b95fa4c49bbfda0c1144da1a4a43991))
28
+ * remove wallet connector from callback types ([#4730](https://github.com/dynamic-labs/DynamicAuth/issues/4730)) ([08cb200](https://github.com/dynamic-labs/DynamicAuth/commit/08cb200a09c0fd78d2093d1a60b17089b3b2c2b1))
29
+
30
+ ## [2.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-02-13)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * allow any icon to be used in wallet list tabs ([#4678](https://github.com/dynamic-labs/DynamicAuth/issues/4678)) ([eb03603](https://github.com/dynamic-labs/DynamicAuth/commit/eb036031725a91cb28c144b3bdcb5b20b3314038))
36
+
2
37
  ## [2.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-02-13)
3
38
 
4
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/starknet",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -30,12 +30,12 @@
30
30
  "get-starknet-core": "^3.2.0",
31
31
  "text-encoding": "0.7.0",
32
32
  "starknetkit": "1.1.3",
33
- "@dynamic-labs/sdk-api": "0.0.363",
34
- "@dynamic-labs/rpc-providers": "2.0.0-alpha.2",
35
- "@dynamic-labs/types": "2.0.0-alpha.2",
36
- "@dynamic-labs/utils": "2.0.0-alpha.2",
37
- "@dynamic-labs/wallet-book": "2.0.0-alpha.2",
38
- "@dynamic-labs/wallet-connector-core": "2.0.0-alpha.2"
33
+ "@dynamic-labs/sdk-api": "0.0.373",
34
+ "@dynamic-labs/rpc-provider-starknet": "2.0.0-alpha.4",
35
+ "@dynamic-labs/types": "2.0.0-alpha.4",
36
+ "@dynamic-labs/utils": "2.0.0-alpha.4",
37
+ "@dynamic-labs/wallet-book": "2.0.0-alpha.4",
38
+ "@dynamic-labs/wallet-connector-core": "2.0.0-alpha.4"
39
39
  },
40
40
  "peerDependencies": {}
41
41
  }
@@ -7,7 +7,7 @@ var getStarknetCore = require('get-starknet-core');
7
7
  var starknet = require('starknet');
8
8
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
9
  var utils = require('@dynamic-labs/utils');
10
- var rpcProviders = require('@dynamic-labs/rpc-providers');
10
+ var rpcProviderStarknet = require('@dynamic-labs/rpc-provider-starknet');
11
11
  var constants = require('./constants.cjs');
12
12
  var ethereumContractAbi = require('./ethereumContractAbi.cjs');
13
13
  var convertors = require('./utils/convertors.cjs');
@@ -26,7 +26,7 @@ class StarknetWalletConnector extends walletConnectorCore.WalletConnectorBase {
26
26
  this.windowKey = windowKey;
27
27
  this.starknetNetworks = opts.starknetNetworks;
28
28
  this.chainRpcProviders = opts.chainRpcProviders;
29
- (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerChainProviders(rpcProviders.ProviderChain.STARKNET, (config) => {
29
+ (_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerChainProviders(rpcProviderStarknet.ProviderChain.STARKNET, (config) => {
30
30
  const rpcProviders = {};
31
31
  if (config === null || config === void 0 ? void 0 : config.starknet) {
32
32
  const networks = config.starknet;
@@ -97,8 +97,10 @@ class StarknetWalletConnector extends walletConnectorCore.WalletConnectorBase {
97
97
  fetchPublicAddress() {
98
98
  return _tslib.__awaiter(this, void 0, void 0, function* () {
99
99
  const wallet = this.getWallet();
100
- yield (wallet === null || wallet === void 0 ? void 0 : wallet.isPreauthorized());
101
- yield this.connect();
100
+ if (wallet && !(wallet === null || wallet === void 0 ? void 0 : wallet.isConnected)) {
101
+ yield (wallet === null || wallet === void 0 ? void 0 : wallet.isPreauthorized());
102
+ yield this.connect();
103
+ }
102
104
  return Promise.resolve(wallet === null || wallet === void 0 ? void 0 : wallet.selectedAddress);
103
105
  });
104
106
  }
@@ -3,8 +3,8 @@ import { ProviderInterface, constants, AccountInterface, RpcProvider } from 'sta
3
3
  import { Chain, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
4
4
  import { NetworkConfiguration } from '@dynamic-labs/sdk-api';
5
5
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
6
- import { ChainRpcProviders, StarknetRpcProvider } from '@dynamic-labs/rpc-providers';
7
6
  import { GenericNetwork } from '@dynamic-labs/types';
7
+ import { IChainRpcProviders, StarknetRpcProvider } from '@dynamic-labs/rpc-provider-starknet';
8
8
  import { StarknetWalletKey } from './types';
9
9
  type AccountChangeEventHandler = (address: {
10
10
  toString(): string;
@@ -25,7 +25,7 @@ declare abstract class StarknetWalletConnector extends WalletConnectorBase {
25
25
  switchNetworkOnlyFromWallet: boolean;
26
26
  starknetNetworks: NetworkConfiguration[];
27
27
  constructor(name: string, windowKey: StarknetWalletKey, opts: {
28
- chainRpcProviders: typeof ChainRpcProviders;
28
+ chainRpcProviders: IChainRpcProviders;
29
29
  starknetNetworks: NetworkConfiguration[];
30
30
  walletBook: WalletBookSchema;
31
31
  });
@@ -3,7 +3,7 @@ import { getStarknet } from 'get-starknet-core';
3
3
  import { RpcProvider, Contract, cairo, constants } from 'starknet';
4
4
  import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
5
5
  import { DynamicError, retryableFn } from '@dynamic-labs/utils';
6
- import { ProviderChain } from '@dynamic-labs/rpc-providers';
6
+ import { ProviderChain } from '@dynamic-labs/rpc-provider-starknet';
7
7
  import { ETH_STARKNET_ADDRESS } from './constants.js';
8
8
  import ETH_CONTRACT_ABI from './ethereumContractAbi.js';
9
9
  import { formatTypedDataMessage } from './utils/convertors.js';
@@ -93,8 +93,10 @@ class StarknetWalletConnector extends WalletConnectorBase {
93
93
  fetchPublicAddress() {
94
94
  return __awaiter(this, void 0, void 0, function* () {
95
95
  const wallet = this.getWallet();
96
- yield (wallet === null || wallet === void 0 ? void 0 : wallet.isPreauthorized());
97
- yield this.connect();
96
+ if (wallet && !(wallet === null || wallet === void 0 ? void 0 : wallet.isConnected)) {
97
+ yield (wallet === null || wallet === void 0 ? void 0 : wallet.isPreauthorized());
98
+ yield this.connect();
99
+ }
98
100
  return Promise.resolve(wallet === null || wallet === void 0 ? void 0 : wallet.selectedAddress);
99
101
  });
100
102
  }