Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
948c127
add partial flow redesign for add sac token
leofelix077 Jun 18, 2026
9b8666d
fix flow logic to external add token
leofelix077 Jun 23, 2026
aea39a3
adjust paddings for add and remove trustline popup
leofelix077 Jun 24, 2026
a7ca9a7
cleanup add token functions
leofelix077 Jun 24, 2026
0b9b951
add tests for sac and sep scenarios and adjust texts
leofelix077 Jun 24, 2026
e00510a
adjust sac check for assets and adjust layouting
leofelix077 Jun 24, 2026
9f5128f
Merge branch 'master' into feat/addtoken-sac-changetrust-review
leofelix077 Jun 25, 2026
6e3b6b8
adjust hide close tab hint to avoid users leaving hanging promise
leofelix077 Jun 25, 2026
1a1539b
Merge branch 'feat/addtoken-sac-changetrust-review' of https://github…
leofelix077 Jun 25, 2026
de107fa
fix tests and scrollbar behavior on standalone pane
leofelix077 Jun 25, 2026
07207a3
fix fee setting for transaction
leofelix077 Jun 25, 2026
3c1c113
fix scroll behavior to auto on affected views
leofelix077 Jun 25, 2026
cd0ae16
revert styles override
leofelix077 Jun 26, 2026
6e59e6e
side fix: adjust auto lock timer translations
leofelix077 Jun 26, 2026
ca58f47
side fix: adjust auto lock timer translations
leofelix077 Jun 26, 2026
5e51fd7
Merge branch 'master' into feat/addtoken-sac-changetrust-review
leofelix077 Jun 26, 2026
913fd30
harden failed submit
leofelix077 Jun 26, 2026
6255393
Merge branch 'feat/addtoken-sac-changetrust-review' of https://github…
leofelix077 Jun 26, 2026
1a72842
fix hydration issue for token and pubnet + reject promises
leofelix077 Jun 30, 2026
75668d8
Merge branch 'master' of https://github.com/stellar/freighter into fe…
leofelix077 Jun 30, 2026
5b9161c
fix pending promises and reject multiple trustline additions
leofelix077 Jun 30, 2026
b314de9
Fix SEP-41/SAC add-token regressions (feeds into #2869) (#2885)
leofelix077 Jul 11, 2026
3dc2d38
Address PR #2869 review: harden Done round-trip, dedupe SAC e2e stubs…
piyalbasu Jul 16, 2026
65e8323
Merge branch 'master' into feat/addtoken-sac-changetrust-review
piyalbasu Jul 16, 2026
db25d09
Fix AddToken spacing: separate the warning/error notification from th…
piyalbasu Jul 17, 2026
28d8712
Fix e2e assertions after SAC merge: assert verification chip, not the…
piyalbasu Jul 17, 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
10 changes: 9 additions & 1 deletion @shared/api/types/message-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export type RequestAccessResponse = string;
export type SignAuthEntryResponse = Buffer | null;
export type SignTransactionResponse = string;
export type SignBlobResponse = Buffer | null;
export type AddTokenResponse = boolean;
export type AddTokenResponse =
| boolean
| { apiError: { code: number; message: string } };
export type SetAllowedStatusResponse = string;
export type SignedHwPayloadResponse = string | Buffer<ArrayBufferLike>;
export type RejectAccessResponse = undefined;
Expand Down Expand Up @@ -221,6 +223,11 @@ export interface AddTokenMessage extends BaseMessage {
uuid: string;
}

export interface AddTokenFailureMessage extends BaseMessage {
type: SERVICE_TYPES.ADD_TOKEN_FAILURE;
uuid: string;
}

export interface SignTransactionMessage extends BaseMessage {
type: SERVICE_TYPES.SIGN_TRANSACTION;
uuid: string;
Expand Down Expand Up @@ -505,6 +512,7 @@ export type ServiceMessageRequest =
| RejectAccessMessage
| HandleSignedHWPayloadMessage
| AddTokenMessage
| AddTokenFailureMessage
| SignTransactionMessage
| SignBlobMessage
| SignAuthEntryMessage
Expand Down
1 change: 1 addition & 0 deletions @shared/constants/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum SERVICE_TYPES {
REJECT_ACCESS = "REJECT_ACCESS",
GRANT_ACCESS = "GRANT_ACCESS",
ADD_TOKEN = "ADD_TOKEN",
ADD_TOKEN_FAILURE = "ADD_TOKEN_FAILURE",
SIGN_TRANSACTION = "SIGN_TRANSACTION",
SIGN_BLOB = "SIGN_BLOB",
SIGN_AUTH_ENTRY = "SIGN_AUTH_ENTRY",
Expand Down
73 changes: 73 additions & 0 deletions extension/e2e-tests/helpers/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,42 @@ export const stubIsSac = async (page: Page | BrowserContext) => {
});
};

/**
* SAC variant of stubIsSac — returns isSacContract: true so the AddToken view
* routes through the ChangeTrustInternal review instead of silently resolving.
* Use together with stubSacTokenDetails so token-details returns a "CODE:G…"
* name that satisfies StrKey.isValidEd25519PublicKey(assetIssuer).
*/
export const stubIsSacTrue = async (page: Page | BrowserContext) => {
await page.route("**/is-sac-contract**", async (route) => {
const json = {
isSacContract: true,
};
await route.fulfill({ json });
});
};

// The G-address used across the e2e suite as the SAC issuer.
export const SAC_ISSUER =
"GDF32CQINROD3E2LMCGZUDVMWTXCJFR5SBYVRJ7WAAIAS3P7DCVWZEFY";

/**
* Stubs token-details so the SAC token's name is "E2E:<SAC_ISSUER>".
* useTokenLookup splits on ":" to extract the issuer, and AddToken checks
* StrKey.isValidEd25519PublicKey(assetIssuer) to gate the SAC review branch.
*/
export const stubSacTokenDetails = async (page: Page | BrowserContext) => {
await page.route("**/token-details/**", async (route) => {
await route.fulfill({
json: {
name: `E2E:${SAC_ISSUER}`,
decimals: 7,
symbol: "E2E",
},
});
});
};

export const stubTokenDetails = async (page: Page | BrowserContext) => {
await page.route("**/token-details/**", async (route) => {
const url = route.request().url();
Expand Down Expand Up @@ -3146,3 +3182,40 @@ export const stubMaintenanceBannerVariant = async (
},
});
};

/**
* Stubs the asset-list endpoint so that the given contractId appears as a
* verified token. This causes getVerifiedTokens() to return a non-empty array,
* which sets isVerifiedToken=true in AddToken and suppresses the
* "Not on your lists" AssetListWarning banner.
*
* Use page.route() (popup-level) for SEP-41 tokens and context.addInitScript()
* for the SAC flow (where the popup is created before page.route() can fire).
*
* @param page - Playwright Page or BrowserContext to attach the route to
* @param contractId - The contract address that should appear as verified
*/
export const stubVerifiedToken = async (
page: Page | BrowserContext,
contractId: string,
) => {
const verifiedAssetList = {
...STELLAR_EXPERT_ASSET_LIST_JSON,
assets: [
...STELLAR_EXPERT_ASSET_LIST_JSON.assets,
{
code: "E2E",
issuer: "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
contract: contractId,
name: "E2E Token",
org: "unknown",
domain: "example.com",
decimals: 7,
},
],
};

await page.route("*/**/testnet/asset-list/**", async (route) => {
await route.fulfill({ json: verifiedAssetList });
});
};
Loading
Loading