
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
The official TypeScript SDK for interacting with the PNP Prediction Market Protocol on EVM-compatible chains (defaulting to Base Mainnet).
This SDK provides a high-level abstraction over the smart contracts (PNPFactory, FeeManager), allowing developers to easily create markets, trade outcome tokens, and redeem winnings.
createMarket, buy, sell, and redeem.cd evm_pnp_sdk
npm install
npm run build
import { PNPClient } from "pnp-evm";
const client = new PNPClient({
// Optional: Defaults to "https://mainnet.base.org"
rpcUrl: process.env.RPC_URL,
// Required for transactions
privateKey: process.env.PRIVATE_KEY
});
import { ethers } from "ethers";
const endTime = Math.floor(Date.now() / 1000) + 86400; // 24 hours from now
const { conditionId, receipt } = await client.market.createMarket({
question: "Will ETH hit $5000 in 2025?",
endTime: endTime,
initialLiquidity: "1000000", // 1 USDC (6 decimals)
// collateralToken: "0x..." // Optional: Defaults to USDC on Base
});
console.log(`Market Created: ${conditionId}`);
// Buy "YES" shares
const buyAmount = ethers.parseUnits("10", 6); // 10 USDC
await client.trading.buy(conditionId, buyAmount, "YES");
// Sell "YES" shares
const sellAmount = ethers.parseUnits("5", 18); // 5 Outcome Tokens (18 decimals)
await client.trading.sell(conditionId, sellAmount, "YES");
const info = await client.market.getMarketInfo(conditionId);
console.log(info);
/* Output:
{
question: "Will ETH hit $5000 in 2025?",
endTime: "173...",
isCreated: true,
isSettled: false,
reserve: "1000000...",
winningToken: "0"
}
*/
The SDK comes pre-configured for Base Mainnet:
| Contract | Address |
|PO|---|
| Factory | 0x66177AC64968b348393Dd05b1664935947832D9E |
| FeeManager | 0xaA9C0a95b257588b9574fD9BfBf040309073bcA7 |
| USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
To use a different chain or contracts:
const client = new PNPClient({
rpcUrl: "https://eth-mainnet.alchemyapi.io/...",
privateKey: "...",
contractAddresses: {
marketFactory: "0x...",
usdcToken: "0x...",
feeManager: "0x..."
}
});
npm run buildexport PRIVATE_KEY="your_key"
npx ts-node examples/quickstart.ts
The SDK includes custom error parsing for common contract reverts (e.g., Invalid amount, Slippage protection). It also automatically handles "Rate Limit" errors from public RPC nodes by retrying read operations.
FAQs
EVM SDK for PNP Prediction Markets
We found that pnp-evm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.