@etherplay/connect 0.0.7 → 0.0.8

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -215,6 +215,7 @@ export function createConnection(settings) {
215
215
  }
216
216
  }
217
217
  function onAccountChanged(accounts) {
218
+ const accountsFormated = accounts.map((a) => a.toLowerCase());
218
219
  if ($connection.step === 'SignedIn' && $connection.mechanism.type === 'wallet') {
219
220
  // TODO if auto-connect and saved-signature ?
220
221
  // connect(
@@ -225,11 +226,10 @@ export function createConnection(settings) {
225
226
  // },
226
227
  // { requireUserConfirmationBeforeSIgnatureRequest: true }
227
228
  // );
228
- if (accounts.length > 0 &&
229
- accounts[0].toLowerCase() != $connection.account.address.toLowerCase()) {
229
+ if (accountsFormated.length > 0 && accountsFormated[0] != $connection.account.address) {
230
230
  set({
231
231
  ...$connection,
232
- walletAccountChanged: accounts[0]
232
+ walletAccountChanged: accountsFormated[0]
233
233
  });
234
234
  }
235
235
  else if ($connection.walletAccountChanged) {
@@ -271,6 +271,7 @@ export function createConnection(settings) {
271
271
  });
272
272
  const provider = wallet.provider;
273
273
  let accounts = await provider.request({ method: 'eth_accounts' });
274
+ accounts = accounts.map((v) => v.toLowerCase());
274
275
  if (accounts.length === 0) {
275
276
  set({
276
277
  step: 'WaitingForWalletConnection',
@@ -278,6 +279,7 @@ export function createConnection(settings) {
278
279
  wallets: $connection.wallets
279
280
  });
280
281
  accounts = await provider.request({ method: 'eth_requestAccounts' });
282
+ accounts = accounts.map((v) => v.toLowerCase());
281
283
  if (accounts.length > 0) {
282
284
  if (options?.requestSignatureRightAway) {
283
285
  watchForAccountChange(walletProvider);
@@ -478,8 +480,11 @@ export function createConnection(settings) {
478
480
  entriesToAdd.push([entry[0].slice(`renraku_`.length), entry[1]]);
479
481
  }
480
482
  }
481
- if (currentURL.searchParams.has('_d_eruda')) {
482
- entriesToAdd.push(['_d_eruda', currentURL.searchParams.get('_d_eruda') || '']);
483
+ if (currentURL.searchParams.has('eruda')) {
484
+ entriesToAdd.push(['eruda', currentURL.searchParams.get('eruda') || '']);
485
+ }
486
+ if (currentURL.searchParams.has('eruda')) {
487
+ entriesToAdd.push(['eruda', currentURL.searchParams.get('eruda') || '']);
483
488
  }
484
489
  for (const entryToAdd of entriesToAdd) {
485
490
  popupURL.searchParams.append(entryToAdd[0], entryToAdd[1]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etherplay/connect",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -52,7 +52,7 @@
52
52
  "@scure/bip32": "^1.6.2",
53
53
  "@scure/bip39": "^1.5.4",
54
54
  "zustand": "^5.0.3",
55
- "@etherplay/alchemy": "0.0.5"
55
+ "@etherplay/alchemy": "0.0.6"
56
56
  },
57
57
  "scripts": {
58
58
  "dev": "vite dev --host --port 60002",