Add BRIDGELESS_INIT env config for the swap referral id#6072
Conversation
2cc39aa to
baeff17
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit baeff17. Configure here.
| referralId: asOptional(asNumber) | ||
| }).withRest, | ||
| { referralId: undefined } | ||
| ), |
There was a problem hiding this comment.
Referral id lacks uint16 bounds
Low Severity
BRIDGELESS_INIT.referralId is documented as a uint16 but cleaned only with asNumber, so negatives, non-integers, and values above 65535 pass through. If Bridgeless encodes that field as a uint16 in deposit payloads, a bad env value can fail swaps or send an invalid referral tag once the id is configured.
Triggered by project rule: Bugbot Review Rules
Reviewed by Cursor Bugbot for commit baeff17. Configure here.


Wires the Bridgeless swap plugin's new optional
referralIdinit option through the GUI env config:envConfig.ts: newBRIDGELESS_INITcleaner —{ referralId?: number }(uint16). Deliberately notasCorePluginInit: the plugin stays enabled by default when the key is absent (it wasbridgeless: truebefore), and{}/{ referralId }both enable it.corePlugins.ts:bridgeless: true→bridgeless: ENV.BRIDGELESS_INIT, so the object reaches the plugin as itsinitOptions.With no
BRIDGELESS_INITin env.json, behavior is identical to today (no referral in deposit payloads). Once Edge's referral id is provisioned on the Bridgeless registry, adding"BRIDGELESS_INIT": { "referralId": <uint16> }to env.json tags every Bridgeless deposit (EVM / Zano / BTC-BCH / Solana / TON) for referral revenue.Companion to EdgeApp/edge-exchange-plugins referral + Solana/TON PRs.
Note
Low Risk
Config-only wiring for an already-enabled swap plugin; no change when BRIDGELESS_INIT is omitted.
Overview
Adds
BRIDGELESS_INITinenvConfig.tsso an optionalreferralId(number) can be set inenv.jsonand passed to the Bridgeless swap plugin as init options. The cleaner usesasOptionalwith a default of{ referralId: undefined }instead ofasCorePluginInit, so Bridgeless stays on by default when the key is missing (matching the previousbridgeless: truebehavior).corePlugins.tsnow mapsbridgeless: ENV.BRIDGELESS_INITinstead ofbridgeless: true, forwarding the config object to the plugin. With no env entry, behavior is unchanged; setting"BRIDGELESS_INIT": { "referralId": <uint16> }tags Bridgeless deposits for referral revenue once Edge’s id is registered.Reviewed by Cursor Bugbot for commit baeff17. Bugbot is set up for automated code reviews on this repo. Configure here.