Skip to content

Commit b5d8d50

Browse files
committed
fix for raw/
1 parent e18a551 commit b5d8d50

File tree

9 files changed

+651
-1
lines changed

9 files changed

+651
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"contract_name": "something-in-raw-folder"
3+
}
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
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 { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate";
8+
import { StdFee } from "@cosmjs/amino";
9+
import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types";
10+
export interface 98ReadOnlyInterface {
11+
contractAddress: string;
12+
getConfig: () => Promise<ConfigResponse>;
13+
getPlugins: ({
14+
limit,
15+
startAfter
16+
}: {
17+
limit?: number;
18+
startAfter?: number;
19+
}) => Promise<PluginsResponse>;
20+
getPluginById: ({
21+
id
22+
}: {
23+
id: number;
24+
}) => Promise<NullablePlugin>;
25+
}
26+
export class 98QueryClient implements 98ReadOnlyInterface {
27+
client: CosmWasmClient;
28+
contractAddress: string;
29+
30+
constructor(client: CosmWasmClient, contractAddress: string) {
31+
this.client = client;
32+
this.contractAddress = contractAddress;
33+
this.getConfig = this.getConfig.bind(this);
34+
this.getPlugins = this.getPlugins.bind(this);
35+
this.getPluginById = this.getPluginById.bind(this);
36+
}
37+
38+
getConfig = async (): Promise<ConfigResponse> => {
39+
return this.client.queryContractSmart(this.contractAddress, {
40+
get_config: {}
41+
});
42+
};
43+
getPlugins = async ({
44+
limit,
45+
startAfter
46+
}: {
47+
limit?: number;
48+
startAfter?: number;
49+
}): Promise<PluginsResponse> => {
50+
return this.client.queryContractSmart(this.contractAddress, {
51+
get_plugins: {
52+
limit,
53+
start_after: startAfter
54+
}
55+
});
56+
};
57+
getPluginById = async ({
58+
id
59+
}: {
60+
id: number;
61+
}): Promise<NullablePlugin> => {
62+
return this.client.queryContractSmart(this.contractAddress, {
63+
get_plugin_by_id: {
64+
id
65+
}
66+
});
67+
};
68+
}
69+
export interface 98Interface extends 98ReadOnlyInterface {
70+
contractAddress: string;
71+
sender: string;
72+
proxyInstallPlugin: ({
73+
id,
74+
instantiateMsg
75+
}: {
76+
id: number;
77+
instantiateMsg: Binary;
78+
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
79+
registerPlugin: ({
80+
checksum,
81+
codeId,
82+
creator,
83+
ipfsHash,
84+
name,
85+
version
86+
}: {
87+
checksum: string;
88+
codeId: number;
89+
creator: string;
90+
ipfsHash: string;
91+
name: string;
92+
version: string;
93+
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
94+
unregisterPlugin: ({
95+
id
96+
}: {
97+
id: number;
98+
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
99+
updatePlugin: ({
100+
checksum,
101+
codeId,
102+
creator,
103+
id,
104+
ipfsHash,
105+
name,
106+
version
107+
}: {
108+
checksum?: string;
109+
codeId?: number;
110+
creator?: string;
111+
id: number;
112+
ipfsHash?: string;
113+
name?: string;
114+
version?: string;
115+
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
116+
updateRegistryFee: ({
117+
newFee
118+
}: {
119+
newFee: Coin;
120+
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
121+
updateDaoAddr: ({
122+
newAddr
123+
}: {
124+
newAddr: string;
125+
}, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
126+
}
127+
export class 98Client extends 98QueryClient implements 98Interface {
128+
client: SigningCosmWasmClient;
129+
sender: string;
130+
contractAddress: string;
131+
132+
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
133+
super(client, contractAddress);
134+
this.client = client;
135+
this.sender = sender;
136+
this.contractAddress = contractAddress;
137+
this.proxyInstallPlugin = this.proxyInstallPlugin.bind(this);
138+
this.registerPlugin = this.registerPlugin.bind(this);
139+
this.unregisterPlugin = this.unregisterPlugin.bind(this);
140+
this.updatePlugin = this.updatePlugin.bind(this);
141+
this.updateRegistryFee = this.updateRegistryFee.bind(this);
142+
this.updateDaoAddr = this.updateDaoAddr.bind(this);
143+
}
144+
145+
proxyInstallPlugin = async ({
146+
id,
147+
instantiateMsg
148+
}: {
149+
id: number;
150+
instantiateMsg: Binary;
151+
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
152+
return await this.client.execute(this.sender, this.contractAddress, {
153+
proxy_install_plugin: {
154+
id,
155+
instantiate_msg: instantiateMsg
156+
}
157+
}, fee, memo, funds);
158+
};
159+
registerPlugin = async ({
160+
checksum,
161+
codeId,
162+
creator,
163+
ipfsHash,
164+
name,
165+
version
166+
}: {
167+
checksum: string;
168+
codeId: number;
169+
creator: string;
170+
ipfsHash: string;
171+
name: string;
172+
version: string;
173+
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
174+
return await this.client.execute(this.sender, this.contractAddress, {
175+
register_plugin: {
176+
checksum,
177+
code_id: codeId,
178+
creator,
179+
ipfs_hash: ipfsHash,
180+
name,
181+
version
182+
}
183+
}, fee, memo, funds);
184+
};
185+
unregisterPlugin = async ({
186+
id
187+
}: {
188+
id: number;
189+
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
190+
return await this.client.execute(this.sender, this.contractAddress, {
191+
unregister_plugin: {
192+
id
193+
}
194+
}, fee, memo, funds);
195+
};
196+
updatePlugin = async ({
197+
checksum,
198+
codeId,
199+
creator,
200+
id,
201+
ipfsHash,
202+
name,
203+
version
204+
}: {
205+
checksum?: string;
206+
codeId?: number;
207+
creator?: string;
208+
id: number;
209+
ipfsHash?: string;
210+
name?: string;
211+
version?: string;
212+
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
213+
return await this.client.execute(this.sender, this.contractAddress, {
214+
update_plugin: {
215+
checksum,
216+
code_id: codeId,
217+
creator,
218+
id,
219+
ipfs_hash: ipfsHash,
220+
name,
221+
version
222+
}
223+
}, fee, memo, funds);
224+
};
225+
updateRegistryFee = async ({
226+
newFee
227+
}: {
228+
newFee: Coin;
229+
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
230+
return await this.client.execute(this.sender, this.contractAddress, {
231+
update_registry_fee: {
232+
new_fee: newFee
233+
}
234+
}, fee, memo, funds);
235+
};
236+
updateDaoAddr = async ({
237+
newAddr
238+
}: {
239+
newAddr: string;
240+
}, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
241+
return await this.client.execute(this.sender, this.contractAddress, {
242+
update_dao_addr: {
243+
new_addr: newAddr
244+
}
245+
}, fee, memo, funds);
246+
};
247+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 { UseQueryOptions, useQuery } from "react-query";
8+
import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types";
9+
import { 98QueryClient } from "./98.client";
10+
export interface 98ReactQuery<TResponse, TData = TResponse> {
11+
client: 98QueryClient;
12+
options?: UseQueryOptions<TResponse, Error, TData>;
13+
}
14+
export interface 98GetPluginByIdQuery<TData> extends 98ReactQuery<NullablePlugin, TData> {
15+
args: {
16+
id: number;
17+
};
18+
}
19+
export function use98GetPluginByIdQuery<TData = NullablePlugin>({
20+
client,
21+
args,
22+
options
23+
}: 98GetPluginByIdQuery<TData>) {
24+
return useQuery<NullablePlugin, Error, TData>(["98GetPluginById", client.contractAddress, JSON.stringify(args)], () => client.getPluginById({
25+
id: args.id
26+
}), options);
27+
}
28+
export interface 98GetPluginsQuery<TData> extends 98ReactQuery<PluginsResponse, TData> {
29+
args: {
30+
limit?: number;
31+
startAfter?: number;
32+
};
33+
}
34+
export function use98GetPluginsQuery<TData = PluginsResponse>({
35+
client,
36+
args,
37+
options
38+
}: 98GetPluginsQuery<TData>) {
39+
return useQuery<PluginsResponse, Error, TData>(["98GetPlugins", client.contractAddress, JSON.stringify(args)], () => client.getPlugins({
40+
limit: args.limit,
41+
startAfter: args.startAfter
42+
}), options);
43+
}
44+
export interface 98GetConfigQuery<TData> extends 98ReactQuery<ConfigResponse, TData> {}
45+
export function use98GetConfigQuery<TData = ConfigResponse>({
46+
client,
47+
options
48+
}: 98GetConfigQuery<TData>) {
49+
return useQuery<ConfigResponse, Error, TData>(["98GetConfig", client.contractAddress], () => client.getConfig(), options);
50+
}

0 commit comments

Comments
 (0)