brave / brave/gate3

Add support for NEAR Intents confidential swaps

Open
#307 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3
Forks
4
Avg merge
13h 34m
Merged PRs (30d)
20

Description

## Summary

Add support for NEAR Intents' confidential swaps
(https://docs.near-intents.org/integration/distribution-channels/1click-api/quickstart#confidential-swaps)
on top of the existing NEAR Intents swap provider integration.

## Scope

Targets NEAR's foreign-to-foreign confidential swaps only — set a
`confidentiality` value (`basic` or `advanced`) on the quote request;
deposits/receipts still happen on external chains exactly like a
normal swap, no signed intent execution or embedded balance needed.

Explicitly out of scope:
- The embedded "Confidential Intents balance" flow (confidential
deposit/recipient/refund types + signed intent execution).
- A new selectable provider. Considered but rejected: our swap layer
queries every known provider by default for "best route across all
providers," and the wallet client fails an entire quote if any route
names a provider it doesn't recognize. A new provider value would
break ordinary swaps for un-updated wallet builds the moment this
ships. A flag on the existing provider avoids that.
- Any browser/wallet client changes — backend-only.
- Echoing the applied confidentiality level back on the response (for
a future wallet-side indicator) — separate future work.

## Implementation sketch

- Add an optional confidentiality field (`basic` / `advanced` / unset)
to the shared swap quote request model.
- Forward it into the NEAR Intents provider's quote request body.
- Default unset to `basic`, scoped only to the NEAR Intents provider's
request-building code — not the shared request model.
- No other provider reads this field, so it's inert elsewhere,
including during multi-provider "best route" fan-out.
- Don't add a new error classification for confidentiality-specific
NEAR failures (e.g. invite-only/not-enabled) — bucket into the
existing catch-all error kind, since new error kinds carry the same
wallet-client compatibility risk as new providers.
- Add test coverage: value passed through, default applied when
omitted, no effect on other providers, invalid values rejected
before reaching NEAR Intents.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the shared swap quote request model and the existing NEAR Intents provider integration, then trace how quote requests are built and how other providers are handled. Add coverage for pass-through, the omitted-value default, isolation from other providers, and rejection of invalid values; done means these cases pass without wallet or embedded-balance changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.