File size: 13,571 Bytes
b051a1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
import requests
from typing import Optional, Dict, Any
from langchain_core.tools import BaseTool

BASE_URL = "https://api.warppay402.com/api/v1"

class ArcDexOracleTool(BaseTool):
    name: str = "arc_dex_oracle"
    description: str = "Real-time ETH/USDC spot price resolver and DEX liquidity oracle for Arc Mainnet ($0.001 USDC)."

    def _run(self, pair: str = "ETH/USDC") -> str:
        res = requests.post(f"{BASE_URL}/tools/arc-dex-oracle", json={"pair": pair})
        return res.text

class WebScraperTool(BaseTool):
    name: str = "web_scraper"
    description: str = "Scrapes any public webpage URL into clean Markdown for AI context window ingestion ($0.001 USDC)."

    def _run(self, url: str) -> str:
        res = requests.post(f"{BASE_URL}/tools/web-scraper", json={"url": url})
        return res.text

class BrowserScraperTool(BaseTool):
    name: str = "browser_scraper"
    description: str = "Executes unblockable JavaScript Chromium rendering via proxy workers ($0.005 USDC)."

    def _run(self, url: str) -> str:
        res = requests.post(f"{BASE_URL}/tools/browser-scraper", json={"url": url})
        return res.text

class BaseAnalyticsTool(BaseTool):
    name: str = "base_analytics"
    description: str = "Fetches ETH balance, nonce, and account stats for any 0x wallet on Base Mainnet ($0.002 USDC)."

    def _run(self, address: str) -> str:
        res = requests.post(f"{BASE_URL}/tools/base-analytics", json={"address": address})
        return res.text

class ArcAnalyticsTool(BaseTool):
    name: str = "arc_analytics"
    description: str = "Fetches live block height, gas price, and RPC latency from Arc Mainnet ($0.001 USDC)."

    def _run(self) -> str:
        res = requests.post(f"{BASE_URL}/tools/arc-analytics")
        return res.text

class ArcNetworkQueryTool(BaseTool):
    name: str = "arc_network_oracle_query"
    description: str = "Pre-flight Arc Mainnet telemetry: RPC latency (ms), gas prices (Gwei), native USDC balance, and account nonce ($0.10 USDC)."

    def _run(self, includeGasTrends: bool = True, checkMerchantAccount: bool = True) -> str:
        payload = {"includeGasTrends": includeGasTrends, "checkMerchantAccount": checkMerchantAccount}
        res = requests.post(f"{BASE_URL}/tools/arc-network-query", json=payload)
        return res.text

class PdfExtractorTool(BaseTool):
    name: str = "pdf_extractor"
    description: str = "Downloads and extracts clean plain text preview from public PDF document URLs ($0.005 USDC)."

    def _run(self, pdfUrl: str) -> str:
        res = requests.post(f"{BASE_URL}/tools/pdf-extractor", json={"pdfUrl": pdfUrl})
        return res.text

class RenderScreenshotTool(BaseTool):
    name: str = "render_screenshot"
    description: str = "Captures full-page rendered screenshot image data from target URL ($0.01 USDC)."

    def _run(self, url: str) -> str:
        res = requests.post(f"{BASE_URL}/tools/render-screenshot", json={"url": url})
        return res.text

class ExtractJsonTool(BaseTool):
    name: str = "extract_json"
    description: str = "Extracts structured JSON schema data from web page HTML content ($0.01 USDC)."

    def _run(self, url: str, schema: Optional[Dict[str, Any]] = None) -> str:
        payload = {"url": url, "schema": schema or {}}
        res = requests.post(f"{BASE_URL}/tools/extract-json", json=payload)
        return res.text

class SmartContractVerifierTool(BaseTool):
    name: str = "smart_contract_verifier"
    description: str = "Source code analysis, bytecode validation, ABI fetching, and proxy detection on Basescan ($0.02 USDC)."

    def _run(self, address: str) -> str:
        res = requests.post(f"{BASE_URL}/tools/smart-contract-verifier", json={"address": address})
        return res.text

class AerodromeYieldsTool(BaseTool):
    name: str = "get_aerodrome_yields"
    description: str = "Fetches top live Aerodrome DEX yield pools, APYs, and TVL on Base Mainnet ($0.003 USDC)."

    def _run(self) -> str:
        res = requests.get(f"{BASE_URL}/tools/aerodrome-yields")
        return res.text

class AerodromeSwapTool(BaseTool):
    name: str = "aerodrome_swap"
    description: str = "Executes low-slippage token swaps directly via Aerodrome Finance Router on Base ($0.01 USDC)."

    def _run(self, tokenIn: str, tokenOut: str, amountIn: str, decimalsIn: int, isStable: bool) -> str:
        payload = {
            "tokenIn": tokenIn, "tokenOut": tokenOut,
            "amountIn": amountIn, "decimalsIn": decimalsIn, "isStable": isStable
        }
        res = requests.post(f"{BASE_URL}/tools/aerodrome-swap", json=payload)
        return res.text

class AerodromeClammTool(BaseTool):
    name: str = "aerodrome_clamm"
    description: str = "Open, adjust, and rebalance concentrated liquidity ranges on Aerodrome Slipstream ($0.01 USDC)."

    def _run(self, action: str, token0: Optional[str] = None, token1: Optional[str] = None,
             tickLower: Optional[int] = None, tickUpper: Optional[int] = None,
             amount0Desired: Optional[str] = None, amount1Desired: Optional[str] = None,
             tokenId: Optional[str] = None) -> str:
        payload = {
            "action": action, "token0": token0, "token1": token1,
            "tickLower": tickLower, "tickUpper": tickUpper,
            "amount0Desired": amount0Desired, "amount1Desired": amount1Desired, "tokenId": tokenId
        }
        res = requests.post(f"{BASE_URL}/tools/aerodrome-clamm", json=payload)
        return res.text

class AerodromeVeaeroTool(BaseTool):
    name: str = "aerodrome_veaero"
    description: str = "Automates $AERO locking, epoch gauge voting, and bribe reward harvesting on Aerodrome ($0.01 USDC)."

    def _run(self, action: str, amount: Optional[str] = None, lockDurationWeeks: Optional[int] = None,
             tokenId: Optional[str] = None, poolVoteAddresses: Optional[list] = None) -> str:
        payload = {
            "action": action, "amount": amount, "lockDurationWeeks": lockDurationWeeks,
            "tokenId": tokenId, "poolVoteAddresses": poolVoteAddresses
        }
        res = requests.post(f"{BASE_URL}/tools/aerodrome-veaero", json=payload)
        return res.text

class DeployBaseContractTool(BaseTool):
    name: str = "deploy_contract"
    description: str = "Programmatically deploys custom Escrow, Bounty, or Subscription contracts to Base Mainnet ($5.00 USDC)."

    def _run(self, contractType: str = "escrow") -> str:
        res = requests.post(f"{BASE_URL}/tools/deploy-contract", json={"contractType": contractType})
        return res.text

class DeploySolanaContractTool(BaseTool):
    name: str = "deploy_solana_contract"
    description: str = "Initializes SPL Escrows, cNFT Badge Issuers, or Raydium Vaults on Solana Mainnet ($5.00 USDC)."

    def _run(self, contractType: str, params: Dict[str, Any]) -> str:
        payload = {"contractType": contractType, "params": params}
        res = requests.post(f"{BASE_URL}/tools/deploy-solana-contract", json=payload)
        return res.text

class DeployArcContractTool(BaseTool):
    name: str = "deploy_arc_contract"
    description: str = "Programmatically deploys custom Escrow, Bounty, or Agent contracts directly to Arc Mainnet ($5.00 USDC)."

    def _run(self, contractType: str = "escrow") -> str:
        res = requests.post(f"{BASE_URL}/tools/deploy-arc-contract", json={"contractType": contractType})
        return res.text

class ArcCctpBridgeTool(BaseTool):
    name: str = "arc_cctp_bridge"
    description: str = "Bridges USDC cross-chain from Arc Mainnet via Circle CCTP V2 ($0.25 USDC)."

    def _run(self, amountUsdc: str, destinationChain: str, recipientAddress: str) -> str:
        payload = {
            "amountUsdc": amountUsdc, "destinationChain": destinationChain, "recipientAddress": recipientAddress
        }
        res = requests.post(f"{BASE_URL}/tools/arc-cctp-bridge", json=payload)
        return res.text

class PublicDataFeedTool(BaseTool):
    name: str = "public_data_feed"
    description: str = "Retrieves signed attestation JSON payloads from the public data feed ($0.0001 USDC)."

    def _run(self, filename: str) -> str:
        res = requests.get(f"https://api.warppay402.com/public_data_feed/{filename}")
        return res.text

class DataFeedsTool(BaseTool):
    name: str = "data_feeds"
    description: str = "Fetches pre-scraped market data feeds and yield reports ($0.001 USDC)."

    def _run(self, feedId: str) -> str:
        res = requests.get(f"{BASE_URL}/feeds/{feedId}")
        return res.text

class RealEstateCalculatorTool(BaseTool):
    name: str = "real_estate_calculator"
    description: str = "Calculates NOI, Cap Rate, Monthly Cash Flow, and DSCR for real estate deals ($0.0005 USDC)."

    def _run(self, purchasePrice: float, monthlyRent: float, annualTaxes: Optional[float] = None,
             annualInsurance: Optional[float] = None, interestRate: float = 6.5, downPaymentPct: float = 20.0) -> str:
        payload = {
            "purchasePrice": purchasePrice,
            "monthlyRent": monthlyRent,
            "annualTaxes": annualTaxes,
            "annualInsurance": annualInsurance,
            "interestRate": interestRate,
            "downPaymentPct": downPaymentPct,
        }
        res = requests.post(f"{BASE_URL}/tools/real-estate-calculator", json=payload)
        return res.text

class AddressNormalizerTool(BaseTool):
    name: str = "address_normalizer"
    description: str = "Standardizes informal address queries and resolves lat/lon coordinates ($0.001 USDC)."

    def _run(self, address: str) -> str:
        res = requests.post(f"{BASE_URL}/tools/address-normalizer", json={"address": address})
        return res.text

class WeatherOracleTool(BaseTool):
    name: str = "weather_oracle"
    description: str = "Fetches live atmospheric conditions, wind speed, visibility, and flight safety clearances ($0.001 USDC)."

    def _run(self, latitude: float, longitude: float) -> str:
        payload = {"latitude": latitude, "longitude": longitude}
        res = requests.post(f"{BASE_URL}/tools/weather-oracle", json=payload)
        return res.text

class ForexOracleTool(BaseTool):
    name: str = "forex_oracle"
    description: str = "Resolves real-time global foreign exchange fiat rates ($0.0005 USDC)."

    def _run(self, baseCurrency: str = "USD") -> str:
        res = requests.post(f"{BASE_URL}/tools/forex-oracle", json={"baseCurrency": baseCurrency})
        return res.text

class ShippingRateEstimatorTool(BaseTool):
    name: str = "shipping_rate_estimator"
    description: str = "Calculates ground, priority, and express shipping rates for e-commerce ($0.001 USDC)."

    def _run(self, weightLbs: float, originZip: str, destinationZip: str) -> str:
        payload = {"weightLbs": weightLbs, "originZip": originZip, "destinationZip": destinationZip}
        res = requests.post(f"{BASE_URL}/tools/shipping-rate-estimator", json=payload)
        return res.text

class GithubHealthAnalyzerTool(BaseTool):
    name: str = "github_health_analyzer"
    description: str = "Queries public GitHub repo stars, open issues, licenses, and push activity ($0.002 USDC)."

    def _run(self, repository: str) -> str:
        res = requests.post(f"{BASE_URL}/tools/github-health-analyzer", json={"repository": repository})
        return res.text

class PropertyCompsEstimatorTool(BaseTool):
    name: str = "property_comps_estimator"
    description: str = "Generates market valuations, price-per-sqft comps, and annual tax estimates ($0.005 USDC)."

    def _run(self, squareFeet: float, bedrooms: int, zipCode: str) -> str:
        payload = {"squareFeet": squareFeet, "bedrooms": bedrooms, "zipCode": zipCode}
        res = requests.post(f"{BASE_URL}/tools/property-comps-estimator", json=payload)
        return res.text

class OutageOracleTool(BaseTool):
    name: str = "outage_oracle"
    description: str = "Resolves real-time power grid, ISP broadband, and cellular network outages by ZIP code ($0.002 USDC)."

    def _run(self, zipCode: str, state: Optional[str] = None, serviceType: str = "all") -> str:
        payload = {"zipCode": zipCode, "state": state, "serviceType": serviceType}
        res = requests.post(f"{BASE_URL}/tools/outage-oracle", json=payload)
        return res.text

class UcpDealsOracleTool(BaseTool):
    name: str = "ucp_deals_oracle"
    description: str = "Aggregates UCP merchant catalogs, pricing, stock availability, and instant checkout URLs ($0.001 USDC)."

    def _run(self, query: str, maxPriceUSD: Optional[float] = None, inStockOnly: bool = True) -> str:
        payload = {"query": query, "maxPriceUSD": maxPriceUSD, "inStockOnly": inStockOnly}
        res = requests.post(f"{BASE_URL}/ucp/search", json=payload)
        return res.text
class DefiExecutorAgentTool(BaseTool):
    name: str = "warppay_defi_executor"
    description: str = "Autonomous DeFi due-diligence and quote agent orchestrating wallet/contract audits, Aerodrome pool yields, and swap simulation from a single goal ($0.15 USDC)."

    def _run(self, goal: str) -> str:
        res = requests.post(f"{BASE_URL}/agents/defi-executor", json={"goal": goal})
        return res.text

class DeepResearchAgentTool(BaseTool):
    name: str = "warppay_deep_research"
    description: str = "Parallel web scraping, UCP merchant catalog search, and forex spot rate synthesis agent from a single goal ($0.05 USDC)."

    def _run(self, goal: str) -> str:
        res = requests.post(f"{BASE_URL}/agents/deep-research", json={"goal": goal})
        return res.text