Skip to content

Feat: Update latest hyperlane (pnpm migration, preview gas fee, bump dependency)#163

Merged
raihannismara merged 14 commits into
stagingfrom
update-latest-hyperlane
Mar 30, 2026
Merged

Feat: Update latest hyperlane (pnpm migration, preview gas fee, bump dependency)#163
raihannismara merged 14 commits into
stagingfrom
update-latest-hyperlane

Conversation

@raihannismara
Copy link
Copy Markdown

@raihannismara raihannismara commented Mar 30, 2026

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

Summary

Migrate package manager from Yarn 4.x (Berry) to pnpm 10.x, following
the patterns established in the monorepo migration
(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

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

🤖 Generated with Claude Code

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.

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


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

Xaroz and others added 10 commits March 22, 2026 20:32
…yperlane-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
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>
* 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: 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>
@raihannismara raihannismara requested a review from derryld3 March 30, 2026 03:53
@raihannismara raihannismara self-assigned this Mar 30, 2026
@raihannismara raihannismara changed the title Feat: Update latest hyperlane Feat: Update latest hyperlane (pnpm migration, preview gas fee, bump dependency) Mar 30, 2026
derryld3
derryld3 previously approved these changes Mar 30, 2026
@D3labs-Donny
Copy link
Copy Markdown

@claude review

Copy link
Copy Markdown

@D3labs-Donny D3labs-Donny 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 migrates the package manager from Yarn 4.x to pnpm 10.x, following the upstream hyperlane-warp-ui-template migration. The core migration (package.json, lockfile, CI workflows) is mechanically sound, but the README update is incomplete with stale yarn references remaining in the Quick Start and Deployment sections, and the Docker section content was accidentally replaced with pnpm commands. Additionally, lint-staged was silently dropped from the pre-commit hook.

Comment thread README.md
Comment thread README.md
Comment thread .husky/pre-commit
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread .prettierignore
D3labs-Donny
D3labs-Donny previously approved these changes Mar 30, 2026
@raihannismara raihannismara merged commit 252ee76 into staging Mar 30, 2026
5 checks passed
@raihannismara raihannismara deleted the update-latest-hyperlane branch March 30, 2026 07:00
raihannismara added a commit 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 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

None yet

Development

Successfully merging this pull request may close these issues.

6 participants