StorageDeposit

Variant 617 v393

pallet_contracts::primitives::StorageDeposit

About This Type

Enum type: StorageDeposit.

A tagged union where the first byte selects which variant is active, followed by that variant's data.

Encoding: 1-byte variant index followed by the selected variant's field data.

Variants (2)

IndexNameFieldsDocs
0Refund
1Charge

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 2 possible variants.
Size
variable (1+ bytes)

Examples

Refund = Refund(u64)
0x00<field0>
00 Variant index 0 = Refund
field 0 field0: u64
Charge = Charge(u64)
0x01<field0>
01 Variant index 1 = Charge
field 0 field0: u64

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode StorageDeposit — variant "Refund"
const value = registry.createType("StorageDeposit", { Refund: { value: 1_000_000_000n } });
console.log("Hex:", value.toHex());

Type Parameters

Balance = u64

Referenced By (2)

Type Information

Type ID
617
Kind
Variant
Path
pallet_contracts::primitives::StorageDeposit
Runtime
v393