phantom / docs

31 stars 17 forks source link

Connection Response from Phantom #41

Closed baileyalo closed 8 months ago

baileyalo commented 1 year ago

No response from Phantom after connect

// Handle a `connect` response from Phantom
if (/onConnect/.test(url.pathname)) {
  const sharedSecretDapp = nacl.box.before(
    bs58.decode(params.get('phantom_encryption_public_key')!),
    dappKeyPair.secretKey,
  );
  const connectData = decryptPayload(
    params.get('data')!,
    params.get('nonce')!,
    sharedSecretDapp,
  );
  setSharedSecret(sharedSecretDapp);
  setSession(connectData.session);
  setPhantomWalletPublicKey(new PublicKey(connectData.public_key));
  console.log(`connected to ${connectData.public_key.toString()}`);
}
lempiy commented 1 year ago

I confirm that. It was broken in latest release of Phantom app. It worked in previous version.

lempiy commented 1 year ago

Android ✅ old v 22.10.3 🔻 new v 22.10.24 (121)

iOS ✅ v 22.10.24 (1)

skmanish commented 1 year ago

I am seeing similar issue with connect deeplink in android (flutter).

Few days ago, the connect API was working as intended, but now it throws an error that the message is malformed:

E/flutter ( 3290): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: The message is forged or malformed or the shared secret is invalid E/flutter ( 3290): #0 TweetNaCl.crypto_secretbox_open package:pinenacl/…/tweetnacl/tweetnacl.dart:662 E/flutter ( 3290): #1 TweetNaCl.crypto_box_open_afternm package:pinenacl/…/tweetnacl/tweetnacl.dart:1439 E/flutter ( 3290): #2 BoxBase.decrypt package:pinenacl/api/authenticated_encryption.dart:30

Any ETA on when this will be fixed?

Timadigwe commented 1 year ago

Is there any update on this , im having this same issue

skmanish commented 1 year ago

It is fixed by phantom team. Please update phantom to 22.10.31 or beyond

baileyalo commented 1 year ago

@skmanish I tried in my react-native app still not getting a response from phantom am running version 22.10.31(123) android

Timadigwe commented 1 year ago

Same here it doesn't even redirect back to my app , after upgrading my phantom app. Can someone help out please Your suggestions would be highly appreciated