Schemas
Calls
create_schema
Attributes
Name |
Type |
model |
BoundedVec<u8, T::SchemaModelMaxBytesBoundedVecLimit> |
model_type |
ModelType |
payload_location |
PayloadLocation |
Python
call = substrate.compose_call(
'Schemas', 'create_schema', {
'model': 'Bytes',
'model_type': (
'AvroBinary',
'Parquet',
),
'payload_location': (
'OnChain',
'IPFS',
'Itemized',
'Paginated',
),
}
)
create_schema_v2
Attributes
Name |
Type |
model |
BoundedVec<u8, T::SchemaModelMaxBytesBoundedVecLimit> |
model_type |
ModelType |
payload_location |
PayloadLocation |
settings |
BoundedVec<SchemaSetting, T::MaxSchemaSettingsPerSchema> |
Python
call = substrate.compose_call(
'Schemas', 'create_schema_v2', {
'model': 'Bytes',
'model_type': (
'AvroBinary',
'Parquet',
),
'payload_location': (
'OnChain',
'IPFS',
'Itemized',
'Paginated',
),
'settings': [
(
'AppendOnly',
'SignatureRequired',
),
],
}
)
create_schema_via_governance
Attributes
Name |
Type |
creator_key |
T::AccountId |
model |
BoundedVec<u8, T::SchemaModelMaxBytesBoundedVecLimit> |
model_type |
ModelType |
payload_location |
PayloadLocation |
settings |
BoundedVec<SchemaSetting, T::MaxSchemaSettingsPerSchema> |
Python
call = substrate.compose_call(
'Schemas', 'create_schema_via_governance', {
'creator_key': 'AccountId',
'model': 'Bytes',
'model_type': (
'AvroBinary',
'Parquet',
),
'payload_location': (
'OnChain',
'IPFS',
'Itemized',
'Paginated',
),
'settings': [
(
'AppendOnly',
'SignatureRequired',
),
],
}
)
propose_to_create_schema
Attributes
Name |
Type |
model |
BoundedVec<u8, T::SchemaModelMaxBytesBoundedVecLimit> |
model_type |
ModelType |
payload_location |
PayloadLocation |
settings |
BoundedVec<SchemaSetting, T::MaxSchemaSettingsPerSchema> |
Python
call = substrate.compose_call(
'Schemas', 'propose_to_create_schema', {
'model': 'Bytes',
'model_type': (
'AvroBinary',
'Parquet',
),
'payload_location': (
'OnChain',
'IPFS',
'Itemized',
'Paginated',
),
'settings': [
(
'AppendOnly',
'SignatureRequired',
),
],
}
)
set_max_schema_model_bytes
Attributes
Python
call = substrate.compose_call(
'Schemas', 'set_max_schema_model_bytes', {'max_size': 'u32'}
)
Events
SchemaCreated
Attributes
Name |
Type |
Composition |
key |
T::AccountId |
AccountId |
schema_id |
SchemaId |
u16 |
SchemaMaxSizeChanged
Attributes
Name |
Type |
Composition |
max_size |
u32 |
u32 |
Storage functions
CurrentSchemaIdentifierMaximum
Python
result = substrate.query(
'Schemas', 'CurrentSchemaIdentifierMaximum', []
)
Return value
'u16'
GovernanceSchemaModelMaxBytes
Python
result = substrate.query(
'Schemas', 'GovernanceSchemaModelMaxBytes', []
)
Return value
'u32'
SchemaInfos
Python
result = substrate.query(
'Schemas', 'SchemaInfos', ['u16']
)
Return value
{
'model_type': ('AvroBinary', 'Parquet'),
'payload_location': ('OnChain', 'IPFS', 'Itemized', 'Paginated'),
'settings': 'u16',
}
SchemaPayloads
Python
result = substrate.query(
'Schemas', 'SchemaPayloads', ['u16']
)
Return value
'Bytes'
Constants
MaxSchemaRegistrations
Value
65000
Python
constant = substrate.get_constant('Schemas', 'MaxSchemaRegistrations')
MaxSchemaSettingsPerSchema
Value
2
Python
constant = substrate.get_constant('Schemas', 'MaxSchemaSettingsPerSchema')
MinSchemaModelSizeBytes
Value
8
Python
constant = substrate.get_constant('Schemas', 'MinSchemaModelSizeBytes')
SchemaModelMaxBytesBoundedVecLimit
Value
65500
Python
constant = substrate.get_constant('Schemas', 'SchemaModelMaxBytesBoundedVecLimit')
Errors
ExceedsMaxSchemaModelBytes
InvalidSchema
InvalidSetting
LessThanMinSchemaModelBytes
SchemaCountOverflow