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
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,20 @@ jobs:
node-version: ${{ matrix.node }}
# The scaffolder is zero-dependency — the suite runs on bare node.
- run: npm test

# The template must honor its documented .env contract: CHAIN_ID selects the
# chain (regression: it used to be silently ignored — everything hit the default).
template-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
working-directory: template
- name: CHAIN_ID env must select the chain
run: CHAIN_ID=121214 npm run gen-config | grep -q "chain 121214"
working-directory: template
- run: npm run typecheck
working-directory: template
2 changes: 1 addition & 1 deletion template/scripts/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { eip1193FromAccount } from "../lib/eip1193Node.js";
import { deployVault } from "./deploy.js";
import * as rome from "../lib/rome.js";

const cfg = loadConfig({ proxyUrl: process.env.PROXY_URL, solanaRpc: process.env.SOLANA_RPC });
const cfg = loadConfig({ chainId: process.env.CHAIN_ID ? Number(process.env.CHAIN_ID) : undefined, proxyUrl: process.env.PROXY_URL, solanaRpc: process.env.SOLANA_RPC });
const evm = privateKeyToAccount(process.env.EVM_KEY as `0x${string}`);
const sol = Keypair.fromSecretKey(Uint8Array.from(JSON.parse(process.env.SOLANA_KEY!)));
const solSign = async (tx: any) => { tx.partialSign(sol); return tx; };
Expand Down
2 changes: 1 addition & 1 deletion template/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function deployVault(cfg: RomeConfig, account: Account): Promise<`0

// `npm run deploy`
if (import.meta.url === `file://${process.argv[1]}`) {
const cfg = loadConfig({ proxyUrl: process.env.PROXY_URL, solanaRpc: process.env.SOLANA_RPC });
const cfg = loadConfig({ chainId: process.env.CHAIN_ID ? Number(process.env.CHAIN_ID) : undefined, proxyUrl: process.env.PROXY_URL, solanaRpc: process.env.SOLANA_RPC });
const account = privateKeyToAccount(process.env.EVM_KEY as `0x${string}`);
const vault = await deployVault(cfg, account);
console.log("Vault deployed:", vault);
Expand Down
2 changes: 1 addition & 1 deletion template/scripts/gen-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "dotenv/config";
import { writeFileSync } from "node:fs";
import { loadConfig } from "../lib/config.js";

const cfg = loadConfig({ proxyUrl: process.env.PROXY_URL, solanaRpc: process.env.SOLANA_RPC });
const cfg = loadConfig({ chainId: process.env.CHAIN_ID ? Number(process.env.CHAIN_ID) : undefined, proxyUrl: process.env.PROXY_URL, solanaRpc: process.env.SOLANA_RPC });
const out = { ...cfg, vault: (process.env.VAULT_ADDRESS || null) as string | null };
writeFileSync(new URL("../src/config.generated.json", import.meta.url), JSON.stringify(out, null, 2) + "\n");
console.log("wrote src/config.generated.json —", `chain ${out.chainId}`, out.vault ? `vault ${out.vault}` : "(deploy a Vault, then set VAULT_ADDRESS)");
Loading