|
setUseCustomHook(() => useWallet); |
|
const wallet = await BrowserWallet.enable('eternl'); |
|
const balance = await wallet.getBalance(); |
|
console.log("balance",balance); |
The dynamic hook is hardcoded to use eternl and does not show how to hook to a connected wallet.
Reproduction Steps
If there is no eternl wallet w/ approved Dapp it is easy to overlook in the developer console. The reproduction steps could be much shorter, but to demonstrate fully I have described the testing environment I used which made this quite apparent.
- Create 2 testing wallets, 1 in lace and 1 in eternl.
- Enable Dapp for wallet in eternl
- run
npm run dev for next-app-route.
- Open Localhost:3000
- Connect Lace, approve Dapp (, and disconnect
- Connect Eternel, approve Dapp and disconnect
- Fund the lace wallet with 10,000 tADA from the faucet.
- Send 1000 tADA to the eternl wallet.
- Open localhost:3000, open the developer console
- Connect Lace wallet (with 10k tADA balance)
- Observe dynamic hoook print the balance of 1000 tADA from the eternl wallet, instead of the 8999 tADA of the connected Lace wallets balance.
Expected Behavior
- The DynamicHook should access the connected wallet, regardless of which wallet the user connected.
- The balance displayed should be for the connected wallet and not potentially access a different wallet that also approved a Dapp connection.
examples/next-app-route/app/_components/dinamycHook.tsx
Lines 14 to 17 in 314fab5
The dynamic hook is hardcoded to use eternl and does not show how to hook to a connected wallet.
Reproduction Steps
If there is no eternl wallet w/ approved Dapp it is easy to overlook in the developer console. The reproduction steps could be much shorter, but to demonstrate fully I have described the testing environment I used which made this quite apparent.
npm run devfor next-app-route.Expected Behavior