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
103 changes: 44 additions & 59 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[package]
edition = "2021"
name = "dojo-c"
version = "1.0.0-alpha.17"
version = "1.0.0-alpha.18"

[lib]
crate-type = ["cdylib", "rlib", "staticlib"]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
dojo-world = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.17", features = [
dojo-world = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.18", features = [
"metadata",
] }

[dependencies]
dojo-types = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.17" }
torii-client = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.17" }
dojo-types = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.18" }
torii-client = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.18" }
torii-grpc = { git = "https://github.com/dojoengine/dojo", features = [
"client",
], tag = "v1.0.0-alpha.17" }
torii-relay = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.17" }
], tag = "v1.0.0-alpha.18" }
torii-relay = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.18" }

starknet = "0.11.0"
starknet-crypto = "0.7.2"
Expand All @@ -37,7 +37,7 @@ cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.3.2" }

# WASM
[target.'cfg(target_arch = "wasm32")'.dependencies]
dojo-world = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.17", features = [
dojo-world = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.18", features = [
] }
serde-wasm-bindgen = "0.6.3"
wasm-bindgen-futures = "0.4.39"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cargo build --release --target x86_64-unknown-linux-gnu
# Building wasm32 binary
cargo build --release --target wasm32-unknown-unknown
# Building using wasm-pack
bunx wasm-pack build --release
cd pkg && bunx wasm-pack build --release
```

## Running
Expand Down
16 changes: 16 additions & 0 deletions dojo.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,17 @@ typedef struct Resultbool {
};
} Resultbool;

typedef struct Event {
struct CArrayFieldElement keys;
struct CArrayFieldElement data;
struct FieldElement transaction_hash;
} Event;

typedef struct CArrayEvent {
struct Event *data;
uintptr_t data_len;
} CArrayEvent;

typedef struct IndexerUpdate {
int64_t head;
int64_t tps;
Expand Down Expand Up @@ -652,6 +663,11 @@ struct Resultbool client_update_event_message_subscription(struct ToriiClient *c
const struct EntityKeysClause *clauses,
uintptr_t clauses_len);

struct ResultSubscription client_on_starknet_event(struct ToriiClient *client,
const struct EntityKeysClause *clauses,
uintptr_t clauses_len,
void (*callback)(struct CArrayEvent));

struct ResultSubscription on_indexer_update(struct ToriiClient *client,
const struct FieldElement *contract_address,
void (*callback)(struct IndexerUpdate));
Expand Down
Loading
Loading