Skip to content
Open
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: 1 addition & 1 deletion .github/workflows/auto-rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: corepack enable

- name: Set up Node.js
uses: actions/setup-node@v7
uses: actions/setup-node@v4
with:
node-version: "22"
cache: yarn
Expand Down
45 changes: 24 additions & 21 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ jobs:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v7
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
node-version: '22'
cache: 'yarn'

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: npm ci
run: yarn install --immutable

- name: Build frontend
run: npm run build
run: yarn build
env:
CI: true

Expand All @@ -40,21 +43,21 @@ jobs:
sha256sum ../frontend-checksums.txt > ../frontend-checksums.txt.sha256

- name: Upload frontend build
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: frontend-build-${{ github.sha }}
path: dist/
retention-days: 30

- name: Upload frontend checksums
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: frontend-checksums-${{ github.sha }}
path: frontend-checksums.txt
retention-days: 30

- name: Deploy to Vercel
uses: vercel/action@v5
uses: amondnet/vercel-action@v42
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
Expand Down Expand Up @@ -123,15 +126,15 @@ jobs:
sha256sum ../../../wasm-checksums.txt > ../../../wasm-checksums.txt.sha256

- name: Upload WASM artifacts
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: contract-wasm-${{ github.sha }}
path: target/wasm32-unknown-unknown/release/*.wasm
retention-days: 30
if-no-files-found: warn

- name: Upload WASM checksums
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: wasm-checksums-${{ github.sha }}
path: wasm-checksums.txt
Expand All @@ -154,19 +157,19 @@ jobs:
cosign-release: 'v2.4.3'

- name: Download WASM artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
name: contract-wasm-${{ github.sha }}
path: ./artifacts/wasm

- name: Download WASM checksums
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
name: wasm-checksums-${{ github.sha }}
path: ./artifacts

- name: Download frontend checksums
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
name: frontend-checksums-${{ github.sha }}
path: ./artifacts
Expand Down Expand Up @@ -206,7 +209,7 @@ jobs:
./artifacts/release-checksums.txt

- name: Upload signed artifacts
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: signed-release-${{ github.sha }}
path: |
Expand All @@ -228,19 +231,19 @@ jobs:
- uses: actions/checkout@v4

- name: Download signed artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
name: signed-release-${{ github.sha }}
path: ./signed-release

- name: Download provenance attestation
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
name: signed-release-${{ github.sha }}
path: ./release-artifacts

- name: Download SBOM
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
name: sbom-${{ github.sha }}
path: ./sbom
Expand Down Expand Up @@ -296,10 +299,10 @@ jobs:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v7
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
node-version: '22'
cache: 'yarn'

- name: Enable Corepack
run: corepack enable
Expand Down Expand Up @@ -340,7 +343,7 @@ jobs:
> sbom/sbom-manifest.json

- name: Upload SBOM artifacts
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: sbom-${{ github.sha }}
path: sbom/
Expand Down
8 changes: 1 addition & 7 deletions api/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,11 @@ async function handler(req: any, res: any) {
timestamp: new Date().toISOString(),
uptime,
services,
circuitBreakers: listCircuitBreakers(),
},
version,
),
);
res.status(200).json({
status: overallStatus,
timestamp: new Date().toISOString(),
uptime,
services,
circuitBreakers: listCircuitBreakers(),
});
}

export default withObservability(handler, "status");
1 change: 0 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
2 changes: 1 addition & 1 deletion src/contracts/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { WalletNetwork } from "@creit.tech/stellar-wallets-kit";
import { Networks as WalletNetwork } from "@creit.tech/stellar-wallets-kit";
import { Network, NetworkType } from "../debug/types/types";

const envSchema = z.object({
Expand Down
5 changes: 4 additions & 1 deletion src/lib/env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { WalletNetwork } from "@creit.tech/stellar-wallets-kit";
import { Networks } from "@creit.tech/stellar-wallets-kit";
import { z } from "zod";

// Alias for backward-compat usage in this file
const WalletNetwork = Networks;

const envSchema = z.object({
PUBLIC_STELLAR_NETWORK: z.enum([
"PUBLIC",
Expand Down
2 changes: 1 addition & 1 deletion src/providers/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { wallet } from "../util/wallet";
import storage from "../util/storage";
import { stellarNetwork } from "../lib/env";
import { ALBEDO_ID } from "@creit.tech/stellar-wallets-kit";
import { ALBEDO_ID } from "@creit.tech/stellar-wallets-kit/modules/albedo";
import { useAsyncTransaction } from "../components/useAsyncTransaction";
import { trackEvent, trackEventWithWallet } from "../lib/analytics/track";
import { useQueryClient } from "@tanstack/react-query";
Expand Down
30 changes: 19 additions & 11 deletions src/util/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import {
StellarWalletsKit,
WalletNetwork,
allowAllModules,
Networks,
type ISupportedWallet,
} from "@creit.tech/stellar-wallets-kit";
import { FreighterModule } from "@creit.tech/stellar-wallets-kit/modules/freighter";
import { AlbedoModule } from "@creit.tech/stellar-wallets-kit/modules/albedo";
import { xBullModule } from "@creit.tech/stellar-wallets-kit/modules/xbull";
import { LobstrModule } from "@creit.tech/stellar-wallets-kit/modules/lobstr";
import { HotWalletModule } from "@creit.tech/stellar-wallets-kit/modules/hotwallet";
import { Horizon } from "@stellar/stellar-sdk";
import { horizonUrl, stellarNetwork, stellarWalletNetwork } from "../lib/env";

// allowAllModules() returns an array containing albedo, freighter, etc.
// This prevents us from having to import them individually and hitting the "Missing Export" error.
export const kit: StellarWalletsKit = new StellarWalletsKit({
network: stellarWalletNetwork as WalletNetwork,
modules: allowAllModules(),
// Initialise the kit with the supported wallet modules.
StellarWalletsKit.init({
network: stellarWalletNetwork as Networks,
modules: [
new FreighterModule(),
new AlbedoModule(),
new xBullModule(),
new LobstrModule(),
new HotWalletModule(),
],
});

function getHorizonHost(mode: string) {
Expand All @@ -35,19 +44,18 @@ export const fetchBalance = async (address: string) => {
const { balances } = await horizon.accounts().accountId(address).call();
return { ok: true, balances };
} catch (e) {
// Re-throw the error so callers can handle it appropriately
console.error("Error fetching balance:", e);
throw e;
}
};

export type Balance = Awaited<ReturnType<typeof fetchBalance>>["balances"][number];

export const wallet = kit;
export const wallet = StellarWalletsKit;

// Restore removed connectWallet export for backward compatibility
export const connectWallet = async (...args: any[]) => {
return (kit as any).openModal(...args);
return (StellarWalletsKit as any).openModal(...args);
};

/**
Expand All @@ -56,5 +64,5 @@ export const connectWallet = async (...args: any[]) => {
* the connection modal for wallets that aren't usable.
*/
export const getSupportedWallets = (): Promise<ISupportedWallet[]> => {
return kit.getSupportedWallets();
return StellarWalletsKit.refreshSupportedWallets();
};
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import wasm from "vite-plugin-wasm";
import { nodePolyfills } from "vite-plugin-node-polyfills";
// import tailwindcss from '@tailwindcss/vite';
import tailwindcss from "@tailwindcss/vite";
import path from "path";

// https://vite.dev/config/
export default defineConfig(() => {
return {
plugins: [
react(),
// tailwindcss(),
tailwindcss(),
nodePolyfills({
include: ["buffer"],
globals: {
Expand Down
Loading