Expand description
Allows transactions in alternative payment methods such as capacity
Quick Links
- Configuration:
Config
- Extrinsics:
Call
- Runtime API:
CapacityTransactionPaymentRuntimeApi
- Custom RPC API:
CapacityPaymentApiServer
- Event Enum:
Event
- Error Enum:
Error
Frequency Transaction Pallet
Allows users to perform transactions using Capacity.
Summary
Frequency supports the following alternative payments:
- Capacity: A refillable resource limited to a subset of transactions.
The Frequency Transaction Pallet proxies or nests one or more calls inside of the root call to enable them to be paid using an alternative method.
For example, to call something like add_ipfs_message(params)
with Capacity, one would call pay_with_capacity(add_ipfs_message(params))
.
The pay_with_capacity
will verify that the inner call is allowed with Capacity.
Requirements for Paying with Capacity
The account must:
- Be a current control key on a Provider.
- Have a minimum balance of the existential deposit.
- Must have enough Capacity for the call remaining in the current Epoch.
Capacity Stable Weights
Token costs on a specific transaction can fluctuate due to benchmark changes, but the costs of Capacity calls are setup to be relatively consistent. This consistency is because the price of a Capacity transaction uses a separate set of benchmark weights, which are kept constant at a given point in time. While periodic updates do occur, the costs typically stay the same or may even decrease over time.
Actions
The Frequency Transaction pallet provides for:
- Transacting using only Capacity
Interactions
Extrinsics
Name/Description | Caller | Payment | Key Events | Runtime Added |
---|---|---|---|---|
pay_with_capacity Proxies a single Capacity allowed call | Provider | Capacity | CapacityWithdrawn * | 1 |
pay_with_capacity_batch_all Proxies a batch (limit 10) of Capacity allowed calls | Provider | Capacity | CapacityWithdrawn * | 1 |
* Note: This is just the event noting the use of Capacity. Additional events for the call being proxied will still occur.
See Rust Docs for more details.
RPCs
Note: May be restricted based on node settings and configuration.
Name | Description | Call | Node Version |
---|---|---|---|
Compute Capacity Fee | Calculates the expected Capacity cost of the supplied transaction | computeCapacityFeeDetails | v1.8.0+ |
See Rust Docs for more details.
Re-exports
pub use types::GetStableWeight;
pub use pallet::*;
pub use weights::*;
Modules
- Fixes the Weight values for Capacity transactions as static values Any change in actual weight does not adjust the cost, but will still adjust the block space
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - Autogenerated weights for
pallet_frequency_tx_payment
Structs
- A type used to withdraw Capacity from an account.
- Require the transactor pay for themselves and maybe include a tip to gain additional priority in the queue.
Enums
- Custom Transaction Validity Errors for ChargeFrqTransactionPayment
- Used to pass the initial payment info from pre- to post-dispatch.
Traits
- A trait used for the withdrawal of Capacity.