Expand description

Allows transactions in alternative payment methods such as capacity

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:

  1. Be a current control key on a Provider.
  2. Have a minimum balance of the existential deposit.
  3. 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/DescriptionCallerPaymentKey EventsRuntime Added
pay_with_capacity
Proxies a single Capacity allowed call
ProviderCapacityCapacityWithdrawn*1
pay_with_capacity_batch_all
Proxies a batch (limit 10) of Capacity allowed calls
ProviderCapacityCapacityWithdrawn*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.

NameDescriptionCallNode Version
Compute Capacity FeeCalculates the expected Capacity cost of the supplied transactioncomputeCapacityFeeDetailsv1.8.0+

See Rust Docs for more details.

Re-exports

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

Enums

Traits