Skip to content

DynamicHookComponent does use the connected wallet #6

@chaincrucial

Description

@chaincrucial

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.

  1. Create 2 testing wallets, 1 in lace and 1 in eternl.
  2. Enable Dapp for wallet in eternl
  3. run npm run dev for next-app-route.
  4. Open Localhost:3000
    1. Connect Lace, approve Dapp (, and disconnect
    2. Connect Eternel, approve Dapp and disconnect
  5. Fund the lace wallet with 10,000 tADA from the faucet.
  6. Send 1000 tADA to the eternl wallet.
  7. Open localhost:3000, open the developer console
    1. Connect Lace wallet (with 10k tADA balance)
    2. 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

  1. The DynamicHook should access the connected wallet, regardless of which wallet the user connected.
  2. The balance displayed should be for the connected wallet and not potentially access a different wallet that also approved a Dapp connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions