TypeScript SDK (@mpc-firewall/core)
Embed raw transaction decoding, policy checks, and NEAR AI Cloud intent auditing directly inside Node.js or TypeScript agent tools.
Drop-In Wallet Tool Guard
In Node.js or TypeScript agent runtimes, import FirewallService from @mpc-firewall/core. Simultaneous calls queue automatically through an internal mutex so two parallel tool calls cannot race daily spend caps.
typescriptWrap an Agent Signing Tool
import { FirewallService } from '@mpc-firewall/core';
const firewall = new FirewallService();
export async function guardAgentTransaction(params: {
chainKind: 'evm' | 'bitcoin';
rawUnsignedHex: string;
agentIntent: string;
}) {
const record = await firewall.inspectAndDispatch(params);
if (record.decision.outcome === 'APPROVED_FOR_MPC_SIGN') {
return { approved: true, mpcDispatch: record.mpcDispatch };
}
if (record.decision.outcome === 'ESCALATE_TO_DAO') {
return { approved: false, needsTeamVote: true, daoProposal: record.daoProposalPayload };
}
return { approved: false, blockedReasons: record.decision.reasons };
}Individual SDK Functions
decodeUnsignedEvmTx
Decodes EIP-1559 / EIP-2930 / Legacy RLP + recursive ABI calldata
decodeUnsignedBitcoinTx
Parses BTC outputs, script types & BIP-143 sighash preimages
evaluateFirewallPolicy
Pure rule engine returning APPROVED / ESCALATE / BLOCKED + ERR_* codes
runConfidentialTeeAudit
NEAR AI Cloud TEE intent-vs-calldata check with Ed25519 signature
buildMpcDispatchPayload
Builds ready-to-submit contract call payloads for approved TXs
authorizeAdminRequest
Constant-time header check for Bearer / x-admin-token secrets