PhantomConnect constructor

PhantomConnect({
  1. required String appUrl,
  2. required String deepLink,
})

We need to provide appUrl and deepLink as parameters to create new PhantomConnect object.

  • appUrl is used to fetch app metadata (i.e. title, icon) using the same properties found in Displaying Your App.
  • deepLink uri is used to open the app from Phantom Wallet i.e our app's deeplink.
  • Also here we generate a new dAppPublicKey and _dAppSecretKey Keypair for encryption and decryption
  • These are unique for each session and destroyed after the session is over.
  • dAppPublicKey and _dAppSecretKey Keypair for encryption and decryption

Implementation

PhantomConnect({required this.appUrl, required this.deepLink}) {
  _dAppSecretKey = PrivateKey.generate();
  dAppPublicKey = _dAppSecretKey.publicKey;
}