Repository navigation
Conversation
No 1Click address is built into the app any more. `oneClickEndpoint`, `near.partner.jwt`, `swapFeeBips` and `swapFeeRecipient` come from quersi, so our proxy and a direct 1Click call can be swapped without a release. Without an endpoint swap is not offered on either platform and every 1Click call fails with a StateError. The key goes out as X-API-Key and the fee as appFees whenever they are set; the proxy drops the key and replaces the fee with its own, so its values apply while it is in the path. A non-URL endpoint, a negative fee or a fee without a recipient is refused with the whole config and logged. The swap doc leaves the app tree.
n13
left a comment
There was a problem hiding this comment.
Verdict: Request changes
Reviewer: GPT-6.1 Sol
Reviewed head fb1746e55eb2566b9955b209f42ce2cec364c96b against base 29277c8ed5bb62b4853c800e082ae168fa8e7dd6.
-
[P2] Preserve ordinary encrypted sends when the swap endpoint is absent. one_click_provider.dart:5–7 now builds the recipient-check service with a null endpoint, while
enableOneClickNearWarningstill defaults to true. An endpoint-less config therefore does more than hide swaps: recipient validation lets the failed lookup through, butEncryptedSendStrategy.submitrepeats it for every multi-input spend and returnsSendFailed("Couldn't verify the address…"), even for an ordinary recipient. I reproduced this through the actual provider with a two-input plan. The live wallet-config response at review time also omitsoneClickEndpointand setsenableOneClickNearWarning: true, so this is a current rollout failure. Keep a separately configured, usable recipient-lookup endpoint when new swaps are unavailable, or otherwise make the endpoint/guard rollout consistent before shipping; preserve the deposit-address safety check. Add integration coverage for both recipient validation and multi-input submission without overriding the production provider with a working service. -
[P3] Reject endpoints with an empty host. remote_config_model.dart:177–184 accepts
https://: Dart reports an authority, but its host is empty. A targeted test confirms that this config is accepted andswapAvailablebecomes true. The service then has no usable HTTP destination. Consequently an endpoint typo replaces the last working config instead of following the promised invalid-config rejection path. Require a nonempty host and cover hostless URLs in the rejection tests.
Validation: 57 focused SDK tests and 105 mobile tests passed; two additional temporary probes reproduced the findings. Formatting passed across 864 files with no changes, and git diff --check passed. Local tests used Flutter 3.44.4 with disposable SDK-compatible dependency resolution because the installed SDK cannot honor the PR's Flutter 3.47.7 lockfiles; tracked lockfiles were restored afterward. Root analysis was stopped at the required 10-second cap and is incomplete locally. GitHub Analyze and dependency-cooldown checks passed; the CI run also passed all three package test steps. No PR code was changed.
Without an oneClickEndpoint the deposit-address guard had nothing to ask and threw, which failed every multi-input encrypted send and tripped the recipient check while enableOneClickNearWarning was on, as the live config has it. The check now needs the flag and an endpoint; with neither, recipients pass without a lookup, as with the flag off. Covered against the production provider for both the recipient screen and submission. An endpoint without a host, such as https://, is refused like any other unusable value instead of replacing the last working config.
n13
left a comment
There was a problem hiding this comment.
Verdict: Approve
Reviewer: GPT-6.1 Sol
Reviewed head 5b8b818ac10187944a7ec36c253ff7e1a6cf6b85 against base 29277c8ed5bb62b4853c800e082ae168fa8e7dd6. No blocking findings.
The follow-up resolves both findings from the previous head: recipient validation and multi-input encrypted-send submission now share the endpoint-aware guard, and hostless HTTP(S) URLs are rejected before replacing a usable configuration. The remaining diff consistently carries the configured endpoint, partner key and app fee through the services, preserves base-path prefixes, and rebuilds the providers when their relevant configuration changes.
Validation:
- Focused
flutter test --no-pub --reporter=expandedruns passed: 57 SDK tests (one_click_service_test,swap_service_test,swap_token_search_test) and 108 mobile tests (remote_config_notifier_test,swap_flow_test,home_intent_gating_test,app_lifecycle_manager_test,encrypted_send_near_intents_guard_test,encrypted_send_strategy_test). - One additional temporary integration test passed using the production providers: endpoint/key/fee updates reach outgoing requests, unchanged configuration preserves service identity, and removing the endpoint prevents further HTTP requests.
dart run melos exec -- dart format lib test --line-length=120 --output=none --set-exit-if-changedpassed across 864 files, with no changes.git diff --checkpassed.- Root analysis via
dart run melos exec --concurrency=1 -- "flutter analyze . --fatal-infos"was stopped at the required 10-second cap. Cold wallet, miner and SDK analysis passed; mobile analysis remained incomplete locally.
Local tests used Flutter 3.44.4 with temporary offline dependency resolution because this machine cannot honor the Flutter 3.47.7 lockfiles. All tracked lockfiles were restored; no PR code was changed. GitHub CI completed successfully, including formatting, analysis and all three package test steps (mobile, SDK and cold wallet). Dependency-cooldown checks also passed. Live settlement and the separately documented proxy deployment were not exercised.
Summary
AppConstants.oneClickEndpointis goneRemoteConfigModelgainsoneClickEndpoint(nullable, no default),nearPartnerJwt(near.partner.jwt) andswapAppFeefromswapFeeBips+swapFeeRecipient.swapAvailableis false without an endpoint, on both platforms and in override builds. A non-URL endpoint, a negative fee or a fee without a recipient is refused with the whole config (logged, previous config kept).OneClickService/SwapServicetake a requiredendpoint; with none served every call throwsStateError('No 1Click endpoint is configured'). The key goes out asX-API-Keyand the fee asappFeeswhenever set, to whichever endpoint is configured; the echoed fee is not checked (the signature does not cover it, the proxy strips it).swapServiceProvider/oneClickServiceProviderrebuild from those config values viaselect; the swap screens already reload on a service change, so a quersi edit takes effect on the next resume.mobile-app/docs/near-intents-swaps.mddeleted; 1Click/proxy documentation lives in the private proxy repo.Through the proxy (
oneClickEndpoint: https://oneclick.quantus.com) the proxy's own key and fee apply (one-click-proxy PR onn13/fee-overridemakes it replace the wallet's fee instead of refusing it, deploy that first). Pointed athttps://1click.chaindefuser.comthe remote config key and fee apply.quersi
wallet_config.jsonkeys:oneClickEndpoint,near.partner.jwt(already served),swapFeeBips,swapFeeRecipient.Test plan
quantus_sdk:one_click_service_test,swap_service_test,swap_token_search_test— 57 pass (key header, fee body, no endpoint fails before any request, base path honoured).mobile-app:remote_config_notifier_test,swap_flow_test,home_intent_gating_test,app_lifecycle_manager_test,encrypted_send_near_intents_guard_test,encrypted_send_strategy_test— all pass.melos run formatclean;melos run analyzehung past 20 s on this machine (no result), the test runs compiled every changed file.