
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
@waterfall-finance/sdk
Advanced tools
TypeScript SDK for x402 payments with OpenRouter. This is a 1:1 port of the Python waterfall SDK.
npm install @waterfall-finance/sdk
import { WaterfallClient, createClient } from "@waterfall-finance/sdk";
// Option 1: Use the convenience function
const client = await createClient("wf_your_api_key");
// Option 2: Manual initialization
const client = new WaterfallClient({
apiKey: "wf_your_api_key",
});
await client.configureWallet(); // Uses default wallet
// Make a chat completion request
const response = await client.chat.send({
model: "openai/gpt-3.5-turbo",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
The main client class for interacting with Waterfall.
const client = new WaterfallClient({
apiKey: "wf_...", // Your Waterfall API key
walletId: "...", // Optional: specific wallet ID
backendUrl: "...", // Optional: custom backend URL
proxyUrl: "...", // Optional: custom x402 proxy URL
});
configureWallet(options?)Configure which wallet to use for payments.
// Use default wallet
await client.configureWallet();
// Use wallet by name
await client.configureWallet({ walletName: "My Wallet" });
// Use wallet by ID
await client.configureWallet({ walletId: "wallet_123" });
listWallets()List all wallets associated with your API key.
const wallets = await client.listWallets();
console.log(wallets);
// [{ id: "...", name: "...", address: "0x...", network: "base-mainnet" }, ...]
createWallet(options)Create a new wallet.
const wallet = await client.createWallet({
name: "My New Wallet",
useTestnet: false, // Optional: use Base Sepolia testnet
teamId: "...", // Optional: team ID
});
chat.send(options)Send a chat completion request.
const response = await client.chat.send({
model: "openai/gpt-4",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "What is the capital of France?" },
],
temperature: 0.7,
maxTokens: 1000,
});
chat.stream(options)Stream a chat completion response.
const stream = await client.chat.stream({
model: "openai/gpt-3.5-turbo",
messages: [{ role: "user", content: "Tell me a story" }],
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
Any model available on OpenRouter can be used:
openai/gpt-4openai/gpt-3.5-turboanthropic/claude-3-opusanthropic/claude-3-sonnetgoogle/gemini-prometa-llama/llama-3-70b-instruct402 Payment Required with payment detailsYour Code
↓
WaterfallClient.chat.send()
↓
x402 Proxy
↓
[402 Payment Required]
↓
Waterfall Backend (signs payment)
↓
[Payment Signature]
↓
Retry with signature
↓
OpenRouter API
↓
AI Model Response
You can also set the API key via environment variable:
export WATERFALL_API_KEY=wf_your_api_key
const client = new WaterfallClient({
apiKey: process.env.WATERFALL_API_KEY,
});
Override default URLs if needed:
const client = new WaterfallClient({
apiKey: "wf_...",
backendUrl: "https://your-custom-backend.convex.site",
proxyUrl: "https://your-custom-proxy.com",
});
try {
const response = await client.chat.send({
model: "openai/gpt-4",
messages: [{ role: "user", content: "Hello!" }],
});
} catch (error) {
if (error.message.includes("Invalid or missing Waterfall API key")) {
console.error("Check your API key");
} else if (error.message.includes("Payment failed")) {
console.error("Payment signing failed - check wallet balance");
} else {
console.error("Unexpected error:", error);
}
}
MIT
FAQs
TypeScript SDK for x402 payments with OpenRouter
The npm package @waterfall-finance/sdk receives a total of 0 weekly downloads. As such, @waterfall-finance/sdk popularity was classified as not popular.
We found that @waterfall-finance/sdk 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.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.