Skip to content

feat(truapi)!: funding discovery, quotes, progress and deposit instructions - #1318

Merged
filvecchiato merged 249 commits into
mainfrom
funding/discovery-quotes
Nov 4, 2026
Merged

filvecchiato merged 249 commits into
mainfrom
funding/discovery-quotes

Conversation

@filvecchiato

@filvecchiato filvecchiato commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #1317 (merged). Part of #1134, #1135, #1139 and #1140.

Providers are discovered, quoted and chosen, and hosts get each session's progress with every change.

Providers: only the ones the host lists with set_funding_providers; the host controls the list. Their Worker manifests (v1 and v2) are read from dotNS with their includes.funding, cached for a day. A provider is named by its ProductId everywhere: candidates, quote rows, sessions, the provider frame and select_funding_provider.

Quotes

  • get_funding_quote(intent, ask) asks every provider's worker, at most 8 at once. Each row goes Pending → Quoted or Unavailable; a provider silent for 10 s is unavailable.
  • A quote that does not price the ask's amount, moves nothing, charges more in fees than the user sends, has an unusable id or has expired counts as the provider being unavailable.
  • Answers are reused for 30 s within the session that asked, never across sessions. A newer ask for the session withdraws the one before it, with its late rows and the quotes it offered. What answers show about a provider is learned for 12 h.
  • select_funding_provider(intent, provider, quote_id) hands the session over on the quote the user chose, which must be one the core offered for that session.

Progress: funding_session_changed(intent, status, progress) carries the per-rail steps with times, the provider's Details, the latest Deposit (an inbound step: crypto address with payment URI, or bank details), a PaymentReceived mismatch and money_moved. Details and Deposit are kept up to 8 each per session, as short plain lines; deposit instructions must name something to pay, not have expired, carry a payment URI rather than a web, script or file one, and pay by the chosen quote's rail and asset. Anything else is refused with InvalidDetail.

Storage: sessions are stored in format 4; rows #1317 stored in format 3 load with no chosen quote and no mismatch.

Tests: truapi unit tests. A quote asked as a provider's worker restarts waits for the new connection. The funding battery with a quoting worker is in #1836.

# Conflicts:
#	rust/crates/truapi-codegen/tests/golden/wire_table.rs
#	rust/crates/truapi/src/host_core.rs
#	rust/crates/truapi/src/native.rs
#	rust/crates/truapi/src/native/platform.rs
#	rust/crates/truapi/src/native/runtime.rs
#	rust/crates/truapi/src/runtime/tests.rs
# Conflicts:
#	rust/crates/truapi-codegen/tests/golden/dispatcher.rs
#	rust/crates/truapi-codegen/tests/golden/host-callbacks.ts
#	rust/crates/truapi-codegen/tests/golden/wire_table.rs
#	rust/crates/truapi-host-cli/README.md
#	rust/crates/truapi-host-cli/src/main.rs
#	rust/crates/truapi/src/api.rs
#	rust/crates/truapi/src/host_core.rs
#	rust/crates/truapi/src/native.rs
#	rust/crates/truapi/src/native/platform.rs
#	rust/crates/truapi/src/native/runtime.rs
#	rust/crates/truapi/src/runtime/tests.rs
#	rust/crates/truapi/src/v01.rs
#	rust/crates/truapi/src/versioned.rs
# Conflicts:
#	rust/crates/truapi-codegen/tests/golden/wire_table.rs
#	rust/crates/truapi/RUNTIME.md
#	rust/crates/truapi/src/host_core.rs
#	rust/crates/truapi/src/lib.rs
#	rust/crates/truapi/src/native.rs
#	rust/crates/truapi/src/native/callbacks.rs
#	rust/crates/truapi/src/native/platform.rs
#	rust/crates/truapi/src/native/runtime.rs
#	rust/crates/truapi/src/platform.rs
#	rust/crates/truapi/src/runtime/services.rs
@github-actions github-actions Bot added area:js Touches the TypeScript packages, the playground or the explorer area:core Touches the Rust core under rust/crates labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size report

Compared with main at aef8ba1.

Raw Gzip Brotli
truapi-host 8.43 MiB (+25.5 KiB, +0.3%) 5.84 MiB (+9.0 KiB, +0.2%) 5.52 MiB (+7.8 KiB, +0.1%)
truapi-provider 4.04 MiB 1.27 MiB 961.4 KiB
truapi 7.52 MiB (+22.3 KiB, +0.3%) 1.05 MiB (+3.8 KiB, +0.4%) 873.9 KiB (+3.2 KiB, +0.4%)
trinity-stack 634.2 KiB 247.5 KiB 204.8 KiB
Total 20.62 MiB (+47.8 KiB, +0.2%) 8.41 MiB (+12.9 KiB, +0.1%) 7.51 MiB (+11.0 KiB, +0.1%)

WebAssembly modules

Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 3.32 MiB (+24.8 KiB, +0.7%) 1.15 MiB (+8.8 KiB, +0.8%) 878.9 KiB (+7.6 KiB, +0.9%)
truapi-host/wasm/web/truapi_verifiable_bg.wasm 4.89 MiB 4.64 MiB 4.61 MiB
truapi-provider/truapi_provider_bg.wasm 4.00 MiB 1.27 MiB 953.6 KiB
trinity-stack/wasm/trinity_stack_bg.wasm 564.4 KiB 230.5 KiB 190.0 KiB
Changed files (9)
Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 3.32 MiB (+24.8 KiB, +0.7%) 1.15 MiB (+8.8 KiB, +0.8%) 878.9 KiB (+7.6 KiB, +0.9%)
truapi/explorer/codegen/types.js 309.4 KiB (+10.4 KiB, +3.5%) 43.6 KiB (+1.6 KiB, +3.7%) 33.8 KiB (+1.3 KiB, +4.0%)
truapi/playground/codegen/truapi-dts.js 383.3 KiB (+7.2 KiB, +1.9%) 66.2 KiB (+1.6 KiB, +2.4%) 52.7 KiB (+1.3 KiB, +2.4%)
truapi/generated/types.js 86.8 KiB (+2.1 KiB, +2.4%) 10.7 KiB (+385 B, +3.7%) 8.9 KiB (+320 B, +3.6%)
truapi/generated/client.js 94.6 KiB (+1.1 KiB, +1.2%) 14.5 KiB (+141 B, +1.0%) 12.1 KiB (+102 B, +0.8%)
truapi/playground/codegen/services.js 126.7 KiB (+1019 B, +0.8%) 19.6 KiB (+177 B, +0.9%) 16.4 KiB (+157 B, +0.9%)
truapi-host/generated/host-callbacks.js 13.4 KiB (+805 B, +6.2%) 4.1 KiB (+219 B, +5.5%) 3.5 KiB (+191 B, +5.6%)
truapi/generated/wire-decode.js 36.8 KiB (+374 B, +1.0%) 3.7 KiB (+25 B, +0.7%) 3.1 KiB (+40 B, +1.3%)
truapi/generated/wire-table.js 11.3 KiB (+99 B, +0.9%) 1.8 KiB (+11 B, +0.6%) 1.5 KiB (+7 B, +0.5%)

Commit: 7ac98cd

@filvecchiato
filvecchiato added this pull request to stack #1320 October 7, 2026 19:03
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

CI Status: 24 required jobs green, 21 passed and 3 skipped by path filter.

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

Signing credentials: valid as of 2026-11-04

Commit 7ac98cd1 · run log

@pgherveou pgherveou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick initial comments will get back to it

@filvecchiato
filvecchiato enabled stacked auto-merge November 4, 2026 09:53
@filvecchiato
filvecchiato added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit e92024d Nov 4, 2026
81 of 83 checks passed
@filvecchiato
filvecchiato deleted the funding/discovery-quotes branch November 4, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Touches the Rust core under rust/crates area:docs Touches documentation area:js Touches the TypeScript packages, the playground or the explorer area:rfc An RFC, or work tracked by one under docs/rfcs size:XXL 1000 lines or more; split it, or say in the description why it cannot be status:waiting-on-review Ready for a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Funding worker and provider bundles Progress and history for the host Quote contract and URL quotes

3 participants