Types
73 structs and enums appear in endpoint arguments, view results and event payloads. They are encoded with the MultiversX top-encoding rules; every SDK that reads the ABI decodes them for you.
Contract crate corelayer 1.0.0, built with
multiversx-sc 0.66.2 on rustc 1.94.1 (e408947bf 2026-03-25).
The ABI itself is served at /abi/corelayer.abi.json.
Account
struct
131 B funded with no block, 297 B with current + previous, 406 B with all three blocks. Every endpoint loads the record once, mutates it in memory and stores it once.
| Field | Type | |
|---|---|---|
version | u8 | |
flags | u16 | bit0 AUTO_RENEW, bit1 PAYG_ENABLED, bit2 PAYG_AUTO_TOPUP, bit3 PAYG_CLOSING. |
credits | u64 | micro-USDC. |
payg_escrow | u64 | micro-USDC. |
payg_budget | u64 | micro-USDC; u64::MAX = "all credits". |
max_payg_price | u64 | micro-USDC per RU, 0 = no ceiling. |
max_renew_price | u64 | > 0 whenever AUTO_RENEW. |
renew_tier_id | u32 | 0 = same tier. |
payg_disabled_at_ms | u64 | 0 unless PAYG_CLOSING. |
last_seq | u32 | |
last_line_ms | u64 | R5 anchor (K-18): moves forward only on an accepted settlement line. |
last_topup_period_id | u32 | K-16. |
sender_count | u32 | |
grant_ru | u64 | |
grant_expiry_ms | u64 | |
created_ms | u64 | |
current | Option<PlanBlockV1> | |
queued | Option<PlanBlockV1> | |
previous | Option<PrevBlockV1> | |
used_ru_reported | u64 | |
policy_id | u32 | |
latency_class | u8 | |
agent_id | u64 |
AccountView
struct
getAccount, getAccountById: the derived fields after a virtual advance.
| Field | Type | |
|---|---|---|
account_id | u32 | |
state | u8 | |
at_ms | u64 | |
period_id | u32 | |
period_start_ms | u64 | |
period_end_ms | u64 | |
tier_id | u32 | |
cap_ru | u64 | |
tariff_at_purchase | u64 | |
payg_bps | u32 | |
payg_price | u64 | |
period_flags | u8 | |
record | Account |
AutoRenewSetData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
enabled | bool | |
renew_tier_id | u32 | |
max_renew_price | u64 |
AutoRenewSkippedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
period_id | u32 | |
tier_id | u32 | |
price | u64 | |
max_renew_price | u64 | |
credits | u64 |
BatchTotals
struct
28 bytes, informational: committed into usage_chain_head, never interpreted.
| Field | Type | |
|---|---|---|
rows | u32 | |
ru_cap | u64 | |
ru_payg | u64 | |
ru_other | u64 |
BlockKind
enum
| Variant | Discriminant | |
|---|---|---|
New | 0 | |
Queued | 1 | |
Upgrade | 2 | |
AutoRenew | 3 |
ByData
struct
settlementPaused, settlementUnpaused.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
by | Address |
ConfigView
struct
getConfig. reporter and treasury are the EFFECTIVE addresses; the pending pair is reported raw so a watcher sees a scheduled change.
| Field | Type | |
|---|---|---|
chain_id | bytes | |
code_version | bytes | |
storage_version | u32 | |
owner | Address | |
operator | Address | |
reporter | Address | |
pending_reporter | Address | |
pending_reporter_effective_ms | u64 | |
treasury | Address | |
pending_treasury | Address | |
pending_treasury_effective_ms | u64 | |
usdc_token_id | TokenIdentifier | |
wegld_token_id | TokenIdentifier | |
pair_address | Address | |
wrapper_address | Address | |
venue_validated | bool |
CreditsGrantedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
amount | u64 | |
reason_code | u8 | |
credits_after | u64 | |
escrow_after | u64 |
CustomBuyerChangedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
added | bool |
DepositData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
amount | u64 | |
credits_after | u64 | |
escrow_after | u64 | |
account_id | u32 | |
is_new | bool |
DistLedger
struct
Storage key distLedger. Read once and written once per deposit; every amount comes from internal accounting, never from the contract balance.
| Field | Type | |
|---|---|---|
version | u8 | |
pool | BigUint | Relayer share not yet pushed (atto-EGLD). |
total_egld_in | BigUint | |
total_treasury_paid | BigUint | |
total_distributed | BigUint | |
total_emergency_withdrawn | BigUint | |
last_distribution_ms | u64 | |
dist_seq | u64 |
DistParams
struct
Storage key distParams. A non-forced distribution runs only when BOTH gates pass (distribution.md §3.3). It carries the leading version: u8 of contract.md §3 and the hand-written version-byte decoder that goes with it: §3's rule ("every top-level stored record starts with version: u8") and §7.3's "Scalar defaults" row both name DistParams as a versioned struct, and distParams is read on every deposit inside try_distribute, so a later release that adds a third parameter needs the discriminator to take the lazy per-record migration path (see SPEC-DEVIATIONS DEV-20).
| Field | Type | |
|---|---|---|
version | u8 | |
min_interval_ms | u64 | |
min_amount | BigUint |
DistributionDeferredData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
pool | BigUint | |
reason | u8 |
DistributionParamsChangedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
min_interval_ms | u64 | |
min_amount | BigUint |
DistributionStateView
struct
getDistributionState.
| Field | Type | |
|---|---|---|
ledger | DistLedger | |
params | DistParams | |
paused | bool | |
max_relayer_share_bps | u32 | SPEC-DEVIATIONS DEV-21: the share bound the owner's off-chain transaction builder must recompute against, which distribution.md §2.4 left without any read path. |
EffectiveMsData
struct
treasuryScheduled, relayerReserveScheduled: the scheduled address is the topic.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
effective_ms | u64 |
EscrowMovedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
amount | u64 | |
to_escrow | bool | |
period_id | u32 | |
credits_after | u64 | |
escrow_after | u64 |
EventMeta
struct
Common header. event_seq is contract-wide, +1 per event, gap-free, starts at 1.
| Field | Type | |
|---|---|---|
event_seq | u64 | |
timestamp_ms | u64 |
GrantReason
enum
| Variant | Discriminant | |
|---|---|---|
Trial | 1 | |
SlaRemedy | 2 | |
Goodwill | 3 | |
ReporterIncident | 4 |
InitializedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
chain_id | bytes | |
code_version | bytes | |
storage_version | u32 |
MaxRelayerShareBpsChangedData
struct
maxRelayerShareBpsChanged (SPEC-DEVIATIONS DEV-21). old_bps is what the mirror had, new_bps what every later activateRelayers / setRelayerWeights is measured against.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
old_bps | u32 | |
new_bps | u32 | |
by | Address |
MetaOnlyData
struct
Events whose whole payload is in the topics: treasuryPendingCancelled, ruScheduleActivated, ruSchedulePendingCancelled, tierActivated, relayerReserveChanged.
| Field | Type | |
|---|---|---|
meta | EventMeta |
OldAddressData
struct
treasuryChanged: the new address is the topic.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
old | Address |
PauseChangedData
struct
pauseChanged, distributionPauseChanged.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
paused | bool | |
by | Address |
PauseStateView
struct
getPauseState.
| Field | Type | |
|---|---|---|
paused | bool | |
deposits_paused | bool | |
settlement_paused | bool | |
distribution_paused | bool | |
renewals_paused | bool |
PaygSetData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
enabled | bool | |
budget | u64 | |
auto_topup | bool | |
max_payg_price | u64 | |
disabled_at_ms | u64 | |
credits_after | u64 | |
escrow_after | u64 |
PaygSettledData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
batch_id | u64 | |
seq | u32 | |
ru | u32 | |
tariff_idx | u16 | |
price_per_ru | u64 | |
debit | u64 | |
closing | bool | |
credits_after | u64 | |
escrow_after | u64 |
PaymentSwappedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
account | Address | |
usdc_in | u64 | |
wegld_out | BigUint | |
egld_out | BigUint | |
treasury_part | BigUint | |
relayer_part | BigUint | |
treasury | Address |
PlanBlockV1
struct
109 bytes nested, no managed types.
| Field | Type | |
|---|---|---|
block_id | u64 | Global counter, never a timestamp. |
tier_id | u32 | |
kind | BlockKind | |
start_ms | u64 | |
end_ms | u64 | start_ms + months * period_ms (checked); u64::MAX for a no-period block (K-11). |
period_ms | u64 | Snapshot; 0 = no period. |
months | u8 | 0 for a no-period block. |
first_period_id | u32 | Period k of this block has period_id = first_period_id + k (K-01). |
cap_ru | u64 | |
bonus_ru | u64 | RESERVED, always 0 in v1 (K-08). |
tariff_at_purchase | u64 | |
tariff_version | u32 | |
payg_bps | u32 | |
payg_price | u64 | tariff_at_purchase * payg_bps / 10_000, exact; 0 when FLOATING. |
max_senders | u32 | |
max_ru_per_s | u32 | |
burst_ru | u32 | |
rate_class | u8 | |
sla_class | u8 | |
flags | u32 | |
period_flags | u8 | bit0 FLOATING. |
price_paid | u64 |
PoolDistributedData
struct
One aggregated event per round: amount_i = unit * weight_i with the weights of registry_version reproduces every transfer exactly.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
total_sent | BigUint | |
unit | BigUint | |
total_weight | u64 | |
n_transfers | u32 | |
remainder | BigUint | |
registry_version | u64 | |
trigger | u8 | DistTrigger: 0 deposit, 1 permissionless, 2 forced. |
PoolEmergencyWithdrawnData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
amount | BigUint | |
to | Address |
PrevBlockV1
struct
57 bytes: what late settlement lines and the renew path need from the block that ended.
| Field | Type | |
|---|---|---|
block_id | u64 | |
tier_id | u32 | |
first_period_id | u32 | |
last_period_id | u32 | |
end_ms | u64 | |
tariff_at_purchase | u64 | |
payg_bps | u32 | |
payg_price | u64 | |
period_flags | u8 | |
max_ru_per_s | u32 | |
burst_ru | u32 |
PricingConfigView
struct
getPricingConfig: everything /v1/pricing needs in one query.
| Field | Type | |
|---|---|---|
tariff | u64 | Raw storage, as getTariff. |
pending_tariff | u64 | |
pending_tariff_effective_ms | u64 | |
tariff_version | u32 | |
effective_tariff | u64 | Lazy rule applied, as getEffectiveTariff. |
effective_tariff_version | u32 | |
ru_schedule | RuScheduleView | |
min_deposit | u64 | |
max_deposit | u64 | 0 = unlimited. |
tariff_min | u64 | |
tariff_max | u64 | |
tariff_granularity | u64 | |
tariff_increase_notice_ms | u64 |
RateClassEntry
struct
View output of getRateClasses.
| Field | Type | |
|---|---|---|
class | u8 | |
max_ru_per_s | u32 | |
burst_ru | u32 |
RateClassSetData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
max_ru_per_s | u32 | |
burst_ru | u32 |
RateClassV1
struct
Storage key rate_class(class): the on-chain upper bound the settlement reject rule R5 uses, snapshotted into every plan block (K-09).
| Field | Type | |
|---|---|---|
version | u8 | |
max_ru_per_s | u32 | |
burst_ru | u32 |
RelayerAddedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
info | RelayerInfo | |
registry_version | u64 |
RelayerInfo
struct
Storage key relayerInfo(addr). Cold path: owner calls and views.
| Field | Type | |
|---|---|---|
version | u8 | |
operator_id | u32 | Forward hook; v1 requires OPERATOR_ID_CORELAYER. |
sla_class | u8 | Forward hook; 0 shared pool, 1 Standard, 2 Priority, 3 Dedicated. |
shard | u8 | Computed on-chain with get_shard_of_address; always below 3. |
state | RelayerState | |
weight | u32 | Non-zero exactly when state == Active (invariant I5). |
stake | BigUint | Forward hook; always 0 in v1. |
registered_at_ms | u64 | |
activatable_at_ms | u64 | RESERVED, always equal to registered_at_ms in v1 (K-20). |
state_changed_at_ms | u64 |
RelayerMetaChangedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
operator_id | u32 | |
sla_class | u8 | |
registry_version | u64 |
RelayerRemovedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
registry_version | u64 |
RelayerRow
struct
View output of getRelayers.
| Field | Type | |
|---|---|---|
address | Address | |
info | RelayerInfo |
RelayerState
enum
None = 0 is the answer of getRelayerState for an address that is not ours.
| Variant | Discriminant | |
|---|---|---|
None | 0 | |
Registered | 1 | |
Active | 2 | |
Draining | 3 | |
Retired | 4 |
RelayerStateChangedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
old_state | RelayerState | |
new_state | RelayerState | |
weight | u32 | |
registry_version | u64 |
RelayerWeightsChangedData
struct
One event per call, not per relayer.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
entries | List<WeightEntry> | |
total_weight | u64 |
RenewedData
struct
renewed: every subscribed field (kind = AutoRenew) plus three.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
block_id | u64 | |
kind | BlockKind | |
months | u8 | |
start_ms | u64 | |
end_ms | u64 | |
period_ms | u64 | |
cap_ru | u64 | |
bonus_ru | u64 | |
tariff_at_purchase | u64 | |
tariff_version | u32 | |
payg_bps | u32 | |
payg_price | u64 | |
floating | bool | |
max_senders | u32 | |
rate_class | u8 | |
sla_class | u8 | |
flags | u32 | |
price_paid | u64 | |
credited_back | u64 | |
reference | bytes | |
credits_after | u64 | |
escrow_after | u64 | |
gap_ms | u64 | |
grid_aligned | bool | |
caller | Address |
RenewOutcome
enum
| Variant | Discriminant | |
|---|---|---|
Ok | 0 | |
NotDue | 1 | |
NotEnabled | 2 | |
Price | 3 | |
Credits | 4 | |
TierInactive | 5 | |
QueuedStarted | 6 | |
NoAccount | 7 | |
Paused | 8 | renewals_paused: nothing charged, no block written, no revert (K-19). |
RenewQuote
struct
quoteRenew.
| Field | Type | |
|---|---|---|
outcome | RenewOutcome | |
due | bool | |
tier_id | u32 | |
price | u64 | |
new_start_ms | u64 | |
new_end_ms | u64 |
ReporterScheduledData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
current | Address | |
pending | Address | |
effective_ms | u64 | |
by | Address |
RoleChangedData
struct
operatorChanged, reporterChanged.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
old | Address | |
new | Address | |
by | Address |
RuGrantedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
ru | u64 | |
grant_ru_after | u64 | |
expiry_ms | u64 | |
reason | GrantReason |
RuScheduleScheduledData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
hash | array32<u8> | |
effective_ms | u64 |
RuScheduleView
struct
getRuSchedule, with the lazy rule applied at the evaluation time.
| Field | Type | |
|---|---|---|
ru_size_atto | u64 | |
version | u32 | |
hash | array32<u8> | |
pending_version | u32 | |
pending_hash | array32<u8> | |
pending_effective_ms | u64 |
SenderChangedData
struct
senderAdded, senderRemoved.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
count_after | u32 | |
fee | u64 | |
credits_after | u64 | |
escrow_after | u64 |
SettleConfigChangedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
max_settle_per_window | u64 | |
ceiling | u64 | |
sender_fee_ru | u32 | |
pending_sender_fee_ru | u32 | |
pending_sender_fee_effective_ms | u64 | |
by | Address |
SettleLineRejectedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
batch_id | u64 | |
seq | u32 | |
period_id | u32 | |
ru | u32 |
SettlementStateView
struct
getSettlementState. reporter is the effective address.
| Field | Type | |
|---|---|---|
reporter | Address | |
settlement_paused | bool | |
settle_state | SettleState | |
totals | Totals |
SettleState
struct
Storage key settle_state: ONE struct, one read and one write per endpoint.
| Field | Type | |
|---|---|---|
version | u8 | |
last_batch_id | u64 | |
last_window_end_ms | u64 | |
usage_chain_head | array32<u8> | |
settle_window_start_ms | u64 | |
settle_window_debited | u64 | |
max_settle_per_window | u64 | |
max_settle_per_window_ceiling | u64 | |
sender_fee_ru | u32 | |
pending_sender_fee_ru | u32 | Lazy 48 h activation of a fee INCREASE; an effective time of 0 means none pending. |
pending_sender_fee_effective_ms | u64 |
SubscribedData
struct
subscribed. The spec names the opaque purchase reference ref; that is a Rust keyword, so the ABI publishes it as reference (SPEC-DEVIATIONS.md DEV-23 — clients, and the account_blocks.ref column of §16.4, map ref to this name).
| Field | Type | |
|---|---|---|
meta | EventMeta | |
block_id | u64 | |
kind | BlockKind | |
months | u8 | |
start_ms | u64 | |
end_ms | u64 | |
period_ms | u64 | |
cap_ru | u64 | |
bonus_ru | u64 | Always 0 in v1 (K-08). |
tariff_at_purchase | u64 | |
tariff_version | u32 | |
payg_bps | u32 | |
payg_price | u64 | |
floating | bool | |
max_senders | u32 | |
rate_class | u8 | |
sla_class | u8 | |
flags | u32 | |
price_paid | u64 | |
credited_back | u64 | |
reference | bytes | |
credits_after | u64 | |
escrow_after | u64 |
SwapVenueChangedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
pair | Address | |
wrapper | Address | |
usdc_token_id | TokenIdentifier | |
wegld_token_id | TokenIdentifier |
TariffActivatedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
tariff | u64 | |
effective_ms | u64 | The SCHEDULED time, which is what tariff_hist stores. |
materialised_ms | u64 | The block time of the mutation that materialised it. |
TariffEntry
struct
One element of tariff_hist (1-based, append-only). effective_ms is the SCHEDULED activation time, not the time of materialisation (K-10).
| Field | Type | |
|---|---|---|
tariff | u64 | |
effective_ms | u64 |
TariffPendingCancelledData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
cancelled_value | u64 | |
would_have_been_effective_ms | u64 |
TariffScheduledData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
old | u64 | |
new | u64 | |
effective_ms | u64 |
TierSavedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
tier | TierV1 |
TierStatus
enum
| Variant | Discriminant | |
|---|---|---|
Draft | 0 | |
Active | 1 | |
Legacy | 2 | |
Retired | 3 |
TierStatusChangedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
old | TierStatus | |
new | TierStatus | |
successor_tier_id | u32 |
TierV1
struct
Storage key tiers(tier_id). Editable only while Draft; after activateTier only status and successor_tier_id change (pricing.md §4.2).
| Field | Type | |
|---|---|---|
version | u8 | |
tier_id | u32 | |
slug | bytes | |
status | TierStatus | |
cap_ru | u64 | |
price_units | u64 | |
payg_bps | u32 | |
period_ms | u64 | |
max_senders | u32 | |
rate_class | u8 | |
sla_class | u8 | |
flags | u32 | |
successor_tier_id | u32 | |
created_ms | u64 |
Totals
struct
Storage key totals: the conservation counters, all micro-USDC. INV-C1: total_deposited + total_granted == total_credits + total_escrow + total_spent_plans + total_settled_payg + total_fees.
| Field | Type | |
|---|---|---|
version | u8 | |
total_deposited | u64 | |
total_granted | u64 | |
total_credits | u64 | |
total_escrow | u64 | |
total_spent_plans | u64 | |
total_settled_payg | u64 | |
total_fees | u64 |
U64ChangedData
struct
minDepositChanged, maxDepositChanged.
| Field | Type | |
|---|---|---|
meta | EventMeta | |
old | u64 | |
new | u64 |
UpgradedData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
old_storage_version | u32 | |
new_storage_version | u32 | |
code_version | bytes |
UsageSettledData
struct
| Field | Type | |
|---|---|---|
meta | EventMeta | |
operator_id | u32 | Always OPERATOR_ID_CORELAYER in v1. |
window_end_ms | u64 | |
usage_root | array32<u8> | |
usage_chain_head | array32<u8> | |
rows | u32 | |
ru_cap | u64 | |
ru_payg | u64 | |
ru_other | u64 | |
lines_accepted | u32 | |
lines_rejected | u32 | |
debit_total | u64 | |
window_debited_after | u64 |
WeightEntry
struct
One element of relayerWeightsChanged.entries.
| Field | Type | |
|---|---|---|
address | Address | |
weight | u32 |