Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ version = "1.8.3"
# Dojo dependencies
dojo-world = { git = "https://github.com/dojoengine/dojo", rev = "0afeb1bc" }
dojo-types = { git = "https://github.com/dojoengine/dojo", rev = "0afeb1bc" }
torii-proto = { git = "https://github.com/dojoengine/torii", rev = "8378c63" }
torii-client = { git = "https://github.com/dojoengine/torii", rev = "8378c63" }
torii-grpc-client = { git = "https://github.com/dojoengine/torii", rev = "8378c63" }
torii-proto = { git = "https://github.com/dojoengine/torii", rev = "ffd7139" }
torii-client = { git = "https://github.com/dojoengine/torii", rev = "ffd7139" }
torii-grpc-client = { git = "https://github.com/dojoengine/torii", rev = "ffd7139" }

# Starknet dependencies
starknet = "0.17.0"
Expand Down
88 changes: 88 additions & 0 deletions bindings/c/dojo.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ struct TokenBalance;
struct TokenContract;
struct Contract;
struct TokenTransfer;
struct TableSearchResults;
struct Provider;
struct Account;
struct Ty;
struct Model;
struct Member;
struct AchievementTask;
struct PlayerAchievementProgress;
struct SearchMatch;
struct EnumOption;
struct TaskProgress;
struct SearchMatchField;

typedef enum BlockTag {
Latest,
Expand Down Expand Up @@ -1052,6 +1055,38 @@ typedef struct TokenTransfer {
struct COptionc_char event_id;
} TokenTransfer;

typedef struct CArrayTableSearchResults {
struct TableSearchResults *data;
uintptr_t data_len;
} CArrayTableSearchResults;

typedef struct SearchResponse {
uint32_t total;
struct CArrayTableSearchResults results;
} SearchResponse;

typedef enum ResultSearchResponse_Tag {
OkSearchResponse,
ErrSearchResponse,
} ResultSearchResponse_Tag;

typedef struct ResultSearchResponse {
ResultSearchResponse_Tag tag;
union {
struct {
struct SearchResponse ok;
};
struct {
struct Error err;
};
};
} ResultSearchResponse;

typedef struct SearchQuery {
const char *query;
uint32_t limit;
} SearchQuery;

typedef enum ResultCArrayFieldElement_Tag {
OkCArrayFieldElement,
ErrCArrayFieldElement,
Expand Down Expand Up @@ -1285,6 +1320,17 @@ typedef struct TokenContract {
struct COptionU256 total_supply;
} TokenContract;

typedef struct CArraySearchMatch {
struct SearchMatch *data;
uintptr_t data_len;
} CArraySearchMatch;

typedef struct TableSearchResults {
const char *table;
uint32_t count;
struct CArraySearchMatch matches;
} TableSearchResults;

typedef struct CArrayEnumOption {
struct EnumOption *data;
uintptr_t data_len;
Expand Down Expand Up @@ -1384,6 +1430,31 @@ typedef struct PlayerAchievementProgress {
double progress_percentage;
} PlayerAchievementProgress;

typedef struct CArraySearchMatchField {
struct SearchMatchField *data;
uintptr_t data_len;
} CArraySearchMatchField;

typedef enum COptionf64_Tag {
Somef64,
Nonef64,
} COptionf64_Tag;

typedef struct COptionf64 {
COptionf64_Tag tag;
union {
struct {
double some;
};
};
} COptionf64;

typedef struct SearchMatch {
const char *id;
struct CArraySearchMatchField fields;
struct COptionf64 score;
} SearchMatch;

typedef struct EnumOption {
const char *name;
struct Ty *ty;
Expand All @@ -1395,6 +1466,11 @@ typedef struct TaskProgress {
bool completed;
} TaskProgress;

typedef struct SearchMatchField {
const char *key;
const char *value;
} SearchMatchField;

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
Expand Down Expand Up @@ -2034,6 +2110,18 @@ struct Resultbool client_update_token_transfer_subscription(struct ToriiClient *
const struct U256 *token_ids,
uintptr_t token_ids_len);

/**
* Performs a full-text search across indexed entities using FTS5
*
* # Parameters
* * `client` - Pointer to ToriiClient instance
* * `query` - Search query containing the search text and limit
*
* # Returns
* Result containing SearchResponse with results grouped by table or error
*/
struct ResultSearchResponse client_search(struct ToriiClient *client, struct SearchQuery query);

/**
* Serializes a string into a byte array
*
Expand Down
Loading