Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Sep 24, 2025

Finish CLI withdrawal flow by adding commands.receiveWithdrawalCmd and implementing blockchain.fundsAdmin.Withdraw and blockchain.fundsAdmin.ReceiveWithdrawal for app-chain initiation and settlement-chain receipt

This change completes the withdrawal flow in the CLI and blockchain layer by wiring app-chain initiation and settlement-chain receipt, updating command UX, and consolidating balance queries to the default signer.

  • Add blockchain.fundsAdmin.Withdraw(ctx, amount) to initiate withdrawals via acg.AppChainGateway.Withdraw and blockchain.fundsAdmin.ReceiveWithdrawal(ctx) to finalize on the settlement chain, with constructor blockchain.NewFundsAdmin initializing the app-chain gateway (funds_admin.go).
  • Replace the CLI withdraw options to accept only --amount, implement commands.withdrawHandler, and introduce commands.receiveWithdrawalCmd with commands.receiveWithdrawalHandler; remove check-withdrawals and address-based balances (funds.go).
  • Move wei formatting to currency.FromWei and add tests and test-only exports for PicoDollar formatting (currency.go, currency_test.go, exports_test.go).
  • Adjust indexer logging to record raw pico-dollar integers in payer registry event handlers (payer_registry_storer.go).
  • Add integration-style tests and helpers for FundsAdmin and coverage for minting and balances (funds_admin_test.go).

📍Where to Start

Start with the CLI flow entry points in commands.withdrawHandler and commands.receiveWithdrawalHandler in funds.go, then follow into blockchain.fundsAdmin.Withdraw and blockchain.fundsAdmin.ReceiveWithdrawal in funds_admin.go.


Macroscope summarized 1e2ee84.

@mkysel mkysel requested a review from a team as a code owner September 24, 2025 14:58
@graphite-app
Copy link

graphite-app bot commented Sep 24, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@mkysel mkysel force-pushed the mkysel/withdrawal-flow branch from 1a4e00e to f13743e Compare September 24, 2025 17:26
@mkysel mkysel linked an issue Sep 24, 2025 that may be closed by this pull request
@mkysel mkysel merged commit 73e7f43 into main Sep 25, 2025
11 checks passed
@mkysel mkysel deleted the mkysel/withdrawal-flow branch September 25, 2025 14:01
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.

Implement deposit/withdrawal flows in xmtpd-cli

3 participants