Skip to content

Cherry-picking commits from main to release/7.76.3-ota for PR #29936#30033

Merged
chloeYue merged 1 commit into
release/7.76.3-otafrom
runway-cherry-pick-7.76.3-1778580441
May 12, 2026
Merged

Cherry-picking commits from main to release/7.76.3-ota for PR #29936#30033
chloeYue merged 1 commit into
release/7.76.3-otafrom
runway-cherry-pick-7.76.3-1778580441

Conversation

@runway-github

@runway-github runway-github Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Description

Adds Deposit Wallet support for the Predict claim flow.

Polymarket Deposit Wallet users still create a normal MetaMask claim
confirmation so the transaction is visible in activity, but the signed
confirmation transaction is not published directly. Instead, Predict
intercepts pending claim transactions in the publish hook, submits the
actual claim calls as a Polymarket Deposit Wallet relayer WALLET
batch, waits only until the relayer returns a transaction hash, and
returns that hash to TransactionController.

This PR preserves legacy Safe claim behavior: Safe users continue to
sign and publish the existing Safe claim transaction path.

Key changes:

  • Add Deposit Wallet claim planning that builds relayer calls from
    claimable positions.
  • Mark Deposit Wallet claim confirmation transactions as externally
    signed before signing.
  • Publish Deposit Wallet claims through the relayer batch and return as
    soon as a transaction hash is available.
  • Trigger best-effort CLOB balance-allowance sync after confirmed
    claims.
  • Wire Predict pending-claim context into beforeSign and publish.
  • Add skipInitialGasEstimate to claim confirmation batch creation.

Changelog

CHANGELOG entry: Fixed Predict claims for Polymarket Deposit Wallet
users.

Related issues

Fixes:
PRED-859

Manual testing steps

Feature: Predict Deposit Wallet claim flow

  Scenario: Deposit Wallet user claims resolved positions
    Given a Predict user is routed to a Polymarket Deposit Wallet
    And the user has claimable positions
    When the user starts the claim flow
    Then MetaMask shows the normal claim confirmation
    When the user approves the confirmation
    Then the claim is submitted through the Polymarket Deposit Wallet relayer
    And MetaMask activity tracks the returned transaction hash

  Scenario: legacy Safe user claims resolved positions
    Given a Predict user is routed to a legacy Safe wallet
    And the user has claimable positions
    When the user approves the claim confirmation
    Then the existing Safe claim publish path is used

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
  • Use these power-user
    SRPs

    to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production
    performance metrics
  • See trace() for usage and
    addToken
    for an example

For performance guidelines and tooling, see the Performance
Guide
.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Note

Medium Risk
Changes claim transaction beforeSign/publish behavior and
introduces a new relayer-based submission path for deposit-wallet users,
which could affect transaction lifecycle and activity tracking if
metadata or batch matching is wrong.

Overview
Adds deposit-wallet support for Predict claims by intercepting
pending predictClaim transactions in PredictController and
delegating beforeSign/publish to new provider hooks
(beforeSignClaim, publishClaim). Deposit-wallet claims are now
marked as externally signed before signing and are published via a
Polymarket relayer WALLET batch (planned by new
planDepositWalletClaim) while legacy Safe claims continue to pass
through.

Claim batch submission is tweaked to set skipInitialGasEstimate and
include the MATIC collateral gas token, and confirmClaim now triggers
a best-effort deposit-wallet collateral allowance sync after claim
confirmation. Tests are expanded/added across PredictController,
PolymarketProvider, and new preflight/claim coverage for requirement
filtering and call ordering.

Reviewed by Cursor Bugbot for commit
c11a3c6. Bugbot is set up for automated
code reviews on this repo. Configure
here.

[3751d9a](https://github.com/MetaMask/metamask-mobile/commit/3751d9a03bc509ea08e94f2df6066656f691958c)

## **Description**

Adds Deposit Wallet support for the Predict claim flow.

Polymarket Deposit Wallet users still create a normal MetaMask claim
confirmation so the transaction is visible in activity, but the signed
confirmation transaction is not published directly. Instead, Predict
intercepts pending claim transactions in the publish hook, submits the
actual claim calls as a Polymarket Deposit Wallet relayer `WALLET`
batch, waits only until the relayer returns a transaction hash, and
returns that hash to TransactionController.

This PR preserves legacy Safe claim behavior: Safe users continue to
sign and publish the existing Safe claim transaction path.

Key changes:
- Add Deposit Wallet claim planning that builds relayer calls from
claimable positions.
- Mark Deposit Wallet claim confirmation transactions as externally
signed before signing.
- Publish Deposit Wallet claims through the relayer batch and return as
soon as a transaction hash is available.
- Trigger best-effort CLOB balance-allowance sync after confirmed
claims.
- Wire Predict pending-claim context into `beforeSign` and `publish`.
- Add `skipInitialGasEstimate` to claim confirmation batch creation.

## **Changelog**

CHANGELOG entry: Fixed Predict claims for Polymarket Deposit Wallet
users.

## **Related issues**

Fixes:
[PRED-859](https://consensyssoftware.atlassian.net/browse/PRED-859)

## **Manual testing steps**

```gherkin
Feature: Predict Deposit Wallet claim flow

  Scenario: Deposit Wallet user claims resolved positions
    Given a Predict user is routed to a Polymarket Deposit Wallet
    And the user has claimable positions
    When the user starts the claim flow
    Then MetaMask shows the normal claim confirmation
    When the user approves the confirmation
    Then the claim is submitted through the Polymarket Deposit Wallet relayer
    And MetaMask activity tracks the returned transaction hash

  Scenario: legacy Safe user claims resolved positions
    Given a Predict user is routed to a legacy Safe wallet
    And the user has claimable positions
    When the user approves the claim confirmation
    Then the existing Safe claim publish path is used
```

## **Screenshots/Recordings**

### **Before**

N/A

### **After**

N/A

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [ ] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [ ] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


[PRED-859]:
https://consensyssoftware.atlassian.net/browse/PRED-859?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes claim transaction `beforeSign`/`publish` behavior and
introduces a new relayer-based submission path for deposit-wallet users,
which could affect transaction lifecycle and activity tracking if
metadata or batch matching is wrong.
> 
> **Overview**
> Adds **deposit-wallet support for Predict claims** by intercepting
pending `predictClaim` transactions in `PredictController` and
delegating `beforeSign`/`publish` to new provider hooks
(`beforeSignClaim`, `publishClaim`). Deposit-wallet claims are now
marked as *externally signed* before signing and are published via a
Polymarket relayer `WALLET` batch (planned by new
`planDepositWalletClaim`) while legacy Safe claims continue to pass
through.
> 
> Claim batch submission is tweaked to set `skipInitialGasEstimate` and
include the MATIC collateral gas token, and `confirmClaim` now triggers
a best-effort deposit-wallet collateral allowance sync after claim
confirmation. Tests are expanded/added across `PredictController`,
`PolymarketProvider`, and new `preflight/claim` coverage for requirement
filtering and call ordering.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c11a3c6. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github Bot requested a review from a team as a code owner May 12, 2026 10:07
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label May 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - PR targets a release branch (release/*)

All E2E tests pre-selected.

View GitHub Actions results

@chloeYue chloeYue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
78.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@chloeYue chloeYue merged commit 20f0a97 into release/7.76.3-ota May 12, 2026
114 of 118 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-7.76.3-1778580441 branch May 12, 2026 11:33
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size-L team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants