Skip to content

feat(truapi): pay withdrawals into their account as getcash does - #1228

Closed
filvecchiato wants to merge 1 commit into
funding/18-payment-requestfrom
funding/19-withdraw-payment
Closed

filvecchiato wants to merge 1 commit into
funding/18-payment-requestfrom
funding/19-withdraw-payment

Conversation

@filvecchiato

Copy link
Copy Markdown
Collaborator

The payment leg of a withdrawal, as getcash pays its withdrawal key (main c63202a6):

getcash here
Key wd:eph:<dest>:<n>, counter per wd:<dest> assign_funding_withdrawal: same label under the funding product, counter wd:<dest>, skipping accounts that hold CASH on People
Payment id: key, then blake2(key ‖ u32le attempt) funding_attempt_id, shared with top-ups
Page requests the payment; AlreadyExists is success, other errors fail requested through PaymentPlatform (#1227) as the funding product; a refusal ends the session for a retry
CASH on the key completes payment from any rank-0 state CASH on the account moves an open, expired, cancelled or payment-failed session to Paid
paymentTaken from the latest status; never expires or cancels recomputed from the host's latest word on the current attempt; a word on an earlier attempt is ignored
30 min window, expiry only on a chain-read tick same
Retry: attempt + 1, fresh window, re-sent retry_funding, while the account is still read (72 h), so CASH that arrived is never asked for twice
Cancel: refused once taken; reads key CASH and host status within 8 s same, from open, expired or payment-failed; unconfirmed when the host does not answer

Differences: the host's Completed marks the payment taken but the session waits for the CASH on the account before it is Paid. A Paid session is converted and sent on in the next PR.

Part of #1179

@github-actions github-actions Bot added the rust Pull requests that update rust code label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Bundle size report

Compared with main at 02c9712.

Raw Gzip Brotli
truapi-host 7.86 MiB (+71.3 KiB, +0.9%) 5.65 MiB (+24.3 KiB, +0.4%) 5.38 MiB (+19.0 KiB, +0.3%)
truapi-provider 4.03 MiB 1.27 MiB 959.8 KiB
truapi 5.75 MiB (+36.2 KiB, +0.6%) 810.3 KiB (+5.4 KiB, +0.7%) 664.2 KiB (+4.2 KiB, +0.6%)
Total 17.64 MiB (+107.5 KiB, +0.6%) 7.72 MiB (+29.7 KiB, +0.4%) 6.97 MiB (+23.2 KiB, +0.3%)

WebAssembly modules

Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 2.76 MiB (+70.9 KiB, +2.6%) 986.4 KiB (+24.2 KiB, +2.5%) 745.4 KiB (+18.9 KiB, +2.6%)
truapi-host/wasm/web/truapi_verifiable_bg.wasm 4.89 MiB 4.64 MiB 4.61 MiB
truapi-provider/truapi_provider_bg.wasm 3.99 MiB 1.26 MiB 952.1 KiB
Changed files (10)
Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 2.76 MiB (+70.9 KiB, +2.6%) 986.4 KiB (+24.2 KiB, +2.5%) 745.4 KiB (+18.9 KiB, +2.6%)
truapi/explorer/codegen/types.js 217.9 KiB (+13.5 KiB, +6.6%) 29.7 KiB (+1.9 KiB, +6.8%) 23.9 KiB (+1.5 KiB, +6.6%)
truapi/playground/codegen/truapi-dts.js 285.2 KiB (+12.4 KiB, +4.5%) 49.1 KiB (+2.1 KiB, +4.6%) 39.6 KiB (+1.7 KiB, +4.5%)
truapi/playground/codegen/services.js 98.0 KiB (+3.4 KiB, +3.6%) 14.7 KiB (+472 B, +3.2%) 12.3 KiB (+362 B, +2.9%)
truapi/generated/types.js 62.8 KiB (+3.0 KiB, +5.0%) 7.7 KiB (+436 B, +5.9%) 6.5 KiB (+338 B, +5.3%)
truapi/generated/client.js 69.0 KiB (+2.5 KiB, +3.8%) 10.3 KiB (+368 B, +3.6%) 8.5 KiB (+317 B, +3.8%)
truapi/generated/wire-decode.js 28.2 KiB (+1.1 KiB, +3.9%) 3.0 KiB (+77 B, +2.6%) 2.5 KiB (+60 B, +2.4%)
truapi-host/generated/host-callbacks.js 10.5 KiB (+432 B, +4.2%) 3.4 KiB (+132 B, +4.0%) 2.8 KiB (+116 B, +4.1%)
truapi/generated/wire-table.js 8.8 KiB (+295 B, +3.4%) 1.5 KiB (+26 B, +1.7%) 1.2 KiB (+19 B, +1.5%)
truapi-host/wasm/web/truapi_server.js 57.8 KiB (+3 B) 10.5 KiB (+3 B) 9.1 KiB (-3 B)

Commit: bda3d56

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

CI Status: not green, 1 item needs attention.

  • rust: failure
All job results
job result
android-bindings success
bundle-size success
changes success
changeset-guard success
cli-package success
codegen success
e2e skipped
explorer success
headless-install success
host-android-bindings success
host-android-detekt success
host-wasm success
ios-bindings success
ios-swift success
licenses success
playground success
provider-android-bindings skipped
release-guard success
rust failure
ts-client success
ts-debugger success
ts-host success
wasm-provider success
workflow-lint skipped

Signing credentials: failure as of 2026-10-06, a release may fail

Commit bda3d569 · run log

@filvecchiato

Copy link
Copy Markdown
Collaborator Author

Consolidated into #1232, which carries these commits.

@filvecchiato
filvecchiato deleted the funding/19-withdraw-payment branch October 6, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant