-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[workspace] | ||
members = ["anchor-gen", "crates/*", "examples/*"] | ||
members = ["crates/*", "examples/*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# anchor-gen | ||
|
||
Generates an Anchor CPI crate from a JSON IDL. | ||
Generates a crate for cross-program invocations to an Anchor program from a JSON IDL. | ||
|
||
## Usage | ||
|
||
In a new crate, write: | ||
|
||
```rust | ||
anchor_gen::generate_cpi_crate!("src/idl.json"); | ||
anchor_gen::generate_cpi_crate!("../../examples/govern-cpi/idl.json"); | ||
|
||
declare_id!("GjphYQcbP1m3FuDyCTUJf2mUMxKPE3j6feWU1rxvC7Ps"); | ||
``` | ||
|
||
This will generate a fully functional Rust CPI client for your IDL. | ||
|
||
## License | ||
More examples can be found in the [examples/](https://github.com/saber-hq/anchor-gen/tree/master/examples) directory. | ||
|
||
Apache 2.0 | ||
License: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,15 @@ authors = ["Ian Macalinao <[email protected]>"] | |
repository = "https://github.com/saber-hq/anchor-gen" | ||
license = "Apache-2.0" | ||
keywords = ["solana", "anchor"] | ||
readme = "../README.md" | ||
readme = "../../README.md" | ||
|
||
[lib] | ||
name = "anchor_gen" | ||
path = "src/lib.rs" | ||
proc-macro = true | ||
|
||
[dependencies] | ||
anchor-idl = { version = "0.2.0", path = "../crates/anchor-idl" } | ||
anchor-idl = { version = "0.2.0", path = "../anchor-idl" } | ||
serde_json = "1.0.81" | ||
anchor-syn = { version = "0.24.2", features = ["idl"] } | ||
syn = { version = "1", features = ["full"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters