Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
0a133ae
[Extension] Swap to New Token design doc
CassioMG Jun 24, 2026
e351df6
[Extension] Drop Paste button from Swap to New Token design doc
CassioMG Jun 24, 2026
bb5be7e
[Extension] Omit Popular tokens on custom networks in Swap design doc
CassioMG Jun 24, 2026
26112a5
[Extension] Rename isNew -> requiresTrustline in Swap design doc
CassioMG Jun 24, 2026
f6d73a4
[Extension] Add destinationTokenDetails to transactionSubmission slice
CassioMG Jun 24, 2026
3707af7
[Extension] Default swap slippage to 2% to match mobile
CassioMG Jun 24, 2026
c6b4981
[Extension] Add shared PercentageButtons component
CassioMG Jun 24, 2026
47a094b
[Extension] Add shared AmountCard component with optional security badge
CassioMG Jun 24, 2026
190e79e
[Extension] Migrate SendAmount to shared AmountCard + PercentageButtons
CassioMG Jun 24, 2026
adf9578
[Extension] Remove Send-local InputWidthContext now that AmountCard o…
CassioMG Jun 24, 2026
eec672d
[Extension] Add fetchTrendingAssets stellar.expert helper for swap Po…
CassioMG Jun 24, 2026
f228bcb
[Extension] Add Redux cache slots for swap Popular tokens + asset sca…
CassioMG Jun 24, 2026
dc8050f
[Extension] Add useSwapTokenLookup destination-discovery hook for swa…
CassioMG Jun 24, 2026
e661d1a
[Extension] Add SwapTokenRow for swap picker (held + non-held variants)
CassioMG Jun 24, 2026
c076158
[Extension] Add Verified/Unverified token info sheets for swap picker
CassioMG Jun 24, 2026
4002e02
[Extension] Add SwapPickerSections (sections, info icons, empty/fallb…
CassioMG Jun 24, 2026
81268ec
[Extension] Parameterize SwapAsset with selectionType (source/destina…
CassioMG Jun 24, 2026
775eccc
Extract buildChangeTrustOperation from getManageAssetXDR
CassioMG Jun 24, 2026
10a5792
Build atomic changeTrust+pathPayment swap tx with total-across-ops fee
CassioMG Jun 24, 2026
6e28b54
Add quote-expiry op-code classification helper
CassioMG Jun 24, 2026
73b8434
Add shouldShowXlmReservePreflight predicate
CassioMG Jun 24, 2026
8c557fd
Add horizonGetBestReceivePath for XLM-reserve prefill
CassioMG Jun 24, 2026
4998ae7
Add XlmReserveSheet (swap for 0.5 XLM, copy address, why-XLM link)
CassioMG Jun 24, 2026
5da1848
[Extension] Add swap-to-new-token telemetry event names
CassioMG Jun 24, 2026
939c6c7
[Extension] Add calculateSwapRate helper for swap review rate row
CassioMG Jun 24, 2026
1fc903d
[Extension] Add trustline banner + info sheet for swap review
CassioMG Jun 24, 2026
9c6dbc1
[Extension] Wire trustline banner, info sheet & rate row into ReviewTx
CassioMG Jun 24, 2026
7b12a23
[Extension] Render SwapAmount on shared AmountCard + PercentageButton…
CassioMG Jun 24, 2026
ff72c8c
[Extension] Add CTA state machine, post-scan gate & reserve pre-fligh…
CassioMG Jun 24, 2026
f7c230e
[Extension] Wire picker selectionType, destination details & swap tel…
CassioMG Jun 24, 2026
7f48804
[Extension] Add swap-to-new-token i18n strings (en + pt) with parity …
CassioMG Jun 24, 2026
741eaf0
[Extension] Add swap-to-new-token Playwright E2E spec
CassioMG Jun 24, 2026
aa07004
[Extension] Reset swap amount input to crypto for priceless source asset
CassioMG Jun 24, 2026
50c3ee6
[Extension] Fix wrong asset on "Sent!" screen after switching token m…
CassioMG Jun 25, 2026
90363c1
Polish Swap home + destination picker to match Figma
CassioMG Jun 25, 2026
cc6d33e
Refine Swap home + picker details to match Figma
CassioMG Jun 25, 2026
c0846e6
Conform Swap changes to AGENTS.md best practices
CassioMG Jun 25, 2026
2029643
Add setInputType to the priceless-asset effect deps
CassioMG Jun 25, 2026
910a746
Add performancePlugin no-op to the Amplitude autocapture stub
CassioMG Jun 25, 2026
4dc95c1
Mock runtime.onMessage/connect in the dev webextension-polyfill shim
CassioMG Jun 25, 2026
8736023
Use a plain plus icon for the empty swap Select picker
CassioMG Jun 25, 2026
bfb42f1
Match the empty swap Select pill dimensions to the token picker
CassioMG Jun 25, 2026
0868e93
Add the dropdown chevron to the empty swap Select picker
CassioMG Jun 25, 2026
156ac75
Darken the swap direction toggle so it's visible on the card seam
CassioMG Jun 25, 2026
ab092cd
Enlarge the swap confirm button to match the Send flow
CassioMG Jun 25, 2026
53cb2e3
Mute the Send flow "Fee:" label to match the Swap flow
CassioMG Jun 25, 2026
14eca11
Widen the AmountCard input click target
CassioMG Jun 25, 2026
4d9bf73
Style the empty Select plus as a small badge on a lighter circle
CassioMG Jun 25, 2026
f189637
Mute the Select plus icon to the "You receive" label color
CassioMG Jun 25, 2026
8028144
Shrink the swap direction toggle to 36px
CassioMG Jun 25, 2026
19e406a
Lighten the swap direction toggle so it doesn't melt into the background
CassioMG Jun 25, 2026
96afc00
Add shared AssetListRow + use it for the Swap discover lists
CassioMG Jun 25, 2026
07d3b62
Migrate Add-a-token rows to the shared AssetListRow
CassioMG Jun 25, 2026
ec0ca42
Space the Swap discover rows so they aren't glued together
CassioMG Jun 25, 2026
78a1018
Use a shared BalanceRow for Swap "Your tokens"; retire SwapTokenRow
CassioMG Jun 25, 2026
2d552e0
Render token icons as perfect circles regardless of source aspect ratio
CassioMG Jun 25, 2026
1d920fd
Share BalanceRow on the account-home balances list
CassioMG Jun 25, 2026
22017aa
Give BalanceRow lists consistent row spacing
CassioMG Jun 25, 2026
08ca478
Show the same "Your tokens" list in the Swap-from picker
CassioMG Jun 25, 2026
0e239f3
Fix "Your tokens" icons stuck loading in the Swap picker
CassioMG Jun 25, 2026
92ba6e4
Restyle Swap Verified/Unverified info sheets to match Figma
CassioMG Jun 25, 2026
9145652
Restyle trustline banner and info sheet to match Figma
CassioMG Jun 26, 2026
02e66f1
Filter the Swap-from list from the first character typed
CassioMG Jun 26, 2026
db4de25
Make Swap "Your tokens" classic-only, fiat-sorted, and always visible
CassioMG Jun 26, 2026
aca6604
Seed recommendedFee in XLM so Swap shows 0.00001, not "100 XLM"
CassioMG Jun 26, 2026
bc09db2
Show the picked non-held token's logo in the Swap receive picker
CassioMG Jun 26, 2026
f2490f4
Rework the Swap direction toggle and reset the amount on source change
CassioMG Jun 26, 2026
c5822d1
Inline-bold the reserve amount in the trustline info sheet
CassioMG Jun 26, 2026
4695fa2
Style the Swap picker empty state as a filled card
CassioMG Jun 26, 2026
d6f63fe
Reset the other picker to "(+) Select" when the same token is picked
CassioMG Jun 26, 2026
30c82f7
Never hide the fiat line; keep the swap fee in XLM
CassioMG Jun 26, 2026
fb72fcc
Use defined SDS font-weight vars in the info sheet
CassioMG Jun 26, 2026
e88a65f
Render the trustline info sheet as a slide-up sheet, not a review pane
CassioMG Jun 26, 2026
16bd79c
Price non-held swap destination tokens (token-prices + spot fallback)
CassioMG Jun 26, 2026
8485596
Remove dead Blockaid asset-scan Redux cache
CassioMG Jun 26, 2026
71151a9
Surface swap token-discovery outages instead of silent empty results
CassioMG Jun 26, 2026
d487072
Swap review: show conversion Rate, drop Minimum received + Memo rows
CassioMG Jun 26, 2026
2806c47
Reserve the 0.5 XLM trustline bump up-front when swapping XLM to a ne…
CassioMG Jun 26, 2026
e66ca34
Scale the default swap fee by operation count
CassioMG Jun 26, 2026
6a078eb
Wire up the "Swap for 0.5 XLM" reserve-recovery action
CassioMG Jun 27, 2026
382cd0f
Recover from a quote that expires at swap submit instead of dead-ending
CassioMG Jun 27, 2026
6ee060d
Fix conditional useMemo in SwapAmount (rules-of-hooks)
CassioMG Jun 27, 2026
8528d47
Gate the swap CTA on no-path and insufficient XLM for fees
CassioMG Jun 27, 2026
6a5c9eb
Show the Soroban hint when a pasted contract id returns no results
CassioMG Jun 27, 2026
4b30754
Simplify the swap record filter to honestly mirror mobile
CassioMG Jun 27, 2026
90dcc0a
Fold the destination token's Blockaid verdict into the swap review gate
CassioMG Jun 27, 2026
6450d41
Wire the swap source token's Blockaid verdict into the review gate
CassioMG Jun 27, 2026
344583a
Emit swap success + trustline-added telemetry post-confirmation
CassioMG Jun 27, 2026
0a10d36
Cache the last idle swap lookup in memory for instant repaint + stale…
CassioMG Jun 27, 2026
9382116
Persist the swap top-tokens list across popup sessions
CassioMG Jun 27, 2026
92e30aa
Pre-warm the swap top-tokens cache from the account screen
CassioMG Jun 27, 2026
5a23b48
Route swap top-tokens persistence through the background message hand…
CassioMG Jun 28, 2026
d039de2
Improve the swap amount-screen default state + "Select a token" CTA
CassioMG Jun 28, 2026
986a2ab
Resolve a pasted SAC to the held token it wraps on the swap-from picker
CassioMG Jun 28, 2026
9c2a4b5
Keep the Blockaid warning badge on the selected swap token pills
CassioMG Jun 28, 2026
512f581
Show a loader while the swap-to search is in flight
CassioMG Jun 28, 2026
e068684
Give the swap review Rate row a content-width label and a fitted value
CassioMG Jun 28, 2026
e3785a8
Keep a new token's icon through the Swapping/Swapped! states
CassioMG Jun 28, 2026
830a96e
Fix the swap-to picker loader getting stuck after a search
CassioMG Jun 29, 2026
c423a6e
Show the generic empty state for an unmatched address on the swap-fro…
CassioMG Jun 29, 2026
351e7cd
Enable the swap "Enter an amount" CTA and focus the sell input on tap
CassioMG Jun 29, 2026
b894df8
Fix the swap fiat-toggle first-tap glitches
CassioMG Jun 29, 2026
72d8583
Show a single Blockaid banner on the swap review + badge the flagged …
CassioMG Jun 29, 2026
17e9685
Hide the swap review body while the trustline info sheet is open
CassioMG Jun 29, 2026
3377ea6
Surface the swap quote-expired notice as a transient toast
CassioMG Jun 29, 2026
93bdf77
Rebuild the XLM-reserve sheet to match Figma + fix the help link
CassioMG Jun 29, 2026
fd13f8e
Don't let an unscannable tx hide a malicious-token banner on review
CassioMG Jun 29, 2026
24bc945
Re-measure the amount input width when the font-size class changes
CassioMG Jun 29, 2026
80df6d6
Render the trustline explanation in-flow so it isn't clipped on the r…
CassioMG Jun 29, 2026
a9e1a02
Shrink the swap direction toggle so it clears the fiat-toggle button
CassioMG Jun 29, 2026
4d54e6c
Disable the swap "Enter an amount" CTA while the sell input is focused
CassioMG Jun 29, 2026
fee8cec
Let the fiat amount input be fully erased to empty
CassioMG Jun 29, 2026
d08d298
Use mobile's insufficient-balance copy with the max spendable amount
CassioMG Jun 29, 2026
159efcc
Fetch swap token prices for held + selected tokens so prices survive …
CassioMG Jun 29, 2026
ca3cf4f
Recalculate the fiat amount when swapping for the 0.5 XLM reserve
CassioMG Jun 29, 2026
1c2e3d5
Polish the XLM-reserve sheet buttons + icon colors toward Figma
CassioMG Jun 29, 2026
1ffb6ab
Show friendly Blockaid reasons (not the raw validation string) on tx …
CassioMG Jun 29, 2026
c8812d3
Use "token" instead of "asset" in Blockaid security copy
CassioMG Jun 29, 2026
7467ffc
Speed up the swap-to search: in-session cache + earlier loader hand-off
CassioMG Jun 29, 2026
bc44578
Stop the i18n scanner splitting colon keys into stray namespace files
CassioMG Jun 29, 2026
144851f
Fix stale comment on the swap direction toggle size
CassioMG Jun 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions @shared/api/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2514,3 +2514,35 @@ export const dismissDiscoverWelcome = async (): Promise<boolean> => {

return !!hasSeenDiscoverWelcome;
};

export const getCachedSwapTopTokens = async (
network: string,
): Promise<{ tokens: unknown[]; updatedAt: number } | null> => {
const { cachedSwapTopTokens, error } = await sendMessageToBackground({
activePublicKey: null,
type: SERVICE_TYPES.GET_CACHED_SWAP_TOP_TOKENS,
network,
});

if (error) {
throw new Error(error);
}

return cachedSwapTopTokens || null;
};

export const cacheSwapTopTokens = async (
network: string,
tokens: unknown[],
): Promise<void> => {
const { error } = await sendMessageToBackground({
activePublicKey: null,
type: SERVICE_TYPES.CACHE_SWAP_TOP_TOKENS,
network,
tokens,
});

if (error) {
throw new Error(error);
}
};
14 changes: 14 additions & 0 deletions @shared/api/types/message-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,18 @@ export interface CacheAssetIconMessage extends BaseMessage {
iconUrl: string;
}

export interface GetCachedSwapTopTokensMessage extends BaseMessage {
type: SERVICE_TYPES.GET_CACHED_SWAP_TOP_TOKENS;
network: string;
}

export interface CacheSwapTopTokensMessage extends BaseMessage {
type: SERVICE_TYPES.CACHE_SWAP_TOP_TOKENS;
network: string;
// Opaque to the background — the popup owns the trending-asset schema.
tokens: unknown[];
}

export interface GetCachedDomainMessage extends BaseMessage {
type: SERVICE_TYPES.GET_CACHED_ASSET_DOMAIN;
assetCanonical: string;
Expand Down Expand Up @@ -524,6 +536,8 @@ export type ServiceMessageRequest =
| GetCachedAssetIconListMessage
| GetCachedAssetIconMessage
| CacheAssetIconMessage
| GetCachedSwapTopTokensMessage
| CacheSwapTopTokensMessage
| GetCachedDomainMessage
| CacheDomainMessage
| GetMemoRequiredAccountsMessage
Expand Down
1 change: 1 addition & 0 deletions @shared/api/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export interface Response {
overriddenBlockaidResponse: string | null;
recentProtocols: RecentProtocolEntry[];
hasSeenDiscoverWelcome: boolean;
cachedSwapTopTokens: { tokens: unknown[]; updatedAt: number } | null;
}

export interface MemoRequiredAccount {
Expand Down
2 changes: 2 additions & 0 deletions @shared/constants/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export enum SERVICE_TYPES {
CLEAR_RECENT_PROTOCOLS = "CLEAR_RECENT_PROTOCOLS",
GET_DISCOVER_WELCOME_SEEN = "GET_DISCOVER_WELCOME_SEEN",
DISMISS_DISCOVER_WELCOME = "DISMISS_DISCOVER_WELCOME",
GET_CACHED_SWAP_TOP_TOKENS = "GET_CACHED_SWAP_TOP_TOKENS",
CACHE_SWAP_TOP_TOKENS = "CACHE_SWAP_TOP_TOKENS",
USER_ACTIVITY = "USER_ACTIVITY",
SESSION_LOCKED = "SESSION_LOCKED",
SESSION_UNLOCKED = "SESSION_UNLOCKED",
Expand Down
37 changes: 37 additions & 0 deletions config/shims/webextension-polyfill.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
/**
* Dev-only stub for `webextension-polyfill`, swapped in by webpack.dev.js
* (NormalModuleReplacementPlugin). The popup served at localhost:9000 runs as a
* plain web page with no extension runtime, so `browser.*` APIs the UI touches
* at mount must resolve to no-ops — otherwise listeners registered in effects
* (e.g. SessionLockListener's `runtime.onMessage`, SidebarSigningListener's
* `runtime.connect`) throw and the error boundary takes down the whole app.
*
* This only makes the UI render for fast iteration — real messaging requires
* loading the unpacked extension.
*/

const noopEvent = {
addListener: () => undefined,
removeListener: () => undefined,
hasListener: () => false,
};

const makePort = (name = "") => ({
name,
onMessage: noopEvent,
onDisconnect: noopEvent,
postMessage: () => undefined,
disconnect: () => undefined,
});

export default {
tabs: {
create: ({ url }: { url: string }) => window.open(url),
},
runtime: {
onMessage: noopEvent,
onMessageExternal: noopEvent,
connect: ({ name }: { name?: string } = {}) => makePort(name),
sendMessage: () =>
Promise.reject(
new Error(
"webextension-polyfill dev shim: runtime messaging is unavailable at localhost:9000 — load the unpacked extension for full functionality",
),
),
},
};
Loading
Loading