Skip to content

Commit 2fdb153

Browse files
committed
cleanup
1 parent 5d2a54e commit 2fdb153

33 files changed

+1310
-39
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,15 @@ cosmwasm-ts-codegen generate \
263263

264264
### Message Builder
265265

266-
Generate raw message jsons for use in your application with the `msg-builder` command.
266+
Generate raw message jsons for use in your application with the `message-builder` command.
267267

268268
[see example output code](https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26)
269269

270270
#### Message Builder via CLI
271271

272272
```sh
273273
cosmwasm-ts-codegen generate \
274-
--plugin msg-builder \
274+
--plugin message-builder \
275275
--schema ./schema \
276276
--out ./ts \
277277
--name MyContractName
@@ -527,7 +527,7 @@ https://gist.github.com/pyramation/a9520ccf131177b1841e02a97d7d3731
527527

528528
https://gist.github.com/pyramation/43320e8b952751a0bd5a77dbc5b601f4
529529

530-
- `cosmwasm-ts-codegen generate --plugin msg-builder`
530+
- `cosmwasm-ts-codegen generate --plugin message-builder`
531531

532532
https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26
533533

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* This file was automatically generated by @cosmwasm/ts-codegen@latest.
3+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
5+
*/
6+
7+
import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types";
8+
import { CamelCasedProperties } from "type-fest";
9+
export abstract class CwAdminFactoryExecuteMessageBuilder {
10+
static instantiateContractWithSelfAdmin = ({
11+
codeId,
12+
instantiateMsg,
13+
label
14+
}: CamelCasedProperties<Extract<ExecuteMsg, {
15+
instantiate_contract_with_self_admin: unknown;
16+
}>["instantiate_contract_with_self_admin"]>): ExecuteMsg => {
17+
return {
18+
instantiate_contract_with_self_admin: ({
19+
code_id: codeId,
20+
instantiate_msg: instantiateMsg,
21+
label
22+
} as const)
23+
};
24+
};
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/**
2+
* This file was automatically generated by @cosmwasm/ts-codegen@latest.
3+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
5+
*/
6+
7+
import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types";
8+
import { CamelCasedProperties } from "type-fest";
9+
export abstract class CwCodeIdRegistryExecuteMessageBuilder {
10+
static receive = ({
11+
amount,
12+
msg,
13+
sender
14+
}: CamelCasedProperties<Extract<ExecuteMsg, {
15+
receive: unknown;
16+
}>["receive"]>): ExecuteMsg => {
17+
return {
18+
receive: ({
19+
amount,
20+
msg,
21+
sender
22+
} as const)
23+
};
24+
};
25+
static register = ({
26+
chainId,
27+
checksum,
28+
codeId,
29+
name,
30+
version
31+
}: CamelCasedProperties<Extract<ExecuteMsg, {
32+
register: unknown;
33+
}>["register"]>): ExecuteMsg => {
34+
return {
35+
register: ({
36+
chain_id: chainId,
37+
checksum,
38+
code_id: codeId,
39+
name,
40+
version
41+
} as const)
42+
};
43+
};
44+
static setOwner = ({
45+
chainId,
46+
name,
47+
owner
48+
}: CamelCasedProperties<Extract<ExecuteMsg, {
49+
set_owner: unknown;
50+
}>["set_owner"]>): ExecuteMsg => {
51+
return {
52+
set_owner: ({
53+
chain_id: chainId,
54+
name,
55+
owner
56+
} as const)
57+
};
58+
};
59+
static unregister = ({
60+
chainId,
61+
codeId
62+
}: CamelCasedProperties<Extract<ExecuteMsg, {
63+
unregister: unknown;
64+
}>["unregister"]>): ExecuteMsg => {
65+
return {
66+
unregister: ({
67+
chain_id: chainId,
68+
code_id: codeId
69+
} as const)
70+
};
71+
};
72+
static updateConfig = ({
73+
admin,
74+
paymentInfo
75+
}: CamelCasedProperties<Extract<ExecuteMsg, {
76+
update_config: unknown;
77+
}>["update_config"]>): ExecuteMsg => {
78+
return {
79+
update_config: ({
80+
admin,
81+
payment_info: paymentInfo
82+
} as const)
83+
};
84+
};
85+
}
86+
export abstract class CwCodeIdRegistryQueryMessageBuilder {
87+
static config = (): QueryMsg => {
88+
return {
89+
config: ({} as const)
90+
};
91+
};
92+
static getRegistration = ({
93+
chainId,
94+
name,
95+
version
96+
}: CamelCasedProperties<Extract<QueryMsg, {
97+
get_registration: unknown;
98+
}>["get_registration"]>): QueryMsg => {
99+
return {
100+
get_registration: ({
101+
chain_id: chainId,
102+
name,
103+
version
104+
} as const)
105+
};
106+
};
107+
static infoForCodeId = ({
108+
chainId,
109+
codeId
110+
}: CamelCasedProperties<Extract<QueryMsg, {
111+
info_for_code_id: unknown;
112+
}>["info_for_code_id"]>): QueryMsg => {
113+
return {
114+
info_for_code_id: ({
115+
chain_id: chainId,
116+
code_id: codeId
117+
} as const)
118+
};
119+
};
120+
static listRegistrations = ({
121+
chainId,
122+
name
123+
}: CamelCasedProperties<Extract<QueryMsg, {
124+
list_registrations: unknown;
125+
}>["list_registrations"]>): QueryMsg => {
126+
return {
127+
list_registrations: ({
128+
chain_id: chainId,
129+
name
130+
} as const)
131+
};
132+
};
133+
}

0 commit comments

Comments
 (0)