@sparkdreamnft/sparkdreamjs 0.0.46 → 0.0.48
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.
- package/amino-schema.d.ts +5741 -0
- package/amino-schema.js +8 -0
- package/chain-amino.d.ts +61 -0
- package/chain-amino.js +670 -0
- package/esm/amino-schema.js +5 -0
- package/esm/chain-amino.js +665 -0
- package/esm/nested-amino.js +7 -1
- package/esm/sparkdream/artifact/v1/query.js +125 -0
- package/esm/sparkdream/artifact/v1/query.lcd.js +7 -0
- package/esm/sparkdream/artifact/v1/query.rpc.Query.js +12 -1
- package/esm/sparkdream/artifact/v1/tx.amino.js +12 -473
- package/esm/sparkdream/artifact/v1/tx.js +13 -1
- package/esm/sparkdream/blog/v1/tx.amino.js +15 -135
- package/esm/sparkdream/collect/v1/tx.amino.js +15 -254
- package/esm/sparkdream/commons/v1/tx.amino.js +12 -258
- package/esm/sparkdream/ecosystem/v1/tx.amino.js +15 -26
- package/esm/sparkdream/federation/v1/tx.amino.js +12 -174
- package/esm/sparkdream/forum/v1/tx.amino.js +15 -231
- package/esm/sparkdream/futarchy/v1/tx.amino.js +16 -38
- package/esm/sparkdream/guardian/v1/tx.amino.js +12 -33
- package/esm/sparkdream/name/v1/tx.amino.js +16 -63
- package/esm/sparkdream/rep/v1/query.js +304 -1
- package/esm/sparkdream/rep/v1/query.lcd.js +19 -0
- package/esm/sparkdream/rep/v1/query.rpc.Query.js +22 -1
- package/esm/sparkdream/rep/v1/tx.amino.js +12 -484
- package/esm/sparkdream/reveal/v1/tx.amino.js +15 -73
- package/esm/sparkdream/season/v1/tx.amino.js +12 -276
- package/esm/sparkdream/service/v1/tx.amino.js +16 -78
- package/esm/sparkdream/session/v1/tx.amino.js +16 -271
- package/esm/sparkdream/shield/v1/tx.amino.js +15 -80
- package/esm/sparkdream/sparkdream/v1/tx.amino.js +16 -8
- package/esm/sparkdream/split/v1/tx.amino.js +16 -8
- package/esm/sparkdream/vault/v1/tx.amino.js +12 -105
- package/nested-amino.d.ts +5 -1
- package/nested-amino.js +8 -1
- package/package.json +1 -1
- package/sparkdream/artifact/v1/query.d.ts +86 -0
- package/sparkdream/artifact/v1/query.js +126 -1
- package/sparkdream/artifact/v1/query.lcd.d.ts +2 -1
- package/sparkdream/artifact/v1/query.lcd.js +7 -0
- package/sparkdream/artifact/v1/query.rpc.Query.d.ts +9 -1
- package/sparkdream/artifact/v1/query.rpc.Query.js +11 -0
- package/sparkdream/artifact/v1/tx.amino.d.ts +1 -353
- package/sparkdream/artifact/v1/tx.amino.js +47 -475
- package/sparkdream/artifact/v1/tx.d.ts +14 -0
- package/sparkdream/artifact/v1/tx.js +13 -1
- package/sparkdream/blog/v1/tx.amino.d.ts +1 -103
- package/sparkdream/blog/v1/tx.amino.js +50 -137
- package/sparkdream/bundle.d.ts +97 -2047
- package/sparkdream/client.d.ts +1 -2009
- package/sparkdream/collect/v1/tx.amino.d.ts +1 -153
- package/sparkdream/collect/v1/tx.amino.js +50 -256
- package/sparkdream/commons/v1/tx.amino.d.ts +1 -123
- package/sparkdream/commons/v1/tx.amino.js +49 -262
- package/sparkdream/ecosystem/v1/tx.amino.d.ts +1 -13
- package/sparkdream/ecosystem/v1/tx.amino.js +50 -28
- package/sparkdream/federation/v1/tx.amino.d.ts +1 -128
- package/sparkdream/federation/v1/tx.amino.js +47 -176
- package/sparkdream/forum/v1/tx.amino.d.ts +1 -203
- package/sparkdream/forum/v1/tx.amino.js +50 -233
- package/sparkdream/futarchy/v1/tx.amino.d.ts +1 -38
- package/sparkdream/futarchy/v1/tx.amino.js +49 -38
- package/sparkdream/guardian/v1/tx.amino.d.ts +1 -7
- package/sparkdream/guardian/v1/tx.amino.js +49 -37
- package/sparkdream/name/v1/tx.amino.d.ts +1 -63
- package/sparkdream/name/v1/tx.amino.js +49 -63
- package/sparkdream/rep/v1/query.d.ts +187 -1
- package/sparkdream/rep/v1/query.js +304 -1
- package/sparkdream/rep/v1/query.lcd.d.ts +3 -1
- package/sparkdream/rep/v1/query.lcd.js +19 -0
- package/sparkdream/rep/v1/query.rpc.Query.d.ts +16 -1
- package/sparkdream/rep/v1/query.rpc.Query.js +21 -0
- package/sparkdream/rep/v1/tx.amino.d.ts +1 -353
- package/sparkdream/rep/v1/tx.amino.js +47 -486
- package/sparkdream/reveal/v1/tx.amino.d.ts +1 -53
- package/sparkdream/reveal/v1/tx.amino.js +50 -75
- package/sparkdream/rpc.query.d.ts +3 -0
- package/sparkdream/season/v1/tx.amino.d.ts +1 -218
- package/sparkdream/season/v1/tx.amino.js +47 -278
- package/sparkdream/service/v1/tx.amino.d.ts +1 -78
- package/sparkdream/service/v1/tx.amino.js +49 -78
- package/sparkdream/session/v1/tx.amino.d.ts +1 -93
- package/sparkdream/session/v1/tx.amino.js +48 -270
- package/sparkdream/shield/v1/tx.amino.d.ts +1 -28
- package/sparkdream/shield/v1/tx.amino.js +50 -82
- package/sparkdream/sparkdream/v1/tx.amino.d.ts +1 -8
- package/sparkdream/sparkdream/v1/tx.amino.js +49 -8
- package/sparkdream/split/v1/tx.amino.d.ts +1 -8
- package/sparkdream/split/v1/tx.amino.js +49 -8
- package/sparkdream/vault/v1/tx.amino.d.ts +1 -43
- package/sparkdream/vault/v1/tx.amino.js +49 -109
- package/varint.d.ts +1 -1
|
@@ -2,263 +2,17 @@
|
|
|
2
2
|
// HAND-WRITTEN OVERRIDE — overlaid on top of the Telescope-generated tx.amino.ts
|
|
3
3
|
// by scripts/codegen.ts after each codegen run. Do not let codegen wipe this.
|
|
4
4
|
//
|
|
5
|
-
// Why: Telescope
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
// the
|
|
11
|
-
// different sign bytes ("signature verification failed").
|
|
5
|
+
// Why: Telescope's generated converters (and the per-message overrides that
|
|
6
|
+
// used to patch them) disagree with the chain's aminojson on empty lists,
|
|
7
|
+
// empty bytes, Dec strings, oneofs and non-nullable messages, and went stale
|
|
8
|
+
// whenever a proto changed. Every Msg of x/commons is converted by the
|
|
9
|
+
// schema-driven engine in chain-amino.ts instead, which renders amino JSON
|
|
10
|
+
// from the protobuf bytes exactly as the chain does.
|
|
12
11
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// the
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import { anyToAmino, aminoToAny } from "../../../nested-amino";
|
|
12
|
+
// MAINTENANCE: none per message. The schema (amino-schema.ts, regenerated from
|
|
13
|
+
// the chain on every proto sync) lists every Msg; __tests__/amino-golden.test.ts
|
|
14
|
+
// checks them all against the chain's encoder.
|
|
15
|
+
import * as tx from "./tx";
|
|
16
|
+
import { chainAminoConverters } from "../../../chain-amino";
|
|
19
17
|
export { configureNestedAminoConverter } from "../../../nested-amino";
|
|
20
|
-
|
|
21
|
-
// converter factory.
|
|
22
|
-
function buildProposalConverter(aminoType) {
|
|
23
|
-
return {
|
|
24
|
-
aminoType,
|
|
25
|
-
toAmino(message) {
|
|
26
|
-
const obj = {};
|
|
27
|
-
obj.proposer = message.proposer === "" ? undefined : message.proposer;
|
|
28
|
-
obj.policy_address = message.policyAddress === "" ? undefined : message.policyAddress;
|
|
29
|
-
// Mirror cosmossdk.io/x/tx/signing/aminojson's omitempty default for
|
|
30
|
-
// repeated fields: omit when empty rather than emitting `[]`. Otherwise
|
|
31
|
-
// the JS side signs `"messages":[]` and the chain reconstructs without
|
|
32
|
-
// the key, causing signature verification to fail.
|
|
33
|
-
obj.messages = (message.messages?.length ?? 0) > 0
|
|
34
|
-
? message.messages.map((a) => anyToAmino(a))
|
|
35
|
-
: undefined;
|
|
36
|
-
obj.metadata = message.metadata === "" ? undefined : message.metadata;
|
|
37
|
-
return obj;
|
|
38
|
-
},
|
|
39
|
-
fromAmino(object) {
|
|
40
|
-
return {
|
|
41
|
-
proposer: object.proposer ?? "",
|
|
42
|
-
policyAddress: object.policy_address ?? "",
|
|
43
|
-
messages: (object.messages ?? []).map((e) => aminoToAny(e)),
|
|
44
|
-
metadata: object.metadata ?? "",
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export const AminoConverter = {
|
|
50
|
-
"/sparkdream.commons.v1.MsgUpdateParams": {
|
|
51
|
-
aminoType: "sparkdream/x/commons/MsgUpdateParams",
|
|
52
|
-
toAmino: MsgUpdateParams.toAmino,
|
|
53
|
-
fromAmino: MsgUpdateParams.fromAmino,
|
|
54
|
-
},
|
|
55
|
-
"/sparkdream.commons.v1.MsgSpendFromCommons": {
|
|
56
|
-
aminoType: "sparkdream/x/commons/MsgSpendFromCommons",
|
|
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
|
-
},
|
|
66
|
-
fromAmino: MsgSpendFromCommons.fromAmino,
|
|
67
|
-
},
|
|
68
|
-
"/sparkdream.commons.v1.MsgEmergencyCancelGovProposal": {
|
|
69
|
-
aminoType: "sparkdream/x/commons/MsgEmergencyCancelGovProposal",
|
|
70
|
-
toAmino: MsgEmergencyCancelGovProposal.toAmino,
|
|
71
|
-
fromAmino: MsgEmergencyCancelGovProposal.fromAmino,
|
|
72
|
-
},
|
|
73
|
-
"/sparkdream.commons.v1.MsgCreatePolicyPermissions": {
|
|
74
|
-
aminoType: "sparkdream/x/commons/MsgCreatePolicyPermissions",
|
|
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
|
-
},
|
|
84
|
-
fromAmino: MsgCreatePolicyPermissions.fromAmino,
|
|
85
|
-
},
|
|
86
|
-
"/sparkdream.commons.v1.MsgUpdatePolicyPermissions": {
|
|
87
|
-
aminoType: "sparkdream/x/commons/MsgUpdatePolicyPermissions",
|
|
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
|
-
},
|
|
97
|
-
fromAmino: MsgUpdatePolicyPermissions.fromAmino,
|
|
98
|
-
},
|
|
99
|
-
"/sparkdream.commons.v1.MsgDeletePolicyPermissions": {
|
|
100
|
-
aminoType: "sparkdream/x/commons/MsgDeletePolicyPermissions",
|
|
101
|
-
toAmino: MsgDeletePolicyPermissions.toAmino,
|
|
102
|
-
fromAmino: MsgDeletePolicyPermissions.fromAmino,
|
|
103
|
-
},
|
|
104
|
-
"/sparkdream.commons.v1.MsgRegisterGroup": {
|
|
105
|
-
aminoType: "sparkdream/x/commons/MsgRegisterGroup",
|
|
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
|
-
},
|
|
136
|
-
fromAmino: MsgRegisterGroup.fromAmino,
|
|
137
|
-
},
|
|
138
|
-
"/sparkdream.commons.v1.MsgRenewGroup": {
|
|
139
|
-
aminoType: "sparkdream/x/commons/MsgRenewGroup",
|
|
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
|
-
},
|
|
152
|
-
fromAmino: MsgRenewGroup.fromAmino,
|
|
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.
|
|
162
|
-
"/sparkdream.commons.v1.MsgUpdateGroupMembers": {
|
|
163
|
-
aminoType: "sparkdream/x/commons/MsgUpdateGroupMembers",
|
|
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
|
-
},
|
|
181
|
-
fromAmino: MsgUpdateGroupMembers.fromAmino,
|
|
182
|
-
},
|
|
183
|
-
"/sparkdream.commons.v1.MsgUpdateGroupConfig": {
|
|
184
|
-
aminoType: "sparkdream/x/commons/MsgUpdateGroupConfig",
|
|
185
|
-
toAmino: MsgUpdateGroupConfig.toAmino,
|
|
186
|
-
fromAmino: MsgUpdateGroupConfig.fromAmino,
|
|
187
|
-
},
|
|
188
|
-
"/sparkdream.commons.v1.MsgForceUpgrade": {
|
|
189
|
-
aminoType: "sparkdream/x/commons/MsgForceUpgrade",
|
|
190
|
-
toAmino: MsgForceUpgrade.toAmino,
|
|
191
|
-
fromAmino: MsgForceUpgrade.fromAmino,
|
|
192
|
-
},
|
|
193
|
-
"/sparkdream.commons.v1.MsgDeleteGroup": {
|
|
194
|
-
aminoType: "sparkdream/x/commons/MsgDeleteGroup",
|
|
195
|
-
toAmino: MsgDeleteGroup.toAmino,
|
|
196
|
-
fromAmino: MsgDeleteGroup.fromAmino,
|
|
197
|
-
},
|
|
198
|
-
"/sparkdream.commons.v1.MsgVetoGroupProposals": {
|
|
199
|
-
aminoType: "sparkdream/x/commons/MsgVetoGroupProposals",
|
|
200
|
-
toAmino: MsgVetoGroupProposals.toAmino,
|
|
201
|
-
fromAmino: MsgVetoGroupProposals.fromAmino,
|
|
202
|
-
},
|
|
203
|
-
// Recursive Any handling — see top-of-file comment.
|
|
204
|
-
"/sparkdream.commons.v1.MsgSubmitProposal": buildProposalConverter("sparkdream/x/commons/MsgSubmitProposal"),
|
|
205
|
-
"/sparkdream.commons.v1.MsgVoteProposal": {
|
|
206
|
-
aminoType: "sparkdream/x/commons/MsgVoteProposal",
|
|
207
|
-
toAmino: MsgVoteProposal.toAmino,
|
|
208
|
-
fromAmino: MsgVoteProposal.fromAmino,
|
|
209
|
-
},
|
|
210
|
-
"/sparkdream.commons.v1.MsgExecuteProposal": {
|
|
211
|
-
aminoType: "sparkdream/x/commons/MsgExecuteProposal",
|
|
212
|
-
toAmino: MsgExecuteProposal.toAmino,
|
|
213
|
-
fromAmino: MsgExecuteProposal.fromAmino,
|
|
214
|
-
},
|
|
215
|
-
// Recursive Any handling — see top-of-file comment.
|
|
216
|
-
"/sparkdream.commons.v1.MsgSubmitAnonymousProposal": buildProposalConverter("sparkdream/x/commons/MsgSubmitAnonymousProposal"),
|
|
217
|
-
"/sparkdream.commons.v1.MsgAnonymousVoteProposal": {
|
|
218
|
-
aminoType: "sparkdream/x/commons/MsgAnonymousVoteProposal",
|
|
219
|
-
toAmino: MsgAnonymousVoteProposal.toAmino,
|
|
220
|
-
fromAmino: MsgAnonymousVoteProposal.fromAmino,
|
|
221
|
-
},
|
|
222
|
-
"/sparkdream.commons.v1.MsgCreateCategory": {
|
|
223
|
-
aminoType: "sparkdream/x/commons/MsgCreateCategory",
|
|
224
|
-
toAmino: MsgCreateCategory.toAmino,
|
|
225
|
-
fromAmino: MsgCreateCategory.fromAmino,
|
|
226
|
-
},
|
|
227
|
-
"/sparkdream.commons.v1.MsgDeleteCategory": {
|
|
228
|
-
aminoType: "sparkdream/x/commons/MsgDeleteCategory",
|
|
229
|
-
toAmino: MsgDeleteCategory.toAmino,
|
|
230
|
-
fromAmino: MsgDeleteCategory.fromAmino,
|
|
231
|
-
},
|
|
232
|
-
"/sparkdream.commons.v1.MsgScheduleRecurringSpend": {
|
|
233
|
-
aminoType: "sparkdream/x/commons/MsgScheduleRecurringSpend",
|
|
234
|
-
toAmino(message) {
|
|
235
|
-
const obj = {};
|
|
236
|
-
obj.authority = message.authority === "" ? undefined : message.authority;
|
|
237
|
-
obj.recipient = message.recipient === "" ? undefined : message.recipient;
|
|
238
|
-
obj.amount_per_period = (message.amountPerPeriod?.length ?? 0) > 0
|
|
239
|
-
? message.amountPerPeriod.map((e) => e ? Coin.toAmino(e) : undefined)
|
|
240
|
-
: undefined;
|
|
241
|
-
obj.period_seconds = message.periodSeconds !== BigInt(0) ? message.periodSeconds?.toString() : undefined;
|
|
242
|
-
obj.start_time = message.startTime !== BigInt(0) ? message.startTime?.toString() : undefined;
|
|
243
|
-
obj.end_time = message.endTime !== BigInt(0) ? message.endTime?.toString() : undefined;
|
|
244
|
-
obj.note = message.note === "" ? undefined : message.note;
|
|
245
|
-
return obj;
|
|
246
|
-
},
|
|
247
|
-
fromAmino: MsgScheduleRecurringSpend.fromAmino,
|
|
248
|
-
},
|
|
249
|
-
"/sparkdream.commons.v1.MsgClaimRecurringSpend": {
|
|
250
|
-
aminoType: "sparkdream/x/commons/MsgClaimRecurringSpend",
|
|
251
|
-
toAmino: MsgClaimRecurringSpend.toAmino,
|
|
252
|
-
fromAmino: MsgClaimRecurringSpend.fromAmino,
|
|
253
|
-
},
|
|
254
|
-
"/sparkdream.commons.v1.MsgCancelRecurringSpend": {
|
|
255
|
-
aminoType: "sparkdream/x/commons/MsgCancelRecurringSpend",
|
|
256
|
-
toAmino: MsgCancelRecurringSpend.toAmino,
|
|
257
|
-
fromAmino: MsgCancelRecurringSpend.fromAmino,
|
|
258
|
-
},
|
|
259
|
-
"/sparkdream.commons.v1.MsgDeclineRecurringSpend": {
|
|
260
|
-
aminoType: "sparkdream/x/commons/MsgDeclineRecurringSpend",
|
|
261
|
-
toAmino: MsgDeclineRecurringSpend.toAmino,
|
|
262
|
-
fromAmino: MsgDeclineRecurringSpend.fromAmino,
|
|
263
|
-
},
|
|
264
|
-
};
|
|
18
|
+
export const AminoConverter = chainAminoConverters("sparkdream.commons.v1", tx);
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
|
-
// HAND-WRITTEN OVERRIDE — overlaid
|
|
3
|
-
//
|
|
2
|
+
// HAND-WRITTEN OVERRIDE — overlaid on top of the Telescope-generated tx.amino.ts
|
|
3
|
+
// by scripts/codegen.ts after each codegen run. Do not let codegen wipe this.
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
},
|
|
28
|
-
};
|
|
5
|
+
// Why: Telescope's generated converters (and the per-message overrides that
|
|
6
|
+
// used to patch them) disagree with the chain's aminojson on empty lists,
|
|
7
|
+
// empty bytes, Dec strings, oneofs and non-nullable messages, and went stale
|
|
8
|
+
// whenever a proto changed. Every Msg of x/ecosystem is converted by the
|
|
9
|
+
// schema-driven engine in chain-amino.ts instead, which renders amino JSON
|
|
10
|
+
// from the protobuf bytes exactly as the chain does.
|
|
11
|
+
//
|
|
12
|
+
// MAINTENANCE: none per message. The schema (amino-schema.ts, regenerated from
|
|
13
|
+
// the chain on every proto sync) lists every Msg; __tests__/amino-golden.test.ts
|
|
14
|
+
// checks them all against the chain's encoder.
|
|
15
|
+
import * as tx from "./tx";
|
|
16
|
+
import { chainAminoConverters } from "../../../chain-amino";
|
|
17
|
+
export const AminoConverter = chainAminoConverters("sparkdream.ecosystem.v1", tx);
|
|
@@ -2,178 +2,16 @@
|
|
|
2
2
|
// HAND-WRITTEN OVERRIDE — overlaid on top of the Telescope-generated tx.amino.ts
|
|
3
3
|
// by scripts/codegen.ts after each codegen run. Do not let codegen wipe this.
|
|
4
4
|
//
|
|
5
|
-
// Why: Telescope's
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
5
|
+
// Why: Telescope's generated converters (and the per-message overrides that
|
|
6
|
+
// used to patch them) disagree with the chain's aminojson on empty lists,
|
|
7
|
+
// empty bytes, Dec strings, oneofs and non-nullable messages, and went stale
|
|
8
|
+
// whenever a proto changed. Every Msg of x/federation is converted by the
|
|
9
|
+
// schema-driven engine in chain-amino.ts instead, which renders amino JSON
|
|
10
|
+
// from the protobuf bytes exactly as the chain does.
|
|
11
11
|
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
// MAINTENANCE: this map REPLACES the generated one wholesale, so it must list
|
|
20
|
-
// every message in tx.proto. A message added to the proto but not added here
|
|
21
|
-
// ends up with no amino converter at all, and amino (Ledger) signing for it
|
|
22
|
-
// fails at runtime. When syncing protos, diff the message list in
|
|
23
|
-
// protos/sparkdream/federation/v1/tx.proto against the keys below.
|
|
24
|
-
import { MsgUpdateParams, MsgRegisterPeer, MsgRemovePeer, MsgSuspendPeer, MsgResumePeer, MsgUpdatePeerPolicy, MsgRegisterBridge, MsgUpdateBridge, MsgSubmitFederatedContent, MsgFederateContent, MsgAttestOutbound, MsgModerateContent, MsgLinkIdentity, MsgUnlinkIdentity, MsgConfirmIdentityLink, MsgRequestReputationAttestation, MsgVerifyContent, MsgChallengeVerification, MsgSubmitArbiterHash, MsgEscalateChallenge, MsgResolveEscalatedChallenge, MsgUpdateOperationalParams, MsgUpdatePeerController, MsgResyncBridgeCount, MsgPruneOrphanBindings } from "./tx";
|
|
25
|
-
import { IdentityCuration } from "./types";
|
|
26
|
-
// Repeated string fields mirror aminojson's omitempty: omit when empty.
|
|
27
|
-
function omitEmptyStrings(list) {
|
|
28
|
-
return (list?.length ?? 0) > 0 ? list.map((e) => e) : undefined;
|
|
29
|
-
}
|
|
30
|
-
function peerPolicyToAmino(message) {
|
|
31
|
-
const obj = {};
|
|
32
|
-
obj.peer_id = message.peerId === "" ? undefined : message.peerId;
|
|
33
|
-
obj.outbound_content_types = omitEmptyStrings(message.outboundContentTypes);
|
|
34
|
-
obj.inbound_content_types = omitEmptyStrings(message.inboundContentTypes);
|
|
35
|
-
obj.min_outbound_trust_level = message.minOutboundTrustLevel === 0 ? undefined : message.minOutboundTrustLevel;
|
|
36
|
-
obj.inbound_rate_limit_per_epoch = message.inboundRateLimitPerEpoch !== BigInt(0) ? message.inboundRateLimitPerEpoch?.toString() : undefined;
|
|
37
|
-
obj.outbound_rate_limit_per_epoch = message.outboundRateLimitPerEpoch !== BigInt(0) ? message.outboundRateLimitPerEpoch?.toString() : undefined;
|
|
38
|
-
obj.allow_reputation_queries = message.allowReputationQueries === false ? undefined : message.allowReputationQueries;
|
|
39
|
-
obj.accept_reputation_attestations = message.acceptReputationAttestations === false ? undefined : message.acceptReputationAttestations;
|
|
40
|
-
obj.require_review = message.requireReview === false ? undefined : message.requireReview;
|
|
41
|
-
obj.blocked_identities = omitEmptyStrings(message.blockedIdentities);
|
|
42
|
-
obj.content_hosts = omitEmptyStrings(message.contentHosts);
|
|
43
|
-
obj.allowed_identities = omitEmptyStrings(message.allowedIdentities);
|
|
44
|
-
obj.curation = message.curation ? IdentityCuration.toAmino(message.curation) : undefined;
|
|
45
|
-
return obj;
|
|
46
|
-
}
|
|
47
|
-
export const AminoConverter = {
|
|
48
|
-
"/sparkdream.federation.v1.MsgUpdateParams": {
|
|
49
|
-
aminoType: "sparkdream/x/federation/MsgUpdateParams",
|
|
50
|
-
toAmino: MsgUpdateParams.toAmino,
|
|
51
|
-
fromAmino: MsgUpdateParams.fromAmino
|
|
52
|
-
},
|
|
53
|
-
"/sparkdream.federation.v1.MsgRegisterPeer": {
|
|
54
|
-
aminoType: "sparkdream/x/federation/MsgRegisterPeer",
|
|
55
|
-
toAmino: MsgRegisterPeer.toAmino,
|
|
56
|
-
fromAmino: MsgRegisterPeer.fromAmino
|
|
57
|
-
},
|
|
58
|
-
"/sparkdream.federation.v1.MsgRemovePeer": {
|
|
59
|
-
aminoType: "sparkdream/x/federation/MsgRemovePeer",
|
|
60
|
-
toAmino: MsgRemovePeer.toAmino,
|
|
61
|
-
fromAmino: MsgRemovePeer.fromAmino
|
|
62
|
-
},
|
|
63
|
-
"/sparkdream.federation.v1.MsgSuspendPeer": {
|
|
64
|
-
aminoType: "sparkdream/x/federation/MsgSuspendPeer",
|
|
65
|
-
toAmino: MsgSuspendPeer.toAmino,
|
|
66
|
-
fromAmino: MsgSuspendPeer.fromAmino
|
|
67
|
-
},
|
|
68
|
-
"/sparkdream.federation.v1.MsgResumePeer": {
|
|
69
|
-
aminoType: "sparkdream/x/federation/MsgResumePeer",
|
|
70
|
-
toAmino: MsgResumePeer.toAmino,
|
|
71
|
-
fromAmino: MsgResumePeer.fromAmino
|
|
72
|
-
},
|
|
73
|
-
"/sparkdream.federation.v1.MsgUpdatePeerPolicy": {
|
|
74
|
-
aminoType: "sparkdream/x/federation/MsgUpdatePeerPolicy",
|
|
75
|
-
toAmino(message) {
|
|
76
|
-
const obj = {};
|
|
77
|
-
obj.authority = message.authority === "" ? undefined : message.authority;
|
|
78
|
-
obj.peer_id = message.peerId === "" ? undefined : message.peerId;
|
|
79
|
-
obj.policy = message.policy ? peerPolicyToAmino(message.policy) : undefined;
|
|
80
|
-
return obj;
|
|
81
|
-
},
|
|
82
|
-
fromAmino: MsgUpdatePeerPolicy.fromAmino
|
|
83
|
-
},
|
|
84
|
-
"/sparkdream.federation.v1.MsgRegisterBridge": {
|
|
85
|
-
aminoType: "sparkdream/x/federation/MsgRegisterBridge",
|
|
86
|
-
toAmino: MsgRegisterBridge.toAmino,
|
|
87
|
-
fromAmino: MsgRegisterBridge.fromAmino
|
|
88
|
-
},
|
|
89
|
-
"/sparkdream.federation.v1.MsgUpdateBridge": {
|
|
90
|
-
aminoType: "sparkdream/x/federation/MsgUpdateBridge",
|
|
91
|
-
toAmino: MsgUpdateBridge.toAmino,
|
|
92
|
-
fromAmino: MsgUpdateBridge.fromAmino
|
|
93
|
-
},
|
|
94
|
-
"/sparkdream.federation.v1.MsgSubmitFederatedContent": {
|
|
95
|
-
aminoType: "sparkdream/x/federation/MsgSubmitFederatedContent",
|
|
96
|
-
toAmino: MsgSubmitFederatedContent.toAmino,
|
|
97
|
-
fromAmino: MsgSubmitFederatedContent.fromAmino
|
|
98
|
-
},
|
|
99
|
-
"/sparkdream.federation.v1.MsgFederateContent": {
|
|
100
|
-
aminoType: "sparkdream/x/federation/MsgFederateContent",
|
|
101
|
-
toAmino: MsgFederateContent.toAmino,
|
|
102
|
-
fromAmino: MsgFederateContent.fromAmino
|
|
103
|
-
},
|
|
104
|
-
"/sparkdream.federation.v1.MsgAttestOutbound": {
|
|
105
|
-
aminoType: "sparkdream/x/federation/MsgAttestOutbound",
|
|
106
|
-
toAmino: MsgAttestOutbound.toAmino,
|
|
107
|
-
fromAmino: MsgAttestOutbound.fromAmino
|
|
108
|
-
},
|
|
109
|
-
"/sparkdream.federation.v1.MsgModerateContent": {
|
|
110
|
-
aminoType: "sparkdream/x/federation/MsgModerateContent",
|
|
111
|
-
toAmino: MsgModerateContent.toAmino,
|
|
112
|
-
fromAmino: MsgModerateContent.fromAmino
|
|
113
|
-
},
|
|
114
|
-
"/sparkdream.federation.v1.MsgLinkIdentity": {
|
|
115
|
-
aminoType: "sparkdream/x/federation/MsgLinkIdentity",
|
|
116
|
-
toAmino: MsgLinkIdentity.toAmino,
|
|
117
|
-
fromAmino: MsgLinkIdentity.fromAmino
|
|
118
|
-
},
|
|
119
|
-
"/sparkdream.federation.v1.MsgUnlinkIdentity": {
|
|
120
|
-
aminoType: "sparkdream/x/federation/MsgUnlinkIdentity",
|
|
121
|
-
toAmino: MsgUnlinkIdentity.toAmino,
|
|
122
|
-
fromAmino: MsgUnlinkIdentity.fromAmino
|
|
123
|
-
},
|
|
124
|
-
"/sparkdream.federation.v1.MsgConfirmIdentityLink": {
|
|
125
|
-
aminoType: "sparkdream/x/federation/MsgConfirmIdentityLink",
|
|
126
|
-
toAmino: MsgConfirmIdentityLink.toAmino,
|
|
127
|
-
fromAmino: MsgConfirmIdentityLink.fromAmino
|
|
128
|
-
},
|
|
129
|
-
"/sparkdream.federation.v1.MsgRequestReputationAttestation": {
|
|
130
|
-
aminoType: "sparkdream/x/federation/MsgRequestReputationAttestation",
|
|
131
|
-
toAmino: MsgRequestReputationAttestation.toAmino,
|
|
132
|
-
fromAmino: MsgRequestReputationAttestation.fromAmino
|
|
133
|
-
},
|
|
134
|
-
"/sparkdream.federation.v1.MsgVerifyContent": {
|
|
135
|
-
aminoType: "sparkdream/x/federation/MsgVerifyContent",
|
|
136
|
-
toAmino: MsgVerifyContent.toAmino,
|
|
137
|
-
fromAmino: MsgVerifyContent.fromAmino
|
|
138
|
-
},
|
|
139
|
-
"/sparkdream.federation.v1.MsgChallengeVerification": {
|
|
140
|
-
aminoType: "sparkdream/x/federation/MsgChallengeVerification",
|
|
141
|
-
toAmino: MsgChallengeVerification.toAmino,
|
|
142
|
-
fromAmino: MsgChallengeVerification.fromAmino
|
|
143
|
-
},
|
|
144
|
-
"/sparkdream.federation.v1.MsgSubmitArbiterHash": {
|
|
145
|
-
aminoType: "sparkdream/x/federation/MsgSubmitArbiterHash",
|
|
146
|
-
toAmino: MsgSubmitArbiterHash.toAmino,
|
|
147
|
-
fromAmino: MsgSubmitArbiterHash.fromAmino
|
|
148
|
-
},
|
|
149
|
-
"/sparkdream.federation.v1.MsgEscalateChallenge": {
|
|
150
|
-
aminoType: "sparkdream/x/federation/MsgEscalateChallenge",
|
|
151
|
-
toAmino: MsgEscalateChallenge.toAmino,
|
|
152
|
-
fromAmino: MsgEscalateChallenge.fromAmino
|
|
153
|
-
},
|
|
154
|
-
"/sparkdream.federation.v1.MsgResolveEscalatedChallenge": {
|
|
155
|
-
aminoType: "sparkdream/x/federation/MsgResolveEscalatedChallenge",
|
|
156
|
-
toAmino: MsgResolveEscalatedChallenge.toAmino,
|
|
157
|
-
fromAmino: MsgResolveEscalatedChallenge.fromAmino
|
|
158
|
-
},
|
|
159
|
-
"/sparkdream.federation.v1.MsgUpdateOperationalParams": {
|
|
160
|
-
aminoType: "sparkdream/x/federation/MsgUpdateOperationalParams",
|
|
161
|
-
toAmino: MsgUpdateOperationalParams.toAmino,
|
|
162
|
-
fromAmino: MsgUpdateOperationalParams.fromAmino
|
|
163
|
-
},
|
|
164
|
-
"/sparkdream.federation.v1.MsgUpdatePeerController": {
|
|
165
|
-
aminoType: "sparkdream/x/federation/MsgUpdatePeerController",
|
|
166
|
-
toAmino: MsgUpdatePeerController.toAmino,
|
|
167
|
-
fromAmino: MsgUpdatePeerController.fromAmino
|
|
168
|
-
},
|
|
169
|
-
"/sparkdream.federation.v1.MsgResyncBridgeCount": {
|
|
170
|
-
aminoType: "sparkdream/x/federation/MsgResyncBridgeCount",
|
|
171
|
-
toAmino: MsgResyncBridgeCount.toAmino,
|
|
172
|
-
fromAmino: MsgResyncBridgeCount.fromAmino
|
|
173
|
-
},
|
|
174
|
-
"/sparkdream.federation.v1.MsgPruneOrphanBindings": {
|
|
175
|
-
aminoType: "sparkdream/x/federation/MsgPruneOrphanBindings",
|
|
176
|
-
toAmino: MsgPruneOrphanBindings.toAmino,
|
|
177
|
-
fromAmino: MsgPruneOrphanBindings.fromAmino
|
|
178
|
-
}
|
|
179
|
-
};
|
|
12
|
+
// MAINTENANCE: none per message. The schema (amino-schema.ts, regenerated from
|
|
13
|
+
// the chain on every proto sync) lists every Msg; __tests__/amino-golden.test.ts
|
|
14
|
+
// checks them all against the chain's encoder.
|
|
15
|
+
import * as tx from "./tx";
|
|
16
|
+
import { chainAminoConverters } from "../../../chain-amino";
|
|
17
|
+
export const AminoConverter = chainAminoConverters("sparkdream.federation.v1", tx);
|