Utility
The Utility pallet serves as a repository of utility functions for the peaq network, offering capabilities such as account management, contract creation and administration, and interaction with other pallets within the network.
Pallet functionalities:
Batch Dispatch: It allows sending a batch of calls to be dispatched. The purpose is to execute a group of extrinsics atomically. The number of calls must not exceed the
batched_calls_limit
constant (available in constant metadata).Pseudonymous Dispatch: In pseudonymous dispatch, an account executes a call through a pseudonymous account. A pseudonymous account is an alternative account ID. Each account has 2*2**16 possible pseudonyms. One possible use case is when you need multiple distinct accounts that need to be controlled by the same keypair.
Functions:
batch(call)
: This function sends a batch of calls to be dispatched. If a call fails, successful calls in the batch up to that point will be executed, and aBatchInterrupted
event will be emitted. If all calls are successful, aBatchCompleted
event is emitted.batch_all(call)
: Similar tobatch
, but all the extrinsics are reverted if any of the extrinsics in the batch is unsuccessful.force_batch(call)
: This function sends a batch of dispatch calls. Unlikebatch
, it allows errors and doesn't interrupt the execution.with_weight(call)
: Dispatches a call with a specified weight. This function does not check for the weight of the call; instead, it allows the root to specify the weight. This extrinsic must be executed from the root.as_derivative(index, call)
: Sends a call through an indexed pseudonym of the sender given the index number and the call.dispatch_as(asOrigin, call)
: Dispatches a function call provided an origin and the call to be dispatched. The dispatch origin for this call must be the root.