@proximuslabs/sdk-evm
v0.2.0-alpha.5
Published
Proximus evm API integration SDK - alpha
Readme
Proximus EVM SDK
Review EVM transactions, approvals and signature requests before submitting them. Create an API key in your PROXIMUS dashboard, install the SDK and connect to the hosted API.
Install
Install the SDK in your application:
npm install @proximuslabs/[email protected]A direct public download is also available:
npm install https://www.proximus.sh/sdk/proximuslabs-sdk-evm-0.2.0-alpha.5.tgzCreate an API key in your PROXIMUS dashboard and pass it to the client. The SDK connects to https://api.proximus.sh by default. Customers do not deploy the security engine.
Server quickstart
import { createEvmClient, requireAllow } from "@proximuslabs/sdk-evm";
const client = createEvmClient({
apiKey: process.env.PROXIMUS_API_KEY,
baseUrl: process.env.PROXIMUS_BASE_URL,
});
const review = await client.reviewTransaction({
requestId: "evm_order_123_review_1",
origin: "https://wallet.example",
chainId: "1",
transaction: {
from: process.env.SENDER_ADDRESS,
to: process.env.RECIPIENT_ADDRESS,
value: "0x2386f26fc10000",
},
});
requireAllow(review); // Throws on challenge/block. Errors also pause execution.
console.log(review.verdict);Transactions and wallets
evmAction(input) builds an unsigned transaction review. Values and fee fields use canonical RPC hex quantities (wei); chain IDs use exact decimal strings or bigint. Contract creation uses calldata without to. Calldata is submitted unchanged, including token approvals. The hosted engine decodes selected token/operator approvals and supports full call traces with state differences through configured RPC providers. Require external_state when simulation is part of your approval policy. Unknown effects and internal execution can remain incomplete. Tracing is not a contract audit, and the local SDK does not execute or simulate EVM code.
evmSignatureAction(...) and client.reviewSignature(...) accept personal_sign hex bytes or eth_signTypedData_v4 JSON. Typed-data domain/chain consistency still needs application validation; this alpha does not sign messages or intercept every provider method.
import { reviewAndSendTransaction } from "@proximuslabs/sdk-evm";
// reviewer calls YOUR authenticated backend. No Proximus secret here.
const { result: transactionHash } = await reviewAndSendTransaction(
payment, window.ethereum, reviewer,
);The EIP-1193 adapter checks available accounts and chain ID before and after review, binds the chain to the transaction and passes the frozen reviewed payload to eth_sendTransaction. It never asks for new permissions or switches chains implicitly. The wallet remains responsible for signing, confirmation and final transaction validity. A wallet may change after the last check; its own checks and explicit user confirmation remain necessary.
Provider support follows EIP-1193. Concrete viem, ethers, WalletConnect, smart-account and mobile adapters require additional conformance testing.
Protect an action
Use protectAndExecute in JavaScript or TypeScript, protect_and_execute in Python or Rust, or ProtectAndExecute in Go to review an action before calling your signer or payment provider. The SDK proceeds only when the action is allowed, its required checks completed and its execution authorization is current. Blocked, incomplete and expired reviews stop execution.
Use the returned execution ID for your provider's idempotency key. Retrieve the provider result before retrying an uncertain payment.
See the integration guide for setup, examples and supported checks. Each review shows which checks completed and whether the action can proceed.
Shared configuration and errors
apiKey: scoped server-side API key.review:writefor review submission,security:executefor execution authorization,reviews:readfor retrieval and capabilities. monitoring additionally needsmonitor:writeand a linked integration.baseUrl: defaults tohttps://api.proximus.sh. Set your own HTTPS gateway URL for self-hosting. Loopback HTTP is allowed locally. A base path such ashttps://app.example/securityis supported when your proxy mounts the contract there. The SDK does not follow redirects or send browser cookies.fetch: optional compatible implementation for your runtime.timeoutMs: default 15000, maximum 120000. Pass{ signal }to each request.- Supply an immutable
requestId. Reuse it with the identical body for retries. The SDK never retries or charges automatically.requestId()generates a secure UUID wherecrypto.randomUUIDis available. ProximusErrorexposescode,statusandretryAfter; it never includes your secret key or raw error response. 401/403 require configuration fixes, 402 is a hosted credit limit, 409 is a conflict/in-progress request, 429 is a rate limit and 503 is unavailable analysis. First retrieve uncertain reviews before deciding to submit another ID.client.getReview(requestId)returns the backend's stored review record. Hosted and reference-gateway storage shapes may differ; use the submitted review response for immediate execution gating.reviewAndExecuteand wallet/payment guards require an exact, unexpired action binding and a fresh execution claim. On your backend, callclient.authorize(action)to produce this response. Use a durable execution ID and wallet or payment-provider idempotency. A claimed attempt must be reconciled before retrying.- No telemetry, private-key custody, background scanning or direct database access is performed by these SDKs.
Use client.capabilities() to read the current supported networks, checks and behavior-model availability. Solana protection includes external_state by default, so unavailable chain simulation pauses execution.
Platforms
The transport and action builders are TypeScript with ESM/CommonJS outputs. Payment fee calculations use decimal.js for decimal arithmetic. Node 22+ is the tested server target. Browser, React Native and Electron frontends use the action builders/guards with a reviewer calling their own authenticated backend; createClient rejects known browser/React Native environments to reduce accidental secret exposure. This runtime check is a guardrail, not a substitute for secure application architecture.
examples/browser-reviewer.ts, examples/BackendReviewer.swift and examples/BackendReviewer.kt demonstrate that backend boundary. Swift and Kotlin examples are not published native SDKs. React Native may need fetch, AbortController, TextEncoder and secure UUID polyfills; compatibility depends on runtime version. Do not put long-lived API keys in mobile or desktop binaries.
Your backend must authenticate the app user, verify their ownership/permissions, derive the exact action, validate origin/CSRF where applicable, enforce quotas and apply decisions. A client can bypass its own UI guard.
Language packages
All six SDK products are available in TypeScript, Go, Python and Rust under Apache 2.0. The TypeScript package stays at the repository root. Each language has typed feature inputs, guarded execution, exact amounts, hosted/self-hosted URLs, examples and loopback HTTP tests.
| Language | Package and setup | | --- | --- | | TypeScript | This directory - ESM, CommonJS and declarations | | Go | go/README.md - standard library, context cancellation | | Python | python/README.md - Python 3.10+, standard library, typed inputs | | Rust | rust/README.md - blocking reqwest, serde types |
Public release packages are available through the installation guide. Python uses the equivalent version 0.2.0a5. The guide selects a verified registry release or a direct PROXIMUS package URL for each language.
Platform APIs
Use the platform SDK for chat, agents, testing and workspace APIs. This specialized package retains its review contract and execution guards. See the API reference for current public operations and required scopes.
Contributing
Bug reports, examples and pull requests are welcome. Read CONTRIBUTING.md to get started and SECURITY.md to report a vulnerability.
License
Copyright 2026 PROXIMUS Research Labs Foundation. The SDK is licensed under Apache 2.0, which permits integration, modification and commercial use subject to its terms. The license grants permission to use the code, it does not transfer copyright or grant rights to PROXIMUS trademarks. Hosted services have separate access and pricing terms. See LICENSE and NOTICE.
Payment fee estimates
Use estimatePaymentFees to calculate the PROXIMUS curve, partner fees and a network-cost reserve in exact atomic units. prepareAndExecutePayment calls your existing provider to prepare the complete unsigned payment, reviews that final action and invokes execution once after authorization. Include every fee recipient and amount before review.
The same workflow is available as estimate_payment_fees and prepare_and_execute_payment in Python and Rust, and EstimatePaymentFees and PrepareAndExecutePayment in Go. Amounts use integer strings. The estimate does not sign a transaction or collect a payment.
See payment integration for arguments, return values, examples and supported execution responsibilities.
