Newer
Older
# Runtime calls
Calls are categorized according to the dispatch origin they require:
1. **User calls**: the dispatch origin for this kind of call must be signed by
the transactor. This is the only call category that can be submitted with an extrinsic.
1. **Root calls**: This kind of call requires a special origin that can only be invoked
through on-chain governance mechanisms.
1. **Inherent calls**: This kind of call is invoked by the author of the block itself
(usually automatically by the node).
1. **Disabled calls**: These calls can not be called directly, they are reserved for internal use by other runtime calls.
There are **78** user calls from **23** pallets.
### Account - 1
#### unlink_identity - 0
<details><summary><code>unlink_identity()</code></summary>
```rust
```
</details>
unlink the identity associated with the account
### Scheduler - 2
#### schedule - 0
<details><summary><code>schedule(when, maybe_periodic, priority, call)</code></summary>
when: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority
call: Box<<T as Config>::RuntimeCall>
Anonymously schedule a task.
#### cancel - 1
<details><summary><code>cancel(when, index)</code></summary>
when: T::BlockNumber
index: u32
```
</details>
Cancel an anonymously scheduled task.
#### schedule_named - 2
<details><summary><code>schedule_named(id, when, maybe_periodic, priority, call)</code></summary>
when: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority
call: Box<<T as Config>::RuntimeCall>
Schedule a named task.
#### cancel_named - 3
<details><summary><code>cancel_named(id)</code></summary>
Cancel a named scheduled task.
#### schedule_after - 4
<details><summary><code>schedule_after(after, maybe_periodic, priority, call)</code></summary>
after: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority
call: Box<<T as Config>::RuntimeCall>
```
</details>
Anonymously schedule a task after a delay.
#### schedule_named_after - 5
<details><summary><code>schedule_named_after(id, after, maybe_periodic, priority, call)</code></summary>
after: T::BlockNumber
maybe_periodic: Option<schedule::Period<T::BlockNumber>>
priority: schedule::Priority
call: Box<<T as Config>::RuntimeCall>
```
</details>
Schedule a named task after a delay.
### Babe - 3
#### report_equivocation - 0
<details><summary><code>report_equivocation(equivocation_proof, key_owner_proof)</code></summary>
equivocation_proof: Box<EquivocationProof<T::Header>>
key_owner_proof: T::KeyOwnerProof
```
</details>
Report authority equivocation/misbehavior. This method will verify
the equivocation proof and validate the given key ownership proof
against the extracted offender. If both are valid, the offence will
be reported.
### Balances - 6
#### transfer_allow_death - 0
<details><summary><code>transfer_allow_death(dest, value)</code></summary>
```rust
dest: AccountIdLookupOf<T>
value: T::Balance
```
</details>
Transfer some liquid free balance to another account.
`transfer_allow_death` will set the `FreeBalance` of the sender and receiver.
If the sender's account is below the existential deposit as a result
of the transfer, the account will be reaped.
The dispatch origin for this call must be `Signed` by the transactor.
#### set_balance_deprecated - 1
<details><summary><code>set_balance_deprecated(who, new_free, old_reserved)</code></summary>
```rust
who: AccountIdLookupOf<T>
new_free: T::Balance
old_reserved: T::Balance
```
</details>
Set the regular balance of a given account; it also takes a reserved balance but this
must be the same as the account's current reserved balance.
The dispatch origin for this call is `root`.
WARNING: This call is DEPRECATED! Use `force_set_balance` instead.
#### transfer_keep_alive - 3
<details><summary><code>transfer_keep_alive(dest, value)</code></summary>
dest: AccountIdLookupOf<T>
value: T::Balance
```
</details>
Same as the [`transfer_allow_death`] call, but with a check that the transfer will not
kill the origin account.
99% of the time you want [`transfer_allow_death`] instead.
[`transfer_allow_death`]: struct.Pallet.html#method.transfer
#### transfer_all - 4
<details><summary><code>transfer_all(dest, keep_alive)</code></summary>
dest: AccountIdLookupOf<T>
keep_alive: bool
```
</details>
Transfer the entire transferable balance from the caller account.
NOTE: This function only attempts to transfer _transferable_ balances. This means that
any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be
transferred by this function. To ensure that this function results in a killed account,
you might need to prepare the account by removing any reference counters, storage
deposits, etc...
The dispatch origin of this call must be Signed.
- `dest`: The recipient of the transfer.
- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all
of the funds the account has, causing the sender account to be killed (false), or
transfer everything except at least the existential deposit, which will guarantee to
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
keep the sender account alive (true).
#### transfer - 7
<details><summary><code>transfer(dest, value)</code></summary>
```rust
dest: AccountIdLookupOf<T>
value: T::Balance
```
</details>
Alias for `transfer_allow_death`, provided only for name-wise compatibility.
WARNING: DEPRECATED! Will be released in approximately 3 months.
#### force_set_balance - 8
<details><summary><code>force_set_balance(who, new_free)</code></summary>
```rust
who: AccountIdLookupOf<T>
new_free: T::Balance
```
</details>
Set the regular balance of a given account.
The dispatch origin for this call is `root`.
### OneshotAccount - 7
#### create_oneshot_account - 0
<details><summary><code>create_oneshot_account(dest, value)</code></summary>
dest: <T::Lookup as StaticLookup>::Source
value: <T::Currency as Currency<T::AccountId>>::Balance
```
</details>
Create an account that can only be consumed once
- `dest`: The oneshot account to be created.
- `balance`: The balance to be transfered to this oneshot account.
Origin account is kept alive.
#### consume_oneshot_account - 1
<details><summary><code>consume_oneshot_account(block_height, dest)</code></summary>
```rust
block_height: T::BlockNumber
dest: Account<<T::Lookup as StaticLookup>::Source>
```
</details>
Consume a oneshot account and transfer its balance to an account
- `block_height`: Must be a recent block number. The limit is `BlockHashCount` in the past. (this is to prevent replay attacks)
- `dest`: The destination account.
- `dest_is_oneshot`: If set to `true`, then a oneshot account is created at `dest`. Else, `dest` has to be an existing account.
#### consume_oneshot_account_with_remaining - 2
<details><summary><code>consume_oneshot_account_with_remaining(block_height, dest, remaining_to, balance)</code></summary>
```rust
block_height: T::BlockNumber
dest: Account<<T::Lookup as StaticLookup>::Source>
remaining_to: Account<<T::Lookup as StaticLookup>::Source>
balance: <T::Currency as Currency<T::AccountId>>::Balance
```
Consume a oneshot account then transfer some amount to an account,
and the remaining amount to another account.
- `block_height`: Must be a recent block number.
The limit is `BlockHashCount` in the past. (this is to prevent replay attacks)
- `dest`: The destination account.
- `dest_is_oneshot`: If set to `true`, then a oneshot account is created at `dest`. Else, `dest` has to be an existing account.
- `dest2`: The second destination account.
- `dest2_is_oneshot`: If set to `true`, then a oneshot account is created at `dest2`. Else, `dest2` has to be an existing account.
- `balance1`: The amount transfered to `dest`, the leftover being transfered to `dest2`.
### AuthorityMembers - 10
#### go_offline - 0
<details><summary><code>go_offline()</code></summary>
```rust
```
ask to leave the set of validators two sessions after
#### go_online - 1
<details><summary><code>go_online()</code></summary>
```rust
```
</details>
ask to join the set of validators two sessions after
#### set_session_keys - 2
<details><summary><code>set_session_keys(keys)</code></summary>
```
</details>
declare new session keys to replace current ones
#### remove_member_from_blacklist - 4
<details><summary><code>remove_member_from_blacklist(member_id)</code></summary>
```rust
member_id: T::MemberId
```
</details>
remove an identity from the blacklist
### Grandpa - 15
#### report_equivocation - 0
<details><summary><code>report_equivocation(equivocation_proof, key_owner_proof)</code></summary>
```rust
equivocation_proof: Box<EquivocationProof<T::Hash, T::BlockNumber>>
key_owner_proof: T::KeyOwnerProof
```
</details>
Report voter equivocation/misbehavior. This method will verify the
equivocation proof and validate the given key ownership proof
against the extracted offender. If both are valid, the offence
will be reported.
### UpgradeOrigin - 21
#### dispatch_as_root_unchecked_weight - 1
<details><summary><code>dispatch_as_root_unchecked_weight(call, weight)</code></summary>
call: Box<<T as Config>::Call>
weight: Weight
```
</details>
Dispatches a function call from root origin.
This function does not check the weight of the call, and instead allows the
caller to specify the weight of the call.
The weight of this call is defined by the caller.
### Preimage - 22
#### note_preimage - 0
<details><summary><code>note_preimage(bytes)</code></summary>
bytes: Vec<u8>
```
</details>
Register a preimage on-chain.
If the preimage was previously requested, no fees or deposits are taken for providing
the preimage. Otherwise, a deposit is taken proportional to the size of the preimage.
#### unnote_preimage - 1
<details><summary><code>unnote_preimage(hash)</code></summary>
hash: T::Hash
```
</details>
Clear an unrequested preimage from the runtime storage.
If `len` is provided, then it will be a much cheaper operation.
- `hash`: The hash of the preimage to be removed from the store.
- `len`: The length of the preimage of `hash`.
#### request_preimage - 2
<details><summary><code>request_preimage(hash)</code></summary>
```rust
hash: T::Hash
```
</details>
Request a preimage be uploaded to the chain without paying any fees or deposits.
If the preimage requests has already been provided on-chain, we unreserve any deposit
a user may have paid, and take the control of the preimage out of their hands.
#### unrequest_preimage - 3
<details><summary><code>unrequest_preimage(hash)</code></summary>
hash: T::Hash
```
</details>
Clear a previously made request for a preimage.
NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`.
### TechnicalCommittee - 23
#### execute - 1
<details><summary><code>execute(proposal, length_bound)</code></summary>
proposal: Box<<T as Config<I>>::Proposal>
length_bound: u32
```
</details>
Dispatch a proposal from a member using the `Member` origin.
Origin must be a member of the collective.
**Complexity**:
- `O(B + M + P)` where:
- `B` is `proposal` size in bytes (length-fee-bounded)
- `M` members-count (code-bounded)
- `P` complexity of dispatching `proposal`
#### propose - 2
<details><summary><code>propose(threshold, proposal, length_bound)</code></summary>
threshold: MemberCount
proposal: Box<<T as Config<I>>::Proposal>
length_bound: u32
```
</details>
Add a new proposal to either be voted on or executed directly.
Requires the sender to be member.
`threshold` determines whether `proposal` is executed directly (`threshold < 2`)
or put up for voting.
**Complexity**
- `O(B + M + P1)` or `O(B + M + P2)` where:
- `B` is `proposal` size in bytes (length-fee-bounded)
- `M` is members-count (code- and governance-bounded)
- branching is influenced by `threshold` where:
- `P1` is proposal execution complexity (`threshold < 2`)
- `P2` is proposals-count (code-bounded) (`threshold >= 2`)
#### vote - 3
<details><summary><code>vote(proposal, index, approve)</code></summary>
proposal: T::Hash
index: ProposalIndex
approve: bool
```
</details>
Add an aye or nay vote for the sender to the given proposal.
Requires the sender to be a member.
Transaction fees will be waived if the member is voting on any particular proposal
for the first time and the call is successful. Subsequent vote changes will charge a
fee.
**Complexity**
- `O(M)` where `M` is members-count (code- and governance-bounded)
<details><summary><code>close(proposal_hash, index, proposal_weight_bound, length_bound)</code></summary>
```rust
proposal_hash: T::Hash
index: ProposalIndex
proposal_weight_bound: Weight
length_bound: u32
```
</details>
Close a vote that is either approved, disapproved or whose voting period has ended.
May be called by any signed account in order to finish voting and close the proposal.
If called before the end of the voting period it will only close the vote if it is
has enough votes to be approved or disapproved.
If called after the end of the voting period abstentions are counted as rejections
unless there is a prime member set and the prime member cast an approval.
If the close operation completes successfully with disapproval, the transaction fee will
be waived. Otherwise execution of the approved operation will be charged to the caller.
+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed
proposal.
+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via
`storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
**Complexity**
- `O(B + M + P1 + P2)` where:
- `B` is `proposal` size in bytes (length-fee-bounded)
- `M` is members-count (code- and governance-bounded)
- `P1` is the complexity of `proposal` preimage.
- `P2` is proposal-count (code-bounded)
### UniversalDividend - 30
#### claim_uds - 0
<details><summary><code>claim_uds()</code></summary>
```rust
```
</details>
Claim Universal Dividends
#### transfer_ud - 1
<details><summary><code>transfer_ud(dest, value)</code></summary>
```rust
dest: <T::Lookup as StaticLookup>::Source
value: BalanceOf<T>
```
</details>
Transfer some liquid free balance to another account, in milliUD.
#### transfer_ud_keep_alive - 2
<details><summary><code>transfer_ud_keep_alive(dest, value)</code></summary>
dest: <T::Lookup as StaticLookup>::Source
value: BalanceOf<T>
```
</details>
Transfer some liquid free balance to another account, in milliUD.
### Identity - 41
#### create_identity - 0
<details><summary><code>create_identity(owner_key)</code></summary>
owner_key: T::AccountId
```
</details>
Create an identity for an existing account
- `owner_key`: the public key corresponding to the identity to be created
The origin must be allowed to create an identity.
#### confirm_identity - 1
<details><summary><code>confirm_identity(idty_name)</code></summary>
idty_name: IdtyName
```
</details>
Confirm the creation of an identity and give it a name
- `idty_name`: the name uniquely associated to this identity. Must match the validation rules defined by the runtime.
The identity must have been created using `create_identity` before it can be confirmed.
#### change_owner_key - 3
<details><summary><code>change_owner_key(new_key, new_key_sig)</code></summary>
```rust
new_key: T::AccountId
new_key_sig: T::Signature
```
</details>
Change identity owner key.
- `new_key`: the new owner key.
- `new_key_sig`: the signature of the encoded form of `IdtyIndexAccountIdPayload`.
Must be signed by `new_key`.
The origin should be the old identity owner key.
#### revoke_identity - 4
<details><summary><code>revoke_identity(idty_index, revocation_key, revocation_sig)</code></summary>
idty_index: T::IdtyIndex
revocation_key: T::AccountId
revocation_sig: T::Signature
```
</details>
Revoke an identity using a revocation signature
- `idty_index`: the index of the identity to be revoked.
- `revocation_key`: the key used to sign the revocation payload.
- `revocation_sig`: the signature of the encoded form of `RevocationPayload`.
Must be signed by `revocation_key`.
Any signed origin can execute this call.
#### fix_sufficients - 7
<details><summary><code>fix_sufficients(owner_key, inc)</code></summary>
```rust
owner_key: T::AccountId
inc: bool
```
</details>
change sufficient ref count for given key
#### link_account - 8
<details><summary><code>link_account(account_id, payload_sig)</code></summary>
```rust
account_id: T::AccountId
payload_sig: T::Signature
```
</details>
Link an account to an identity
### Membership - 42
#### claim_membership - 1
<details><summary><code>claim_membership()</code></summary>
```rust
```
</details>
Benjamin Gallois
committed
claim membership
it must fullfill the requirements (certs, distance)
for main wot claim_membership is called automatically when validating identity
for smith wot, it means joining the authority members
#### renew_membership - 2
<details><summary><code>renew_membership()</code></summary>
```rust
```
</details>
extend the validity period of an active membership
#### revoke_membership - 3
<details><summary><code>revoke_membership()</code></summary>
```rust
```
</details>
revoke an active membership
(only available for sub wot, automatic for main wot)
### Cert - 43
#### add_cert - 0
<details><summary><code>add_cert(issuer, receiver)</code></summary>
issuer: T::IdtyIndex
receiver: T::IdtyIndex
```
</details>
Add a new certification or renew an existing one
- `receiver`: the account receiving the certification from the origin
The origin must be allow to certify.
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
### Distance - 44
#### request_distance_evaluation - 0
<details><summary><code>request_distance_evaluation()</code></summary>
```rust
```
</details>
Request an identity to be evaluated
#### update_evaluation - 1
<details><summary><code>update_evaluation(computation_result)</code></summary>
```rust
computation_result: ComputationResult
```
</details>
(Inherent) Push an evaluation result to the pool
#### force_update_evaluation - 2
<details><summary><code>force_update_evaluation(evaluator, computation_result)</code></summary>
```rust
evaluator: <T as frame_system::Config>::AccountId
computation_result: ComputationResult
```
</details>
Push an evaluation result to the pool
#### force_set_distance_status - 3
<details><summary><code>force_set_distance_status(identity, status)</code></summary>
```rust
identity: <T as pallet_identity::Config>::IdtyIndex
status: Option<(<T as frame_system::Config>::AccountId, DistanceStatus)>
```
</details>
Set the distance evaluation status of an identity
Removes the status if `status` is `None`.
* `status.0` is the account for whom the price will be unreserved or slashed
when the evaluation completes.
* `status.1` is the status of the evaluation.
### SmithMembership - 52
#### claim_membership - 1
<details><summary><code>claim_membership()</code></summary>
```rust
```
</details>
Benjamin Gallois
committed
claim membership
it must fullfill the requirements (certs, distance)
for main wot claim_membership is called automatically when validating identity
for smith wot, it means joining the authority members
#### renew_membership - 2
<details><summary><code>renew_membership()</code></summary>
```rust
```
extend the validity period of an active membership
#### revoke_membership - 3
<details><summary><code>revoke_membership()</code></summary>
```rust
```
</details>
revoke an active membership
(only available for sub wot, automatic for main wot)
### SmithCert - 53
#### add_cert - 0
<details><summary><code>add_cert(issuer, receiver)</code></summary>
issuer: T::IdtyIndex
receiver: T::IdtyIndex
```
</details>
Add a new certification or renew an existing one
- `receiver`: the account receiving the certification from the origin
The origin must be allow to certify.
### AtomicSwap - 60
#### create_swap - 0
<details><summary><code>create_swap(target, hashed_proof, action, duration)</code></summary>
```rust
target: T::AccountId
hashed_proof: HashedProof
action: T::SwapAction
duration: T::BlockNumber
```
</details>
Register a new atomic swap, declaring an intention to send funds from origin to target
on the current blockchain. The target can claim the fund using the revealed proof. If
the fund is not claimed after `duration` blocks, then the sender can cancel the swap.
The dispatch origin for this call must be _Signed_.
- `target`: Receiver of the atomic swap.
- `hashed_proof`: The blake2_256 hash of the secret proof.
- `balance`: Funds to be sent from origin.
- `duration`: Locked duration of the atomic swap. For safety reasons, it is recommended
that the revealer uses a shorter duration than the counterparty, to prevent the
situation where the revealer reveals the proof too late around the end block.
#### claim_swap - 1
<details><summary><code>claim_swap(proof, action)</code></summary>
proof: Vec<u8>
action: T::SwapAction
```
</details>
Claim an atomic swap.
The dispatch origin for this call must be _Signed_.
- `proof`: Revealed proof of the claim.
- `action`: Action defined in the swap, it must match the entry in blockchain. Otherwise
the operation fails. This is used for weight calculation.
#### cancel_swap - 2
<details><summary><code>cancel_swap(target, hashed_proof)</code></summary>
target: T::AccountId
hashed_proof: HashedProof
```
</details>
Cancel an atomic swap. Only possible after the originally set duration has passed.
The dispatch origin for this call must be _Signed_.
- `target`: Target of the original atomic swap.
- `hashed_proof`: Hashed proof of the original atomic swap.
### Multisig - 61
#### as_multi_threshold_1 - 0
<details><summary><code>as_multi_threshold_1(other_signatories, call)</code></summary>
other_signatories: Vec<T::AccountId>
call: Box<<T as Config>::RuntimeCall>
```
</details>
Immediately dispatch a multi-signature call using a single approval from the caller.
The dispatch origin for this call must be _Signed_.
- `other_signatories`: The accounts (other than the sender) who are part of the
multi-signature, but do not participate in the approval process.
- `call`: The call to be executed.
Result is equivalent to the dispatched result.
**Complexity**
O(Z + C) where Z is the length of the call and C its execution weight.
#### as_multi - 1
<details><summary><code>as_multi(threshold, other_signatories, maybe_timepoint, call, max_weight)</code></summary>
threshold: u16
other_signatories: Vec<T::AccountId>
maybe_timepoint: Option<Timepoint<T::BlockNumber>>
call: Box<<T as Config>::RuntimeCall>
max_weight: Weight
```
</details>
Register approval for a dispatch to be made from a deterministic composite account if
approved by a total of `threshold - 1` of `other_signatories`.
If there are enough, then dispatch the call.
Payment: `DepositBase` will be reserved if this is the first approval, plus
`threshold` times `DepositFactor`. It is returned once this dispatch happens or
is cancelled.
The dispatch origin for this call must be _Signed_.
- `threshold`: The total number of approvals for this dispatch before it is executed.