Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

types.gno

23.77 Kb · 579 lines
  1package protocol_fee
  2
  3import bptree "gno.land/p/nt/bptree/v0"
  4
  5type IProtocolFee interface {
  6	IProtocolFeeManager
  7	IProtocolFeeGetter
  8	Render(path string) string
  9}
 10
 11type IProtocolFeeManager interface {
 12	// Mutating methods take `_ int, rlm realm` so a leading integer discriminator
 13	// (callers pass 0) and the current protocol_fee realm context are threaded
 14	// from proxy entry points down to cross-realm token transfers and store writes
 15	// performed inside each implementation. The discriminator is explicit at every
 16	// call site, making the realm threading visible to readers.
 17	// DistributeProtocolFee distributes all reserved protocol fees to DevOps and
 18	// GovStaker according to the configured allocation percentages.
 19	//
 20	// Parameters:
 21	//   - _: cross-call discriminator; callers pass 0
 22	//   - rlm: propagated protocol_fee realm context; implementation validates it as current
 23	DistributeProtocolFee(_ int, rlm realm)
 24
 25	// DistributeProtocolFeeByTokenPath distributes the reserved fee for one token path.
 26	//
 27	// Parameters:
 28	//   - _: cross-call discriminator; callers pass 0
 29	//   - rlm: propagated protocol_fee realm context; implementation validates it as current
 30	//   - tokenPath: token contract path whose reserved fee should be distributed
 31	DistributeProtocolFeeByTokenPath(_ int, rlm realm, tokenPath string)
 32
 33	// SetDevOpsPct updates the DevOps share; the GovStaker share becomes 10000 minus pct.
 34	//
 35	// Parameters:
 36	//   - _: cross-call discriminator; callers pass 0
 37	//   - rlm: propagated protocol_fee realm context; implementation validates it as current
 38	//   - pct: DevOps allocation in basis-point units, from 0 through 10000 inclusive
 39	SetDevOpsPct(_ int, rlm realm, pct int64)
 40
 41	// SetGovStakerPct updates the GovStaker share; the DevOps share becomes 10000 minus pct.
 42	//
 43	// Parameters:
 44	//   - _: cross-call discriminator; callers pass 0
 45	//   - rlm: propagated protocol_fee realm context; implementation validates it as current
 46	//   - pct: GovStaker allocation in basis-point units, from 0 through 10000 inclusive
 47	SetGovStakerPct(_ int, rlm realm, pct int64)
 48
 49	// AddToProtocolFee records and pulls an approved fee from an authorized protocol caller.
 50	//
 51	// Parameters:
 52	//   - _: cross-call discriminator; callers pass 0
 53	//   - rlm: propagated protocol_fee realm context; implementation rejects a non-current value
 54	//   - tokenPath: token contract path from which the approved fee is pulled
 55	//   - amount: non-negative fee amount in token base units; zero is a successful no-op
 56	//
 57	// Returns:
 58	//   - err: nil after accounting and transfer succeed; an error when realm validation, halt checks, or storage/transfer operations fail
 59	AddToProtocolFee(_ int, rlm realm, tokenPath string, amount int64) error
 60
 61	// AdvanceAccrualEpoch closes the current epoch and selects the next epoch for new fees.
 62	//
 63	// Parameters:
 64	//   - _: cross-call discriminator; callers pass 0
 65	//   - rlm: propagated protocol_fee realm context; implementation validates it as current
 66	//
 67	// Returns:
 68	//   - epoch: newly stored non-negative accrual epoch
 69	AdvanceAccrualEpoch(_ int, rlm realm) int64
 70
 71	// ConsumeAccrualBuckets removes pending buckets for one token in epoch order.
 72	//
 73	// Parameters:
 74	//   - _: cross-call discriminator; callers pass 0
 75	//   - rlm: propagated protocol_fee realm context; implementation validates it as current
 76	//   - tokenPath: token contract path whose pending GovStaker buckets are consumed
 77	//   - limit: maximum number of oldest buckets; zero or negative consumes all pending buckets
 78	//
 79	// Returns:
 80	//   - epochs: consumed epoch numbers in ascending order
 81	//   - amounts: fee amounts corresponding positionally to epochs, in token base units
 82	ConsumeAccrualBuckets(_ int, rlm realm, tokenPath string, limit int) ([]int64, []int64)
 83}
 84
 85type IProtocolFeeGetter interface {
 86	// GetDevOpsPct returns the configured DevOps allocation.
 87	//
 88	// Returns:
 89	//   - pct: DevOps fee allocation in basis-point units, from 0 through 10000
 90	GetDevOpsPct() int64
 91
 92	// GetGovStakerPct returns the configured GovStaker allocation.
 93	//
 94	// Returns:
 95	//   - pct: GovStaker fee allocation in basis-point units, from 0 through 10000
 96	GetGovStakerPct() int64
 97
 98	// GetReservedTokens returns token paths whose collected fees await distribution.
 99	//
100	// Returns:
101	//   - tokenPaths: token contract paths in the reserved-token index
102	GetReservedTokens() []string
103
104	// GetAccuTransfersToGovStaker returns cumulative allocations assigned to GovStaker.
105	//
106	// Returns:
107	//   - transfers: map from token contract path to cumulative allocated amount in base units
108	GetAccuTransfersToGovStaker() map[string]int64
109
110	// GetAccuTransfersToDevOps returns cumulative allocations assigned to DevOps.
111	//
112	// Returns:
113	//   - transfers: map from token contract path to cumulative allocated amount in base units
114	GetAccuTransfersToDevOps() map[string]int64
115
116	// GetAccuTransferToGovStakerByTokenPath returns the GovStaker allocation for one token.
117	//
118	// Parameters:
119	//   - path: token contract path whose cumulative GovStaker allocation is queried
120	//
121	// Returns:
122	//   - amount: cumulative GovStaker allocation for path in token base units, or zero if absent
123	GetAccuTransferToGovStakerByTokenPath(path string) int64
124
125	// GetAccuTransferToDevOpsByTokenPath returns the DevOps allocation for one token.
126	//
127	// Parameters:
128	//   - path: token contract path whose cumulative DevOps allocation is queried
129	//
130	// Returns:
131	//   - amount: cumulative DevOps allocation for path in token base units, or zero if absent
132	GetAccuTransferToDevOpsByTokenPath(path string) int64
133
134	// GetActualDistributedToGovStaker returns cumulative amounts transferred to GovStaker.
135	//
136	// Returns:
137	//   - transfers: map from token contract path to cumulative amount actually transferred in base units
138	GetActualDistributedToGovStaker() map[string]int64
139
140	// GetActualDistributedToDevOps returns cumulative amounts transferred to DevOps.
141	//
142	// Returns:
143	//   - transfers: map from token contract path to cumulative amount actually transferred in base units
144	GetActualDistributedToDevOps() map[string]int64
145
146	// GetActualDistributedToGovStakerByTokenPath returns the completed GovStaker transfer for one token.
147	//
148	// Parameters:
149	//   - path: token contract path whose completed GovStaker transfer is queried
150	//
151	// Returns:
152	//   - amount: cumulative GovStaker amount actually transferred for path in base units, or zero if absent
153	GetActualDistributedToGovStakerByTokenPath(path string) int64
154
155	// GetActualDistributedToDevOpsByTokenPath returns the completed DevOps transfer for one token.
156	//
157	// Parameters:
158	//   - path: token contract path whose completed DevOps transfer is queried
159	//
160	// Returns:
161	//   - amount: cumulative DevOps amount actually transferred for path in base units, or zero if absent
162	GetActualDistributedToDevOpsByTokenPath(path string) int64
163
164	// GetAccrualEpoch returns the epoch assigned to newly collected GovStaker fees.
165	//
166	// Returns:
167	//   - epoch: current non-negative accrual epoch
168	GetAccrualEpoch() int64
169
170	// GetAccrualPendingTokens returns token paths that still have pending accrual buckets.
171	//
172	// Returns:
173	//   - tokenPaths: token contract paths with at least one pending GovStaker accrual bucket
174	GetAccrualPendingTokens() []string
175
176	// GetAccrualBuckets reads pending token buckets without removing them.
177	//
178	// Parameters:
179	//   - tokenPath: token contract path whose GovStaker accrual buckets are queried
180	//   - limit: maximum number of oldest buckets; zero or negative returns all pending buckets
181	//
182	// Returns:
183	//   - epochs: selected accrual epoch numbers in ascending order
184	//   - amounts: fee amounts corresponding positionally to epochs, in token base units
185	GetAccrualBuckets(tokenPath string, limit int) ([]int64, []int64)
186}
187
188type IProtocolFeeStore interface {
189	// HasDevOpsPctStoreKey reports whether the persisted DevOps percentage key exists.
190	//
191	// Returns:
192	//   - exists: true when the DevOps percentage key is present in the KV store
193	HasDevOpsPctStoreKey() bool
194
195	// InitializeDevOpsPct creates the DevOps percentage key with its default value.
196	//
197	// Parameters:
198	//   - _: cross-call discriminator; callers pass 0
199	//   - rlm: propagated protocol_fee realm context required for the authorized store write
200	//
201	// Returns:
202	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
203	InitializeDevOpsPct(_ int, rlm realm) error
204
205	// GetDevOpsPct reads the persisted DevOps percentage.
206	//
207	// Returns:
208	//   - pct: stored DevOps allocation in basis-point units
209	GetDevOpsPct() int64
210
211	// SetDevOpsPct persists a new DevOps percentage.
212	//
213	// Parameters:
214	//   - _: cross-call discriminator; callers pass 0
215	//   - rlm: propagated protocol_fee realm context required for the authorized store write
216	//   - pct: DevOps allocation in basis-point units
217	//
218	// Returns:
219	//   - err: nil when the value is stored; an error for invalid realm context or KV-store failure
220	SetDevOpsPct(_ int, rlm realm, pct int64) error
221
222	// HasAccuToGovStakerStoreKey reports whether the GovStaker allocation tree key exists.
223	//
224	// Returns:
225	//   - exists: true when the cumulative GovStaker allocation tree is present in the KV store
226	HasAccuToGovStakerStoreKey() bool
227
228	// InitializeAccuToGovStaker creates the cumulative GovStaker allocation tree.
229	//
230	// Parameters:
231	//   - _: cross-call discriminator; callers pass 0
232	//   - rlm: propagated protocol_fee realm context required for the authorized store write
233	//
234	// Returns:
235	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
236	InitializeAccuToGovStaker(_ int, rlm realm) error
237
238	// GetAccuToGovStaker returns the tree of cumulative GovStaker allocations by token.
239	//
240	// Returns:
241	//   - tree: persistent BPTree keyed by token path with int64 allocation values
242	GetAccuToGovStaker() *bptree.BPTree
243
244	// GetAccuToGovStakerItem reads one token's cumulative GovStaker allocation.
245	//
246	// Parameters:
247	//   - tokenPath: token contract path used as the allocation-tree key
248	//
249	// Returns:
250	//   - amount: stored allocation in token base units, or zero when tokenPath is absent
251	//   - exists: true when tokenPath has a stored allocation; false when absent
252	GetAccuToGovStakerItem(tokenPath string) (int64, bool)
253
254	// SetAccuToGovStakerItem stores one token's cumulative GovStaker allocation.
255	//
256	// Parameters:
257	//   - _: cross-call discriminator; callers pass 0
258	//   - rlm: propagated protocol_fee realm context required for the authorized store write
259	//   - tokenPath: token contract path used as the allocation-tree key
260	//   - amount: cumulative GovStaker allocation in token base units to store
261	//
262	// Returns:
263	//   - err: nil when the value is stored; an error for invalid realm context, missing tree, or KV-store failure
264	SetAccuToGovStakerItem(_ int, rlm realm, tokenPath string, amount int64) error
265
266	// HasAccuToDevOpsStoreKey reports whether the DevOps allocation tree key exists.
267	//
268	// Returns:
269	//   - exists: true when the cumulative DevOps allocation tree is present in the KV store
270	HasAccuToDevOpsStoreKey() bool
271
272	// InitializeAccuToDevOps creates the cumulative DevOps allocation tree.
273	//
274	// Parameters:
275	//   - _: cross-call discriminator; callers pass 0
276	//   - rlm: propagated protocol_fee realm context required for the authorized store write
277	//
278	// Returns:
279	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
280	InitializeAccuToDevOps(_ int, rlm realm) error
281
282	// GetAccuToDevOps returns the tree of cumulative DevOps allocations by token.
283	//
284	// Returns:
285	//   - tree: persistent BPTree keyed by token path with int64 allocation values
286	GetAccuToDevOps() *bptree.BPTree
287
288	// GetAccuToDevOpsItem reads one token's cumulative DevOps allocation.
289	//
290	// Parameters:
291	//   - tokenPath: token contract path used as the allocation-tree key
292	//
293	// Returns:
294	//   - amount: stored allocation in token base units, or zero when tokenPath is absent
295	//   - exists: true when tokenPath has a stored allocation; false when absent
296	GetAccuToDevOpsItem(tokenPath string) (int64, bool)
297
298	// SetAccuToDevOpsItem stores one token's cumulative DevOps allocation.
299	//
300	// Parameters:
301	//   - _: cross-call discriminator; callers pass 0
302	//   - rlm: propagated protocol_fee realm context required for the authorized store write
303	//   - tokenPath: token contract path used as the allocation-tree key
304	//   - amount: cumulative DevOps allocation in token base units to store
305	//
306	// Returns:
307	//   - err: nil when the value is stored; an error for invalid realm context, missing tree, or KV-store failure
308	SetAccuToDevOpsItem(_ int, rlm realm, tokenPath string, amount int64) error
309
310	// HasDistributedToGovStakerHistoryStoreKey reports whether the GovStaker history tree key exists.
311	//
312	// Returns:
313	//   - exists: true when the cumulative GovStaker distribution-history tree is present
314	HasDistributedToGovStakerHistoryStoreKey() bool
315
316	// InitializeDistributedToGovStakerHistory creates the GovStaker distribution-history tree.
317	//
318	// Parameters:
319	//   - _: cross-call discriminator; callers pass 0
320	//   - rlm: propagated protocol_fee realm context required for the authorized store write
321	//
322	// Returns:
323	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
324	InitializeDistributedToGovStakerHistory(_ int, rlm realm) error
325
326	// GetDistributedToGovStakerHistory returns cumulative actual GovStaker transfers by token.
327	//
328	// Returns:
329	//   - tree: persistent BPTree keyed by token path with int64 transferred amounts
330	GetDistributedToGovStakerHistory() *bptree.BPTree
331
332	// GetDistributedToGovStakerHistoryItem reads one token's actual GovStaker transfer.
333	//
334	// Parameters:
335	//   - tokenPath: token contract path used as the history-tree key
336	//
337	// Returns:
338	//   - amount: stored transferred amount in token base units, or zero when tokenPath is absent
339	//   - exists: true when tokenPath has a stored history amount; false when absent
340	GetDistributedToGovStakerHistoryItem(tokenPath string) (int64, bool)
341
342	// SetDistributedToGovStakerHistoryItem stores one token's actual GovStaker transfer.
343	//
344	// Parameters:
345	//   - _: cross-call discriminator; callers pass 0
346	//   - rlm: propagated protocol_fee realm context required for the authorized store write
347	//   - tokenPath: token contract path used as the history-tree key
348	//   - amount: cumulative amount actually transferred to GovStaker in token base units
349	//
350	// Returns:
351	//   - err: nil when the value is stored; an error for invalid realm context, missing tree, or KV-store failure
352	SetDistributedToGovStakerHistoryItem(_ int, rlm realm, tokenPath string, amount int64) error
353
354	// HasDistributedToDevOpsHistoryStoreKey reports whether the DevOps history tree key exists.
355	//
356	// Returns:
357	//   - exists: true when the cumulative DevOps distribution-history tree is present
358	HasDistributedToDevOpsHistoryStoreKey() bool
359
360	// InitializeDistributedToDevOpsHistory creates the DevOps distribution-history tree.
361	//
362	// Parameters:
363	//   - _: cross-call discriminator; callers pass 0
364	//   - rlm: propagated protocol_fee realm context required for the authorized store write
365	//
366	// Returns:
367	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
368	InitializeDistributedToDevOpsHistory(_ int, rlm realm) error
369
370	// GetDistributedToDevOpsHistory returns cumulative actual DevOps transfers by token.
371	//
372	// Returns:
373	//   - tree: persistent BPTree keyed by token path with int64 transferred amounts
374	GetDistributedToDevOpsHistory() *bptree.BPTree
375
376	// GetDistributedToDevOpsHistoryItem reads one token's actual DevOps transfer.
377	//
378	// Parameters:
379	//   - tokenPath: token contract path used as the history-tree key
380	//
381	// Returns:
382	//   - amount: stored transferred amount in token base units, or zero when tokenPath is absent
383	//   - exists: true when tokenPath has a stored history amount; false when absent
384	GetDistributedToDevOpsHistoryItem(tokenPath string) (int64, bool)
385
386	// SetDistributedToDevOpsHistoryItem stores one token's actual DevOps transfer.
387	//
388	// Parameters:
389	//   - _: cross-call discriminator; callers pass 0
390	//   - rlm: propagated protocol_fee realm context required for the authorized store write
391	//   - tokenPath: token contract path used as the history-tree key
392	//   - amount: cumulative amount actually transferred to DevOps in token base units
393	//
394	// Returns:
395	//   - err: nil when the value is stored; an error for invalid realm context, missing tree, or KV-store failure
396	SetDistributedToDevOpsHistoryItem(_ int, rlm realm, tokenPath string, amount int64) error
397
398	// HasReservedTokensStoreKey reports whether the reserved-token index key exists.
399	//
400	// Returns:
401	//   - exists: true when the reserved-token index is present in the KV store
402	HasReservedTokensStoreKey() bool
403
404	// InitializeReservedTokens creates the empty reserved-token index.
405	//
406	// Parameters:
407	//   - _: cross-call discriminator; callers pass 0
408	//   - rlm: propagated protocol_fee realm context required for the authorized store write
409	//
410	// Returns:
411	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
412	InitializeReservedTokens(_ int, rlm realm) error
413
414	// GetReservedTokens returns token paths currently marked as awaiting distribution.
415	//
416	// Returns:
417	//   - tokenPaths: keys in the reserved-token index
418	GetReservedTokens() []string
419
420	// HasReservedToken reports whether tokenPath is in the reserved-token index.
421	//
422	// Parameters:
423	//   - tokenPath: token contract path to look up in the reserved-token index
424	//
425	// Returns:
426	//   - exists: true when tokenPath is reserved for distribution
427	HasReservedToken(tokenPath string) bool
428
429	// AddReservedToken marks tokenPath as awaiting fee distribution.
430	//
431	// Parameters:
432	//   - _: cross-call discriminator; callers pass 0
433	//   - rlm: propagated protocol_fee realm context required for the authorized store write
434	//   - tokenPath: token contract path to add to the reserved-token index
435	//
436	// Returns:
437	//   - err: nil when added or already present; an error for invalid realm context or KV-store failure
438	AddReservedToken(_ int, rlm realm, tokenPath string) error
439
440	// RemoveReservedToken removes tokenPath from the reserved-token index when present.
441	//
442	// Parameters:
443	//   - _: cross-call discriminator; callers pass 0
444	//   - rlm: propagated protocol_fee realm context required for the authorized store write
445	//   - tokenPath: token contract path to remove from the reserved-token index
446	//
447	// Returns:
448	//   - err: nil when removed or already absent; an error for invalid realm context or KV-store failure
449	RemoveReservedToken(_ int, rlm realm, tokenPath string) error
450
451	// HasAccrualEpochStoreKey reports whether the accrual-epoch key exists.
452	//
453	// Returns:
454	//   - exists: true when the current accrual epoch is present in the KV store
455	HasAccrualEpochStoreKey() bool
456
457	// InitializeAccrualEpoch creates the accrual-epoch key with epoch zero.
458	//
459	// Parameters:
460	//   - _: cross-call discriminator; callers pass 0
461	//   - rlm: propagated protocol_fee realm context required for the authorized store write
462	//
463	// Returns:
464	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
465	InitializeAccrualEpoch(_ int, rlm realm) error
466
467	// GetAccrualEpoch reads the epoch currently assigned to newly collected fees.
468	//
469	// Returns:
470	//   - epoch: current non-negative accrual epoch
471	GetAccrualEpoch() int64
472
473	// SetAccrualEpoch persists a new current accrual epoch.
474	//
475	// Parameters:
476	//   - _: cross-call discriminator; callers pass 0
477	//   - rlm: propagated protocol_fee realm context required for the authorized store write
478	//   - accrualEpoch: epoch number to store for subsequently collected fees
479	//
480	// Returns:
481	//   - err: nil when the epoch is stored; an error for invalid realm context or KV-store failure
482	SetAccrualEpoch(_ int, rlm realm, accrualEpoch int64) error
483
484	// HasAccrualBucketsStoreKey reports whether the accrual-buckets tree key exists.
485	//
486	// Returns:
487	//   - exists: true when the per-token accrual-bucket tree is present
488	HasAccrualBucketsStoreKey() bool
489
490	// InitializeAccrualBuckets creates the empty per-token accrual-bucket tree.
491	//
492	// Parameters:
493	//   - _: cross-call discriminator; callers pass 0
494	//   - rlm: propagated protocol_fee realm context required for the authorized store write
495	//
496	// Returns:
497	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
498	InitializeAccrualBuckets(_ int, rlm realm) error
499
500	// GetAccrualBuckets reads the oldest pending buckets for one token without removing them.
501	//
502	// Parameters:
503	//   - tokenPath: token contract path whose accrual buckets are queried
504	//   - limit: maximum number of oldest buckets; zero or negative returns all pending buckets
505	//
506	// Returns:
507	//   - epochs: selected accrual epoch numbers in ascending order
508	//   - amounts: bucket amounts corresponding positionally to epochs, in token base units
509	GetAccrualBuckets(tokenPath string, limit int) ([]int64, []int64)
510
511	// AddAccrualBucket adds amount to one token's bucket for an accrual epoch.
512	//
513	// Parameters:
514	//   - _: cross-call discriminator; callers pass 0
515	//   - rlm: propagated protocol_fee realm context required for the authorized store write
516	//   - tokenPath: token contract path whose accrual bucket is updated
517	//   - epoch: accrual epoch receiving the fee amount
518	//   - amount: fee amount in token base units to add to that epoch bucket
519	//
520	// Returns:
521	//   - err: nil when the bucket is stored; an error for invalid realm context or KV-store failure
522	AddAccrualBucket(_ int, rlm realm, tokenPath string, epoch int64, amount int64) error
523
524	// RemoveAccrualBuckets removes specified epoch buckets for one token.
525	//
526	// Parameters:
527	//   - _: cross-call discriminator; callers pass 0
528	//   - rlm: propagated protocol_fee realm context required for the authorized store write
529	//   - tokenPath: token contract path whose buckets are removed
530	//   - epochs: accrual epoch numbers to remove; an empty result removes no buckets
531	//
532	// Returns:
533	//   - err: nil when removal succeeds; an error for invalid realm context or KV-store failure
534	RemoveAccrualBuckets(_ int, rlm realm, tokenPath string, epochs []int64) error
535
536	// HasAccrualPendingTokensStoreKey reports whether the pending-token index key exists.
537	//
538	// Returns:
539	//   - exists: true when the index of tokens with pending buckets is present
540	HasAccrualPendingTokensStoreKey() bool
541
542	// InitializeAccrualPendingTokens creates the empty pending-token index.
543	//
544	// Parameters:
545	//   - _: cross-call discriminator; callers pass 0
546	//   - rlm: propagated protocol_fee realm context required for the authorized store write
547	//
548	// Returns:
549	//   - err: nil when initialization succeeds; an error for invalid realm context or KV-store failure
550	InitializeAccrualPendingTokens(_ int, rlm realm) error
551
552	// GetAccrualPendingTokens returns token paths indexed as owning pending buckets.
553	//
554	// Returns:
555	//   - tokenPaths: token contract paths present in the pending-token index
556	GetAccrualPendingTokens() []string
557
558	// AddAccrualPendingToken marks a token path as owning at least one pending bucket.
559	//
560	// Parameters:
561	//   - _: cross-call discriminator; callers pass 0
562	//   - rlm: propagated protocol_fee realm context required for the authorized store write
563	//   - tokenPath: token contract path to add to the pending-token index
564	//
565	// Returns:
566	//   - err: nil when added or already present; an error for invalid realm context or KV-store failure
567	AddAccrualPendingToken(_ int, rlm realm, tokenPath string) error
568
569	// RemoveAccrualPendingToken removes a token path from the pending-token index when present.
570	//
571	// Parameters:
572	//   - _: cross-call discriminator; callers pass 0
573	//   - rlm: propagated protocol_fee realm context required for the authorized store write
574	//   - tokenPath: token contract path to remove after its pending buckets are consumed
575	//
576	// Returns:
577	//   - err: nil when removed or already absent; an error for invalid realm context or KV-store failure
578	RemoveAccrualPendingToken(_ int, rlm realm, tokenPath string) error
579}