CodeInfo
Composite 544 v393pallet_contracts::wasm::CodeInfo
About This Type
Structured type: CodeInfo.
A struct-like type where each field is encoded in declaration order.
Encoding: Fields encoded consecutively in declaration order, no field names or separators.
Fields (5)
| # | Name | Type |
|---|---|---|
| 0 | owner | AccountId |
| 1 | deposit | Compact<u64> |
| 2 | refcount | Compact<u64> |
| 3 | determinism | Determinism |
| 4 | code_len | u32 |
SCALE Encoding
- Rule
- 5 fields encoded consecutively in declaration order. No field names or delimiters.
- Size
- sum of field sizes
Examples
Struct with 5 fields = owner: AccountId, deposit: Compact<u64>, refcount: Compact<u64>, determinism: Determinism, code_len: u32
0x<field0><field1><field2><field3><field4>field 0 owner: AccountIdfield 1 deposit: Compact<u64>field 2 refcount: Compact<u64>field 3 determinism: Determinismfield 4 code_len: u32Code Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode CodeInfo
const value = registry.createType("CodeInfo", {
owner: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
deposit: 0,
refcount: 0,
determinism: 0,
code_len: 1000000
});
console.log("Hex:", value.toHex());Type Parameters
T
Type Information
- Type ID
- 544
- Kind
- Composite
- Path
- pallet_contracts::wasm::CodeInfo
- Runtime
- v393