-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: implement Ethereum, Polygon and Bitcoin with phantom #677
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
} | ||
|
||
public async pairDevice(): Promise<PhantomHDWallet | undefined> { | ||
const evmProvider = window.phantom?.ethereum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: checkIsMetaMaskImpersonator
will fail in web, which we may or may not have to accommodate: https://github.com/MetaMask/detect-provider/blob/4b85b3445c746b40d4a52a5679dfe357f29238c4/src/detect-ethereum-provider.ts#L31 (notably, handleSend
and useStakingAction
use it for MM with snaps detection
Issue
gomes notes:
Two spotted issues with Phantom:
window.ethereum.request()
calls in console https://github.com/orgs/phantom/discussions/294neo notes:
First of all, I was thinking that the concept was pretty similar to metamask with snap at some point, so I started from this package.
The EVM part is following the EIP-1193 standard as stated in https://docs.phantom.app/ethereum-and-polygon/getting-started , so the implementation is very similar to any wallets as MetaMask.
Providers
Phantom as multiple providers, this is kinda why I had to store them all in memory, to communicate with the bitcoin part, we need to use the bitcoin provider. We only have a single provider for every EVM supporteds.
BTC TX
Phantom require to build the TX using PSBT, the logic is kinda like Native