@sparkdreamnft/sparkdreamjs 0.0.36 → 0.0.37

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.
Files changed (33) hide show
  1. package/esm/sparkdream/federation/v1/genesis.js +101 -3
  2. package/esm/sparkdream/federation/v1/params.js +129 -117
  3. package/esm/sparkdream/federation/v1/query.js +204 -7
  4. package/esm/sparkdream/federation/v1/query.lcd.js +11 -2
  5. package/esm/sparkdream/federation/v1/query.rpc.Query.js +16 -3
  6. package/esm/sparkdream/federation/v1/types.js +73 -1
  7. package/esm/sparkdream/federation/v1/verifier_activity.js +143 -45
  8. package/esm/sparkdream/rep/v1/bonded_role.js +37 -1
  9. package/esm/sparkdream/rep/v1/params.js +194 -2
  10. package/esm/sparkdream/rep/v1/role_activity.js +13 -1
  11. package/package.json +1 -1
  12. package/sparkdream/bundle.d.ts +50 -0
  13. package/sparkdream/federation/v1/genesis.d.ts +66 -0
  14. package/sparkdream/federation/v1/genesis.js +102 -4
  15. package/sparkdream/federation/v1/params.d.ts +72 -10
  16. package/sparkdream/federation/v1/params.js +129 -117
  17. package/sparkdream/federation/v1/query.d.ts +120 -3
  18. package/sparkdream/federation/v1/query.js +204 -7
  19. package/sparkdream/federation/v1/query.lcd.d.ts +2 -1
  20. package/sparkdream/federation/v1/query.lcd.js +11 -2
  21. package/sparkdream/federation/v1/query.rpc.Query.d.ts +13 -3
  22. package/sparkdream/federation/v1/query.rpc.Query.js +15 -2
  23. package/sparkdream/federation/v1/types.d.ts +44 -0
  24. package/sparkdream/federation/v1/types.js +73 -1
  25. package/sparkdream/federation/v1/verifier_activity.d.ts +151 -68
  26. package/sparkdream/federation/v1/verifier_activity.js +144 -46
  27. package/sparkdream/rep/v1/bonded_role.d.ts +42 -0
  28. package/sparkdream/rep/v1/bonded_role.js +37 -1
  29. package/sparkdream/rep/v1/params.d.ts +96 -0
  30. package/sparkdream/rep/v1/params.js +194 -2
  31. package/sparkdream/rep/v1/role_activity.d.ts +26 -0
  32. package/sparkdream/rep/v1/role_activity.js +13 -1
  33. package/sparkdream/rpc.query.d.ts +1 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GenesisState = void 0;
3
+ exports.OperatorRewardDayFunding = exports.GenesisState = void 0;
4
4
  //@ts-nocheck
5
5
  const params_1 = require("./params");
6
6
  const types_1 = require("./types");
@@ -20,7 +20,8 @@ function createBaseGenesisState() {
20
20
  verifierActivities: [],
21
21
  verificationRecords: [],
22
22
  nextContentId: BigInt(0),
23
- nextOutboundAttestationId: BigInt(0)
23
+ nextOutboundAttestationId: BigInt(0),
24
+ operatorRewardDayFundingList: []
24
25
  };
25
26
  }
26
27
  /**
@@ -60,7 +61,7 @@ exports.GenesisState = {
60
61
  types_1.OutboundAttestation.encode(v, writer.uint32(74).fork()).ldelim();
61
62
  }
62
63
  for (const v of message.verifierActivities) {
63
- verifier_activity_1.VerifierActivity.encode(v, writer.uint32(114).fork()).ldelim();
64
+ verifier_activity_1.VerifierActivity.encode(v, writer.uint32(82).fork()).ldelim();
64
65
  }
65
66
  for (const v of message.verificationRecords) {
66
67
  types_1.VerificationRecord.encode(v, writer.uint32(90).fork()).ldelim();
@@ -71,6 +72,9 @@ exports.GenesisState = {
71
72
  if (message.nextOutboundAttestationId !== BigInt(0)) {
72
73
  writer.uint32(104).uint64(message.nextOutboundAttestationId);
73
74
  }
75
+ for (const v of message.operatorRewardDayFundingList) {
76
+ exports.OperatorRewardDayFunding.encode(v, writer.uint32(114).fork()).ldelim();
77
+ }
74
78
  return writer;
75
79
  },
76
80
  decode(input, length) {
@@ -107,7 +111,7 @@ exports.GenesisState = {
107
111
  case 9:
108
112
  message.outboundAttestations.push(types_1.OutboundAttestation.decode(reader, reader.uint32()));
109
113
  break;
110
- case 14:
114
+ case 10:
111
115
  message.verifierActivities.push(verifier_activity_1.VerifierActivity.decode(reader, reader.uint32()));
112
116
  break;
113
117
  case 11:
@@ -119,6 +123,9 @@ exports.GenesisState = {
119
123
  case 13:
120
124
  message.nextOutboundAttestationId = reader.uint64();
121
125
  break;
126
+ case 14:
127
+ message.operatorRewardDayFundingList.push(exports.OperatorRewardDayFunding.decode(reader, reader.uint32()));
128
+ break;
122
129
  default:
123
130
  reader.skipType(tag & 7);
124
131
  break;
@@ -141,6 +148,7 @@ exports.GenesisState = {
141
148
  message.verificationRecords = object.verificationRecords?.map(e => types_1.VerificationRecord.fromPartial(e)) || [];
142
149
  message.nextContentId = object.nextContentId !== undefined && object.nextContentId !== null ? BigInt(object.nextContentId.toString()) : BigInt(0);
143
150
  message.nextOutboundAttestationId = object.nextOutboundAttestationId !== undefined && object.nextOutboundAttestationId !== null ? BigInt(object.nextOutboundAttestationId.toString()) : BigInt(0);
151
+ message.operatorRewardDayFundingList = object.operatorRewardDayFundingList?.map(e => exports.OperatorRewardDayFunding.fromPartial(e)) || [];
144
152
  return message;
145
153
  },
146
154
  fromAmino(object) {
@@ -166,6 +174,7 @@ exports.GenesisState = {
166
174
  if (object.next_outbound_attestation_id !== undefined && object.next_outbound_attestation_id !== null) {
167
175
  message.nextOutboundAttestationId = BigInt(object.next_outbound_attestation_id);
168
176
  }
177
+ message.operatorRewardDayFundingList = object.operator_reward_day_funding_list?.map(e => exports.OperatorRewardDayFunding.fromAmino(e)) || [];
169
178
  return message;
170
179
  },
171
180
  toAmino(message) {
@@ -228,6 +237,12 @@ exports.GenesisState = {
228
237
  }
229
238
  obj.next_content_id = message.nextContentId !== BigInt(0) ? message.nextContentId?.toString() : undefined;
230
239
  obj.next_outbound_attestation_id = message.nextOutboundAttestationId !== BigInt(0) ? message.nextOutboundAttestationId?.toString() : undefined;
240
+ if (message.operatorRewardDayFundingList) {
241
+ obj.operator_reward_day_funding_list = message.operatorRewardDayFundingList.map(e => e ? exports.OperatorRewardDayFunding.toAmino(e) : undefined);
242
+ }
243
+ else {
244
+ obj.operator_reward_day_funding_list = message.operatorRewardDayFundingList;
245
+ }
231
246
  return obj;
232
247
  },
233
248
  fromAminoMsg(object) {
@@ -246,3 +261,86 @@ exports.GenesisState = {
246
261
  };
247
262
  }
248
263
  };
264
+ function createBaseOperatorRewardDayFunding() {
265
+ return {
266
+ day: BigInt(0),
267
+ amountFunded: ""
268
+ };
269
+ }
270
+ /**
271
+ * OperatorRewardDayFunding is one UTC day's community-pool draw for the
272
+ * bridge-operator reward pool, ledgered so the daily cap bounds a day rather
273
+ * than a block.
274
+ * @name OperatorRewardDayFunding
275
+ * @package sparkdream.federation.v1
276
+ * @see proto type: sparkdream.federation.v1.OperatorRewardDayFunding
277
+ */
278
+ exports.OperatorRewardDayFunding = {
279
+ typeUrl: "/sparkdream.federation.v1.OperatorRewardDayFunding",
280
+ encode(message, writer = binary_1.BinaryWriter.create()) {
281
+ if (message.day !== BigInt(0)) {
282
+ writer.uint32(8).uint64(message.day);
283
+ }
284
+ if (message.amountFunded !== "") {
285
+ writer.uint32(18).string(message.amountFunded);
286
+ }
287
+ return writer;
288
+ },
289
+ decode(input, length) {
290
+ const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
291
+ let end = length === undefined ? reader.len : reader.pos + length;
292
+ const message = createBaseOperatorRewardDayFunding();
293
+ while (reader.pos < end) {
294
+ const tag = reader.uint32();
295
+ switch (tag >>> 3) {
296
+ case 1:
297
+ message.day = reader.uint64();
298
+ break;
299
+ case 2:
300
+ message.amountFunded = reader.string();
301
+ break;
302
+ default:
303
+ reader.skipType(tag & 7);
304
+ break;
305
+ }
306
+ }
307
+ return message;
308
+ },
309
+ fromPartial(object) {
310
+ const message = createBaseOperatorRewardDayFunding();
311
+ message.day = object.day !== undefined && object.day !== null ? BigInt(object.day.toString()) : BigInt(0);
312
+ message.amountFunded = object.amountFunded ?? "";
313
+ return message;
314
+ },
315
+ fromAmino(object) {
316
+ const message = createBaseOperatorRewardDayFunding();
317
+ if (object.day !== undefined && object.day !== null) {
318
+ message.day = BigInt(object.day);
319
+ }
320
+ if (object.amount_funded !== undefined && object.amount_funded !== null) {
321
+ message.amountFunded = object.amount_funded;
322
+ }
323
+ return message;
324
+ },
325
+ toAmino(message) {
326
+ const obj = {};
327
+ obj.day = message.day !== BigInt(0) ? message.day?.toString() : undefined;
328
+ obj.amount_funded = message.amountFunded === "" ? undefined : message.amountFunded;
329
+ return obj;
330
+ },
331
+ fromAminoMsg(object) {
332
+ return exports.OperatorRewardDayFunding.fromAmino(object.value);
333
+ },
334
+ fromProtoMsg(message) {
335
+ return exports.OperatorRewardDayFunding.decode(message.value);
336
+ },
337
+ toProto(message) {
338
+ return exports.OperatorRewardDayFunding.encode(message).finish();
339
+ },
340
+ toProtoMsg(message) {
341
+ return {
342
+ typeUrl: "/sparkdream.federation.v1.OperatorRewardDayFunding",
343
+ value: exports.OperatorRewardDayFunding.encode(message).finish()
344
+ };
345
+ }
346
+ };
@@ -86,12 +86,43 @@ export interface Params {
86
86
  challengeJuryDeadline: Duration;
87
87
  verifierDemotionCooldown: Duration;
88
88
  verifierOverturnBaseCooldown: Duration;
89
+ /**
90
+ * upheld_to_reset_overturns is how many CONSECUTIVE upheld verdicts clear a
91
+ * verifier's overturn streak. Federation owns the value; x/rep enforces it,
92
+ * via BondedRoleConfig.upheld_to_reset_overturns written through by
93
+ * SyncVerifierBondedRoleConfig -- same path as the two cooldowns above.
94
+ */
89
95
  upheldToResetOverturns: number;
90
- minEpochVerifications: number;
91
- minVerifierAccuracy: string;
92
- operatorRewardShare: string;
93
- verifierDreamReward: string;
94
- maxVerifierDreamMintPerEpoch: string;
96
+ /**
97
+ * operator_reward_inflation_share is the fraction of the community pool's
98
+ * INFLATION income federation may draw per UTC day:
99
+ *
100
+ * daily_allowance = annual_provisions * community_tax * share / 365
101
+ *
102
+ * A share rather than a fixed amount, for the reason x/rep documents: a
103
+ * fixed draw takes its largest share of the pool exactly when the pool is
104
+ * poorest. The base is the inflation rate, never the pool balance -- the
105
+ * balance holds the genesis allocation earmarked for the councils. Zero
106
+ * disables automatic funding, leaving the pool to direct sends.
107
+ */
108
+ operatorRewardInflationShare: string;
109
+ /**
110
+ * Upper cap on the pool; excess is burned at the ratio below, so an
111
+ * over-funded pool cannot sit as a standing prize.
112
+ */
113
+ maxOperatorRewardPool: string;
114
+ operatorRewardPoolOverflowBurnRatio: string;
115
+ operatorRewardEpochBlocks: bigint;
116
+ /**
117
+ * Minimum independently-verified submissions in an epoch to earn anything.
118
+ */
119
+ minEpochVerifiedSubmissions: number;
120
+ /**
121
+ * Ceiling on epoch_unverified / epoch_submitted. An operator flooding the
122
+ * queue with content no verifier will confirm is spending verifier
123
+ * attention rather than producing value.
124
+ */
125
+ maxUnverifiedRate: string;
95
126
  /**
96
127
  * Anonymous challenge resolution
97
128
  */
@@ -204,12 +235,43 @@ export interface ParamsAmino {
204
235
  challenge_jury_deadline?: DurationAmino;
205
236
  verifier_demotion_cooldown?: DurationAmino;
206
237
  verifier_overturn_base_cooldown?: DurationAmino;
238
+ /**
239
+ * upheld_to_reset_overturns is how many CONSECUTIVE upheld verdicts clear a
240
+ * verifier's overturn streak. Federation owns the value; x/rep enforces it,
241
+ * via BondedRoleConfig.upheld_to_reset_overturns written through by
242
+ * SyncVerifierBondedRoleConfig -- same path as the two cooldowns above.
243
+ */
207
244
  upheld_to_reset_overturns?: number;
208
- min_epoch_verifications?: number;
209
- min_verifier_accuracy?: string;
210
- operator_reward_share?: string;
211
- verifier_dream_reward?: string;
212
- max_verifier_dream_mint_per_epoch?: string;
245
+ /**
246
+ * operator_reward_inflation_share is the fraction of the community pool's
247
+ * INFLATION income federation may draw per UTC day:
248
+ *
249
+ * daily_allowance = annual_provisions * community_tax * share / 365
250
+ *
251
+ * A share rather than a fixed amount, for the reason x/rep documents: a
252
+ * fixed draw takes its largest share of the pool exactly when the pool is
253
+ * poorest. The base is the inflation rate, never the pool balance -- the
254
+ * balance holds the genesis allocation earmarked for the councils. Zero
255
+ * disables automatic funding, leaving the pool to direct sends.
256
+ */
257
+ operator_reward_inflation_share?: string;
258
+ /**
259
+ * Upper cap on the pool; excess is burned at the ratio below, so an
260
+ * over-funded pool cannot sit as a standing prize.
261
+ */
262
+ max_operator_reward_pool?: string;
263
+ operator_reward_pool_overflow_burn_ratio?: string;
264
+ operator_reward_epoch_blocks?: string;
265
+ /**
266
+ * Minimum independently-verified submissions in an epoch to earn anything.
267
+ */
268
+ min_epoch_verified_submissions?: number;
269
+ /**
270
+ * Ceiling on epoch_unverified / epoch_submitted. An operator flooding the
271
+ * queue with content no verifier will confirm is spending verifier
272
+ * attention rather than producing value.
273
+ */
274
+ max_unverified_rate?: string;
213
275
  /**
214
276
  * Anonymous challenge resolution
215
277
  */