Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
pull_request:
branches:
- main
- next
push:
branches:
- main
- next

jobs:
build:
Expand Down
825 changes: 331 additions & 494 deletions CLAUDE.MD

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@
"vite-plugin-static-copy": "^3.1.2"
},
"dependencies": {
"@aztec/accounts": "v4.0.0-nightly.20260126",
"@aztec/aztec.js": "v4.0.0-nightly.20260126",
"@aztec/bb.js": "v4.0.0-nightly.20260126",
"@aztec/blob-lib": "v4.0.0-nightly.20260126",
"@aztec/constants": "v4.0.0-nightly.20260126",
"@aztec/entrypoints": "v4.0.0-nightly.20260126",
"@aztec/ethereum": "v4.0.0-nightly.20260126",
"@aztec/foundation": "v4.0.0-nightly.20260126",
"@aztec/kv-store": "v4.0.0-nightly.20260126",
"@aztec/noir-contracts.js": "v4.0.0-nightly.20260126",
"@aztec/noir-noirc_abi": "v4.0.0-nightly.20260126",
"@aztec/protocol-contracts": "v4.0.0-nightly.20260126",
"@aztec/pxe": "v4.0.0-nightly.20260126",
"@aztec/stdlib": "v4.0.0-nightly.20260126",
"@aztec/wallet-sdk": "v4.0.0-nightly.20260126",
"@aztec/accounts": "v4.0.0-nightly.20260204",
"@aztec/aztec.js": "v4.0.0-nightly.20260204",
"@aztec/bb.js": "v4.0.0-nightly.20260204",
"@aztec/blob-lib": "v4.0.0-nightly.20260204",
"@aztec/constants": "v4.0.0-nightly.20260204",
"@aztec/entrypoints": "v4.0.0-nightly.20260204",
"@aztec/ethereum": "v4.0.0-nightly.20260204",
"@aztec/foundation": "v4.0.0-nightly.20260204",
"@aztec/kv-store": "v4.0.0-nightly.20260204",
"@aztec/noir-contracts.js": "v4.0.0-nightly.20260204",
"@aztec/noir-noirc_abi": "v4.0.0-nightly.20260204",
"@aztec/protocol-contracts": "v4.0.0-nightly.20260204",
"@aztec/pxe": "v4.0.0-nightly.20260204",
"@aztec/stdlib": "v4.0.0-nightly.20260204",
"@aztec/wallet-sdk": "v4.0.0-nightly.20260204",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@fontsource/roboto": "^5.1.1",
Expand Down
15 changes: 12 additions & 3 deletions app/src/config/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const NETWORKS: NetworkConfig[] = [
chainId: 31337,
version: 0, // Auto-detect version
description: "Local development network",
color: "#4caf50", // Green
color: "#4caf50",
nodeUrl: "http://localhost:8080",
},
{
Expand All @@ -26,9 +26,18 @@ export const NETWORKS: NetworkConfig[] = [
chainId: 11155111,
version: 1647720761,
description: "Aztec Labs Devnet",
color: "#2196f3", // Blue
color: "#2196f3",
nodeUrl: "https://next.devnet.aztec-labs.com/",
},
{
id: "nextnet",
name: "Nextnet",
chainId: 11155111,
version: 1478105884,
description: "Aztec Labs Nextnet",
color: "#f321c9",
nodeUrl: "https://nextnet.aztec-labs.com/",
},
];

export const DEFAULT_NETWORK = NETWORKS[1];
Expand All @@ -39,7 +48,7 @@ export function getNetworkById(id: string): NetworkConfig | undefined {

export function getNetworkByChainId(
chainId: number,
version?: number
version?: number,
): NetworkConfig | undefined {
return NETWORKS.find((network) => {
if (network.version !== 0) {
Expand Down
10 changes: 8 additions & 2 deletions app/src/ipc/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ contextBridge.exposeInMainWorld("walletAPI", {
listAuthorizedApps(stringifiedArgs: string): Promise<string[]> {
return ipcRenderer.invoke("listAuthorizedApps", stringifiedArgs);
},
getAppAuthorizations(stringifiedArgs: string): Promise<Record<string, any>> {
return ipcRenderer.invoke("getAppAuthorizations", stringifiedArgs);
getAppCapabilities(stringifiedArgs: string): Promise<any[]> {
return ipcRenderer.invoke("getAppCapabilities", stringifiedArgs);
},
capabilityToStorageKeys(stringifiedArgs: string): Promise<string[]> {
return ipcRenderer.invoke("capabilityToStorageKeys", stringifiedArgs);
},
storeCapabilityGrants(stringifiedArgs: string): Promise<void> {
return ipcRenderer.invoke("storeCapabilityGrants", stringifiedArgs);
},
updateAccountAuthorization(stringifiedArgs: string): Promise<void> {
return ipcRenderer.invoke("updateAccountAuthorization", stringifiedArgs);
Expand Down
107 changes: 73 additions & 34 deletions app/src/ipc/wallet-internal-interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fr } from "@aztec/aztec.js/fields";
import { type Wallet, WalletSchema } from "@aztec/aztec.js/wallet";
import { type Wallet, WalletSchema, type GrantedCapability } from "@aztec/aztec.js/wallet";
import { optional, schemas } from "@aztec/stdlib/schemas";
import { z } from "zod";
import { type ApiSchemaFor } from "@aztec/stdlib/schemas";
Expand Down Expand Up @@ -38,14 +38,16 @@ const ArgValueSchema = z.object({
value: z.string(),
});

const PublicEnqueueEventSchema: z.ZodType<any> = z.object({
type: z.literal("public-enqueue"),
const PublicCallEventSchema: z.ZodType<any> = z.object({
type: z.literal("public-call"),
depth: z.number(),
counter: z.number(),
contract: ContractInfoSchema,
function: z.string(),
caller: ContractInfoSchema,
isStaticCall: z.boolean(),
args: z.array(ArgValueSchema),
returnValues: z.array(ArgValueSchema).optional(),
});

const PrivateCallEventSchema: z.ZodType<any> = z.lazy(() =>
Expand All @@ -63,7 +65,7 @@ const PrivateCallEventSchema: z.ZodType<any> = z.lazy(() =>
args: z.array(ArgValueSchema),
returnValues: z.array(ArgValueSchema),
nestedEvents: z.array(
z.union([PrivateCallEventSchema, PublicEnqueueEventSchema])
z.union([PrivateCallEventSchema, PublicCallEventSchema])
),
})
);
Expand All @@ -72,7 +74,7 @@ const DecodedExecutionTraceSchema = z.union([
// Full transaction trace
z.object({
privateExecution: PrivateCallEventSchema,
publicExecutionQueue: z.array(PublicEnqueueEventSchema),
publicCalls: z.array(PublicCallEventSchema),
}),
// Simplified utility trace
z.object({
Expand All @@ -85,6 +87,47 @@ const DecodedExecutionTraceSchema = z.union([
}),
]);

// Schemas for simulation/proving stats
const FunctionTimingSchema = z.object({
functionName: z.string(),
time: z.number(),
oracles: z.record(z.object({ times: z.array(z.number()) })).optional(),
});

const StatsTimingsSchema = z.object({
sync: z.number(),
publicSimulation: z.number().optional(),
validation: z.number().optional(),
proving: z.number().optional(), // Only present in ProvingStats - actual proof generation time
perFunction: z.array(FunctionTimingSchema),
unaccounted: z.number(),
total: z.number(),
});

const SimulationStatsSchema = z.object({
timings: StatsTimingsSchema,
nodeRPCCalls: z
.object({
perMethod: z.record(z.object({ times: z.array(z.number()) })),
roundTrips: z.object({
roundTripDurations: z.array(z.number()),
roundTripMethods: z.array(z.array(z.string())),
}),
})
.optional(),
});

const ProvingStatsSchema = z.object({
timings: StatsTimingsSchema,
});

const StoredPhaseTimingsSchema = z.object({
simulation: z.number().optional(),
proving: z.number().optional(),
sending: z.number().optional(),
mining: z.number().optional(),
});

// Internal wallet interface - extends external with internal-only methods
export type InternalWalletInterface = Omit<Wallet, "getAccounts"> & {
createAccount(
Expand All @@ -99,7 +142,9 @@ export type InternalWalletInterface = Omit<Wallet, "getAccounts"> & {
getExecutionTrace(interactionId: string): Promise<
| {
trace?: DecodedExecutionTrace;
stats?: any;
stats?: z.infer<typeof SimulationStatsSchema>;
provingStats?: z.infer<typeof ProvingStatsSchema>;
phaseTimings?: z.infer<typeof StoredPhaseTimingsSchema>;
from?: string;
embeddedPaymentMethodFeePayer?: string;
}
Expand All @@ -113,17 +158,13 @@ export type InternalWalletInterface = Omit<Wallet, "getAccounts"> & {
) => void;
// App authorization management
listAuthorizedApps(): Promise<string[]>;
getAppAuthorizations(appId: string): Promise<{
accounts: { alias: string; item: string }[];
contacts: { alias: string; item: string }[];
simulations: Array<{
type: "simulateTx" | "simulateUtility";
payloadHash: string;
title?: string;
key: string;
}>;
otherMethods: string[];
}>;
getAppCapabilities(appId: string): Promise<GrantedCapability[]>;
capabilityToStorageKeys(capability: GrantedCapability): Promise<string[]>;
storeCapabilityGrants(
appId: string,
manifest: any,
granted: GrantedCapability[]
): Promise<void>;
updateAccountAuthorization(
appId: string,
accounts: { alias: string; item: string }[]
Expand Down Expand Up @@ -174,7 +215,9 @@ export const InternalWalletInterfaceSchema: ApiSchemaFor<InternalWalletInterface
optional(
z.object({
trace: DecodedExecutionTraceSchema.optional(),
stats: z.any().optional(),
stats: SimulationStatsSchema.optional(),
provingStats: ProvingStatsSchema.optional(),
phaseTimings: StoredPhaseTimingsSchema.optional(),
from: z.string().optional(),
embeddedPaymentMethodFeePayer: z.string().optional(),
})
Expand All @@ -192,24 +235,20 @@ export const InternalWalletInterfaceSchema: ApiSchemaFor<InternalWalletInterface
// App authorization management
listAuthorizedApps: z.function().args().returns(z.array(z.string())),
// @ts-ignore
getAppAuthorizations: z
getAppCapabilities: z
.function()
.args(z.string())
.returns(
z.object({
accounts: z.array(z.object({ alias: z.string(), item: z.string() })),
contacts: z.array(z.object({ alias: z.string(), item: z.string() })),
simulations: z.array(
z.object({
type: z.enum(["simulateTx", "simulateUtility"]),
payloadHash: z.string(),
title: z.string().optional(),
key: z.string(),
})
),
otherMethods: z.array(z.string()),
})
),
.returns(z.array(z.any())),
// @ts-ignore
capabilityToStorageKeys: z
.function()
.args(z.any())
.returns(z.array(z.string())),
// @ts-ignore
storeCapabilityGrants: z
.function()
.args(z.string(), z.any(), z.array(z.any()))
.returns(z.void()),
// @ts-ignore
updateAccountAuthorization: z
.function()
Expand Down
4 changes: 3 additions & 1 deletion app/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ app.on("ready", async () => {
"getExecutionTrace",
"resolveAuthorization",
"listAuthorizedApps",
"getAppAuthorizations",
"getAppCapabilities",
"capabilityToStorageKeys",
"storeCapabilityGrants",
"updateAccountAuthorization",
"updateAddressBookAuthorization",
"revokeAuthorization",
Expand Down
1 change: 1 addition & 0 deletions app/src/ui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export function App() {
"getPrivateEvents",
"getContractMetadata",
"getContractClassMetadata",
"requestCapabilities",
]);

const [authQueue, setAuthQueue] = useState<AuthorizationRequest[]>([]);
Expand Down
Loading