Skip to content

Commit

Permalink
docs: update README with new version and ABI file
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Dec 22, 2023
1 parent 2d4b52b commit c8e818a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions crates/rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This crates contains the compile-time rust macro `abigen` to generate rust bindi
```toml
# Cargo.toml

cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.1.5", features = ["abigen-rs"] }
cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.1.7", features = ["abigen-rs"] }
```

```rust
Expand All @@ -24,11 +24,14 @@ For examples, please refer to the [examples](../../examples) folder.
The `abigen!` macro takes 2 or 3 inputs:

1. The name you want to assign to the contract type being generated.
2. Path to the JSON file containing only the list of ABI entries. This can be easily generated with `jq` doing the following:
2. Path to the JSON file containing the ABI. This file can have two format:

```
jq .abi ./target/dev/package_contract.contract_class.json > /path/contract.json
```
- The entire Sierra file (`*.contract_class.json`)
- Only the array of ABI entries. These can be easily extracted with `jq` doing the following:

```
jq .abi ./target/dev/package_contract.contract_class.json > /path/contract.json
```

3. Optional parameters:
- `output_path`: if provided, the content will be generated in the given file instead of being expanded at the location of the macro invocation.
Expand Down

0 comments on commit c8e818a

Please sign in to comment.