Skip to content

feat(truapi)!: funding provider trait, reports and settlement - #1242

Closed
filvecchiato wants to merge 5 commits into
funding/bridgefrom
funding/provider
Closed

filvecchiato wants to merge 5 commits into
funding/bridgefrom
funding/provider

Conversation

@filvecchiato

@filvecchiato filvecchiato commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

A provider's worker runs the funding sessions the user chose it for, and the host decides how they end. Stacked on the test hosts PR.

  • FundingProvider trait (22, Worker only): serveSubscribe replays the caller's sessions in flight, then streams new ones and cancel requests; report stores each update on the session; presentFrame shows one of the provider's screens in a host frame
  • Reports come only from the assigned provider and only move forward: AwaitingPayment, PaymentReceived, Converting, Crediting { top_up_id, amount } (up to three, for partial-claim retries), Delivered; outbound Collecting { payment_id, amount }; Failed before funds move. A top-up or payment id another of the provider's sessions already names is refused with DuplicateId, so one claim never settles two sessions
  • The core ends a session as Delivered from what the named top-ups claimed and Released once the named payment completes, following TopUpPlatform and PaymentPlatform; nothing moved fails it. Once funds move, the provider cannot fail the session and its deadline no longer applies
  • select_funding_provider (Rust and native) assigns a session; the core holds the provider's worker while it is open, and again after a restart
  • Cancel ends an unassigned session, asks the provider of an assigned one, and is refused once the provider has seen the user's payment
  • make e2e-funding-cli runs a provider worker on the CLI host: the scripted overlay hands provide sessions to the product that asked, scripted engines complete its top-ups and payment requests, and an inbound session resumes and is delivered after a host restart (13 cases)

Breaking: hosts implement present_provider_frame on FundingPlatform (natively NativeFundingCallbacks).

Not here: candidates and quotes, so select_funding_provider accepts any product id for now.

Part of #1145, #1140, #1141.

@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 54b6bc4.

Raw Gzip Brotli
truapi-host 7.88 MiB (+93.6 KiB, +1.2%) 5.66 MiB (+31.4 KiB, +0.5%) 5.39 MiB (+21.9 KiB, +0.4%)
truapi-provider 4.03 MiB 1.27 MiB 959.8 KiB
truapi 5.78 MiB (+65.5 KiB, +1.1%) 814.7 KiB (+9.8 KiB, +1.2%) 667.6 KiB (+7.7 KiB, +1.2%)
Total 17.69 MiB (+159.1 KiB, +0.9%) 7.73 MiB (+41.2 KiB, +0.5%) 6.98 MiB (+29.5 KiB, +0.4%)

WebAssembly modules

Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 2.78 MiB (+93.2 KiB, +3.4%) 993.5 KiB (+31.3 KiB, +3.3%) 748.2 KiB (+21.7 KiB, +3.0%)
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.78 MiB (+93.2 KiB, +3.4%) 993.5 KiB (+31.3 KiB, +3.3%) 748.2 KiB (+21.7 KiB, +3.0%)
truapi/explorer/codegen/types.js 227.6 KiB (+23.2 KiB, +11.3%) 31.1 KiB (+3.2 KiB, +11.5%) 25.0 KiB (+2.5 KiB, +11.3%)
truapi/playground/codegen/truapi-dts.js 295.7 KiB (+22.9 KiB, +8.4%) 50.8 KiB (+3.9 KiB, +8.2%) 41.0 KiB (+3.1 KiB, +8.0%)
truapi/playground/codegen/services.js 100.7 KiB (+6.1 KiB, +6.5%) 15.1 KiB (+906 B, +6.2%) 12.7 KiB (+721 B, +5.9%)
truapi/generated/types.js 65.4 KiB (+5.5 KiB, +9.3%) 8.0 KiB (+793 B, +10.7%) 6.7 KiB (+551 B, +8.7%)
truapi/generated/client.js 71.6 KiB (+5.1 KiB, +7.7%) 10.7 KiB (+800 B, +7.9%) 8.9 KiB (+653 B, +7.7%)
truapi/generated/wire-decode.js 29.2 KiB (+2.1 KiB, +7.6%) 3.1 KiB (+173 B, +5.9%) 2.6 KiB (+142 B, +5.7%)
truapi/generated/wire-table.js 9.1 KiB (+601 B, +6.9%) 1.6 KiB (+72 B, +4.6%) 1.3 KiB (+53 B, +4.3%)
truapi-host/generated/host-callbacks.js 10.5 KiB (+399 B, +3.9%) 3.3 KiB (+122 B, +3.7%) 2.8 KiB (+113 B, +4.0%)
truapi-host/wasm/web/truapi_server.js 57.8 KiB (+3 B) 10.5 KiB (-1 B) 9.1 KiB (+16 B, +0.2%)

Commit: e67c493

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

CI Status: not green, 1 item needs attention.

  • playground: 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
funding-battery success
headless-install success
host-android-bindings success
host-android-detekt success
host-wasm success
ios-bindings success
ios-swift success
licenses success
playground failure
provider-android-bindings success
release-guard success
rust success
ts-client success
ts-debugger success
ts-host success
wasm-provider success
workflow-lint success

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

Commit e67c4935 · run log

@github-actions github-actions Bot added documentation Improvements or additions to documentation javascript Pull requests that update javascript code labels Oct 7, 2026
@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label Oct 7, 2026
@filvecchiato
filvecchiato added this pull request to stack #1284 October 7, 2026 09:49
@filvecchiato
filvecchiato removed this pull request from stack #1284 October 7, 2026 10:00
@filvecchiato
filvecchiato added this pull request to stack #1287 October 7, 2026 10:00
@filvecchiato
filvecchiato removed this pull request from stack #1287 October 7, 2026 19:03
@filvecchiato

Copy link
Copy Markdown
Collaborator Author

Moved to #1317 (provider trait, reports and settlement), stacked on #1315.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code javascript Pull requests that update javascript code rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant