/** * Application context: SDK read services + wallet-backed write executors. * * Reads (blockchain, token, gooddollar, ens) come from celina-sdk. * Writes call celina-sdk prepare* methods, then sign steps with CELO_PRIVATE_KEY * via executePreparedFlow — unlike celina-agent where the user signs in-browser. */ import { createCelinaClient } from "@andrewkimjoseph/celina-sdk"; import type { CeloClientFactory } from "../clients/celo-client.js"; import { TransactionService } from "../services/transaction.service.js"; import { MentoFxService } from "../services/mento-fx.service.js"; import { UniswapService } from "../services/uniswap.service.js"; import { AaveService } from "../services/aave.service.js"; import { ContractWriteService } from "../services/contract-write.service.js"; import { GoodDollarWriteService } from "../services/gooddollar.service.js"; import { GoodDollarIdentityWriteService } from "../services/gooddollar-identity-write.service.js"; import { GoodDollarFaceVerificationService } from "../services/gooddollar-face-verification.service.js"; import { GovernanceWriteService } from "../services/governance-write.service.js"; import { StakingWriteService } from "../services/staking-write.service.js"; import { AccountWriteService } from "../services/account-write.service.js"; import type { AppConfig } from "../config/env.js"; import type { CreateServerOptions } from "../server/create-server.js"; export interface AppContext { /** Full Celina SDK client (reads + prepare*). */ sdk: ReturnType; /** Whether any signing key is configured (CELO or Self agent). */ config: { hasWallet: boolean; walletAddress?: `0x${string}`; /** Which configured key resolves to `walletAddress` when no explicit signer is requested. */ signer?: "celo" | "self_agent"; hasSelfAgentKey: boolean; hasCeloKey: boolean; /** Invalid env key messages when a key is set but malformed. */ keyErrors?: import("../config/env.js").KeyConfigErrors; /** Main wallet address, when CELO_PRIVATE_KEY is configured. */ celoAddress?: `0x${string}`; /** Self agent wallet address, when SELF_AGENT_PRIVATE_KEY is configured. */ selfAgentAddress?: `0x${string}`; }; /** From celina-sdk — public RPC reads only. */ blockchain: ReturnType["blockchain"]; account: ReturnType["account"]; token: ReturnType["token"]; /** SDK transaction reads (gas fees, generic estimates). */ sdkTransaction: ReturnType["transaction"]; /** Local service — signs SDK-prepared send steps with `CELO_PRIVATE_KEY`. */ transaction: TransactionService; mentoFx: MentoFxService; uniswap: UniswapService; aave: AaveService; contractWrite: ContractWriteService; gooddollar: ReturnType["gooddollar"]; gooddollarWrite: GoodDollarWriteService; gooddollarIdentityWrite: GoodDollarIdentityWriteService; gooddollarFaceVerification: GoodDollarFaceVerificationService; governanceWrite: GovernanceWriteService; stakingWrite: StakingWriteService; accountWrite: AccountWriteService; governance: ReturnType["governance"]; staking: ReturnType["staking"]; nft: ReturnType["nft"]; contract: ReturnType["contract"]; /** Self Agent ID — from celina-sdk; requires `SELF_AGENT_PRIVATE_KEY` for signing tools. */ self: ReturnType["self"]; ens: ReturnType["ens"]; } /** * Compose MCP tool context: celina-sdk reads plus SDK prepare* write executors. * Writes sign server-side; celina-agent uses prepare* + user wallet instead. */ export declare function createAppContext(clientFactory: CeloClientFactory, config: AppConfig, walletAddress?: `0x${string}`, options?: Pick): AppContext;