Skip to content

Commit ec64cd6

Browse files
committed
Generate ts-client
1 parent 38d604a commit ec64cd6

File tree

15 files changed

+589
-500
lines changed

15 files changed

+589
-500
lines changed

ts-client/zigbeealliance.distributedcomplianceledger.compliance/module.ts

+44-44
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import { IgniteClient } from "../client"
88
import { MissingWalletError } from "../helpers"
99
import { Api } from "./rest";
1010
import { MsgUpdateComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
11-
import { MsgDeleteComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
1211
import { MsgCertifyModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
13-
import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
12+
import { MsgDeleteComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
1413
import { MsgProvisionModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
14+
import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
1515

1616
import { CertifiedModel as typeCertifiedModel} from "./types"
1717
import { ComplianceHistoryItem as typeComplianceHistoryItem} from "./types"
@@ -20,28 +20,22 @@ import { DeviceSoftwareCompliance as typeDeviceSoftwareCompliance} from "./types
2020
import { ProvisionalModel as typeProvisionalModel} from "./types"
2121
import { RevokedModel as typeRevokedModel} from "./types"
2222

23-
export { MsgUpdateComplianceInfo, MsgDeleteComplianceInfo, MsgCertifyModel, MsgRevokeModel, MsgProvisionModel };
23+
export { MsgUpdateComplianceInfo, MsgCertifyModel, MsgDeleteComplianceInfo, MsgProvisionModel, MsgRevokeModel };
2424

2525
type sendMsgUpdateComplianceInfoParams = {
2626
value: MsgUpdateComplianceInfo,
2727
fee?: StdFee,
2828
memo?: string
2929
};
3030

31-
type sendMsgDeleteComplianceInfoParams = {
32-
value: MsgDeleteComplianceInfo,
33-
fee?: StdFee,
34-
memo?: string
35-
};
36-
3731
type sendMsgCertifyModelParams = {
3832
value: MsgCertifyModel,
3933
fee?: StdFee,
4034
memo?: string
4135
};
4236

43-
type sendMsgRevokeModelParams = {
44-
value: MsgRevokeModel,
37+
type sendMsgDeleteComplianceInfoParams = {
38+
value: MsgDeleteComplianceInfo,
4539
fee?: StdFee,
4640
memo?: string
4741
};
@@ -52,27 +46,33 @@ type sendMsgProvisionModelParams = {
5246
memo?: string
5347
};
5448

49+
type sendMsgRevokeModelParams = {
50+
value: MsgRevokeModel,
51+
fee?: StdFee,
52+
memo?: string
53+
};
54+
5555

5656
type msgUpdateComplianceInfoParams = {
5757
value: MsgUpdateComplianceInfo,
5858
};
5959

60-
type msgDeleteComplianceInfoParams = {
61-
value: MsgDeleteComplianceInfo,
62-
};
63-
6460
type msgCertifyModelParams = {
6561
value: MsgCertifyModel,
6662
};
6763

68-
type msgRevokeModelParams = {
69-
value: MsgRevokeModel,
64+
type msgDeleteComplianceInfoParams = {
65+
value: MsgDeleteComplianceInfo,
7066
};
7167

7268
type msgProvisionModelParams = {
7369
value: MsgProvisionModel,
7470
};
7571

72+
type msgRevokeModelParams = {
73+
value: MsgRevokeModel,
74+
};
75+
7676

7777
export const registry = new Registry(msgTypes);
7878

@@ -117,59 +117,59 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
117117
}
118118
},
119119

120-
async sendMsgDeleteComplianceInfo({ value, fee, memo }: sendMsgDeleteComplianceInfoParams): Promise<DeliverTxResponse> {
120+
async sendMsgCertifyModel({ value, fee, memo }: sendMsgCertifyModelParams): Promise<DeliverTxResponse> {
121121
if (!signer) {
122-
throw new Error('TxClient:sendMsgDeleteComplianceInfo: Unable to sign Tx. Signer is not present.')
122+
throw new Error('TxClient:sendMsgCertifyModel: Unable to sign Tx. Signer is not present.')
123123
}
124124
try {
125125
const { address } = (await signer.getAccounts())[0];
126126
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
127-
let msg = this.msgDeleteComplianceInfo({ value: MsgDeleteComplianceInfo.fromPartial(value) })
127+
let msg = this.msgCertifyModel({ value: MsgCertifyModel.fromPartial(value) })
128128
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
129129
} catch (e: any) {
130-
throw new Error('TxClient:sendMsgDeleteComplianceInfo: Could not broadcast Tx: '+ e.message)
130+
throw new Error('TxClient:sendMsgCertifyModel: Could not broadcast Tx: '+ e.message)
131131
}
132132
},
133133

134-
async sendMsgCertifyModel({ value, fee, memo }: sendMsgCertifyModelParams): Promise<DeliverTxResponse> {
134+
async sendMsgDeleteComplianceInfo({ value, fee, memo }: sendMsgDeleteComplianceInfoParams): Promise<DeliverTxResponse> {
135135
if (!signer) {
136-
throw new Error('TxClient:sendMsgCertifyModel: Unable to sign Tx. Signer is not present.')
136+
throw new Error('TxClient:sendMsgDeleteComplianceInfo: Unable to sign Tx. Signer is not present.')
137137
}
138138
try {
139139
const { address } = (await signer.getAccounts())[0];
140140
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
141-
let msg = this.msgCertifyModel({ value: MsgCertifyModel.fromPartial(value) })
141+
let msg = this.msgDeleteComplianceInfo({ value: MsgDeleteComplianceInfo.fromPartial(value) })
142142
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
143143
} catch (e: any) {
144-
throw new Error('TxClient:sendMsgCertifyModel: Could not broadcast Tx: '+ e.message)
144+
throw new Error('TxClient:sendMsgDeleteComplianceInfo: Could not broadcast Tx: '+ e.message)
145145
}
146146
},
147147

148-
async sendMsgRevokeModel({ value, fee, memo }: sendMsgRevokeModelParams): Promise<DeliverTxResponse> {
148+
async sendMsgProvisionModel({ value, fee, memo }: sendMsgProvisionModelParams): Promise<DeliverTxResponse> {
149149
if (!signer) {
150-
throw new Error('TxClient:sendMsgRevokeModel: Unable to sign Tx. Signer is not present.')
150+
throw new Error('TxClient:sendMsgProvisionModel: Unable to sign Tx. Signer is not present.')
151151
}
152152
try {
153153
const { address } = (await signer.getAccounts())[0];
154154
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
155-
let msg = this.msgRevokeModel({ value: MsgRevokeModel.fromPartial(value) })
155+
let msg = this.msgProvisionModel({ value: MsgProvisionModel.fromPartial(value) })
156156
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
157157
} catch (e: any) {
158-
throw new Error('TxClient:sendMsgRevokeModel: Could not broadcast Tx: '+ e.message)
158+
throw new Error('TxClient:sendMsgProvisionModel: Could not broadcast Tx: '+ e.message)
159159
}
160160
},
161161

162-
async sendMsgProvisionModel({ value, fee, memo }: sendMsgProvisionModelParams): Promise<DeliverTxResponse> {
162+
async sendMsgRevokeModel({ value, fee, memo }: sendMsgRevokeModelParams): Promise<DeliverTxResponse> {
163163
if (!signer) {
164-
throw new Error('TxClient:sendMsgProvisionModel: Unable to sign Tx. Signer is not present.')
164+
throw new Error('TxClient:sendMsgRevokeModel: Unable to sign Tx. Signer is not present.')
165165
}
166166
try {
167167
const { address } = (await signer.getAccounts())[0];
168168
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix});
169-
let msg = this.msgProvisionModel({ value: MsgProvisionModel.fromPartial(value) })
169+
let msg = this.msgRevokeModel({ value: MsgRevokeModel.fromPartial(value) })
170170
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
171171
} catch (e: any) {
172-
throw new Error('TxClient:sendMsgProvisionModel: Could not broadcast Tx: '+ e.message)
172+
throw new Error('TxClient:sendMsgRevokeModel: Could not broadcast Tx: '+ e.message)
173173
}
174174
},
175175

@@ -182,14 +182,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
182182
}
183183
},
184184

185-
msgDeleteComplianceInfo({ value }: msgDeleteComplianceInfoParams): EncodeObject {
186-
try {
187-
return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgDeleteComplianceInfo", value: MsgDeleteComplianceInfo.fromPartial( value ) }
188-
} catch (e: any) {
189-
throw new Error('TxClient:MsgDeleteComplianceInfo: Could not create message: ' + e.message)
190-
}
191-
},
192-
193185
msgCertifyModel({ value }: msgCertifyModelParams): EncodeObject {
194186
try {
195187
return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgCertifyModel", value: MsgCertifyModel.fromPartial( value ) }
@@ -198,11 +190,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
198190
}
199191
},
200192

201-
msgRevokeModel({ value }: msgRevokeModelParams): EncodeObject {
193+
msgDeleteComplianceInfo({ value }: msgDeleteComplianceInfoParams): EncodeObject {
202194
try {
203-
return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel", value: MsgRevokeModel.fromPartial( value ) }
195+
return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgDeleteComplianceInfo", value: MsgDeleteComplianceInfo.fromPartial( value ) }
204196
} catch (e: any) {
205-
throw new Error('TxClient:MsgRevokeModel: Could not create message: ' + e.message)
197+
throw new Error('TxClient:MsgDeleteComplianceInfo: Could not create message: ' + e.message)
206198
}
207199
},
208200

@@ -214,6 +206,14 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
214206
}
215207
},
216208

209+
msgRevokeModel({ value }: msgRevokeModelParams): EncodeObject {
210+
try {
211+
return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel", value: MsgRevokeModel.fromPartial( value ) }
212+
} catch (e: any) {
213+
throw new Error('TxClient:MsgRevokeModel: Could not create message: ' + e.message)
214+
}
215+
},
216+
217217
}
218218
};
219219

ts-client/zigbeealliance.distributedcomplianceledger.compliance/registry.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { GeneratedType } from "@cosmjs/proto-signing";
22
import { MsgUpdateComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
3-
import { MsgDeleteComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
43
import { MsgCertifyModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
5-
import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
4+
import { MsgDeleteComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
65
import { MsgProvisionModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
6+
import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx";
77

88
const msgTypes: Array<[string, GeneratedType]> = [
99
["/zigbeealliance.distributedcomplianceledger.compliance.MsgUpdateComplianceInfo", MsgUpdateComplianceInfo],
10-
["/zigbeealliance.distributedcomplianceledger.compliance.MsgDeleteComplianceInfo", MsgDeleteComplianceInfo],
1110
["/zigbeealliance.distributedcomplianceledger.compliance.MsgCertifyModel", MsgCertifyModel],
12-
["/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel", MsgRevokeModel],
11+
["/zigbeealliance.distributedcomplianceledger.compliance.MsgDeleteComplianceInfo", MsgDeleteComplianceInfo],
1312
["/zigbeealliance.distributedcomplianceledger.compliance.MsgProvisionModel", MsgProvisionModel],
13+
["/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel", MsgRevokeModel],
1414

1515
];
1616

0 commit comments

Comments
 (0)