@blockrun/llm 2.13.0 → 3.1.0
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 +32 -49
- package/dist/index.cjs +262 -528
- package/dist/index.d.cts +127 -347
- package/dist/index.d.ts +127 -347
- package/dist/index.js +261 -526
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -727,130 +727,6 @@ interface ExaFindSimilarOptions {
|
|
|
727
727
|
/** Exclude pages from the same domain as the reference URL */
|
|
728
728
|
excludeSourceDomain?: boolean;
|
|
729
729
|
}
|
|
730
|
-
interface XUser {
|
|
731
|
-
id: string;
|
|
732
|
-
userName: string;
|
|
733
|
-
name: string;
|
|
734
|
-
profilePicture?: string;
|
|
735
|
-
description?: string;
|
|
736
|
-
followers?: number;
|
|
737
|
-
following?: number;
|
|
738
|
-
isBlueVerified?: boolean;
|
|
739
|
-
verifiedType?: string;
|
|
740
|
-
location?: string;
|
|
741
|
-
joined?: string;
|
|
742
|
-
}
|
|
743
|
-
interface XUserLookupResponse {
|
|
744
|
-
users: XUser[];
|
|
745
|
-
not_found?: string[];
|
|
746
|
-
total_requested?: number;
|
|
747
|
-
total_found?: number;
|
|
748
|
-
}
|
|
749
|
-
interface XFollower {
|
|
750
|
-
id: string;
|
|
751
|
-
name?: string;
|
|
752
|
-
screen_name?: string;
|
|
753
|
-
userName?: string;
|
|
754
|
-
location?: string;
|
|
755
|
-
description?: string;
|
|
756
|
-
protected?: boolean;
|
|
757
|
-
verified?: boolean;
|
|
758
|
-
followers_count?: number;
|
|
759
|
-
following_count?: number;
|
|
760
|
-
favourites_count?: number;
|
|
761
|
-
statuses_count?: number;
|
|
762
|
-
created_at?: string;
|
|
763
|
-
profile_image_url_https?: string;
|
|
764
|
-
can_dm?: boolean;
|
|
765
|
-
}
|
|
766
|
-
interface XFollowersResponse {
|
|
767
|
-
followers: XFollower[];
|
|
768
|
-
has_next_page?: boolean;
|
|
769
|
-
next_cursor?: string;
|
|
770
|
-
total_returned?: number;
|
|
771
|
-
username?: string;
|
|
772
|
-
}
|
|
773
|
-
interface XFollowingsResponse {
|
|
774
|
-
followings: XFollower[];
|
|
775
|
-
has_next_page?: boolean;
|
|
776
|
-
next_cursor?: string;
|
|
777
|
-
total_returned?: number;
|
|
778
|
-
username?: string;
|
|
779
|
-
}
|
|
780
|
-
interface XUserInfoResponse {
|
|
781
|
-
data: Record<string, unknown>;
|
|
782
|
-
username?: string;
|
|
783
|
-
}
|
|
784
|
-
interface XVerifiedFollowersResponse {
|
|
785
|
-
followers: XFollower[];
|
|
786
|
-
has_next_page?: boolean;
|
|
787
|
-
next_cursor?: string;
|
|
788
|
-
total_returned?: number;
|
|
789
|
-
}
|
|
790
|
-
interface XTweet {
|
|
791
|
-
id: string;
|
|
792
|
-
text?: string;
|
|
793
|
-
created_at?: string;
|
|
794
|
-
author?: Record<string, unknown>;
|
|
795
|
-
favorite_count?: number;
|
|
796
|
-
retweet_count?: number;
|
|
797
|
-
reply_count?: number;
|
|
798
|
-
view_count?: number;
|
|
799
|
-
lang?: string;
|
|
800
|
-
entities?: Record<string, unknown>;
|
|
801
|
-
media?: Array<Record<string, unknown>>;
|
|
802
|
-
[key: string]: unknown;
|
|
803
|
-
}
|
|
804
|
-
interface XTweetsResponse {
|
|
805
|
-
tweets: XTweet[];
|
|
806
|
-
has_next_page?: boolean;
|
|
807
|
-
next_cursor?: string;
|
|
808
|
-
total_returned?: number;
|
|
809
|
-
}
|
|
810
|
-
interface XMentionsResponse {
|
|
811
|
-
tweets: XTweet[];
|
|
812
|
-
has_next_page?: boolean;
|
|
813
|
-
next_cursor?: string;
|
|
814
|
-
total_returned?: number;
|
|
815
|
-
username?: string;
|
|
816
|
-
}
|
|
817
|
-
interface XTweetLookupResponse {
|
|
818
|
-
tweets: XTweet[];
|
|
819
|
-
not_found?: string[];
|
|
820
|
-
total_requested?: number;
|
|
821
|
-
total_found?: number;
|
|
822
|
-
}
|
|
823
|
-
interface XTweetRepliesResponse {
|
|
824
|
-
replies: XTweet[];
|
|
825
|
-
has_next_page?: boolean;
|
|
826
|
-
next_cursor?: string;
|
|
827
|
-
total_returned?: number;
|
|
828
|
-
}
|
|
829
|
-
interface XTweetThreadResponse {
|
|
830
|
-
tweets: XTweet[];
|
|
831
|
-
has_next_page?: boolean;
|
|
832
|
-
next_cursor?: string;
|
|
833
|
-
total_returned?: number;
|
|
834
|
-
}
|
|
835
|
-
interface XSearchResponse {
|
|
836
|
-
tweets: XTweet[];
|
|
837
|
-
has_next_page?: boolean;
|
|
838
|
-
next_cursor?: string;
|
|
839
|
-
total_returned?: number;
|
|
840
|
-
}
|
|
841
|
-
interface XTrendingResponse {
|
|
842
|
-
data: Record<string, unknown>;
|
|
843
|
-
}
|
|
844
|
-
interface XArticlesRisingResponse {
|
|
845
|
-
data: Record<string, unknown>;
|
|
846
|
-
}
|
|
847
|
-
interface XAuthorAnalyticsResponse {
|
|
848
|
-
data: Record<string, unknown>;
|
|
849
|
-
handle?: string;
|
|
850
|
-
}
|
|
851
|
-
interface XCompareAuthorsResponse {
|
|
852
|
-
data: Record<string, unknown>;
|
|
853
|
-
}
|
|
854
730
|
type PriceCategory = "crypto" | "fx" | "commodity" | "usstock" | "stocks";
|
|
855
731
|
type StockMarket = "us" | "hk" | "jp" | "kr" | "gb" | "de" | "fr" | "nl" | "ie" | "lu" | "cn" | "ca";
|
|
856
732
|
type BarResolution = "1" | "5" | "15" | "60" | "240" | "D" | "W" | "M";
|
|
@@ -913,11 +789,6 @@ interface SearchClientOptions {
|
|
|
913
789
|
apiUrl?: string;
|
|
914
790
|
timeout?: number;
|
|
915
791
|
}
|
|
916
|
-
interface XClientOptions {
|
|
917
|
-
privateKey?: `0x${string}` | string;
|
|
918
|
-
apiUrl?: string;
|
|
919
|
-
timeout?: number;
|
|
920
|
-
}
|
|
921
792
|
interface PriceClientOptions {
|
|
922
793
|
privateKey?: `0x${string}` | string;
|
|
923
794
|
apiUrl?: string;
|
|
@@ -1359,136 +1230,6 @@ declare class LLMClient {
|
|
|
1359
1230
|
* console.log(`Balance: $${balance.toFixed(2)} USDC`);
|
|
1360
1231
|
*/
|
|
1361
1232
|
getBalance(): Promise<number>;
|
|
1362
|
-
/**
|
|
1363
|
-
* Look up X/Twitter user profiles by username.
|
|
1364
|
-
*
|
|
1365
|
-
* Powered by AttentionVC. $0.002 per user (min $0.02, max $0.20).
|
|
1366
|
-
*
|
|
1367
|
-
* @param usernames - Single username or array of usernames (without @)
|
|
1368
|
-
*/
|
|
1369
|
-
xUserLookup(usernames: string | string[]): Promise<XUserLookupResponse>;
|
|
1370
|
-
/**
|
|
1371
|
-
* Get followers of an X/Twitter user.
|
|
1372
|
-
*
|
|
1373
|
-
* Powered by AttentionVC. $0.05 per page (~200 accounts).
|
|
1374
|
-
*
|
|
1375
|
-
* @param username - X/Twitter username (without @)
|
|
1376
|
-
* @param cursor - Pagination cursor from previous response
|
|
1377
|
-
*/
|
|
1378
|
-
xFollowers(username: string, cursor?: string): Promise<XFollowersResponse>;
|
|
1379
|
-
/**
|
|
1380
|
-
* Get accounts an X/Twitter user is following.
|
|
1381
|
-
*
|
|
1382
|
-
* Powered by AttentionVC. $0.05 per page (~200 accounts).
|
|
1383
|
-
*
|
|
1384
|
-
* @param username - X/Twitter username (without @)
|
|
1385
|
-
* @param cursor - Pagination cursor from previous response
|
|
1386
|
-
*/
|
|
1387
|
-
xFollowings(username: string, cursor?: string): Promise<XFollowingsResponse>;
|
|
1388
|
-
/**
|
|
1389
|
-
* Get detailed profile info for a single X/Twitter user.
|
|
1390
|
-
*
|
|
1391
|
-
* Powered by AttentionVC. $0.002 per request.
|
|
1392
|
-
*
|
|
1393
|
-
* @param username - X/Twitter username (without @)
|
|
1394
|
-
*/
|
|
1395
|
-
xUserInfo(username: string): Promise<XUserInfoResponse>;
|
|
1396
|
-
/**
|
|
1397
|
-
* Get verified (blue-check) followers of an X/Twitter user.
|
|
1398
|
-
*
|
|
1399
|
-
* Powered by AttentionVC. $0.048 per page.
|
|
1400
|
-
*
|
|
1401
|
-
* @param userId - X/Twitter user ID (not username)
|
|
1402
|
-
* @param cursor - Pagination cursor from previous response
|
|
1403
|
-
*/
|
|
1404
|
-
xVerifiedFollowers(userId: string, cursor?: string): Promise<XVerifiedFollowersResponse>;
|
|
1405
|
-
/**
|
|
1406
|
-
* Get tweets posted by an X/Twitter user.
|
|
1407
|
-
*
|
|
1408
|
-
* Powered by AttentionVC. $0.032 per page.
|
|
1409
|
-
*
|
|
1410
|
-
* @param username - X/Twitter username (without @)
|
|
1411
|
-
* @param includeReplies - Include reply tweets (default: false)
|
|
1412
|
-
* @param cursor - Pagination cursor from previous response
|
|
1413
|
-
*/
|
|
1414
|
-
xUserTweets(username: string, includeReplies?: boolean, cursor?: string): Promise<XTweetsResponse>;
|
|
1415
|
-
/**
|
|
1416
|
-
* Get tweets that mention an X/Twitter user.
|
|
1417
|
-
*
|
|
1418
|
-
* Powered by AttentionVC. $0.032 per page.
|
|
1419
|
-
*
|
|
1420
|
-
* @param username - X/Twitter username (without @)
|
|
1421
|
-
* @param sinceTime - Start time filter (ISO8601 or Unix timestamp)
|
|
1422
|
-
* @param untilTime - End time filter (ISO8601 or Unix timestamp)
|
|
1423
|
-
* @param cursor - Pagination cursor from previous response
|
|
1424
|
-
*/
|
|
1425
|
-
xUserMentions(username: string, sinceTime?: string, untilTime?: string, cursor?: string): Promise<XMentionsResponse>;
|
|
1426
|
-
/**
|
|
1427
|
-
* Fetch full tweet data for up to 200 tweet IDs.
|
|
1428
|
-
*
|
|
1429
|
-
* Powered by AttentionVC. $0.16 per batch.
|
|
1430
|
-
*
|
|
1431
|
-
* @param tweetIds - Single tweet ID or array of tweet IDs (max 200)
|
|
1432
|
-
*/
|
|
1433
|
-
xTweetLookup(tweetIds: string | string[]): Promise<XTweetLookupResponse>;
|
|
1434
|
-
/**
|
|
1435
|
-
* Get replies to a specific tweet.
|
|
1436
|
-
*
|
|
1437
|
-
* Powered by AttentionVC. $0.032 per page.
|
|
1438
|
-
*
|
|
1439
|
-
* @param tweetId - The tweet ID to get replies for
|
|
1440
|
-
* @param queryType - Sort order: 'Latest' or 'Default'
|
|
1441
|
-
* @param cursor - Pagination cursor from previous response
|
|
1442
|
-
*/
|
|
1443
|
-
xTweetReplies(tweetId: string, queryType?: string, cursor?: string): Promise<XTweetRepliesResponse>;
|
|
1444
|
-
/**
|
|
1445
|
-
* Get the full thread context for a tweet.
|
|
1446
|
-
*
|
|
1447
|
-
* Powered by AttentionVC. $0.032 per page.
|
|
1448
|
-
*
|
|
1449
|
-
* @param tweetId - The tweet ID to get thread for
|
|
1450
|
-
* @param cursor - Pagination cursor from previous response
|
|
1451
|
-
*/
|
|
1452
|
-
xTweetThread(tweetId: string, cursor?: string): Promise<XTweetThreadResponse>;
|
|
1453
|
-
/**
|
|
1454
|
-
* Search X/Twitter with advanced query operators.
|
|
1455
|
-
*
|
|
1456
|
-
* Powered by AttentionVC. $0.032 per page.
|
|
1457
|
-
*
|
|
1458
|
-
* @param query - Search query (supports Twitter search operators)
|
|
1459
|
-
* @param queryType - Sort order: 'Latest', 'Top', or 'Default'
|
|
1460
|
-
* @param cursor - Pagination cursor from previous response
|
|
1461
|
-
*/
|
|
1462
|
-
xSearch(query: string, queryType?: string, cursor?: string): Promise<XSearchResponse>;
|
|
1463
|
-
/**
|
|
1464
|
-
* Get current trending topics on X/Twitter.
|
|
1465
|
-
*
|
|
1466
|
-
* Powered by AttentionVC. $0.002 per request.
|
|
1467
|
-
*/
|
|
1468
|
-
xTrending(): Promise<XTrendingResponse>;
|
|
1469
|
-
/**
|
|
1470
|
-
* Get rising/viral articles from X/Twitter.
|
|
1471
|
-
*
|
|
1472
|
-
* Powered by AttentionVC intelligence layer. $0.05 per request.
|
|
1473
|
-
*/
|
|
1474
|
-
xArticlesRising(): Promise<XArticlesRisingResponse>;
|
|
1475
|
-
/**
|
|
1476
|
-
* Get author analytics and intelligence metrics for an X/Twitter user.
|
|
1477
|
-
*
|
|
1478
|
-
* Powered by AttentionVC intelligence layer. $0.02 per request.
|
|
1479
|
-
*
|
|
1480
|
-
* @param handle - X/Twitter handle (without @)
|
|
1481
|
-
*/
|
|
1482
|
-
xAuthorAnalytics(handle: string): Promise<XAuthorAnalyticsResponse>;
|
|
1483
|
-
/**
|
|
1484
|
-
* Compare two X/Twitter authors side-by-side with intelligence metrics.
|
|
1485
|
-
*
|
|
1486
|
-
* Powered by AttentionVC intelligence layer. $0.05 per request.
|
|
1487
|
-
*
|
|
1488
|
-
* @param handle1 - First X/Twitter handle (without @)
|
|
1489
|
-
* @param handle2 - Second X/Twitter handle (without @)
|
|
1490
|
-
*/
|
|
1491
|
-
xCompareAuthors(handle1: string, handle2: string): Promise<XCompareAuthorsResponse>;
|
|
1492
1233
|
/**
|
|
1493
1234
|
* Query Predexon prediction market data (GET endpoints).
|
|
1494
1235
|
*
|
|
@@ -1547,6 +1288,69 @@ declare class LLMClient {
|
|
|
1547
1288
|
/** Discover wallets connected to a seed address via on-chain transfers and
|
|
1548
1289
|
* identity proofs. Tier 2 ($0.005/call). */
|
|
1549
1290
|
pmWalletCluster(address: string): Promise<Record<string, unknown>>;
|
|
1291
|
+
/**
|
|
1292
|
+
* Query DefiLlama DeFi data (GET passthrough). Powered by DefiLlama.
|
|
1293
|
+
* $0.005/call for protocols / protocol/{slug} / chains / yields;
|
|
1294
|
+
* $0.001/call for prices/{coins}.
|
|
1295
|
+
*
|
|
1296
|
+
* @param path - e.g. "protocols", "protocol/aave", "chains", "yields",
|
|
1297
|
+
* "prices/coingecko:bitcoin,base:0x..."
|
|
1298
|
+
* @param params - Query parameters passed through to DefiLlama
|
|
1299
|
+
*/
|
|
1300
|
+
defi(path: string, params?: Record<string, string>): Promise<Record<string, unknown>>;
|
|
1301
|
+
/** All DeFi protocols with TVL ($0.005/call). */
|
|
1302
|
+
defiProtocols(): Promise<Record<string, unknown>>;
|
|
1303
|
+
/** Single protocol details + historical TVL ($0.005/call). */
|
|
1304
|
+
defiProtocol(slug: string): Promise<Record<string, unknown>>;
|
|
1305
|
+
/** Current TVL of every chain ($0.005/call). */
|
|
1306
|
+
defiChains(): Promise<Record<string, unknown>>;
|
|
1307
|
+
/** Yield pools with APY/TVL ($0.005/call). */
|
|
1308
|
+
defiYields(params?: Record<string, string>): Promise<Record<string, unknown>>;
|
|
1309
|
+
/** Token price lookup ($0.001/call). Coins like "coingecko:bitcoin" or "{chain}:{address}". */
|
|
1310
|
+
defiPrices(coins: string | string[]): Promise<Record<string, unknown>>;
|
|
1311
|
+
/**
|
|
1312
|
+
* Query the 0x Swap / Gasless APIs (free — no x402 payment; BlockRun
|
|
1313
|
+
* takes an on-chain affiliate fee on executed swaps instead).
|
|
1314
|
+
*
|
|
1315
|
+
* @param path - "price", "quote", "gasless/price", "gasless/quote",
|
|
1316
|
+
* "gasless/submit" (POST), "gasless/status/{hash}",
|
|
1317
|
+
* "gasless/approval-tokens", "gasless/chains", "swap/chains"
|
|
1318
|
+
* @param params - Query params (chainId, sellToken, buyToken, sellAmount, taker, ...)
|
|
1319
|
+
* @param body - JSON body — pass to switch to POST (gasless/submit only)
|
|
1320
|
+
*/
|
|
1321
|
+
dex(path: string, params?: Record<string, string>, body?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1322
|
+
/** Indicative Permit2 swap price — no commitment (free). */
|
|
1323
|
+
dexPrice(params: Record<string, string>): Promise<Record<string, unknown>>;
|
|
1324
|
+
/** Firm Permit2 swap quote with permit2.eip712 + tx data (free). */
|
|
1325
|
+
dexQuote(params: Record<string, string>): Promise<Record<string, unknown>>;
|
|
1326
|
+
/** Gasless indicative price quote (free). */
|
|
1327
|
+
dexGaslessPrice(params: Record<string, string>): Promise<Record<string, unknown>>;
|
|
1328
|
+
/** Gasless firm quote — returns trade.eip712 to sign (free). */
|
|
1329
|
+
dexGaslessQuote(params: Record<string, string>): Promise<Record<string, unknown>>;
|
|
1330
|
+
/** Submit a signed gasless trade; the 0x relayer pays gas (free). */
|
|
1331
|
+
dexGaslessSubmit(body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1332
|
+
/** Poll a gasless trade's status by tradeHash (free). */
|
|
1333
|
+
dexGaslessStatus(tradeHash: string): Promise<Record<string, unknown>>;
|
|
1334
|
+
/** Chains where the Swap API is supported (free). */
|
|
1335
|
+
dexChains(): Promise<Record<string, unknown>>;
|
|
1336
|
+
/** Chains where the Gasless API is supported (free). */
|
|
1337
|
+
dexGaslessChains(): Promise<Record<string, unknown>>;
|
|
1338
|
+
/**
|
|
1339
|
+
* Call the Modal sandbox compute API (POST passthrough).
|
|
1340
|
+
*
|
|
1341
|
+
* @param path - "sandbox/create" ($0.01 CPU / $0.05 GPU), "sandbox/exec",
|
|
1342
|
+
* "sandbox/status", "sandbox/terminate" ($0.001 each)
|
|
1343
|
+
* @param body - JSON body for the endpoint
|
|
1344
|
+
*/
|
|
1345
|
+
modal(path: string, body?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1346
|
+
/** Create a sandboxed compute environment ($0.01 CPU / $0.05 GPU). */
|
|
1347
|
+
modalSandboxCreate(body?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1348
|
+
/** Execute a command in a sandbox; returns stdout/stderr ($0.001). */
|
|
1349
|
+
modalSandboxExec(sandboxId: string, command: string[], extra?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1350
|
+
/** Check a sandbox's status ($0.001). */
|
|
1351
|
+
modalSandboxStatus(sandboxId: string): Promise<Record<string, unknown>>;
|
|
1352
|
+
/** Terminate a sandbox ($0.001). */
|
|
1353
|
+
modalSandboxTerminate(sandboxId: string): Promise<Record<string, unknown>>;
|
|
1550
1354
|
/**
|
|
1551
1355
|
* Get current session spending.
|
|
1552
1356
|
*
|
|
@@ -2178,78 +1982,6 @@ declare class SearchClient {
|
|
|
2178
1982
|
getWalletAddress(): string;
|
|
2179
1983
|
}
|
|
2180
1984
|
|
|
2181
|
-
/**
|
|
2182
|
-
* BlockRun X (Twitter) Client - AttentionVC-partnered X/Twitter API via x402.
|
|
2183
|
-
*
|
|
2184
|
-
* Wraps the /api/v1/x/* endpoint family. Every call is gated by an x402
|
|
2185
|
-
* payment; the client handles the 402 → sign → retry dance automatically.
|
|
2186
|
-
*
|
|
2187
|
-
* Usage:
|
|
2188
|
-
* import { XClient } from "@blockrun/llm";
|
|
2189
|
-
*
|
|
2190
|
-
* const x = new XClient({ privateKey: "0x..." });
|
|
2191
|
-
* const info = await x.userInfo("elonmusk");
|
|
2192
|
-
* const followers = await x.followers("paulg");
|
|
2193
|
-
* const results = await x.search("x402 micropayments", { queryType: "Latest" });
|
|
2194
|
-
*/
|
|
2195
|
-
|
|
2196
|
-
interface XUserTweetsOptions {
|
|
2197
|
-
username?: string;
|
|
2198
|
-
userId?: string;
|
|
2199
|
-
cursor?: string;
|
|
2200
|
-
includeReplies?: boolean;
|
|
2201
|
-
}
|
|
2202
|
-
interface XMentionsOptions {
|
|
2203
|
-
sinceTime?: string;
|
|
2204
|
-
untilTime?: string;
|
|
2205
|
-
cursor?: string;
|
|
2206
|
-
}
|
|
2207
|
-
interface XTweetRepliesOptions {
|
|
2208
|
-
cursor?: string;
|
|
2209
|
-
queryType?: "Latest" | "Default";
|
|
2210
|
-
}
|
|
2211
|
-
interface XSearchOptions {
|
|
2212
|
-
queryType?: "Latest" | "Top" | "Default";
|
|
2213
|
-
cursor?: string;
|
|
2214
|
-
}
|
|
2215
|
-
/**
|
|
2216
|
-
* BlockRun X/Twitter client.
|
|
2217
|
-
*
|
|
2218
|
-
* @deprecated BlockRun's `/v1/x/*` (AttentionVC-partnered) integration was
|
|
2219
|
-
* removed from the backend on 2026-04-30 (commit 80dcf52). All `XClient`
|
|
2220
|
-
* calls will return HTTP 404 until a replacement upstream is wired up.
|
|
2221
|
-
* The class is kept in the SDK so existing imports do not break;
|
|
2222
|
-
* instantiation logs a one-time `console.warn`.
|
|
2223
|
-
*/
|
|
2224
|
-
declare class XClient {
|
|
2225
|
-
private account;
|
|
2226
|
-
private privateKey;
|
|
2227
|
-
private apiUrl;
|
|
2228
|
-
private timeout;
|
|
2229
|
-
private static deprecationWarned;
|
|
2230
|
-
constructor(options?: XClientOptions);
|
|
2231
|
-
userLookup(usernames: string | string[]): Promise<XUserLookupResponse>;
|
|
2232
|
-
userInfo(username: string): Promise<XUserInfoResponse>;
|
|
2233
|
-
followers(username: string, cursor?: string): Promise<XFollowersResponse>;
|
|
2234
|
-
/** `/v1/x/users/following` (singular path variant). */
|
|
2235
|
-
following(username: string, cursor?: string): Promise<XFollowingsResponse>;
|
|
2236
|
-
/** `/v1/x/users/followings` (plural path variant). */
|
|
2237
|
-
followings(username: string, cursor?: string): Promise<XFollowingsResponse>;
|
|
2238
|
-
verifiedFollowers(userId: string, cursor?: string): Promise<XVerifiedFollowersResponse>;
|
|
2239
|
-
userTweets(options: XUserTweetsOptions): Promise<XTweetsResponse>;
|
|
2240
|
-
mentions(username: string, options?: XMentionsOptions): Promise<XMentionsResponse>;
|
|
2241
|
-
tweetLookup(tweetIds: string | string[]): Promise<XTweetLookupResponse>;
|
|
2242
|
-
tweetReplies(tweetId: string, options?: XTweetRepliesOptions): Promise<XTweetRepliesResponse>;
|
|
2243
|
-
tweetThread(tweetId: string, cursor?: string): Promise<XTweetThreadResponse>;
|
|
2244
|
-
search(query: string, options?: XSearchOptions): Promise<XSearchResponse>;
|
|
2245
|
-
trending(): Promise<XTrendingResponse>;
|
|
2246
|
-
articlesRising(): Promise<XArticlesRisingResponse>;
|
|
2247
|
-
private post;
|
|
2248
|
-
private payAndRetry;
|
|
2249
|
-
private fetchWithTimeout;
|
|
2250
|
-
getWalletAddress(): string;
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2253
1985
|
/**
|
|
2254
1986
|
* BlockRun Price Client - Pyth-backed market data via x402.
|
|
2255
1987
|
*
|
|
@@ -2875,21 +2607,6 @@ declare class SolanaLLMClient {
|
|
|
2875
2607
|
imageEdit(prompt: string, image: string | string[], options?: ImageEditOptions): Promise<ImageResponse>;
|
|
2876
2608
|
/** Standalone search (Solana payment). */
|
|
2877
2609
|
search(query: string, options?: SearchOptions): Promise<SearchResult>;
|
|
2878
|
-
xUserLookup(usernames: string | string[]): Promise<XUserLookupResponse>;
|
|
2879
|
-
xFollowers(username: string, cursor?: string): Promise<XFollowersResponse>;
|
|
2880
|
-
xFollowings(username: string, cursor?: string): Promise<XFollowingsResponse>;
|
|
2881
|
-
xUserInfo(username: string): Promise<XUserInfoResponse>;
|
|
2882
|
-
xVerifiedFollowers(userId: string, cursor?: string): Promise<XVerifiedFollowersResponse>;
|
|
2883
|
-
xUserTweets(username: string, includeReplies?: boolean, cursor?: string): Promise<XTweetsResponse>;
|
|
2884
|
-
xUserMentions(username: string, sinceTime?: string, untilTime?: string, cursor?: string): Promise<XMentionsResponse>;
|
|
2885
|
-
xTweetLookup(tweetIds: string | string[]): Promise<XTweetLookupResponse>;
|
|
2886
|
-
xTweetReplies(tweetId: string, queryType?: string, cursor?: string): Promise<XTweetRepliesResponse>;
|
|
2887
|
-
xTweetThread(tweetId: string, cursor?: string): Promise<XTweetThreadResponse>;
|
|
2888
|
-
xSearch(query: string, queryType?: string, cursor?: string): Promise<XSearchResponse>;
|
|
2889
|
-
xTrending(): Promise<XTrendingResponse>;
|
|
2890
|
-
xArticlesRising(): Promise<XArticlesRisingResponse>;
|
|
2891
|
-
xAuthorAnalytics(handle: string): Promise<XAuthorAnalyticsResponse>;
|
|
2892
|
-
xCompareAuthors(handle1: string, handle2: string): Promise<XCompareAuthorsResponse>;
|
|
2893
2610
|
pm(path: string, params?: Record<string, string>): Promise<Record<string, unknown>>;
|
|
2894
2611
|
pmQuery(path: string, query: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
2895
2612
|
/**
|
|
@@ -2930,6 +2647,69 @@ declare class SolanaLLMClient {
|
|
|
2930
2647
|
* const answer = await client.exaAnswer("What is the current state of AI safety research?");
|
|
2931
2648
|
*/
|
|
2932
2649
|
exaAnswer(query: string, options?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
2650
|
+
/**
|
|
2651
|
+
* Query DefiLlama DeFi data (GET passthrough). Powered by DefiLlama.
|
|
2652
|
+
* $0.005/call for protocols / protocol/{slug} / chains / yields;
|
|
2653
|
+
* $0.001/call for prices/{coins}.
|
|
2654
|
+
*
|
|
2655
|
+
* @param path - e.g. "protocols", "protocol/aave", "chains", "yields",
|
|
2656
|
+
* "prices/coingecko:bitcoin,base:0x..."
|
|
2657
|
+
* @param params - Query parameters passed through to DefiLlama
|
|
2658
|
+
*/
|
|
2659
|
+
defi(path: string, params?: Record<string, string>): Promise<Record<string, unknown>>;
|
|
2660
|
+
/** All DeFi protocols with TVL ($0.005/call). */
|
|
2661
|
+
defiProtocols(): Promise<Record<string, unknown>>;
|
|
2662
|
+
/** Single protocol details + historical TVL ($0.005/call). */
|
|
2663
|
+
defiProtocol(slug: string): Promise<Record<string, unknown>>;
|
|
2664
|
+
/** Current TVL of every chain ($0.005/call). */
|
|
2665
|
+
defiChains(): Promise<Record<string, unknown>>;
|
|
2666
|
+
/** Yield pools with APY/TVL ($0.005/call). */
|
|
2667
|
+
defiYields(params?: Record<string, string>): Promise<Record<string, unknown>>;
|
|
2668
|
+
/** Token price lookup ($0.001/call). Coins like "coingecko:bitcoin" or "{chain}:{address}". */
|
|
2669
|
+
defiPrices(coins: string | string[]): Promise<Record<string, unknown>>;
|
|
2670
|
+
/**
|
|
2671
|
+
* Query the 0x Swap / Gasless APIs (free — no x402 payment; BlockRun
|
|
2672
|
+
* takes an on-chain affiliate fee on executed swaps instead).
|
|
2673
|
+
*
|
|
2674
|
+
* @param path - "price", "quote", "gasless/price", "gasless/quote",
|
|
2675
|
+
* "gasless/submit" (POST), "gasless/status/{hash}",
|
|
2676
|
+
* "gasless/approval-tokens", "gasless/chains", "swap/chains"
|
|
2677
|
+
* @param params - Query params (chainId, sellToken, buyToken, sellAmount, taker, ...)
|
|
2678
|
+
* @param body - JSON body — pass to switch to POST (gasless/submit only)
|
|
2679
|
+
*/
|
|
2680
|
+
dex(path: string, params?: Record<string, string>, body?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
2681
|
+
/** Indicative Permit2 swap price — no commitment (free). */
|
|
2682
|
+
dexPrice(params: Record<string, string>): Promise<Record<string, unknown>>;
|
|
2683
|
+
/** Firm Permit2 swap quote with permit2.eip712 + tx data (free). */
|
|
2684
|
+
dexQuote(params: Record<string, string>): Promise<Record<string, unknown>>;
|
|
2685
|
+
/** Gasless indicative price quote (free). */
|
|
2686
|
+
dexGaslessPrice(params: Record<string, string>): Promise<Record<string, unknown>>;
|
|
2687
|
+
/** Gasless firm quote — returns trade.eip712 to sign (free). */
|
|
2688
|
+
dexGaslessQuote(params: Record<string, string>): Promise<Record<string, unknown>>;
|
|
2689
|
+
/** Submit a signed gasless trade; the 0x relayer pays gas (free). */
|
|
2690
|
+
dexGaslessSubmit(body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
2691
|
+
/** Poll a gasless trade's status by tradeHash (free). */
|
|
2692
|
+
dexGaslessStatus(tradeHash: string): Promise<Record<string, unknown>>;
|
|
2693
|
+
/** Chains where the Swap API is supported (free). */
|
|
2694
|
+
dexChains(): Promise<Record<string, unknown>>;
|
|
2695
|
+
/** Chains where the Gasless API is supported (free). */
|
|
2696
|
+
dexGaslessChains(): Promise<Record<string, unknown>>;
|
|
2697
|
+
/**
|
|
2698
|
+
* Call the Modal sandbox compute API (POST passthrough).
|
|
2699
|
+
*
|
|
2700
|
+
* @param path - "sandbox/create" ($0.01 CPU / $0.05 GPU), "sandbox/exec",
|
|
2701
|
+
* "sandbox/status", "sandbox/terminate" ($0.001 each)
|
|
2702
|
+
* @param body - JSON body for the endpoint
|
|
2703
|
+
*/
|
|
2704
|
+
modal(path: string, body?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
2705
|
+
/** Create a sandboxed compute environment ($0.01 CPU / $0.05 GPU). */
|
|
2706
|
+
modalSandboxCreate(body?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
2707
|
+
/** Execute a command in a sandbox; returns stdout/stderr ($0.001). */
|
|
2708
|
+
modalSandboxExec(sandboxId: string, command: string[], extra?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
2709
|
+
/** Check a sandbox's status ($0.001). */
|
|
2710
|
+
modalSandboxStatus(sandboxId: string): Promise<Record<string, unknown>>;
|
|
2711
|
+
/** Terminate a sandbox ($0.001). */
|
|
2712
|
+
modalSandboxTerminate(sandboxId: string): Promise<Record<string, unknown>>;
|
|
2933
2713
|
/** Get session spending. */
|
|
2934
2714
|
getSpending(): Spending;
|
|
2935
2715
|
/** True if using sol.blockrun.ai. */
|
|
@@ -3257,4 +3037,4 @@ declare function validateTemperature(temperature?: number): void;
|
|
|
3257
3037
|
*/
|
|
3258
3038
|
declare function validateTopP(topP?: number): void;
|
|
3259
3039
|
|
|
3260
|
-
export { APIError, AnthropicClient, type AudioModel, type AudioTrack, BASE_CHAIN_ID, type BarResolution, type BlockRunAnthropicOptions, BlockrunClient, type BlockrunClientOptions, BlockrunError, type CallInitiatedResponse, type CallModel, type CallOptions, type CallStatusResponse, type ChatChoice, type ChatCompletionOptions, type ChatMessage, type ChatOptions, type ChatResponse, type ChatResponseWithCost, type ChatUsage, type CostEntry, type CostEstimate, type CreatePaymentOptions, type FunctionCall, type FunctionDefinition, type HistoryOptions, ImageClient, type ImageClientOptions, type ImageData, type ImageEditOptions, type ImageGenerateOptions, type ImageModel, type ImageResponse, KNOWN_PROVIDERS, LLMClient, type LLMClientOptions, type ListOptions, type MarketSession, type Model, MusicClient, type MusicClientOptions, type MusicGenerateOptions, type MusicResponse, NETWORK_ALIASES, type NewsSearchSource, OpenAI, type OpenAIChatCompletionChoice, type OpenAIChatCompletionChunk, type OpenAIChatCompletionParams, type OpenAIChatCompletionResponse, type OpenAIClientOptions, PHONE_PRICES, PORTRAIT_ENROLLMENT_PRICE_USD, PaymentError, type PaymentLinks, type PhoneBuyOptions, type PhoneBuyResponse, PhoneClient, type PhoneClientOptions, type PhoneListResponse, type PhoneLookupResponse, type PhoneNumberRecord, type PhoneReleaseResponse, type PhoneRenewResponse, type PollOptions, PortraitClient, type PortraitClientOptions, type PortraitEnrollOptions, type PortraitEnrollResponse, type PriceBar, type PriceCategory, PriceClient, type PriceClientOptions, type PriceHistoryResponse, type PriceOptions, type PricePoint, RPC_PRICE_USD, type ResponseFormat, type RoutingDecision, type RoutingProfile, type RoutingTier, type RpcBatchRequest, RpcClient, type RpcClientOptions, type RpcError, type RpcNetwork, type RpcResponse, type RssSearchSource, SOLANA_NETWORK, SOLANA_WALLET_FILE as SOLANA_WALLET_FILE_PATH, SUPPORTED_NETWORKS, SearchClient, type SearchClientOptions, type SearchOptions, type SearchParameters, type SearchResult, type SearchSource, type SearchUsage, type SmartChatOptions, type SmartChatResponse, SolanaLLMClient, type SolanaLLMClientOptions, type SolanaWalletInfo, type SoundEffectOptions, type SpeechAudio, SpeechClient, type SpeechClientOptions, type SpeechGenerateOptions, type SpeechModel, type SpeechResponse, type SpeechVoice, type Spending, type SpendingReport, type StockMarket, SurfClient, type SurfClientOptions, type SymbolListResponse, type Tool, type ToolCall, type ToolChoice, USDC_BASE, USDC_BASE_CONTRACT, USDC_SOLANA, VideoClient, type VideoClientOptions, type VideoClip, type VideoGenerateOptions, type VideoModel, type VideoResponse, VoiceClient, type VoiceClientOptions, type VoiceInfo, type VoicePreset, WALLET_DIR_PATH, WALLET_FILE_PATH, type WalletInfo, type WebSearchSource, type
|
|
3040
|
+
export { APIError, AnthropicClient, type AudioModel, type AudioTrack, BASE_CHAIN_ID, type BarResolution, type BlockRunAnthropicOptions, BlockrunClient, type BlockrunClientOptions, BlockrunError, type CallInitiatedResponse, type CallModel, type CallOptions, type CallStatusResponse, type ChatChoice, type ChatCompletionOptions, type ChatMessage, type ChatOptions, type ChatResponse, type ChatResponseWithCost, type ChatUsage, type CostEntry, type CostEstimate, type CreatePaymentOptions, type FunctionCall, type FunctionDefinition, type HistoryOptions, ImageClient, type ImageClientOptions, type ImageData, type ImageEditOptions, type ImageGenerateOptions, type ImageModel, type ImageResponse, KNOWN_PROVIDERS, LLMClient, type LLMClientOptions, type ListOptions, type MarketSession, type Model, MusicClient, type MusicClientOptions, type MusicGenerateOptions, type MusicResponse, NETWORK_ALIASES, type NewsSearchSource, OpenAI, type OpenAIChatCompletionChoice, type OpenAIChatCompletionChunk, type OpenAIChatCompletionParams, type OpenAIChatCompletionResponse, type OpenAIClientOptions, PHONE_PRICES, PORTRAIT_ENROLLMENT_PRICE_USD, PaymentError, type PaymentLinks, type PhoneBuyOptions, type PhoneBuyResponse, PhoneClient, type PhoneClientOptions, type PhoneListResponse, type PhoneLookupResponse, type PhoneNumberRecord, type PhoneReleaseResponse, type PhoneRenewResponse, type PollOptions, PortraitClient, type PortraitClientOptions, type PortraitEnrollOptions, type PortraitEnrollResponse, type PriceBar, type PriceCategory, PriceClient, type PriceClientOptions, type PriceHistoryResponse, type PriceOptions, type PricePoint, RPC_PRICE_USD, type ResponseFormat, type RoutingDecision, type RoutingProfile, type RoutingTier, type RpcBatchRequest, RpcClient, type RpcClientOptions, type RpcError, type RpcNetwork, type RpcResponse, type RssSearchSource, SOLANA_NETWORK, SOLANA_WALLET_FILE as SOLANA_WALLET_FILE_PATH, SUPPORTED_NETWORKS, SearchClient, type SearchClientOptions, type SearchOptions, type SearchParameters, type SearchResult, type SearchSource, type SearchUsage, type SmartChatOptions, type SmartChatResponse, SolanaLLMClient, type SolanaLLMClientOptions, type SolanaWalletInfo, type SoundEffectOptions, type SpeechAudio, SpeechClient, type SpeechClientOptions, type SpeechGenerateOptions, type SpeechModel, type SpeechResponse, type SpeechVoice, type Spending, type SpendingReport, type StockMarket, SurfClient, type SurfClientOptions, type SymbolListResponse, type Tool, type ToolCall, type ToolChoice, USDC_BASE, USDC_BASE_CONTRACT, USDC_SOLANA, VideoClient, type VideoClientOptions, type VideoClip, type VideoGenerateOptions, type VideoModel, type VideoResponse, VoiceClient, type VoiceClientOptions, type VoiceInfo, type VoicePreset, WALLET_DIR_PATH, WALLET_FILE_PATH, type WalletInfo, type WebSearchSource, type XSearchSource, clearCache, createPaymentPayload, createSolanaPaymentPayload, createSolanaWallet, createWallet, LLMClient as default, extractPaymentDetails, formatFundingMessageCompact, formatNeedsFundingMessage, formatWalletCreatedMessage, getCached, getCachedByRequest, getCostLogSummary, getCostSummary, getEip681Uri, getOrCreateSolanaWallet, getOrCreateWallet, getPaymentLinks, getWalletAddress, loadSolanaWallet, loadWallet, logCost, parsePaymentRequired, saveSolanaWallet, saveToCache, saveWallet, scanSolanaWallets, scanWallets, setCache, setupAgentSolanaWallet, setupAgentWallet, solanaClient, solanaKeyToBytes, solanaPublicKey, status, validateMaxTokens, validateModel, validateTemperature, validateTopP };
|