
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@predicate/core
Advanced tools
TypeScript client for interacting with the Predicate API. Handles policy evaluation, authentication, and request validation for any JavaScript/TypeScript environment.
npm install @predicate/core
import { PredicateClient, PredicateRequest } from '@predicate/core';
const client = new PredicateClient({
apiUrl: 'https://api.predicate.io/',
apiKey: process.env.PREDICATE_API_KEY!
});
const request: PredicateRequest = {
from: '0xSenderAddress',
to: '0xContractAddress',
data: '0xEncodedArguments',
msg_value: '0',
chain_id: 1 // Optional
};
const result = await client.evaluatePolicy(request);
console.log("Task ID:", result.task_id);
console.log("Signers:", result.signers);
console.log("Signatures:", result.signature);
interface PredicateResponse {
is_compliant: boolean;
task_id: string;
expiry_block: number;
signers: string[];
signature: string[];
results?: PredicateSignerResults;
}
import { PredicateClient, PredicateRequest } from '@predicate/core/v2';
const client = new PredicateClient({
apiUrl: 'https://api.predicate.io/',
apiKey: process.env.PREDICATE_API_KEY!
});
const request: PredicateRequest = {
from: '0xSenderAddress',
to: '0xContractAddress',
data: '0xEncodedArguments',
msg_value: '0',
chain: 'ethereum' // Required: 'ethereum' | 'solana' | 'sepolia' | 'holesky' | 'anvil'
};
const result = await client.evaluatePolicy(request);
console.log("Policy ID:", result.policy_id);
console.log("Is Compliant:", result.is_compliant);
console.log("Attestation:", result.attestation);
interface PredicateResponse {
policy_id: string;
is_compliant: boolean;
attestation: {
uuid: string;
expiration: number;
attester: string;
signature: string;
};
}
| Feature | V1 | V2 |
|---|---|---|
| Import | @predicate/core | @predicate/core/v2 |
| Endpoint | /v1/task | /v2/attestation |
| Chain Field | chain_id?: number | string | chain: SupportedChain (required) |
| Response ID | task_id | attestation.uuid |
| Expiry | expiry_block (block number) | attestation.expiration (unix seconds) |
| Signers | Multiple signers/signatures | Single attester/signature |
| Policy ID | Not included | policy_id field |
Update import path:
// Before
import { PredicateClient } from '@predicate/core';
// After
import { PredicateClient } from '@predicate/core/v2';
Add required chain field:
const request = {
// ... other fields
chain: 'ethereum' // Now required
};
Update response handling:
// V1
console.log(result.task_id, result.signers);
// V2
console.log(result.policy_id, result.attestation.uuid, result.attestation.attester);
For detailed documentation, visit docs.predicate.io.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Core utilities for interacting with Predicate API
We found that @predicate/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.