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
69 changes: 35 additions & 34 deletions Cargo.lock

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

13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ version = "1.5.0"
crate-type = ["cdylib", "rlib", "staticlib"]

[dependencies]
dojo-world = { git = "https://github.com/dojoengine/dojo", tag = "v1.4.1" }
dojo-types = { git = "https://github.com/dojoengine/dojo", tag = "v1.4.1" }
torii-client = { git = "https://github.com/dojoengine/torii", rev = "4dbb084" }
torii-grpc-client = { git = "https://github.com/dojoengine/torii", rev = "4dbb084" }
torii-typed-data = { git = "https://github.com/dojoengine/torii", rev = "4dbb084" }
torii-libp2p-types = { git = "https://github.com/dojoengine/torii", rev = "4dbb084" }
dojo-world = { git = "https://github.com/dojoengine/dojo", rev = "4145801" }
dojo-types = { git = "https://github.com/dojoengine/dojo", rev = "4145801" }
torii-proto = { git = "https://github.com/dojoengine/torii", rev = "3ae9b23" }
torii-client = { git = "https://github.com/dojoengine/torii", rev = "3ae9b23" }
torii-grpc-client = { git = "https://github.com/dojoengine/torii", rev = "3ae9b23" }
torii-typed-data = { git = "https://github.com/dojoengine/torii", rev = "3ae9b23" }
torii-libp2p-types = { git = "https://github.com/dojoengine/torii", rev = "3ae9b23" }

starknet = "0.13.0"
starknet-crypto = "0.7.2"
Expand Down
46 changes: 14 additions & 32 deletions dojo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ struct OrderBy;
struct COptionFieldElement;
struct CHashItemFieldElementModelMetadata;
struct Subscription;
struct EntityKeysClause;
struct Struct;
struct Token;
struct TokenBalance;
Expand Down Expand Up @@ -236,6 +235,11 @@ typedef struct Pagination {
struct CArrayOrderBy order_by;
} Pagination;

typedef struct CArrayFieldElement {
struct FieldElement *data;
uintptr_t data_len;
} CArrayFieldElement;

typedef struct CArrayCOptionFieldElement {
struct COptionFieldElement *data;
uintptr_t data_len;
Expand Down Expand Up @@ -373,6 +377,7 @@ typedef struct CompositeClause {
} CompositeClause;

typedef enum Clause_Tag {
HashedKeys,
Keys,
CMember,
Composite,
Expand All @@ -381,6 +386,9 @@ typedef enum Clause_Tag {
typedef struct Clause {
Clause_Tag tag;
union {
struct {
struct CArrayFieldElement hashed_keys;
};
struct {
struct KeysClause keys;
};
Expand Down Expand Up @@ -464,11 +472,6 @@ typedef struct CArrayStruct {
uintptr_t data_len;
} CArrayStruct;

typedef struct CArrayFieldElement {
struct FieldElement *data;
uintptr_t data_len;
} CArrayFieldElement;

typedef struct Event {
struct CArrayFieldElement keys;
struct CArrayFieldElement data;
Expand Down Expand Up @@ -790,23 +793,6 @@ typedef struct CHashItemFieldElementModelMetadata {
struct ModelMetadata value;
} CHashItemFieldElementModelMetadata;

typedef enum EntityKeysClause_Tag {
HashedKeys,
EntityKeys,
} EntityKeysClause_Tag;

typedef struct EntityKeysClause {
EntityKeysClause_Tag tag;
union {
struct {
struct CArrayFieldElement hashed_keys;
};
struct {
struct KeysClause entity_keys;
};
};
} EntityKeysClause;

typedef struct Member {
const char *name;
struct Ty *ty;
Expand Down Expand Up @@ -1073,8 +1059,7 @@ struct ResultWorldMetadata client_metadata(struct ToriiClient *client);
* Result containing pointer to Subscription or error
*/
struct ResultSubscription client_on_entity_state_update(struct ToriiClient *client,
const struct EntityKeysClause *clauses,
uintptr_t clauses_len,
struct COptionClause clause,
void (*callback)(struct FieldElement,
struct CArrayStruct));

Expand All @@ -1092,8 +1077,7 @@ struct ResultSubscription client_on_entity_state_update(struct ToriiClient *clie
*/
struct Resultbool client_update_entity_subscription(struct ToriiClient *client,
struct Subscription *subscription,
const struct EntityKeysClause *clauses,
uintptr_t clauses_len);
struct COptionClause clause);

/**
* Subscribes to event message updates
Expand All @@ -1108,8 +1092,7 @@ struct Resultbool client_update_entity_subscription(struct ToriiClient *client,
* Result containing pointer to Subscription or error
*/
struct ResultSubscription client_on_event_message_update(struct ToriiClient *client,
const struct EntityKeysClause *clauses,
uintptr_t clauses_len,
struct COptionClause clause,
void (*callback)(struct FieldElement,
struct CArrayStruct));

Expand All @@ -1127,8 +1110,7 @@ struct ResultSubscription client_on_event_message_update(struct ToriiClient *cli
*/
struct Resultbool client_update_event_message_subscription(struct ToriiClient *client,
struct Subscription *subscription,
const struct EntityKeysClause *clauses,
uintptr_t clauses_len);
struct COptionClause clause);

/**
* Subscribes to Starknet events
Expand All @@ -1143,7 +1125,7 @@ struct Resultbool client_update_event_message_subscription(struct ToriiClient *c
* Result containing pointer to Subscription or error
*/
struct ResultSubscription client_on_starknet_event(struct ToriiClient *client,
const struct EntityKeysClause *clauses,
const struct KeysClause *clauses,
uintptr_t clauses_len,
void (*callback)(struct Event));

Expand Down
Loading