Skip to content

Implemented a full cleanup and stabilization pass for the local buyer/seller OmniClaw flow.#39

Merged
abiorh-claw merged 3 commits intomainfrom
fix_docker
Apr 5, 2026
Merged

Implemented a full cleanup and stabilization pass for the local buyer/seller OmniClaw flow.#39
abiorh-claw merged 3 commits intomainfrom
fix_docker

Conversation

@Abiorh001
Copy link
Copy Markdown
Contributor

Implemented a full cleanup and stabilization pass for the local buyer/seller OmniClaw flow.

What changed:

  • consolidated the canonical local example into examples/local-economy/
  • removed scattered root-level compose/policy files
  • updated scripts/start_local_economy.sh to use the new example path and source .env
  • fixed x402 seller verification/ledger recording
  • fixed buyer and seller transaction history so latest entries show correctly
  • fixed x402 custom-priced payments so recorded amounts match the actual settled amount
  • standardized user-facing amount formatting to two decimals
  • corrected Gateway balance handling by separating:
    • gateway_balance = spendable / withdrawable Circle Gateway available balance
    • gateway_onchain_balance = raw on-chain Gateway contract balance
  • updated payer-side balance checks to use the actual spendable Gateway balance
  • verified CLI/API flow end to end:
    • seller serve
    • unpaid 402
    • buyer pay
    • seller runtime 402 -> 200
    • correct buyer/seller ledger entries
    • seller CLI withdraw from available balance

Important bug fixed:

  • we previously mixed raw on-chain Gateway balance with Circle Gateway available balance, which could make funds appear immediately withdrawable when they were not yet available
    through Circle batch settlement. That accounting model is now corrected.

Verified behavior:

  • buyer pays protected seller endpoint successfully
  • seller receives and records incoming settlement
  • balances and transactions reflect the real settled amount
  • seller can withdraw from the actually available Gateway balance

This makes the local two-sided example accurate and usable as the canonical reference flow.

@Abiorh001 Abiorh001 requested a review from abiorh-claw April 5, 2026 09:25
@abiorh-claw abiorh-claw merged commit be27bd7 into main Apr 5, 2026
5 checks passed
@abiorh-claw abiorh-claw deleted the fix_docker branch April 5, 2026 09:45
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.

2 participants