StorageDepositTransferredAndHeld
Event v334 → current #8Emitted when storage deposit is transferred and held by the contract system.
View events on chainUseful for: developersanalytics
The Big Picture
Contracts pay for storage through deposits. This tracks who paid and how much.
Use Cases
- Track storage costs
- Monitor deposit flows
- Build cost analysis tools
From Chain Metadata
Some funds have been transferred and held as storage deposit.
Triggers
Emitted by
Preconditions
- Contract operation increased storage
- Payer has sufficient balance
Effects
Storage Modified
Postconditions
- Deposit transferred from payer
- Deposit held for storage
Side Effects
- Payer's free balance decreased
Event Data
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Subscribe to StorageDepositTransferredAndHeld events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.Contracts.StorageDepositTransferredAndHeld.get(block.hash);
for (const evt of events) {
console.log("StorageDepositTransferredAndHeld:", evt.payload);
}
});Runtime Info
- Pallet Index
- 29
- Event Index
- 8
- First Version
- v334
- Current Version
- v411