schema.rs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. use std::{
  2. env::current_dir,
  3. fs::create_dir_all,
  4. };
  5. use cosmwasm_schema::{
  6. export_schema,
  7. export_schema_with_title,
  8. remove_schemas,
  9. schema_for,
  10. };
  11. use cw721::{
  12. AllNftInfoResponse,
  13. ApprovalResponse,
  14. ApprovalsResponse,
  15. ContractInfoResponse,
  16. NftInfoResponse,
  17. NumTokensResponse,
  18. OperatorsResponse,
  19. OwnerOfResponse,
  20. TokensResponse,
  21. };
  22. use cw721_base::{
  23. ExecuteMsg,
  24. Extension,
  25. InstantiateMsg,
  26. MinterResponse,
  27. QueryMsg,
  28. };
  29. fn main() {
  30. let mut out_dir = current_dir().unwrap();
  31. out_dir.push("schema");
  32. create_dir_all(&out_dir).unwrap();
  33. remove_schemas(&out_dir).unwrap();
  34. export_schema(&schema_for!(InstantiateMsg), &out_dir);
  35. export_schema_with_title(&schema_for!(ExecuteMsg<()>), &out_dir, "ExecuteMsg");
  36. export_schema(&schema_for!(QueryMsg), &out_dir);
  37. export_schema_with_title(
  38. &schema_for!(AllNftInfoResponse<Extension>),
  39. &out_dir,
  40. "AllNftInfoResponse",
  41. );
  42. export_schema(&schema_for!(ApprovalResponse), &out_dir);
  43. export_schema(&schema_for!(ApprovalsResponse), &out_dir);
  44. export_schema(&schema_for!(OperatorsResponse), &out_dir);
  45. export_schema(&schema_for!(ContractInfoResponse), &out_dir);
  46. export_schema(&schema_for!(MinterResponse), &out_dir);
  47. export_schema_with_title(
  48. &schema_for!(NftInfoResponse<Extension>),
  49. &out_dir,
  50. "NftInfoResponse",
  51. );
  52. export_schema(&schema_for!(NumTokensResponse), &out_dir);
  53. export_schema(&schema_for!(OwnerOfResponse), &out_dir);
  54. export_schema(&schema_for!(TokensResponse), &out_dir);
  55. }