diff --git a/.env.example b/.env.example index 489357c..d8b0421 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,7 @@ PORT=4000 STELLAR_NETWORK=testnet # Soroban RPC endpoint SOROBAN_RPC_URL=https://soroban-testnet.stellar.org +STELLAR_SIGNER_SECRET_KEY= # Deployed contract IDs (leave blank until deployed) SETTLEMENT_CONTRACT_ID= diff --git a/src/config/configuration.ts b/src/config/configuration.ts index aa84559..e6d6201 100644 --- a/src/config/configuration.ts +++ b/src/config/configuration.ts @@ -40,6 +40,7 @@ export interface AppConfig { sorobanRpcUrl: string; settlementContractId: string; solverRegistryContractId: string; + signerSecretKey: string; // Secret key for the backend's Soroban signer. Empty outside production // (no on-chain write path exists yet); envValidationSchema requires and // format-checks it in production so it can never silently fall back to @@ -65,6 +66,7 @@ export default (): AppConfig => ({ sorobanRpcUrl: process.env.SOROBAN_RPC_URL ?? "https://soroban-testnet.stellar.org", settlementContractId: process.env.SETTLEMENT_CONTRACT_ID ?? "", solverRegistryContractId: process.env.SOLVER_REGISTRY_CONTRACT_ID ?? "", + signerSecretKey: process.env.STELLAR_SIGNER_SECRET_KEY ?? "", signingKey: process.env.SOROBAN_SIGNING_KEY ?? "", feePercentile: (process.env.SOROBAN_FEE_PERCENTILE ?? "p50") as FeePercentile, }, diff --git a/src/config/env.validation.ts b/src/config/env.validation.ts index 8a2dc55..19a37d3 100644 --- a/src/config/env.validation.ts +++ b/src/config/env.validation.ts @@ -19,6 +19,7 @@ export const envValidationSchema = Joi.object({ SOROBAN_RPC_URL: Joi.string().uri().default("https://soroban-testnet.stellar.org"), SETTLEMENT_CONTRACT_ID: Joi.string().allow("").default(""), SOLVER_REGISTRY_CONTRACT_ID: Joi.string().allow("").default(""), + STELLAR_SIGNER_SECRET_KEY: Joi.string().allow("").default(""), // Secret key for the backend's own Soroban signer (submits on-chain writes // such as settlement and slashing calls). No default is provided anywhere diff --git a/src/soroban/soroban.module.ts b/src/soroban/soroban.module.ts index 8b19079..49d6e97 100644 --- a/src/soroban/soroban.module.ts +++ b/src/soroban/soroban.module.ts @@ -7,6 +7,7 @@ import { SignerService } from "./signer.service"; import { StellarTxService } from "./stellar-tx.service"; @Module({ + imports: [forwardRef(() => IntentsModule)], controllers: [SorobanController], providers: [ SorobanService,