DarwiniaStaking¶
Calls¶
chill¶
See [Pallet::chill
].
Attributes¶
No attributes
Python¶
call = substrate.compose_call(
'DarwiniaStaking', 'chill', {}
)
collect¶
See [Pallet::collect
].
Attributes¶
Name | Type |
---|---|
commission | Perbill |
Python¶
call = substrate.compose_call(
'DarwiniaStaking', 'collect', {'commission': 'u32'}
)
nominate¶
See [Pallet::nominate
].
Attributes¶
Name | Type |
---|---|
target | T::AccountId |
Python¶
call = substrate.compose_call(
'DarwiniaStaking', 'nominate', {'target': '[u8; 20]'}
)
payout¶
See [Pallet::payout
].
Attributes¶
Name | Type |
---|---|
who | T::AccountId |
Python¶
call = substrate.compose_call(
'DarwiniaStaking', 'payout', {'who': '[u8; 20]'}
)
set_collator_count¶
See [Pallet::set_collator_count
].
Attributes¶
Name | Type |
---|---|
count | u32 |
Python¶
call = substrate.compose_call(
'DarwiniaStaking', 'set_collator_count', {'count': 'u32'}
)
set_rate_limit¶
See [Pallet::set_rate_limit
].
Attributes¶
Name | Type |
---|---|
amount | Balance |
Python¶
call = substrate.compose_call(
'DarwiniaStaking', 'set_rate_limit', {'amount': 'u128'}
)
stake¶
See [Pallet::stake
].
Attributes¶
Name | Type |
---|---|
ring_amount | Balance |
deposits | Vec<DepositId<T>> |
Python¶
call = substrate.compose_call(
'DarwiniaStaking', 'stake', {
'deposits': ['u16'],
'ring_amount': 'u128',
}
)
unstake¶
See [Pallet::unstake
].
Attributes¶
Name | Type |
---|---|
ring_amount | Balance |
deposits | Vec<DepositId<T>> |
Python¶
call = substrate.compose_call(
'DarwiniaStaking', 'unstake', {
'deposits': ['u16'],
'ring_amount': 'u128',
}
)
Events¶
CommissionUpdated¶
A collator has updated their commission.
Attributes¶
Name | Type | Composition |
---|---|---|
who | T::AccountId |
[u8; 20] |
commission | Perbill |
u32 |
Elected¶
A new collator set has been elected.
Attributes¶
Name | Type | Composition |
---|---|---|
collators | Vec<T::AccountId> |
['[u8; 20]'] |
Payout¶
A payout has been made for the staker.
Attributes¶
Name | Type | Composition |
---|---|---|
who | T::AccountId |
[u8; 20] |
amount | Balance |
u128 |
Staked¶
An account has staked some assets.
Attributes¶
Name | Type | Composition |
---|---|---|
who | T::AccountId |
[u8; 20] |
ring_amount | Balance |
u128 |
deposits | Vec<DepositId<T>> |
['u16'] |
Unpaid¶
Unable to pay the staker's reward.
Attributes¶
Name | Type | Composition |
---|---|---|
who | T::AccountId |
[u8; 20] |
amount | Balance |
u128 |
Unstaked¶
An account has unstaked assets.
Attributes¶
Name | Type | Composition |
---|---|---|
who | T::AccountId |
[u8; 20] |
ring_amount | Balance |
u128 |
deposits | Vec<DepositId<T>> |
['u16'] |
Storage functions¶
AuthoredBlocksCount¶
Number of blocks authored by the collator within current session.
Python¶
result = substrate.query(
'DarwiniaStaking', 'AuthoredBlocksCount', []
)
Return value¶
('u32', 'scale_info::417')
CollatorCount¶
The ideal number of active collators.
Python¶
result = substrate.query(
'DarwiniaStaking', 'CollatorCount', []
)
Return value¶
'u32'
Collators¶
The map from (wannabe) collator to the preferences of that collator.
Python¶
result = substrate.query(
'DarwiniaStaking', 'Collators', ['[u8; 20]']
)
Return value¶
'u32'
ElapsedTime¶
Elapsed time.
Python¶
result = substrate.query(
'DarwiniaStaking', 'ElapsedTime', []
)
Return value¶
'u128'
ExposureCache0¶
Exposure cache 0.
Python¶
result = substrate.query(
'DarwiniaStaking', 'ExposureCache0', ['[u8; 20]']
)
Return value¶
{'commission': 'u32', 'nominators': [{'vote': 'u128', 'who': '[u8; 20]'}], 'vote': 'u128'}
ExposureCache1¶
Exposure cache 1.
Python¶
result = substrate.query(
'DarwiniaStaking', 'ExposureCache1', ['[u8; 20]']
)
Return value¶
{'commission': 'u32', 'nominators': [{'vote': 'u128', 'who': '[u8; 20]'}], 'vote': 'u128'}
ExposureCache2¶
Exposure cache 2.
Python¶
result = substrate.query(
'DarwiniaStaking', 'ExposureCache2', ['[u8; 20]']
)
Return value¶
{'commission': 'u32', 'nominators': [{'vote': 'u128', 'who': '[u8; 20]'}], 'vote': 'u128'}
ExposureCacheStates¶
Exposure cache states.
To avoid extra DB RWs during new session, such as:
nocompile
previous = current;
current = next;
next = elect();
Now, with data:
nocompile
cache1 == previous;
cache2 == current;
cache3 == next;
Just need to shift the marker and write the storage map once:
nocompile
mark(cache3, current);
mark(cache2, previous);
mark(cache1, next);
cache1 = elect();
Python¶
result = substrate.query(
'DarwiniaStaking', 'ExposureCacheStates', []
)
Return value¶
(
('Previous', 'Current', 'Next'),
('Previous', 'Current', 'Next'),
('Previous', 'Current', 'Next'),
)
Ledgers¶
All staking ledgers.
Python¶
result = substrate.query(
'DarwiniaStaking', 'Ledgers', ['[u8; 20]']
)
Return value¶
{'deposits': ['u16'], 'ring': 'u128'}
Nominators¶
The map from nominator to their nomination preferences, namely the collator that they wish to support.
Python¶
result = substrate.query(
'DarwiniaStaking', 'Nominators', ['[u8; 20]']
)
Return value¶
'[u8; 20]'
PendingRewards¶
All outstanding rewards since the last payment.
Python¶
result = substrate.query(
'DarwiniaStaking', 'PendingRewards', ['[u8; 20]']
)
Return value¶
'u128'
RateLimit¶
Rate limit.
The maximum amount of RING that can be staked or unstaked in one session.
Python¶
result = substrate.query(
'DarwiniaStaking', 'RateLimit', []
)
Return value¶
'u128'
RateLimitState¶
Rate limit state.
Tracks the rate limit state in a session.
Python¶
result = substrate.query(
'DarwiniaStaking', 'RateLimitState', []
)
Return value¶
{'Neg': 'u128', 'Pos': 'u128'}
SessionStartTime¶
Active session's start-time.
Python¶
result = substrate.query(
'DarwiniaStaking', 'SessionStartTime', []
)
Return value¶
'u128'
Constants¶
KtonRewardDistributionContract¶
The address of KTON reward distribution contract.
Value¶
'0x000000000ae5db7bdaf8d071e680452e33d91dd5'
Python¶
constant = substrate.get_constant('DarwiniaStaking', 'KtonRewardDistributionContract')
MaxDeposits¶
Maximum deposit count.
Value¶
512
Python¶
constant = substrate.get_constant('DarwiniaStaking', 'MaxDeposits')
Errors¶
DepositNotFound¶
Deposit not found.
ExceedMaxDeposits¶
Exceed maximum deposit count.
ExceedRateLimit¶
Exceed rate limit.
NoReward¶
No reward to pay for this collator.
NotStaker¶
You are not a staker.
TargetNotCollator¶
Target is not a collator.
ZeroCollatorCount¶
Collator count mustn't be zero.