Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignAndSendTransaction not working on Phantom #86

Closed
haykgalstyan opened this issue Jan 19, 2025 · 10 comments · Fixed by #87
Closed

SignAndSendTransaction not working on Phantom #86

haykgalstyan opened this issue Jan 19, 2025 · 10 comments · Fixed by #87

Comments

@haykgalstyan
Copy link

haykgalstyan commented Jan 19, 2025

Hello!
I'm not sure if this is an unimplemented feature or a bug, but as mentioned in the title, calling appKitModal.request(...) with solana_signAndSendTransaction method is throwing an exception with Phantom.
Following the stack trace took me to this piece of code in PhantomService class.

try {
  late final Uri requestUri;
  switch (request.method) {
    case 'solana_signMessage':
      requestUri = _phantomHelper.buildSignMessageUri(
        message: request.params['message'],
      );
    case 'solana_signTransaction':
      requestUri = _phantomHelper.buildSignTransactionUri(
        transaction: request.params['transaction'],
      );
    default:
      throw ThirdPartyWalletException('${request.method} unimplemented');
  }

But I also found a buildSignAndSendTransactionUri method in PhantomHelper class.

So I'm not sure if this was not used because it did not work, or if this is planned for the future.
I'd at least like to know if this is planned in upcoming releases or if I should look for other solutions...

Copy link

linear bot commented Jan 19, 2025

@haykgalstyan
Copy link
Author

By the way, I was also not able to call solana_signTransaction request successfully, a working Solana request example in the docs would be really helpful.

@quetool
Copy link
Member

quetool commented Jan 19, 2025

I'll check tomorrow. Thanks!

@quetool
Copy link
Member

quetool commented Jan 20, 2025

Hello @haykgalstyan! I just pushed version 1.4.0-beta02 with the fix for this.

Also, regarding examples, since the constructions of Solana transactions would depend on the library you choose we can not really add them in the docs, however you can see a couple of example here, using solana_web3 package https://github.com/reown-com/reown_flutter/blob/develop/packages/reown_appkit/example/base/lib/utils/crypto/helpers.dart#L170

Again, thank you so much for reporting!

@quetool
Copy link
Member

quetool commented Jan 20, 2025

By the way, solana methods with phantom only work on mainnet, sadly they seems to have issues when using testnet or devnet. I have already reached out to them for guidance.

@haykgalstyan
Copy link
Author

You are so fast! :D Thanks a lot for a quick fix!

@haykgalstyan
Copy link
Author

Is there any hope we would have Solflare wallet for solana? I have tried the solana_mobile_client for flutter and it worked for android both mainnet and devnet. But it's clunky providing UX for both Reown's modal and other wallets separately. @quetool

@haykgalstyan
Copy link
Author

When I saw that Phantom wallet is a service implementation, it came to my mind that maybe there could be Solflare version in the future?

@quetool
Copy link
Member

quetool commented Jan 20, 2025

About Solflare: We have de-listed it from mobile options because they don't support WalletConnect protocol and, unlike Phantom and Coinbase (which they don't support WC protocol either), they don't provide either any kind of API/SDK (which Phantom and Coinbase does).

Basically we are not the one that supports a wallet, it's rather the wallet that supports WalletConnect protocol and since we support WalletConntect protocol by default, those wallets are already supported from AppKit.
If we find a wallet that doesn't support WalletConnect protocol but provides any sorts of mechanism to connect we try our best to include it in AppKit

About solana_mobile_client I never used it, I only tried solana_web3 for our basic use case and seems to work pretty well. Maybe in the future we could evaluate integrate solana API directly inside AppKit but I don't think it's on the table for now.

I am not an expert in Solana but feel free to open help requests if you ever feel stuck with this packages although it's always better to directly reach out to developers.

@haykgalstyan
Copy link
Author

Understood, thanks for all the details and clearing things up, this is very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants