xytara 3.1.16 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +120 -92
- package/RELEASE_NOTES.md +7 -3
- package/START_HERE.md +56 -224
- package/bin/xytara.js +21 -8
- package/client.js +79 -1
- package/lib/{delivery_receipt.js → delivery_receipt_verify.js} +14 -100
- package/package.json +25 -35
- package/scripts/verify_client.js +418 -0
- package/scripts/verify_release_candidate.js +146 -45
- package/.env.example +0 -173
- package/ADAPTER_START_HERE.md +0 -56
- package/BSV_TERANODE_PLATFORM_DISCONTINUITY_RUNBOOK.md +0 -126
- package/CARRIED_HANDOFF_DEMO.md +0 -60
- package/EXAMPLE_PATHS.md +0 -53
- package/FINAL_CONTRACT.md +0 -498
- package/PARTNER_READY_PATH.md +0 -71
- package/PUBLIC_DEMO_SCRIPT.md +0 -78
- package/REAL_PAYMENT_SETUP.md +0 -320
- package/SERVICE_CONTRACT.md +0 -419
- package/SUPABASE_RUNTIME_STATE_SETUP.md +0 -61
- package/TERMINOLOGY.md +0 -50
- package/WHY_XYTARA_XOONYA.md +0 -63
- package/XT1_EXECUTION_TRUTH_STANDARD.md +0 -78
- package/XYTARA_ADAPTER_PROTOCOL_TRUTH_MODEL.md +0 -75
- package/XYTARA_AUTONOMOUS_ENTRY_MODEL.md +0 -124
- package/XYTARA_DEFAULT_PATH_MODEL.md +0 -84
- package/XYTARA_EXECUTION_TRUTH_MODEL.md +0 -171
- package/XYTARA_PAYMENT_RAIL_TRUTH_MODEL.md +0 -68
- package/adapters/AUTHORING_GUIDE.md +0 -244
- package/adapters/ONBOARDING_POSTURE.md +0 -61
- package/adapters/THIRD_PARTY_SUBMISSION_PROCESS.md +0 -84
- package/adapters/adapter-manifest.schema.json +0 -283
- package/adapters/examples/example-execution-adapter.js +0 -61
- package/adapters/examples/example-execution-adapter.manifest.json +0 -81
- package/adapters/examples/example-settlement-adapter.js +0 -55
- package/adapters/examples/example-settlement-adapter.manifest.json +0 -78
- package/adapters/examples/example-third-party-acp-registration.submission-bundle.json +0 -124
- package/adapters/examples/example-third-party-erc8004-registration.submission-bundle.json +0 -121
- package/adapters/examples/example-third-party-identity-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-identity-registration.record.json +0 -26
- package/adapters/examples/example-third-party-identity-registration.submission-bundle.json +0 -126
- package/adapters/examples/example-third-party-langchain-registration.submission-bundle.json +0 -124
- package/adapters/examples/example-third-party-mpp-registration.submission-bundle.json +0 -120
- package/adapters/examples/example-third-party-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-registration.record.json +0 -28
- package/adapters/examples/example-third-party-registration.submission-bundle.json +0 -126
- package/adapters/examples/example-third-party-settlement-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-settlement-registration.record.json +0 -26
- package/adapters/examples/example-third-party-settlement-registration.submission-bundle.json +0 -127
- package/adapters/examples/langchain-reference-execution-adapter.js +0 -81
- package/adapters/examples/langchain-reference-execution-adapter.manifest.json +0 -79
- package/adapters/examples/langgraph-reference-execution-adapter.js +0 -81
- package/adapters/examples/langgraph-reference-execution-adapter.manifest.json +0 -79
- package/adapters/examples/minimal-third-party-execution-adapter.js +0 -61
- package/adapters/examples/minimal-third-party-execution-adapter.manifest.json +0 -79
- package/adapters/examples/minimal-third-party-execution-registration.record.json +0 -26
- package/adapters/examples/minimal-third-party-execution.certification-pack.json +0 -22
- package/adapters/examples/minimal-third-party-execution.submission-bundle.json +0 -126
- package/adapters/integration-certification-pack.schema.json +0 -82
- package/adapters/integration-registration-record.schema.json +0 -114
- package/adapters/integration-submission-bundle-set.schema.json +0 -39
- package/adapters/integration-submission-bundle.schema.json +0 -34
- package/adapters/interfaces.js +0 -56
- package/bin/xytara-release.js +0 -1429
- package/examples/_demo_env.js +0 -40
- package/examples/adapter_review_walkthrough.js +0 -54
- package/examples/export_carried_handoff.js +0 -81
- package/examples/funded_runtime_walkthrough.js +0 -71
- package/examples/partner_launch_walkthrough.js +0 -44
- package/examples/quickstart.js +0 -3256
- package/fixtures/catalog.js +0 -1156
- package/index.js +0 -395
- package/integrations/dispatch.js +0 -276
- package/integrations/registry-snapshot.schema.json +0 -36
- package/integrations/registry.js +0 -2261
- package/integrations/views.js +0 -28
- package/lib/a2a_lane_contract.js +0 -104
- package/lib/a2a_rpc.js +0 -287
- package/lib/a2c_lane_contract.js +0 -111
- package/lib/account_auth.js +0 -585
- package/lib/acp_lane_contract.js +0 -54
- package/lib/activity_audit_contract.js +0 -322
- package/lib/adapter_certification_contract.js +0 -130
- package/lib/adapter_depth_contract.js +0 -218
- package/lib/adapter_pack.js +0 -118
- package/lib/adapter_partner_pack.js +0 -89
- package/lib/adapter_promotion_pack.js +0 -89
- package/lib/adapter_protocol_truth_contract.js +0 -229
- package/lib/agent_identity.js +0 -162
- package/lib/announcement_pack.js +0 -61
- package/lib/artifact_distribution_lane_contract.js +0 -54
- package/lib/asyncapi_contract.js +0 -150
- package/lib/auth_interop_contract.js +0 -80
- package/lib/authority_binding_lifecycle_contract.js +0 -182
- package/lib/autonomous_entry_contract.js +0 -409
- package/lib/bolt_adapter.js +0 -187
- package/lib/bolt_lane_contract.js +0 -55
- package/lib/bolt_payment_front.js +0 -224
- package/lib/business_cockpit.js +0 -378
- package/lib/buyer_event_log.js +0 -230
- package/lib/buyer_safety_policy.js +0 -132
- package/lib/capability_execution_truth.js +0 -276
- package/lib/capability_registry.js +0 -633
- package/lib/catalog_contract.js +0 -966
- package/lib/catalog_family_model.js +0 -193
- package/lib/catalog_views.js +0 -55
- package/lib/cdp_jwt.js +0 -57
- package/lib/checkout_event_security.js +0 -142
- package/lib/checkout_processor_adapter.js +0 -217
- package/lib/cloudevents_contract.js +0 -80
- package/lib/command_flow.js +0 -911
- package/lib/commerce_artifacts.js +0 -591
- package/lib/commerce_authority.js +0 -449
- package/lib/commerce_bridge.js +0 -274
- package/lib/commerce_cases.js +0 -399
- package/lib/commerce_checkout.js +0 -509
- package/lib/commerce_coordination.js +0 -346
- package/lib/commerce_economics.js +0 -4017
- package/lib/commerce_identity.js +0 -578
- package/lib/commerce_quotes.js +0 -266
- package/lib/commerce_reports.js +0 -14461
- package/lib/commerce_runtime.js +0 -322
- package/lib/commerce_shell.js +0 -257
- package/lib/crypto_agility_matrix.js +0 -125
- package/lib/default_path_contract.js +0 -412
- package/lib/delivery_summary_contract.js +0 -95
- package/lib/ecosystem_entry.js +0 -64
- package/lib/erc8004_lane_contract.js +0 -65
- package/lib/event_system_lane_contract.js +0 -75
- package/lib/execution_dedupe.js +0 -86
- package/lib/execution_truth_contract.js +0 -234
- package/lib/external_credit_bridge.js +0 -142
- package/lib/external_execution_policy.js +0 -143
- package/lib/external_execution_runtime.js +0 -238
- package/lib/feature_control_lane_contract.js +0 -54
- package/lib/first_run_conversion_contract.js +0 -290
- package/lib/framework_lane_contract.js +0 -89
- package/lib/framework_provider_promotion.js +0 -235
- package/lib/full_catalog_contract.js +0 -525
- package/lib/go_live_operator_pack.js +0 -391
- package/lib/http_transport.js +0 -99
- package/lib/identity_auth.js +0 -175
- package/lib/identity_interop_contract.js +0 -82
- package/lib/integration_matrix_contract.js +0 -102
- package/lib/l402_adapter.js +0 -241
- package/lib/l402_lane_contract.js +0 -55
- package/lib/l402_payment_front.js +0 -265
- package/lib/launch_narrative.js +0 -53
- package/lib/lifecycle_continuity_contract.js +0 -115
- package/lib/machine_identity_registry_contract.js +0 -199
- package/lib/major_rails_lane_contract.js +0 -150
- package/lib/market_lane_contract.js +0 -467
- package/lib/market_lane_depth_contract.js +0 -182
- package/lib/market_lane_promotion_contract.js +0 -210
- package/lib/market_lane_trace_contract.js +0 -278
- package/lib/mcp_lane_contract.js +0 -137
- package/lib/mpp_adapter.js +0 -237
- package/lib/network_transport.js +0 -110
- package/lib/offline_verifiability_recovery_contract.js +0 -155
- package/lib/openapi_contract.js +0 -300
- package/lib/operational_receipt_contract.js +0 -165
- package/lib/operator_intelligence.js +0 -407
- package/lib/outreach_copy_pack.js +0 -51
- package/lib/outreach_message_pack.js +0 -71
- package/lib/outreach_proof.js +0 -71
- package/lib/outreach_target_pack.js +0 -60
- package/lib/partner_intelligence.js +0 -105
- package/lib/payment_config.js +0 -257
- package/lib/payment_front_registry.js +0 -53
- package/lib/payment_protocol_contract.js +0 -165
- package/lib/payment_rail_truth_contract.js +0 -324
- package/lib/payment_verification.js +0 -357
- package/lib/phase_10_closeout_pack.js +0 -45
- package/lib/phase_10_completion_pack.js +0 -76
- package/lib/phase_10_decision_record_pack.js +0 -54
- package/lib/phase_10_decision_resolution_pack.js +0 -53
- package/lib/phase_10_demand_signal_adapters_runtime_pack.js +0 -74
- package/lib/phase_10_ecosystem_backlog_triage_runtime_pack.js +0 -74
- package/lib/phase_10_freeze_baseline_pack.js +0 -67
- package/lib/phase_10_freeze_review_pack.js +0 -64
- package/lib/phase_10_gate_pack.js +0 -57
- package/lib/phase_10_long_tail_continuity_pack.js +0 -80
- package/lib/phase_10_long_tail_ecosystem_pack.js +0 -66
- package/lib/phase_10_niche_extension_registry_runtime_pack.js +0 -74
- package/lib/phase_1_claude_mcp_pack.js +0 -60
- package/lib/phase_1_claude_mcp_runtime_pack.js +0 -52
- package/lib/phase_1_ecosystem_pack.js +0 -67
- package/lib/phase_1_openai_codex_pack.js +0 -60
- package/lib/phase_1_openai_codex_runtime_pack.js +0 -52
- package/lib/phase_2_base_runtime_pack.js +0 -71
- package/lib/phase_2_base_usdc_runtime_pack.js +0 -72
- package/lib/phase_2_closeout_pack.js +0 -65
- package/lib/phase_2_completion_pack.js +0 -113
- package/lib/phase_2_decision_record_pack.js +0 -66
- package/lib/phase_2_decision_resolution_pack.js +0 -69
- package/lib/phase_2_eth_runtime_pack.js +0 -70
- package/lib/phase_2_evm_base_runtime_pack.js +0 -73
- package/lib/phase_2_evm_runtime_pack.js +0 -71
- package/lib/phase_2_flip_preview_pack.js +0 -60
- package/lib/phase_2_freeze_review_pack.js +0 -99
- package/lib/phase_2_gate_pack.js +0 -77
- package/lib/phase_2_payment_rails_pack.js +0 -71
- package/lib/phase_2_usdc_runtime_pack.js +0 -71
- package/lib/phase_3_brc_runtime_pack.js +0 -81
- package/lib/phase_3_bsv_teranode_runtime_pack.js +0 -83
- package/lib/phase_3_closeout_pack.js +0 -62
- package/lib/phase_3_completion_pack.js +0 -94
- package/lib/phase_3_decision_record_pack.js +0 -64
- package/lib/phase_3_decision_resolution_pack.js +0 -69
- package/lib/phase_3_freeze_baseline_pack.js +0 -67
- package/lib/phase_3_freeze_review_pack.js +0 -80
- package/lib/phase_3_gate_pack.js +0 -76
- package/lib/phase_3_metanet_runtime_pack.js +0 -81
- package/lib/phase_3_native_bsv_pack.js +0 -91
- package/lib/phase_3_native_continuity_pack.js +0 -82
- package/lib/phase_4_attestation_runtime_pack.js +0 -75
- package/lib/phase_4_closeout_pack.js +0 -45
- package/lib/phase_4_completion_pack.js +0 -94
- package/lib/phase_4_decision_record_pack.js +0 -54
- package/lib/phase_4_decision_resolution_pack.js +0 -45
- package/lib/phase_4_erc8004_runtime_pack.js +0 -76
- package/lib/phase_4_freeze_baseline_pack.js +0 -67
- package/lib/phase_4_freeze_review_pack.js +0 -68
- package/lib/phase_4_gate_pack.js +0 -58
- package/lib/phase_4_identity_registry_runtime_pack.js +0 -75
- package/lib/phase_4_identity_trust_pack.js +0 -73
- package/lib/phase_4_trust_continuity_pack.js +0 -86
- package/lib/phase_5_antelope_runtime_pack.js +0 -76
- package/lib/phase_5_closeout_pack.js +0 -44
- package/lib/phase_5_completion_pack.js +0 -82
- package/lib/phase_5_constellation_dag_runtime_pack.js +0 -76
- package/lib/phase_5_decision_record_pack.js +0 -54
- package/lib/phase_5_decision_resolution_pack.js +0 -45
- package/lib/phase_5_digibyte_dgb_runtime_pack.js +0 -76
- package/lib/phase_5_freeze_baseline_pack.js +0 -67
- package/lib/phase_5_freeze_review_pack.js +0 -68
- package/lib/phase_5_gate_pack.js +0 -58
- package/lib/phase_5_hedera_hbar_runtime_pack.js +0 -76
- package/lib/phase_5_kaspa_kas_runtime_pack.js +0 -76
- package/lib/phase_5_major_rails_continuity_pack.js +0 -86
- package/lib/phase_5_major_rails_pack.js +0 -110
- package/lib/phase_5_metal_runtime_pack.js +0 -76
- package/lib/phase_5_polkadot_dot_runtime_pack.js +0 -76
- package/lib/phase_5_proton_xpr_runtime_pack.js +0 -76
- package/lib/phase_5_solana_runtime_pack.js +0 -76
- package/lib/phase_6_autogen_runtime_pack.js +0 -72
- package/lib/phase_6_closeout_pack.js +0 -46
- package/lib/phase_6_completion_pack.js +0 -77
- package/lib/phase_6_decision_record_pack.js +0 -54
- package/lib/phase_6_decision_resolution_pack.js +0 -53
- package/lib/phase_6_framework_continuity_pack.js +0 -81
- package/lib/phase_6_framework_runtime_pack.js +0 -68
- package/lib/phase_6_freeze_baseline_pack.js +0 -68
- package/lib/phase_6_freeze_review_pack.js +0 -65
- package/lib/phase_6_gate_pack.js +0 -59
- package/lib/phase_6_langchain_runtime_pack.js +0 -72
- package/lib/phase_6_langgraph_runtime_pack.js +0 -72
- package/lib/phase_6_semantic_kernel_runtime_pack.js +0 -72
- package/lib/phase_7_closeout_pack.js +0 -45
- package/lib/phase_7_completion_pack.js +0 -85
- package/lib/phase_7_decision_record_pack.js +0 -53
- package/lib/phase_7_decision_resolution_pack.js +0 -53
- package/lib/phase_7_event_system_continuity_pack.js +0 -89
- package/lib/phase_7_event_system_pack.js +0 -76
- package/lib/phase_7_freeze_baseline_pack.js +0 -74
- package/lib/phase_7_freeze_review_pack.js +0 -65
- package/lib/phase_7_gate_pack.js +0 -58
- package/lib/phase_7_kafka_runtime_pack.js +0 -74
- package/lib/phase_7_mqtt_runtime_pack.js +0 -74
- package/lib/phase_7_nats_runtime_pack.js +0 -74
- package/lib/phase_7_webhook_event_bus_runtime_pack.js +0 -74
- package/lib/phase_8_closeout_pack.js +0 -46
- package/lib/phase_8_completion_pack.js +0 -82
- package/lib/phase_8_decision_record_pack.js +0 -54
- package/lib/phase_8_decision_resolution_pack.js +0 -53
- package/lib/phase_8_external_receipt_import_runtime_pack.js +0 -74
- package/lib/phase_8_external_result_import_runtime_pack.js +0 -74
- package/lib/phase_8_freeze_baseline_pack.js +0 -71
- package/lib/phase_8_freeze_review_pack.js +0 -64
- package/lib/phase_8_gate_pack.js +0 -58
- package/lib/phase_8_proof_bridge_continuity_pack.js +0 -86
- package/lib/phase_8_proof_bridges_pack.js +0 -72
- package/lib/phase_8_proof_bundle_normalization_runtime_pack.js +0 -74
- package/lib/phase_9_closeout_pack.js +0 -46
- package/lib/phase_9_completion_pack.js +0 -82
- package/lib/phase_9_custody_refs_runtime_pack.js +0 -74
- package/lib/phase_9_decision_record_pack.js +0 -54
- package/lib/phase_9_decision_resolution_pack.js +0 -53
- package/lib/phase_9_freeze_baseline_pack.js +0 -71
- package/lib/phase_9_freeze_review_pack.js +0 -64
- package/lib/phase_9_gate_pack.js +0 -58
- package/lib/phase_9_operator_accounting_bridges_runtime_pack.js +0 -74
- package/lib/phase_9_treasury_connectivity_pack.js +0 -72
- package/lib/phase_9_treasury_continuity_pack.js +0 -86
- package/lib/phase_9_treasury_destinations_runtime_pack.js +0 -74
- package/lib/phase_program_pack.js +0 -120
- package/lib/pricing_optimization_contract.js +0 -775
- package/lib/protocol_lane_contract.js +0 -117
- package/lib/provenance_lane_contract.js +0 -54
- package/lib/provider_lane_contract.js +0 -240
- package/lib/provider_network_contract.js +0 -149
- package/lib/provider_payout_execution.js +0 -155
- package/lib/provider_registry.js +0 -852
- package/lib/provider_runtime_journey_contract.js +0 -183
- package/lib/public_surface_policy_contract.js +0 -111
- package/lib/publish_plan.js +0 -51
- package/lib/rate_limiter.js +0 -81
- package/lib/record_queries.js +0 -48
- package/lib/release_candidate.js +0 -50
- package/lib/release_center.js +0 -1093
- package/lib/release_history.js +0 -205
- package/lib/release_manifest.js +0 -113
- package/lib/release_pack.js +0 -453
- package/lib/request_rate_limit.js +0 -144
- package/lib/resource_views.js +0 -31
- package/lib/revenue_launch_path_contract.js +0 -326
- package/lib/route_matchers.js +0 -34
- package/lib/route_params.js +0 -19
- package/lib/runtime_bridge.js +0 -124
- package/lib/runtime_operations_worker.js +0 -282
- package/lib/runtime_state_store.js +0 -495
- package/lib/settlement_bsv_live.js +0 -600
- package/lib/settlement_bsv_teranode.js +0 -117
- package/lib/settlement_lane_contract.js +0 -111
- package/lib/shared_signals_lane_contract.js +0 -54
- package/lib/signed_audit_provenance_contract.js +0 -83
- package/lib/soft_launch_pack.js +0 -78
- package/lib/stablecoin_lane_contract.js +0 -76
- package/lib/stripe_mpp_lane_contract.js +0 -96
- package/lib/stripe_mpp_payment_front.js +0 -258
- package/lib/telemetry_lane_contract.js +0 -54
- package/lib/treasury_destinations_contract.js +0 -764
- package/lib/treasury_egress_policy_contract.js +0 -91
- package/lib/treasury_lane_contract.js +0 -84
- package/lib/trust_portability_boundary_contract.js +0 -72
- package/lib/x402_facilitator.js +0 -198
- package/lib/x402_lane_contract.js +0 -136
- package/lib/x402_settlement_recovery.js +0 -175
- package/scripts/buyer_events_daily_report.js +0 -79
- package/scripts/registry_cli.js +0 -275
- package/scripts/state_backup_offsite.js +0 -196
- package/scripts/verify_a2a_rpc.js +0 -131
- package/scripts/verify_adapters.js +0 -554
- package/scripts/verify_agent_identity.js +0 -153
- package/scripts/verify_all.js +0 -4963
- package/scripts/verify_bolt_adapter.js +0 -128
- package/scripts/verify_buyer_event_log.js +0 -128
- package/scripts/verify_buyer_safety.js +0 -141
- package/scripts/verify_cdp_facilitator.js +0 -110
- package/scripts/verify_checkout_processor.js +0 -109
- package/scripts/verify_commerce_bridge.js +0 -177
- package/scripts/verify_control_plane_contracts.js +0 -34
- package/scripts/verify_control_plane_routes.js +0 -70
- package/scripts/verify_delivery_summary.js +0 -112
- package/scripts/verify_examples.js +0 -19
- package/scripts/verify_execution_dedupe.js +0 -189
- package/scripts/verify_execution_surfacing.js +0 -76
- package/scripts/verify_external_execution_retry.js +0 -140
- package/scripts/verify_final_activation.js +0 -191
- package/scripts/verify_first_run_conversions.js +0 -81
- package/scripts/verify_framework_provider_promotion.js +0 -152
- package/scripts/verify_full_catalog.js +0 -174
- package/scripts/verify_integrations.js +0 -620
- package/scripts/verify_l402_adapter.js +0 -86
- package/scripts/verify_lifecycle_continuity.js +0 -96
- package/scripts/verify_lifecycle_spend_binding.js +0 -88
- package/scripts/verify_market_lane_depth.js +0 -94
- package/scripts/verify_market_lane_promotion.js +0 -103
- package/scripts/verify_market_lane_traces.js +0 -98
- package/scripts/verify_market_lanes.js +0 -102
- package/scripts/verify_mpp_adapter.js +0 -128
- package/scripts/verify_operator_observability_boundary.js +0 -83
- package/scripts/verify_pricing_experiment_plan.js +0 -124
- package/scripts/verify_production_readiness.js +0 -268
- package/scripts/verify_provider_network.js +0 -819
- package/scripts/verify_provider_runtime_breadth.js +0 -109
- package/scripts/verify_provider_runtime_journeys.js +0 -111
- package/scripts/verify_rate_limiter.js +0 -52
- package/scripts/verify_refund_credit.js +0 -106
- package/scripts/verify_revenue_launch_paths.js +0 -105
- package/scripts/verify_runtime_durability.js +0 -52
- package/scripts/verify_runtime_state_guard.js +0 -117
- package/scripts/verify_service.js +0 -15421
- package/scripts/verify_settlement.js +0 -116
- package/scripts/verify_tooling.js +0 -1412
- package/scripts/verify_treasury_public_boundary.js +0 -97
- package/scripts/verify_verify_execute_settle.js +0 -209
- package/scripts/verify_x402_facilitator.js +0 -307
- package/scripts/verify_x402_settlement_recovery.js +0 -153
- package/server.js +0 -12245
|
@@ -1,764 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { buildConfiguredTreasuryDestination, loadPaymentConfig } = require("./payment_config");
|
|
4
|
-
const {
|
|
5
|
-
buildBsvTeranodeTreasuryDestination,
|
|
6
|
-
loadBsvTeranodeConfig
|
|
7
|
-
} = require("./settlement_bsv_teranode");
|
|
8
|
-
|
|
9
|
-
const RAIL_PROFILES = [
|
|
10
|
-
{
|
|
11
|
-
rail_id: "bsv_teranode",
|
|
12
|
-
settlement_mode: "bsv_teranode",
|
|
13
|
-
reserve_role: "strategic_native_treasury",
|
|
14
|
-
compliance_posture: "public_native_treasury_identity_allowed",
|
|
15
|
-
required_fields: ["destination_id", "destination_kind", "external_ref"],
|
|
16
|
-
recommended_fields: ["network", "custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "storage_class"],
|
|
17
|
-
config_template: {
|
|
18
|
-
destination_id: "treasury_bsv_main",
|
|
19
|
-
destination_kind: "bsv_teranode_address",
|
|
20
|
-
external_ref: "1ExampleMerchantAddress",
|
|
21
|
-
custody_ref: "vault.bsv.primary",
|
|
22
|
-
reporting_ref: "ledger.bsv.primary",
|
|
23
|
-
wallet_ref: "wallet.bsv.primary",
|
|
24
|
-
provider_ref: "arc.bsv.primary",
|
|
25
|
-
network: "mainnet",
|
|
26
|
-
storage_class: "cold_primary"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
rail_id: "evm",
|
|
31
|
-
settlement_mode: "evm",
|
|
32
|
-
reserve_role: "canonical_contract_settlement",
|
|
33
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
34
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "chain_id"],
|
|
35
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "storage_class"],
|
|
36
|
-
config_template: {
|
|
37
|
-
destination_id: "treasury_evm_main",
|
|
38
|
-
destination_kind: "evm_address",
|
|
39
|
-
external_ref: "0xTreasuryAddress",
|
|
40
|
-
chain_id: "1",
|
|
41
|
-
custody_ref: "vault.evm.primary",
|
|
42
|
-
reporting_ref: "ledger.evm.primary",
|
|
43
|
-
provider_ref: "rpc.evm.primary",
|
|
44
|
-
storage_class: "warm_operational"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
rail_id: "base",
|
|
49
|
-
settlement_mode: "base",
|
|
50
|
-
reserve_role: "canonical_low-friction_evm_settlement",
|
|
51
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
52
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "chain_id"],
|
|
53
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "storage_class"],
|
|
54
|
-
config_template: {
|
|
55
|
-
destination_id: "treasury_base_main",
|
|
56
|
-
destination_kind: "evm_address",
|
|
57
|
-
external_ref: "0xBaseTreasuryAddress",
|
|
58
|
-
chain_id: "8453",
|
|
59
|
-
custody_ref: "vault.base.primary",
|
|
60
|
-
reporting_ref: "ledger.base.primary",
|
|
61
|
-
provider_ref: "rpc.base.primary",
|
|
62
|
-
storage_class: "warm_operational"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
rail_id: "solana_payment",
|
|
67
|
-
settlement_mode: "solana_payment",
|
|
68
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
69
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
70
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
71
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class"],
|
|
72
|
-
config_template: {
|
|
73
|
-
destination_id: "treasury_solana_main",
|
|
74
|
-
destination_kind: "solana_address",
|
|
75
|
-
external_ref: "ExampleSolanaTreasuryAddress",
|
|
76
|
-
network: "mainnet-beta",
|
|
77
|
-
asset_symbol: "SOL_OR_SPL",
|
|
78
|
-
custody_ref: "vault.solana.primary",
|
|
79
|
-
reporting_ref: "ledger.solana.primary",
|
|
80
|
-
wallet_ref: "wallet.solana.primary",
|
|
81
|
-
provider_ref: "rpc.solana.primary",
|
|
82
|
-
storage_class: "warm_operational"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
rail_id: "xpr_payment",
|
|
87
|
-
settlement_mode: "xpr_payment",
|
|
88
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
89
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
90
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
91
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class"],
|
|
92
|
-
config_template: {
|
|
93
|
-
destination_id: "treasury_xpr_main",
|
|
94
|
-
destination_kind: "proton_xpr_account",
|
|
95
|
-
external_ref: "examplexpracct",
|
|
96
|
-
network: "mainnet",
|
|
97
|
-
asset_symbol: "XPR",
|
|
98
|
-
custody_ref: "vault.xpr.primary",
|
|
99
|
-
reporting_ref: "ledger.xpr.primary",
|
|
100
|
-
wallet_ref: "wallet.xpr.primary",
|
|
101
|
-
provider_ref: "rpc.xpr.primary",
|
|
102
|
-
storage_class: "warm_operational"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
rail_id: "metal_payment",
|
|
107
|
-
settlement_mode: "metal_payment",
|
|
108
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
109
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
110
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
111
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class"],
|
|
112
|
-
config_template: {
|
|
113
|
-
destination_id: "treasury_metal_main",
|
|
114
|
-
destination_kind: "metal_account",
|
|
115
|
-
external_ref: "metal-account-or-address",
|
|
116
|
-
network: "mainnet",
|
|
117
|
-
asset_symbol: "METAL",
|
|
118
|
-
custody_ref: "vault.metal.primary",
|
|
119
|
-
reporting_ref: "ledger.metal.primary",
|
|
120
|
-
wallet_ref: "wallet.metal.primary",
|
|
121
|
-
provider_ref: "rpc.metal.primary",
|
|
122
|
-
storage_class: "warm_operational"
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
rail_id: "antelope_payment",
|
|
127
|
-
settlement_mode: "antelope_payment",
|
|
128
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
129
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
130
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
131
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class"],
|
|
132
|
-
config_template: {
|
|
133
|
-
destination_id: "treasury_antelope_main",
|
|
134
|
-
destination_kind: "antelope_account",
|
|
135
|
-
external_ref: "exampleeosacct",
|
|
136
|
-
network: "mainnet",
|
|
137
|
-
asset_symbol: "EOSIO_OR_ANTILOPE",
|
|
138
|
-
custody_ref: "vault.antelope.primary",
|
|
139
|
-
reporting_ref: "ledger.antelope.primary",
|
|
140
|
-
wallet_ref: "wallet.antelope.primary",
|
|
141
|
-
provider_ref: "rpc.antelope.primary",
|
|
142
|
-
storage_class: "warm_operational"
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
rail_id: "hedera_hbar",
|
|
147
|
-
settlement_mode: "hedera_hbar",
|
|
148
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
149
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
150
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
151
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class", "memo_ref"],
|
|
152
|
-
config_template: {
|
|
153
|
-
destination_id: "treasury_hedera_main",
|
|
154
|
-
destination_kind: "hedera_account_id",
|
|
155
|
-
external_ref: "0.0.1234567",
|
|
156
|
-
network: "mainnet",
|
|
157
|
-
asset_symbol: "HBAR",
|
|
158
|
-
custody_ref: "vault.hedera.primary",
|
|
159
|
-
reporting_ref: "ledger.hedera.primary",
|
|
160
|
-
wallet_ref: "wallet.hedera.primary",
|
|
161
|
-
provider_ref: "rpc.hedera.primary",
|
|
162
|
-
memo_ref: "treasury.hedera.primary",
|
|
163
|
-
storage_class: "warm_operational"
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
rail_id: "kaspa_kas",
|
|
168
|
-
settlement_mode: "kaspa_kas",
|
|
169
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
170
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
171
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
172
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class"],
|
|
173
|
-
config_template: {
|
|
174
|
-
destination_id: "treasury_kaspa_main",
|
|
175
|
-
destination_kind: "kaspa_address",
|
|
176
|
-
external_ref: "kaspa:qrealreceivingaddress",
|
|
177
|
-
network: "mainnet",
|
|
178
|
-
asset_symbol: "KAS",
|
|
179
|
-
custody_ref: "vault.kaspa.primary",
|
|
180
|
-
reporting_ref: "ledger.kaspa.primary",
|
|
181
|
-
wallet_ref: "wallet.kaspa.primary",
|
|
182
|
-
provider_ref: "rpc.kaspa.primary",
|
|
183
|
-
storage_class: "warm_operational"
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
rail_id: "polkadot_dot",
|
|
188
|
-
settlement_mode: "polkadot_dot",
|
|
189
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
190
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
191
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
192
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class"],
|
|
193
|
-
config_template: {
|
|
194
|
-
destination_id: "treasury_polkadot_main",
|
|
195
|
-
destination_kind: "polkadot_address",
|
|
196
|
-
external_ref: "1realpolkadotreceivingaddress",
|
|
197
|
-
network: "mainnet",
|
|
198
|
-
asset_symbol: "DOT",
|
|
199
|
-
custody_ref: "vault.polkadot.primary",
|
|
200
|
-
reporting_ref: "ledger.polkadot.primary",
|
|
201
|
-
wallet_ref: "wallet.polkadot.primary",
|
|
202
|
-
provider_ref: "rpc.polkadot.primary",
|
|
203
|
-
storage_class: "warm_operational"
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
rail_id: "digibyte_dgb",
|
|
208
|
-
settlement_mode: "digibyte_dgb",
|
|
209
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
210
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
211
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
212
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class"],
|
|
213
|
-
config_template: {
|
|
214
|
-
destination_id: "treasury_digibyte_main",
|
|
215
|
-
destination_kind: "digibyte_address",
|
|
216
|
-
external_ref: "DRealReceivingAddress",
|
|
217
|
-
network: "mainnet",
|
|
218
|
-
asset_symbol: "DGB",
|
|
219
|
-
custody_ref: "vault.digibyte.primary",
|
|
220
|
-
reporting_ref: "ledger.digibyte.primary",
|
|
221
|
-
wallet_ref: "wallet.digibyte.primary",
|
|
222
|
-
provider_ref: "rpc.digibyte.primary",
|
|
223
|
-
storage_class: "warm_operational"
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
rail_id: "constellation_dag",
|
|
228
|
-
settlement_mode: "constellation_dag",
|
|
229
|
-
reserve_role: "major_alternative_rail_settlement",
|
|
230
|
-
compliance_posture: "public_settlement_destination_allowed",
|
|
231
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "network"],
|
|
232
|
-
recommended_fields: ["custody_ref", "reporting_ref", "wallet_ref", "provider_ref", "asset_symbol", "storage_class"],
|
|
233
|
-
config_template: {
|
|
234
|
-
destination_id: "treasury_constellation_main",
|
|
235
|
-
destination_kind: "constellation_address",
|
|
236
|
-
external_ref: "DAGRealReceivingAddress",
|
|
237
|
-
network: "mainnet",
|
|
238
|
-
asset_symbol: "DAG",
|
|
239
|
-
custody_ref: "vault.constellation.primary",
|
|
240
|
-
reporting_ref: "ledger.constellation.primary",
|
|
241
|
-
wallet_ref: "wallet.constellation.primary",
|
|
242
|
-
provider_ref: "rpc.constellation.primary",
|
|
243
|
-
storage_class: "warm_operational"
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
rail_id: "usdc",
|
|
248
|
-
settlement_mode: "usdc",
|
|
249
|
-
reserve_role: "stable_operating_reserve",
|
|
250
|
-
compliance_posture: "public_stable_reserve_allowed",
|
|
251
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "asset_symbol"],
|
|
252
|
-
recommended_fields: ["chain_id", "custody_ref", "reporting_ref", "wallet_ref", "storage_class"],
|
|
253
|
-
config_template: {
|
|
254
|
-
destination_id: "treasury_usdc_primary",
|
|
255
|
-
destination_kind: "stablecoin_address",
|
|
256
|
-
external_ref: "0xUsdcTreasuryAddress",
|
|
257
|
-
asset_symbol: "USDC",
|
|
258
|
-
chain_id: "8453",
|
|
259
|
-
custody_ref: "vault.usdc.primary",
|
|
260
|
-
reporting_ref: "ledger.usdc.primary",
|
|
261
|
-
storage_class: "warm_operational"
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
rail_id: "dai",
|
|
266
|
-
settlement_mode: "dai",
|
|
267
|
-
reserve_role: "stable_operating_reserve",
|
|
268
|
-
compliance_posture: "public_stable_reserve_allowed",
|
|
269
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "asset_symbol"],
|
|
270
|
-
recommended_fields: ["chain_id", "custody_ref", "reporting_ref", "wallet_ref", "storage_class"],
|
|
271
|
-
config_template: {
|
|
272
|
-
destination_id: "treasury_dai_primary",
|
|
273
|
-
destination_kind: "stablecoin_address",
|
|
274
|
-
external_ref: "0xDaiTreasuryAddress",
|
|
275
|
-
asset_symbol: "DAI",
|
|
276
|
-
chain_id: "1",
|
|
277
|
-
custody_ref: "vault.dai.primary",
|
|
278
|
-
reporting_ref: "ledger.dai.primary",
|
|
279
|
-
storage_class: "warm_operational"
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
rail_id: "monero",
|
|
284
|
-
settlement_mode: "monero",
|
|
285
|
-
reserve_role: "optional_hidden_privacy_reserve",
|
|
286
|
-
compliance_posture: "internal_only_policy_gated",
|
|
287
|
-
required_fields: ["destination_id", "destination_kind", "external_ref", "policy_scope"],
|
|
288
|
-
recommended_fields: ["custody_ref", "reporting_ref", "storage_class"],
|
|
289
|
-
config_template: {
|
|
290
|
-
destination_id: "treasury_monero_private",
|
|
291
|
-
destination_kind: "monero_address",
|
|
292
|
-
external_ref: "8ExampleMoneroAddress",
|
|
293
|
-
policy_scope: "internal_optional_privacy_reserve",
|
|
294
|
-
custody_ref: "vault.monero.policy_gated",
|
|
295
|
-
reporting_ref: "ledger.monero.internal",
|
|
296
|
-
storage_class: "isolated_policy_gated"
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
];
|
|
300
|
-
|
|
301
|
-
const TREASURY_PUBLIC_BOUNDARY_REJECTION_CODES = [
|
|
302
|
-
"public_custody_destination_leak",
|
|
303
|
-
"public_external_ref_leak",
|
|
304
|
-
"public_custody_ref_leak",
|
|
305
|
-
"public_reporting_ref_leak",
|
|
306
|
-
"public_wallet_ref_leak",
|
|
307
|
-
"public_provider_ref_leak",
|
|
308
|
-
"internal_rail_public_claimed",
|
|
309
|
-
"readiness_only_rail_public_claimed",
|
|
310
|
-
"claim_boundary_mismatch",
|
|
311
|
-
"unsupported_live_claim_rail",
|
|
312
|
-
"operator_visibility_rule_missing"
|
|
313
|
-
];
|
|
314
|
-
|
|
315
|
-
const SENSITIVE_PUBLIC_DESTINATION_FIELDS = [
|
|
316
|
-
"external_ref",
|
|
317
|
-
"custody_ref",
|
|
318
|
-
"reporting_ref",
|
|
319
|
-
"wallet_ref",
|
|
320
|
-
"provider_ref",
|
|
321
|
-
"merchant_address",
|
|
322
|
-
"merchant_paymail"
|
|
323
|
-
];
|
|
324
|
-
|
|
325
|
-
function classifyDestinationSource(profile, paymentConfig) {
|
|
326
|
-
const settlementMode = profile.settlement_mode;
|
|
327
|
-
const mapEntry = paymentConfig.treasury_destinations_by_settlement_mode[settlementMode];
|
|
328
|
-
if (mapEntry && mapEntry.destination_id) {
|
|
329
|
-
return "per_settlement_mode";
|
|
330
|
-
}
|
|
331
|
-
if (settlementMode === "bsv_teranode" && buildBsvTeranodeTreasuryDestination("acct_treasury_operator", settlementMode)) {
|
|
332
|
-
return "bsv_merchant_destination";
|
|
333
|
-
}
|
|
334
|
-
if (paymentConfig.treasury_destination_id) {
|
|
335
|
-
return "global_default";
|
|
336
|
-
}
|
|
337
|
-
return "unconfigured";
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function buildFieldValueMap(destination, bsvConfig) {
|
|
341
|
-
return {
|
|
342
|
-
destination_id: destination && destination.destination_id ? destination.destination_id : null,
|
|
343
|
-
destination_kind: destination && destination.destination_kind ? destination.destination_kind : null,
|
|
344
|
-
external_ref: destination && destination.external_ref ? destination.external_ref : null,
|
|
345
|
-
custody_ref: destination && destination.custody_ref ? destination.custody_ref : null,
|
|
346
|
-
reporting_ref: destination && destination.reporting_ref ? destination.reporting_ref : null,
|
|
347
|
-
wallet_ref: destination && destination.wallet_ref ? destination.wallet_ref : null,
|
|
348
|
-
provider_ref: destination && destination.provider_ref ? destination.provider_ref : null,
|
|
349
|
-
memo_ref: destination && destination.memo_ref ? destination.memo_ref : null,
|
|
350
|
-
network: destination && destination.network ? destination.network : (bsvConfig && bsvConfig.network ? bsvConfig.network : null),
|
|
351
|
-
chain_id: destination && destination.chain_id ? destination.chain_id : null,
|
|
352
|
-
asset_symbol: destination && destination.asset_symbol ? destination.asset_symbol : null,
|
|
353
|
-
policy_scope: destination && destination.policy_scope ? destination.policy_scope : null,
|
|
354
|
-
storage_class: destination && destination.storage_class ? destination.storage_class : null
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function listMissingFields(fieldNames, values) {
|
|
359
|
-
return fieldNames.filter((fieldName) => !values[fieldName]);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
function buildReadinessState(source, requiredMissingFields) {
|
|
363
|
-
if (source === "per_settlement_mode" && requiredMissingFields.length === 0) {
|
|
364
|
-
return "explicit_per-rail_ready";
|
|
365
|
-
}
|
|
366
|
-
if (source === "bsv_merchant_destination" && requiredMissingFields.length === 0) {
|
|
367
|
-
return "native_bsv_ready";
|
|
368
|
-
}
|
|
369
|
-
if (source === "global_default" && requiredMissingFields.length === 0) {
|
|
370
|
-
return "fallback_only_not_explicitly_per-rail";
|
|
371
|
-
}
|
|
372
|
-
if (source === "unconfigured") {
|
|
373
|
-
return "unconfigured";
|
|
374
|
-
}
|
|
375
|
-
return "partially_configured";
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
function buildClaimDiscipline(profile, source, readinessState, configured, missingRecommendedFields) {
|
|
379
|
-
const internalOnly = profile.compliance_posture === "internal_only_policy_gated";
|
|
380
|
-
const reportingGaps = Array.isArray(missingRecommendedFields) && missingRecommendedFields.length > 0;
|
|
381
|
-
let publicClaimStatus = "readiness_template_only";
|
|
382
|
-
if (internalOnly) {
|
|
383
|
-
publicClaimStatus = "internal_policy_gated_not_public";
|
|
384
|
-
} else if (configured && reportingGaps) {
|
|
385
|
-
publicClaimStatus = "live_landing_path_with_operator_reporting_gaps";
|
|
386
|
-
} else if (configured) {
|
|
387
|
-
publicClaimStatus = "live_operational_landing_path";
|
|
388
|
-
} else if (source === "global_default") {
|
|
389
|
-
publicClaimStatus = "fallback_not_public_multi-rail_claim";
|
|
390
|
-
} else if (readinessState === "partially_configured") {
|
|
391
|
-
publicClaimStatus = "partial_configuration_not_public_claim";
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
const publicClaimAllowed = !internalOnly && configured;
|
|
395
|
-
return {
|
|
396
|
-
public_claim_status: publicClaimStatus,
|
|
397
|
-
public_claim_allowed: publicClaimAllowed,
|
|
398
|
-
operator_claim_allowed: configured,
|
|
399
|
-
launch_claim_role: profile.rail_id === "bsv_teranode"
|
|
400
|
-
? "launch_primary_native_settlement"
|
|
401
|
-
: internalOnly
|
|
402
|
-
? "internal_optional_reserve"
|
|
403
|
-
: "future_or_optional_rail",
|
|
404
|
-
claim_guidance: publicClaimAllowed
|
|
405
|
-
? reportingGaps
|
|
406
|
-
? "can_claim_as_configured_with_operator_reporting_gaps_disclosed"
|
|
407
|
-
: "can_claim_as_configured_live_landing_path"
|
|
408
|
-
: internalOnly
|
|
409
|
-
? "do_not_make_public_landing_claim"
|
|
410
|
-
: "keep_as_supported_architecture_or_readiness_template_until_real_destination_is_configured",
|
|
411
|
-
reporting_gap_fields: reportingGaps ? missingRecommendedFields : []
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
function buildOperatorNextSteps(requiredMissingFields, recommendedMissingFields, claimDiscipline) {
|
|
416
|
-
const steps = [];
|
|
417
|
-
if (requiredMissingFields.length > 0) {
|
|
418
|
-
steps.push("fill_missing_required_destination_fields_before_any_live_claim");
|
|
419
|
-
}
|
|
420
|
-
if (claimDiscipline.public_claim_status === "fallback_not_public_multi-rail_claim") {
|
|
421
|
-
steps.push("replace_global_fallback_with_per-rail_destination_before_public_multi-rail_claim");
|
|
422
|
-
}
|
|
423
|
-
if (claimDiscipline.public_claim_status === "internal_policy_gated_not_public") {
|
|
424
|
-
steps.push("keep_internal_only_and_policy_gated");
|
|
425
|
-
}
|
|
426
|
-
if (recommendedMissingFields.length > 0) {
|
|
427
|
-
steps.push("add_recommended_custody_reporting_wallet_provider_or_storage_refs");
|
|
428
|
-
}
|
|
429
|
-
return steps.length ? steps : ["keep_destination_under_periodic_operator_review"];
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
function buildTreasuryDestinationProfile(profile) {
|
|
433
|
-
const paymentConfig = loadPaymentConfig();
|
|
434
|
-
const destination = buildConfiguredTreasuryDestination("acct_treasury_operator", profile.settlement_mode);
|
|
435
|
-
const source = classifyDestinationSource(profile, paymentConfig);
|
|
436
|
-
const bsvConfig = profile.settlement_mode === "bsv_teranode" ? loadBsvTeranodeConfig() : null;
|
|
437
|
-
const fieldValues = buildFieldValueMap(destination, bsvConfig);
|
|
438
|
-
const requiredMissingFields = listMissingFields(profile.required_fields, fieldValues);
|
|
439
|
-
const recommendedMissingFields = listMissingFields(profile.recommended_fields, fieldValues);
|
|
440
|
-
const readinessState = buildReadinessState(source, requiredMissingFields);
|
|
441
|
-
const configured = readinessState === "explicit_per-rail_ready" || readinessState === "native_bsv_ready";
|
|
442
|
-
const claimDiscipline = buildClaimDiscipline(profile, source, readinessState, configured, recommendedMissingFields);
|
|
443
|
-
return {
|
|
444
|
-
rail_id: profile.rail_id,
|
|
445
|
-
settlement_mode: profile.settlement_mode,
|
|
446
|
-
reserve_role: profile.reserve_role,
|
|
447
|
-
compliance_posture: profile.compliance_posture,
|
|
448
|
-
configured,
|
|
449
|
-
configuration_source: source,
|
|
450
|
-
readiness_state: readinessState,
|
|
451
|
-
public_claim_status: claimDiscipline.public_claim_status,
|
|
452
|
-
public_claim_allowed: claimDiscipline.public_claim_allowed,
|
|
453
|
-
operator_claim_allowed: claimDiscipline.operator_claim_allowed,
|
|
454
|
-
launch_claim_role: claimDiscipline.launch_claim_role,
|
|
455
|
-
claim_guidance: claimDiscipline.claim_guidance,
|
|
456
|
-
reporting_gap_fields: claimDiscipline.reporting_gap_fields,
|
|
457
|
-
explicit_per_rail_configured: source === "per_settlement_mode" && requiredMissingFields.length === 0,
|
|
458
|
-
field_requirements: {
|
|
459
|
-
required_fields: profile.required_fields,
|
|
460
|
-
recommended_fields: profile.recommended_fields,
|
|
461
|
-
missing_required_fields: requiredMissingFields,
|
|
462
|
-
missing_recommended_fields: recommendedMissingFields
|
|
463
|
-
},
|
|
464
|
-
custody_destination: destination && destination.destination_id ? {
|
|
465
|
-
destination_id: destination.destination_id,
|
|
466
|
-
destination_kind: destination.destination_kind,
|
|
467
|
-
account_id: destination.account_id,
|
|
468
|
-
external_ref: destination.external_ref || null,
|
|
469
|
-
custody_ref: destination.custody_ref || null,
|
|
470
|
-
reporting_ref: destination.reporting_ref || null,
|
|
471
|
-
wallet_ref: destination.wallet_ref || null,
|
|
472
|
-
provider_ref: destination.provider_ref || null,
|
|
473
|
-
memo_ref: destination.memo_ref || null,
|
|
474
|
-
network: destination.network || null,
|
|
475
|
-
chain_id: destination.chain_id || null,
|
|
476
|
-
asset_symbol: destination.asset_symbol || null,
|
|
477
|
-
policy_scope: destination.policy_scope || null,
|
|
478
|
-
storage_class: destination.storage_class || null
|
|
479
|
-
} : null,
|
|
480
|
-
runtime_claim_readiness: configured
|
|
481
|
-
? "operational_claim_ready"
|
|
482
|
-
: source === "global_default"
|
|
483
|
-
? "fallback_present_but_do_not_claim_explicit_multi-rail_landing_yet"
|
|
484
|
-
: "do_not_claim_as_live_landing_destination_yet",
|
|
485
|
-
operator_next_steps: buildOperatorNextSteps(requiredMissingFields, recommendedMissingFields, claimDiscipline),
|
|
486
|
-
config_template: profile.config_template,
|
|
487
|
-
rail_metadata: bsvConfig ? {
|
|
488
|
-
network: bsvConfig.network,
|
|
489
|
-
merchant_address: bsvConfig.merchant_address,
|
|
490
|
-
merchant_paymail: bsvConfig.merchant_paymail
|
|
491
|
-
} : null,
|
|
492
|
-
guardrails: profile.rail_id === "monero"
|
|
493
|
-
? [
|
|
494
|
-
"internal_only",
|
|
495
|
-
"not_public_treasury_identity",
|
|
496
|
-
"must_not_weaken_reporting_or_accounting_surfaces",
|
|
497
|
-
"policy_scope_must_be_explicit_before_operational_use"
|
|
498
|
-
]
|
|
499
|
-
: [
|
|
500
|
-
"treasury_visibility_must_flow_back_into_xytara_ledger_and_reporting",
|
|
501
|
-
"custody_destination_should_be_secure_before_operational_claims_are_made",
|
|
502
|
-
"per-rail_config_is_preferred_over_global_fallback_for_public_operational_claims"
|
|
503
|
-
]
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
function sanitizeTreasuryDestinationProfile(profile) {
|
|
508
|
-
return {
|
|
509
|
-
rail_id: profile.rail_id,
|
|
510
|
-
settlement_mode: profile.settlement_mode,
|
|
511
|
-
reserve_role: profile.reserve_role,
|
|
512
|
-
compliance_posture: profile.compliance_posture,
|
|
513
|
-
configured: profile.configured,
|
|
514
|
-
configuration_source: profile.configuration_source,
|
|
515
|
-
readiness_state: profile.readiness_state,
|
|
516
|
-
public_claim_status: profile.public_claim_status,
|
|
517
|
-
public_claim_allowed: profile.public_claim_allowed,
|
|
518
|
-
launch_claim_role: profile.launch_claim_role,
|
|
519
|
-
claim_guidance: profile.claim_guidance,
|
|
520
|
-
reporting_gap_fields: profile.reporting_gap_fields,
|
|
521
|
-
explicit_per_rail_configured: profile.explicit_per_rail_configured,
|
|
522
|
-
field_requirements: profile.field_requirements,
|
|
523
|
-
destination_visibility: {
|
|
524
|
-
destination_kind: profile.custody_destination ? profile.custody_destination.destination_kind : null,
|
|
525
|
-
network: profile.custody_destination ? profile.custody_destination.network : null,
|
|
526
|
-
chain_id: profile.custody_destination ? profile.custody_destination.chain_id : null,
|
|
527
|
-
asset_symbol: profile.custody_destination ? profile.custody_destination.asset_symbol : null,
|
|
528
|
-
policy_scope: profile.custody_destination ? profile.custody_destination.policy_scope : null,
|
|
529
|
-
storage_class: profile.custody_destination ? profile.custody_destination.storage_class : null
|
|
530
|
-
},
|
|
531
|
-
runtime_claim_readiness: profile.runtime_claim_readiness,
|
|
532
|
-
config_template: profile.config_template,
|
|
533
|
-
guardrails: profile.guardrails
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
function buildOperatorTreasuryDestinationsPack() {
|
|
538
|
-
const profiles = RAIL_PROFILES.map(buildTreasuryDestinationProfile);
|
|
539
|
-
const configuredProfiles = profiles.filter((entry) => entry.configured);
|
|
540
|
-
const explicitProfiles = profiles.filter((entry) => entry.explicit_per_rail_configured);
|
|
541
|
-
const publicClaimableProfiles = profiles.filter((entry) => entry.public_claim_allowed);
|
|
542
|
-
const internalOnlyProfiles = profiles.filter((entry) => entry.compliance_posture === "internal_only_policy_gated");
|
|
543
|
-
return {
|
|
544
|
-
product: "xytara",
|
|
545
|
-
category: "machine-commerce-operator-treasury-destinations-pack",
|
|
546
|
-
pack_version: "xytara-operator-treasury-destinations-pack-v1",
|
|
547
|
-
posture: "operator_only_custody_visibility_and_per-rail_destination_readiness",
|
|
548
|
-
profiles,
|
|
549
|
-
readiness_summary: {
|
|
550
|
-
explicit_per_rail_configured_count: explicitProfiles.length,
|
|
551
|
-
configured_profile_count: configuredProfiles.length,
|
|
552
|
-
public_claimable_profile_count: publicClaimableProfiles.length,
|
|
553
|
-
readiness_only_profile_count: profiles.filter((entry) => !entry.public_claim_allowed && entry.compliance_posture !== "internal_only_policy_gated").length,
|
|
554
|
-
internal_only_profile_count: internalOnlyProfiles.length,
|
|
555
|
-
reporting_gap_count: profiles.filter((entry) => Array.isArray(entry.reporting_gap_fields) && entry.reporting_gap_fields.length > 0).length,
|
|
556
|
-
fallback_only_count: profiles.filter((entry) => entry.readiness_state === "fallback_only_not_explicitly_per-rail").length,
|
|
557
|
-
partially_configured_count: profiles.filter((entry) => entry.readiness_state === "partially_configured").length,
|
|
558
|
-
unconfigured_count: profiles.filter((entry) => entry.readiness_state === "unconfigured").length
|
|
559
|
-
},
|
|
560
|
-
public_claim_boundary: {
|
|
561
|
-
live_claimable_rails: publicClaimableProfiles.map((entry) => entry.rail_id),
|
|
562
|
-
readiness_only_rails: profiles
|
|
563
|
-
.filter((entry) => !entry.public_claim_allowed && entry.compliance_posture !== "internal_only_policy_gated")
|
|
564
|
-
.map((entry) => entry.rail_id),
|
|
565
|
-
internal_only_rails: internalOnlyProfiles.map((entry) => entry.rail_id),
|
|
566
|
-
rule: "only_rails_with_public_claim_allowed_true_should_be_described_as_live_landing_paths"
|
|
567
|
-
},
|
|
568
|
-
supported_surfaces: {
|
|
569
|
-
treasury_lane_ref: "/v1/treasury",
|
|
570
|
-
treasury_summary_ref_template: "/v1/economics/accounts/:account_id/treasury-summary",
|
|
571
|
-
treasury_signoff_pack_ref_template: "/v1/economics/accounts/:account_id/treasury-signoff-pack",
|
|
572
|
-
rail_summary_ref_template: "/v1/economics/accounts/:account_id/rail-summary",
|
|
573
|
-
rail_signoff_pack_ref_template: "/v1/economics/accounts/:account_id/rail-signoff-pack",
|
|
574
|
-
payment_setup_doc_ref: "REAL_PAYMENT_SETUP.md",
|
|
575
|
-
native_setup_doc_ref: "REAL_PAYMENT_SETUP.md",
|
|
576
|
-
validation_preview_ref: "/v1/treasury-destinations/validate-preview"
|
|
577
|
-
},
|
|
578
|
-
operator_rule: configuredProfiles.length > 0
|
|
579
|
-
? "claim_only_the_rails_with_real_configured_destinations_as_live_landing_paths"
|
|
580
|
-
: "no_multi-rail_operational_claims_until_real_destinations_exist",
|
|
581
|
-
custody_visibility_rule: "do_not_expose_real_external_refs_or_custody_refs_on_public_surfaces",
|
|
582
|
-
deterministic_rejection_codes: TREASURY_PUBLIC_BOUNDARY_REJECTION_CODES.slice(),
|
|
583
|
-
config_examples: Object.fromEntries(RAIL_PROFILES.map((profile) => [profile.settlement_mode, profile.config_template]))
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
function buildTreasuryDestinationsPack() {
|
|
588
|
-
const operatorPack = buildOperatorTreasuryDestinationsPack();
|
|
589
|
-
return {
|
|
590
|
-
product: "xytara",
|
|
591
|
-
category: "machine-commerce-treasury-destinations-pack",
|
|
592
|
-
pack_version: "xytara-treasury-destinations-pack-v3",
|
|
593
|
-
posture: "public_treasury_destination_readiness_without_custody_refs",
|
|
594
|
-
profiles: operatorPack.profiles.map(sanitizeTreasuryDestinationProfile),
|
|
595
|
-
readiness_summary: operatorPack.readiness_summary,
|
|
596
|
-
public_claim_boundary: operatorPack.public_claim_boundary,
|
|
597
|
-
supported_surfaces: {
|
|
598
|
-
treasury_lane_ref: "/v1/treasury",
|
|
599
|
-
treasury_summary_ref_template: "/v1/economics/accounts/:account_id/treasury-summary",
|
|
600
|
-
rail_summary_ref_template: "/v1/economics/accounts/:account_id/rail-summary",
|
|
601
|
-
payment_setup_doc_ref: "REAL_PAYMENT_SETUP.md",
|
|
602
|
-
native_setup_doc_ref: "REAL_PAYMENT_SETUP.md",
|
|
603
|
-
validation_preview_ref: "/v1/treasury-destinations/validate-preview",
|
|
604
|
-
operator_pack_ref: "/v1/treasury-destinations/operator-pack"
|
|
605
|
-
},
|
|
606
|
-
operator_rule: operatorPack.operator_rule,
|
|
607
|
-
claim_discipline_rule: "unsupported_or_unconfigured_rails_may_be_listed_as_architecture_but_not_as_live_landing_paths",
|
|
608
|
-
privacy_rule: "public_surfaces_must_not_expose_real_treasury_landing_refs_or_custody_provider_refs",
|
|
609
|
-
deterministic_rejection_codes: TREASURY_PUBLIC_BOUNDARY_REJECTION_CODES.slice(),
|
|
610
|
-
config_examples: operatorPack.config_examples
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
function summarizeTreasuryDestinationsPack() {
|
|
615
|
-
const pack = buildTreasuryDestinationsPack();
|
|
616
|
-
return {
|
|
617
|
-
product: "xytara",
|
|
618
|
-
category: "machine-commerce-treasury-destinations-pack-summary",
|
|
619
|
-
summary_version: "xytara-treasury-destinations-pack-summary-v2",
|
|
620
|
-
profile_count: pack.profiles.length,
|
|
621
|
-
configured_profile_count: pack.profiles.filter((entry) => entry.configured).length,
|
|
622
|
-
explicit_per_rail_configured_count: pack.readiness_summary.explicit_per_rail_configured_count,
|
|
623
|
-
public_claimable_profile_count: pack.readiness_summary.public_claimable_profile_count,
|
|
624
|
-
readiness_only_profile_count: pack.readiness_summary.readiness_only_profile_count,
|
|
625
|
-
reporting_gap_count: pack.readiness_summary.reporting_gap_count,
|
|
626
|
-
internal_only_profile_count: pack.profiles.filter((entry) => entry.compliance_posture === "internal_only_policy_gated").length,
|
|
627
|
-
deterministic_rejection_code_count: pack.deterministic_rejection_codes.length,
|
|
628
|
-
public_claim_boundary: pack.public_claim_boundary,
|
|
629
|
-
linked_surfaces: pack.supported_surfaces
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
function summarizeOperatorTreasuryDestinationsPack() {
|
|
634
|
-
const pack = buildOperatorTreasuryDestinationsPack();
|
|
635
|
-
return {
|
|
636
|
-
product: "xytara",
|
|
637
|
-
category: "machine-commerce-operator-treasury-destinations-pack-summary",
|
|
638
|
-
summary_version: "xytara-operator-treasury-destinations-pack-summary-v1",
|
|
639
|
-
profile_count: pack.profiles.length,
|
|
640
|
-
configured_profile_count: pack.readiness_summary.configured_profile_count,
|
|
641
|
-
explicit_per_rail_configured_count: pack.readiness_summary.explicit_per_rail_configured_count,
|
|
642
|
-
public_claimable_profile_count: pack.readiness_summary.public_claimable_profile_count,
|
|
643
|
-
readiness_only_profile_count: pack.readiness_summary.readiness_only_profile_count,
|
|
644
|
-
reporting_gap_count: pack.readiness_summary.reporting_gap_count,
|
|
645
|
-
internal_only_profile_count: pack.profiles.filter((entry) => entry.compliance_posture === "internal_only_policy_gated").length,
|
|
646
|
-
deterministic_rejection_code_count: pack.deterministic_rejection_codes.length,
|
|
647
|
-
public_claim_boundary: pack.public_claim_boundary,
|
|
648
|
-
linked_surfaces: pack.supported_surfaces
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
function buildTreasuryDestinationValidationPreview(input) {
|
|
653
|
-
const providedMap = input && typeof input === "object" && !Array.isArray(input)
|
|
654
|
-
? input.treasury_destinations_by_settlement_mode
|
|
655
|
-
: null;
|
|
656
|
-
const previousJson = process.env.XYTARA_TREASURY_DESTINATIONS_JSON;
|
|
657
|
-
const previousPath = process.env.XYTARA_TREASURY_DESTINATIONS_PATH;
|
|
658
|
-
try {
|
|
659
|
-
if (providedMap && typeof providedMap === "object") {
|
|
660
|
-
process.env.XYTARA_TREASURY_DESTINATIONS_JSON = JSON.stringify(providedMap);
|
|
661
|
-
delete process.env.XYTARA_TREASURY_DESTINATIONS_PATH;
|
|
662
|
-
}
|
|
663
|
-
const pack = buildTreasuryDestinationsPack();
|
|
664
|
-
return {
|
|
665
|
-
product: "xytara",
|
|
666
|
-
category: "machine-commerce-treasury-destination-validation-preview",
|
|
667
|
-
preview_version: "xytara-treasury-destination-validation-preview-v1",
|
|
668
|
-
operator_rule: pack.operator_rule,
|
|
669
|
-
readiness_summary: pack.readiness_summary,
|
|
670
|
-
profiles: pack.profiles.map((profile) => ({
|
|
671
|
-
rail_id: profile.rail_id,
|
|
672
|
-
readiness_state: profile.readiness_state,
|
|
673
|
-
public_claim_status: profile.public_claim_status,
|
|
674
|
-
public_claim_allowed: profile.public_claim_allowed,
|
|
675
|
-
explicit_per_rail_configured: profile.explicit_per_rail_configured,
|
|
676
|
-
missing_required_fields: profile.field_requirements.missing_required_fields,
|
|
677
|
-
missing_recommended_fields: profile.field_requirements.missing_recommended_fields
|
|
678
|
-
}))
|
|
679
|
-
};
|
|
680
|
-
} finally {
|
|
681
|
-
if (previousJson === undefined) delete process.env.XYTARA_TREASURY_DESTINATIONS_JSON;
|
|
682
|
-
else process.env.XYTARA_TREASURY_DESTINATIONS_JSON = previousJson;
|
|
683
|
-
if (previousPath === undefined) delete process.env.XYTARA_TREASURY_DESTINATIONS_PATH;
|
|
684
|
-
else process.env.XYTARA_TREASURY_DESTINATIONS_PATH = previousPath;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
function arraysEqual(left, right) {
|
|
689
|
-
const leftSorted = (Array.isArray(left) ? left : []).slice().sort();
|
|
690
|
-
const rightSorted = (Array.isArray(right) ? right : []).slice().sort();
|
|
691
|
-
return leftSorted.length === rightSorted.length && leftSorted.every((entry, index) => entry === rightSorted[index]);
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
function validateTreasuryDestinationPublicBoundary(packInput) {
|
|
695
|
-
const pack = packInput || buildTreasuryDestinationsPack();
|
|
696
|
-
const profiles = Array.isArray(pack.profiles) ? pack.profiles : [];
|
|
697
|
-
const boundary = pack.public_claim_boundary || {};
|
|
698
|
-
const rejectionCodes = [];
|
|
699
|
-
const liveClaimableRails = profiles.filter((entry) => entry && entry.public_claim_allowed).map((entry) => entry.rail_id);
|
|
700
|
-
const internalOnlyRails = profiles
|
|
701
|
-
.filter((entry) => entry && entry.compliance_posture === "internal_only_policy_gated")
|
|
702
|
-
.map((entry) => entry.rail_id);
|
|
703
|
-
const readinessOnlyRails = profiles
|
|
704
|
-
.filter((entry) => entry && !entry.public_claim_allowed && entry.compliance_posture !== "internal_only_policy_gated")
|
|
705
|
-
.map((entry) => entry.rail_id);
|
|
706
|
-
|
|
707
|
-
for (const profile of profiles) {
|
|
708
|
-
if (!profile) continue;
|
|
709
|
-
if (profile.custody_destination != null) {
|
|
710
|
-
rejectionCodes.push("public_custody_destination_leak");
|
|
711
|
-
}
|
|
712
|
-
const visibility = profile.destination_visibility || {};
|
|
713
|
-
for (const fieldName of SENSITIVE_PUBLIC_DESTINATION_FIELDS) {
|
|
714
|
-
if (visibility[fieldName] != null) {
|
|
715
|
-
rejectionCodes.push(`public_${fieldName}_leak`);
|
|
716
|
-
}
|
|
717
|
-
if (profile[fieldName] != null) {
|
|
718
|
-
rejectionCodes.push(`public_${fieldName}_leak`);
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
if (profile.compliance_posture === "internal_only_policy_gated" && profile.public_claim_allowed === true) {
|
|
722
|
-
rejectionCodes.push("internal_rail_public_claimed");
|
|
723
|
-
}
|
|
724
|
-
if (boundary.readiness_only_rails && boundary.readiness_only_rails.includes(profile.rail_id) && profile.public_claim_allowed === true) {
|
|
725
|
-
rejectionCodes.push("readiness_only_rail_public_claimed");
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
const boundaryLiveRails = Array.isArray(boundary.live_claimable_rails) ? boundary.live_claimable_rails : [];
|
|
730
|
-
const boundaryReadinessRails = Array.isArray(boundary.readiness_only_rails) ? boundary.readiness_only_rails : [];
|
|
731
|
-
const boundaryInternalRails = Array.isArray(boundary.internal_only_rails) ? boundary.internal_only_rails : [];
|
|
732
|
-
if (
|
|
733
|
-
!arraysEqual(liveClaimableRails, boundaryLiveRails)
|
|
734
|
-
|| !arraysEqual(readinessOnlyRails, boundaryReadinessRails)
|
|
735
|
-
|| !arraysEqual(internalOnlyRails, boundaryInternalRails)
|
|
736
|
-
) {
|
|
737
|
-
rejectionCodes.push("claim_boundary_mismatch");
|
|
738
|
-
}
|
|
739
|
-
if (boundaryLiveRails.some((railId) => !profiles.some((entry) => entry && entry.rail_id === railId && entry.public_claim_allowed === true))) {
|
|
740
|
-
rejectionCodes.push("unsupported_live_claim_rail");
|
|
741
|
-
}
|
|
742
|
-
if (pack.category === "machine-commerce-operator-treasury-destinations-pack"
|
|
743
|
-
&& pack.custody_visibility_rule !== "do_not_expose_real_external_refs_or_custody_refs_on_public_surfaces") {
|
|
744
|
-
rejectionCodes.push("operator_visibility_rule_missing");
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
return {
|
|
748
|
-
validation_version: "xytara-treasury-public-boundary-validation-v1",
|
|
749
|
-
public_boundary_valid: rejectionCodes.length === 0,
|
|
750
|
-
rejection_codes: Array.from(new Set(rejectionCodes)),
|
|
751
|
-
deterministic_rejection_codes: TREASURY_PUBLIC_BOUNDARY_REJECTION_CODES.slice(),
|
|
752
|
-
public_claim_boundary: boundary,
|
|
753
|
-
boundary: "public_treasury_surfaces_must_not_expose_landing_or_custody_refs_and_must_match_claim_allowed_state"
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
module.exports = {
|
|
758
|
-
buildOperatorTreasuryDestinationsPack,
|
|
759
|
-
summarizeOperatorTreasuryDestinationsPack,
|
|
760
|
-
buildTreasuryDestinationsPack,
|
|
761
|
-
summarizeTreasuryDestinationsPack,
|
|
762
|
-
buildTreasuryDestinationValidationPreview,
|
|
763
|
-
validateTreasuryDestinationPublicBoundary
|
|
764
|
-
};
|