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
1 change: 0 additions & 1 deletion src/components/dashboard/AuditLog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,5 @@ export default function AuditLog() {
)}
</div>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion src/lib/sac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function inspectSac(asset: SacAsset, network: NetworkName): Promise
await server.getContractData(
contractId,
StellarSdk.xdr.ScVal.scvLedgerKeyContractInstance(),
StellarSdk.SorobanRpc.Durability.Persistent,
StellarSdk.rpc.Durability.Persistent,
)
return { contractId, deployed: true, metadata }
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/stellar/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export function getServer(network: NetworkName = 'testnet'): StellarSdk.Horizon.

export const ee = getServer;

export function getSorobanServer(network: NetworkName = 'testnet'): StellarSdk.SorobanRpc.Server {
export function getSorobanServer(network: NetworkName = 'testnet'): StellarSdk.rpc.Server {
const config = NETWORKS[network];
if (network === 'custom' && !config.sorobanUrl) {
throw new Error('Custom Soroban RPC URL not configured');
Expand Down
6 changes: 3 additions & 3 deletions src/lib/stellar/rpcReadSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ export const RPC_RETENTION_LIMIT_LEDGERS = 100_000;
export class RpcReadSource implements StellarReadSource {
private network: NetworkName;
private retentionLimit: number;
private serverGetter?: (_network: NetworkName) => StellarSdk.SorobanRpc.Server;
private serverGetter?: (_network: NetworkName) => StellarSdk.rpc.Server;

constructor(
network: NetworkName = 'testnet',
retentionLimit: number = RPC_RETENTION_LIMIT_LEDGERS,
serverGetter?: (_network: NetworkName) => StellarSdk.SorobanRpc.Server
serverGetter?: (_network: NetworkName) => StellarSdk.rpc.Server
) {
this.network = network;
this.retentionLimit = retentionLimit;
this.serverGetter = serverGetter;
}

private getServer(): StellarSdk.SorobanRpc.Server {
private getServer(): StellarSdk.rpc.Server {
if (this.serverGetter) {
return this.serverGetter(this.network);
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { create } from 'zustand'
import { getStoredValue } from './storage'
import { syncState, onStateChange, resolveStateConflict, loadSyncedState, getTabId } from '../utils/stateSync'
import type { NetworkName, NetworkStats } from './stellar'
import type { Horizon, SorobanRpc } from '@stellar/stellar-sdk'
import type { Horizon, rpc } from '@stellar/stellar-sdk'
import { generateInsights, type AnalyticsSummary } from './analytics'
import { accountRequests } from './requestCancellation'
import { applyCustomThemeToDOM, removeCustomThemeFromDOM, saveThemeVarsToStorage, clearThemeVarsFromStorage, type ThemeDefinition } from '../styles/themeTypes'
Expand Down Expand Up @@ -93,7 +93,7 @@ export interface NetworkSlice {
faucetLoading: boolean
faucetResult: unknown
contractId: string
contractData: SorobanRpc.Api.LedgerEntryResult | null
contractData: rpc.Api.LedgerEntryResult | null
contractLoading: boolean
contractError: string | null
deploymentStatus: Record<string, unknown> | null
Expand Down Expand Up @@ -247,7 +247,7 @@ export interface StoreState extends NetworkSlice, SessionSlice, AccountSlice, Ui
setFaucetResult: (r: unknown) => void

setContractId: (id: string) => void
setContractData: (data: SorobanRpc.Api.LedgerEntryResult) => void
setContractData: (data: rpc.Api.LedgerEntryResult) => void
setContractLoading: (v: boolean) => void
setContractError: (e: string | null) => void

Expand Down
4 changes: 2 additions & 2 deletions src/lib/wallet/smartWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export async function fetchSacBalances(
const simResponse = await server.simulateTransaction(tx)

if (
StellarSdk.SorobanRpc.Api.isSimulationSuccess(simResponse) &&
StellarSdk.rpc.Api.isSimulationSuccess(simResponse) &&
simResponse.result?.retval
) {
const retval = simResponse.result.retval
Expand Down Expand Up @@ -363,7 +363,7 @@ export async function fetchSmartWalletAccount(

const simResp = await server.simulateTransaction(tx)
if (
StellarSdk.SorobanRpc.Api.isSimulationSuccess(simResp) &&
StellarSdk.rpc.Api.isSimulationSuccess(simResp) &&
simResp.result?.retval
) {
const native = StellarSdk.scValToNative(simResp.result.retval)
Expand Down
3 changes: 2 additions & 1 deletion src/ml/isolation_forest.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Simple Isolation Forest implementation (approximate)
const fs = require('fs');

function c(n) {
if (n <= 1) return 0;
Expand Down Expand Up @@ -77,11 +76,13 @@ class IsolationForest {
}

save(path) {
const fs = require('fs');
fs.mkdirSync(require('path').dirname(path), { recursive: true });
fs.writeFileSync(path, JSON.stringify(this.toJSON()));
}

static load(path) {
const fs = require('fs');
const raw = fs.readFileSync(path, 'utf8');
const obj = JSON.parse(raw);
const f = new IsolationForest(obj.nTrees, obj.sampleSize);
Expand Down
20 changes: 3 additions & 17 deletions src/ml/isolation_forest.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
// Browser-compatible shim — the real CJS module only runs in Node (training/server).
// In the browser bundle we export a no-op class so the import chain doesn't break.
let IsolationForest: any;
import isolationForestModule from './isolation_forest.cjs'

if (typeof window === 'undefined') {
// Node environment (training scripts, server-side)
// eslint-disable-next-line @typescript-eslint/no-var-requires
IsolationForest = require('./isolation_forest.cjs').IsolationForest;
} else {
IsolationForest = class {
fit() { return this; }
predict() { return []; }
score() { return 0; }
save() {}
static load() { return new IsolationForest(); }
};
}
const { IsolationForest } = isolationForestModule

export { IsolationForest };
export { IsolationForest }
Loading