docs's People
Forkers
teamchong rawfalafel damvickky jeffreyq chrislally badboyade hassanraza02 isabella232 lolaletten compnetzero-ai frolovdev academydaoo starktayfun platformtestnet2 starkmerv kartelmaro12docs's Issues
(iOS) Getting -32603 error from Universal link authorization
Hello, I'm trying to authorize a user wallet from my app to Phanton iOS using Universal links. I managed to launch the app and I can see the authorizartion request. Although when I accept it, I'm getting
?errorCode=-32603&errorMessage=Something+went+wrong.
and according to the official docs this is an internal issue. This is my test implementation so far:
private func requestWalletAuthorization() {
guard let keypair = try? NaclBox.keyPair() else { return }
let publicKey = keypair.publicKey.map { String(format: "%02hhx", $0) }.joined()
Task {
guard var urlComponents = URLComponents(
string: "https://phantom.app/ul/v1/connect"
) else {
return
}
urlComponents.queryItems = [
URLQueryItem(
name: "app_url",
value: "https://website.com/"
),
URLQueryItem(
name: "dapp_encryption_public_key",
value: publicKey
),
URLQueryItem(
name: "redirect_link",
value: "https://website.com/"
)
]
// result: https://phantom.app/ul/v1/connect?app_url=https://website.com/&dapp_encryption_public_key=xxxxxxx&redirect_link=https://website.com/
await UIApplication.shared.open(urlComponents.url!)
}
}
You guys have any clue on what I'm doing wrong? Thank you in advance.
Is it possible to sign a message (not a transaction)
With sol-wallet-adapter
it is possible to sign a message as a proof of account ownership. This is useful for all sorts of things - a couple of projects used it for wallet verification for airdrops.
I don't see this documented anywhere for Phantom. Is this an existing feature? And if not, was it removed due to any specific reason?
solana object is not found on initial load (React)
Browser: Chrome 95.0.4638.54
Hi there!
I'm using Phantom Wallet extension in my React App. I am trying to check to see if the user has Phantom installed. If they don't send them a message saying to install it.
Currently I just check the window object directly on component mount like so:
if (window.solana) {
// Do something with solana object
} else {
// Tell user to download phantom wallet
}
A few things to note here:
- I have tried checking for the
phantom
object which is also not there - If I hard refresh the page, the
solana
object is in thewindow
object, but a quick refresh seems to not inject it again - I have added a 300ms timeout before checking for the
solana
object and it seems to work everytime!
Curious if you have come across this :)? Thanks!
Can't create new window.solana.Transaciton() through JS
I am trying to initiate a Solana transaction, using the wallet as a provider, however, it shows that the wallet itself does not have any of the constructors for creating SOL transactions, or any other constructed classes. Is this something I need to do with an external library?
Partilly Signed Transaction and signAndSendTransaction
Hi, since Phantom Labs discord doesn't give support anymore and I don'have have any reply from Phantom Support, I'll expose my issue here:
I'm creating a Transaction and then partially signed it, serialize it and send it to the frontend.
transaction.partialSign(bankKeypair)
const serializedTransaction = transaction.serialize({
requireAllSignatures: false
})
serializedTransaction.toString('base64')
When I get the Transaction in the frontend, I recover it with:
const recoveredTransaction = Transaction.from(Buffer.from(serializedTransaction, 'base64'))
If I use the deprecated function from phantom wallet signTransaction
const signedTransaction = await window.solana.signTransaction(recoveredTransaction)
const result = await connection.sendRawTransaction(signedTransaction.serialize());
Everything works just fine!
If I use the correct method from phantom wallet signAndSendTransaction
const result = await window.solana.signAndSendTransaction(recoveredTransaction)
It fails with {code: -32003, message: 'Transaction creation failed.'}
Why does it fail with signAndSendTransaction
and not with signTransaction
and sendRawTransaction
?
Thank you,
bitcoin testnet support integration
Discussed in https://github.com/orgs/phantom/discussions/144
Originally posted by ansigroup December 28, 2023
Summary
Hello,
please add bitcoin testnet support to wallet
Example
No response
Steps to Reproduce
Developer Settings: no bitcoin testnet
Phantom Version
No response
Is there an existing discussion for this?
- I have searched the existing discussions
Unrecognised token despite inclusion in token-list
My token which can be found at https://explorer.solana.com/address/BHcuncUCUxsBw1yyENizoseEAH2Qrt4UxbcukPhQEGPQ
Is clearly recognised by all Solana explorers. However, when I go to view in my phantom wallet it appears an an unrecognized token.
I'd appreciate a fix or a pointer to where I can fix this. Thanks.
Random issues appears since Tuesday
Hi!
Me and my team receives constant issues when reaching Phantom wallet through deep links. The wallet returns -32603 code with errors messages like "Missing sharing secret", "failed+to+send+transaction:+Transaction+simulation+failed:+Error+processing+Instruction+0:+incorrect+program+id+for+instruction", or "token not found"
Would be possible to check what happened in Phantom Wallet app since last update?
`signAndSendTransaction` Transaction recentBlockhash required error
import {
Connection,
LAMPORTS_PER_SOL,
PublicKey,
SystemProgram,
Transaction,
TransactionInstruction
} from "@solana/web3.js"
(async () => {
const tx = new Transaction();
const connection = await new Connection(
network("http://localhost:8899"),'confirmed'
)
const {signature} = await window.solana.signAndSendTransaction(tx);
const b = await connection.confirmTransaction(signature);
console.log(b,123)
})()
Does not work and docs and very wrong https://docs.phantom.app/integrating/sending-a-transaction
Possible collection of user data
Bug: Localhost subdomain (Eg: app.localhost:3000) doesnt mount Phantom onto window
I am trying to implement solana-labs/wallet-adapter in my latest next 13 project. I want to implement the wallet connection for my subdomain on localhost: app.localhost:3000, but the wallet adapter doesn't detect phantom wallet.
After some research i can confirm that the phantom wallet doesn't mount into the window object only when i use subdomain in localhost. it mounts normally when there is no subdomain.
Is there a fix for using subdomain in localhost development?
network and disconnect events not firing
I tried to revoke access from the extension but the disconnect
event is not firing. Also, what event to watch for when user changes network
from the extension?
Feature Request: Custom URLs
Hi @chriskalani @rawfalafel , great work on this project.
Kindly allow users to add Custom Cluster URLs i.e. HTTP://192.x.x.x:8899
etc. Much needed feature for devs, thank you.
Let me know if you need a hand.
Glitchy rendering of mp4 NFT
So far reproduced only on Chrome on Windows
2022-01-20.07-16-37.mp4
2022-01-20.07-18-56.mp4
Wallet adapter not firing event on wallet change
Phantom chrome extension: v23.19.0
Chrome (OSX) 120.0.6099.109 (Official Build) (arm64)
Hi, this was an issue that was resolved a couple of months back but seems to have crept back in recently.
When switching between Solana wallets on a connected dApp (using Solana wallet adapter), nothing happens and the old wallet stays connected.
Expected behaviour: the wallet change is picked up, so the user doesn't need to hard disconnect or refresh the page.
This is especially critical for our multi-sig locking feature in biblio.tech as users need to sign with 2 wallets, the app polls awaiting a wallet change which never fires.
Repro steps:
- visit jup.ag
- connect wallet
- switch wallet in phantom extenstion
- observe no change is picked up in the app.
Feature requests: events for `clusterChanged` and `accountsChanged`
It would be useful to be able to listen for these events in the frontend, e.g. so you can do something when someone changes their account in Phantom.
MetaMask has support for accountsChanged
https://docs.metamask.io/guide/ethereum-provider.html#events
Feature request: transfer tokens to off-curve program addresses
Please, allow transfer tokens to program derived address
Eagerly connecting from an untrusted client should return not throw
Right now his method:
window.solana.connect({ onlyIfTrusted: true });
throws a funky error that does not look to be by design:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '_bn')
It's tough to diagnose since Phantom does not seem to be open source (?), but that looks like the connect
method itself is not catching an internal async error, rather than intentionally throwing a designed error. What would be even better than throwing a designed error though, is just returning a message code to the client without throwing at all.
As it stands, if the client attempts to eagerly connect but is not yet trusted, because of that uncaught async error within the connect
method, the client cannot continue execution. So if, for example, you want to toggle a piece of client side state to indicate that an attempt was made to eagerly connect, you can't.
Calling connect({ onlyIfTrusted: true })
from an untrusted client is obviously an expected usage, so it should not result in an uncaught async error, or a designed thrown error, but simply a message code that indicates the client is not yet trusted. This would be much easier to handle from the client, and allow for better UX implementations.
Android(kotlin or Java) integration Guidence
I am bit confused to integrate SDK for android Kotlin. So, can anyone guide me for android Kotlin?
Actually, I am not femilier with react native and all the code and snippets are available in react native as per my knowledge.
So, I want to get any doc or resource for specific android kotln or java.
Ledger wallet message signing
Is there an ETA on support for message signing for ledger wallets in phantom?
Asking because support for signMessage was recently added to solana app for ledger, and one of your developers noticed it: solana-labs/solana#21366 (comment).
Open Browse Deeplink in In-App Browser on Initial Load
Hello ๐
As this is the docs site, I'm not sure if this is the correct place for this issue, so let me know if there's a better one!
I'm following the browse documentation to deeplink users into the Phantom in-app browser.
Expected Behavior
- users should be taken to the Phantom in-app browser on initial load of the Phantom app
Actual behavior
- users are not taken to the Phantom in-app browser on initial load. users have to go back to the original app, click the button again, and then the Phantom in-app browser loads
Reproduction: https://codesandbox.io/s/jovial-pascal-8gymif?file=/src/App.js
Steps to reproduce:
- Make sure the Phantom app on your phone is killed
- Open https://8gymif.csb.app/ on a mobile browser
- Click "Connect with Phantom"
- Observe the Phantom app loading, but staying on the home screen and not opening the in-app browser
- Return to https://8gymif.csb.app/
- Click "Connect with Phantom"
- Now the Phantom in-app browser loads
Please let me know if I'm missing anything to make this work as expected, thanks!
Cannot execute transfer transaction
I was trying to transfer some funds from an address to another and the transaction never succeeds
Wallet A had 21884360103 LAMPORTS
(=21.884360103 SOL
, on Phantom I see 21.88436 SOL
)
But if I try to transfer 21884310103 LAMPORTS
(=21.884310103 SOL
) to Wallet B
I get that it was unable to send the funds
It does that even with 21.88431 SOL
(so it matches the precision that Phantom uses)
![image](https://private-user-images.githubusercontent.com/51273585/272954811-0c177b5f-eeec-4678-b9e7-ab59de67d86f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDYzMzgzNjQsIm5iZiI6MTcwNjMzODA2NCwicGF0aCI6Ii81MTI3MzU4NS8yNzI5NTQ4MTEtMGMxNzdiNWYtZWVlYy00Njc4LWI5ZTctYWI1OWRlNjdkODZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAxMjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMTI3VDA2NDc0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZlMDExZTg2MzY5MGY1YjcwZTQ3ODdkMGE4OTkwZGIwNTc5YWM2Y2Y5YjllMjg4ZWI0NGUxNDc5NWY4ZWYwOTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7z6m8KQawDE6HgY1XazQyTxszMgrA5rN2i-KUH3zVcg)
TypeError: Cannot redefine property: ethereum when connecting loading page for Solana dapp when "Active Networks" is set as ALL
sendTransaction Transaction Message Mutated
How signAndSendTransaction handle partial signed signature?
From my understand when we minting we have to partial sign tx with mint_keypair
and call signAndSendTransaction
.
But when I try call it with
// Partial sign (except wallet)
let recent_blockhash = client.get_latest_blockhash().await.unwrap();
let signers: Vec<&dyn Signer> = vec![&mint_keypair];
let _result = mint_tx.try_partial_sign(&signers, recent_blockhash);
let message_data = transaction.message_data();
let transaction_bs58 = encode(&message_data).into_string();
let sign_json = json!({
"method": "signAndSendTransaction",
"params": {
"message": transaction_bs58
},
"id": 1 as u32,
"jsonrpc": "2.0"
});
Phantom - RPC Error: Signature verification failed {code: -32003, message: 'Signature verification failed'}
When signTransaction
working just fine for above tx
.
So, How signAndSendTransaction
handle partial signed signature there?
Thanks
Token balance
Hello, Is there a way to get token balance?
Verify the signed message
Could you add the documentation for the signed message verification? I really appreciate it if you can mention which algorithm you're using to sign/verify the message. By default, I thought you guys are using nacl.sign
as Solana Web3, but it seems not.
Phantom connection problem
Hey, I am using trying to connect phantom to my web app using the following function.
`
//@ts-ignore
window.solana.connect();
//@ts-ignore
window.solana.on("connect", () => {
setConnected(true);
window.location.assign("#/dashboard")
});
//@ts-ignore
window.solana.on("disconnect", () => {
setConnected(false);
});
return () => {
myWallet.disconnect();
};
}`
However, the connection is not established even though it was working before. Is there an update that occurred recently?
How to deposit MATIC to phantom wallet and get balance of it?
I would like to get Balance of MATIC on Phantom wallet.
For test, I also want to deposit MATIC to phantom wallet.
I've read docs of depositing MATIC but it doesn't work.
How can I got balance of MATIC?
Thanks.
The GLB img of a NFT is not displayed
https://solscan.io/token/4PjqXbQpzBUbiggczM2E3bEsj4cne3oHrEzDNsb4kZgN
The glb image is displayed correctly in Solscan, but it shows nothing in the wallet
iOS In-app browser does not render epub
The in-app browser does not render epubs in iOS. There are no issues with Android.
Expected behavior
- Go to the following link in iOS in-app browser and see the epub render
- https://futurepress.github.io/epubjs-reader/#epubcfi(/6/228[xchapter_108]!/4/2/2/2/1:0)
We've confirmed that the above link works and renders properly in Safari and Chrome (outside of the Phantom in-app browser).
Add popular token
The account can't be used to receive the popular SPL token, because it did not send a transaction when added a popular token from the token list.
Any idea about this? It's different from other wallets.
[Deeplinks] Feature Request - ConnectAndSignAndTransfer method
Hello, any chance we could get a provider method
for connecting & signing & sending all in 1 go without having to get redirected back ? For use cases where there's just a simple transaction needed this seems like it could simplify UX. Or maybe an option to sign & send a transaction without having to first open a session through the connect method?
Error while scanning Solana Qr Code
When I try to scan a qr code in devnet the app crashes and solana pay qr code does not works.
solana:https%3A%2F%2Fsolana-pay-ruddy.vercel.app%2Fapi%3Frecipient%3DCSab2WuFWre1FAMAFpiTsyw4mZArrqTnsd3UYPqZgiiC%26amount%3D0.2%26label%3Dtest%26memo%3Dteste%26reference%3DAAuUEgyBcJWhDHUEvizSLLRUSSdgdfAYr58rpg9stJko
User should be able to select derivation path
Connection Response from Phantom
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()}`);
}
Feature Request Official Flutter SDK
Hey guys, any plans for making Flutter SDK? Would love to get Phantom support into our mobile app! We need you all! Did you know that even WalletConnect doesn't have an official Flutter SDK?
Discord invite is invalid
Steps to reproduce:
- https://docs.phantom.app
- Click Discord
feature request - decrypt message with wallet private key
any chance you guys are going to offer decrypt message like metamask? thanks!
Iam getting issue while connecting to the wallet in ios devices same code is working in android devices.
We are trying to connect a webpage with the Mobile phone phantom wallet app, everything is working fine for Android devices
but the detection of iPhone is not working, when I am clicking on the wallet button in ios it is redirecting to the phantom webpage even though I am not getting any error message. Please help me in fixing the issue
can`t signTransaction: too long waited to approve.
In the firefox browser, the transaction is rejected due to a long wait. When this is in the console, the reason is as follows: The user rejected the transaction. This problem is only in Firefox.
below code works for other wallets in google chrome
let transaction = new Transaction().add(
new TransactionInstruction({
data: createBidInstruction(chosenSideIndex, betValue),
keys: [
{ pubkey: publicKey, isSigner: true, isWritable: true }, //from
{ pubkey: new PublicKey(bet.wallet), isSigner: false, isWritable: true }, //to
{ pubkey: SystemProgram.programId, isSigner: false, isWritable: false }
],
programId: new PublicKey('PROGRAMKEY')
})
)
transaction.feePayer = transaction.feePayer || publicKey || undefined;
transaction.recentBlockhash = transaction.recentBlockhash || (await connection.getLatestBlockhash('finalized')).blockhash;
await sendTransaction(transaction, connection)
any limit on .signAllTransactions()?
hey, would like to know if there is any limit on the number of transactions i can sign with .signAllTransactions()?
Devnet used when localhost is selected network
Have localhost selected as my network but transactions are being sent to devnet, and succeed even if the test validator is not running locally.
Interfacing with phantom via the solana wallet-adapter if that's relevant.
Do you accept contributors outside this organisation?
Cannot assign to read only property 'solana' of object '#<Window>'
Uncaught TypeError: Cannot assign to read only property 'solana' of object '#'
at Function.loadInjectObjectsOfSolana (chrome-extension://afbcbjpbpfadlkmhmclhkeeodmamcflc/inject_start.js:411)
at Pt.dispenseInjectMessage (chrome-extension://afbcbjpbpfadlkmhmclhkeeodmamcflc/inject_start.js:411)
at chrome-extension://afbcbjpbpfadlkmhmclhkeeodmamcflc/inject_start.js:411
at HTMLDocument. (chrome-extension://afbcbjpbpfadlkmhmclhkeeodmamcflc/inject_start.js:210)
The latest extension update may be causing some issues with solana injection. Any suggestion on fix?
connect method callback
Hi there,
Is there a way to know if user refuse to connect ?
var provider = window.solana
await ??? provider.connect({ onlyIfTrusted: false });
I tried this without success
var result = await window.solana.request({
method: "connect",
params: {
onlyIfTrusted: false
}
})
my console.log or console.error never fire
Thanks for your help
PHANTOM DEBUG: Sent message to extension
I am receiving this log message from Phantom extension when visiting web3 apps (e.g. Uniswap).
Log messages are flooding browser console at a rate of 100/1 minute.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.