Skip to content

[MPC Feedback] No tx.submit_and_await — can't easily await transaction status #32

@r-near

Description

@r-near

Source

MPC team feedback via @marten.blankfors (Slack thread)

Problem Statement

"We're lacking an easy way to await the status of a submitted transaction. I'd expect to be able to do something like let result = tx.submit_and_await - but this doesn't exist or at least we cannot do this."

Research Findings

✅ This capability exists today in near-api-rs

The .send_to(&network).await pattern does exactly this:

let result = contract
    .call_function("method", args)
    .transaction()
    .with_signer(account_id, signer)
    .send_to(&network)
    .await?;  // Waits for finality by default

result.assert_success();

You can configure wait behavior with .wait_until():

  • TxExecutionStatus::None — fire-and-forget
  • TxExecutionStatus::Included — in a block (not finalized)
  • TxExecutionStatus::Final — full finality (default)

Root Cause of MPC Team's Issue

The MPC team embeds nearcore directly and uses internal IndexerRpcHandler instead of standard RPC. This architecture bypasses the normal transaction submission flow.

If they migrate to using near-api-rs as an RPC customer (see #30), this problem disappears.

Remaining Gaps

  1. Documentation — near-api-rs README notes "good quality examples" is still TODO
  2. Discoverability — the pattern isn't named submit_and_await() so it's not obvious
  3. Timeout configuration — no explicit timeout config exposed (uses internal retry logic)

Recommended Actions

  • Improve near-api-rs documentation with explicit "submit and await" examples
  • Help MPC team migrate from embedded nearcore to RPC customer pattern
  • Consider adding a submit_and_await() alias for discoverability

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmpc-teamFeedback from MPC teampartner-feedbackFeedback from internal partner teams (MPC, Bridge, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions