@@ -8,10 +8,10 @@ import { IgniteClient } from "../client"
8
8
import { MissingWalletError } from "../helpers"
9
9
import { Api } from "./rest" ;
10
10
import { MsgUpdateComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx" ;
11
- import { MsgDeleteComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx" ;
12
11
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" ;
14
13
import { MsgProvisionModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx" ;
14
+ import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx" ;
15
15
16
16
import { CertifiedModel as typeCertifiedModel } from "./types"
17
17
import { ComplianceHistoryItem as typeComplianceHistoryItem } from "./types"
@@ -20,28 +20,22 @@ import { DeviceSoftwareCompliance as typeDeviceSoftwareCompliance} from "./types
20
20
import { ProvisionalModel as typeProvisionalModel } from "./types"
21
21
import { RevokedModel as typeRevokedModel } from "./types"
22
22
23
- export { MsgUpdateComplianceInfo , MsgDeleteComplianceInfo , MsgCertifyModel , MsgRevokeModel , MsgProvisionModel } ;
23
+ export { MsgUpdateComplianceInfo , MsgCertifyModel , MsgDeleteComplianceInfo , MsgProvisionModel , MsgRevokeModel } ;
24
24
25
25
type sendMsgUpdateComplianceInfoParams = {
26
26
value : MsgUpdateComplianceInfo ,
27
27
fee ?: StdFee ,
28
28
memo ?: string
29
29
} ;
30
30
31
- type sendMsgDeleteComplianceInfoParams = {
32
- value : MsgDeleteComplianceInfo ,
33
- fee ?: StdFee ,
34
- memo ?: string
35
- } ;
36
-
37
31
type sendMsgCertifyModelParams = {
38
32
value : MsgCertifyModel ,
39
33
fee ?: StdFee ,
40
34
memo ?: string
41
35
} ;
42
36
43
- type sendMsgRevokeModelParams = {
44
- value : MsgRevokeModel ,
37
+ type sendMsgDeleteComplianceInfoParams = {
38
+ value : MsgDeleteComplianceInfo ,
45
39
fee ?: StdFee ,
46
40
memo ?: string
47
41
} ;
@@ -52,27 +46,33 @@ type sendMsgProvisionModelParams = {
52
46
memo ?: string
53
47
} ;
54
48
49
+ type sendMsgRevokeModelParams = {
50
+ value : MsgRevokeModel ,
51
+ fee ?: StdFee ,
52
+ memo ?: string
53
+ } ;
54
+
55
55
56
56
type msgUpdateComplianceInfoParams = {
57
57
value : MsgUpdateComplianceInfo ,
58
58
} ;
59
59
60
- type msgDeleteComplianceInfoParams = {
61
- value : MsgDeleteComplianceInfo ,
62
- } ;
63
-
64
60
type msgCertifyModelParams = {
65
61
value : MsgCertifyModel ,
66
62
} ;
67
63
68
- type msgRevokeModelParams = {
69
- value : MsgRevokeModel ,
64
+ type msgDeleteComplianceInfoParams = {
65
+ value : MsgDeleteComplianceInfo ,
70
66
} ;
71
67
72
68
type msgProvisionModelParams = {
73
69
value : MsgProvisionModel ,
74
70
} ;
75
71
72
+ type msgRevokeModelParams = {
73
+ value : MsgRevokeModel ,
74
+ } ;
75
+
76
76
77
77
export const registry = new Registry ( msgTypes ) ;
78
78
@@ -117,59 +117,59 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
117
117
}
118
118
} ,
119
119
120
- async sendMsgDeleteComplianceInfo ( { value, fee, memo } : sendMsgDeleteComplianceInfoParams ) : Promise < DeliverTxResponse > {
120
+ async sendMsgCertifyModel ( { value, fee, memo } : sendMsgCertifyModelParams ) : Promise < DeliverTxResponse > {
121
121
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.' )
123
123
}
124
124
try {
125
125
const { address } = ( await signer . getAccounts ( ) ) [ 0 ] ;
126
126
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 ) } )
128
128
return await signingClient . signAndBroadcast ( address , [ msg ] , fee ? fee : defaultFee , memo )
129
129
} 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 )
131
131
}
132
132
} ,
133
133
134
- async sendMsgCertifyModel ( { value, fee, memo } : sendMsgCertifyModelParams ) : Promise < DeliverTxResponse > {
134
+ async sendMsgDeleteComplianceInfo ( { value, fee, memo } : sendMsgDeleteComplianceInfoParams ) : Promise < DeliverTxResponse > {
135
135
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.' )
137
137
}
138
138
try {
139
139
const { address } = ( await signer . getAccounts ( ) ) [ 0 ] ;
140
140
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 ) } )
142
142
return await signingClient . signAndBroadcast ( address , [ msg ] , fee ? fee : defaultFee , memo )
143
143
} 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 )
145
145
}
146
146
} ,
147
147
148
- async sendMsgRevokeModel ( { value, fee, memo } : sendMsgRevokeModelParams ) : Promise < DeliverTxResponse > {
148
+ async sendMsgProvisionModel ( { value, fee, memo } : sendMsgProvisionModelParams ) : Promise < DeliverTxResponse > {
149
149
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.' )
151
151
}
152
152
try {
153
153
const { address } = ( await signer . getAccounts ( ) ) [ 0 ] ;
154
154
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 ) } )
156
156
return await signingClient . signAndBroadcast ( address , [ msg ] , fee ? fee : defaultFee , memo )
157
157
} 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 )
159
159
}
160
160
} ,
161
161
162
- async sendMsgProvisionModel ( { value, fee, memo } : sendMsgProvisionModelParams ) : Promise < DeliverTxResponse > {
162
+ async sendMsgRevokeModel ( { value, fee, memo } : sendMsgRevokeModelParams ) : Promise < DeliverTxResponse > {
163
163
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.' )
165
165
}
166
166
try {
167
167
const { address } = ( await signer . getAccounts ( ) ) [ 0 ] ;
168
168
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 ) } )
170
170
return await signingClient . signAndBroadcast ( address , [ msg ] , fee ? fee : defaultFee , memo )
171
171
} 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 )
173
173
}
174
174
} ,
175
175
@@ -182,14 +182,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
182
182
}
183
183
} ,
184
184
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
-
193
185
msgCertifyModel ( { value } : msgCertifyModelParams ) : EncodeObject {
194
186
try {
195
187
return { typeUrl : "/zigbeealliance.distributedcomplianceledger.compliance.MsgCertifyModel" , value : MsgCertifyModel . fromPartial ( value ) }
@@ -198,11 +190,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
198
190
}
199
191
} ,
200
192
201
- msgRevokeModel ( { value } : msgRevokeModelParams ) : EncodeObject {
193
+ msgDeleteComplianceInfo ( { value } : msgDeleteComplianceInfoParams ) : EncodeObject {
202
194
try {
203
- return { typeUrl : "/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel " , value : MsgRevokeModel . fromPartial ( value ) }
195
+ return { typeUrl : "/zigbeealliance.distributedcomplianceledger.compliance.MsgDeleteComplianceInfo " , value : MsgDeleteComplianceInfo . fromPartial ( value ) }
204
196
} 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 )
206
198
}
207
199
} ,
208
200
@@ -214,6 +206,14 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht
214
206
}
215
207
} ,
216
208
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
+
217
217
}
218
218
} ;
219
219
0 commit comments