Hello i Make my wallet to be recognized by the dapps under the name of phantom. When connect
request is send from the dapp i successfully initialize my public key but then dapps freezes. Example with MagicEden:
Currently my implementation looks like this :
this.window.solana = {
isPhantom: true,
isConnected: false,
publicKey: null,
connect: async () => {
const { accepted } = await this.window.providerManager.enable('solana')
const solana = this.window.providerManager.getProviderFor('SOL')
const addresses = await solana.getMethod('wallet.getAddresses')()
const [address] = addresses;
const { publicKey } = address;
console.log('wowz', address)
this.isConnected = true
this.publicKey = new PublicKey(publicKey);
},
on: async (method, payload) => {
console.log('ON Method ', method)
console.log('ON Payload ', payload)
},
accountChanged: async () => {
console.log('accountChanged')
},
off: async (method, payload) => {
console.log('OFF Method ', method)
console.log('OFF Payload ', payload)
},
disconnect: () => {
console.log('dc called')
},
}
Any idea what i'm doing wrong? I feel is like something with how i return the response to the dapp but really not sure how to do it, also other wallets are not open source and can't debug them. Please heeelp