Skip to content

Centralize blockchain transaction building into a single service #8

@martinjms

Description

@martinjms

Summary

Transaction-building logic is currently spread across multiple components (Overview, Buildings). Each independently resolves the binding ID, builds PTBs, and handles results. This led to a critical bug where the binding ID wasn't loaded correctly in one place, causing Apply to create duplicate bindings.

Proposed solution

Create a single TransactionService or useTransactions hook that:

  • Owns the binding ID resolution (single source of truth)
  • Validates binding ID exists before any transaction
  • Provides typed methods: install(), updateUrl(), applyPolicies(), addToBlocklist(), removeFromBlocklist()
  • Handles result parsing, toast notifications, and query invalidation in one place
  • Prevents duplicate binding creation

Benefits

  • Binding ID validated in one place, not scattered across components
  • Consistent error handling and user feedback
  • Easier to implement single-transaction Apply (Single-transaction Apply flow #5) later
  • Reduces code duplication between Overview and Buildings pages

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions