|
| 1 | +# Frequency Transaction Pallet |
| 2 | + |
| 3 | +Allows users to perform transactions using Capacity. |
| 4 | + |
| 5 | +## Summary |
| 6 | + |
| 7 | +Frequency supports the following alternative payments: |
| 8 | + |
| 9 | +- Capacity: A refillable resource limited to a subset of transactions. |
| 10 | + |
| 11 | +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. |
| 12 | +For example, to call something like `add_ipfs_message(params)` with Capacity, one would call `pay_with_capacity(add_ipfs_message(params))`. |
| 13 | +The `pay_with_capacity` will verify that the inner call is allowed with Capacity. |
| 14 | + |
| 15 | +### Requirements for Paying with Capacity |
| 16 | + |
| 17 | +The account must: |
| 18 | +1. Be a current control key on a Provider. |
| 19 | +2. Have a minimum balance of the existential deposit. |
| 20 | +3. Must have enough Capacity for the call remaining in the current Epoch. |
| 21 | + |
| 22 | +### Capacity Stable Weights |
| 23 | + |
| 24 | +Token costs on a specific transaction can fluctuate due to benchmark changes, but the costs of Capacity calls are setup to be relatively consistent. |
| 25 | +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. |
| 26 | +While periodic updates do occur, the costs typically stay the same or may even decrease over time. |
| 27 | + |
| 28 | +### Actions |
| 29 | + |
| 30 | +The Frequency Transaction pallet provides for: |
| 31 | + |
| 32 | +- Transacting using only Capacity |
| 33 | + |
| 34 | +## Interactions |
| 35 | + |
| 36 | +### Extrinsics |
| 37 | + |
| 38 | +| Name/Description | Caller | Payment | Key Events | Runtime Added | |
| 39 | +| -------------------------------- | ------------- | ------- | ------------------------------------------------------------------------------------------------------------- | ------------- | |
| 40 | +| `pay_with_capacity`<br />Proxies a single Capacity allowed call | Provider | Capacity | [`CapacityWithdrawn`](https://frequency-chain.github.io/frequency/pallet_capacity/pallet/enum.Event.html#variant.CapacityWithdrawn)* | 1 | |
| 41 | +| `pay_with_capacity_batch_all`<br />Proxies a batch (limit 10) of Capacity allowed calls | Provider | Capacity | [`CapacityWithdrawn`](https://frequency-chain.github.io/frequency/pallet_capacity/pallet/enum.Event.html#variant.CapacityWithdrawn)* | 1 | |
| 42 | + |
| 43 | +\* Note: This is just the event noting the use of Capacity. Additional events for the call being proxied will still occur. |
| 44 | + |
| 45 | +See [Rust Docs](https://frequency-chain.github.io/frequency/pallet_frequency_tx_payment/pallet/struct.Pallet.html) for more details. |
| 46 | + |
| 47 | +### RPCs |
| 48 | + |
| 49 | +Note: May be restricted based on node settings and configuration. |
| 50 | + |
| 51 | +| Name | Description | Call | Node Version | |
| 52 | +| ------- | ----------------- | ---------------------------------------------------------------------------------------------------- | ------------ | |
| 53 | +| Compute Capacity Fee | Calculates the expected Capacity cost of the supplied transaction | [`computeCapacityFeeDetails`](https://frequency-chain.github.io/frequency/pallet_frequency_tx_payment_rpc/trait.CapacityPaymentApiServer.html#tymethod.compute_capacity_fee_details) | v1.8.0+ | |
| 54 | + |
| 55 | +See [Rust Docs](https://frequency-chain.github.io/frequency/pallet_frequency_tx_payment_rpc/trait.CapacityPaymentApiServer.html) for more details. |
0 commit comments