Appearance
Subscriptions and billing
A subscription holds native coin (PLS) and pays for requests from the consumer contracts you add to it.
| Action | Who | How |
|---|---|---|
| Create | anyone (you become owner) | createSubscription() · verity sub create --fund 10 |
| Fund | anyone | fundSubscription(subId) with value · verity sub fund <id> 2.5 |
| Add/remove consumer (max 100) | owner | addConsumer / removeConsumer · verity sub add-consumer |
| Transfer ownership | owner, then new owner accepts | requestSubscriptionOwnerTransfer → acceptSubscriptionOwnerTransfer |
| Cancel and refund | owner, when nothing is pending | cancelSubscription(subId, to) · verity sub cancel <id> |
Reservations
When a consumer requests randomness, the coordinator reserves the request's worst-case cost from the subscription:
reserve = (callbackGasLimit + fulfillmentGasOverhead) × lane max gas price × (100 + premium%) / 100 + protocol flat feeAt fulfilment you pay the actual cost (never more than the reservation), and the rest is released. A request fails with InsufficientBalance if balance − reserved cannot cover its reservation, so keep a buffer. getSubscription(subId) returns the balance, reserved amount, pending request count, owner and consumers.
See Pricing for the full fee formula and worked numbers.
Removing a consumer
Requests the consumer already made still complete and are billed. A subscription cannot be cancelled while requests are pending: they must be fulfilled or cancelled first (see timeouts), so operators are always paid for work in flight.