Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
068108c
Account and Nav Redesign (#2129)
aristidesstaffieri Jun 25, 2025
d7006d2
Asset detail redesign (#2131)
aristidesstaffieri Jun 25, 2025
11e7239
[FEATURE] Account history redesign (#2136)
aristidesstaffieri Jul 1, 2025
dad6fc7
QA Beta 5.34.0 Beta version 0 (#2133)
aristidesstaffieri Jul 1, 2025
513ac50
QA 5.34.0 beta.1 (#2144)
aristidesstaffieri Jul 16, 2025
0c22727
Send & Swap Redesign (#2143)
aristidesstaffieri Jul 16, 2025
e265da4
tweaks slide up usage in send and swap flow, adds icons for details i…
aristidesstaffieri Jul 16, 2025
b4914cc
[QA] 5.34.0 beta.2 (#2149)
aristidesstaffieri Jul 18, 2025
41e64cc
[FEATURE] Grant Access Redesign (#2153)
aristidesstaffieri Jul 22, 2025
52ef94f
[FEATURE] Sign Message redesign (#2158)
aristidesstaffieri Jul 30, 2025
44bbdbb
[FEATURE] Redesign Sign Transaction Modal (#2155)
aristidesstaffieri Jul 30, 2025
273b734
[FEATURE] Feature/sign auth entry redesign (#2175)
aristidesstaffieri Aug 1, 2025
9dedf8a
[QA] 5.34.0beta.5 (#2180)
aristidesstaffieri Aug 4, 2025
1370d4c
[FEATURE] internal tx change trust (#2182)
aristidesstaffieri Aug 7, 2025
af82d51
[FEATURE] Redesign notifications, preferences, and recovery phrase (#…
aristidesstaffieri Aug 8, 2025
d89b1d5
[QA] beta 5.34.0-7 (#2189)
aristidesstaffieri Aug 19, 2025
ba3fb9a
[QA] 5.34.0 beta 8 (#2204)
aristidesstaffieri Aug 21, 2025
a13ca9e
copy icon-128 into beta images
aristidesstaffieri Aug 21, 2025
dc13331
uses callback ref in order to remeasure input width on mount when tra…
aristidesstaffieri Aug 22, 2025
e20c4c5
Merge remote-tracking branch 'origin' into release/5.34.0
aristidesstaffieri Aug 22, 2025
00a3a3b
refactors addAsset e2e tests to work is tokens are on the top assets …
aristidesstaffieri Aug 22, 2025
e43cab5
freeze lockfile for docs preview build command
aristidesstaffieri Aug 22, 2025
dbfc5cd
upgrades docusaurus deps and pins wrap-ansi to cjs version
aristidesstaffieri Aug 25, 2025
9024856
pins babel related deps to compatible versions
aristidesstaffieri Aug 25, 2025
e6ac616
revert to lock file and docusaurus versions from master
aristidesstaffieri Aug 25, 2025
3e07989
tweaks wrod wrapping on detail rows
aristidesstaffieri Aug 25, 2025
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
15 changes: 11 additions & 4 deletions @shared/api/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
IssuerKey,
AssetVisibility,
ApiTokenPrices,
HorizonOperation,
} from "./types";
import {
AccountBalancesInterface,
Expand Down Expand Up @@ -281,13 +282,16 @@ export const makeAccountActive = ({
export const updateAccountName = ({
activePublicKey,
accountName,
publicKey,
}: {
activePublicKey: string;
accountName: string;
publicKey: string;
}): Promise<{ allAccounts: Array<Account> }> =>
sendMessageToBackground({
activePublicKey,
accountName,
publicKey,
type: SERVICE_TYPES.UPDATE_ACCOUNT_NAME,
});

Expand Down Expand Up @@ -814,10 +818,10 @@ export const getAccountHistoryStandalone = async ({
}: {
publicKey: string;
networkDetails: NetworkDetails;
}): Promise<Horizon.ServerApi.OperationRecord[]> => {
}): Promise<HorizonOperation[]> => {
const { networkUrl, networkPassphrase } = networkDetails;

let operations = [] as Horizon.ServerApi.OperationRecord[];
let operations = [] as HorizonOperation[];

try {
const server = stellarSdkServer(networkUrl, networkPassphrase);
Expand All @@ -831,7 +835,7 @@ export const getAccountHistoryStandalone = async ({
.includeFailed(true)
.call();

operations = operationsData.records || [];
operations = (operationsData.records as HorizonOperation[]) || [];
} catch (e) {
console.error(e);
}
Expand All @@ -845,7 +849,7 @@ export const getIndexerAccountHistory = async ({
}: {
publicKey: string;
networkDetails: NetworkDetails;
}): Promise<Horizon.ServerApi.OperationRecord[]> => {
}): Promise<HorizonOperation[]> => {
try {
const url = new URL(
`${INDEXER_URL}/account-history/${publicKey}?network=${networkDetails.network}&is_failed_included=true`,
Expand Down Expand Up @@ -1210,12 +1214,15 @@ export const signTransaction = async ({
};

export const signBlob = async ({
apiVersion,
activePublicKey,
}: {
apiVersion?: string;
activePublicKey: string;
}): Promise<void> => {
try {
await sendMessageToBackground({
apiVersion,
activePublicKey,
type: SERVICE_TYPES.SIGN_BLOB,
});
Expand Down
3 changes: 3 additions & 0 deletions @shared/api/types/message-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface TokenToAdd {
}

export interface MessageToSign {
apiVersion?: string;
domain: string;
tab?: browser.Tabs.Tab;
message: string;
Expand Down Expand Up @@ -101,6 +102,7 @@ export interface MakeAccountActiveMessage extends BaseMessage {
export interface UpdateAccountNameMessage extends BaseMessage {
type: SERVICE_TYPES.UPDATE_ACCOUNT_NAME;
accountName: string;
publicKey: string;
}

export interface AddCustomNetworkMessage extends BaseMessage {
Expand Down Expand Up @@ -183,6 +185,7 @@ export interface SignTransactionMessage extends BaseMessage {
}

export interface SignBlobMessage extends BaseMessage {
apiVersion?: string;
type: SERVICE_TYPES.SIGN_BLOB;
}

Expand Down
33 changes: 28 additions & 5 deletions @shared/api/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ export type BlockAidScanTxResult = Blockaid.StellarTransactionScanResponse & {
request_id: string;
};
export type BlockAidBulkScanAssetResult = Blockaid.TokenBulkScanResponse;
export type BlockaidAssetDiff =
| Blockaid.StellarTransactionScanResponse.StellarSimulationResult.StellarLegacyAssetDiff
| Blockaid.StellarTransactionScanResponse.StellarSimulationResult.StellarNativeAssetDiff
| Blockaid.StellarTransactionScanResponse.StellarSimulationResult.StellarContractAssetDiff;

export interface AssetBalance extends Balance {
limit: BigNumber;
Expand Down Expand Up @@ -307,7 +311,24 @@ export interface SorobanBalance {

export type TokenBalances = SorobanBalance[];

export type HorizonOperation = Horizon.ServerApi.OperationRecord;
export type HorizonOperation = Horizon.ServerApi.OperationRecord & {
account: string;
amount?: string;
starting_balance?: string;
asset_code?: string;
asset_issuer?: string;
asset_type?: string;
transaction_attr: Horizon.ServerApi.TransactionRecord & {
contractId?: string;
fnName: string;
args: {
[key: string]: any;
};
};
to_muxed?: string;
to?: string;
from?: string;
};

export interface AccountHistoryInterface {
operations: Array<HorizonOperation> | [];
Expand Down Expand Up @@ -345,11 +366,13 @@ export interface FreighterApiError {
ext?: string[];
}

export interface ApiTokenPrice {
currentPrice: string;
percentagePriceChange24h?: string;
}

export interface ApiTokenPrices {
[key: string]: {
currentPrice: string;
percentagePriceChange24h?: string;
} | null;
[key: string]: ApiTokenPrice | null;
}

export type DiscoverData = {
Expand Down
2 changes: 2 additions & 0 deletions @shared/helpers/stellar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { INDEXER_URL } from "@shared/constants/mercury";
export const CUSTOM_NETWORK = "STANDALONE";
export const LP_ISSUER_KEY = "lp";

export const isPlaywright = process.env.IS_PLAYWRIGHT === "true";

export const isNextSdk = (networkPassphrase: string) =>
[""].includes(networkPassphrase);

Expand Down
2 changes: 1 addition & 1 deletion @stellar/freighter-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stellar/freighter-api",
"version": "4.1.0",
"version": "5.0.0",
"license": "Apache-2.0",
"author": "Stellar Development Foundation <hello@stellar.org>",
"description": "Utility functions to interact with Freighter extension",
Expand Down
1 change: 1 addition & 0 deletions @stellar/freighter-api/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare const __PACKAGE_VERSION__: string;
3 changes: 1 addition & 2 deletions @stellar/freighter-api/src/signAuthEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
import { FreighterApiError } from "@shared/api/types";
import { FreighterApiNodeError } from "@shared/api/helpers/extensionMessaging";
import { isBrowser } from ".";
import packageJson from "../package.json";

export const signAuthEntry = async (
entryXdr: string,
Expand All @@ -29,7 +28,7 @@ export const signAuthEntry = async (
}
}

const req = await submitAuthEntry(entryXdr, packageJson.version, opts);
const req = await submitAuthEntry(entryXdr, __PACKAGE_VERSION__, opts);

if (req.error) {
return { signedAuthEntry: null, signerAddress: "", error: req.error };
Expand Down
3 changes: 1 addition & 2 deletions @stellar/freighter-api/src/signMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import packageJson from "../package.json";
import { Buffer } from "buffer";

import {
Expand Down Expand Up @@ -41,7 +40,7 @@ export const signMessage = async (
}
}

const req = await submitMessage(message, packageJson.version, opts);
const req = await submitMessage(message, __PACKAGE_VERSION__, opts);

if (req.error) {
return { signedMessage: null, signerAddress: "", error: req.error };
Expand Down
15 changes: 1 addition & 14 deletions @stellar/freighter-api/src/signTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
requestAllowedStatus,
requestAccess,
submitTransaction,
} from "@shared/api/external";
import { submitTransaction } from "@shared/api/external";
import { FreighterApiError } from "@shared/api/types";
import { FreighterApiNodeError } from "@shared/api/helpers/extensionMessaging";
import { isBrowser } from ".";
Expand All @@ -19,15 +15,6 @@ export const signTransaction = async (
}
> => {
if (isBrowser) {
const { isAllowed } = await requestAllowedStatus();
if (!isAllowed) {
const req = await requestAccess();

if (req.error) {
return { signedTxXdr: "", signerAddress: "", error: req.error };
}
}

const req = await submitTransaction(transactionXdr, opts);

if (req.error) {
Expand Down
4 changes: 3 additions & 1 deletion @stellar/freighter-api/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const webpack = require("webpack");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const path = require("path");
const { DEFAULT_STATS } = require("../../config/webpack");
const packageJson = require("./package.json");

const BUILD_PATH = path.resolve(__dirname, "./build");

Expand Down Expand Up @@ -39,10 +40,11 @@ const config = {
plugins: [
new webpack.DefinePlugin({
DEV_SERVER: false,
__PACKAGE_VERSION__: JSON.stringify(packageJson.version),
}),
new webpack.NormalModuleReplacementPlugin(
/webextension-polyfill/,
path.resolve(__dirname, "../../config/shims/webextension-polyfill.ts")
path.resolve(__dirname, "../../config/shims/webextension-polyfill.ts"),
),
],
stats: DEFAULT_STATS,
Expand Down
1 change: 1 addition & 0 deletions config/jest/setupTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ global.EXPERIMENTAL = false;
global.TextEncoder = TextEncoder;
// @ts-expect-error
global.TextDecoder = TextDecoder;
global.__PACKAGE_VERSION__ = "5.0.0";

Object.defineProperty(global.self, "crypto", {
value: {
Expand Down
7 changes: 5 additions & 2 deletions docs/docs/playground/signMessage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ import { SignMessageDemo } from "./components/SignMessageDemo";
<p>
```
const kp = <signing key pair>
const res = await stellarApi.signMessage("hi", { networkPassphrase: SorobanClient.Networks.TESTNET })
const passes = kp.verify(Buffer.from("hi", "base64"), Buffer.from(res.signedMessage, "base64")) // true
const message = "hi";
const res = await stellarApi.signMessage(message, { networkPassphrase: SorobanClient.Networks.TESTNET });
const SIGN_MESSAGE_PREFIX = "Stellar Signed Message:\n";
const messageHash = SHA256(SIGN_MESSAGE_PREFIX + message);
const passes = kp.verify(Buffer.from(messageHash, "base64"), res.signedMessage); // true
```
</p>
<strong>Test Freighter's `signMessage` method:</strong>
Expand Down
14 changes: 6 additions & 8 deletions extension/e2e-tests/accountHistory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test("View Account History", async ({ page, extensionId }) => {
test.slow();
await loginAndFund({ page, extensionId });

await page.getByTestId("BottomNav-link-account-history").click();
await page.getByTestId("nav-link-account-history").click();
await expectPageToHaveScreenshot({
page,
screenshot: "account-history.png",
Expand Down Expand Up @@ -41,21 +41,19 @@ test("View failed transaction", async ({ page, extensionId }) => {

test.slow();
await loginAndFund({ page, extensionId });
await page.getByTestId("BottomNav-link-account-history").click();
await page.getByTestId("nav-link-account-history").click();
await expect(page.getByTestId("history-item-amount-component")).toHaveText(
"",
"Mar 21",
);
await expect(page.getByTestId("history-item-label")).toHaveText(
"Transaction failed",
"Transaction Failed",
);
await expectPageToHaveScreenshot({
page,
screenshot: "failed-transaction-history-item.png",
});
await page.getByText("Transaction failed").click();
await expect(page.getByTestId("AppHeaderPageTitle")).toHaveText(
"Transaction failed",
);
await expect(page.getByTestId("AppHeaderPageTitle")).toHaveText("History");
await expectPageToHaveScreenshot({
page,
screenshot: "failed-transaction.png",
Expand Down Expand Up @@ -146,7 +144,7 @@ test("Hide create claimable balance spam", async ({ page, extensionId }) => {

test.slow();
await loginAndFund({ page, extensionId });
await page.getByTestId("BottomNav-link-account-history").click();
await page.getByTestId("nav-link-account-history").click();
await expect(page.getByTestId("AppHeaderPageTitle")).toHaveText("History");
const historyItems = page.getByTestId("history-item");
expect(historyItems).toHaveCount(2);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading