Skip to content

feat!: pnpm migration#7410

Merged
paulbalaji merged 44 commits into
mainfrom
pbio-cursor/investigate-pnpm-package-manager-migration-2193
Dec 15, 2025
Merged

feat!: pnpm migration#7410
paulbalaji merged 44 commits into
mainfrom
pbio-cursor/investigate-pnpm-package-manager-migration-2193

Conversation

@paulbalaji
Copy link
Copy Markdown
Collaborator

@paulbalaji paulbalaji commented Nov 19, 2025

Description

Migrate package manager from Yarn 4.x (Berry) to pnpm 10.x.

Design docs:

Changes:

  • Update packageManager to pnpm@10.25.0
  • Add pnpm-workspace.yaml for workspace configuration
  • Convert resolutions to pnpm.overrides
  • Convert yarn patches to pnpm.patchedDependencies format
  • Update all scripts that reference yarn to use pnpm
  • Create .github/actions/pnpm-cache action for CI caching
  • Update CI workflows to use pnpm (pnpm/action-setup@v4, pnpm store caching)
  • Update GitHub Actions to latest versions (checkout@v6, setup-node@v6)
  • Update READMEs and developer guides with pnpm commands
  • Remove yarn files (.yarn/, .yarnrc.yml, yarn.lock)
  • Add pnpm-lock.yaml

Drive-by changes

  • Minor typing refinements and config cleanups

Related issues

Backward compatibility

Yes - no runtime changes, only build tooling migration.

Testing

  • pnpm install succeeds
  • pnpm build succeeds
  • pnpm test passes
  • pnpm lint passes
  • CI workflows pass

Summary by CodeRabbit

  • New Features

    • Added support for pnpm monorepo workspace configuration.
    • Enhanced Docker build process with pnpm integration and registry support.
  • Chores

    • Migrated package manager from Yarn to pnpm across the entire project.
    • Updated all build scripts, CLI commands, and CI/CD workflows to use pnpm.
    • Updated documentation and installation instructions to reflect pnpm usage.
    • Upgraded GitHub Actions to latest versions.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 19, 2025

⚠️ No Changeset found

Latest commit: e5016c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread package.json Outdated
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Nov 19, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​types/​json-stable-stringify@​1.0.36 ⏵ 1.2.010010039 -4550 -30100
Updatednpm/​@​nomiclabs/​hardhat-etherscan@​3.1.0 ⏵ 3.1.899100100 +150 -27100
Updatednpm/​@​types/​prompts@​2.4.0 ⏵ 2.4.910010070 +180 +3100
Updatednpm/​@​types/​express@​4.17.21 ⏵ 5.0.5100 +11007191100
Updatednpm/​@​types/​express@​4.17.21 ⏵ 4.17.251001007191100
Updatednpm/​@​typescript-eslint/​parser@​8.16.0 ⏵ 8.47.010010071 +198100
Updatednpm/​solidity-bytes-utils@​0.8.2 ⏵ 0.8.473 +41009381 +3100
Updatednpm/​@​solana/​wallet-adapter-react-ui@​0.9.35 ⏵ 0.9.39100 +110073 +183 +2100
Updatednpm/​typescript-eslint@​8.37.0 ⏵ 8.47.0100 +110074 +198 +1100
Updatednpm/​@​types/​ws@​8.5.13 ⏵ 8.18.1100 +110074 +182100
Updatednpm/​@​chain-registry/​types@​0.50.13 ⏵ 0.50.25899 -110074 +398 +1100
Updatednpm/​@​types/​chai-as-promised@​8.0.0 ⏵ 8.0.2100 +110074 +381 -5100
Updatednpm/​@​types/​yargs@​17.0.32 ⏵ 17.0.35100 +110075 +190100
Updatednpm/​@​cloudflare/​vitest-pool-workers@​0.4.28 ⏵ 0.4.319910076 +1100 +1100
Updatednpm/​@​types/​react-dom@​18.3.0 ⏵ 18.3.7100 +110076 +190100
Updatednpm/​@​turnkey/​solana@​1.1.12 ⏵ 1.1.13991007698100
Updatednpm/​@​types/​sinon@​10.0.11 ⏵ 17.0.4100 +11007687100
Updatednpm/​@​types/​mocha@​10.0.5 ⏵ 10.0.1010010077 +180100
Updatednpm/​wagmi@​2.12.32 ⏵ 2.19.4100 +110078 +298 +1100
Updatednpm/​@​arbitrum/​sdk@​4.0.1 ⏵ 4.0.499 +110078 -2287 +1100
Updatednpm/​@​starknet-react/​chains@​3.1.2 ⏵ 3.1.384 +310078 +286 -7100
Updatednpm/​@​ethersproject/​hardware-wallets@​5.7.0 ⏵ 5.8.0891007981100
Updatednpm/​@​types/​react@​18.3.3 ⏵ 18.3.27100 +110079 +195100
Updatednpm/​@​wagmi/​core@​2.14.6 ⏵ 2.22.1100 +110079 +295 -1100
Updatednpm/​hardhat-ignore-warnings@​0.2.11 ⏵ 0.2.1290 +110095 +180100
Updatednpm/​@​typescript-eslint/​eslint-plugin@​8.16.0 ⏵ 8.47.099 +110080 +198100
Updatednpm/​@​ethersproject/​experimental@​5.7.0 ⏵ 5.8.0991009481100
Updatednpm/​@​types/​node@​18.19.129 ⏵ 18.19.13010010081 +196 +1100
Updatednpm/​@​cosmos-kit/​react@​2.20.1 ⏵ 2.22.781 +210092 +593100
Updatednpm/​@​interchain-ui/​react@​1.26.1 ⏵ 1.26.381 +110098 +286100
Updatednpm/​@​types/​cors@​2.8.18 ⏵ 2.8.191001009181100
Updatednpm/​hardhat-gas-reporter@​1.0.9 ⏵ 1.0.1099 +1100100 +181100
See 61 more rows in the dashboard

View full report

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
typescript/cli/src/tests/ethereum/core/core-check.e2e-test.ts (1)

34-39: pnpm CLI invocation looks good; consider reusing shared helper for consistency

Aye, this swap to pnpm --filter @hyperlane-xyz/cli run hyperlane core check fits the new toolchain just fine for this “missing --chain” error path, and the .nothrow() usage still makes sense for the assertion that follows.

Only thing I’d watch is keeping this in step with the rest of the swamp: if other CLI tests now go through a shared helper (like localTestRunCmdPrefix or similar), it might be worth routing this one through the same path so future changes to the pnpm invocation don’t drift here unnoticed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a75c8ae and e78c1d3.

📒 Files selected for processing (2)
  • typescript/cli/src/tests/cosmosnative/core/core-check.e2e-test.ts (1 hunks)
  • typescript/cli/src/tests/ethereum/core/core-check.e2e-test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • typescript/cli/src/tests/cosmosnative/core/core-check.e2e-test.ts
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/mainnet_config.json in future code reviews as requested by paulbalaji.
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/testnet_config.json in future code reviews as requested by paulbalaji.
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: Apply `yarn prettier` for code formatting across all workspaces
📚 Learning: 2025-11-24T17:19:38.362Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: Run all tests using `yarn test` for unified testing; use workspace-specific commands for targeted testing (Hardhat, Forge for Solidity; Unit tests for TypeScript; Cargo for Rust)

Applied to files:

  • typescript/cli/src/tests/ethereum/core/core-check.e2e-test.ts
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.

Applied to files:

  • typescript/cli/src/tests/ethereum/core/core-check.e2e-test.ts
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.

Applied to files:

  • typescript/cli/src/tests/ethereum/core/core-check.e2e-test.ts
📚 Learning: 2025-08-26T13:46:37.695Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/testnet_config.json in future code reviews as requested by paulbalaji.

Applied to files:

  • typescript/cli/src/tests/ethereum/core/core-check.e2e-test.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (72)
  • GitHub Check: coverage-run
  • GitHub Check: cli-evm-e2e-matrix (warp-check-3)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-4)
  • GitHub Check: cli-evm-e2e-matrix (warp-init)
  • GitHub Check: cli-evm-e2e-matrix (core-check)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
  • GitHub Check: cli-evm-e2e-matrix (core-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
  • GitHub Check: cli-evm-e2e-matrix (warp-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-send)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-5)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
  • GitHub Check: cli-evm-e2e-matrix (relay)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
  • GitHub Check: cli-evm-e2e-matrix (core-deploy)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
  • GitHub Check: cli-evm-e2e-matrix (core-apply)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
  • GitHub Check: cli-evm-e2e-matrix (core-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
  • GitHub Check: env-test-matrix (testnet4, sepolia, core)
  • GitHub Check: env-test-matrix (mainnet3, optimism, igp)
  • GitHub Check: env-test-matrix (mainnet3, optimism, core)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, core)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-radix-e2e-matrix (warp-deploy)
  • GitHub Check: cli-radix-e2e-matrix (core-deploy)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-read)
  • GitHub Check: cli-radix-e2e-matrix (core-apply)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
  • GitHub Check: aleo-sdk-e2e-run
  • GitHub Check: cli-cosmos-e2e-matrix (core-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (core-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
  • GitHub Check: cli-cosmos-e2e-matrix (core-check)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
  • GitHub Check: cosmos-sdk-e2e-run
  • GitHub Check: cli-install-test-run
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
  • GitHub Check: pnpm-test-run
  • GitHub Check: infra-test
  • GitHub Check: e2e-matrix (starknet)
  • GitHub Check: e2e-matrix (sealevel)
  • GitHub Check: e2e-matrix (cosmwasm)
  • GitHub Check: pnpm-install
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: e2e-matrix (radix)
  • GitHub Check: e2e-matrix (cosmosnative)
  • GitHub Check: agent-configs (mainnet3)
  • GitHub Check: agent-configs (testnet4)
  • GitHub Check: lint-prettier
  • GitHub Check: build-and-push-to-gcr
  • GitHub Check: fork-tests
  • GitHub Check: slither
  • GitHub Check: diff-check
  • GitHub Check: test-rs
  • GitHub Check: lander-coverage
  • GitHub Check: lint-rs
  • GitHub Check: diff-check

…upport

The previous fix moved the requiresKey check too early, before AltVM providers
were set up. This broke non-sign commands (like 'core read') that still need
AltVM providers but don't need signers.

The check now correctly returns early AFTER setting up AltVM providers but
BEFORE signer setup, matching the original behavior.
The test iterates over ~133 warp IDs, each making a network request to the
GitHub registry. The default 2000ms timeout was insufficient, causing
consistent CI failures.
@paulbalaji
Copy link
Copy Markdown
Collaborator Author

@paulbalaji paulbalaji force-pushed the pbio-cursor/investigate-pnpm-package-manager-migration-2193 branch from 96a5f05 to 12f6846 Compare December 11, 2025 19:14
@paulbalaji paulbalaji requested review from Xaroz, ltyu and xeno097 December 11, 2025 19:27
Copy link
Copy Markdown
Contributor

@antigremlin antigremlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's getting better all the time

The build:zk script exists in solidity/package.json but was being called
from root in npm-beta-release.yml workflow. With pnpm, root scripts don't
automatically find workspace scripts.

- Add build:zk to turbo.json tasks (depends on build)
- Add build:zk script to root package.json delegating to turbo

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@hyper-gonk
Copy link
Copy Markdown
Contributor

hyper-gonk Bot commented Dec 12, 2025

🐳 Monorepo Docker Image Built Successfully

Image Tags:

gcr.io/abacus-labs-dev/hyperlane-monorepo:pr-7410
gcr.io/abacus-labs-dev/hyperlane-monorepo:e5016c3-20251212-171401

@hyper-gonk
Copy link
Copy Markdown
Contributor

hyper-gonk Bot commented Dec 12, 2025

🦀 Rust Agent Docker Image Built Successfully

Image Tags:

gcr.io/abacus-labs-dev/hyperlane-agent:pr-7410
gcr.io/abacus-labs-dev/hyperlane-agent:e5016c3-20251212-171400

@paulbalaji paulbalaji mentioned this pull request Dec 12, 2025
2 tasks
github-merge-queue Bot pushed a commit to hyperlane-xyz/hyperlane-warp-ui-template that referenced this pull request Dec 15, 2025
## Summary

Migrate package manager from Yarn 4.x (Berry) to pnpm 10.x, following
the patterns established in the monorepo migration
([hyperlane-monorepo#7410](hyperlane-xyz/hyperlane-monorepo#7410)).

**Changes:**
- Update `packageManager` to pnpm@10.25.0
- Convert `resolutions` to `pnpm.overrides`
- Convert yarn patches to `pnpm.patchedDependencies` format
- Pin dependency versions to match yarn.lock (pnpm re-resolves `^`
ranges to latest):
  - `@cosmos-kit/react`: 2.18.0
  - `@solana/wallet-adapter-wallets`: 0.19.16
  - `@rainbow-me/rainbowkit`: 2.2.0
- Add phantom dependencies required by pnpm strict dependency isolation
- Update CI workflows to use pnpm (pnpm/action-setup@v4, pnpm store
caching)
- Update GitHub Actions to latest versions (checkout@v6, setup-node@v6)
- Update vercel.json to use pnpm@10.25.0
- Update README with pnpm commands
- Remove yarn files (.yarn/, .yarnrc.yml, yarn.lock)
- Add pnpm-lock.yaml

## Test plan

- [x] `pnpm install` succeeds
- [x] `pnpm typecheck` passes
- [x] `pnpm build` succeeds
- [x] `pnpm lint` passes
- [x] CI workflows pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added support for Solana wallet integrations, Sentry error monitoring,
and additional Chakra UI packages.

* **Chores**
* Migrated project tooling, package manager metadata, and CI workflows
from Yarn to pnpm; updated GitHub Actions and dev tooling versions.
* Upgraded and added multiple dependencies and devDependencies; replaced
resolution/patch approach with pnpm-compatible overrides.

* **Documentation**
  * Updated CLI/README commands and ignore lists to reflect pnpm usage.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@paulbalaji paulbalaji enabled auto-merge December 15, 2025 15:21
@paulbalaji paulbalaji added this pull request to the merge queue Dec 15, 2025
Merged via the queue into main with commit f9f300d Dec 15, 2025
102 checks passed
@paulbalaji paulbalaji deleted the pbio-cursor/investigate-pnpm-package-manager-migration-2193 branch December 15, 2025 15:33
@github-project-automation github-project-automation Bot moved this from In Review to Done in Hyperlane Tasks Dec 15, 2025
raihannismara pushed a commit to d3labs-io/hyperlane-warp-ui-template that referenced this pull request Mar 23, 2026
Migrate package manager from Yarn 4.x (Berry) to pnpm 10.x, following
the patterns established in the monorepo migration
([hyperlane-monorepo#7410](hyperlane-xyz/hyperlane-monorepo#7410)).

**Changes:**
- Update `packageManager` to pnpm@10.25.0
- Convert `resolutions` to `pnpm.overrides`
- Convert yarn patches to `pnpm.patchedDependencies` format
- Pin dependency versions to match yarn.lock (pnpm re-resolves `^`
ranges to latest):
  - `@cosmos-kit/react`: 2.18.0
  - `@solana/wallet-adapter-wallets`: 0.19.16
  - `@rainbow-me/rainbowkit`: 2.2.0
- Add phantom dependencies required by pnpm strict dependency isolation
- Update CI workflows to use pnpm (pnpm/action-setup@v4, pnpm store
caching)
- Update GitHub Actions to latest versions (checkout@v6, setup-node@v6)
- Update vercel.json to use pnpm@10.25.0
- Update README with pnpm commands
- Remove yarn files (.yarn/, .yarnrc.yml, yarn.lock)
- Add pnpm-lock.yaml
- Fix unit testing
- Update husky

- [x] `pnpm install` succeeds
- [x] `pnpm typecheck` passes
- [x] `pnpm build` succeeds
- [x] `pnpm lint` passes
- [x] CI workflows pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* Added support for Solana wallet integrations, Sentry error monitoring,
and additional Chakra UI packages.

* **Chores**
* Migrated project tooling, package manager metadata, and CI workflows
from Yarn to pnpm; updated GitHub Actions and dev tooling versions.
* Upgraded and added multiple dependencies and devDependencies; replaced
resolution/patch approach with pnpm-compatible overrides.

* **Documentation**
  * Updated CLI/README commands and ignore lists to reflect pnpm usage.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
raihannismara added a commit to d3labs-io/hyperlane-warp-ui-template that referenced this pull request Mar 30, 2026
…dependency) (#163)

* chore: bump hyperlane version

* fix: isSmartContract check for EIP-7702 addresses to not show banner (hyperlane-xyz#850)

With the inclusion of Smart Accounts ([EIP-7702](https://eip7702.io/))
the UI was incorrectly showing the recipient banner check for address
that are smart accounts and not smart contracts

- This PR introduces check if the contract code starts with the EIP-7702
selector to decide if the UI should show the warning banner or not
- Refactors contract address check into its own util function

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Bug Fixes**
* Improved contract address detection to accurately distinguish between
smart accounts and regular contracts.
* Enhanced error reporting with clearer contextual messages during
address validation.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

* c
feat: add preview fee estimate before bridge

* feat: estimate gas preview

* feat!: pnpm migration (hyperlane-xyz#840)

Migrate package manager from Yarn 4.x (Berry) to pnpm 10.x, following
the patterns established in the monorepo migration
([hyperlane-monorepo#7410](hyperlane-xyz/hyperlane-monorepo#7410)).

**Changes:**
- Update `packageManager` to pnpm@10.25.0
- Convert `resolutions` to `pnpm.overrides`
- Convert yarn patches to `pnpm.patchedDependencies` format
- Pin dependency versions to match yarn.lock (pnpm re-resolves `^`
ranges to latest):
  - `@cosmos-kit/react`: 2.18.0
  - `@solana/wallet-adapter-wallets`: 0.19.16
  - `@rainbow-me/rainbowkit`: 2.2.0
- Add phantom dependencies required by pnpm strict dependency isolation
- Update CI workflows to use pnpm (pnpm/action-setup@v4, pnpm store
caching)
- Update GitHub Actions to latest versions (checkout@v6, setup-node@v6)
- Update vercel.json to use pnpm@10.25.0
- Update README with pnpm commands
- Remove yarn files (.yarn/, .yarnrc.yml, yarn.lock)
- Add pnpm-lock.yaml
- Fix unit testing
- Update husky

- [x] `pnpm install` succeeds
- [x] `pnpm typecheck` passes
- [x] `pnpm build` succeeds
- [x] `pnpm lint` passes
- [x] CI workflows pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* Added support for Solana wallet integrations, Sentry error monitoring,
and additional Chakra UI packages.

* **Chores**
* Migrated project tooling, package manager metadata, and CI workflows
from Yarn to pnpm; updated GitHub Actions and dev tooling versions.
* Upgraded and added multiple dependencies and devDependencies; replaced
resolution/patch approach with pnpm-compatible overrides.

* **Documentation**
  * Updated CLI/README commands and ignore lists to reflect pnpm usage.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* chore: delete yarn related, update the way fetch in react-query

* fix: max button not calculated from balances, dynamic estimated fee

* chore: bump depedency hyperlane 20.1.0

* Fix/metamask mobile walletconnect chain switch (#160)

* fix: ensure wallet is on origin chain before EVM transactions

WalletConnect with MetaMask mobile can take several seconds after a
chain switch before the wagmi store reflects the new chain. The
hardcoded 2-second sleep in @hyperlane-xyz/widgets is often not
enough, causing the chain-ID assertion to fail with ChainMismatchError.

Add waitForChainSwitch to poll getAccount().chainId every 500 ms (up to
30 s) and ensureWalletOnChain to call switchChain then wait. Call
ensureWalletOnChain in executeTransfer before every EVM transaction so
the wallet is confirmed on the correct chain before the widgets layer
runs its own check.

* test: add unit tests for waitForChainSwitch and ensureWalletOnChain

Cover all branches of the two new rpcUtils helpers with fake-timer
tests: immediate resolution, polling until chain updates, timeout with
descriptive error, switchChain rejection swallowing, and the full 30 s
default timeout path.

Add EVM-specific tests to useTokenTransfer to verify ensureWalletOnChain
is called with the correct wagmiConfig and chainId, that a
ChainMismatchError surfaces the right toast, and that preEstimateGasForEvmTxs
is invoked after the chain guard succeeds.

* feat: Safe wallet support via event-based tx confirmation (#157)

* feat: add resilient tx confirmation with RPC polling fallback

Race wallet confirm() against direct blockchain polling with Fibonacci
backoff to handle WalletConnect wallets that fail to resolve the
confirmation callback. Uses 5s initial delay, Fibonacci intervals
(1s, 1s, 2s, 3s... capped at 30s), and 1-hour max poll duration.

* feat: add event-based tx confirmation for Safe wallet support

Safe wallets return a safeTxHash (internal meta-transaction hash) from
sendTransaction instead of an on-chain txHash. Both the wallet confirm
callback and RPC polling use the public client to look up this hash,
but it never exists on-chain — causing transfers to hang indefinitely.

Add a third racing leg to resilientConfirm that watches for contract
events on-chain via eth_getLogs. When the Safe executes the transaction,
the target contract emits events (ERC20 Transfer, Approval, etc.) where
the Safe address appears as an indexed topic. The event watcher detects
this and extracts the real on-chain txHash from the log entry.

This approach is completely chain-agnostic — works on any EVM chain with
any Safe deployment without needing to know Safe infrastructure URLs.

Key changes:
- Add pollForContractEvent with Fibonacci backoff event polling
- Extend resilientConfirm to support 3-leg race (wallet + RPC + events)
- Pass contract address and sender from useTokenTransfer for event filtering
- Extract real on-chain txHash from receipt for explorer links
- Capture block number before initial delay with 10-block safety buffer

* prettier

* fix: estimate gas per-tx instead of all upfront

Gas pre-estimation for all transactions was running before any were sent.
For multi-tx flows (approval + transferRemote), the transferRemote gas
estimation would fail because the token allowance wasn't set yet —
the simulation reverts without the approval in place.

With no gasLimit set, wagmi falls back to estimating gas through the
WalletConnect connector's rpcMap during sendTransaction, which can be
CORS-blocked or time out, causing the transferRemote request to never
reach the Safe wallet.

Fix by estimating gas for each transaction immediately before sending it,
so by the time transferRemote is estimated, all prior approvals are
confirmed on-chain and the simulation uses the correct allowance state.

* fix: detect Safe transferRemote via ExecutionSuccess event

The event-based polling only watched the target contract for logs
where the sender is an indexed topic. This works for ERC20 Approval
(owner is indexed) but fails for transferRemote: the warp router
emits SentTransferRemote(destination, recipient, amount) with no
sender topic, so the Safe tx was never detected.

Fix: each polling cycle now also queries the sender address (the Safe
contract itself) for logs where the wallet-returned hash appears as a
topic. Safe emits ExecutionSuccess(bytes32 indexed txHash, payment)
when any tx executes — txHash equals the safeTxHash from
sendTransaction. This is fully chain-agnostic; no Safe infrastructure
URLs required.

* use raw data on top of topic log

* add test

* refactor: remove redundant RPC polling leg from resilientConfirm

confirm() in @hyperlane-xyz/widgets calls wagmi's waitForTransactionReceipt
via the public client (raceTransport), not through the WalletConnect relay.
The RPC polling leg was therefore a duplicate of what confirm() already does
internally. Remove it.

What stays:
- Event-based polling (pollForContractEvent): the only mechanism that can
  detect Safe wallet transactions. Safe returns a safeTxHash that
  waitForTransactionReceipt cannot resolve, so confirm() hangs indefinitely
  for Safe wallets. Event polling detects the actual on-chain tx via logs.
- Revert detection: wallet leg now explicitly checks receipt.status === 'reverted'
  since waitForTransactionReceipt returns success even for reverted transactions.
- ensureWalletOnChain / waitForChainSwitch: added from staging to ensure
  wallet chain state is correct before submitting EVM transactions.

* refactor: extract Safe wallet confirmation into safeWalletUtils

Move fibonacciDelays, abortableSleep, pollForContractEvent,
ResilientConfirmOptions, and resilientConfirm out of rpcUtils.ts into
a dedicated safeWalletUtils.ts. rpcUtils.ts now only contains RPC
transport (raceTransport, raceViemProviderBuilder, withWcRpcFirst),
gas estimation (preEstimateGasForEvmTxs), and chain switching
(waitForChainSwitch, ensureWalletOnChain).

Corresponding tests moved to safeWalletUtils.test.ts.
useTokenTransfer.ts imports resilientConfirm from the new module.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: deleted patch 18 unused

* chore: upgrate ci/cd with v4, fix ut approval not covered the test

* chore: update ci/cd due error when install the package

* fix ut when ci/cd trigged

---------

Co-authored-by: Jason Guo <33064781+Xaroz@users.noreply.github.com>
Co-authored-by: Paul Balaji <10051819+paulbalaji@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: derryld3 <derryl@d3labs.io>
raihannismara added a commit to d3labs-io/hyperlane-warp-ui-template that referenced this pull request Apr 6, 2026
…dependency) (#163)

* chore: bump hyperlane version

* fix: isSmartContract check for EIP-7702 addresses to not show banner (hyperlane-xyz#850)

With the inclusion of Smart Accounts ([EIP-7702](https://eip7702.io/))
the UI was incorrectly showing the recipient banner check for address
that are smart accounts and not smart contracts

- This PR introduces check if the contract code starts with the EIP-7702
selector to decide if the UI should show the warning banner or not
- Refactors contract address check into its own util function

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **Bug Fixes**
* Improved contract address detection to accurately distinguish between
smart accounts and regular contracts.
* Enhanced error reporting with clearer contextual messages during
address validation.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

* c
feat: add preview fee estimate before bridge

* feat: estimate gas preview

* feat!: pnpm migration (hyperlane-xyz#840)

Migrate package manager from Yarn 4.x (Berry) to pnpm 10.x, following
the patterns established in the monorepo migration
([hyperlane-monorepo#7410](hyperlane-xyz/hyperlane-monorepo#7410)).

**Changes:**
- Update `packageManager` to pnpm@10.25.0
- Convert `resolutions` to `pnpm.overrides`
- Convert yarn patches to `pnpm.patchedDependencies` format
- Pin dependency versions to match yarn.lock (pnpm re-resolves `^`
ranges to latest):
  - `@cosmos-kit/react`: 2.18.0
  - `@solana/wallet-adapter-wallets`: 0.19.16
  - `@rainbow-me/rainbowkit`: 2.2.0
- Add phantom dependencies required by pnpm strict dependency isolation
- Update CI workflows to use pnpm (pnpm/action-setup@v4, pnpm store
caching)
- Update GitHub Actions to latest versions (checkout@v6, setup-node@v6)
- Update vercel.json to use pnpm@10.25.0
- Update README with pnpm commands
- Remove yarn files (.yarn/, .yarnrc.yml, yarn.lock)
- Add pnpm-lock.yaml
- Fix unit testing
- Update husky

- [x] `pnpm install` succeeds
- [x] `pnpm typecheck` passes
- [x] `pnpm build` succeeds
- [x] `pnpm lint` passes
- [x] CI workflows pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* Added support for Solana wallet integrations, Sentry error monitoring,
and additional Chakra UI packages.

* **Chores**
* Migrated project tooling, package manager metadata, and CI workflows
from Yarn to pnpm; updated GitHub Actions and dev tooling versions.
* Upgraded and added multiple dependencies and devDependencies; replaced
resolution/patch approach with pnpm-compatible overrides.

* **Documentation**
  * Updated CLI/README commands and ignore lists to reflect pnpm usage.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* chore: delete yarn related, update the way fetch in react-query

* fix: max button not calculated from balances, dynamic estimated fee

* chore: bump depedency hyperlane 20.1.0

* Fix/metamask mobile walletconnect chain switch (#160)

* fix: ensure wallet is on origin chain before EVM transactions

WalletConnect with MetaMask mobile can take several seconds after a
chain switch before the wagmi store reflects the new chain. The
hardcoded 2-second sleep in @hyperlane-xyz/widgets is often not
enough, causing the chain-ID assertion to fail with ChainMismatchError.

Add waitForChainSwitch to poll getAccount().chainId every 500 ms (up to
30 s) and ensureWalletOnChain to call switchChain then wait. Call
ensureWalletOnChain in executeTransfer before every EVM transaction so
the wallet is confirmed on the correct chain before the widgets layer
runs its own check.

* test: add unit tests for waitForChainSwitch and ensureWalletOnChain

Cover all branches of the two new rpcUtils helpers with fake-timer
tests: immediate resolution, polling until chain updates, timeout with
descriptive error, switchChain rejection swallowing, and the full 30 s
default timeout path.

Add EVM-specific tests to useTokenTransfer to verify ensureWalletOnChain
is called with the correct wagmiConfig and chainId, that a
ChainMismatchError surfaces the right toast, and that preEstimateGasForEvmTxs
is invoked after the chain guard succeeds.

* feat: Safe wallet support via event-based tx confirmation (#157)

* feat: add resilient tx confirmation with RPC polling fallback

Race wallet confirm() against direct blockchain polling with Fibonacci
backoff to handle WalletConnect wallets that fail to resolve the
confirmation callback. Uses 5s initial delay, Fibonacci intervals
(1s, 1s, 2s, 3s... capped at 30s), and 1-hour max poll duration.

* feat: add event-based tx confirmation for Safe wallet support

Safe wallets return a safeTxHash (internal meta-transaction hash) from
sendTransaction instead of an on-chain txHash. Both the wallet confirm
callback and RPC polling use the public client to look up this hash,
but it never exists on-chain — causing transfers to hang indefinitely.

Add a third racing leg to resilientConfirm that watches for contract
events on-chain via eth_getLogs. When the Safe executes the transaction,
the target contract emits events (ERC20 Transfer, Approval, etc.) where
the Safe address appears as an indexed topic. The event watcher detects
this and extracts the real on-chain txHash from the log entry.

This approach is completely chain-agnostic — works on any EVM chain with
any Safe deployment without needing to know Safe infrastructure URLs.

Key changes:
- Add pollForContractEvent with Fibonacci backoff event polling
- Extend resilientConfirm to support 3-leg race (wallet + RPC + events)
- Pass contract address and sender from useTokenTransfer for event filtering
- Extract real on-chain txHash from receipt for explorer links
- Capture block number before initial delay with 10-block safety buffer

* prettier

* fix: estimate gas per-tx instead of all upfront

Gas pre-estimation for all transactions was running before any were sent.
For multi-tx flows (approval + transferRemote), the transferRemote gas
estimation would fail because the token allowance wasn't set yet —
the simulation reverts without the approval in place.

With no gasLimit set, wagmi falls back to estimating gas through the
WalletConnect connector's rpcMap during sendTransaction, which can be
CORS-blocked or time out, causing the transferRemote request to never
reach the Safe wallet.

Fix by estimating gas for each transaction immediately before sending it,
so by the time transferRemote is estimated, all prior approvals are
confirmed on-chain and the simulation uses the correct allowance state.

* fix: detect Safe transferRemote via ExecutionSuccess event

The event-based polling only watched the target contract for logs
where the sender is an indexed topic. This works for ERC20 Approval
(owner is indexed) but fails for transferRemote: the warp router
emits SentTransferRemote(destination, recipient, amount) with no
sender topic, so the Safe tx was never detected.

Fix: each polling cycle now also queries the sender address (the Safe
contract itself) for logs where the wallet-returned hash appears as a
topic. Safe emits ExecutionSuccess(bytes32 indexed txHash, payment)
when any tx executes — txHash equals the safeTxHash from
sendTransaction. This is fully chain-agnostic; no Safe infrastructure
URLs required.

* use raw data on top of topic log

* add test

* refactor: remove redundant RPC polling leg from resilientConfirm

confirm() in @hyperlane-xyz/widgets calls wagmi's waitForTransactionReceipt
via the public client (raceTransport), not through the WalletConnect relay.
The RPC polling leg was therefore a duplicate of what confirm() already does
internally. Remove it.

What stays:
- Event-based polling (pollForContractEvent): the only mechanism that can
  detect Safe wallet transactions. Safe returns a safeTxHash that
  waitForTransactionReceipt cannot resolve, so confirm() hangs indefinitely
  for Safe wallets. Event polling detects the actual on-chain tx via logs.
- Revert detection: wallet leg now explicitly checks receipt.status === 'reverted'
  since waitForTransactionReceipt returns success even for reverted transactions.
- ensureWalletOnChain / waitForChainSwitch: added from staging to ensure
  wallet chain state is correct before submitting EVM transactions.

* refactor: extract Safe wallet confirmation into safeWalletUtils

Move fibonacciDelays, abortableSleep, pollForContractEvent,
ResilientConfirmOptions, and resilientConfirm out of rpcUtils.ts into
a dedicated safeWalletUtils.ts. rpcUtils.ts now only contains RPC
transport (raceTransport, raceViemProviderBuilder, withWcRpcFirst),
gas estimation (preEstimateGasForEvmTxs), and chain switching
(waitForChainSwitch, ensureWalletOnChain).

Corresponding tests moved to safeWalletUtils.test.ts.
useTokenTransfer.ts imports resilientConfirm from the new module.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: deleted patch 18 unused

* chore: upgrate ci/cd with v4, fix ut approval not covered the test

* chore: update ci/cd due error when install the package

* fix ut when ci/cd trigged

---------

Co-authored-by: Jason Guo <33064781+Xaroz@users.noreply.github.com>
Co-authored-by: Paul Balaji <10051819+paulbalaji@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: derryld3 <derryl@d3labs.io>
raihannismara added a commit to d3labs-io/hyperlane-warp-ui-template that referenced this pull request Apr 6, 2026
…dependency) (#163) (#168)

* chore: bump hyperlane version

* fix: isSmartContract check for EIP-7702 addresses to not show banner (hyperlane-xyz#850)

With the inclusion of Smart Accounts ([EIP-7702](https://eip7702.io/))
the UI was incorrectly showing the recipient banner check for address
that are smart accounts and not smart contracts

- This PR introduces check if the contract code starts with the EIP-7702
selector to decide if the UI should show the warning banner or not
- Refactors contract address check into its own util function

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **Bug Fixes**
* Improved contract address detection to accurately distinguish between
smart accounts and regular contracts.
* Enhanced error reporting with clearer contextual messages during
address validation.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

* c
feat: add preview fee estimate before bridge

* feat: estimate gas preview

* feat!: pnpm migration (hyperlane-xyz#840)

Migrate package manager from Yarn 4.x (Berry) to pnpm 10.x, following
the patterns established in the monorepo migration
([hyperlane-monorepo#7410](hyperlane-xyz/hyperlane-monorepo#7410)).

**Changes:**
- Update `packageManager` to pnpm@10.25.0
- Convert `resolutions` to `pnpm.overrides`
- Convert yarn patches to `pnpm.patchedDependencies` format
- Pin dependency versions to match yarn.lock (pnpm re-resolves `^`
ranges to latest):
  - `@cosmos-kit/react`: 2.18.0
  - `@solana/wallet-adapter-wallets`: 0.19.16
  - `@rainbow-me/rainbowkit`: 2.2.0
- Add phantom dependencies required by pnpm strict dependency isolation
- Update CI workflows to use pnpm (pnpm/action-setup@v4, pnpm store
caching)
- Update GitHub Actions to latest versions (checkout@v6, setup-node@v6)
- Update vercel.json to use pnpm@10.25.0
- Update README with pnpm commands
- Remove yarn files (.yarn/, .yarnrc.yml, yarn.lock)
- Add pnpm-lock.yaml
- Fix unit testing
- Update husky

- [x] `pnpm install` succeeds
- [x] `pnpm typecheck` passes
- [x] `pnpm build` succeeds
- [x] `pnpm lint` passes
- [x] CI workflows pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* Added support for Solana wallet integrations, Sentry error monitoring,
and additional Chakra UI packages.

* **Chores**
* Migrated project tooling, package manager metadata, and CI workflows
from Yarn to pnpm; updated GitHub Actions and dev tooling versions.
* Upgraded and added multiple dependencies and devDependencies; replaced
resolution/patch approach with pnpm-compatible overrides.

* **Documentation**
  * Updated CLI/README commands and ignore lists to reflect pnpm usage.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------



* chore: delete yarn related, update the way fetch in react-query

* fix: max button not calculated from balances, dynamic estimated fee

* chore: bump depedency hyperlane 20.1.0

* Fix/metamask mobile walletconnect chain switch (#160)

* fix: ensure wallet is on origin chain before EVM transactions

WalletConnect with MetaMask mobile can take several seconds after a
chain switch before the wagmi store reflects the new chain. The
hardcoded 2-second sleep in @hyperlane-xyz/widgets is often not
enough, causing the chain-ID assertion to fail with ChainMismatchError.

Add waitForChainSwitch to poll getAccount().chainId every 500 ms (up to
30 s) and ensureWalletOnChain to call switchChain then wait. Call
ensureWalletOnChain in executeTransfer before every EVM transaction so
the wallet is confirmed on the correct chain before the widgets layer
runs its own check.

* test: add unit tests for waitForChainSwitch and ensureWalletOnChain

Cover all branches of the two new rpcUtils helpers with fake-timer
tests: immediate resolution, polling until chain updates, timeout with
descriptive error, switchChain rejection swallowing, and the full 30 s
default timeout path.

Add EVM-specific tests to useTokenTransfer to verify ensureWalletOnChain
is called with the correct wagmiConfig and chainId, that a
ChainMismatchError surfaces the right toast, and that preEstimateGasForEvmTxs
is invoked after the chain guard succeeds.

* feat: Safe wallet support via event-based tx confirmation (#157)

* feat: add resilient tx confirmation with RPC polling fallback

Race wallet confirm() against direct blockchain polling with Fibonacci
backoff to handle WalletConnect wallets that fail to resolve the
confirmation callback. Uses 5s initial delay, Fibonacci intervals
(1s, 1s, 2s, 3s... capped at 30s), and 1-hour max poll duration.

* feat: add event-based tx confirmation for Safe wallet support

Safe wallets return a safeTxHash (internal meta-transaction hash) from
sendTransaction instead of an on-chain txHash. Both the wallet confirm
callback and RPC polling use the public client to look up this hash,
but it never exists on-chain — causing transfers to hang indefinitely.

Add a third racing leg to resilientConfirm that watches for contract
events on-chain via eth_getLogs. When the Safe executes the transaction,
the target contract emits events (ERC20 Transfer, Approval, etc.) where
the Safe address appears as an indexed topic. The event watcher detects
this and extracts the real on-chain txHash from the log entry.

This approach is completely chain-agnostic — works on any EVM chain with
any Safe deployment without needing to know Safe infrastructure URLs.

Key changes:
- Add pollForContractEvent with Fibonacci backoff event polling
- Extend resilientConfirm to support 3-leg race (wallet + RPC + events)
- Pass contract address and sender from useTokenTransfer for event filtering
- Extract real on-chain txHash from receipt for explorer links
- Capture block number before initial delay with 10-block safety buffer

* prettier

* fix: estimate gas per-tx instead of all upfront

Gas pre-estimation for all transactions was running before any were sent.
For multi-tx flows (approval + transferRemote), the transferRemote gas
estimation would fail because the token allowance wasn't set yet —
the simulation reverts without the approval in place.

With no gasLimit set, wagmi falls back to estimating gas through the
WalletConnect connector's rpcMap during sendTransaction, which can be
CORS-blocked or time out, causing the transferRemote request to never
reach the Safe wallet.

Fix by estimating gas for each transaction immediately before sending it,
so by the time transferRemote is estimated, all prior approvals are
confirmed on-chain and the simulation uses the correct allowance state.

* fix: detect Safe transferRemote via ExecutionSuccess event

The event-based polling only watched the target contract for logs
where the sender is an indexed topic. This works for ERC20 Approval
(owner is indexed) but fails for transferRemote: the warp router
emits SentTransferRemote(destination, recipient, amount) with no
sender topic, so the Safe tx was never detected.

Fix: each polling cycle now also queries the sender address (the Safe
contract itself) for logs where the wallet-returned hash appears as a
topic. Safe emits ExecutionSuccess(bytes32 indexed txHash, payment)
when any tx executes — txHash equals the safeTxHash from
sendTransaction. This is fully chain-agnostic; no Safe infrastructure
URLs required.

* use raw data on top of topic log

* add test

* refactor: remove redundant RPC polling leg from resilientConfirm

confirm() in @hyperlane-xyz/widgets calls wagmi's waitForTransactionReceipt
via the public client (raceTransport), not through the WalletConnect relay.
The RPC polling leg was therefore a duplicate of what confirm() already does
internally. Remove it.

What stays:
- Event-based polling (pollForContractEvent): the only mechanism that can
  detect Safe wallet transactions. Safe returns a safeTxHash that
  waitForTransactionReceipt cannot resolve, so confirm() hangs indefinitely
  for Safe wallets. Event polling detects the actual on-chain tx via logs.
- Revert detection: wallet leg now explicitly checks receipt.status === 'reverted'
  since waitForTransactionReceipt returns success even for reverted transactions.
- ensureWalletOnChain / waitForChainSwitch: added from staging to ensure
  wallet chain state is correct before submitting EVM transactions.

* refactor: extract Safe wallet confirmation into safeWalletUtils

Move fibonacciDelays, abortableSleep, pollForContractEvent,
ResilientConfirmOptions, and resilientConfirm out of rpcUtils.ts into
a dedicated safeWalletUtils.ts. rpcUtils.ts now only contains RPC
transport (raceTransport, raceViemProviderBuilder, withWcRpcFirst),
gas estimation (preEstimateGasForEvmTxs), and chain switching
(waitForChainSwitch, ensureWalletOnChain).

Corresponding tests moved to safeWalletUtils.test.ts.
useTokenTransfer.ts imports resilientConfirm from the new module.



---------



* chore: deleted patch 18 unused

* chore: upgrate ci/cd with v4, fix ut approval not covered the test

* chore: update ci/cd due error when install the package

* fix ut when ci/cd trigged

---------

Co-authored-by: Jason Guo <33064781+Xaroz@users.noreply.github.com>
Co-authored-by: Paul Balaji <10051819+paulbalaji@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: derryld3 <derryl@d3labs.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Hyperlane Gnosis Safe integration

3 participants