@warppay402/sdk 1.0.5 → 1.0.6

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/dist/index.d.ts CHANGED
@@ -24,6 +24,23 @@ export interface PdfExtractorResponse {
24
24
  info: Record<string, any>;
25
25
  textPreview: string;
26
26
  }
27
+ export interface BrowserScrapeResponse {
28
+ success: boolean;
29
+ url: string;
30
+ content: string;
31
+ }
32
+ export interface ScreenshotResponse {
33
+ success: boolean;
34
+ url: string;
35
+ screenshotUrl?: string;
36
+ base64?: string;
37
+ }
38
+ export interface ExtractJsonResponse {
39
+ success: boolean;
40
+ url: string;
41
+ schema: any;
42
+ extractedData: Record<string, any>;
43
+ }
27
44
  export declare class WarpPayClient {
28
45
  private baseUrl;
29
46
  private account;
@@ -45,4 +62,16 @@ export declare class WarpPayClient {
45
62
  * Downloads and extracts text preview from a public PDF URL ($0.05 USDC on Base)
46
63
  */
47
64
  extractPdf(pdfUrl: string): Promise<PdfExtractorResponse>;
65
+ /**
66
+ * Executes JS-rendering browser scraper via proxy workers ($0.05 USDC on Base)
67
+ */
68
+ browserScrape(url: string): Promise<BrowserScrapeResponse>;
69
+ /**
70
+ * Renders target URL and returns full-page screenshot data ($0.10 USDC on Base)
71
+ */
72
+ renderScreenshot(url: string): Promise<ScreenshotResponse>;
73
+ /**
74
+ * Extracts structured JSON schema data from web pages ($0.15 USDC on Base)
75
+ */
76
+ extractJson(url: string, schema?: object): Promise<ExtractJsonResponse>;
48
77
  }
package/dist/index.js CHANGED
@@ -121,5 +121,23 @@ class WarpPayClient {
121
121
  async extractPdf(pdfUrl) {
122
122
  return this.executePaidRequest("/api/v1/tools/pdf-extractor", { pdfUrl });
123
123
  }
124
+ /**
125
+ * Executes JS-rendering browser scraper via proxy workers ($0.05 USDC on Base)
126
+ */
127
+ async browserScrape(url) {
128
+ return this.executePaidRequest("/api/v1/tools/browser-scraper", { url });
129
+ }
130
+ /**
131
+ * Renders target URL and returns full-page screenshot data ($0.10 USDC on Base)
132
+ */
133
+ async renderScreenshot(url) {
134
+ return this.executePaidRequest("/api/v1/tools/render-screenshot", { url });
135
+ }
136
+ /**
137
+ * Extracts structured JSON schema data from web pages ($0.15 USDC on Base)
138
+ */
139
+ async extractJson(url, schema) {
140
+ return this.executePaidRequest("/api/v1/tools/extract-json", { url, schema });
141
+ }
124
142
  }
125
143
  exports.WarpPayClient = WarpPayClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warppay402/sdk",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
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",
package/src/index.ts CHANGED
@@ -32,6 +32,26 @@ export interface PdfExtractorResponse {
32
32
  textPreview: string;
33
33
  }
34
34
 
35
+ export interface BrowserScrapeResponse {
36
+ success: boolean;
37
+ url: string;
38
+ content: string;
39
+ }
40
+
41
+ export interface ScreenshotResponse {
42
+ success: boolean;
43
+ url: string;
44
+ screenshotUrl?: string;
45
+ base64?: string;
46
+ }
47
+
48
+ export interface ExtractJsonResponse {
49
+ success: boolean;
50
+ url: string;
51
+ schema: any;
52
+ extractedData: Record<string, any>;
53
+ }
54
+
35
55
  export class WarpPayClient {
36
56
  private baseUrl: string;
37
57
  private account;
@@ -165,4 +185,25 @@ export class WarpPayClient {
165
185
  public async extractPdf(pdfUrl: string): Promise<PdfExtractorResponse> {
166
186
  return this.executePaidRequest<PdfExtractorResponse>("/api/v1/tools/pdf-extractor", { pdfUrl });
167
187
  }
188
+
189
+ /**
190
+ * Executes JS-rendering browser scraper via proxy workers ($0.05 USDC on Base)
191
+ */
192
+ public async browserScrape(url: string): Promise<BrowserScrapeResponse> {
193
+ return this.executePaidRequest<BrowserScrapeResponse>("/api/v1/tools/browser-scraper", { url });
194
+ }
195
+
196
+ /**
197
+ * Renders target URL and returns full-page screenshot data ($0.10 USDC on Base)
198
+ */
199
+ public async renderScreenshot(url: string): Promise<ScreenshotResponse> {
200
+ return this.executePaidRequest<ScreenshotResponse>("/api/v1/tools/render-screenshot", { url });
201
+ }
202
+
203
+ /**
204
+ * Extracts structured JSON schema data from web pages ($0.15 USDC on Base)
205
+ */
206
+ public async extractJson(url: string, schema?: object): Promise<ExtractJsonResponse> {
207
+ return this.executePaidRequest<ExtractJsonResponse>("/api/v1/tools/extract-json", { url, schema });
208
+ }
168
209
  }