-
Notifications
You must be signed in to change notification settings - Fork 31
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
Using @alephium/web3-wallet in react-native fails #362
Comments
@gilles-hemmerle maybe having a look at our own React Native mobile wallet will give you some help? https://github.com/alephium/alephium-frontend/tree/next/apps/mobile-wallet |
It might be that the entry points of the Related PR: #352 |
To validate this hypothesis, I would suggest @gilles-hemmerle to find the "main": "dist/src/index.js",
"browser": "dist/alephium-web3-wallet.min.js",
"exports": {
"node": "./dist/src/index.js",
"default": "./dist/alephium-web3-wallet.min.js"
}, and then launch the React Native dev server again and see if the issue persists. |
@nop33 The changes you introduced work well with our mobile wallet, right? |
I was waiting for a new web3 version to be released on npm, I havent' had the chance to update yet. Will do it later today. But based on my tests here, it works: #352 (comment) |
We have released |
Successfully tested 0.42.0 on mobile and explorer: alephium/alephium-frontend#619 |
Thanks, did you integrate the bridge in your wallet actually? |
This minimal repo is working in your end? Can I ask you which node / npm / yarn version you are using? |
@gilles-hemmerle We will test the bridge SDK tomorrow. That one might need to be updated to support |
Have you been able to test ? I'm still strugling using PrivateKeyWallet in a react native app. Plus I tried to check in your mono repo wallet, and it appears you are not using PrivateKeyWallet to create a signer from a private key (which seems the only way I could see to use the existing bridge sdk). I wanted to finalize the bridge implementation before the event this weekend but I'm strugling to implement the sdk in a react native app. |
Hey @gilles-hemmerle , thanks for the ping. Sorry that I have forgotten this due the Rhone upgrade. Let me do it right now. |
So there are 2 problems with The first one is that the name of the Webpack minified output is The second is that Webpack was not being executed so the minified file that RN expected was never there. This PR should be addressing both issues: #377 |
@gilles-hemmerle 1.0.3 should be addressing the issue you had with @alephium/web3-wallet. However, we are facing another known issue now: alephium/alephium-frontend#683 |
@gilles-hemmerle can you check if |
Yes seems to work, I'm now able to create a PrivateKeyWallet successfully, thanks! |
Context
I'm currently trying to implement the bridge in sezame wallet (react native application).
I imported wormhole-sdk and I try to use the bridge directly through the wallet.
I need to use
transferLocalTokenFromAlph
which expects a SignerProvider as a first params. So I figured out in your documentation that we can create a SignerProvider from thePrivateKeyWallet
class which is exposed in the@alephium/web3-wallet project
.Environnement
What I did
I imported the following dependencies :
However, when I want to import the PrivateKeyWallet like this :
import {PrivateKeyWallet} from '@alephium/web3-wallet';
I get the following error when running the app in a ios device
npx react-native start --reset-cache
and then executing the app :yarn ios
error: Error: While trying to resolve module
@alephium/web3-wallet
from filesezame/wallet-react-native/src/screens/bridge/bridge-screen.tsx
, the packagesezame/wallet-react-native/node_modules/@alephium/web3-wallet/package.json
was successfully found. However, this package itself specifies amain
module field that could not be resolved (sezame/wallet-react-native/node_modules/@alephium/web3-wallet/dist/alephium-web3.min.js
. Indeed, none of these files exist:Repo to desmonstrate the issue
https://github.com/gilles-hemmerle/alephium-web3-wallet-issue
Questions
transferLocalTokenFromAlph
function. The first argument requires aSignerProvider
. But if I pass aPrivateKeyWallet
, it complains : 'PrivateKeyWallet' is not assignable to the 'SignerProvider' type parameter. Howver, in the source files I seeclass PrivateKeyWallet extends SignerProviderSimple
andabstract class SignerProviderSimple extends SignerProvide
, sotransferLocalTokenFromAlph
should accept aPrivateKeyWallet
, do I have some inompatibility between the dependencies i'm using?The text was updated successfully, but these errors were encountered: