Skip to content

Auto-assign BitcoinDepot referral on wallet detection#6022

Closed
j0ntz wants to merge 1 commit into
developfrom
jon/bitcoindepot-detection
Closed

Auto-assign BitcoinDepot referral on wallet detection#6022
j0ntz wants to merge 1 commit into
developfrom
jon/bitcoindepot-detection

Conversation

@j0ntz

@j0ntz j0ntz commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Asana task: https://app.asana.com/0/1215088146871429/1214990791228138

Detect BitcoinDepot whitelabel users at login by examining the account's wallets and auto-assign them the bitcoindepot referral/affiliate ID.

  • Adds hasBitcoinDepotWallets(account) (src/util/bitcoinDepotUtils.ts): true when any non-deleted wallet's appIds contains a BitcoinDepot appId (case-insensitive substring match, single updatable constant).
  • loadAccountReferral assigns installerId: 'bitcoindepot' to unaffiliated accounts on both load paths (existing referral file without installerId, and the no-referral default path), persists it via the existing saveAccountReferral flow, and attempts activatePromotion('bitcoindepot') with silent errors.
  • Existing affiliations (installerId already set) are never overwritten.
  • No visual changes; unit tests cover the detection helper.

Note: the exact BitcoinDepot login appId is not present in this repo; the substring match constant should be confirmed/adjusted once the whitelabel appId is verified.


Note

Medium Risk
Changes login-time referral and promotion activation for a subset of users; mis-detection from the substring appIds match could affiliate wrong accounts, though existing installerId values are preserved.

Overview
Adds automatic BitcoinDepot whitelabel affiliation at login when wallet history indicates the user came from that app and the account has no installerId yet.

A new hasBitcoinDepotWallets helper scans non-deleted wallets for a case-insensitive bitcoindepot substring in appIds. loadAccountReferral sets installerId to bitcoindepot, persists via the existing save flow, and calls activatePromotion('bitcoindepot') with errors ignored. The same logic applies on the existing-referral path (only when installerId is unset) and on the no-referral-file default path. Existing affiliations are never overwritten. Unit tests cover the detector; CHANGELOG is updated.

Reviewed by Cursor Bugbot for commit 76a478e. Bugbot is set up for automated code reviews on this repo. Configure here.

Detect BitcoinDepot whitelabel users at login by checking account
wallets for the BitcoinDepot login appId, and assign the bitcoindepot
referral/affiliate ID to unaffiliated accounts. Existing affiliations
are never overwritten.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@j0ntz j0ntz closed this Jun 8, 2026
@j0ntz

j0ntz commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Not possible to detect bd users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant