@sparkdreamnft/sparkdreamjs 0.0.17 → 0.0.19
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/cosmos/bundle.d.ts +160 -160
- package/cosmos/bundle.js +182 -182
- package/esm/cosmos/bundle.js +182 -182
- package/esm/ibc/bundle.js +106 -106
- package/esm/sparkdream/blog/v1/params.js +113 -52
- package/esm/sparkdream/blog/v1/tx.js +583 -2
- package/esm/sparkdream/blog/v1/tx.registry.js +74 -2
- package/esm/sparkdream/blog/v1/tx.rpc.msg.js +33 -3
- package/esm/sparkdream/bundle.js +448 -346
- package/esm/sparkdream/client.js +7 -1
- package/esm/sparkdream/collect/v1/params.js +121 -1
- package/esm/sparkdream/collect/v1/tx.js +293 -1
- package/esm/sparkdream/collect/v1/tx.registry.js +38 -2
- package/esm/sparkdream/collect/v1/tx.rpc.msg.js +17 -2
- package/esm/sparkdream/collect/v1/types.js +147 -3
- package/esm/sparkdream/commons/v1/genesis.js +29 -1
- package/esm/sparkdream/commons/v1/query.js +317 -0
- package/esm/sparkdream/commons/v1/query.lcd.js +23 -0
- package/esm/sparkdream/commons/v1/query.rpc.Query.js +20 -1
- package/esm/sparkdream/commons/v1/recurring_spend.js +296 -0
- package/esm/sparkdream/commons/v1/tx.js +693 -0
- package/esm/sparkdream/commons/v1/tx.registry.js +74 -2
- package/esm/sparkdream/commons/v1/tx.rpc.msg.js +33 -1
- package/esm/sparkdream/federation/v1/genesis.js +10 -10
- package/esm/sparkdream/federation/v1/params.js +29 -54
- package/esm/sparkdream/federation/v1/query.js +216 -71
- package/esm/sparkdream/federation/v1/query.lcd.js +11 -6
- package/esm/sparkdream/federation/v1/query.rpc.Query.js +24 -15
- package/esm/sparkdream/federation/v1/tx.amino.js +21 -21
- package/esm/sparkdream/federation/v1/tx.js +1146 -1105
- package/esm/sparkdream/federation/v1/tx.registry.js +74 -74
- package/esm/sparkdream/federation/v1/tx.rpc.msg.js +32 -26
- package/esm/sparkdream/federation/v1/types.js +355 -99
- package/esm/sparkdream/federation/v1/verifier_activity.js +13 -1
- package/esm/sparkdream/forum/v1/params.js +389 -148
- package/esm/sparkdream/forum/v1/post.js +25 -1
- package/esm/sparkdream/forum/v1/tx.js +460 -0
- package/esm/sparkdream/forum/v1/tx.registry.js +56 -2
- package/esm/sparkdream/forum/v1/tx.rpc.msg.js +30 -1
- package/esm/sparkdream/forum/v1/types.js +355 -0
- package/esm/sparkdream/forum/v1/user_rate_limit.js +41 -2
- package/esm/sparkdream/guardian/module/v1/module.js +68 -0
- package/esm/sparkdream/guardian/v1/query.js +128 -0
- package/esm/sparkdream/guardian/v1/query.lcd.js +13 -0
- package/esm/sparkdream/guardian/v1/query.rpc.Query.js +26 -0
- package/esm/sparkdream/guardian/v1/tx.amino.js +9 -0
- package/esm/sparkdream/guardian/v1/tx.js +175 -0
- package/esm/sparkdream/guardian/v1/tx.registry.js +33 -0
- package/esm/sparkdream/guardian/v1/tx.rpc.msg.js +24 -0
- package/esm/sparkdream/identity/module/v1/module.js +71 -0
- package/esm/sparkdream/identity/v1/chain_identity.js +199 -0
- package/esm/sparkdream/identity/v1/genesis.js +84 -0
- package/esm/sparkdream/identity/v1/query.js +372 -0
- package/esm/sparkdream/identity/v1/query.lcd.js +21 -0
- package/esm/sparkdream/identity/v1/query.rpc.Query.js +42 -0
- package/esm/sparkdream/lcd.js +15 -0
- package/esm/sparkdream/name/v1/params.js +19 -18
- package/esm/sparkdream/rep/v1/bonded_role.js +48 -2
- package/esm/sparkdream/rep/v1/member.js +209 -1
- package/esm/sparkdream/rep/v1/tag.js +6 -13
- package/esm/sparkdream/rpc.query.js +9 -0
- package/esm/sparkdream/rpc.tx.js +6 -0
- package/esm/sparkdream/service/module/v1/module.js +71 -0
- package/esm/sparkdream/service/v1/controller_transfer_case.js +155 -0
- package/esm/sparkdream/service/v1/genesis.js +240 -0
- package/esm/sparkdream/service/v1/operator.js +250 -0
- package/esm/sparkdream/service/v1/params.js +355 -0
- package/esm/sparkdream/service/v1/query.js +1582 -0
- package/esm/sparkdream/service/v1/query.lcd.js +107 -0
- package/esm/sparkdream/service/v1/query.rpc.Query.js +109 -0
- package/esm/sparkdream/service/v1/refile_cooldown.js +121 -0
- package/esm/sparkdream/service/v1/report.js +212 -0
- package/esm/sparkdream/service/v1/reporter_rate_limit.js +137 -0
- package/esm/sparkdream/service/v1/service_type_config.js +264 -0
- package/esm/sparkdream/service/v1/system_report_rate_limit.js +115 -0
- package/esm/sparkdream/service/v1/tier1_escrow_entry.js +145 -0
- package/esm/sparkdream/service/v1/tier1_last_slash.js +121 -0
- package/esm/sparkdream/service/v1/tx.amino.js +69 -0
- package/esm/sparkdream/service/v1/tx.js +2124 -0
- package/esm/sparkdream/service/v1/tx.registry.js +249 -0
- package/esm/sparkdream/service/v1/tx.rpc.msg.js +100 -0
- package/esm/sparkdream/service/v1/types.js +353 -0
- package/esm/sparkdream/session/v1/genesis.js +136 -10
- package/esm/sparkdream/session/v1/grant.js +1020 -0
- package/esm/sparkdream/session/v1/params.js +543 -19
- package/esm/sparkdream/session/v1/query.js +487 -0
- package/esm/sparkdream/session/v1/query.lcd.js +41 -3
- package/esm/sparkdream/session/v1/query.rpc.Query.js +36 -4
- package/esm/sparkdream/session/v1/session.js +6 -0
- package/esm/sparkdream/session/v1/tx.js +1066 -0
- package/esm/sparkdream/session/v1/tx.registry.js +110 -2
- package/esm/sparkdream/session/v1/tx.rpc.msg.js +65 -3
- package/esm/tendermint/bundle.js +20 -20
- package/ibc/bundle.d.ts +90 -90
- package/ibc/bundle.js +106 -106
- package/package.json +1 -1
- package/sparkdream/blog/v1/params.d.ts +89 -28
- package/sparkdream/blog/v1/params.js +113 -52
- package/sparkdream/blog/v1/post.d.ts +2 -2
- package/sparkdream/blog/v1/tx.d.ts +385 -10
- package/sparkdream/blog/v1/tx.js +584 -3
- package/sparkdream/blog/v1/tx.registry.d.ts +49 -1
- package/sparkdream/blog/v1/tx.registry.js +73 -1
- package/sparkdream/blog/v1/tx.rpc.msg.d.ts +27 -3
- package/sparkdream/blog/v1/tx.rpc.msg.js +32 -2
- package/sparkdream/bundle.d.ts +15308 -12896
- package/sparkdream/bundle.js +448 -346
- package/sparkdream/client.d.ts +90 -20
- package/sparkdream/client.js +7 -1
- package/sparkdream/collect/v1/params.d.ts +140 -0
- package/sparkdream/collect/v1/params.js +121 -1
- package/sparkdream/collect/v1/tx.d.ts +195 -3
- package/sparkdream/collect/v1/tx.js +294 -2
- package/sparkdream/collect/v1/tx.registry.d.ts +25 -1
- package/sparkdream/collect/v1/tx.registry.js +37 -1
- package/sparkdream/collect/v1/tx.rpc.msg.d.ts +15 -2
- package/sparkdream/collect/v1/tx.rpc.msg.js +16 -1
- package/sparkdream/collect/v1/types.d.ts +114 -0
- package/sparkdream/collect/v1/types.js +147 -3
- package/sparkdream/commons/v1/genesis.d.ts +17 -0
- package/sparkdream/commons/v1/genesis.js +29 -1
- package/sparkdream/commons/v1/query.d.ts +186 -0
- package/sparkdream/commons/v1/query.js +318 -1
- package/sparkdream/commons/v1/query.lcd.d.ts +3 -1
- package/sparkdream/commons/v1/query.lcd.js +23 -0
- package/sparkdream/commons/v1/query.rpc.Query.d.ts +12 -1
- package/sparkdream/commons/v1/query.rpc.Query.js +19 -0
- package/sparkdream/commons/v1/recurring_spend.d.ts +234 -0
- package/sparkdream/commons/v1/recurring_spend.js +301 -0
- package/sparkdream/commons/v1/tx.d.ts +472 -0
- package/sparkdream/commons/v1/tx.js +694 -1
- package/sparkdream/commons/v1/tx.registry.d.ts +49 -1
- package/sparkdream/commons/v1/tx.registry.js +73 -1
- package/sparkdream/commons/v1/tx.rpc.msg.d.ts +29 -1
- package/sparkdream/commons/v1/tx.rpc.msg.js +32 -0
- package/sparkdream/federation/v1/genesis.d.ts +3 -3
- package/sparkdream/federation/v1/genesis.js +9 -9
- package/sparkdream/federation/v1/params.d.ts +64 -13
- package/sparkdream/federation/v1/params.js +29 -54
- package/sparkdream/federation/v1/query.d.ts +209 -100
- package/sparkdream/federation/v1/query.js +216 -71
- package/sparkdream/federation/v1/query.lcd.d.ts +4 -3
- package/sparkdream/federation/v1/query.lcd.js +11 -6
- package/sparkdream/federation/v1/query.rpc.Query.d.ts +10 -7
- package/sparkdream/federation/v1/query.rpc.Query.js +24 -15
- package/sparkdream/federation/v1/tx.amino.d.ts +21 -21
- package/sparkdream/federation/v1/tx.amino.js +20 -20
- package/sparkdream/federation/v1/tx.d.ts +479 -352
- package/sparkdream/federation/v1/tx.js +1147 -1106
- package/sparkdream/federation/v1/tx.registry.d.ts +49 -49
- package/sparkdream/federation/v1/tx.registry.js +73 -73
- package/sparkdream/federation/v1/tx.rpc.msg.d.ts +18 -9
- package/sparkdream/federation/v1/tx.rpc.msg.js +31 -25
- package/sparkdream/federation/v1/types.d.ts +307 -41
- package/sparkdream/federation/v1/types.js +360 -100
- package/sparkdream/federation/v1/verifier_activity.d.ts +18 -0
- package/sparkdream/federation/v1/verifier_activity.js +13 -1
- package/sparkdream/forum/v1/params.d.ts +309 -62
- package/sparkdream/forum/v1/params.js +389 -148
- package/sparkdream/forum/v1/post.d.ts +28 -0
- package/sparkdream/forum/v1/post.js +25 -1
- package/sparkdream/forum/v1/tx.d.ts +291 -0
- package/sparkdream/forum/v1/tx.js +462 -2
- package/sparkdream/forum/v1/tx.registry.d.ts +37 -1
- package/sparkdream/forum/v1/tx.registry.js +55 -1
- package/sparkdream/forum/v1/tx.rpc.msg.d.ts +27 -1
- package/sparkdream/forum/v1/tx.rpc.msg.js +29 -0
- package/sparkdream/forum/v1/types.d.ts +247 -0
- package/sparkdream/forum/v1/types.js +356 -1
- package/sparkdream/forum/v1/user_rate_limit.d.ts +24 -3
- package/sparkdream/forum/v1/user_rate_limit.js +41 -2
- package/sparkdream/guardian/module/v1/module.d.ts +74 -0
- package/sparkdream/guardian/module/v1/module.js +71 -0
- package/sparkdream/guardian/v1/query.d.ts +88 -0
- package/sparkdream/guardian/v1/query.js +131 -0
- package/sparkdream/guardian/v1/query.lcd.d.ts +9 -0
- package/sparkdream/guardian/v1/query.lcd.js +17 -0
- package/sparkdream/guardian/v1/query.rpc.Query.d.ts +20 -0
- package/sparkdream/guardian/v1/query.rpc.Query.js +31 -0
- package/sparkdream/guardian/v1/tx.amino.d.ts +8 -0
- package/sparkdream/guardian/v1/tx.amino.js +12 -0
- package/sparkdream/guardian/v1/tx.d.ts +138 -0
- package/sparkdream/guardian/v1/tx.js +181 -0
- package/sparkdream/guardian/v1/tx.registry.d.ts +25 -0
- package/sparkdream/guardian/v1/tx.registry.js +37 -0
- package/sparkdream/guardian/v1/tx.rpc.msg.d.ts +22 -0
- package/sparkdream/guardian/v1/tx.rpc.msg.js +29 -0
- package/sparkdream/identity/module/v1/module.d.ts +54 -0
- package/sparkdream/identity/module/v1/module.js +74 -0
- package/sparkdream/identity/v1/chain_identity.d.ts +131 -0
- package/sparkdream/identity/v1/chain_identity.js +202 -0
- package/sparkdream/identity/v1/genesis.d.ts +65 -0
- package/sparkdream/identity/v1/genesis.js +87 -0
- package/sparkdream/identity/v1/query.d.ts +243 -0
- package/sparkdream/identity/v1/query.js +375 -0
- package/sparkdream/identity/v1/query.lcd.d.ts +11 -0
- package/sparkdream/identity/v1/query.lcd.js +25 -0
- package/sparkdream/identity/v1/query.rpc.Query.d.ts +26 -0
- package/sparkdream/identity/v1/query.rpc.Query.js +47 -0
- package/sparkdream/lcd.d.ts +9 -0
- package/sparkdream/lcd.js +15 -0
- package/sparkdream/name/v1/params.d.ts +25 -8
- package/sparkdream/name/v1/params.js +19 -18
- package/sparkdream/rep/v1/bonded_role.d.ts +51 -0
- package/sparkdream/rep/v1/bonded_role.js +48 -2
- package/sparkdream/rep/v1/member.d.ts +134 -0
- package/sparkdream/rep/v1/member.js +210 -2
- package/sparkdream/rep/v1/tag.d.ts +15 -2
- package/sparkdream/rep/v1/tag.js +6 -13
- package/sparkdream/rpc.query.d.ts +34 -2
- package/sparkdream/rpc.query.js +9 -0
- package/sparkdream/rpc.tx.d.ts +6 -0
- package/sparkdream/rpc.tx.js +6 -0
- package/sparkdream/service/module/v1/module.d.ts +54 -0
- package/sparkdream/service/module/v1/module.js +74 -0
- package/sparkdream/service/v1/controller_transfer_case.d.ts +125 -0
- package/sparkdream/service/v1/controller_transfer_case.js +158 -0
- package/sparkdream/service/v1/genesis.d.ts +172 -0
- package/sparkdream/service/v1/genesis.js +243 -0
- package/sparkdream/service/v1/operator.d.ts +215 -0
- package/sparkdream/service/v1/operator.js +253 -0
- package/sparkdream/service/v1/params.d.ts +346 -0
- package/sparkdream/service/v1/params.js +358 -0
- package/sparkdream/service/v1/query.d.ts +964 -0
- package/sparkdream/service/v1/query.js +1585 -0
- package/sparkdream/service/v1/query.lcd.d.ts +18 -0
- package/sparkdream/service/v1/query.lcd.js +111 -0
- package/sparkdream/service/v1/query.rpc.Query.d.ts +63 -0
- package/sparkdream/service/v1/query.rpc.Query.js +114 -0
- package/sparkdream/service/v1/refile_cooldown.d.ts +105 -0
- package/sparkdream/service/v1/refile_cooldown.js +124 -0
- package/sparkdream/service/v1/report.d.ts +174 -0
- package/sparkdream/service/v1/report.js +215 -0
- package/sparkdream/service/v1/reporter_rate_limit.d.ts +112 -0
- package/sparkdream/service/v1/reporter_rate_limit.js +140 -0
- package/sparkdream/service/v1/service_type_config.d.ts +222 -0
- package/sparkdream/service/v1/service_type_config.js +269 -0
- package/sparkdream/service/v1/system_report_rate_limit.d.ts +106 -0
- package/sparkdream/service/v1/system_report_rate_limit.js +118 -0
- package/sparkdream/service/v1/tier1_escrow_entry.d.ts +125 -0
- package/sparkdream/service/v1/tier1_escrow_entry.js +148 -0
- package/sparkdream/service/v1/tier1_last_slash.d.ts +101 -0
- package/sparkdream/service/v1/tier1_last_slash.js +124 -0
- package/sparkdream/service/v1/tx.amino.d.ts +68 -0
- package/sparkdream/service/v1/tx.amino.js +72 -0
- package/sparkdream/service/v1/tx.d.ts +1264 -0
- package/sparkdream/service/v1/tx.js +2127 -0
- package/sparkdream/service/v1/tx.registry.d.ts +169 -0
- package/sparkdream/service/v1/tx.registry.js +253 -0
- package/sparkdream/service/v1/tx.rpc.msg.d.ts +80 -0
- package/sparkdream/service/v1/tx.rpc.msg.js +105 -0
- package/sparkdream/service/v1/types.d.ts +94 -0
- package/sparkdream/service/v1/types.js +370 -0
- package/sparkdream/session/v1/genesis.d.ts +93 -9
- package/sparkdream/session/v1/genesis.js +137 -11
- package/sparkdream/session/v1/grant.d.ts +517 -0
- package/sparkdream/session/v1/grant.js +1027 -0
- package/sparkdream/session/v1/params.d.ts +338 -7
- package/sparkdream/session/v1/params.js +543 -19
- package/sparkdream/session/v1/query.d.ts +265 -0
- package/sparkdream/session/v1/query.js +488 -1
- package/sparkdream/session/v1/query.lcd.d.ts +4 -1
- package/sparkdream/session/v1/query.lcd.js +41 -3
- package/sparkdream/session/v1/query.rpc.Query.d.ts +27 -4
- package/sparkdream/session/v1/query.rpc.Query.js +35 -3
- package/sparkdream/session/v1/session.d.ts +18 -0
- package/sparkdream/session/v1/session.js +6 -0
- package/sparkdream/session/v1/tx.d.ts +660 -0
- package/sparkdream/session/v1/tx.js +1067 -1
- package/sparkdream/session/v1/tx.registry.d.ts +73 -1
- package/sparkdream/session/v1/tx.registry.js +109 -1
- package/sparkdream/session/v1/tx.rpc.msg.d.ts +63 -3
- package/sparkdream/session/v1/tx.rpc.msg.js +64 -2
- package/tendermint/bundle.d.ts +844 -844
- package/tendermint/bundle.js +20 -20
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import { setPaginationParams } from "../../../helpers";
|
|
3
|
+
export class LCDQueryClient {
|
|
4
|
+
req;
|
|
5
|
+
constructor({ requestClient }) {
|
|
6
|
+
this.req = requestClient;
|
|
7
|
+
}
|
|
8
|
+
/* Parameters queries the parameters of the module. */
|
|
9
|
+
params = async (_params = {}) => {
|
|
10
|
+
const endpoint = `sparkdream/service/v1/params`;
|
|
11
|
+
return await this.req.get(endpoint);
|
|
12
|
+
};
|
|
13
|
+
/* Operator returns the live operator record for (address, service_type). */
|
|
14
|
+
operator = async (params) => {
|
|
15
|
+
const endpoint = `sparkdream/service/v1/operator/${params.address}/${params.serviceType}`;
|
|
16
|
+
return await this.req.get(endpoint);
|
|
17
|
+
};
|
|
18
|
+
/* ServiceType returns one service-type registry entry. */
|
|
19
|
+
serviceType = async (params) => {
|
|
20
|
+
const endpoint = `sparkdream/service/v1/service_type/${params.serviceType}`;
|
|
21
|
+
return await this.req.get(endpoint);
|
|
22
|
+
};
|
|
23
|
+
/* ServiceTypes returns all service-type registry entries (paginated). */
|
|
24
|
+
serviceTypes = async (params) => {
|
|
25
|
+
const options = {
|
|
26
|
+
params: {}
|
|
27
|
+
};
|
|
28
|
+
if (typeof params?.enabledOnly !== "undefined") {
|
|
29
|
+
options.params.enabled_only = params.enabledOnly;
|
|
30
|
+
}
|
|
31
|
+
if (typeof params?.pagination !== "undefined") {
|
|
32
|
+
setPaginationParams(options, params.pagination);
|
|
33
|
+
}
|
|
34
|
+
const endpoint = `sparkdream/service/v1/service_types`;
|
|
35
|
+
return await this.req.get(endpoint, options);
|
|
36
|
+
};
|
|
37
|
+
/* Operators returns all live operator records (paginated, optionally
|
|
38
|
+
filtered by status). */
|
|
39
|
+
operators = async (params) => {
|
|
40
|
+
const options = {
|
|
41
|
+
params: {}
|
|
42
|
+
};
|
|
43
|
+
if (typeof params?.statusFilter !== "undefined") {
|
|
44
|
+
options.params.status_filter = params.statusFilter;
|
|
45
|
+
}
|
|
46
|
+
if (typeof params?.pagination !== "undefined") {
|
|
47
|
+
setPaginationParams(options, params.pagination);
|
|
48
|
+
}
|
|
49
|
+
const endpoint = `sparkdream/service/v1/operators`;
|
|
50
|
+
return await this.req.get(endpoint, options);
|
|
51
|
+
};
|
|
52
|
+
/* OperatorsByController returns live operators whose controller is the
|
|
53
|
+
given address. */
|
|
54
|
+
operatorsByController = async (params) => {
|
|
55
|
+
const options = {
|
|
56
|
+
params: {}
|
|
57
|
+
};
|
|
58
|
+
if (typeof params?.statusFilter !== "undefined") {
|
|
59
|
+
options.params.status_filter = params.statusFilter;
|
|
60
|
+
}
|
|
61
|
+
if (typeof params?.pagination !== "undefined") {
|
|
62
|
+
setPaginationParams(options, params.pagination);
|
|
63
|
+
}
|
|
64
|
+
const endpoint = `sparkdream/service/v1/operators_by_controller/${params.controller}`;
|
|
65
|
+
return await this.req.get(endpoint, options);
|
|
66
|
+
};
|
|
67
|
+
/* OperatorsByServiceType returns live operators of the given service type. */
|
|
68
|
+
operatorsByServiceType = async (params) => {
|
|
69
|
+
const options = {
|
|
70
|
+
params: {}
|
|
71
|
+
};
|
|
72
|
+
if (typeof params?.statusFilter !== "undefined") {
|
|
73
|
+
options.params.status_filter = params.statusFilter;
|
|
74
|
+
}
|
|
75
|
+
if (typeof params?.pagination !== "undefined") {
|
|
76
|
+
setPaginationParams(options, params.pagination);
|
|
77
|
+
}
|
|
78
|
+
const endpoint = `sparkdream/service/v1/operators_by_service_type/${params.serviceType}`;
|
|
79
|
+
return await this.req.get(endpoint, options);
|
|
80
|
+
};
|
|
81
|
+
/* Report returns a single report by id. */
|
|
82
|
+
report = async (params) => {
|
|
83
|
+
const endpoint = `sparkdream/service/v1/report/${params.reportId}`;
|
|
84
|
+
return await this.req.get(endpoint);
|
|
85
|
+
};
|
|
86
|
+
/* ReportsByOperator returns reports against (operator_address, service_type). */
|
|
87
|
+
reportsByOperator = async (params) => {
|
|
88
|
+
const options = {
|
|
89
|
+
params: {}
|
|
90
|
+
};
|
|
91
|
+
if (typeof params?.statusFilter !== "undefined") {
|
|
92
|
+
options.params.status_filter = params.statusFilter;
|
|
93
|
+
}
|
|
94
|
+
if (typeof params?.pagination !== "undefined") {
|
|
95
|
+
setPaginationParams(options, params.pagination);
|
|
96
|
+
}
|
|
97
|
+
const endpoint = `sparkdream/service/v1/reports_by_operator/${params.operatorAddress}/${params.serviceType}`;
|
|
98
|
+
return await this.req.get(endpoint, options);
|
|
99
|
+
};
|
|
100
|
+
/* OperatorReputationSnapshot returns bond-block totals for an address
|
|
101
|
+
(§6.6 lazy accrual visibility). Settles in-memory at query time; no
|
|
102
|
+
state write. */
|
|
103
|
+
operatorReputationSnapshot = async (params) => {
|
|
104
|
+
const endpoint = `sparkdream/service/v1/operator_reputation_snapshot/${params.address}`;
|
|
105
|
+
return await this.req.get(endpoint);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { BinaryReader } from "../../../binary";
|
|
2
|
+
import { createProtobufRpcClient } from "@cosmjs/stargate";
|
|
3
|
+
import { QueryParamsRequest, QueryParamsResponse, QueryOperatorRequest, QueryOperatorResponse, QueryServiceTypeRequest, QueryServiceTypeResponse, QueryServiceTypesRequest, QueryServiceTypesResponse, QueryOperatorsRequest, QueryOperatorsResponse, QueryOperatorsByControllerRequest, QueryOperatorsByControllerResponse, QueryOperatorsByServiceTypeRequest, QueryOperatorsByServiceTypeResponse, QueryReportRequest, QueryReportResponse, QueryReportsByOperatorRequest, QueryReportsByOperatorResponse, QueryOperatorReputationSnapshotRequest, QueryOperatorReputationSnapshotResponse } from "./query";
|
|
4
|
+
export class QueryClientImpl {
|
|
5
|
+
rpc;
|
|
6
|
+
constructor(rpc) {
|
|
7
|
+
this.rpc = rpc;
|
|
8
|
+
}
|
|
9
|
+
/* Parameters queries the parameters of the module. */
|
|
10
|
+
params = async (request = {}) => {
|
|
11
|
+
const data = QueryParamsRequest.encode(request).finish();
|
|
12
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "Params", data);
|
|
13
|
+
return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data)));
|
|
14
|
+
};
|
|
15
|
+
/* Operator returns the live operator record for (address, service_type). */
|
|
16
|
+
operator = async (request) => {
|
|
17
|
+
const data = QueryOperatorRequest.encode(request).finish();
|
|
18
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "Operator", data);
|
|
19
|
+
return promise.then(data => QueryOperatorResponse.decode(new BinaryReader(data)));
|
|
20
|
+
};
|
|
21
|
+
/* ServiceType returns one service-type registry entry. */
|
|
22
|
+
serviceType = async (request) => {
|
|
23
|
+
const data = QueryServiceTypeRequest.encode(request).finish();
|
|
24
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "ServiceType", data);
|
|
25
|
+
return promise.then(data => QueryServiceTypeResponse.decode(new BinaryReader(data)));
|
|
26
|
+
};
|
|
27
|
+
/* ServiceTypes returns all service-type registry entries (paginated). */
|
|
28
|
+
serviceTypes = async (request) => {
|
|
29
|
+
const data = QueryServiceTypesRequest.encode(request).finish();
|
|
30
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "ServiceTypes", data);
|
|
31
|
+
return promise.then(data => QueryServiceTypesResponse.decode(new BinaryReader(data)));
|
|
32
|
+
};
|
|
33
|
+
/* Operators returns all live operator records (paginated, optionally
|
|
34
|
+
filtered by status). */
|
|
35
|
+
operators = async (request) => {
|
|
36
|
+
const data = QueryOperatorsRequest.encode(request).finish();
|
|
37
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "Operators", data);
|
|
38
|
+
return promise.then(data => QueryOperatorsResponse.decode(new BinaryReader(data)));
|
|
39
|
+
};
|
|
40
|
+
/* OperatorsByController returns live operators whose controller is the
|
|
41
|
+
given address. */
|
|
42
|
+
operatorsByController = async (request) => {
|
|
43
|
+
const data = QueryOperatorsByControllerRequest.encode(request).finish();
|
|
44
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "OperatorsByController", data);
|
|
45
|
+
return promise.then(data => QueryOperatorsByControllerResponse.decode(new BinaryReader(data)));
|
|
46
|
+
};
|
|
47
|
+
/* OperatorsByServiceType returns live operators of the given service type. */
|
|
48
|
+
operatorsByServiceType = async (request) => {
|
|
49
|
+
const data = QueryOperatorsByServiceTypeRequest.encode(request).finish();
|
|
50
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "OperatorsByServiceType", data);
|
|
51
|
+
return promise.then(data => QueryOperatorsByServiceTypeResponse.decode(new BinaryReader(data)));
|
|
52
|
+
};
|
|
53
|
+
/* Report returns a single report by id. */
|
|
54
|
+
report = async (request) => {
|
|
55
|
+
const data = QueryReportRequest.encode(request).finish();
|
|
56
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "Report", data);
|
|
57
|
+
return promise.then(data => QueryReportResponse.decode(new BinaryReader(data)));
|
|
58
|
+
};
|
|
59
|
+
/* ReportsByOperator returns reports against (operator_address, service_type). */
|
|
60
|
+
reportsByOperator = async (request) => {
|
|
61
|
+
const data = QueryReportsByOperatorRequest.encode(request).finish();
|
|
62
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "ReportsByOperator", data);
|
|
63
|
+
return promise.then(data => QueryReportsByOperatorResponse.decode(new BinaryReader(data)));
|
|
64
|
+
};
|
|
65
|
+
/* OperatorReputationSnapshot returns bond-block totals for an address
|
|
66
|
+
(§6.6 lazy accrual visibility). Settles in-memory at query time; no
|
|
67
|
+
state write. */
|
|
68
|
+
operatorReputationSnapshot = async (request) => {
|
|
69
|
+
const data = QueryOperatorReputationSnapshotRequest.encode(request).finish();
|
|
70
|
+
const promise = this.rpc.request("sparkdream.service.v1.Query", "OperatorReputationSnapshot", data);
|
|
71
|
+
return promise.then(data => QueryOperatorReputationSnapshotResponse.decode(new BinaryReader(data)));
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export const createRpcQueryExtension = (base) => {
|
|
75
|
+
const rpc = createProtobufRpcClient(base);
|
|
76
|
+
const queryService = new QueryClientImpl(rpc);
|
|
77
|
+
return {
|
|
78
|
+
params(request) {
|
|
79
|
+
return queryService.params(request);
|
|
80
|
+
},
|
|
81
|
+
operator(request) {
|
|
82
|
+
return queryService.operator(request);
|
|
83
|
+
},
|
|
84
|
+
serviceType(request) {
|
|
85
|
+
return queryService.serviceType(request);
|
|
86
|
+
},
|
|
87
|
+
serviceTypes(request) {
|
|
88
|
+
return queryService.serviceTypes(request);
|
|
89
|
+
},
|
|
90
|
+
operators(request) {
|
|
91
|
+
return queryService.operators(request);
|
|
92
|
+
},
|
|
93
|
+
operatorsByController(request) {
|
|
94
|
+
return queryService.operatorsByController(request);
|
|
95
|
+
},
|
|
96
|
+
operatorsByServiceType(request) {
|
|
97
|
+
return queryService.operatorsByServiceType(request);
|
|
98
|
+
},
|
|
99
|
+
report(request) {
|
|
100
|
+
return queryService.report(request);
|
|
101
|
+
},
|
|
102
|
+
reportsByOperator(request) {
|
|
103
|
+
return queryService.reportsByOperator(request);
|
|
104
|
+
},
|
|
105
|
+
operatorReputationSnapshot(request) {
|
|
106
|
+
return queryService.operatorReputationSnapshot(request);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import { BinaryReader, BinaryWriter } from "../../../binary";
|
|
3
|
+
function createBaseRefileCooldown() {
|
|
4
|
+
return {
|
|
5
|
+
controller: "",
|
|
6
|
+
operatorAddress: "",
|
|
7
|
+
serviceType: "",
|
|
8
|
+
dismissedAt: BigInt(0)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* RefileCooldown bars a controller from re-filing the same allegation
|
|
13
|
+
* against the same (operator, service_type) within
|
|
14
|
+
* `report_refile_cooldown_blocks` after a PENDING report was
|
|
15
|
+
* AUTO_DISMISSED (controller stall). See x-service-spec.md §3.4.5.
|
|
16
|
+
*
|
|
17
|
+
* Keyed by (controller, operator_address, service_type, dismissed_at)
|
|
18
|
+
* in the RefileCooldowns store; lazy expiry — entries are checked at
|
|
19
|
+
* MsgReportOperator time and pruned when expired.
|
|
20
|
+
* @name RefileCooldown
|
|
21
|
+
* @package sparkdream.service.v1
|
|
22
|
+
* @see proto type: sparkdream.service.v1.RefileCooldown
|
|
23
|
+
*/
|
|
24
|
+
export const RefileCooldown = {
|
|
25
|
+
typeUrl: "/sparkdream.service.v1.RefileCooldown",
|
|
26
|
+
aminoType: "sparkdream/x/service/RefileCooldown",
|
|
27
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
28
|
+
if (message.controller !== "") {
|
|
29
|
+
writer.uint32(10).string(message.controller);
|
|
30
|
+
}
|
|
31
|
+
if (message.operatorAddress !== "") {
|
|
32
|
+
writer.uint32(18).string(message.operatorAddress);
|
|
33
|
+
}
|
|
34
|
+
if (message.serviceType !== "") {
|
|
35
|
+
writer.uint32(26).string(message.serviceType);
|
|
36
|
+
}
|
|
37
|
+
if (message.dismissedAt !== BigInt(0)) {
|
|
38
|
+
writer.uint32(32).int64(message.dismissedAt);
|
|
39
|
+
}
|
|
40
|
+
return writer;
|
|
41
|
+
},
|
|
42
|
+
decode(input, length) {
|
|
43
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
44
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
45
|
+
const message = createBaseRefileCooldown();
|
|
46
|
+
while (reader.pos < end) {
|
|
47
|
+
const tag = reader.uint32();
|
|
48
|
+
switch (tag >>> 3) {
|
|
49
|
+
case 1:
|
|
50
|
+
message.controller = reader.string();
|
|
51
|
+
break;
|
|
52
|
+
case 2:
|
|
53
|
+
message.operatorAddress = reader.string();
|
|
54
|
+
break;
|
|
55
|
+
case 3:
|
|
56
|
+
message.serviceType = reader.string();
|
|
57
|
+
break;
|
|
58
|
+
case 4:
|
|
59
|
+
message.dismissedAt = reader.int64();
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
reader.skipType(tag & 7);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return message;
|
|
67
|
+
},
|
|
68
|
+
fromPartial(object) {
|
|
69
|
+
const message = createBaseRefileCooldown();
|
|
70
|
+
message.controller = object.controller ?? "";
|
|
71
|
+
message.operatorAddress = object.operatorAddress ?? "";
|
|
72
|
+
message.serviceType = object.serviceType ?? "";
|
|
73
|
+
message.dismissedAt = object.dismissedAt !== undefined && object.dismissedAt !== null ? BigInt(object.dismissedAt.toString()) : BigInt(0);
|
|
74
|
+
return message;
|
|
75
|
+
},
|
|
76
|
+
fromAmino(object) {
|
|
77
|
+
const message = createBaseRefileCooldown();
|
|
78
|
+
if (object.controller !== undefined && object.controller !== null) {
|
|
79
|
+
message.controller = object.controller;
|
|
80
|
+
}
|
|
81
|
+
if (object.operator_address !== undefined && object.operator_address !== null) {
|
|
82
|
+
message.operatorAddress = object.operator_address;
|
|
83
|
+
}
|
|
84
|
+
if (object.service_type !== undefined && object.service_type !== null) {
|
|
85
|
+
message.serviceType = object.service_type;
|
|
86
|
+
}
|
|
87
|
+
if (object.dismissed_at !== undefined && object.dismissed_at !== null) {
|
|
88
|
+
message.dismissedAt = BigInt(object.dismissed_at);
|
|
89
|
+
}
|
|
90
|
+
return message;
|
|
91
|
+
},
|
|
92
|
+
toAmino(message) {
|
|
93
|
+
const obj = {};
|
|
94
|
+
obj.controller = message.controller === "" ? undefined : message.controller;
|
|
95
|
+
obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress;
|
|
96
|
+
obj.service_type = message.serviceType === "" ? undefined : message.serviceType;
|
|
97
|
+
obj.dismissed_at = message.dismissedAt !== BigInt(0) ? message.dismissedAt?.toString() : undefined;
|
|
98
|
+
return obj;
|
|
99
|
+
},
|
|
100
|
+
fromAminoMsg(object) {
|
|
101
|
+
return RefileCooldown.fromAmino(object.value);
|
|
102
|
+
},
|
|
103
|
+
toAminoMsg(message) {
|
|
104
|
+
return {
|
|
105
|
+
type: "sparkdream/x/service/RefileCooldown",
|
|
106
|
+
value: RefileCooldown.toAmino(message)
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
fromProtoMsg(message) {
|
|
110
|
+
return RefileCooldown.decode(message.value);
|
|
111
|
+
},
|
|
112
|
+
toProto(message) {
|
|
113
|
+
return RefileCooldown.encode(message).finish();
|
|
114
|
+
},
|
|
115
|
+
toProtoMsg(message) {
|
|
116
|
+
return {
|
|
117
|
+
typeUrl: "/sparkdream.service.v1.RefileCooldown",
|
|
118
|
+
value: RefileCooldown.encode(message).finish()
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "../../../binary";
|
|
2
|
+
function createBaseReport() {
|
|
3
|
+
return {
|
|
4
|
+
reportId: BigInt(0),
|
|
5
|
+
operatorAddress: "",
|
|
6
|
+
serviceType: "",
|
|
7
|
+
reporter: "",
|
|
8
|
+
reason: "",
|
|
9
|
+
filedAt: BigInt(0),
|
|
10
|
+
escalatedAt: BigInt(0),
|
|
11
|
+
status: 0,
|
|
12
|
+
proposedSlashBps: 0,
|
|
13
|
+
slashAmount: "",
|
|
14
|
+
deposit: "",
|
|
15
|
+
juryCaseId: BigInt(0)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Report is a single report filed against an operator (see x-service-spec.md
|
|
20
|
+
* §3.4 and §4.1). Keyed by `report_id` (auto-incrementing uint64); secondary
|
|
21
|
+
* indexes by operator (ReportsByOperator) and by status for the PENDING /
|
|
22
|
+
* ESCALATED EndBlocker sweeps.
|
|
23
|
+
* @name Report
|
|
24
|
+
* @package sparkdream.service.v1
|
|
25
|
+
* @see proto type: sparkdream.service.v1.Report
|
|
26
|
+
*/
|
|
27
|
+
export const Report = {
|
|
28
|
+
typeUrl: "/sparkdream.service.v1.Report",
|
|
29
|
+
aminoType: "sparkdream/x/service/Report",
|
|
30
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
31
|
+
if (message.reportId !== BigInt(0)) {
|
|
32
|
+
writer.uint32(8).uint64(message.reportId);
|
|
33
|
+
}
|
|
34
|
+
if (message.operatorAddress !== "") {
|
|
35
|
+
writer.uint32(18).string(message.operatorAddress);
|
|
36
|
+
}
|
|
37
|
+
if (message.serviceType !== "") {
|
|
38
|
+
writer.uint32(26).string(message.serviceType);
|
|
39
|
+
}
|
|
40
|
+
if (message.reporter !== "") {
|
|
41
|
+
writer.uint32(34).string(message.reporter);
|
|
42
|
+
}
|
|
43
|
+
if (message.reason !== "") {
|
|
44
|
+
writer.uint32(42).string(message.reason);
|
|
45
|
+
}
|
|
46
|
+
if (message.filedAt !== BigInt(0)) {
|
|
47
|
+
writer.uint32(48).int64(message.filedAt);
|
|
48
|
+
}
|
|
49
|
+
if (message.escalatedAt !== BigInt(0)) {
|
|
50
|
+
writer.uint32(56).int64(message.escalatedAt);
|
|
51
|
+
}
|
|
52
|
+
if (message.status !== 0) {
|
|
53
|
+
writer.uint32(64).int32(message.status);
|
|
54
|
+
}
|
|
55
|
+
if (message.proposedSlashBps !== 0) {
|
|
56
|
+
writer.uint32(72).uint32(message.proposedSlashBps);
|
|
57
|
+
}
|
|
58
|
+
if (message.slashAmount !== "") {
|
|
59
|
+
writer.uint32(82).string(message.slashAmount);
|
|
60
|
+
}
|
|
61
|
+
if (message.deposit !== "") {
|
|
62
|
+
writer.uint32(90).string(message.deposit);
|
|
63
|
+
}
|
|
64
|
+
if (message.juryCaseId !== BigInt(0)) {
|
|
65
|
+
writer.uint32(96).uint64(message.juryCaseId);
|
|
66
|
+
}
|
|
67
|
+
return writer;
|
|
68
|
+
},
|
|
69
|
+
decode(input, length) {
|
|
70
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
71
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
72
|
+
const message = createBaseReport();
|
|
73
|
+
while (reader.pos < end) {
|
|
74
|
+
const tag = reader.uint32();
|
|
75
|
+
switch (tag >>> 3) {
|
|
76
|
+
case 1:
|
|
77
|
+
message.reportId = reader.uint64();
|
|
78
|
+
break;
|
|
79
|
+
case 2:
|
|
80
|
+
message.operatorAddress = reader.string();
|
|
81
|
+
break;
|
|
82
|
+
case 3:
|
|
83
|
+
message.serviceType = reader.string();
|
|
84
|
+
break;
|
|
85
|
+
case 4:
|
|
86
|
+
message.reporter = reader.string();
|
|
87
|
+
break;
|
|
88
|
+
case 5:
|
|
89
|
+
message.reason = reader.string();
|
|
90
|
+
break;
|
|
91
|
+
case 6:
|
|
92
|
+
message.filedAt = reader.int64();
|
|
93
|
+
break;
|
|
94
|
+
case 7:
|
|
95
|
+
message.escalatedAt = reader.int64();
|
|
96
|
+
break;
|
|
97
|
+
case 8:
|
|
98
|
+
message.status = reader.int32();
|
|
99
|
+
break;
|
|
100
|
+
case 9:
|
|
101
|
+
message.proposedSlashBps = reader.uint32();
|
|
102
|
+
break;
|
|
103
|
+
case 10:
|
|
104
|
+
message.slashAmount = reader.string();
|
|
105
|
+
break;
|
|
106
|
+
case 11:
|
|
107
|
+
message.deposit = reader.string();
|
|
108
|
+
break;
|
|
109
|
+
case 12:
|
|
110
|
+
message.juryCaseId = reader.uint64();
|
|
111
|
+
break;
|
|
112
|
+
default:
|
|
113
|
+
reader.skipType(tag & 7);
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return message;
|
|
118
|
+
},
|
|
119
|
+
fromPartial(object) {
|
|
120
|
+
const message = createBaseReport();
|
|
121
|
+
message.reportId = object.reportId !== undefined && object.reportId !== null ? BigInt(object.reportId.toString()) : BigInt(0);
|
|
122
|
+
message.operatorAddress = object.operatorAddress ?? "";
|
|
123
|
+
message.serviceType = object.serviceType ?? "";
|
|
124
|
+
message.reporter = object.reporter ?? "";
|
|
125
|
+
message.reason = object.reason ?? "";
|
|
126
|
+
message.filedAt = object.filedAt !== undefined && object.filedAt !== null ? BigInt(object.filedAt.toString()) : BigInt(0);
|
|
127
|
+
message.escalatedAt = object.escalatedAt !== undefined && object.escalatedAt !== null ? BigInt(object.escalatedAt.toString()) : BigInt(0);
|
|
128
|
+
message.status = object.status ?? 0;
|
|
129
|
+
message.proposedSlashBps = object.proposedSlashBps ?? 0;
|
|
130
|
+
message.slashAmount = object.slashAmount ?? "";
|
|
131
|
+
message.deposit = object.deposit ?? "";
|
|
132
|
+
message.juryCaseId = object.juryCaseId !== undefined && object.juryCaseId !== null ? BigInt(object.juryCaseId.toString()) : BigInt(0);
|
|
133
|
+
return message;
|
|
134
|
+
},
|
|
135
|
+
fromAmino(object) {
|
|
136
|
+
const message = createBaseReport();
|
|
137
|
+
if (object.report_id !== undefined && object.report_id !== null) {
|
|
138
|
+
message.reportId = BigInt(object.report_id);
|
|
139
|
+
}
|
|
140
|
+
if (object.operator_address !== undefined && object.operator_address !== null) {
|
|
141
|
+
message.operatorAddress = object.operator_address;
|
|
142
|
+
}
|
|
143
|
+
if (object.service_type !== undefined && object.service_type !== null) {
|
|
144
|
+
message.serviceType = object.service_type;
|
|
145
|
+
}
|
|
146
|
+
if (object.reporter !== undefined && object.reporter !== null) {
|
|
147
|
+
message.reporter = object.reporter;
|
|
148
|
+
}
|
|
149
|
+
if (object.reason !== undefined && object.reason !== null) {
|
|
150
|
+
message.reason = object.reason;
|
|
151
|
+
}
|
|
152
|
+
if (object.filed_at !== undefined && object.filed_at !== null) {
|
|
153
|
+
message.filedAt = BigInt(object.filed_at);
|
|
154
|
+
}
|
|
155
|
+
if (object.escalated_at !== undefined && object.escalated_at !== null) {
|
|
156
|
+
message.escalatedAt = BigInt(object.escalated_at);
|
|
157
|
+
}
|
|
158
|
+
if (object.status !== undefined && object.status !== null) {
|
|
159
|
+
message.status = object.status;
|
|
160
|
+
}
|
|
161
|
+
if (object.proposed_slash_bps !== undefined && object.proposed_slash_bps !== null) {
|
|
162
|
+
message.proposedSlashBps = object.proposed_slash_bps;
|
|
163
|
+
}
|
|
164
|
+
if (object.slash_amount !== undefined && object.slash_amount !== null) {
|
|
165
|
+
message.slashAmount = object.slash_amount;
|
|
166
|
+
}
|
|
167
|
+
if (object.deposit !== undefined && object.deposit !== null) {
|
|
168
|
+
message.deposit = object.deposit;
|
|
169
|
+
}
|
|
170
|
+
if (object.jury_case_id !== undefined && object.jury_case_id !== null) {
|
|
171
|
+
message.juryCaseId = BigInt(object.jury_case_id);
|
|
172
|
+
}
|
|
173
|
+
return message;
|
|
174
|
+
},
|
|
175
|
+
toAmino(message) {
|
|
176
|
+
const obj = {};
|
|
177
|
+
obj.report_id = message.reportId !== BigInt(0) ? message.reportId?.toString() : undefined;
|
|
178
|
+
obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress;
|
|
179
|
+
obj.service_type = message.serviceType === "" ? undefined : message.serviceType;
|
|
180
|
+
obj.reporter = message.reporter === "" ? undefined : message.reporter;
|
|
181
|
+
obj.reason = message.reason === "" ? undefined : message.reason;
|
|
182
|
+
obj.filed_at = message.filedAt !== BigInt(0) ? message.filedAt?.toString() : undefined;
|
|
183
|
+
obj.escalated_at = message.escalatedAt !== BigInt(0) ? message.escalatedAt?.toString() : undefined;
|
|
184
|
+
obj.status = message.status === 0 ? undefined : message.status;
|
|
185
|
+
obj.proposed_slash_bps = message.proposedSlashBps === 0 ? undefined : message.proposedSlashBps;
|
|
186
|
+
obj.slash_amount = message.slashAmount === "" ? undefined : message.slashAmount;
|
|
187
|
+
obj.deposit = message.deposit === "" ? undefined : message.deposit;
|
|
188
|
+
obj.jury_case_id = message.juryCaseId !== BigInt(0) ? message.juryCaseId?.toString() : undefined;
|
|
189
|
+
return obj;
|
|
190
|
+
},
|
|
191
|
+
fromAminoMsg(object) {
|
|
192
|
+
return Report.fromAmino(object.value);
|
|
193
|
+
},
|
|
194
|
+
toAminoMsg(message) {
|
|
195
|
+
return {
|
|
196
|
+
type: "sparkdream/x/service/Report",
|
|
197
|
+
value: Report.toAmino(message)
|
|
198
|
+
};
|
|
199
|
+
},
|
|
200
|
+
fromProtoMsg(message) {
|
|
201
|
+
return Report.decode(message.value);
|
|
202
|
+
},
|
|
203
|
+
toProto(message) {
|
|
204
|
+
return Report.encode(message).finish();
|
|
205
|
+
},
|
|
206
|
+
toProtoMsg(message) {
|
|
207
|
+
return {
|
|
208
|
+
typeUrl: "/sparkdream.service.v1.Report",
|
|
209
|
+
value: Report.encode(message).finish()
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import { BinaryReader, BinaryWriter } from "../../../binary";
|
|
3
|
+
function createBaseReporterRateLimit() {
|
|
4
|
+
return {
|
|
5
|
+
reporter: "",
|
|
6
|
+
operatorAddress: "",
|
|
7
|
+
serviceType: "",
|
|
8
|
+
recentFilingHeights: []
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* ReporterRateLimit tracks recent filing heights for a given
|
|
13
|
+
* (reporter, operator_address, service_type) tuple, implementing the
|
|
14
|
+
* sliding-window per-reporter cap from §3.4.6.
|
|
15
|
+
*
|
|
16
|
+
* The keeper admits a new filing iff fewer than
|
|
17
|
+
* `max_reports_per_reporter_per_operator_per_window` entries in
|
|
18
|
+
* `recent_filing_heights` fall within
|
|
19
|
+
* `[current_height - reporter_rate_limit_window_blocks, current_height]`.
|
|
20
|
+
*
|
|
21
|
+
* Ring-buffer semantics: when at capacity, the oldest entry is
|
|
22
|
+
* overwritten on each new filing.
|
|
23
|
+
* @name ReporterRateLimit
|
|
24
|
+
* @package sparkdream.service.v1
|
|
25
|
+
* @see proto type: sparkdream.service.v1.ReporterRateLimit
|
|
26
|
+
*/
|
|
27
|
+
export const ReporterRateLimit = {
|
|
28
|
+
typeUrl: "/sparkdream.service.v1.ReporterRateLimit",
|
|
29
|
+
aminoType: "sparkdream/x/service/ReporterRateLimit",
|
|
30
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
31
|
+
if (message.reporter !== "") {
|
|
32
|
+
writer.uint32(10).string(message.reporter);
|
|
33
|
+
}
|
|
34
|
+
if (message.operatorAddress !== "") {
|
|
35
|
+
writer.uint32(18).string(message.operatorAddress);
|
|
36
|
+
}
|
|
37
|
+
if (message.serviceType !== "") {
|
|
38
|
+
writer.uint32(26).string(message.serviceType);
|
|
39
|
+
}
|
|
40
|
+
writer.uint32(34).fork();
|
|
41
|
+
for (const v of message.recentFilingHeights) {
|
|
42
|
+
writer.int64(v);
|
|
43
|
+
}
|
|
44
|
+
writer.ldelim();
|
|
45
|
+
return writer;
|
|
46
|
+
},
|
|
47
|
+
decode(input, length) {
|
|
48
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
49
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
50
|
+
const message = createBaseReporterRateLimit();
|
|
51
|
+
while (reader.pos < end) {
|
|
52
|
+
const tag = reader.uint32();
|
|
53
|
+
switch (tag >>> 3) {
|
|
54
|
+
case 1:
|
|
55
|
+
message.reporter = reader.string();
|
|
56
|
+
break;
|
|
57
|
+
case 2:
|
|
58
|
+
message.operatorAddress = reader.string();
|
|
59
|
+
break;
|
|
60
|
+
case 3:
|
|
61
|
+
message.serviceType = reader.string();
|
|
62
|
+
break;
|
|
63
|
+
case 4:
|
|
64
|
+
if ((tag & 7) === 2) {
|
|
65
|
+
const end2 = reader.uint32() + reader.pos;
|
|
66
|
+
while (reader.pos < end2) {
|
|
67
|
+
message.recentFilingHeights.push(reader.int64());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
message.recentFilingHeights.push(reader.int64());
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
reader.skipType(tag & 7);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return message;
|
|
80
|
+
},
|
|
81
|
+
fromPartial(object) {
|
|
82
|
+
const message = createBaseReporterRateLimit();
|
|
83
|
+
message.reporter = object.reporter ?? "";
|
|
84
|
+
message.operatorAddress = object.operatorAddress ?? "";
|
|
85
|
+
message.serviceType = object.serviceType ?? "";
|
|
86
|
+
message.recentFilingHeights = object.recentFilingHeights?.map(e => BigInt(e.toString())) || [];
|
|
87
|
+
return message;
|
|
88
|
+
},
|
|
89
|
+
fromAmino(object) {
|
|
90
|
+
const message = createBaseReporterRateLimit();
|
|
91
|
+
if (object.reporter !== undefined && object.reporter !== null) {
|
|
92
|
+
message.reporter = object.reporter;
|
|
93
|
+
}
|
|
94
|
+
if (object.operator_address !== undefined && object.operator_address !== null) {
|
|
95
|
+
message.operatorAddress = object.operator_address;
|
|
96
|
+
}
|
|
97
|
+
if (object.service_type !== undefined && object.service_type !== null) {
|
|
98
|
+
message.serviceType = object.service_type;
|
|
99
|
+
}
|
|
100
|
+
message.recentFilingHeights = object.recent_filing_heights?.map(e => BigInt(e)) || [];
|
|
101
|
+
return message;
|
|
102
|
+
},
|
|
103
|
+
toAmino(message) {
|
|
104
|
+
const obj = {};
|
|
105
|
+
obj.reporter = message.reporter === "" ? undefined : message.reporter;
|
|
106
|
+
obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress;
|
|
107
|
+
obj.service_type = message.serviceType === "" ? undefined : message.serviceType;
|
|
108
|
+
if (message.recentFilingHeights) {
|
|
109
|
+
obj.recent_filing_heights = message.recentFilingHeights.map(e => e.toString());
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
obj.recent_filing_heights = message.recentFilingHeights;
|
|
113
|
+
}
|
|
114
|
+
return obj;
|
|
115
|
+
},
|
|
116
|
+
fromAminoMsg(object) {
|
|
117
|
+
return ReporterRateLimit.fromAmino(object.value);
|
|
118
|
+
},
|
|
119
|
+
toAminoMsg(message) {
|
|
120
|
+
return {
|
|
121
|
+
type: "sparkdream/x/service/ReporterRateLimit",
|
|
122
|
+
value: ReporterRateLimit.toAmino(message)
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
fromProtoMsg(message) {
|
|
126
|
+
return ReporterRateLimit.decode(message.value);
|
|
127
|
+
},
|
|
128
|
+
toProto(message) {
|
|
129
|
+
return ReporterRateLimit.encode(message).finish();
|
|
130
|
+
},
|
|
131
|
+
toProtoMsg(message) {
|
|
132
|
+
return {
|
|
133
|
+
typeUrl: "/sparkdream.service.v1.ReporterRateLimit",
|
|
134
|
+
value: ReporterRateLimit.encode(message).finish()
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
};
|