Index of every page on this site: llms.txt
All skills
Run it yourself

Use with your agentic flow for clear dapp end-to-end tests. After you build a wallet feature — connect, transfer, swap, USDC or ERC20 deposit, contract call, signature — prove it by driving the real MetaMask or Leather extension in Playwright, then hand the reviewer video and screenshots of the actual popups and on-chain transactions.

  • 9 files
  • 65.8 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/yehia67/e2e-wallets/wallets-e2e

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesleather-stacks.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Leather and Stacks flows

Use @wallets-e2e/leather with a real source-built Leather extension. The driver implements WalletDriver<SupportedStacksNetwork> for mainnet and testnet4.

Package: https://www.npmjs.com/package/@wallets-e2e/leather Core dependency: https://www.npmjs.com/package/@wallets-e2e/core

Read setup-and-reporting.md before choosing a published Leather/core version pair. Do not substitute toolkit source for a missing public package capability.

Basic flow

import { expect } from '@playwright/test';
import {
  selectWalletInStacksConnectModal,
  waitForTransactionMined,
  TESTNET_RPC_URL,
} from '@wallets-e2e/core';
import { leatherDriver } from '@wallets-e2e/leather';
import { test } from './fixtures.js';

function required(name: string): string {
  const value = process.env[name]?.trim();
  if (!value) throw new Error(`${name} is required`);
  return value;
}

const seedPhrase = required('WALLETS_E2E_SEED_PHRASE');
const expectedMainnetAddress = required('WALLETS_E2E_MAINNET_ADDRESS');

test('connects and submits a Stacks transaction', async ({ extensionContext: context, page }) => {
  await page.goto('/');
  const account = await leatherDriver.importWallet(context, seedPhrase);
  expect(account.address).toBe(expectedMainnetAddress);

  await leatherDriver.switchNetwork?.(context, 'testnet4');
  await leatherDriver.connectToDapp(context, async () => {
    await page.getByTestId('connect-wallet').click();
    await selectWalletInStacksConnectModal(page, 'Leather');
  });

  await leatherDriver.confirmTransaction(context, async () => {
    await page.getByTestId('send-stx').click();
  });

  const txid = (await page.getByTestId('transfer-txid').innerText())
    .replace(/^txid:\s*/, '')
    .trim();
  expect(txid).toMatch(/^(?:0x)?[0-9a-f]{64}$/i);
  expect(
    await waitForTransactionMined(txid, {
      rpcUrl: TESTNET_RPC_URL,
      timeoutMs: 15 * 60_000,
    }),
  ).toBe('success');
});

@stacks/connect renders its own in-page wallet picker before Leather opens. Selecting Leather is dapp integration logic, so use selectWalletInStacksConnectModal(page, 'Leather') inside the connection trigger.

Transaction and signature behavior

Leather uses confirmTransaction for a message-signature popup, STX transfer, and contract call. Its button text changes by request type (Sign or Approve); the driver handles both.

Always select the network before a real transfer or contract call. Leather otherwise defaults to mainnet even if the dapp request describes another network, and fee estimation can fail before a popup renders.

For Stacks requests:

  • Use request('stx_signMessage', { message }); the deprecated signMessage() helper is a no-op.
  • Filter the result of connect() by symbol === 'STX'. Address array order is not guaranteed.
  • A transfer memo is a fixed 34-byte field. Longer text makes transaction construction fail before wallet approval UI appears.
  • Contract calls use stx_callContract and real ClarityValue arguments.
  • Popup closure is not mining. Poll with waitForTransactionMined; fail on abort_by_response, abort_by_post_condition, other non-success statuses, or timeout.

Leather's persisted unlocked address is normally the mainnet-form address even when the wallet later switches to testnet. Keep independently derived mainnet and testnet fixture addresses and assert the form appropriate to the API/UI being checked.

Network and timing constraints

StacksNetwork includes mainnet, testnet4, testnet3, signet, and devnet, but the current driver-supported subset is mainnet | testnet4. The word testnet in package BDD steps resolves to testnet4; unsupported real names fail clearly instead of silently mapping.

Prefer the typed switchNetwork(context, 'testnet4'), available from 0.1.4. The older switchToTestnetNetwork remains as a deprecated compatibility bridge.

Real Stacks testnet blocks can take many minutes. Size both the receipt timeout and Playwright test timeout; a 15-minute receipt poll under a 2-minute test timeout will always be killed by Playwright. Do not respond to slow blocks by removing the mined assertion.

This project uses real Stacks testnet for chain-facing acceptance tests. Do not assume a local Clarinet devnet is interchangeable without first proving its lifecycle and deployment behavior in the consuming repository.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 92caf26. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated last month

README badge

README badge for yehia67/e2e-wallets