@sparkdreamnft/sparkdreamjs 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,84 +1,117 @@
1
1
  //@ts-nocheck
2
- import { MsgUpdateParams, MsgUpdateOperationalParams, MsgCreatePost, MsgUpdatePost, MsgDeletePost, MsgHidePost, MsgUnhidePost, MsgCreateReply, MsgUpdateReply, MsgDeleteReply, MsgHideReply, MsgUnhideReply, MsgReact, MsgRemoveReaction, MsgPinPost, MsgPinReply } from "./tx";
2
+ // HAND-WRITTEN OVERRIDE overlaid by scripts/codegen.ts after telescope.
3
+ // See ../../commons/v1/tx.amino.ts for the broader rationale.
4
+ //
5
+ // Telescope emits `[]` for empty repeated fields; aminojson on the chain omits
6
+ // them. The only repeated fields in blog are `tags` on MsgCreatePost and
7
+ // MsgUpdatePost — posts without tags would sign different bytes than the chain
8
+ // reconstructs, surfacing as "signature verification failed".
9
+ import { MsgUpdateParams, MsgUpdateOperationalParams, MsgCreatePost, MsgUpdatePost, MsgDeletePost, MsgHidePost, MsgUnhidePost, MsgCreateReply, MsgUpdateReply, MsgDeleteReply, MsgHideReply, MsgUnhideReply, MsgReact, MsgRemoveReaction, MsgPinPost, MsgPinReply, } from "./tx";
3
10
  export const AminoConverter = {
4
11
  "/sparkdream.blog.v1.MsgUpdateParams": {
5
12
  aminoType: "sparkdream/x/blog/MsgUpdateParams",
6
13
  toAmino: MsgUpdateParams.toAmino,
7
- fromAmino: MsgUpdateParams.fromAmino
14
+ fromAmino: MsgUpdateParams.fromAmino,
8
15
  },
9
16
  "/sparkdream.blog.v1.MsgUpdateOperationalParams": {
10
17
  aminoType: "sparkdream/x/blog/MsgUpdateOperationalParams",
11
18
  toAmino: MsgUpdateOperationalParams.toAmino,
12
- fromAmino: MsgUpdateOperationalParams.fromAmino
19
+ fromAmino: MsgUpdateOperationalParams.fromAmino,
13
20
  },
14
21
  "/sparkdream.blog.v1.MsgCreatePost": {
15
22
  aminoType: "sparkdream/x/blog/MsgCreatePost",
16
- toAmino: MsgCreatePost.toAmino,
17
- fromAmino: MsgCreatePost.fromAmino
23
+ toAmino(message) {
24
+ const obj = {};
25
+ obj.creator = message.creator === "" ? undefined : message.creator;
26
+ obj.title = message.title === "" ? undefined : message.title;
27
+ obj.body = message.body === "" ? undefined : message.body;
28
+ obj.content_type = message.contentType === 0 ? undefined : message.contentType;
29
+ obj.min_reply_trust_level = message.minReplyTrustLevel === 0 ? undefined : message.minReplyTrustLevel;
30
+ obj.author_bond = message.authorBond === null ? undefined : message.authorBond;
31
+ obj.initiative_id = message.initiativeId !== BigInt(0) ? message.initiativeId?.toString() : undefined;
32
+ obj.tags = (message.tags?.length ?? 0) > 0
33
+ ? message.tags.map((e) => e)
34
+ : undefined;
35
+ return obj;
36
+ },
37
+ fromAmino: MsgCreatePost.fromAmino,
18
38
  },
19
39
  "/sparkdream.blog.v1.MsgUpdatePost": {
20
40
  aminoType: "sparkdream/x/blog/MsgUpdatePost",
21
- toAmino: MsgUpdatePost.toAmino,
22
- fromAmino: MsgUpdatePost.fromAmino
41
+ toAmino(message) {
42
+ const obj = {};
43
+ obj.creator = message.creator === "" ? undefined : message.creator;
44
+ obj.title = message.title === "" ? undefined : message.title;
45
+ obj.body = message.body === "" ? undefined : message.body;
46
+ obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined;
47
+ obj.content_type = message.contentType === 0 ? undefined : message.contentType;
48
+ obj.replies_enabled = message.repliesEnabled === false ? undefined : message.repliesEnabled;
49
+ obj.min_reply_trust_level = message.minReplyTrustLevel === 0 ? undefined : message.minReplyTrustLevel;
50
+ obj.tags = (message.tags?.length ?? 0) > 0
51
+ ? message.tags.map((e) => e)
52
+ : undefined;
53
+ return obj;
54
+ },
55
+ fromAmino: MsgUpdatePost.fromAmino,
23
56
  },
24
57
  "/sparkdream.blog.v1.MsgDeletePost": {
25
58
  aminoType: "sparkdream/x/blog/MsgDeletePost",
26
59
  toAmino: MsgDeletePost.toAmino,
27
- fromAmino: MsgDeletePost.fromAmino
60
+ fromAmino: MsgDeletePost.fromAmino,
28
61
  },
29
62
  "/sparkdream.blog.v1.MsgHidePost": {
30
63
  aminoType: "sparkdream/x/blog/MsgHidePost",
31
64
  toAmino: MsgHidePost.toAmino,
32
- fromAmino: MsgHidePost.fromAmino
65
+ fromAmino: MsgHidePost.fromAmino,
33
66
  },
34
67
  "/sparkdream.blog.v1.MsgUnhidePost": {
35
68
  aminoType: "sparkdream/x/blog/MsgUnhidePost",
36
69
  toAmino: MsgUnhidePost.toAmino,
37
- fromAmino: MsgUnhidePost.fromAmino
70
+ fromAmino: MsgUnhidePost.fromAmino,
38
71
  },
39
72
  "/sparkdream.blog.v1.MsgCreateReply": {
40
73
  aminoType: "sparkdream/x/blog/MsgCreateReply",
41
74
  toAmino: MsgCreateReply.toAmino,
42
- fromAmino: MsgCreateReply.fromAmino
75
+ fromAmino: MsgCreateReply.fromAmino,
43
76
  },
44
77
  "/sparkdream.blog.v1.MsgUpdateReply": {
45
78
  aminoType: "sparkdream/x/blog/MsgUpdateReply",
46
79
  toAmino: MsgUpdateReply.toAmino,
47
- fromAmino: MsgUpdateReply.fromAmino
80
+ fromAmino: MsgUpdateReply.fromAmino,
48
81
  },
49
82
  "/sparkdream.blog.v1.MsgDeleteReply": {
50
83
  aminoType: "sparkdream/x/blog/MsgDeleteReply",
51
84
  toAmino: MsgDeleteReply.toAmino,
52
- fromAmino: MsgDeleteReply.fromAmino
85
+ fromAmino: MsgDeleteReply.fromAmino,
53
86
  },
54
87
  "/sparkdream.blog.v1.MsgHideReply": {
55
88
  aminoType: "sparkdream/x/blog/MsgHideReply",
56
89
  toAmino: MsgHideReply.toAmino,
57
- fromAmino: MsgHideReply.fromAmino
90
+ fromAmino: MsgHideReply.fromAmino,
58
91
  },
59
92
  "/sparkdream.blog.v1.MsgUnhideReply": {
60
93
  aminoType: "sparkdream/x/blog/MsgUnhideReply",
61
94
  toAmino: MsgUnhideReply.toAmino,
62
- fromAmino: MsgUnhideReply.fromAmino
95
+ fromAmino: MsgUnhideReply.fromAmino,
63
96
  },
64
97
  "/sparkdream.blog.v1.MsgReact": {
65
98
  aminoType: "sparkdream/x/blog/MsgReact",
66
99
  toAmino: MsgReact.toAmino,
67
- fromAmino: MsgReact.fromAmino
100
+ fromAmino: MsgReact.fromAmino,
68
101
  },
69
102
  "/sparkdream.blog.v1.MsgRemoveReaction": {
70
103
  aminoType: "sparkdream/x/blog/MsgRemoveReaction",
71
104
  toAmino: MsgRemoveReaction.toAmino,
72
- fromAmino: MsgRemoveReaction.fromAmino
105
+ fromAmino: MsgRemoveReaction.fromAmino,
73
106
  },
74
107
  "/sparkdream.blog.v1.MsgPinPost": {
75
108
  aminoType: "sparkdream/x/blog/MsgPinPost",
76
109
  toAmino: MsgPinPost.toAmino,
77
- fromAmino: MsgPinPost.fromAmino
110
+ fromAmino: MsgPinPost.fromAmino,
78
111
  },
79
112
  "/sparkdream.blog.v1.MsgPinReply": {
80
113
  aminoType: "sparkdream/x/blog/MsgPinReply",
81
114
  toAmino: MsgPinReply.toAmino,
82
- fromAmino: MsgPinReply.fromAmino
83
- }
115
+ fromAmino: MsgPinReply.fromAmino,
116
+ },
84
117
  };
@@ -1,139 +1,241 @@
1
1
  //@ts-nocheck
2
- import { MsgUpdateParams, MsgCreateCollection, MsgUpdateCollection, MsgDeleteCollection, MsgAddItem, MsgAddItems, MsgUpdateItem, MsgRemoveItem, MsgRemoveItems, MsgReorderItem, MsgAddCollaborator, MsgRemoveCollaborator, MsgUpdateCollaboratorRole, MsgRateCollection, MsgChallengeReview, MsgRequestSponsorship, MsgCancelSponsorshipRequest, MsgSponsorCollection, MsgUpdateOperationalParams, MsgUpvoteContent, MsgDownvoteContent, MsgFlagContent, MsgHideContent, MsgAppealHide, MsgEndorseCollection, MsgSetSeekingEndorsement, MsgPinCollection } from "./tx";
2
+ // HAND-WRITTEN OVERRIDE overlaid by scripts/codegen.ts after telescope.
3
+ // See ../../commons/v1/tx.amino.ts for the broader rationale.
4
+ //
5
+ // Telescope emits `[]` for empty repeated fields; aminojson on the chain omits
6
+ // them. In collect the offending messages are: MsgCreateCollection (tags),
7
+ // MsgUpdateCollection (tags), MsgAddItem (attributes), MsgAddItems (items),
8
+ // MsgUpdateItem (attributes), MsgRemoveItems (ids), MsgRateCollection (tags).
9
+ import { MsgUpdateParams, MsgCreateCollection, MsgUpdateCollection, MsgDeleteCollection, MsgAddItem, MsgAddItems, MsgUpdateItem, MsgRemoveItem, MsgRemoveItems, MsgReorderItem, MsgAddCollaborator, MsgRemoveCollaborator, MsgUpdateCollaboratorRole, MsgRateCollection, MsgChallengeReview, MsgRequestSponsorship, MsgCancelSponsorshipRequest, MsgSponsorCollection, MsgUpdateOperationalParams, MsgUpvoteContent, MsgDownvoteContent, MsgFlagContent, MsgHideContent, MsgAppealHide, MsgEndorseCollection, MsgSetSeekingEndorsement, MsgPinCollection, } from "./tx";
10
+ import { NftReference, LinkReference, OnChainReference, CustomReference, KeyValuePair, AddItemEntry } from "./types";
11
+ import { base64FromBytes } from "../../../helpers";
3
12
  export const AminoConverter = {
4
13
  "/sparkdream.collect.v1.MsgUpdateParams": {
5
14
  aminoType: "sparkdream/x/collect/MsgUpdateParams",
6
15
  toAmino: MsgUpdateParams.toAmino,
7
- fromAmino: MsgUpdateParams.fromAmino
16
+ fromAmino: MsgUpdateParams.fromAmino,
8
17
  },
9
18
  "/sparkdream.collect.v1.MsgCreateCollection": {
10
19
  aminoType: "sparkdream/x/collect/MsgCreateCollection",
11
- toAmino: MsgCreateCollection.toAmino,
12
- fromAmino: MsgCreateCollection.fromAmino
20
+ toAmino(message) {
21
+ const obj = {};
22
+ obj.creator = message.creator === "" ? undefined : message.creator;
23
+ obj.type = message.type === 0 ? undefined : message.type;
24
+ obj.visibility = message.visibility === 0 ? undefined : message.visibility;
25
+ obj.encrypted = message.encrypted === false ? undefined : message.encrypted;
26
+ obj.expires_at = message.expiresAt !== BigInt(0) ? message.expiresAt?.toString() : undefined;
27
+ obj.name = message.name === "" ? undefined : message.name;
28
+ obj.description = message.description === "" ? undefined : message.description;
29
+ obj.cover_uri = message.coverUri === "" ? undefined : message.coverUri;
30
+ obj.tags = (message.tags?.length ?? 0) > 0
31
+ ? message.tags.map((e) => e)
32
+ : undefined;
33
+ obj.encrypted_data = message.encryptedData ? base64FromBytes(message.encryptedData) : undefined;
34
+ obj.author_bond = message.authorBond === null ? undefined : message.authorBond;
35
+ obj.initiative_id = message.initiativeId !== BigInt(0) ? message.initiativeId?.toString() : undefined;
36
+ return obj;
37
+ },
38
+ fromAmino: MsgCreateCollection.fromAmino,
13
39
  },
14
40
  "/sparkdream.collect.v1.MsgUpdateCollection": {
15
41
  aminoType: "sparkdream/x/collect/MsgUpdateCollection",
16
- toAmino: MsgUpdateCollection.toAmino,
17
- fromAmino: MsgUpdateCollection.fromAmino
42
+ toAmino(message) {
43
+ const obj = {};
44
+ obj.creator = message.creator === "" ? undefined : message.creator;
45
+ obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined;
46
+ obj.type = message.type === 0 ? undefined : message.type;
47
+ obj.expires_at = message.expiresAt !== BigInt(0) ? message.expiresAt?.toString() : undefined;
48
+ obj.name = message.name === "" ? undefined : message.name;
49
+ obj.description = message.description === "" ? undefined : message.description;
50
+ obj.cover_uri = message.coverUri === "" ? undefined : message.coverUri;
51
+ obj.tags = (message.tags?.length ?? 0) > 0
52
+ ? message.tags.map((e) => e)
53
+ : undefined;
54
+ obj.encrypted_data = message.encryptedData ? base64FromBytes(message.encryptedData) : undefined;
55
+ obj.community_feedback_enabled = message.communityFeedbackEnabled === false ? undefined : message.communityFeedbackEnabled;
56
+ obj.update_community_feedback = message.updateCommunityFeedback === false ? undefined : message.updateCommunityFeedback;
57
+ return obj;
58
+ },
59
+ fromAmino: MsgUpdateCollection.fromAmino,
18
60
  },
19
61
  "/sparkdream.collect.v1.MsgDeleteCollection": {
20
62
  aminoType: "sparkdream/x/collect/MsgDeleteCollection",
21
63
  toAmino: MsgDeleteCollection.toAmino,
22
- fromAmino: MsgDeleteCollection.fromAmino
64
+ fromAmino: MsgDeleteCollection.fromAmino,
23
65
  },
24
66
  "/sparkdream.collect.v1.MsgAddItem": {
25
67
  aminoType: "sparkdream/x/collect/MsgAddItem",
26
- toAmino: MsgAddItem.toAmino,
27
- fromAmino: MsgAddItem.fromAmino
68
+ toAmino(message) {
69
+ const obj = {};
70
+ obj.creator = message.creator === "" ? undefined : message.creator;
71
+ obj.collection_id = message.collectionId !== BigInt(0) ? message.collectionId?.toString() : undefined;
72
+ obj.position = message.position !== BigInt(0) ? message.position?.toString() : undefined;
73
+ obj.title = message.title === "" ? undefined : message.title;
74
+ obj.description = message.description === "" ? undefined : message.description;
75
+ obj.image_uri = message.imageUri === "" ? undefined : message.imageUri;
76
+ obj.reference_type = message.referenceType === 0 ? undefined : message.referenceType;
77
+ obj.nft = message.nft ? NftReference.toAmino(message.nft) : undefined;
78
+ obj.link = message.link ? LinkReference.toAmino(message.link) : undefined;
79
+ obj.on_chain = message.onChain ? OnChainReference.toAmino(message.onChain) : undefined;
80
+ obj.custom = message.custom ? CustomReference.toAmino(message.custom) : undefined;
81
+ obj.attributes = (message.attributes?.length ?? 0) > 0
82
+ ? message.attributes.map((e) => e ? KeyValuePair.toAmino(e) : undefined)
83
+ : undefined;
84
+ obj.encrypted_data = message.encryptedData ? base64FromBytes(message.encryptedData) : undefined;
85
+ return obj;
86
+ },
87
+ fromAmino: MsgAddItem.fromAmino,
28
88
  },
29
89
  "/sparkdream.collect.v1.MsgAddItems": {
30
90
  aminoType: "sparkdream/x/collect/MsgAddItems",
31
- toAmino: MsgAddItems.toAmino,
32
- fromAmino: MsgAddItems.fromAmino
91
+ toAmino(message) {
92
+ const obj = {};
93
+ obj.creator = message.creator === "" ? undefined : message.creator;
94
+ obj.collection_id = message.collectionId !== BigInt(0) ? message.collectionId?.toString() : undefined;
95
+ obj.items = (message.items?.length ?? 0) > 0
96
+ ? message.items.map((e) => e ? AddItemEntry.toAmino(e) : undefined)
97
+ : undefined;
98
+ return obj;
99
+ },
100
+ fromAmino: MsgAddItems.fromAmino,
33
101
  },
34
102
  "/sparkdream.collect.v1.MsgUpdateItem": {
35
103
  aminoType: "sparkdream/x/collect/MsgUpdateItem",
36
- toAmino: MsgUpdateItem.toAmino,
37
- fromAmino: MsgUpdateItem.fromAmino
104
+ toAmino(message) {
105
+ const obj = {};
106
+ obj.creator = message.creator === "" ? undefined : message.creator;
107
+ obj.id = message.id !== BigInt(0) ? message.id?.toString() : undefined;
108
+ obj.title = message.title === "" ? undefined : message.title;
109
+ obj.description = message.description === "" ? undefined : message.description;
110
+ obj.image_uri = message.imageUri === "" ? undefined : message.imageUri;
111
+ obj.reference_type = message.referenceType === 0 ? undefined : message.referenceType;
112
+ obj.nft = message.nft ? NftReference.toAmino(message.nft) : undefined;
113
+ obj.link = message.link ? LinkReference.toAmino(message.link) : undefined;
114
+ obj.on_chain = message.onChain ? OnChainReference.toAmino(message.onChain) : undefined;
115
+ obj.custom = message.custom ? CustomReference.toAmino(message.custom) : undefined;
116
+ obj.attributes = (message.attributes?.length ?? 0) > 0
117
+ ? message.attributes.map((e) => e ? KeyValuePair.toAmino(e) : undefined)
118
+ : undefined;
119
+ obj.encrypted_data = message.encryptedData ? base64FromBytes(message.encryptedData) : undefined;
120
+ return obj;
121
+ },
122
+ fromAmino: MsgUpdateItem.fromAmino,
38
123
  },
39
124
  "/sparkdream.collect.v1.MsgRemoveItem": {
40
125
  aminoType: "sparkdream/x/collect/MsgRemoveItem",
41
126
  toAmino: MsgRemoveItem.toAmino,
42
- fromAmino: MsgRemoveItem.fromAmino
127
+ fromAmino: MsgRemoveItem.fromAmino,
43
128
  },
44
129
  "/sparkdream.collect.v1.MsgRemoveItems": {
45
130
  aminoType: "sparkdream/x/collect/MsgRemoveItems",
46
- toAmino: MsgRemoveItems.toAmino,
47
- fromAmino: MsgRemoveItems.fromAmino
131
+ toAmino(message) {
132
+ const obj = {};
133
+ obj.creator = message.creator === "" ? undefined : message.creator;
134
+ obj.ids = (message.ids?.length ?? 0) > 0
135
+ ? message.ids.map((e) => e.toString())
136
+ : undefined;
137
+ return obj;
138
+ },
139
+ fromAmino: MsgRemoveItems.fromAmino,
48
140
  },
49
141
  "/sparkdream.collect.v1.MsgReorderItem": {
50
142
  aminoType: "sparkdream/x/collect/MsgReorderItem",
51
143
  toAmino: MsgReorderItem.toAmino,
52
- fromAmino: MsgReorderItem.fromAmino
144
+ fromAmino: MsgReorderItem.fromAmino,
53
145
  },
54
146
  "/sparkdream.collect.v1.MsgAddCollaborator": {
55
147
  aminoType: "sparkdream/x/collect/MsgAddCollaborator",
56
148
  toAmino: MsgAddCollaborator.toAmino,
57
- fromAmino: MsgAddCollaborator.fromAmino
149
+ fromAmino: MsgAddCollaborator.fromAmino,
58
150
  },
59
151
  "/sparkdream.collect.v1.MsgRemoveCollaborator": {
60
152
  aminoType: "sparkdream/x/collect/MsgRemoveCollaborator",
61
153
  toAmino: MsgRemoveCollaborator.toAmino,
62
- fromAmino: MsgRemoveCollaborator.fromAmino
154
+ fromAmino: MsgRemoveCollaborator.fromAmino,
63
155
  },
64
156
  "/sparkdream.collect.v1.MsgUpdateCollaboratorRole": {
65
157
  aminoType: "sparkdream/x/collect/MsgUpdateCollaboratorRole",
66
158
  toAmino: MsgUpdateCollaboratorRole.toAmino,
67
- fromAmino: MsgUpdateCollaboratorRole.fromAmino
159
+ fromAmino: MsgUpdateCollaboratorRole.fromAmino,
68
160
  },
69
161
  "/sparkdream.collect.v1.MsgRateCollection": {
70
162
  aminoType: "sparkdream/x/collect/MsgRateCollection",
71
- toAmino: MsgRateCollection.toAmino,
72
- fromAmino: MsgRateCollection.fromAmino
163
+ toAmino(message) {
164
+ const obj = {};
165
+ obj.creator = message.creator === "" ? undefined : message.creator;
166
+ obj.collection_id = message.collectionId !== BigInt(0) ? message.collectionId?.toString() : undefined;
167
+ obj.verdict = message.verdict === 0 ? undefined : message.verdict;
168
+ obj.tags = (message.tags?.length ?? 0) > 0
169
+ ? message.tags.map((e) => e)
170
+ : undefined;
171
+ obj.comment = message.comment === "" ? undefined : message.comment;
172
+ return obj;
173
+ },
174
+ fromAmino: MsgRateCollection.fromAmino,
73
175
  },
74
176
  "/sparkdream.collect.v1.MsgChallengeReview": {
75
177
  aminoType: "sparkdream/x/collect/MsgChallengeReview",
76
178
  toAmino: MsgChallengeReview.toAmino,
77
- fromAmino: MsgChallengeReview.fromAmino
179
+ fromAmino: MsgChallengeReview.fromAmino,
78
180
  },
79
181
  "/sparkdream.collect.v1.MsgRequestSponsorship": {
80
182
  aminoType: "sparkdream/x/collect/MsgRequestSponsorship",
81
183
  toAmino: MsgRequestSponsorship.toAmino,
82
- fromAmino: MsgRequestSponsorship.fromAmino
184
+ fromAmino: MsgRequestSponsorship.fromAmino,
83
185
  },
84
186
  "/sparkdream.collect.v1.MsgCancelSponsorshipRequest": {
85
187
  aminoType: "sparkdream/x/collect/MsgCancelSponsorshipRequest",
86
188
  toAmino: MsgCancelSponsorshipRequest.toAmino,
87
- fromAmino: MsgCancelSponsorshipRequest.fromAmino
189
+ fromAmino: MsgCancelSponsorshipRequest.fromAmino,
88
190
  },
89
191
  "/sparkdream.collect.v1.MsgSponsorCollection": {
90
192
  aminoType: "sparkdream/x/collect/MsgSponsorCollection",
91
193
  toAmino: MsgSponsorCollection.toAmino,
92
- fromAmino: MsgSponsorCollection.fromAmino
194
+ fromAmino: MsgSponsorCollection.fromAmino,
93
195
  },
94
196
  "/sparkdream.collect.v1.MsgUpdateOperationalParams": {
95
197
  aminoType: "sparkdream/x/collect/MsgUpdateOperationalParams",
96
198
  toAmino: MsgUpdateOperationalParams.toAmino,
97
- fromAmino: MsgUpdateOperationalParams.fromAmino
199
+ fromAmino: MsgUpdateOperationalParams.fromAmino,
98
200
  },
99
201
  "/sparkdream.collect.v1.MsgUpvoteContent": {
100
202
  aminoType: "sparkdream/x/collect/MsgUpvoteContent",
101
203
  toAmino: MsgUpvoteContent.toAmino,
102
- fromAmino: MsgUpvoteContent.fromAmino
204
+ fromAmino: MsgUpvoteContent.fromAmino,
103
205
  },
104
206
  "/sparkdream.collect.v1.MsgDownvoteContent": {
105
207
  aminoType: "sparkdream/x/collect/MsgDownvoteContent",
106
208
  toAmino: MsgDownvoteContent.toAmino,
107
- fromAmino: MsgDownvoteContent.fromAmino
209
+ fromAmino: MsgDownvoteContent.fromAmino,
108
210
  },
109
211
  "/sparkdream.collect.v1.MsgFlagContent": {
110
212
  aminoType: "sparkdream/x/collect/MsgFlagContent",
111
213
  toAmino: MsgFlagContent.toAmino,
112
- fromAmino: MsgFlagContent.fromAmino
214
+ fromAmino: MsgFlagContent.fromAmino,
113
215
  },
114
216
  "/sparkdream.collect.v1.MsgHideContent": {
115
217
  aminoType: "sparkdream/x/collect/MsgHideContent",
116
218
  toAmino: MsgHideContent.toAmino,
117
- fromAmino: MsgHideContent.fromAmino
219
+ fromAmino: MsgHideContent.fromAmino,
118
220
  },
119
221
  "/sparkdream.collect.v1.MsgAppealHide": {
120
222
  aminoType: "sparkdream/x/collect/MsgAppealHide",
121
223
  toAmino: MsgAppealHide.toAmino,
122
- fromAmino: MsgAppealHide.fromAmino
224
+ fromAmino: MsgAppealHide.fromAmino,
123
225
  },
124
226
  "/sparkdream.collect.v1.MsgEndorseCollection": {
125
227
  aminoType: "sparkdream/x/collect/MsgEndorseCollection",
126
228
  toAmino: MsgEndorseCollection.toAmino,
127
- fromAmino: MsgEndorseCollection.fromAmino
229
+ fromAmino: MsgEndorseCollection.fromAmino,
128
230
  },
129
231
  "/sparkdream.collect.v1.MsgSetSeekingEndorsement": {
130
232
  aminoType: "sparkdream/x/collect/MsgSetSeekingEndorsement",
131
233
  toAmino: MsgSetSeekingEndorsement.toAmino,
132
- fromAmino: MsgSetSeekingEndorsement.fromAmino
234
+ fromAmino: MsgSetSeekingEndorsement.fromAmino,
133
235
  },
134
236
  "/sparkdream.collect.v1.MsgPinCollection": {
135
237
  aminoType: "sparkdream/x/collect/MsgPinCollection",
136
238
  toAmino: MsgPinCollection.toAmino,
137
- fromAmino: MsgPinCollection.fromAmino
138
- }
239
+ fromAmino: MsgPinCollection.fromAmino,
240
+ },
139
241
  };
@@ -13,7 +13,8 @@
13
13
  // This override delegates the inner Any conversion to a consumer-supplied
14
14
  // proto registry + AminoTypes via `configureNestedAminoConverter`. The rest of
15
15
  // the converters are unchanged.
16
- import { MsgUpdateParams, MsgSpendFromCommons, MsgEmergencyCancelGovProposal, MsgCreatePolicyPermissions, MsgUpdatePolicyPermissions, MsgDeletePolicyPermissions, MsgRegisterGroup, MsgRenewGroup, MsgUpdateGroupMembers, MsgUpdateGroupConfig, MsgForceUpgrade, MsgDeleteGroup, MsgVetoGroupProposals, MsgVoteProposal, MsgExecuteProposal, MsgAnonymousVoteProposal, MsgCreateCategory, } from "./tx";
16
+ import { MsgUpdateParams, MsgSpendFromCommons, MsgEmergencyCancelGovProposal, MsgCreatePolicyPermissions, MsgUpdatePolicyPermissions, MsgDeletePolicyPermissions, MsgRegisterGroup, MsgRenewGroup, MsgUpdateGroupMembers, MsgUpdateGroupConfig, MsgForceUpgrade, MsgDeleteGroup, MsgVetoGroupProposals, MsgVoteProposal, MsgExecuteProposal, MsgAnonymousVoteProposal, MsgCreateCategory, MsgDeleteCategory, } from "./tx";
17
+ import { Coin } from "../../../cosmos/base/v1beta1/coin";
17
18
  import { anyToAmino, aminoToAny } from "../../../nested-amino";
18
19
  export { configureNestedAminoConverter } from "../../../nested-amino";
19
20
  // Both proposal-submission messages share the same shape, so they share a
@@ -53,7 +54,15 @@ export const AminoConverter = {
53
54
  },
54
55
  "/sparkdream.commons.v1.MsgSpendFromCommons": {
55
56
  aminoType: "sparkdream/x/commons/MsgSpendFromCommons",
56
- toAmino: MsgSpendFromCommons.toAmino,
57
+ toAmino(message) {
58
+ const obj = {};
59
+ obj.authority = message.authority === "" ? undefined : message.authority;
60
+ obj.recipient = message.recipient === "" ? undefined : message.recipient;
61
+ obj.amount = (message.amount?.length ?? 0) > 0
62
+ ? message.amount.map((e) => e ? Coin.toAmino(e) : undefined)
63
+ : undefined;
64
+ return obj;
65
+ },
57
66
  fromAmino: MsgSpendFromCommons.fromAmino,
58
67
  },
59
68
  "/sparkdream.commons.v1.MsgEmergencyCancelGovProposal": {
@@ -63,12 +72,28 @@ export const AminoConverter = {
63
72
  },
64
73
  "/sparkdream.commons.v1.MsgCreatePolicyPermissions": {
65
74
  aminoType: "sparkdream/x/commons/MsgCreatePolicyPermissions",
66
- toAmino: MsgCreatePolicyPermissions.toAmino,
75
+ toAmino(message) {
76
+ const obj = {};
77
+ obj.authority = message.authority === "" ? undefined : message.authority;
78
+ obj.policy_address = message.policyAddress === "" ? undefined : message.policyAddress;
79
+ obj.allowed_messages = (message.allowedMessages?.length ?? 0) > 0
80
+ ? message.allowedMessages.map((e) => e)
81
+ : undefined;
82
+ return obj;
83
+ },
67
84
  fromAmino: MsgCreatePolicyPermissions.fromAmino,
68
85
  },
69
86
  "/sparkdream.commons.v1.MsgUpdatePolicyPermissions": {
70
87
  aminoType: "sparkdream/x/commons/MsgUpdatePolicyPermissions",
71
- toAmino: MsgUpdatePolicyPermissions.toAmino,
88
+ toAmino(message) {
89
+ const obj = {};
90
+ obj.authority = message.authority === "" ? undefined : message.authority;
91
+ obj.policy_address = message.policyAddress === "" ? undefined : message.policyAddress;
92
+ obj.allowed_messages = (message.allowedMessages?.length ?? 0) > 0
93
+ ? message.allowedMessages.map((e) => e)
94
+ : undefined;
95
+ return obj;
96
+ },
72
97
  fromAmino: MsgUpdatePolicyPermissions.fromAmino,
73
98
  },
74
99
  "/sparkdream.commons.v1.MsgDeletePolicyPermissions": {
@@ -78,17 +103,81 @@ export const AminoConverter = {
78
103
  },
79
104
  "/sparkdream.commons.v1.MsgRegisterGroup": {
80
105
  aminoType: "sparkdream/x/commons/MsgRegisterGroup",
81
- toAmino: MsgRegisterGroup.toAmino,
106
+ toAmino(message) {
107
+ const obj = {};
108
+ obj.authority = message.authority === "" ? undefined : message.authority;
109
+ obj.name = message.name === "" ? undefined : message.name;
110
+ obj.description = message.description === "" ? undefined : message.description;
111
+ obj.members = (message.members?.length ?? 0) > 0
112
+ ? message.members.map((e) => e)
113
+ : undefined;
114
+ obj.member_weights = (message.memberWeights?.length ?? 0) > 0
115
+ ? message.memberWeights.map((e) => e)
116
+ : undefined;
117
+ obj.funding_weight = message.fundingWeight !== BigInt(0) ? message.fundingWeight?.toString() : undefined;
118
+ obj.max_spend_per_epoch = message.maxSpendPerEpoch === "" ? undefined : message.maxSpendPerEpoch;
119
+ obj.update_cooldown = message.updateCooldown !== BigInt(0) ? message.updateCooldown?.toString() : undefined;
120
+ obj.intended_parent_address = message.intendedParentAddress === "" ? undefined : message.intendedParentAddress;
121
+ obj.min_members = message.minMembers !== BigInt(0) ? message.minMembers?.toString() : undefined;
122
+ obj.max_members = message.maxMembers !== BigInt(0) ? message.maxMembers?.toString() : undefined;
123
+ obj.term_duration = message.termDuration !== BigInt(0) ? message.termDuration?.toString() : undefined;
124
+ obj.activation_time = message.activationTime !== BigInt(0) ? message.activationTime?.toString() : undefined;
125
+ obj.voting_period = message.votingPeriod !== BigInt(0) ? message.votingPeriod?.toString() : undefined;
126
+ obj.min_execution_period = message.minExecutionPeriod !== BigInt(0) ? message.minExecutionPeriod?.toString() : undefined;
127
+ obj.futarchy_enabled = message.futarchyEnabled === false ? undefined : message.futarchyEnabled;
128
+ obj.vote_threshold = message.voteThreshold === "" ? undefined : message.voteThreshold;
129
+ obj.policy_type = message.policyType === "" ? undefined : message.policyType;
130
+ obj.allowed_messages = (message.allowedMessages?.length ?? 0) > 0
131
+ ? message.allowedMessages.map((e) => e)
132
+ : undefined;
133
+ obj.electoral_policy_address = message.electoralPolicyAddress === "" ? undefined : message.electoralPolicyAddress;
134
+ return obj;
135
+ },
82
136
  fromAmino: MsgRegisterGroup.fromAmino,
83
137
  },
84
138
  "/sparkdream.commons.v1.MsgRenewGroup": {
85
139
  aminoType: "sparkdream/x/commons/MsgRenewGroup",
86
- toAmino: MsgRenewGroup.toAmino,
140
+ toAmino(message) {
141
+ const obj = {};
142
+ obj.authority = message.authority === "" ? undefined : message.authority;
143
+ obj.group_name = message.groupName === "" ? undefined : message.groupName;
144
+ obj.new_members = (message.newMembers?.length ?? 0) > 0
145
+ ? message.newMembers.map((e) => e)
146
+ : undefined;
147
+ obj.new_member_weights = (message.newMemberWeights?.length ?? 0) > 0
148
+ ? message.newMemberWeights.map((e) => e)
149
+ : undefined;
150
+ return obj;
151
+ },
87
152
  fromAmino: MsgRenewGroup.fromAmino,
88
153
  },
154
+ // Telescope's auto-generated toAmino emits `[]` for empty repeated fields
155
+ // (the `if (message.membersToAdd)` check is truthy for `[]` in JS), but
156
+ // aminojson on the chain side omits them. An invite has empty
157
+ // `members_to_remove`, a remove has empty `members_to_add`/`weights_to_add`,
158
+ // and either combination produces sign-bytes that don't match what the
159
+ // chain reconstructs — surfacing as "signature verification failed" /
160
+ // "unauthorized". Mirror the omitempty pattern used by the proposal
161
+ // converter above.
89
162
  "/sparkdream.commons.v1.MsgUpdateGroupMembers": {
90
163
  aminoType: "sparkdream/x/commons/MsgUpdateGroupMembers",
91
- toAmino: MsgUpdateGroupMembers.toAmino,
164
+ toAmino(message) {
165
+ const obj = {};
166
+ obj.authority = message.authority === "" ? undefined : message.authority;
167
+ obj.group_policy_address = message.groupPolicyAddress === ""
168
+ ? undefined
169
+ : message.groupPolicyAddress;
170
+ obj.members_to_add = (message.membersToAdd?.length ?? 0) > 0
171
+ ? message.membersToAdd.map((e) => e)
172
+ : undefined;
173
+ obj.weights_to_add = (message.weightsToAdd?.length ?? 0) > 0
174
+ ? message.weightsToAdd.map((e) => e)
175
+ : undefined;
176
+ obj.members_to_remove = (message.membersToRemove?.length ?? 0) > 0
177
+ ? message.membersToRemove.map((e) => e)
178
+ : undefined;
179
+ return obj;
180
+ },
92
181
  fromAmino: MsgUpdateGroupMembers.fromAmino,
93
182
  },
94
183
  "/sparkdream.commons.v1.MsgUpdateGroupConfig": {
@@ -135,4 +224,9 @@ export const AminoConverter = {
135
224
  toAmino: MsgCreateCategory.toAmino,
136
225
  fromAmino: MsgCreateCategory.fromAmino,
137
226
  },
227
+ "/sparkdream.commons.v1.MsgDeleteCategory": {
228
+ aminoType: "sparkdream/x/commons/MsgDeleteCategory",
229
+ toAmino: MsgDeleteCategory.toAmino,
230
+ fromAmino: MsgDeleteCategory.fromAmino,
231
+ },
138
232
  };
@@ -1,14 +1,28 @@
1
1
  //@ts-nocheck
2
+ // HAND-WRITTEN OVERRIDE — overlaid by scripts/codegen.ts after telescope.
3
+ // See ../../commons/v1/tx.amino.ts for the broader rationale.
4
+ //
5
+ // MsgSpend has `repeated cosmos.base.v1beta1.Coin amount` which the
6
+ // auto-generated toAmino emits as `[]` when empty, mismatching the chain.
2
7
  import { MsgUpdateParams, MsgSpend } from "./tx";
8
+ import { Coin } from "../../../cosmos/base/v1beta1/coin";
3
9
  export const AminoConverter = {
4
10
  "/sparkdream.ecosystem.v1.MsgUpdateParams": {
5
11
  aminoType: "sparkdream/x/ecosystem/MsgUpdateParams",
6
12
  toAmino: MsgUpdateParams.toAmino,
7
- fromAmino: MsgUpdateParams.fromAmino
13
+ fromAmino: MsgUpdateParams.fromAmino,
8
14
  },
9
15
  "/sparkdream.ecosystem.v1.MsgSpend": {
10
16
  aminoType: "sparkdream/x/ecosystem/MsgSpend",
11
- toAmino: MsgSpend.toAmino,
12
- fromAmino: MsgSpend.fromAmino
13
- }
17
+ toAmino(message) {
18
+ const obj = {};
19
+ obj.authority = message.authority === "" ? undefined : message.authority;
20
+ obj.recipient = message.recipient === "" ? undefined : message.recipient;
21
+ obj.amount = (message.amount?.length ?? 0) > 0
22
+ ? message.amount.map((e) => e ? Coin.toAmino(e) : undefined)
23
+ : undefined;
24
+ return obj;
25
+ },
26
+ fromAmino: MsgSpend.fromAmino,
27
+ },
14
28
  };