From c8658747200e391590cdc5b41b4d9742daef6c79 Mon Sep 17 00:00:00 2001 From: srdtrk Date: Wed, 14 Feb 2024 17:14:49 -0500 Subject: [PATCH 1/2] docs: imp readme --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 5a16b8a..f34bd9e 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,16 @@ Generate Go code for your CosmWasm smart contracts. The quickest way to generate Go code for your CosmWasm smart contracts. Currently, this tool only supports generating the types needed to interact with the smart contract. Support for a gRPC query client and a gRPC transaction client is planned. + +## Usage + +In order to generate Go code for your CosmWasm smart contract, you need to have its full API exported as a JSON file +using [`cosmwasm-schema`](https://crates.io/crates/cosmwasm-schema). +Once you have the JSON file, you can use it to generate the Go code. + +```sh +go-codegen generate /path/to/contract-api.json --output /path/to/output --package-name mypackage +``` + +This will generate the Go code in the specified optional output directory, if not specified, it will generate the code in `output.go` in the current directory. +Package name is also optional, if not specified, it will use the name of the contract. From 2ae856cebd4734290aee39974ddd49973e9e07bb Mon Sep 17 00:00:00 2001 From: srdtrk Date: Wed, 14 Feb 2024 17:32:35 -0500 Subject: [PATCH 2/2] docs: added acks --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index f34bd9e..16bb39e 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,8 @@ go-codegen generate /path/to/contract-api.json --output /path/to/output --packag This will generate the Go code in the specified optional output directory, if not specified, it will generate the code in `output.go` in the current directory. Package name is also optional, if not specified, it will use the name of the contract. + +## Acknowledgements + +The Go Gopher mascot was created by [Renee French](https://reneefrench.blogspot.com/) and is licensed under the [Creative Commons 4.0 Attribution License](https://creativecommons.org/licenses/by/4.0/). +I've modified the original image to include the logo of [`ts-codegen`](https://github.com/CosmWasm/ts-codegen).