@warppay402/sdk 1.0.2 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -4
- package/openclaw.plugin.json +6 -0
- package/package.json +22 -1
package/README.md
CHANGED
|
@@ -17,22 +17,46 @@ const client = new WarpPayClient({
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
async function main() {
|
|
20
|
-
//
|
|
20
|
+
// 1. Scrape any URL into clean Markdown ($0.01 USDC)
|
|
21
21
|
const page = await client.scrapeWeb("https://news.ycombinator.com");
|
|
22
22
|
console.log("Title:", page.title);
|
|
23
23
|
console.log("Markdown:", page.markdown);
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// 2. JS Browser Scraper ($0.05 USDC)
|
|
26
|
+
const rendered = await client.browserScrape("https://example.com");
|
|
27
|
+
console.log("Rendered Content:", rendered);
|
|
28
|
+
|
|
29
|
+
// 3. Capture Full-Page Screenshot ($0.10 USDC)
|
|
30
|
+
const screenshot = await client.renderScreenshot("https://example.com");
|
|
31
|
+
console.log("Screenshot Data:", screenshot);
|
|
32
|
+
|
|
33
|
+
// 4. Extract Structured JSON Data ($0.15 USDC)
|
|
34
|
+
const extracted = await client.extractJson("https://news.ycombinator.com", {
|
|
35
|
+
title: "string",
|
|
36
|
+
topStories: "array",
|
|
37
|
+
});
|
|
38
|
+
console.log("Extracted Data:", extracted);
|
|
39
|
+
|
|
40
|
+
// 5. Fetch Base Wallet Analytics ($0.02 USDC)
|
|
26
41
|
const analytics = await client.getBaseAnalytics("0x556c77792642E8ff95eC930FFb8D46a76579126E");
|
|
27
42
|
console.log("ETH Balance:", analytics.ethBalance);
|
|
28
43
|
|
|
29
|
-
// Extract PDF
|
|
30
|
-
const pdf = await client.extractPdf("https://example.com/document.pdf");
|
|
44
|
+
// 6. Extract PDF Text Preview ($0.05 USDC)
|
|
45
|
+
const pdf = await client.extractPdf("https://example.com/document.pdf");
|
|
31
46
|
console.log("Preview:", pdf.textPreview);
|
|
32
47
|
}
|
|
33
48
|
|
|
34
49
|
main();
|
|
35
50
|
```
|
|
51
|
+
## 🛠️ Available Methods & Pricing
|
|
52
|
+
|
|
53
|
+
* **`scrapeWeb(url)`** — `$0.01 USDC` — Extracts clean Markdown from web pages.
|
|
54
|
+
* **`getBaseAnalytics(address)`** — `$0.02 USDC` — Fetches ETH balance and nonce stats.
|
|
55
|
+
* **`browserScrape(url)`** — `$0.05 USDC` — Unblockable JS browser scraping via proxy workers.
|
|
56
|
+
* **`extractPdf(pdfUrl)`** — `$0.05 USDC` — Parses text preview from public PDF URLs.
|
|
57
|
+
* **`renderScreenshot(url)`** — `$0.10 USDC` — Renders target URL and returns full-page screenshot data.
|
|
58
|
+
* **`extractJson(url, schema?)`** — `$0.15 USDC` — Parses web pages into structured JSON data.
|
|
59
|
+
|
|
36
60
|
## 🛠️ LangChain Integration
|
|
37
61
|
```typescript
|
|
38
62
|
import { WarpPayClient, createWarpPayLangChainTools } from "@warppay402/sdk";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warppay402/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Official TypeScript SDK for WarpPay402 pay-per-use AI tools on Base Mainnet",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,5 +30,26 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^26.2.0",
|
|
32
32
|
"typescript": "^5.0.0"
|
|
33
|
+
},
|
|
34
|
+
"openclaw": {
|
|
35
|
+
"compat": {
|
|
36
|
+
"pluginApi": "1.0.0"
|
|
37
|
+
},
|
|
38
|
+
"build": {
|
|
39
|
+
"openclawVersion": "1.0.0"
|
|
40
|
+
},
|
|
41
|
+
"extensions": [
|
|
42
|
+
"dist/index.js"
|
|
43
|
+
],
|
|
44
|
+
"configSchema": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"properties": {
|
|
48
|
+
"privateKey": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Base wallet private key for paying x402 micropayments"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
33
54
|
}
|
|
34
55
|
}
|