Skip to content

Commit fa5dff0

Browse files
authored
Merge pull request #3 from mayoreee/feat/schema
feat: Support CosmWasm v1.1 schema and response types
2 parents 4859610 + a460fd3 commit fa5dff0

41 files changed

Lines changed: 2074 additions & 440 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,29 @@ cd contracts/sg721/
404404
cargo schema
405405
```
406406
### Exporting Schemas
407-
#### `cosmwasm_std` Examples
407+
408+
#### `cosmwasm v1.1` Example
409+
410+
Using the new `write_api` method, you can export schemas:
411+
412+
```rs
413+
use cosmwasm_schema::write_api;
414+
415+
pub use cw4::{AdminResponse, MemberListResponse, MemberResponse, TotalWeightResponse};
416+
pub use cw4_group::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};
417+
418+
fn main() {
419+
write_api! {
420+
instantiate: InstantiateMsg,
421+
execute: ExecuteMsg,
422+
query: QueryMsg,
423+
}
424+
}
425+
```
426+
427+
#### `cosmwasm_std` Example
428+
429+
Here is a legacy example:
408430

409431
```rs
410432
use cosmwasm_std::{Addr, CosmosMsg, Empty};

0 commit comments

Comments
 (0)