@@ -29,15 +29,18 @@ struct TokenBalance;
2929struct TokenContract ;
3030struct Contract ;
3131struct TokenTransfer ;
32+ struct TableSearchResults ;
3233struct Provider ;
3334struct Account ;
3435struct Ty ;
3536struct Model ;
3637struct Member ;
3738struct AchievementTask ;
3839struct PlayerAchievementProgress ;
40+ struct SearchMatch ;
3941struct EnumOption ;
4042struct TaskProgress ;
43+ struct SearchMatchField ;
4144
4245typedef enum BlockTag {
4346 Latest,
@@ -1052,6 +1055,38 @@ typedef struct TokenTransfer {
10521055 struct COptionc_char event_id;
10531056} TokenTransfer;
10541057
1058+ typedef struct CArrayTableSearchResults {
1059+ struct TableSearchResults *data;
1060+ uintptr_t data_len;
1061+ } CArrayTableSearchResults;
1062+
1063+ typedef struct SearchResponse {
1064+ uint32_t total;
1065+ struct CArrayTableSearchResults results;
1066+ } SearchResponse;
1067+
1068+ typedef enum ResultSearchResponse_Tag {
1069+ OkSearchResponse,
1070+ ErrSearchResponse,
1071+ } ResultSearchResponse_Tag;
1072+
1073+ typedef struct ResultSearchResponse {
1074+ ResultSearchResponse_Tag tag;
1075+ union {
1076+ struct {
1077+ struct SearchResponse ok;
1078+ };
1079+ struct {
1080+ struct Error err;
1081+ };
1082+ };
1083+ } ResultSearchResponse;
1084+
1085+ typedef struct SearchQuery {
1086+ const char *query;
1087+ uint32_t limit;
1088+ } SearchQuery;
1089+
10551090typedef enum ResultCArrayFieldElement_Tag {
10561091 OkCArrayFieldElement,
10571092 ErrCArrayFieldElement,
@@ -1285,6 +1320,17 @@ typedef struct TokenContract {
12851320 struct COptionU256 total_supply;
12861321} TokenContract;
12871322
1323+ typedef struct CArraySearchMatch {
1324+ struct SearchMatch *data;
1325+ uintptr_t data_len;
1326+ } CArraySearchMatch;
1327+
1328+ typedef struct TableSearchResults {
1329+ const char *table;
1330+ uint32_t count;
1331+ struct CArraySearchMatch matches;
1332+ } TableSearchResults;
1333+
12881334typedef struct CArrayEnumOption {
12891335 struct EnumOption *data;
12901336 uintptr_t data_len;
@@ -1384,6 +1430,31 @@ typedef struct PlayerAchievementProgress {
13841430 double progress_percentage;
13851431} PlayerAchievementProgress;
13861432
1433+ typedef struct CArraySearchMatchField {
1434+ struct SearchMatchField *data;
1435+ uintptr_t data_len;
1436+ } CArraySearchMatchField;
1437+
1438+ typedef enum COptionf64_Tag {
1439+ Somef64,
1440+ Nonef64,
1441+ } COptionf64_Tag;
1442+
1443+ typedef struct COptionf64 {
1444+ COptionf64_Tag tag;
1445+ union {
1446+ struct {
1447+ double some;
1448+ };
1449+ };
1450+ } COptionf64;
1451+
1452+ typedef struct SearchMatch {
1453+ const char *id;
1454+ struct CArraySearchMatchField fields;
1455+ struct COptionf64 score;
1456+ } SearchMatch;
1457+
13871458typedef struct EnumOption {
13881459 const char *name;
13891460 struct Ty *ty;
@@ -1395,6 +1466,11 @@ typedef struct TaskProgress {
13951466 bool completed;
13961467} TaskProgress;
13971468
1469+ typedef struct SearchMatchField {
1470+ const char *key;
1471+ const char *value;
1472+ } SearchMatchField;
1473+
13981474#ifdef __cplusplus
13991475extern " C" {
14001476#endif // __cplusplus
@@ -2034,6 +2110,18 @@ struct Resultbool client_update_token_transfer_subscription(struct ToriiClient *
20342110 const struct U256 *token_ids,
20352111 uintptr_t token_ids_len);
20362112
2113+ /* *
2114+ * Performs a full-text search across indexed entities using FTS5
2115+ *
2116+ * # Parameters
2117+ * * `client` - Pointer to ToriiClient instance
2118+ * * `query` - Search query containing the search text and limit
2119+ *
2120+ * # Returns
2121+ * Result containing SearchResponse with results grouped by table or error
2122+ */
2123+ struct ResultSearchResponse client_search (struct ToriiClient *client, struct SearchQuery query);
2124+
20372125/* *
20382126 * Serializes a string into a byte array
20392127 *
0 commit comments