Skip to content

tools: drain-product-account (phone-signed PAS/PGAS mover)#406

Merged
EnderOfWorlds007 merged 1 commit into
mainfrom
add-product-account-drain-tool
Jun 16, 2026
Merged

tools: drain-product-account (phone-signed PAS/PGAS mover)#406
EnderOfWorlds007 merged 1 commit into
mainfrom
add-product-account-drain-tool

Conversation

@EnderOfWorlds007

Copy link
Copy Markdown
Collaborator

Adds tools/drain-product-account.ts — a bun-run helper to move native PAS + PGAS between the user's own phone-controlled product accounts, signed on the phone via the live CLI session.

Why

Built to push a product account below the playground-app funds floors (native < 0.3 PAS and PGAS < 5B) so the "Become a builder" resource drip fires on a star — the live test for the playground-app funds gate (hasSufficientFunds). Also doubles as a general "move funds between my product accounts" / refund tool (set PRODUCT_ID / DEST / LEAVE_*).

Key facts baked into the header

  • Product accounts are soft-derived /product/{productId}/{index} off the wallet root; the same phone signs for any of them — createPlaygroundSessionSigner(session, { productId, derivationIndex }). (Verified: same root → playground.dot/0 and pr-472-playgroundtest.dot/0 are different accounts the one phone controls.)
  • Requires a repo version whose host-papp can decode the current session (SsoSessionsV3 + deviceEncPubKey, host-papp 0.8.7 / terminal 0.5.0, CLI ≥ v0.40.x). A stale checkout silently returns 0 sessions → "NO SESSION".
  • Fees paid in PGAS via ChargeAssetTxPayment (pattern from polkadot-app-deploy's PGAS_FEE_OPTIONS).
  • DRY_RUN=1 bun tools/drain-product-account.ts previews; each transfer is one phone approval.

Sits alongside the other ad-hoc tools/*.ts. Not in the typecheck scope; lint:license passes.

@EnderOfWorlds007 EnderOfWorlds007 merged commit 39f6531 into main Jun 16, 2026
19 of 20 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/add-product-account-drain-tool bash

@github-actions

Copy link
Copy Markdown
Contributor

E2E Test Pass · ❌ FAIL

Tag: e2e-ci-pr · Branch: add-product-account-drain-tool · Commit: ca0f627 · Run logs

Cell Result Time
pr-deploy-cdm ✅ PASS 4m17s
pr-mod ✅ PASS 1m23s
pr-deploy-frontend ❌ FAIL 14m34s
pr-deploy-foundry ✅ PASS 0m50s
pr-preflight ✅ PASS 3m04s
pr-install ✅ PASS 0m46s
pr-login-session ✅ PASS 1m43s
${{ matrix.cell }} ⏭️ SKIP 0m00s
${{ matrix.cell }} ⏭️ SKIP 0m-7s

Sentry traces: view spans for this run

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.

1 participant