diff --git a/README.md b/README.md index ed264a43a..fdc1c06df 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,7 @@ Encointer wallet and client for mobile phones ## Setup -The following works for ubuntu 22.04: - +### Ubuntu 22.04 Install Android Studio from snap and set it up as follows: 1. Tools > SDK manager > Install SDK Android 8.0 Oreo (not sure if version matters much) 2. ... Tools > Install SDK commandline tools @@ -52,16 +51,17 @@ sudo apt install cmake ninja-build libgtk-3-dev npm build-essentials # install project deps (i.e., melos) .flutter/bin/dart pub get .flutter/bin/dart melos bootstrap - -sudo npm install --global yarn -# optional: -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash ``` In studio: under run configurations, add build flavor `dev` Now: run! +### Windows +Essentially only a project wide flutter installation is needed. A simple trick to install flutter wrapper like above is +to open a Git Bash shell on windows to run the `./scripts/install_flutter_wrapper.sh`. All `./.flutter\bin\dart` +commands work from a windows terminal, so the rest of the installation steps are the same. + ### Additional Info #### Flutter wrapper and the .flutter git submodule diff --git a/app/assets/avatars/participant20.svg b/app/assets/avatars/participant20.svg new file mode 100644 index 000000000..61381cfcc --- /dev/null +++ b/app/assets/avatars/participant20.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant21.svg b/app/assets/avatars/participant21.svg new file mode 100644 index 000000000..067e817e1 --- /dev/null +++ b/app/assets/avatars/participant21.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant22.svg b/app/assets/avatars/participant22.svg new file mode 100644 index 000000000..5b4c44feb --- /dev/null +++ b/app/assets/avatars/participant22.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant23.svg b/app/assets/avatars/participant23.svg new file mode 100644 index 000000000..7056bd2ed --- /dev/null +++ b/app/assets/avatars/participant23.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant24.svg b/app/assets/avatars/participant24.svg new file mode 100644 index 000000000..e84d51a63 --- /dev/null +++ b/app/assets/avatars/participant24.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant25.svg b/app/assets/avatars/participant25.svg new file mode 100644 index 000000000..d18b1910d --- /dev/null +++ b/app/assets/avatars/participant25.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant26.svg b/app/assets/avatars/participant26.svg new file mode 100644 index 000000000..65c253a39 --- /dev/null +++ b/app/assets/avatars/participant26.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant27.svg b/app/assets/avatars/participant27.svg new file mode 100644 index 000000000..1e7b5ae3c --- /dev/null +++ b/app/assets/avatars/participant27.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant28.svg b/app/assets/avatars/participant28.svg new file mode 100644 index 000000000..62d7ab2d4 --- /dev/null +++ b/app/assets/avatars/participant28.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/avatars/participant29.svg b/app/assets/avatars/participant29.svg new file mode 100644 index 000000000..d325de15b --- /dev/null +++ b/app/assets/avatars/participant29.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/lib/gen/assets.gen.dart b/app/lib/gen/assets.gen.dart index 193a4d4c0..a102fb551 100644 --- a/app/lib/gen/assets.gen.dart +++ b/app/lib/gen/assets.gen.dart @@ -74,6 +74,36 @@ class $AssetsAvatarsGen { /// File path: assets/avatars/participant19.svg SvgGenImage get participant19 => const SvgGenImage('assets/avatars/participant19.svg'); + /// File path: assets/avatars/participant20.svg + SvgGenImage get participant20 => const SvgGenImage('assets/avatars/participant20.svg'); + + /// File path: assets/avatars/participant21.svg + SvgGenImage get participant21 => const SvgGenImage('assets/avatars/participant21.svg'); + + /// File path: assets/avatars/participant22.svg + SvgGenImage get participant22 => const SvgGenImage('assets/avatars/participant22.svg'); + + /// File path: assets/avatars/participant23.svg + SvgGenImage get participant23 => const SvgGenImage('assets/avatars/participant23.svg'); + + /// File path: assets/avatars/participant24.svg + SvgGenImage get participant24 => const SvgGenImage('assets/avatars/participant24.svg'); + + /// File path: assets/avatars/participant25.svg + SvgGenImage get participant25 => const SvgGenImage('assets/avatars/participant25.svg'); + + /// File path: assets/avatars/participant26.svg + SvgGenImage get participant26 => const SvgGenImage('assets/avatars/participant26.svg'); + + /// File path: assets/avatars/participant27.svg + SvgGenImage get participant27 => const SvgGenImage('assets/avatars/participant27.svg'); + + /// File path: assets/avatars/participant28.svg + SvgGenImage get participant28 => const SvgGenImage('assets/avatars/participant28.svg'); + + /// File path: assets/avatars/participant29.svg + SvgGenImage get participant29 => const SvgGenImage('assets/avatars/participant29.svg'); + /// List of all assets List get values => [ participant00, @@ -95,7 +125,17 @@ class $AssetsAvatarsGen { participant16, participant17, participant18, - participant19 + participant19, + participant20, + participant21, + participant22, + participant23, + participant24, + participant25, + participant26, + participant27, + participant28, + participant29 ]; } diff --git a/app/lib/models/ceremonies/ceremonies.dart b/app/lib/models/ceremonies/ceremonies.dart index f0cb6f5d8..c866e52dd 100644 --- a/app/lib/models/ceremonies/ceremonies.dart +++ b/app/lib/models/ceremonies/ceremonies.dart @@ -2,10 +2,12 @@ import 'dart:convert'; import 'package:json_annotation/json_annotation.dart'; -import 'package:encointer_wallet/models/communities/community_identifier.dart'; import 'package:ew_polkadart/encointer_types.dart' as et; import 'package:encointer_wallet/utils/enum.dart'; +export 'reputation/v1.dart'; +export 'reputation/v2.dart'; + part 'ceremonies.g.dart'; @JsonSerializable(explicitToJson: true) @@ -72,23 +74,6 @@ class AggregatedAccountDataGlobal { // ignore: constant_identifier_names enum ParticipantType { Bootstrapper, Reputable, Endorsee, Newbie } -@JsonSerializable() -class CommunityReputation { - CommunityReputation(this.communityIdentifier, this.reputation); - - factory CommunityReputation.fromJson(Map json) => _$CommunityReputationFromJson(json); - - Map toJson() => _$CommunityReputationToJson(this); - - CommunityIdentifier communityIdentifier; - Reputation reputation; - - @override - String toString() { - return jsonEncode(this); - } -} - @JsonSerializable() class Meetup { Meetup(this.index, this.locationIndex, this.time, this.registry); @@ -116,10 +101,6 @@ class Meetup { // ignore: constant_identifier_names enum CeremonyPhase { Registering, Assigning, Attesting } -// For compatibility with substrate's naming convention. -// ignore: constant_identifier_names -enum Reputation { Unverified, UnverifiedReputable, VerifiedUnlinked, VerifiedLinked } - // -- Helper functions for above types CeremonyPhase ceremonyPhaseTypeFromPolkadart(et.CeremonyPhaseType phase) { @@ -137,20 +118,6 @@ CeremonyPhase? ceremonyPhaseFromString(String value) { return getEnumFromString(CeremonyPhase.values, value); } -Reputation? reputationFromString(String value) { - return getEnumFromString(Reputation.values, value); -} - -extension ReputationExtension on Reputation { - String toValue() { - return toEnumValue(this); - } - - bool isVerified() { - return this == Reputation.VerifiedUnlinked || this == Reputation.VerifiedLinked; - } -} - extension ParticipantTypeExtension on ParticipantType { String toValue() { return toEnumValue(this); @@ -164,13 +131,3 @@ extension CeremonyPhaseExtension on CeremonyPhase { return toEnumValue(this); } } - -/// Takes a `List` which contains a `List]>` and -/// transforms it into a `Map`. -Map reputationsFromList(List reputationsList) { - final reputations = reputationsList.cast>(); - - return { - for (final cr in reputations) cr[0] as int: CommunityReputation.fromJson(cr[1] as Map), - }; -} diff --git a/app/lib/models/ceremonies/ceremonies.g.dart b/app/lib/models/ceremonies/ceremonies.g.dart index b1a606fb6..6204818ef 100644 --- a/app/lib/models/ceremonies/ceremonies.g.dart +++ b/app/lib/models/ceremonies/ceremonies.g.dart @@ -59,23 +59,6 @@ const _$CeremonyPhaseEnumMap = { CeremonyPhase.Attesting: 'Attesting', }; -CommunityReputation _$CommunityReputationFromJson(Map json) => CommunityReputation( - CommunityIdentifier.fromJson(json['communityIdentifier'] as Map), - $enumDecode(_$ReputationEnumMap, json['reputation']), - ); - -Map _$CommunityReputationToJson(CommunityReputation instance) => { - 'communityIdentifier': instance.communityIdentifier.toJson(), - 'reputation': _$ReputationEnumMap[instance.reputation]!, - }; - -const _$ReputationEnumMap = { - Reputation.Unverified: 'Unverified', - Reputation.UnverifiedReputable: 'UnverifiedReputable', - Reputation.VerifiedUnlinked: 'VerifiedUnlinked', - Reputation.VerifiedLinked: 'VerifiedLinked', -}; - Meetup _$MeetupFromJson(Map json) => Meetup( json['index'] as int, json['locationIndex'] as int, diff --git a/app/lib/models/ceremonies/reputation/v1.dart b/app/lib/models/ceremonies/reputation/v1.dart new file mode 100644 index 000000000..b0610ac75 --- /dev/null +++ b/app/lib/models/ceremonies/reputation/v1.dart @@ -0,0 +1,62 @@ +import 'dart:convert'; + +import 'package:encointer_wallet/models/ceremonies/reputation/v2.dart'; +import 'package:encointer_wallet/utils/enum.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:encointer_wallet/models/communities/community_identifier.dart'; + +part 'v1.g.dart'; + +@JsonSerializable() +class CommunityReputationV1 { + CommunityReputationV1(this.communityIdentifier, this.reputation); + + factory CommunityReputationV1.fromJson(Map json) => _$CommunityReputationV1FromJson(json); + + Map toJson() => _$CommunityReputationV1ToJson(this); + + CommunityIdentifier communityIdentifier; + ReputationV1 reputation; + + CommunityReputation toV2(int currentCeremonyIndex) { + return CommunityReputation(communityIdentifier, reputation.toV2(currentCeremonyIndex)); + } + + @override + String toString() { + return jsonEncode(this); + } +} + +// For compatibility with substrate's naming convention. +// ignore: constant_identifier_names +enum ReputationV1 { Unverified, UnverifiedReputable, VerifiedUnlinked, VerifiedLinked } + +extension ReputationV1Extension on ReputationV1 { + String toValue() { + return toEnumValue(this); + } + + bool isVerified() { + return this == ReputationV1.VerifiedUnlinked || this == ReputationV1.VerifiedLinked; + } + + Reputation toV2(int currentCeremonyIndex) { + return switch (this) { + ReputationV1.Unverified => Reputation.values.unverified(), + ReputationV1.UnverifiedReputable => Reputation.values.unverifiedReputable(), + ReputationV1.VerifiedUnlinked => Reputation.values.verifiedUnlinked(), + ReputationV1.VerifiedLinked => Reputation.values.verifiedLinked(currentCeremonyIndex), + }; + } +} + +/// Takes a `List` which contains a `List]>` and +/// transforms it into a `Map`. +Map reputationsV1FromList(List reputationsList) { + final reputations = reputationsList.cast>(); + + return { + for (final cr in reputations) cr[0] as int: CommunityReputationV1.fromJson(cr[1] as Map), + }; +} diff --git a/app/lib/models/ceremonies/reputation/v1.g.dart b/app/lib/models/ceremonies/reputation/v1.g.dart new file mode 100644 index 000000000..a01018baa --- /dev/null +++ b/app/lib/models/ceremonies/reputation/v1.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'v1.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CommunityReputationV1 _$CommunityReputationV1FromJson(Map json) => CommunityReputationV1( + CommunityIdentifier.fromJson(json['communityIdentifier'] as Map), + $enumDecode(_$ReputationV1EnumMap, json['reputation']), + ); + +Map _$CommunityReputationV1ToJson(CommunityReputationV1 instance) => { + 'communityIdentifier': instance.communityIdentifier.toJson(), + 'reputation': _$ReputationV1EnumMap[instance.reputation]!, + }; + +const _$ReputationV1EnumMap = { + ReputationV1.Unverified: 'Unverified', + ReputationV1.UnverifiedReputable: 'UnverifiedReputable', + ReputationV1.VerifiedUnlinked: 'VerifiedUnlinked', + ReputationV1.VerifiedLinked: 'VerifiedLinked', +}; diff --git a/app/lib/models/ceremonies/reputation/v2.dart b/app/lib/models/ceremonies/reputation/v2.dart new file mode 100644 index 000000000..9f695e760 --- /dev/null +++ b/app/lib/models/ceremonies/reputation/v2.dart @@ -0,0 +1,156 @@ +import 'dart:convert'; + +import 'package:encointer_wallet/utils/enum.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:encointer_wallet/models/communities/community_identifier.dart'; + +part 'v2.g.dart'; + +@JsonSerializable() +class CommunityReputation { + CommunityReputation(this.communityIdentifier, this.reputation); + + factory CommunityReputation.fromJson(Map json) => _$CommunityReputationFromJson(json); + + Map toJson() => _$CommunityReputationToJson(this); + + CommunityIdentifier communityIdentifier; + Reputation reputation; + + @override + String toString() { + return jsonEncode(this); + } +} + +abstract class Reputation { + const Reputation(); + + factory Reputation.fromJson(dynamic json) { + if (json.runtimeType == String) { + final variant = json as String; + switch (variant) { + case 'Unverified': + return const Unverified(); + case 'UnverifiedReputable': + return const UnverifiedReputable(); + case 'VerifiedUnlinked': + return const VerifiedUnlinked(); + default: + throw Exception('Reputation: Invalid variant: "$variant"'); + } + } else { + final variant = (json as Map).keys.first; + switch (variant) { + case 'VerifiedLinked': + return VerifiedLinked(json.values.first as int); + default: + throw Exception('Reputation: Invalid variant: "$variant"'); + } + } + } + + static const $Reputation values = $Reputation(); + + Map toJson(); +} + +class $Reputation { + const $Reputation(); + + Unverified unverified() { + return const Unverified(); + } + + UnverifiedReputable unverifiedReputable() { + return const UnverifiedReputable(); + } + + VerifiedUnlinked verifiedUnlinked() { + return const VerifiedUnlinked(); + } + + VerifiedLinked verifiedLinked(int value0) { + return VerifiedLinked(value0); + } +} + +class Unverified extends Reputation { + const Unverified(); + + @override + Map toJson() => {'Unverified': null}; + + @override + bool operator ==(Object other) => other is Unverified; + + @override + int get hashCode => runtimeType.hashCode; +} + +class UnverifiedReputable extends Reputation { + const UnverifiedReputable(); + + @override + Map toJson() => {'UnverifiedReputable': null}; + + @override + bool operator ==(Object other) => other is UnverifiedReputable; + + @override + int get hashCode => runtimeType.hashCode; +} + +class VerifiedUnlinked extends Reputation { + const VerifiedUnlinked(); + + @override + Map toJson() => {'VerifiedUnlinked': null}; + + @override + bool operator ==(Object other) => other is VerifiedUnlinked; + + @override + int get hashCode => runtimeType.hashCode; +} + +class VerifiedLinked extends Reputation { + const VerifiedLinked(this.value0); + + /// CeremonyIndexType + final int value0; + + @override + Map toJson() => {'VerifiedLinked': value0}; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is VerifiedLinked && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +extension ReputationExtension on Reputation { + String toValue() { + return toEnumValue(this); + } + + bool isVerified() { + return runtimeType == VerifiedUnlinked || runtimeType == VerifiedLinked; + } +} + +/// Takes a `List` which contains a `List]>` and +/// transforms it into a `Map`. +Map reputationsFromList(List reputationsList) { + final reputations = reputationsList.cast>(); + + return { + for (final cr in reputations) cr[0] as int: CommunityReputation.fromJson(cr[1] as Map), + }; +} diff --git a/app/lib/models/ceremonies/reputation/v2.g.dart b/app/lib/models/ceremonies/reputation/v2.g.dart new file mode 100644 index 000000000..33a6d12ef --- /dev/null +++ b/app/lib/models/ceremonies/reputation/v2.g.dart @@ -0,0 +1,17 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'v2.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CommunityReputation _$CommunityReputationFromJson(Map json) => CommunityReputation( + CommunityIdentifier.fromJson(json['communityIdentifier'] as Map), + Reputation.fromJson(json['reputation']), + ); + +Map _$CommunityReputationToJson(CommunityReputation instance) => { + 'communityIdentifier': instance.communityIdentifier.toJson(), + 'reputation': instance.reputation.toJson(), + }; diff --git a/app/lib/page/assets/announcement/widgets/announcement_card.dart b/app/lib/page/assets/announcement/widgets/announcement_card.dart index d127ed2de..e3a8792cf 100644 --- a/app/lib/page/assets/announcement/widgets/announcement_card.dart +++ b/app/lib/page/assets/announcement/widgets/announcement_card.dart @@ -1,8 +1,10 @@ +import 'package:encointer_wallet/service/launch/app_launch.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import 'package:share_plus/share_plus.dart'; +import 'package:flutter_linkify/flutter_linkify.dart'; import 'package:encointer_wallet/page/assets/announcement/widgets/publisher_and_community_icon.dart'; import 'package:encointer_wallet/page/assets/announcement/logic/announcement_card_store.dart'; @@ -58,8 +60,9 @@ class AnnouncementCard extends StatelessWidget { ), Padding( padding: const EdgeInsets.only(bottom: 20, right: 20, left: 20), - child: Text( - announcement.content, + child: Linkify( + onOpen: (link) => AppLaunch.launchURL(link.url), + text: announcement.content, style: context.bodyMedium.copyWith(height: 1.5), ), ), diff --git a/app/lib/service/substrate_api/encointer/encointer_api.dart b/app/lib/service/substrate_api/encointer/encointer_api.dart index 912c3e11e..56b40180d 100644 --- a/app/lib/service/substrate_api/encointer/encointer_api.dart +++ b/app/lib/service/substrate_api/encointer/encointer_api.dart @@ -26,7 +26,7 @@ import 'package:ew_http/ew_http.dart'; import 'package:ew_keyring/ew_keyring.dart'; import 'package:ew_polkadart/encointer_types.dart' show ProofOfAttendance; import 'package:ew_polkadart/ew_polkadart.dart' - show BlockHash, Tuple2, StorageChangeSet, SequenceCodec, EncointerKusama, ByteInput; + show BlockHash, ByteInput, EncointerKusama, RuntimeVersion, SequenceCodec, StorageChangeSet, Tuple2; import 'package:ew_polkadart/generated/encointer_kusama/types/sp_core/crypto/account_id32.dart'; import 'package:ew_primitives/ew_primitives.dart'; import 'package:ew_substrate_fixed/substrate_fixed.dart'; @@ -582,10 +582,33 @@ class EncointerApi { if (address.isEmpty) return; - final reputations = await _dartApi.getReputations(address, at: at ?? store.chain.latestHash); + final runtimeVersion = await encointerKusama.rpc.state.getRuntimeVersion(at: at ?? store.chain.latestHash); - Log.d('api: getReputations: $reputations', 'EncointerApi'); - if (reputations.isNotEmpty) await store.encointer.account?.setReputations(reputations); + if (hasNewReputationType(runtimeVersion)) { + final reputations = await _dartApi.getReputations(address, at: at ?? store.chain.latestHash); + Log.d('api: getReputationsV2: $reputations', 'EncointerApi'); + if (reputations.isNotEmpty) await store.encointer.account?.setReputations(reputations); + } else { + final reputationsV1 = await _dartApi.getReputationsV1(address, at: at ?? store.chain.latestHash); + Log.d('api: getReputations: $reputationsV1', 'EncointerApi'); + final cIndex = store.encointer.currentCeremonyIndex ?? 0; + final reputations = Map.fromEntries(reputationsV1.entries.map((e) => MapEntry(e.key, e.value.toV2(cIndex)))); + Log.d('api: getReputations (migrated to V2): $reputations', 'EncointerApi'); + + if (reputations.isNotEmpty) await store.encointer.account?.setReputations(reputations); + } + } + + bool hasNewReputationType(RuntimeVersion version) { + Log.p('Runtime version ${version.toJson()}'); + if (version.specName == 'encointer-parachain') { + return version.specVersion >= 1002000; + } else if (version.specName == 'encointer-node-notee') { + return version.specVersion >= 31; + } else { + Log.p('unknown spec name found: ${version.specName}. Assuming that the runtime has new reputation type'); + return true; + } } /// Gets a proof of attendance for the oldest attended ceremony, if available. @@ -595,7 +618,11 @@ class EncointerApi { /// Note: this returns the polkadart generated type. ProofOfAttendance? getProofOfAttendance() { final pubKey = store.account.currentAccountPubKey; - final cIndex = store.encointer.account?.ceremonyIndexForNextProofOfAttendance; + final currentCeremonyIndex = store.encointer.currentCeremonyIndex; + + if (currentCeremonyIndex == null) return null; + + final cIndex = store.encointer.account?.ceremonyIndexForNextProofOfAttendance(currentCeremonyIndex); if (cIndex == null || cIndex == 0) { return null; diff --git a/app/lib/service/substrate_api/encointer/encointer_dart_api.dart b/app/lib/service/substrate_api/encointer/encointer_dart_api.dart index 31fb0c029..659dab003 100644 --- a/app/lib/service/substrate_api/encointer/encointer_dart_api.dart +++ b/app/lib/service/substrate_api/encointer/encointer_dart_api.dart @@ -47,6 +47,18 @@ class EncointerDartApi { return locations.map((l) => Location.fromJson(l as Map)).toList(); } + /// Queries the rpc 'encointer_getReputations'. + /// + /// Address must be SS58 encoded. + Future> getReputationsV1(String address, {BlockHash? at}) async { + final params = [address]; + + if (at != null) params.add('0x${hex.encode(at)}'); + + final reputations = await _dartApi.rpc>('encointer_getReputations', params); + return reputationsV1FromList(reputations); + } + /// Queries the rpc 'encointer_getReputations'. /// /// Address must be SS58 encoded. diff --git a/app/lib/service/tx/lib/src/send_tx_dart.dart b/app/lib/service/tx/lib/src/send_tx_dart.dart index 6725bf57f..550c89b1a 100644 --- a/app/lib/service/tx/lib/src/send_tx_dart.dart +++ b/app/lib/service/tx/lib/src/send_tx_dart.dart @@ -127,7 +127,7 @@ class EWAuthorApi

{ String? blockHashHex; final sub = await submitAndWatchExtrinsic(extrinsic, (xtUpdate) async { - Log.d('ExtrinsicUpdate: ${xtUpdate.type}'); + Log.d('ExtrinsicUpdate: type: ${xtUpdate.type}, value: ${xtUpdate.value}'); if (xtUpdate.type == 'ready') { Log.p('Xt is ready'); diff --git a/app/lib/service/tx/lib/src/submit_tx_wrappers.dart b/app/lib/service/tx/lib/src/submit_tx_wrappers.dart index a634dc71c..8d428b932 100644 --- a/app/lib/service/tx/lib/src/submit_tx_wrappers.dart +++ b/app/lib/service/tx/lib/src/submit_tx_wrappers.dart @@ -78,7 +78,8 @@ Future submitClaimRewards( onFinish: (BuildContext txPageContext, ExtrinsicReport report) { // Claiming the rewards creates a new reputation if successful. // Hence, we should update the state afterwards. - store.dataUpdate.setInvalidated(); + store.encointer.getEncointerBalance(); + webApi.encointer.getReputations(); return report; }, ); @@ -316,7 +317,11 @@ Future submitEncointerTransfer( api, OpaqueExtrinsic(xt), TxNotification.encointerBalanceTransfer(context.l10n), - onFinish: onFinish, + onFinish: (BuildContext txPageContext, ExtrinsicReport report) { + if (onFinish != null) onFinish(txPageContext, report); + store.encointer.getEncointerBalance(); + return report; + }, onError: onError, ); } diff --git a/app/lib/service/tx/lib/src/tx_builder.dart b/app/lib/service/tx/lib/src/tx_builder.dart index 31ecb5a96..cf7579461 100644 --- a/app/lib/service/tx/lib/src/tx_builder.dart +++ b/app/lib/service/tx/lib/src/tx_builder.dart @@ -31,8 +31,8 @@ class TxBuilder { // fetch recent relevant data from chain final runtimeVersion = await _getRuntimeVersion(); - final blockNumber = await _getBlockNumber(); - final blockHash = await _getBlockHash(); + final finalizedHash = await _getLatestFinalizedHash(); + final blockNumber = await _getBlockNumber(hash: finalizedHash); final genesisHash = await _getBlockHash(blockNumber: 0); final accountInfo = await encointerKusama.query.system.account(pair.publicKey.bytes); @@ -49,7 +49,7 @@ class TxBuilder { specVersion: runtimeVersion.specVersion, transactionVersion: runtimeVersion.transactionVersion, genesisHash: genesisHash, - blockHash: blockHash, + blockHash: finalizedHash, blockNumber: blockNumber, eraPeriod: 64, nonce: accountInfo.nonce, @@ -85,8 +85,15 @@ class TxBuilder { return hash.replaceFirst('0x', ''); } - Future _getBlockNumber() async { - final block = await provider.send('chain_getBlock', []); + Future _getLatestFinalizedHash() async { + final hash = (await provider.send('chain_getFinalizedHead', [])).result as String; + return hash.replaceFirst('0x', ''); + } + + Future _getBlockNumber({String? hash}) async { + final params = hash != null ? [hash.replaceFirst('0x', '')] : []; + + final block = await provider.send('chain_getBlock', params); // ignore: avoid_dynamic_calls final blockNumber = int.parse(block.result['block']['header']['number'] as String); diff --git a/app/lib/store/encointer/sub_stores/encointer_account_store/encointer_account_store.dart b/app/lib/store/encointer/sub_stores/encointer_account_store/encointer_account_store.dart index f811bec24..1d1d1dcc0 100644 --- a/app/lib/store/encointer/sub_stores/encointer_account_store/encointer_account_store.dart +++ b/app/lib/store/encointer/sub_stores/encointer_account_store/encointer_account_store.dart @@ -56,8 +56,12 @@ abstract class _EncointerAccountStore with Store { /// contain all potential reputation values: UnverifiedReputable, VerifiedUnlinked and VerifiedLinked. /// /// Map: ceremony index -> CommunityReputation + /// + /// Note: must be nullable for json-deserialization of old stores. @observable - Map reputations = {}; + Map? _reputationsV2; + + Map get reputations => _reputationsV2 ?? {}; /// Returns all reputations associated with a meetup. @computed @@ -76,13 +80,27 @@ abstract class _EncointerAccountStore with Store { @observable int numberOfNewbieTicketsForReputable = 0; - @computed - int? get ceremonyIndexForNextProofOfAttendance { + int? ceremonyIndexForNextProofOfAttendance(int currentCeremonyIndex) { if (verifiedReputations.isNotEmpty) { try { - return verifiedReputations.entries.firstWhere((e) => e.value.reputation == Reputation.VerifiedUnlinked).key; + // returns the first reputation that hasn't been linked, or has been linked to a non-current cIndex. + return verifiedReputations.entries.firstWhere((e) { + if (e.value.reputation.runtimeType == VerifiedUnlinked) { + Log.d('Found unlinked reputation with cIndex ${e.key}'); + return true; + } + + if (e.value.reputation.runtimeType == VerifiedLinked && + (e.value.reputation as VerifiedLinked).value0 != currentCeremonyIndex) { + Log.d('Found linked reputation that has been linked to previous cycle with cIndex ${e.key}'); + return true; + } + + return false; + }).key; } catch (e, s) { - Log.e('$address has reputation, but none that has not been linked yet', 'EncointerAccountStore', s); + Log.e('$address has reputation, but none that has not been linked with the current cIndex', + 'EncointerAccountStore', s); return 0; } } else { @@ -125,7 +143,7 @@ abstract class _EncointerAccountStore with Store { @action Future setReputations(Map reps) async { - reputations = reps; + _reputationsV2 = reps; unawaited(writeToCache()); await getNumberOfNewbieTicketsForReputable(); } diff --git a/app/lib/store/encointer/sub_stores/encointer_account_store/encointer_account_store.g.dart b/app/lib/store/encointer/sub_stores/encointer_account_store/encointer_account_store.g.dart index c9362d88b..685400b02 100644 --- a/app/lib/store/encointer/sub_stores/encointer_account_store/encointer_account_store.g.dart +++ b/app/lib/store/encointer/sub_stores/encointer_account_store/encointer_account_store.g.dart @@ -13,9 +13,6 @@ EncointerAccountStore _$EncointerAccountStoreFromJson(Map json) ..balanceEntries = ObservableMap.of((json['balanceEntries'] as Map).map( (k, e) => MapEntry(k, BalanceEntry.fromJson(e as Map)), )) - ..reputations = (json['reputations'] as Map).map( - (k, e) => MapEntry(int.parse(k), CommunityReputation.fromJson(e as Map)), - ) ..txsTransfer = ObservableList.of( (json['txsTransfer'] as List).map((e) => TransferData.fromJson(e as Map))) ..numberOfNewbieTicketsForReputable = json['numberOfNewbieTicketsForReputable'] as int @@ -27,7 +24,6 @@ Map _$EncointerAccountStoreToJson(EncointerAccountStore instanc 'network': instance.network, 'address': instance.address, 'balanceEntries': instance.balanceEntries.map((k, e) => MapEntry(k, e.toJson())), - 'reputations': instance.reputations.map((k, e) => MapEntry(k.toString(), e.toJson())), 'txsTransfer': instance.txsTransfer.map((e) => e.toJson()).toList(), 'numberOfNewbieTicketsForReputable': instance.numberOfNewbieTicketsForReputable, 'lastProofOfAttendance': instance.lastProofOfAttendance?.toJson(), @@ -53,13 +49,6 @@ mixin _$EncointerAccountStore on _EncointerAccountStore, Store { int get verifiedReputationCount => (_$verifiedReputationCountComputed ??= Computed(() => super.verifiedReputationCount, name: '_EncointerAccountStore.verifiedReputationCount')) .value; - Computed? _$ceremonyIndexForNextProofOfAttendanceComputed; - - @override - int? get ceremonyIndexForNextProofOfAttendance => (_$ceremonyIndexForNextProofOfAttendanceComputed ??= Computed( - () => super.ceremonyIndexForNextProofOfAttendance, - name: '_EncointerAccountStore.ceremonyIndexForNextProofOfAttendance')) - .value; late final _$balanceEntriesAtom = Atom(name: '_EncointerAccountStore.balanceEntries', context: context); @@ -76,18 +65,18 @@ mixin _$EncointerAccountStore on _EncointerAccountStore, Store { }); } - late final _$reputationsAtom = Atom(name: '_EncointerAccountStore.reputations', context: context); + late final _$_reputationsV2Atom = Atom(name: '_EncointerAccountStore._reputationsV2', context: context); @override - Map get reputations { - _$reputationsAtom.reportRead(); - return super.reputations; + Map? get _reputationsV2 { + _$_reputationsV2Atom.reportRead(); + return super._reputationsV2; } @override - set reputations(Map value) { - _$reputationsAtom.reportWrite(value, super.reputations, () { - super.reputations = value; + set _reputationsV2(Map? value) { + _$_reputationsV2Atom.reportWrite(value, super._reputationsV2, () { + super._reputationsV2 = value; }); } @@ -213,13 +202,11 @@ mixin _$EncointerAccountStore on _EncointerAccountStore, Store { String toString() { return ''' balanceEntries: ${balanceEntries}, -reputations: ${reputations}, txsTransfer: ${txsTransfer}, numberOfNewbieTicketsForReputable: ${numberOfNewbieTicketsForReputable}, lastProofOfAttendance: ${lastProofOfAttendance}, verifiedReputations: ${verifiedReputations}, -verifiedReputationCount: ${verifiedReputationCount}, -ceremonyIndexForNextProofOfAttendance: ${ceremonyIndexForNextProofOfAttendance} +verifiedReputationCount: ${verifiedReputationCount} '''; } } diff --git a/app/pubspec.lock b/app/pubspec.lock index 295359bb0..083bad93f 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -523,6 +523,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.4.0" + flutter_linkify: + dependency: "direct main" + description: + name: flutter_linkify + sha256: "74669e06a8f358fee4512b4320c0b80e51cffc496607931de68d28f099254073" + url: "https://pub.dev" + source: hosted + version: "6.0.0" flutter_local_notifications: dependency: "direct main" description: @@ -848,6 +856,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.0" + linkify: + dependency: transitive + description: + name: linkify + sha256: "4139ea77f4651ab9c315b577da2dd108d9aa0bd84b5d03d33323f1970c645832" + url: "https://pub.dev" + source: hosted + version: "5.0.0" lists: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 8501d4449..ad78306e1 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -14,7 +14,7 @@ description: EncointerWallet made with Flutter. # bump version already while working on new release, bumping build number at the same time # bump build number even more, if needed to clarify what's deployed -version: 1.13.2+882 +version: 1.13.4+884 publish_to: none @@ -63,6 +63,7 @@ dependencies: provider: ^6.1.1 flutter_map_marker_popup: ^6.1.2 flutter_map: ^6.1.0 + flutter_linkify: ^6.0.0 # Automatically transform http(s) links to inline links. dart_geohash: ^2.0.2 # Todo: #1270: replace with alternative package iconsax: ^0.0.8 # Todo: #1271: replace with alternative package add_2_calendar: ^3.0.1 diff --git a/app/test/mock/data/mock_encointer_data.dart b/app/test/mock/data/mock_encointer_data.dart index 3fc61da09..a374fd031 100644 --- a/app/test/mock/data/mock_encointer_data.dart +++ b/app/test/mock/data/mock_encointer_data.dart @@ -25,8 +25,8 @@ List testCommunities = [ CidName(cid3, buendnerBock), ]; -Map testReputations = { - 1: CommunityReputation(cid, Reputation.VerifiedUnlinked), +Map testReputations = { + 1: CommunityReputationV1(cid, ReputationV1.VerifiedUnlinked), }; const Map communityMetadata = { diff --git a/app/test/service/tx/lib/send_tx_dart_test.dart b/app/test/service/tx/lib/send_tx_dart_test.dart index 6f34bd92e..7ea54de79 100644 --- a/app/test/service/tx/lib/send_tx_dart_test.dart +++ b/app/test/service/tx/lib/send_tx_dart_test.dart @@ -29,7 +29,8 @@ void main() { // Checked that the encoded call matches the one from polkadot-js. const oneERT = 1000000000000; - final transfer = encointerKusama.tx.balances.transfer(dest: bob.multiAddress(), value: BigInt.from(oneERT)); + final transfer = + encointerKusama.tx.balances.transferAllowDeath(dest: bob.multiAddress(), value: BigInt.from(oneERT)); final txBuilder = TxBuilder(provider); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/encointer_kusama.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/encointer_kusama.dart index 07d8c1556..c25970b14 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/encointer_kusama.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/encointer_kusama.dart @@ -1,32 +1,33 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i27; +import 'dart:async' as _i28; import 'package:polkadart/polkadart.dart' as _i1; import 'pallets/aura.dart' as _i9; import 'pallets/aura_ext.dart' as _i10; import 'pallets/balances.dart' as _i7; -import 'pallets/collective.dart' as _i17; +import 'pallets/collective.dart' as _i18; import 'pallets/dmp_queue.dart' as _i13; -import 'pallets/encointer_balances.dart' as _i22; -import 'pallets/encointer_bazaar.dart' as _i23; -import 'pallets/encointer_ceremonies.dart' as _i20; -import 'pallets/encointer_communities.dart' as _i21; -import 'pallets/encointer_faucet.dart' as _i25; -import 'pallets/encointer_reputation_commitments.dart' as _i24; -import 'pallets/encointer_scheduler.dart' as _i19; -import 'pallets/membership.dart' as _i18; +import 'pallets/encointer_balances.dart' as _i23; +import 'pallets/encointer_bazaar.dart' as _i24; +import 'pallets/encointer_ceremonies.dart' as _i21; +import 'pallets/encointer_communities.dart' as _i22; +import 'pallets/encointer_faucet.dart' as _i26; +import 'pallets/encointer_reputation_commitments.dart' as _i25; +import 'pallets/encointer_scheduler.dart' as _i20; +import 'pallets/membership.dart' as _i19; +import 'pallets/message_queue.dart' as _i14; import 'pallets/parachain_info.dart' as _i6; import 'pallets/parachain_system.dart' as _i3; import 'pallets/polkadot_xcm.dart' as _i12; -import 'pallets/proxy.dart' as _i15; +import 'pallets/proxy.dart' as _i16; import 'pallets/randomness_collective_flip.dart' as _i4; -import 'pallets/scheduler.dart' as _i16; +import 'pallets/scheduler.dart' as _i17; import 'pallets/system.dart' as _i2; import 'pallets/timestamp.dart' as _i5; import 'pallets/transaction_payment.dart' as _i8; -import 'pallets/treasury.dart' as _i14; -import 'pallets/utility.dart' as _i26; +import 'pallets/treasury.dart' as _i15; +import 'pallets/utility.dart' as _i27; import 'pallets/xcmp_queue.dart' as _i11; class Queries { @@ -43,18 +44,19 @@ class Queries { xcmpQueue = _i11.Queries(api), polkadotXcm = _i12.Queries(api), dmpQueue = _i13.Queries(api), - treasury = _i14.Queries(api), - proxy = _i15.Queries(api), - scheduler = _i16.Queries(api), - collective = _i17.Queries(api), - membership = _i18.Queries(api), - encointerScheduler = _i19.Queries(api), - encointerCeremonies = _i20.Queries(api), - encointerCommunities = _i21.Queries(api), - encointerBalances = _i22.Queries(api), - encointerBazaar = _i23.Queries(api), - encointerReputationCommitments = _i24.Queries(api), - encointerFaucet = _i25.Queries(api); + messageQueue = _i14.Queries(api), + treasury = _i15.Queries(api), + proxy = _i16.Queries(api), + scheduler = _i17.Queries(api), + collective = _i18.Queries(api), + membership = _i19.Queries(api), + encointerScheduler = _i20.Queries(api), + encointerCeremonies = _i21.Queries(api), + encointerCommunities = _i22.Queries(api), + encointerBalances = _i23.Queries(api), + encointerBazaar = _i24.Queries(api), + encointerReputationCommitments = _i25.Queries(api), + encointerFaucet = _i26.Queries(api); final _i2.Queries system; @@ -80,29 +82,31 @@ class Queries { final _i13.Queries dmpQueue; - final _i14.Queries treasury; + final _i14.Queries messageQueue; - final _i15.Queries proxy; + final _i15.Queries treasury; - final _i16.Queries scheduler; + final _i16.Queries proxy; - final _i17.Queries collective; + final _i17.Queries scheduler; - final _i18.Queries membership; + final _i18.Queries collective; - final _i19.Queries encointerScheduler; + final _i19.Queries membership; - final _i20.Queries encointerCeremonies; + final _i20.Queries encointerScheduler; - final _i21.Queries encointerCommunities; + final _i21.Queries encointerCeremonies; - final _i22.Queries encointerBalances; + final _i22.Queries encointerCommunities; - final _i23.Queries encointerBazaar; + final _i23.Queries encointerBalances; - final _i24.Queries encointerReputationCommitments; + final _i24.Queries encointerBazaar; - final _i25.Queries encointerFaucet; + final _i25.Queries encointerReputationCommitments; + + final _i26.Queries encointerFaucet; } class Extrinsics { @@ -120,33 +124,33 @@ class Extrinsics { final _i12.Txs polkadotXcm = _i12.Txs(); - final _i13.Txs dmpQueue = _i13.Txs(); + final _i14.Txs messageQueue = _i14.Txs(); - final _i26.Txs utility = _i26.Txs(); + final _i27.Txs utility = _i27.Txs(); - final _i14.Txs treasury = _i14.Txs(); + final _i15.Txs treasury = _i15.Txs(); - final _i15.Txs proxy = _i15.Txs(); + final _i16.Txs proxy = _i16.Txs(); - final _i16.Txs scheduler = _i16.Txs(); + final _i17.Txs scheduler = _i17.Txs(); - final _i17.Txs collective = _i17.Txs(); + final _i18.Txs collective = _i18.Txs(); - final _i18.Txs membership = _i18.Txs(); + final _i19.Txs membership = _i19.Txs(); - final _i19.Txs encointerScheduler = _i19.Txs(); + final _i20.Txs encointerScheduler = _i20.Txs(); - final _i20.Txs encointerCeremonies = _i20.Txs(); + final _i21.Txs encointerCeremonies = _i21.Txs(); - final _i21.Txs encointerCommunities = _i21.Txs(); + final _i22.Txs encointerCommunities = _i22.Txs(); - final _i22.Txs encointerBalances = _i22.Txs(); + final _i23.Txs encointerBalances = _i23.Txs(); - final _i23.Txs encointerBazaar = _i23.Txs(); + final _i24.Txs encointerBazaar = _i24.Txs(); - final _i24.Txs encointerReputationCommitments = _i24.Txs(); + final _i25.Txs encointerReputationCommitments = _i25.Txs(); - final _i25.Txs encointerFaucet = _i25.Txs(); + final _i26.Txs encointerFaucet = _i26.Txs(); } class Constants { @@ -160,25 +164,29 @@ class Constants { final _i8.Constants transactionPayment = _i8.Constants(); - final _i26.Constants utility = _i26.Constants(); + final _i11.Constants xcmpQueue = _i11.Constants(); + + final _i14.Constants messageQueue = _i14.Constants(); + + final _i27.Constants utility = _i27.Constants(); - final _i14.Constants treasury = _i14.Constants(); + final _i15.Constants treasury = _i15.Constants(); - final _i15.Constants proxy = _i15.Constants(); + final _i16.Constants proxy = _i16.Constants(); - final _i16.Constants scheduler = _i16.Constants(); + final _i17.Constants scheduler = _i17.Constants(); - final _i17.Constants collective = _i17.Constants(); + final _i18.Constants collective = _i18.Constants(); - final _i19.Constants encointerScheduler = _i19.Constants(); + final _i20.Constants encointerScheduler = _i20.Constants(); - final _i20.Constants encointerCeremonies = _i20.Constants(); + final _i21.Constants encointerCeremonies = _i21.Constants(); - final _i21.Constants encointerCommunities = _i21.Constants(); + final _i22.Constants encointerCommunities = _i22.Constants(); - final _i22.Constants encointerBalances = _i22.Constants(); + final _i23.Constants encointerBalances = _i23.Constants(); - final _i25.Constants encointerFaucet = _i25.Constants(); + final _i26.Constants encointerFaucet = _i26.Constants(); } class Rpc { @@ -243,11 +251,11 @@ class EncointerKusama { final Registry registry; - _i27.Future connect() async { + _i28.Future connect() async { return await _provider.connect(); } - _i27.Future disconnect() async { + _i28.Future disconnect() async { return await _provider.disconnect(); } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/aura_ext.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/aura_ext.dart index 685571ef7..5a85316a1 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/aura_ext.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/aura_ext.dart @@ -1,11 +1,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i4; -import 'dart:typed_data' as _i5; +import 'dart:async' as _i6; +import 'dart:typed_data' as _i7; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; import '../types/sp_consensus_aura/sr25519/app_sr25519/public.dart' as _i2; +import '../types/sp_consensus_slots/slot.dart' as _i5; +import '../types/tuples.dart' as _i4; class Queries { const Queries(this.__api); @@ -18,12 +20,21 @@ class Queries { valueCodec: _i3.SequenceCodec<_i2.Public>(_i2.PublicCodec()), ); + final _i1.StorageValue<_i4.Tuple2<_i5.Slot, int>> _slotInfo = const _i1.StorageValue<_i4.Tuple2<_i5.Slot, int>>( + prefix: 'AuraExt', + storage: 'SlotInfo', + valueCodec: _i4.Tuple2Codec<_i5.Slot, int>( + _i5.SlotCodec(), + _i3.U32Codec.codec, + ), + ); + /// Serves as cache for the authorities. /// /// The authorities in AuRa are overwritten in `on_initialize` when we switch to a new session, - /// but we require the old authorities to verify the seal when validating a PoV. This will always - /// be updated to the latest AuRa authorities in `on_finalize`. - _i4.Future> authorities({_i1.BlockHash? at}) async { + /// but we require the old authorities to verify the seal when validating a PoV. This will + /// always be updated to the latest AuRa authorities in `on_finalize`. + _i6.Future> authorities({_i1.BlockHash? at}) async { final hashedKey = _authorities.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -35,9 +46,30 @@ class Queries { return []; /* Default */ } + /// Current slot paired with a number of authored blocks. + /// + /// Updated on each block initialization. + _i6.Future<_i4.Tuple2<_i5.Slot, int>?> slotInfo({_i1.BlockHash? at}) async { + final hashedKey = _slotInfo.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _slotInfo.decodeValue(bytes); + } + return null; /* Nullable */ + } + /// Returns the storage key for `authorities`. - _i5.Uint8List authoritiesKey() { + _i7.Uint8List authoritiesKey() { final hashedKey = _authorities.hashedKey(); return hashedKey; } + + /// Returns the storage key for `slotInfo`. + _i7.Uint8List slotInfoKey() { + final hashedKey = _slotInfo.hashedKey(); + return hashedKey; + } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/balances.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/balances.dart index 521ff6d3d..63d43e5e3 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/balances.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/balances.dart @@ -5,9 +5,10 @@ import 'dart:typed_data' as _i9; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; -import '../types/encointer_runtime/runtime_call.dart' as _i10; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i10; import '../types/pallet_balances/pallet/call.dart' as _i12; import '../types/pallet_balances/types/account_data.dart' as _i4; +import '../types/pallet_balances/types/adjustment_direction.dart' as _i13; import '../types/pallet_balances/types/balance_lock.dart' as _i5; import '../types/pallet_balances/types/id_amount.dart' as _i7; import '../types/pallet_balances/types/reserve_data.dart' as _i6; @@ -297,20 +298,6 @@ class Txs { return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::set_balance_deprecated`]. - _i10.RuntimeCall setBalanceDeprecated({ - required _i11.MultiAddress who, - required BigInt newFree, - required BigInt oldReserved, - }) { - final _call = _i12.Call.values.setBalanceDeprecated( - who: who, - newFree: newFree, - oldReserved: oldReserved, - ); - return _i10.RuntimeCall.values.balances(_call); - } - /// See [`Pallet::force_transfer`]. _i10.RuntimeCall forceTransfer({ required _i11.MultiAddress source, @@ -367,18 +354,6 @@ class Txs { return _i10.RuntimeCall.values.balances(_call); } - /// See [`Pallet::transfer`]. - _i10.RuntimeCall transfer({ - required _i11.MultiAddress dest, - required BigInt value, - }) { - final _call = _i12.Call.values.transfer( - dest: dest, - value: value, - ); - return _i10.RuntimeCall.values.balances(_call); - } - /// See [`Pallet::force_set_balance`]. _i10.RuntimeCall forceSetBalance({ required _i11.MultiAddress who, @@ -390,6 +365,18 @@ class Txs { ); return _i10.RuntimeCall.values.balances(_call); } + + /// See [`Pallet::force_adjust_total_issuance`]. + _i10.RuntimeCall forceAdjustTotalIssuance({ + required _i13.AdjustmentDirection direction, + required BigInt delta, + }) { + final _call = _i12.Call.values.forceAdjustTotalIssuance( + direction: direction, + delta: delta, + ); + return _i10.RuntimeCall.values.balances(_call); + } } class Constants { @@ -412,9 +399,6 @@ class Constants { /// The maximum number of named reserves that can exist on an account. final int maxReserves = 50; - /// The maximum number of holds that can exist on an account at any time. - final int maxHolds = 0; - /// The maximum number of individual freeze locks that can exist on an account at any time. final int maxFreezes = 0; } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/collective.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/collective.dart index c980de8b2..0db5037bc 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/collective.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/collective.dart @@ -5,7 +5,7 @@ import 'dart:typed_data' as _i8; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/encointer_runtime/runtime_call.dart' as _i4; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i4; import '../types/pallet_collective/pallet/call.dart' as _i9; import '../types/pallet_collective/votes.dart' as _i5; import '../types/primitive_types/h256.dart' as _i2; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/cumulus_xcm.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/cumulus_xcm.dart new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/cumulus_xcm.dart @@ -0,0 +1 @@ + diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/dmp_queue.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/dmp_queue.dart index 086e801fd..4e9bb24b5 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/dmp_queue.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/dmp_queue.dart @@ -1,196 +1,38 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; -import 'dart:typed_data' as _i8; +import 'dart:async' as _i3; +import 'dart:typed_data' as _i4; import 'package:polkadart/polkadart.dart' as _i1; -import 'package:polkadart/scale_codec.dart' as _i5; -import '../types/cumulus_pallet_dmp_queue/config_data.dart' as _i2; -import '../types/cumulus_pallet_dmp_queue/page_index_data.dart' as _i3; -import '../types/cumulus_pallet_dmp_queue/pallet/call.dart' as _i10; -import '../types/encointer_runtime/runtime_call.dart' as _i9; -import '../types/sp_weights/weight_v2/weight.dart' as _i7; -import '../types/tuples.dart' as _i4; +import '../types/cumulus_pallet_dmp_queue/pallet/migration_state.dart' as _i2; class Queries { const Queries(this.__api); final _i1.StateApi __api; - final _i1.StorageValue<_i2.ConfigData> _configuration = const _i1.StorageValue<_i2.ConfigData>( + final _i1.StorageValue<_i2.MigrationState> _migrationStatus = const _i1.StorageValue<_i2.MigrationState>( prefix: 'DmpQueue', - storage: 'Configuration', - valueCodec: _i2.ConfigData.codec, + storage: 'MigrationStatus', + valueCodec: _i2.MigrationState.codec, ); - final _i1.StorageValue<_i3.PageIndexData> _pageIndex = const _i1.StorageValue<_i3.PageIndexData>( - prefix: 'DmpQueue', - storage: 'PageIndex', - valueCodec: _i3.PageIndexData.codec, - ); - - final _i1.StorageMap>>> _pages = - const _i1.StorageMap>>>( - prefix: 'DmpQueue', - storage: 'Pages', - valueCodec: _i5.SequenceCodec<_i4.Tuple2>>(_i4.Tuple2Codec>( - _i5.U32Codec.codec, - _i5.U8SequenceCodec.codec, - )), - hasher: _i1.StorageHasher.blake2b128Concat(_i5.U32Codec.codec), - ); - - final _i1.StorageMap>> _overweight = - const _i1.StorageMap>>( - prefix: 'DmpQueue', - storage: 'Overweight', - valueCodec: _i4.Tuple2Codec>( - _i5.U32Codec.codec, - _i5.U8SequenceCodec.codec, - ), - hasher: _i1.StorageHasher.blake2b128Concat(_i5.U64Codec.codec), - ); - - final _i1.StorageValue _counterForOverweight = const _i1.StorageValue( - prefix: 'DmpQueue', - storage: 'CounterForOverweight', - valueCodec: _i5.U32Codec.codec, - ); - - /// The configuration. - _i6.Future<_i2.ConfigData> configuration({_i1.BlockHash? at}) async { - final hashedKey = _configuration.hashedKey(); - final bytes = await __api.getStorage( - hashedKey, - at: at, - ); - if (bytes != null) { - return _configuration.decodeValue(bytes); - } - return _i2.ConfigData( - maxIndividual: _i7.Weight( - refTime: BigInt.from(10000000000), - proofSize: BigInt.from(65536), - )); /* Default */ - } - - /// The page index. - _i6.Future<_i3.PageIndexData> pageIndex({_i1.BlockHash? at}) async { - final hashedKey = _pageIndex.hashedKey(); + /// The migration state of this pallet. + _i3.Future<_i2.MigrationState> migrationStatus({_i1.BlockHash? at}) async { + final hashedKey = _migrationStatus.hashedKey(); final bytes = await __api.getStorage( hashedKey, at: at, ); if (bytes != null) { - return _pageIndex.decodeValue(bytes); + return _migrationStatus.decodeValue(bytes); } - return _i3.PageIndexData( - beginUsed: 0, - endUsed: 0, - overweightCount: BigInt.zero, - ); /* Default */ + return _i2.NotStarted(); /* Default */ } - /// The queue pages. - _i6.Future>>> pages( - int key1, { - _i1.BlockHash? at, - }) async { - final hashedKey = _pages.hashedKeyFor(key1); - final bytes = await __api.getStorage( - hashedKey, - at: at, - ); - if (bytes != null) { - return _pages.decodeValue(bytes); - } - return []; /* Default */ - } - - /// The overweight messages. - _i6.Future<_i4.Tuple2>?> overweight( - BigInt key1, { - _i1.BlockHash? at, - }) async { - final hashedKey = _overweight.hashedKeyFor(key1); - final bytes = await __api.getStorage( - hashedKey, - at: at, - ); - if (bytes != null) { - return _overweight.decodeValue(bytes); - } - return null; /* Nullable */ - } - - /// Counter for the related counted storage map - _i6.Future counterForOverweight({_i1.BlockHash? at}) async { - final hashedKey = _counterForOverweight.hashedKey(); - final bytes = await __api.getStorage( - hashedKey, - at: at, - ); - if (bytes != null) { - return _counterForOverweight.decodeValue(bytes); - } - return 0; /* Default */ - } - - /// Returns the storage key for `configuration`. - _i8.Uint8List configurationKey() { - final hashedKey = _configuration.hashedKey(); - return hashedKey; - } - - /// Returns the storage key for `pageIndex`. - _i8.Uint8List pageIndexKey() { - final hashedKey = _pageIndex.hashedKey(); + /// Returns the storage key for `migrationStatus`. + _i4.Uint8List migrationStatusKey() { + final hashedKey = _migrationStatus.hashedKey(); return hashedKey; } - - /// Returns the storage key for `pages`. - _i8.Uint8List pagesKey(int key1) { - final hashedKey = _pages.hashedKeyFor(key1); - return hashedKey; - } - - /// Returns the storage key for `overweight`. - _i8.Uint8List overweightKey(BigInt key1) { - final hashedKey = _overweight.hashedKeyFor(key1); - return hashedKey; - } - - /// Returns the storage key for `counterForOverweight`. - _i8.Uint8List counterForOverweightKey() { - final hashedKey = _counterForOverweight.hashedKey(); - return hashedKey; - } - - /// Returns the storage map key prefix for `pages`. - _i8.Uint8List pagesMapPrefix() { - final hashedKey = _pages.mapPrefix(); - return hashedKey; - } - - /// Returns the storage map key prefix for `overweight`. - _i8.Uint8List overweightMapPrefix() { - final hashedKey = _overweight.mapPrefix(); - return hashedKey; - } -} - -class Txs { - const Txs(); - - /// See [`Pallet::service_overweight`]. - _i9.RuntimeCall serviceOverweight({ - required BigInt index, - required _i7.Weight weightLimit, - }) { - final _call = _i10.Call.values.serviceOverweight( - index: index, - weightLimit: weightLimit, - ); - return _i9.RuntimeCall.values.dmpQueue(_call); - } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_balances.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_balances.dart index b9f3f16d1..6e11e16be 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_balances.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_balances.dart @@ -5,9 +5,9 @@ import 'dart:typed_data' as _i9; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i6; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i10; import '../types/encointer_primitives/balances/balance_entry.dart' as _i3; import '../types/encointer_primitives/communities/community_identifier.dart' as _i2; -import '../types/encointer_runtime/runtime_call.dart' as _i10; import '../types/pallet_encointer_balances/pallet/call.dart' as _i11; import '../types/sp_core/crypto/account_id32.dart' as _i4; import '../types/substrate_fixed/fixed_i128.dart' as _i5; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_bazaar.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_bazaar.dart index 826b1b101..acb8abfd4 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_bazaar.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_bazaar.dart @@ -5,11 +5,11 @@ import 'dart:typed_data' as _i9; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i7; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i10; import '../types/encointer_primitives/bazaar/business_data.dart' as _i4; import '../types/encointer_primitives/bazaar/business_identifier.dart' as _i5; import '../types/encointer_primitives/bazaar/offering_data.dart' as _i6; import '../types/encointer_primitives/communities/community_identifier.dart' as _i2; -import '../types/encointer_runtime/runtime_call.dart' as _i10; import '../types/pallet_encointer_bazaar/pallet/call.dart' as _i11; import '../types/sp_core/crypto/account_id32.dart' as _i3; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_ceremonies.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_ceremonies.dart index 819321f3f..b8ac13d20 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_ceremonies.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_ceremonies.dart @@ -5,6 +5,7 @@ import 'dart:typed_data' as _i13; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i4; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i14; import '../types/encointer_primitives/ceremonies/assignment.dart' as _i7; import '../types/encointer_primitives/ceremonies/assignment_count.dart' as _i6; import '../types/encointer_primitives/ceremonies/assignment_params.dart' as _i12; @@ -12,7 +13,6 @@ import '../types/encointer_primitives/ceremonies/meetup_result.dart' as _i10; import '../types/encointer_primitives/ceremonies/proof_of_attendance.dart' as _i15; import '../types/encointer_primitives/ceremonies/reputation.dart' as _i8; import '../types/encointer_primitives/communities/community_identifier.dart' as _i2; -import '../types/encointer_runtime/runtime_call.dart' as _i14; import '../types/pallet_encointer_ceremonies/pallet/call.dart' as _i16; import '../types/sp_core/crypto/account_id32.dart' as _i3; import '../types/substrate_fixed/fixed_u128.dart' as _i9; @@ -711,7 +711,7 @@ class Queries { if (bytes != null) { return _participantReputation.decodeValue(bytes); } - return _i8.Reputation.unverified; /* Default */ + return _i8.Unverified(); /* Default */ } _i11.Future reputationCount( diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_communities.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_communities.dart index ca1f8684a..085880c16 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_communities.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_communities.dart @@ -5,16 +5,16 @@ import 'dart:typed_data' as _i11; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i4; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i12; import '../types/encointer_primitives/communities/community_identifier.dart' as _i3; import '../types/encointer_primitives/communities/community_metadata.dart' as _i7; import '../types/encointer_primitives/communities/community_rules.dart' as _i10; import '../types/encointer_primitives/communities/location.dart' as _i5; -import '../types/encointer_runtime/runtime_call.dart' as _i12; -import '../types/geohash/geo_hash.dart' as _i2; import '../types/pallet_encointer_communities/pallet/call.dart' as _i14; import '../types/sp_core/crypto/account_id32.dart' as _i6; import '../types/substrate_fixed/fixed_i128.dart' as _i13; import '../types/substrate_fixed/fixed_u128.dart' as _i8; +import '../types/substrate_geohash/geo_hash.dart' as _i2; class Queries { const Queries(this.__api); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_faucet.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_faucet.dart index ffe6e1e0d..94c02108c 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_faucet.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_faucet.dart @@ -5,9 +5,9 @@ import 'dart:typed_data' as _i6; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i4; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i7; import '../types/encointer_primitives/communities/community_identifier.dart' as _i8; import '../types/encointer_primitives/faucet/faucet.dart' as _i3; -import '../types/encointer_runtime/runtime_call.dart' as _i7; import '../types/frame_support/pallet_id.dart' as _i10; import '../types/pallet_encointer_faucet/pallet/call.dart' as _i9; import '../types/sp_core/crypto/account_id32.dart' as _i2; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_reputation_commitments.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_reputation_commitments.dart index 51813bf17..b16dd4264 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_reputation_commitments.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_reputation_commitments.dart @@ -5,8 +5,8 @@ import 'dart:typed_data' as _i8; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i9; import '../types/encointer_primitives/communities/community_identifier.dart' as _i4; -import '../types/encointer_runtime/runtime_call.dart' as _i9; import '../types/pallet_encointer_reputation_commitments/pallet/call.dart' as _i10; import '../types/primitive_types/h256.dart' as _i6; import '../types/sp_core/crypto/account_id32.dart' as _i5; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_scheduler.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_scheduler.dart index 368898c67..8fb390054 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_scheduler.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/encointer_scheduler.dart @@ -5,8 +5,8 @@ import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i6; import '../types/encointer_primitives/scheduler/ceremony_phase_type.dart' as _i3; -import '../types/encointer_runtime/runtime_call.dart' as _i6; import '../types/pallet_encointer_scheduler/pallet/call.dart' as _i7; class Queries { diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/membership.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/membership.dart index 9e517d77c..a2b16f8bf 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/membership.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/membership.dart @@ -5,7 +5,7 @@ import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/encointer_runtime/runtime_call.dart' as _i6; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i6; import '../types/pallet_membership/pallet/call.dart' as _i8; import '../types/sp_core/crypto/account_id32.dart' as _i2; import '../types/sp_runtime/multiaddress/multi_address.dart' as _i7; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/message_queue.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/message_queue.dart new file mode 100644 index 000000000..8126a7182 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/message_queue.dart @@ -0,0 +1,192 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i6; +import 'dart:typed_data' as _i7; + +import 'package:polkadart/polkadart.dart' as _i1; +import 'package:polkadart/scale_codec.dart' as _i5; + +import '../types/cumulus_primitives_core/aggregate_message_origin.dart' as _i2; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i8; +import '../types/pallet_message_queue/book_state.dart' as _i3; +import '../types/pallet_message_queue/page.dart' as _i4; +import '../types/pallet_message_queue/pallet/call.dart' as _i9; +import '../types/sp_weights/weight_v2/weight.dart' as _i10; + +class Queries { + const Queries(this.__api); + + final _i1.StateApi __api; + + final _i1.StorageMap<_i2.AggregateMessageOrigin, _i3.BookState> _bookStateFor = + const _i1.StorageMap<_i2.AggregateMessageOrigin, _i3.BookState>( + prefix: 'MessageQueue', + storage: 'BookStateFor', + valueCodec: _i3.BookState.codec, + hasher: _i1.StorageHasher.twoxx64Concat(_i2.AggregateMessageOrigin.codec), + ); + + final _i1.StorageValue<_i2.AggregateMessageOrigin> _serviceHead = const _i1.StorageValue<_i2.AggregateMessageOrigin>( + prefix: 'MessageQueue', + storage: 'ServiceHead', + valueCodec: _i2.AggregateMessageOrigin.codec, + ); + + final _i1.StorageDoubleMap<_i2.AggregateMessageOrigin, int, _i4.Page> _pages = + const _i1.StorageDoubleMap<_i2.AggregateMessageOrigin, int, _i4.Page>( + prefix: 'MessageQueue', + storage: 'Pages', + valueCodec: _i4.Page.codec, + hasher1: _i1.StorageHasher.twoxx64Concat(_i2.AggregateMessageOrigin.codec), + hasher2: _i1.StorageHasher.twoxx64Concat(_i5.U32Codec.codec), + ); + + /// The index of the first and last (non-empty) pages. + _i6.Future<_i3.BookState> bookStateFor( + _i2.AggregateMessageOrigin key1, { + _i1.BlockHash? at, + }) async { + final hashedKey = _bookStateFor.hashedKeyFor(key1); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _bookStateFor.decodeValue(bytes); + } + return _i3.BookState( + begin: 0, + end: 0, + count: 0, + readyNeighbours: null, + messageCount: BigInt.zero, + size: BigInt.zero, + ); /* Default */ + } + + /// The origin at which we should begin servicing. + _i6.Future<_i2.AggregateMessageOrigin?> serviceHead({_i1.BlockHash? at}) async { + final hashedKey = _serviceHead.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _serviceHead.decodeValue(bytes); + } + return null; /* Nullable */ + } + + /// The map of page indices to pages. + _i6.Future<_i4.Page?> pages( + _i2.AggregateMessageOrigin key1, + int key2, { + _i1.BlockHash? at, + }) async { + final hashedKey = _pages.hashedKeyFor( + key1, + key2, + ); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _pages.decodeValue(bytes); + } + return null; /* Nullable */ + } + + /// Returns the storage key for `bookStateFor`. + _i7.Uint8List bookStateForKey(_i2.AggregateMessageOrigin key1) { + final hashedKey = _bookStateFor.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `serviceHead`. + _i7.Uint8List serviceHeadKey() { + final hashedKey = _serviceHead.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `pages`. + _i7.Uint8List pagesKey( + _i2.AggregateMessageOrigin key1, + int key2, + ) { + final hashedKey = _pages.hashedKeyFor( + key1, + key2, + ); + return hashedKey; + } + + /// Returns the storage map key prefix for `bookStateFor`. + _i7.Uint8List bookStateForMapPrefix() { + final hashedKey = _bookStateFor.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `pages`. + _i7.Uint8List pagesMapPrefix(_i2.AggregateMessageOrigin key1) { + final hashedKey = _pages.mapPrefix(key1); + return hashedKey; + } +} + +class Txs { + const Txs(); + + /// See [`Pallet::reap_page`]. + _i8.RuntimeCall reapPage({ + required _i2.AggregateMessageOrigin messageOrigin, + required int pageIndex, + }) { + final _call = _i9.Call.values.reapPage( + messageOrigin: messageOrigin, + pageIndex: pageIndex, + ); + return _i8.RuntimeCall.values.messageQueue(_call); + } + + /// See [`Pallet::execute_overweight`]. + _i8.RuntimeCall executeOverweight({ + required _i2.AggregateMessageOrigin messageOrigin, + required int page, + required int index, + required _i10.Weight weightLimit, + }) { + final _call = _i9.Call.values.executeOverweight( + messageOrigin: messageOrigin, + page: page, + index: index, + weightLimit: weightLimit, + ); + return _i8.RuntimeCall.values.messageQueue(_call); + } +} + +class Constants { + Constants(); + + /// The size of the page; this implies the maximum message size which can be sent. + /// + /// A good value depends on the expected message sizes, their weights, the weight that is + /// available for processing them and the maximal needed message size. The maximal message + /// size is slightly lower than this as defined by [`MaxMessageLenOf`]. + final int heapSize = 65536; + + /// The maximum number of stale pages (i.e. of overweight messages) allowed before culling + /// can happen. Once there are more stale pages than this, then historical pages may be + /// dropped, even if they contain unprocessed overweight messages. + final int maxStale = 8; + + /// The amount of weight (if any) which should be provided to the message queue for + /// servicing enqueued items. + /// + /// This may be legitimately `None` in the case that you will call + /// `ServiceQueues::service_queues` manually. + final _i10.Weight? serviceWeight = _i10.Weight( + refTime: BigInt.from(175000000000), + proofSize: BigInt.from(1835008), + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/parachain_info.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/parachain_info.dart index dfc909358..7fc011833 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/parachain_info.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/parachain_info.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i4; import 'package:polkadart/polkadart.dart' as _i1; -import '../types/polkadot_parachain/primitives/id.dart' as _i2; +import '../types/polkadot_parachain_primitives/primitives/id.dart' as _i2; class Queries { const Queries(this.__api); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/parachain_system.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/parachain_system.dart index 5cc0870b0..df6e194e3 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/parachain_system.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/parachain_system.dart @@ -1,171 +1,226 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i13; -import 'dart:typed_data' as _i14; +import 'dart:async' as _i16; +import 'dart:typed_data' as _i17; import 'package:polkadart/polkadart.dart' as _i1; -import 'package:polkadart/scale_codec.dart' as _i2; - -import '../types/cumulus_pallet_parachain_system/code_upgrade_authorization.dart' as _i12; -import '../types/cumulus_pallet_parachain_system/pallet/call.dart' as _i17; -import '../types/cumulus_pallet_parachain_system/relay_state_snapshot/messaging_state_snapshot.dart' as _i6; -import '../types/cumulus_primitives_parachain_inherent/message_queue_chain.dart' as _i8; -import '../types/cumulus_primitives_parachain_inherent/parachain_inherent_data.dart' as _i16; -import '../types/encointer_runtime/runtime_call.dart' as _i15; -import '../types/polkadot_core_primitives/outbound_hrmp_message.dart' as _i10; -import '../types/polkadot_parachain/primitives/id.dart' as _i9; -import '../types/polkadot_primitives/v5/abridged_host_configuration.dart' as _i7; -import '../types/polkadot_primitives/v5/persisted_validation_data.dart' as _i3; -import '../types/polkadot_primitives/v5/upgrade_restriction.dart' as _i4; -import '../types/primitive_types/h256.dart' as _i18; -import '../types/sp_trie/storage_proof/storage_proof.dart' as _i5; -import '../types/sp_weights/weight_v2/weight.dart' as _i11; +import 'package:polkadart/scale_codec.dart' as _i3; + +import '../types/cumulus_pallet_parachain_system/pallet/call.dart' as _i20; +import '../types/cumulus_pallet_parachain_system/relay_state_snapshot/messaging_state_snapshot.dart' as _i9; +import '../types/cumulus_pallet_parachain_system/unincluded_segment/ancestor.dart' as _i2; +import '../types/cumulus_pallet_parachain_system/unincluded_segment/segment_tracker.dart' as _i4; +import '../types/cumulus_primitives_parachain_inherent/message_queue_chain.dart' as _i11; +import '../types/cumulus_primitives_parachain_inherent/parachain_inherent_data.dart' as _i19; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i18; +import '../types/polkadot_core_primitives/outbound_hrmp_message.dart' as _i13; +import '../types/polkadot_parachain_primitives/primitives/id.dart' as _i12; +import '../types/polkadot_primitives/v6/abridged_host_configuration.dart' as _i10; +import '../types/polkadot_primitives/v6/persisted_validation_data.dart' as _i5; +import '../types/polkadot_primitives/v6/upgrade_go_ahead.dart' as _i7; +import '../types/polkadot_primitives/v6/upgrade_restriction.dart' as _i6; +import '../types/primitive_types/h256.dart' as _i21; +import '../types/sp_arithmetic/fixed_point/fixed_u128.dart' as _i14; +import '../types/sp_trie/storage_proof/storage_proof.dart' as _i8; +import '../types/sp_weights/weight_v2/weight.dart' as _i15; class Queries { const Queries(this.__api); final _i1.StateApi __api; + final _i1.StorageValue> _unincludedSegment = const _i1.StorageValue>( + prefix: 'ParachainSystem', + storage: 'UnincludedSegment', + valueCodec: _i3.SequenceCodec<_i2.Ancestor>(_i2.Ancestor.codec), + ); + + final _i1.StorageValue<_i4.SegmentTracker> _aggregatedUnincludedSegment = const _i1.StorageValue<_i4.SegmentTracker>( + prefix: 'ParachainSystem', + storage: 'AggregatedUnincludedSegment', + valueCodec: _i4.SegmentTracker.codec, + ); + final _i1.StorageValue> _pendingValidationCode = const _i1.StorageValue>( prefix: 'ParachainSystem', storage: 'PendingValidationCode', - valueCodec: _i2.U8SequenceCodec.codec, + valueCodec: _i3.U8SequenceCodec.codec, ); final _i1.StorageValue> _newValidationCode = const _i1.StorageValue>( prefix: 'ParachainSystem', storage: 'NewValidationCode', - valueCodec: _i2.U8SequenceCodec.codec, + valueCodec: _i3.U8SequenceCodec.codec, ); - final _i1.StorageValue<_i3.PersistedValidationData> _validationData = - const _i1.StorageValue<_i3.PersistedValidationData>( + final _i1.StorageValue<_i5.PersistedValidationData> _validationData = + const _i1.StorageValue<_i5.PersistedValidationData>( prefix: 'ParachainSystem', storage: 'ValidationData', - valueCodec: _i3.PersistedValidationData.codec, + valueCodec: _i5.PersistedValidationData.codec, ); final _i1.StorageValue _didSetValidationCode = const _i1.StorageValue( prefix: 'ParachainSystem', storage: 'DidSetValidationCode', - valueCodec: _i2.BoolCodec.codec, + valueCodec: _i3.BoolCodec.codec, ); final _i1.StorageValue _lastRelayChainBlockNumber = const _i1.StorageValue( prefix: 'ParachainSystem', storage: 'LastRelayChainBlockNumber', - valueCodec: _i2.U32Codec.codec, + valueCodec: _i3.U32Codec.codec, ); - final _i1.StorageValue<_i4.UpgradeRestriction?> _upgradeRestrictionSignal = - const _i1.StorageValue<_i4.UpgradeRestriction?>( + final _i1.StorageValue<_i6.UpgradeRestriction?> _upgradeRestrictionSignal = + const _i1.StorageValue<_i6.UpgradeRestriction?>( prefix: 'ParachainSystem', storage: 'UpgradeRestrictionSignal', - valueCodec: _i2.OptionCodec<_i4.UpgradeRestriction>(_i4.UpgradeRestriction.codec), + valueCodec: _i3.OptionCodec<_i6.UpgradeRestriction>(_i6.UpgradeRestriction.codec), ); - final _i1.StorageValue<_i5.StorageProof> _relayStateProof = const _i1.StorageValue<_i5.StorageProof>( + final _i1.StorageValue<_i7.UpgradeGoAhead?> _upgradeGoAhead = const _i1.StorageValue<_i7.UpgradeGoAhead?>( + prefix: 'ParachainSystem', + storage: 'UpgradeGoAhead', + valueCodec: _i3.OptionCodec<_i7.UpgradeGoAhead>(_i7.UpgradeGoAhead.codec), + ); + + final _i1.StorageValue<_i8.StorageProof> _relayStateProof = const _i1.StorageValue<_i8.StorageProof>( prefix: 'ParachainSystem', storage: 'RelayStateProof', - valueCodec: _i5.StorageProof.codec, + valueCodec: _i8.StorageProof.codec, ); - final _i1.StorageValue<_i6.MessagingStateSnapshot> _relevantMessagingState = - const _i1.StorageValue<_i6.MessagingStateSnapshot>( + final _i1.StorageValue<_i9.MessagingStateSnapshot> _relevantMessagingState = + const _i1.StorageValue<_i9.MessagingStateSnapshot>( prefix: 'ParachainSystem', storage: 'RelevantMessagingState', - valueCodec: _i6.MessagingStateSnapshot.codec, + valueCodec: _i9.MessagingStateSnapshot.codec, ); - final _i1.StorageValue<_i7.AbridgedHostConfiguration> _hostConfiguration = - const _i1.StorageValue<_i7.AbridgedHostConfiguration>( + final _i1.StorageValue<_i10.AbridgedHostConfiguration> _hostConfiguration = + const _i1.StorageValue<_i10.AbridgedHostConfiguration>( prefix: 'ParachainSystem', storage: 'HostConfiguration', - valueCodec: _i7.AbridgedHostConfiguration.codec, + valueCodec: _i10.AbridgedHostConfiguration.codec, ); - final _i1.StorageValue<_i8.MessageQueueChain> _lastDmqMqcHead = const _i1.StorageValue<_i8.MessageQueueChain>( + final _i1.StorageValue<_i11.MessageQueueChain> _lastDmqMqcHead = const _i1.StorageValue<_i11.MessageQueueChain>( prefix: 'ParachainSystem', storage: 'LastDmqMqcHead', - valueCodec: _i8.MessageQueueChainCodec(), + valueCodec: _i11.MessageQueueChainCodec(), ); - final _i1.StorageValue> _lastHrmpMqcHeads = - const _i1.StorageValue>( + final _i1.StorageValue> _lastHrmpMqcHeads = + const _i1.StorageValue>( prefix: 'ParachainSystem', storage: 'LastHrmpMqcHeads', - valueCodec: _i2.BTreeMapCodec<_i9.Id, _i8.MessageQueueChain>( - keyCodec: _i9.IdCodec(), - valueCodec: _i8.MessageQueueChainCodec(), + valueCodec: _i3.BTreeMapCodec<_i12.Id, _i11.MessageQueueChain>( + keyCodec: _i12.IdCodec(), + valueCodec: _i11.MessageQueueChainCodec(), ), ); final _i1.StorageValue _processedDownwardMessages = const _i1.StorageValue( prefix: 'ParachainSystem', storage: 'ProcessedDownwardMessages', - valueCodec: _i2.U32Codec.codec, + valueCodec: _i3.U32Codec.codec, ); final _i1.StorageValue _hrmpWatermark = const _i1.StorageValue( prefix: 'ParachainSystem', storage: 'HrmpWatermark', - valueCodec: _i2.U32Codec.codec, + valueCodec: _i3.U32Codec.codec, ); - final _i1.StorageValue> _hrmpOutboundMessages = - const _i1.StorageValue>( + final _i1.StorageValue> _hrmpOutboundMessages = + const _i1.StorageValue>( prefix: 'ParachainSystem', storage: 'HrmpOutboundMessages', - valueCodec: _i2.SequenceCodec<_i10.OutboundHrmpMessage>(_i10.OutboundHrmpMessage.codec), + valueCodec: _i3.SequenceCodec<_i13.OutboundHrmpMessage>(_i13.OutboundHrmpMessage.codec), ); final _i1.StorageValue>> _upwardMessages = const _i1.StorageValue>>( prefix: 'ParachainSystem', storage: 'UpwardMessages', - valueCodec: _i2.SequenceCodec>(_i2.U8SequenceCodec.codec), + valueCodec: _i3.SequenceCodec>(_i3.U8SequenceCodec.codec), ); final _i1.StorageValue>> _pendingUpwardMessages = const _i1.StorageValue>>( prefix: 'ParachainSystem', storage: 'PendingUpwardMessages', - valueCodec: _i2.SequenceCodec>(_i2.U8SequenceCodec.codec), + valueCodec: _i3.SequenceCodec>(_i3.U8SequenceCodec.codec), + ); + + final _i1.StorageValue<_i14.FixedU128> _upwardDeliveryFeeFactor = const _i1.StorageValue<_i14.FixedU128>( + prefix: 'ParachainSystem', + storage: 'UpwardDeliveryFeeFactor', + valueCodec: _i14.FixedU128Codec(), ); final _i1.StorageValue _announcedHrmpMessagesPerCandidate = const _i1.StorageValue( prefix: 'ParachainSystem', storage: 'AnnouncedHrmpMessagesPerCandidate', - valueCodec: _i2.U32Codec.codec, + valueCodec: _i3.U32Codec.codec, ); - final _i1.StorageValue<_i11.Weight> _reservedXcmpWeightOverride = const _i1.StorageValue<_i11.Weight>( + final _i1.StorageValue<_i15.Weight> _reservedXcmpWeightOverride = const _i1.StorageValue<_i15.Weight>( prefix: 'ParachainSystem', storage: 'ReservedXcmpWeightOverride', - valueCodec: _i11.Weight.codec, + valueCodec: _i15.Weight.codec, ); - final _i1.StorageValue<_i11.Weight> _reservedDmpWeightOverride = const _i1.StorageValue<_i11.Weight>( + final _i1.StorageValue<_i15.Weight> _reservedDmpWeightOverride = const _i1.StorageValue<_i15.Weight>( prefix: 'ParachainSystem', storage: 'ReservedDmpWeightOverride', - valueCodec: _i11.Weight.codec, - ); - - final _i1.StorageValue<_i12.CodeUpgradeAuthorization> _authorizedUpgrade = - const _i1.StorageValue<_i12.CodeUpgradeAuthorization>( - prefix: 'ParachainSystem', - storage: 'AuthorizedUpgrade', - valueCodec: _i12.CodeUpgradeAuthorization.codec, + valueCodec: _i15.Weight.codec, ); final _i1.StorageValue> _customValidationHeadData = const _i1.StorageValue>( prefix: 'ParachainSystem', storage: 'CustomValidationHeadData', - valueCodec: _i2.U8SequenceCodec.codec, + valueCodec: _i3.U8SequenceCodec.codec, ); - /// In case of a scheduled upgrade, this storage field contains the validation code to be applied. + /// Latest included block descendants the runtime accepted. In other words, these are + /// ancestors of the currently executing block which have not been included in the observed + /// relay-chain state. /// - /// As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][sp_core::storage::well_known_keys::CODE] - /// which will result the next block process with the new validation code. This concludes the upgrade process. - _i13.Future> pendingValidationCode({_i1.BlockHash? at}) async { + /// The segment length is limited by the capacity returned from the [`ConsensusHook`] configured + /// in the pallet. + _i16.Future> unincludedSegment({_i1.BlockHash? at}) async { + final hashedKey = _unincludedSegment.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _unincludedSegment.decodeValue(bytes); + } + return []; /* Default */ + } + + /// Storage field that keeps track of bandwidth used by the unincluded segment along with the + /// latest HRMP watermark. Used for limiting the acceptance of new blocks with + /// respect to relay chain constraints. + _i16.Future<_i4.SegmentTracker?> aggregatedUnincludedSegment({_i1.BlockHash? at}) async { + final hashedKey = _aggregatedUnincludedSegment.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _aggregatedUnincludedSegment.decodeValue(bytes); + } + return null; /* Nullable */ + } + + /// In case of a scheduled upgrade, this storage field contains the validation code to be + /// applied. + /// + /// As soon as the relay chain gives us the go-ahead signal, we will overwrite the + /// [`:code`][sp_core::storage::well_known_keys::CODE] which will result the next block process + /// with the new validation code. This concludes the upgrade process. + _i16.Future> pendingValidationCode({_i1.BlockHash? at}) async { final hashedKey = _pendingValidationCode.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -186,7 +241,7 @@ class Queries { /// /// This will be cleared in `on_initialize` of each new block if no other pallet already set /// the value. - _i13.Future?> newValidationCode({_i1.BlockHash? at}) async { + _i16.Future?> newValidationCode({_i1.BlockHash? at}) async { final hashedKey = _newValidationCode.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -201,7 +256,7 @@ class Queries { /// The [`PersistedValidationData`] set for this block. /// This value is expected to be set only once per block and it's never stored /// in the trie. - _i13.Future<_i3.PersistedValidationData?> validationData({_i1.BlockHash? at}) async { + _i16.Future<_i5.PersistedValidationData?> validationData({_i1.BlockHash? at}) async { final hashedKey = _validationData.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -214,7 +269,7 @@ class Queries { } /// Were the validation data set to notify the relay chain? - _i13.Future didSetValidationCode({_i1.BlockHash? at}) async { + _i16.Future didSetValidationCode({_i1.BlockHash? at}) async { final hashedKey = _didSetValidationCode.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -227,7 +282,9 @@ class Queries { } /// The relay chain block number associated with the last parachain block. - _i13.Future lastRelayChainBlockNumber({_i1.BlockHash? at}) async { + /// + /// This is updated in `on_finalize`. + _i16.Future lastRelayChainBlockNumber({_i1.BlockHash? at}) async { final hashedKey = _lastRelayChainBlockNumber.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -246,7 +303,7 @@ class Queries { /// This storage item is a mirror of the corresponding value for the current parachain from the /// relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is /// set after the inherent. - _i13.Future<_i4.UpgradeRestriction?> upgradeRestrictionSignal({_i1.BlockHash? at}) async { + _i16.Future<_i6.UpgradeRestriction?> upgradeRestrictionSignal({_i1.BlockHash? at}) async { final hashedKey = _upgradeRestrictionSignal.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -258,13 +315,30 @@ class Queries { return null; /* Default */ } + /// Optional upgrade go-ahead signal from the relay-chain. + /// + /// This storage item is a mirror of the corresponding value for the current parachain from the + /// relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is + /// set after the inherent. + _i16.Future<_i7.UpgradeGoAhead?> upgradeGoAhead({_i1.BlockHash? at}) async { + final hashedKey = _upgradeGoAhead.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _upgradeGoAhead.decodeValue(bytes); + } + return null; /* Default */ + } + /// The state proof for the last relay parent block. /// /// This field is meant to be updated each block with the validation data inherent. Therefore, /// before processing of the inherent, e.g. in `on_initialize` this data may be stale. /// /// This data is also absent from the genesis. - _i13.Future<_i5.StorageProof?> relayStateProof({_i1.BlockHash? at}) async { + _i16.Future<_i8.StorageProof?> relayStateProof({_i1.BlockHash? at}) async { final hashedKey = _relayStateProof.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -283,7 +357,7 @@ class Queries { /// before processing of the inherent, e.g. in `on_initialize` this data may be stale. /// /// This data is also absent from the genesis. - _i13.Future<_i6.MessagingStateSnapshot?> relevantMessagingState({_i1.BlockHash? at}) async { + _i16.Future<_i9.MessagingStateSnapshot?> relevantMessagingState({_i1.BlockHash? at}) async { final hashedKey = _relevantMessagingState.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -301,7 +375,7 @@ class Queries { /// before processing of the inherent, e.g. in `on_initialize` this data may be stale. /// /// This data is also absent from the genesis. - _i13.Future<_i7.AbridgedHostConfiguration?> hostConfiguration({_i1.BlockHash? at}) async { + _i16.Future<_i10.AbridgedHostConfiguration?> hostConfiguration({_i1.BlockHash? at}) async { final hashedKey = _hostConfiguration.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -317,7 +391,7 @@ class Queries { /// /// This value is loaded before and saved after processing inbound downward messages carried /// by the system inherent. - _i13.Future<_i8.MessageQueueChain> lastDmqMqcHead({_i1.BlockHash? at}) async { + _i16.Future<_i11.MessageQueueChain> lastDmqMqcHead({_i1.BlockHash? at}) async { final hashedKey = _lastDmqMqcHead.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -337,7 +411,7 @@ class Queries { /// /// This value is loaded before and saved after processing inbound downward messages carried /// by the system inherent. - _i13.Future> lastHrmpMqcHeads({_i1.BlockHash? at}) async { + _i16.Future> lastHrmpMqcHeads({_i1.BlockHash? at}) async { final hashedKey = _lastHrmpMqcHeads.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -346,13 +420,13 @@ class Queries { if (bytes != null) { return _lastHrmpMqcHeads.decodeValue(bytes); } - return <_i9.Id, _i8.MessageQueueChain>{}; /* Default */ + return <_i12.Id, _i11.MessageQueueChain>{}; /* Default */ } /// Number of downward messages processed in a block. /// /// This will be cleared in `on_initialize` of each new block. - _i13.Future processedDownwardMessages({_i1.BlockHash? at}) async { + _i16.Future processedDownwardMessages({_i1.BlockHash? at}) async { final hashedKey = _processedDownwardMessages.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -367,7 +441,7 @@ class Queries { /// HRMP watermark that was set in a block. /// /// This will be cleared in `on_initialize` of each new block. - _i13.Future hrmpWatermark({_i1.BlockHash? at}) async { + _i16.Future hrmpWatermark({_i1.BlockHash? at}) async { final hashedKey = _hrmpWatermark.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -382,7 +456,7 @@ class Queries { /// HRMP messages that were sent in a block. /// /// This will be cleared in `on_initialize` of each new block. - _i13.Future> hrmpOutboundMessages({_i1.BlockHash? at}) async { + _i16.Future> hrmpOutboundMessages({_i1.BlockHash? at}) async { final hashedKey = _hrmpOutboundMessages.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -397,7 +471,7 @@ class Queries { /// Upward messages that were sent in a block. /// /// This will be cleared in `on_initialize` of each new block. - _i13.Future>> upwardMessages({_i1.BlockHash? at}) async { + _i16.Future>> upwardMessages({_i1.BlockHash? at}) async { final hashedKey = _upwardMessages.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -410,7 +484,7 @@ class Queries { } /// Upward messages that are still pending and not yet send to the relay chain. - _i13.Future>> pendingUpwardMessages({_i1.BlockHash? at}) async { + _i16.Future>> pendingUpwardMessages({_i1.BlockHash? at}) async { final hashedKey = _pendingUpwardMessages.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -422,9 +496,25 @@ class Queries { return []; /* Default */ } + /// The factor to multiply the base delivery fee by for UMP. + _i16.Future<_i14.FixedU128> upwardDeliveryFeeFactor({_i1.BlockHash? at}) async { + final hashedKey = _upwardDeliveryFeeFactor.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _upwardDeliveryFeeFactor.decodeValue(bytes); + } + return BigInt.parse( + '1000000000000000000', + radix: 10, + ); /* Default */ + } + /// The number of HRMP messages we observed in `on_initialize` and thus used that number for /// announcing the weight of `on_initialize` and `on_finalize`. - _i13.Future announcedHrmpMessagesPerCandidate({_i1.BlockHash? at}) async { + _i16.Future announcedHrmpMessagesPerCandidate({_i1.BlockHash? at}) async { final hashedKey = _announcedHrmpMessagesPerCandidate.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -438,7 +528,7 @@ class Queries { /// The weight we reserve at the beginning of the block for processing XCMP messages. This /// overrides the amount set in the Config trait. - _i13.Future<_i11.Weight?> reservedXcmpWeightOverride({_i1.BlockHash? at}) async { + _i16.Future<_i15.Weight?> reservedXcmpWeightOverride({_i1.BlockHash? at}) async { final hashedKey = _reservedXcmpWeightOverride.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -452,7 +542,7 @@ class Queries { /// The weight we reserve at the beginning of the block for processing DMP messages. This /// overrides the amount set in the Config trait. - _i13.Future<_i11.Weight?> reservedDmpWeightOverride({_i1.BlockHash? at}) async { + _i16.Future<_i15.Weight?> reservedDmpWeightOverride({_i1.BlockHash? at}) async { final hashedKey = _reservedDmpWeightOverride.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -464,23 +554,10 @@ class Queries { return null; /* Nullable */ } - /// The next authorized upgrade, if there is one. - _i13.Future<_i12.CodeUpgradeAuthorization?> authorizedUpgrade({_i1.BlockHash? at}) async { - final hashedKey = _authorizedUpgrade.hashedKey(); - final bytes = await __api.getStorage( - hashedKey, - at: at, - ); - if (bytes != null) { - return _authorizedUpgrade.decodeValue(bytes); - } - return null; /* Nullable */ - } - /// A custom head data that should be returned as result of `validate_block`. /// /// See `Pallet::set_custom_validation_head_data` for more information. - _i13.Future?> customValidationHeadData({_i1.BlockHash? at}) async { + _i16.Future?> customValidationHeadData({_i1.BlockHash? at}) async { final hashedKey = _customValidationHeadData.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -492,128 +569,146 @@ class Queries { return null; /* Nullable */ } + /// Returns the storage key for `unincludedSegment`. + _i17.Uint8List unincludedSegmentKey() { + final hashedKey = _unincludedSegment.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `aggregatedUnincludedSegment`. + _i17.Uint8List aggregatedUnincludedSegmentKey() { + final hashedKey = _aggregatedUnincludedSegment.hashedKey(); + return hashedKey; + } + /// Returns the storage key for `pendingValidationCode`. - _i14.Uint8List pendingValidationCodeKey() { + _i17.Uint8List pendingValidationCodeKey() { final hashedKey = _pendingValidationCode.hashedKey(); return hashedKey; } /// Returns the storage key for `newValidationCode`. - _i14.Uint8List newValidationCodeKey() { + _i17.Uint8List newValidationCodeKey() { final hashedKey = _newValidationCode.hashedKey(); return hashedKey; } /// Returns the storage key for `validationData`. - _i14.Uint8List validationDataKey() { + _i17.Uint8List validationDataKey() { final hashedKey = _validationData.hashedKey(); return hashedKey; } /// Returns the storage key for `didSetValidationCode`. - _i14.Uint8List didSetValidationCodeKey() { + _i17.Uint8List didSetValidationCodeKey() { final hashedKey = _didSetValidationCode.hashedKey(); return hashedKey; } /// Returns the storage key for `lastRelayChainBlockNumber`. - _i14.Uint8List lastRelayChainBlockNumberKey() { + _i17.Uint8List lastRelayChainBlockNumberKey() { final hashedKey = _lastRelayChainBlockNumber.hashedKey(); return hashedKey; } /// Returns the storage key for `upgradeRestrictionSignal`. - _i14.Uint8List upgradeRestrictionSignalKey() { + _i17.Uint8List upgradeRestrictionSignalKey() { final hashedKey = _upgradeRestrictionSignal.hashedKey(); return hashedKey; } + /// Returns the storage key for `upgradeGoAhead`. + _i17.Uint8List upgradeGoAheadKey() { + final hashedKey = _upgradeGoAhead.hashedKey(); + return hashedKey; + } + /// Returns the storage key for `relayStateProof`. - _i14.Uint8List relayStateProofKey() { + _i17.Uint8List relayStateProofKey() { final hashedKey = _relayStateProof.hashedKey(); return hashedKey; } /// Returns the storage key for `relevantMessagingState`. - _i14.Uint8List relevantMessagingStateKey() { + _i17.Uint8List relevantMessagingStateKey() { final hashedKey = _relevantMessagingState.hashedKey(); return hashedKey; } /// Returns the storage key for `hostConfiguration`. - _i14.Uint8List hostConfigurationKey() { + _i17.Uint8List hostConfigurationKey() { final hashedKey = _hostConfiguration.hashedKey(); return hashedKey; } /// Returns the storage key for `lastDmqMqcHead`. - _i14.Uint8List lastDmqMqcHeadKey() { + _i17.Uint8List lastDmqMqcHeadKey() { final hashedKey = _lastDmqMqcHead.hashedKey(); return hashedKey; } /// Returns the storage key for `lastHrmpMqcHeads`. - _i14.Uint8List lastHrmpMqcHeadsKey() { + _i17.Uint8List lastHrmpMqcHeadsKey() { final hashedKey = _lastHrmpMqcHeads.hashedKey(); return hashedKey; } /// Returns the storage key for `processedDownwardMessages`. - _i14.Uint8List processedDownwardMessagesKey() { + _i17.Uint8List processedDownwardMessagesKey() { final hashedKey = _processedDownwardMessages.hashedKey(); return hashedKey; } /// Returns the storage key for `hrmpWatermark`. - _i14.Uint8List hrmpWatermarkKey() { + _i17.Uint8List hrmpWatermarkKey() { final hashedKey = _hrmpWatermark.hashedKey(); return hashedKey; } /// Returns the storage key for `hrmpOutboundMessages`. - _i14.Uint8List hrmpOutboundMessagesKey() { + _i17.Uint8List hrmpOutboundMessagesKey() { final hashedKey = _hrmpOutboundMessages.hashedKey(); return hashedKey; } /// Returns the storage key for `upwardMessages`. - _i14.Uint8List upwardMessagesKey() { + _i17.Uint8List upwardMessagesKey() { final hashedKey = _upwardMessages.hashedKey(); return hashedKey; } /// Returns the storage key for `pendingUpwardMessages`. - _i14.Uint8List pendingUpwardMessagesKey() { + _i17.Uint8List pendingUpwardMessagesKey() { final hashedKey = _pendingUpwardMessages.hashedKey(); return hashedKey; } + /// Returns the storage key for `upwardDeliveryFeeFactor`. + _i17.Uint8List upwardDeliveryFeeFactorKey() { + final hashedKey = _upwardDeliveryFeeFactor.hashedKey(); + return hashedKey; + } + /// Returns the storage key for `announcedHrmpMessagesPerCandidate`. - _i14.Uint8List announcedHrmpMessagesPerCandidateKey() { + _i17.Uint8List announcedHrmpMessagesPerCandidateKey() { final hashedKey = _announcedHrmpMessagesPerCandidate.hashedKey(); return hashedKey; } /// Returns the storage key for `reservedXcmpWeightOverride`. - _i14.Uint8List reservedXcmpWeightOverrideKey() { + _i17.Uint8List reservedXcmpWeightOverrideKey() { final hashedKey = _reservedXcmpWeightOverride.hashedKey(); return hashedKey; } /// Returns the storage key for `reservedDmpWeightOverride`. - _i14.Uint8List reservedDmpWeightOverrideKey() { + _i17.Uint8List reservedDmpWeightOverrideKey() { final hashedKey = _reservedDmpWeightOverride.hashedKey(); return hashedKey; } - /// Returns the storage key for `authorizedUpgrade`. - _i14.Uint8List authorizedUpgradeKey() { - final hashedKey = _authorizedUpgrade.hashedKey(); - return hashedKey; - } - /// Returns the storage key for `customValidationHeadData`. - _i14.Uint8List customValidationHeadDataKey() { + _i17.Uint8List customValidationHeadDataKey() { final hashedKey = _customValidationHeadData.hashedKey(); return hashedKey; } @@ -623,32 +718,32 @@ class Txs { const Txs(); /// See [`Pallet::set_validation_data`]. - _i15.RuntimeCall setValidationData({required _i16.ParachainInherentData data}) { - final _call = _i17.Call.values.setValidationData(data: data); - return _i15.RuntimeCall.values.parachainSystem(_call); + _i18.RuntimeCall setValidationData({required _i19.ParachainInherentData data}) { + final _call = _i20.Call.values.setValidationData(data: data); + return _i18.RuntimeCall.values.parachainSystem(_call); } /// See [`Pallet::sudo_send_upward_message`]. - _i15.RuntimeCall sudoSendUpwardMessage({required List message}) { - final _call = _i17.Call.values.sudoSendUpwardMessage(message: message); - return _i15.RuntimeCall.values.parachainSystem(_call); + _i18.RuntimeCall sudoSendUpwardMessage({required List message}) { + final _call = _i20.Call.values.sudoSendUpwardMessage(message: message); + return _i18.RuntimeCall.values.parachainSystem(_call); } /// See [`Pallet::authorize_upgrade`]. - _i15.RuntimeCall authorizeUpgrade({ - required _i18.H256 codeHash, + _i18.RuntimeCall authorizeUpgrade({ + required _i21.H256 codeHash, required bool checkVersion, }) { - final _call = _i17.Call.values.authorizeUpgrade( + final _call = _i20.Call.values.authorizeUpgrade( codeHash: codeHash, checkVersion: checkVersion, ); - return _i15.RuntimeCall.values.parachainSystem(_call); + return _i18.RuntimeCall.values.parachainSystem(_call); } /// See [`Pallet::enact_authorized_upgrade`]. - _i15.RuntimeCall enactAuthorizedUpgrade({required List code}) { - final _call = _i17.Call.values.enactAuthorizedUpgrade(code: code); - return _i15.RuntimeCall.values.parachainSystem(_call); + _i18.RuntimeCall enactAuthorizedUpgrade({required List code}) { + final _call = _i20.Call.values.enactAuthorizedUpgrade(code: code); + return _i18.RuntimeCall.values.parachainSystem(_call); } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/polkadot_xcm.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/polkadot_xcm.dart index 618aebc87..8ebdf6bc8 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/polkadot_xcm.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/polkadot_xcm.dart @@ -1,26 +1,27 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i12; -import 'dart:typed_data' as _i13; +import 'dart:async' as _i13; +import 'dart:typed_data' as _i14; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; -import '../types/encointer_runtime/runtime_call.dart' as _i14; -import '../types/pallet_xcm/pallet/call.dart' as _i16; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i15; +import '../types/pallet_xcm/pallet/call.dart' as _i17; import '../types/pallet_xcm/pallet/query_status.dart' as _i3; -import '../types/pallet_xcm/pallet/remote_locked_fungible_record.dart' as _i11; -import '../types/pallet_xcm/pallet/version_migration_stage.dart' as _i8; +import '../types/pallet_xcm/pallet/remote_locked_fungible_record.dart' as _i12; +import '../types/pallet_xcm/pallet/version_migration_stage.dart' as _i9; import '../types/primitive_types/h256.dart' as _i4; -import '../types/sp_core/crypto/account_id32.dart' as _i9; +import '../types/sp_core/crypto/account_id32.dart' as _i10; import '../types/sp_weights/weight_v2/weight.dart' as _i7; -import '../types/tuples.dart' as _i6; -import '../types/xcm/v3/multilocation/multi_location.dart' as _i19; -import '../types/xcm/v3/weight_limit.dart' as _i20; -import '../types/xcm/versioned_asset_id.dart' as _i10; -import '../types/xcm/versioned_multi_assets.dart' as _i17; -import '../types/xcm/versioned_multi_location.dart' as _i5; -import '../types/xcm/versioned_xcm_1.dart' as _i15; -import '../types/xcm/versioned_xcm_2.dart' as _i18; +import '../types/staging_xcm/v4/location/location.dart' as _i20; +import '../types/tuples.dart' as _i8; +import '../types/tuples_2.dart' as _i6; +import '../types/xcm/v3/weight_limit.dart' as _i21; +import '../types/xcm/versioned_asset_id.dart' as _i11; +import '../types/xcm/versioned_assets.dart' as _i18; +import '../types/xcm/versioned_location.dart' as _i5; +import '../types/xcm/versioned_xcm_1.dart' as _i16; +import '../types/xcm/versioned_xcm_2.dart' as _i19; class Queries { const Queries(this.__api); @@ -53,27 +54,26 @@ class Queries { valueCodec: _i2.U32Codec.codec, ); - final _i1.StorageDoubleMap _supportedVersion = - const _i1.StorageDoubleMap( + final _i1.StorageDoubleMap _supportedVersion = + const _i1.StorageDoubleMap( prefix: 'PolkadotXcm', storage: 'SupportedVersion', valueCodec: _i2.U32Codec.codec, hasher1: _i1.StorageHasher.twoxx64Concat(_i2.U32Codec.codec), - hasher2: _i1.StorageHasher.blake2b128Concat(_i5.VersionedMultiLocation.codec), + hasher2: _i1.StorageHasher.blake2b128Concat(_i5.VersionedLocation.codec), ); - final _i1.StorageDoubleMap _versionNotifiers = - const _i1.StorageDoubleMap( + final _i1.StorageDoubleMap _versionNotifiers = + const _i1.StorageDoubleMap( prefix: 'PolkadotXcm', storage: 'VersionNotifiers', valueCodec: _i2.U64Codec.codec, hasher1: _i1.StorageHasher.twoxx64Concat(_i2.U32Codec.codec), - hasher2: _i1.StorageHasher.blake2b128Concat(_i5.VersionedMultiLocation.codec), + hasher2: _i1.StorageHasher.blake2b128Concat(_i5.VersionedLocation.codec), ); - final _i1.StorageDoubleMap> - _versionNotifyTargets = - const _i1.StorageDoubleMap>( + final _i1.StorageDoubleMap> _versionNotifyTargets = + const _i1.StorageDoubleMap>( prefix: 'PolkadotXcm', storage: 'VersionNotifyTargets', valueCodec: _i6.Tuple3Codec( @@ -82,48 +82,47 @@ class Queries { _i2.U32Codec.codec, ), hasher1: _i1.StorageHasher.twoxx64Concat(_i2.U32Codec.codec), - hasher2: _i1.StorageHasher.blake2b128Concat(_i5.VersionedMultiLocation.codec), + hasher2: _i1.StorageHasher.blake2b128Concat(_i5.VersionedLocation.codec), ); - final _i1.StorageValue>> _versionDiscoveryQueue = - const _i1.StorageValue>>( + final _i1.StorageValue>> _versionDiscoveryQueue = + const _i1.StorageValue>>( prefix: 'PolkadotXcm', storage: 'VersionDiscoveryQueue', - valueCodec: - _i2.SequenceCodec<_i6.Tuple2<_i5.VersionedMultiLocation, int>>(_i6.Tuple2Codec<_i5.VersionedMultiLocation, int>( - _i5.VersionedMultiLocation.codec, + valueCodec: _i2.SequenceCodec<_i8.Tuple2<_i5.VersionedLocation, int>>(_i8.Tuple2Codec<_i5.VersionedLocation, int>( + _i5.VersionedLocation.codec, _i2.U32Codec.codec, )), ); - final _i1.StorageValue<_i8.VersionMigrationStage> _currentMigration = - const _i1.StorageValue<_i8.VersionMigrationStage>( + final _i1.StorageValue<_i9.VersionMigrationStage> _currentMigration = + const _i1.StorageValue<_i9.VersionMigrationStage>( prefix: 'PolkadotXcm', storage: 'CurrentMigration', - valueCodec: _i8.VersionMigrationStage.codec, + valueCodec: _i9.VersionMigrationStage.codec, ); - final _i1.StorageTripleMap + final _i1.StorageTripleMap _remoteLockedFungibles = - const _i1.StorageTripleMap( + const _i1.StorageTripleMap( prefix: 'PolkadotXcm', storage: 'RemoteLockedFungibles', - valueCodec: _i11.RemoteLockedFungibleRecord.codec, + valueCodec: _i12.RemoteLockedFungibleRecord.codec, hasher1: _i1.StorageHasher.twoxx64Concat(_i2.U32Codec.codec), - hasher2: _i1.StorageHasher.blake2b128Concat(_i9.AccountId32Codec()), - hasher3: _i1.StorageHasher.blake2b128Concat(_i10.VersionedAssetId.codec), + hasher2: _i1.StorageHasher.blake2b128Concat(_i10.AccountId32Codec()), + hasher3: _i1.StorageHasher.blake2b128Concat(_i11.VersionedAssetId.codec), ); - final _i1.StorageMap<_i9.AccountId32, List<_i6.Tuple2>> _lockedFungibles = - const _i1.StorageMap<_i9.AccountId32, List<_i6.Tuple2>>( + final _i1.StorageMap<_i10.AccountId32, List<_i8.Tuple2>> _lockedFungibles = + const _i1.StorageMap<_i10.AccountId32, List<_i8.Tuple2>>( prefix: 'PolkadotXcm', storage: 'LockedFungibles', - valueCodec: _i2.SequenceCodec<_i6.Tuple2>( - _i6.Tuple2Codec( + valueCodec: + _i2.SequenceCodec<_i8.Tuple2>(_i8.Tuple2Codec( _i2.U128Codec.codec, - _i5.VersionedMultiLocation.codec, + _i5.VersionedLocation.codec, )), - hasher: _i1.StorageHasher.blake2b128Concat(_i9.AccountId32Codec()), + hasher: _i1.StorageHasher.blake2b128Concat(_i10.AccountId32Codec()), ); final _i1.StorageValue _xcmExecutionSuspended = const _i1.StorageValue( @@ -133,7 +132,7 @@ class Queries { ); /// The latest available query index. - _i12.Future queryCounter({_i1.BlockHash? at}) async { + _i13.Future queryCounter({_i1.BlockHash? at}) async { final hashedKey = _queryCounter.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -146,7 +145,7 @@ class Queries { } /// The ongoing queries. - _i12.Future<_i3.QueryStatus?> queries( + _i13.Future<_i3.QueryStatus?> queries( BigInt key1, { _i1.BlockHash? at, }) async { @@ -163,9 +162,9 @@ class Queries { /// The existing asset traps. /// - /// Key is the blake2 256 hash of (origin, versioned `MultiAssets`) pair. Value is the number of + /// Key is the blake2 256 hash of (origin, versioned `Assets`) pair. Value is the number of /// times this pair has been trapped (usually just 1 if it exists at all). - _i12.Future assetTraps( + _i13.Future assetTraps( _i4.H256 key1, { _i1.BlockHash? at, }) async { @@ -182,7 +181,7 @@ class Queries { /// Default version to encode XCM when latest version of destination is unknown. If `None`, /// then the destinations whose XCM version is unknown are considered unreachable. - _i12.Future safeXcmVersion({_i1.BlockHash? at}) async { + _i13.Future safeXcmVersion({_i1.BlockHash? at}) async { final hashedKey = _safeXcmVersion.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -195,9 +194,9 @@ class Queries { } /// The Latest versions that we know various locations support. - _i12.Future supportedVersion( + _i13.Future supportedVersion( int key1, - _i5.VersionedMultiLocation key2, { + _i5.VersionedLocation key2, { _i1.BlockHash? at, }) async { final hashedKey = _supportedVersion.hashedKeyFor( @@ -215,9 +214,9 @@ class Queries { } /// All locations that we have requested version notifications from. - _i12.Future versionNotifiers( + _i13.Future versionNotifiers( int key1, - _i5.VersionedMultiLocation key2, { + _i5.VersionedLocation key2, { _i1.BlockHash? at, }) async { final hashedKey = _versionNotifiers.hashedKeyFor( @@ -236,9 +235,9 @@ class Queries { /// The target locations that are subscribed to our version changes, as well as the most recent /// of our versions we informed them of. - _i12.Future<_i6.Tuple3?> versionNotifyTargets( + _i13.Future<_i6.Tuple3?> versionNotifyTargets( int key1, - _i5.VersionedMultiLocation key2, { + _i5.VersionedLocation key2, { _i1.BlockHash? at, }) async { final hashedKey = _versionNotifyTargets.hashedKeyFor( @@ -258,7 +257,7 @@ class Queries { /// Destinations whose latest XCM version we would like to know. Duplicates not allowed, and /// the `u32` counter is the number of times that a send to the destination has been attempted, /// which is used as a prioritization. - _i12.Future>> versionDiscoveryQueue({_i1.BlockHash? at}) async { + _i13.Future>> versionDiscoveryQueue({_i1.BlockHash? at}) async { final hashedKey = _versionDiscoveryQueue.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -271,7 +270,7 @@ class Queries { } /// The current migration's stage, if any. - _i12.Future<_i8.VersionMigrationStage?> currentMigration({_i1.BlockHash? at}) async { + _i13.Future<_i9.VersionMigrationStage?> currentMigration({_i1.BlockHash? at}) async { final hashedKey = _currentMigration.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -284,10 +283,10 @@ class Queries { } /// Fungible assets which we know are locked on a remote chain. - _i12.Future<_i11.RemoteLockedFungibleRecord?> remoteLockedFungibles( + _i13.Future<_i12.RemoteLockedFungibleRecord?> remoteLockedFungibles( int key1, - _i9.AccountId32 key2, - _i10.VersionedAssetId key3, { + _i10.AccountId32 key2, + _i11.VersionedAssetId key3, { _i1.BlockHash? at, }) async { final hashedKey = _remoteLockedFungibles.hashedKeyFor( @@ -306,8 +305,8 @@ class Queries { } /// Fungible assets which we know are locked on this chain. - _i12.Future>?> lockedFungibles( - _i9.AccountId32 key1, { + _i13.Future>?> lockedFungibles( + _i10.AccountId32 key1, { _i1.BlockHash? at, }) async { final hashedKey = _lockedFungibles.hashedKeyFor(key1); @@ -322,7 +321,7 @@ class Queries { } /// Global suspension state of the XCM executor. - _i12.Future xcmExecutionSuspended({_i1.BlockHash? at}) async { + _i13.Future xcmExecutionSuspended({_i1.BlockHash? at}) async { final hashedKey = _xcmExecutionSuspended.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -335,33 +334,33 @@ class Queries { } /// Returns the storage key for `queryCounter`. - _i13.Uint8List queryCounterKey() { + _i14.Uint8List queryCounterKey() { final hashedKey = _queryCounter.hashedKey(); return hashedKey; } /// Returns the storage key for `queries`. - _i13.Uint8List queriesKey(BigInt key1) { + _i14.Uint8List queriesKey(BigInt key1) { final hashedKey = _queries.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `assetTraps`. - _i13.Uint8List assetTrapsKey(_i4.H256 key1) { + _i14.Uint8List assetTrapsKey(_i4.H256 key1) { final hashedKey = _assetTraps.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `safeXcmVersion`. - _i13.Uint8List safeXcmVersionKey() { + _i14.Uint8List safeXcmVersionKey() { final hashedKey = _safeXcmVersion.hashedKey(); return hashedKey; } /// Returns the storage key for `supportedVersion`. - _i13.Uint8List supportedVersionKey( + _i14.Uint8List supportedVersionKey( int key1, - _i5.VersionedMultiLocation key2, + _i5.VersionedLocation key2, ) { final hashedKey = _supportedVersion.hashedKeyFor( key1, @@ -371,9 +370,9 @@ class Queries { } /// Returns the storage key for `versionNotifiers`. - _i13.Uint8List versionNotifiersKey( + _i14.Uint8List versionNotifiersKey( int key1, - _i5.VersionedMultiLocation key2, + _i5.VersionedLocation key2, ) { final hashedKey = _versionNotifiers.hashedKeyFor( key1, @@ -383,9 +382,9 @@ class Queries { } /// Returns the storage key for `versionNotifyTargets`. - _i13.Uint8List versionNotifyTargetsKey( + _i14.Uint8List versionNotifyTargetsKey( int key1, - _i5.VersionedMultiLocation key2, + _i5.VersionedLocation key2, ) { final hashedKey = _versionNotifyTargets.hashedKeyFor( key1, @@ -395,22 +394,22 @@ class Queries { } /// Returns the storage key for `versionDiscoveryQueue`. - _i13.Uint8List versionDiscoveryQueueKey() { + _i14.Uint8List versionDiscoveryQueueKey() { final hashedKey = _versionDiscoveryQueue.hashedKey(); return hashedKey; } /// Returns the storage key for `currentMigration`. - _i13.Uint8List currentMigrationKey() { + _i14.Uint8List currentMigrationKey() { final hashedKey = _currentMigration.hashedKey(); return hashedKey; } /// Returns the storage key for `remoteLockedFungibles`. - _i13.Uint8List remoteLockedFungiblesKey( + _i14.Uint8List remoteLockedFungiblesKey( int key1, - _i9.AccountId32 key2, - _i10.VersionedAssetId key3, + _i10.AccountId32 key2, + _i11.VersionedAssetId key3, ) { final hashedKey = _remoteLockedFungibles.hashedKeyFor( key1, @@ -421,49 +420,49 @@ class Queries { } /// Returns the storage key for `lockedFungibles`. - _i13.Uint8List lockedFungiblesKey(_i9.AccountId32 key1) { + _i14.Uint8List lockedFungiblesKey(_i10.AccountId32 key1) { final hashedKey = _lockedFungibles.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `xcmExecutionSuspended`. - _i13.Uint8List xcmExecutionSuspendedKey() { + _i14.Uint8List xcmExecutionSuspendedKey() { final hashedKey = _xcmExecutionSuspended.hashedKey(); return hashedKey; } /// Returns the storage map key prefix for `queries`. - _i13.Uint8List queriesMapPrefix() { + _i14.Uint8List queriesMapPrefix() { final hashedKey = _queries.mapPrefix(); return hashedKey; } /// Returns the storage map key prefix for `assetTraps`. - _i13.Uint8List assetTrapsMapPrefix() { + _i14.Uint8List assetTrapsMapPrefix() { final hashedKey = _assetTraps.mapPrefix(); return hashedKey; } /// Returns the storage map key prefix for `supportedVersion`. - _i13.Uint8List supportedVersionMapPrefix(int key1) { + _i14.Uint8List supportedVersionMapPrefix(int key1) { final hashedKey = _supportedVersion.mapPrefix(key1); return hashedKey; } /// Returns the storage map key prefix for `versionNotifiers`. - _i13.Uint8List versionNotifiersMapPrefix(int key1) { + _i14.Uint8List versionNotifiersMapPrefix(int key1) { final hashedKey = _versionNotifiers.mapPrefix(key1); return hashedKey; } /// Returns the storage map key prefix for `versionNotifyTargets`. - _i13.Uint8List versionNotifyTargetsMapPrefix(int key1) { + _i14.Uint8List versionNotifyTargetsMapPrefix(int key1) { final hashedKey = _versionNotifyTargets.mapPrefix(key1); return hashedKey; } /// Returns the storage map key prefix for `lockedFungibles`. - _i13.Uint8List lockedFungiblesMapPrefix() { + _i14.Uint8List lockedFungiblesMapPrefix() { final hashedKey = _lockedFungibles.mapPrefix(); return hashedKey; } @@ -473,130 +472,160 @@ class Txs { const Txs(); /// See [`Pallet::send`]. - _i14.RuntimeCall send({ - required _i5.VersionedMultiLocation dest, - required _i15.VersionedXcm message, + _i15.RuntimeCall send({ + required _i5.VersionedLocation dest, + required _i16.VersionedXcm message, }) { - final _call = _i16.Call.values.send( + final _call = _i17.Call.values.send( dest: dest, message: message, ); - return _i14.RuntimeCall.values.polkadotXcm(_call); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::teleport_assets`]. - _i14.RuntimeCall teleportAssets({ - required _i5.VersionedMultiLocation dest, - required _i5.VersionedMultiLocation beneficiary, - required _i17.VersionedMultiAssets assets, + _i15.RuntimeCall teleportAssets({ + required _i5.VersionedLocation dest, + required _i5.VersionedLocation beneficiary, + required _i18.VersionedAssets assets, required int feeAssetItem, }) { - final _call = _i16.Call.values.teleportAssets( + final _call = _i17.Call.values.teleportAssets( dest: dest, beneficiary: beneficiary, assets: assets, feeAssetItem: feeAssetItem, ); - return _i14.RuntimeCall.values.polkadotXcm(_call); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::reserve_transfer_assets`]. - _i14.RuntimeCall reserveTransferAssets({ - required _i5.VersionedMultiLocation dest, - required _i5.VersionedMultiLocation beneficiary, - required _i17.VersionedMultiAssets assets, + _i15.RuntimeCall reserveTransferAssets({ + required _i5.VersionedLocation dest, + required _i5.VersionedLocation beneficiary, + required _i18.VersionedAssets assets, required int feeAssetItem, }) { - final _call = _i16.Call.values.reserveTransferAssets( + final _call = _i17.Call.values.reserveTransferAssets( dest: dest, beneficiary: beneficiary, assets: assets, feeAssetItem: feeAssetItem, ); - return _i14.RuntimeCall.values.polkadotXcm(_call); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::execute`]. - _i14.RuntimeCall execute({ - required _i18.VersionedXcm message, + _i15.RuntimeCall execute({ + required _i19.VersionedXcm message, required _i7.Weight maxWeight, }) { - final _call = _i16.Call.values.execute( + final _call = _i17.Call.values.execute( message: message, maxWeight: maxWeight, ); - return _i14.RuntimeCall.values.polkadotXcm(_call); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::force_xcm_version`]. - _i14.RuntimeCall forceXcmVersion({ - required _i19.MultiLocation location, + _i15.RuntimeCall forceXcmVersion({ + required _i20.Location location, required int version, }) { - final _call = _i16.Call.values.forceXcmVersion( + final _call = _i17.Call.values.forceXcmVersion( location: location, version: version, ); - return _i14.RuntimeCall.values.polkadotXcm(_call); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::force_default_xcm_version`]. - _i14.RuntimeCall forceDefaultXcmVersion({int? maybeXcmVersion}) { - final _call = _i16.Call.values.forceDefaultXcmVersion(maybeXcmVersion: maybeXcmVersion); - return _i14.RuntimeCall.values.polkadotXcm(_call); + _i15.RuntimeCall forceDefaultXcmVersion({int? maybeXcmVersion}) { + final _call = _i17.Call.values.forceDefaultXcmVersion(maybeXcmVersion: maybeXcmVersion); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::force_subscribe_version_notify`]. - _i14.RuntimeCall forceSubscribeVersionNotify({required _i5.VersionedMultiLocation location}) { - final _call = _i16.Call.values.forceSubscribeVersionNotify(location: location); - return _i14.RuntimeCall.values.polkadotXcm(_call); + _i15.RuntimeCall forceSubscribeVersionNotify({required _i5.VersionedLocation location}) { + final _call = _i17.Call.values.forceSubscribeVersionNotify(location: location); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::force_unsubscribe_version_notify`]. - _i14.RuntimeCall forceUnsubscribeVersionNotify({required _i5.VersionedMultiLocation location}) { - final _call = _i16.Call.values.forceUnsubscribeVersionNotify(location: location); - return _i14.RuntimeCall.values.polkadotXcm(_call); + _i15.RuntimeCall forceUnsubscribeVersionNotify({required _i5.VersionedLocation location}) { + final _call = _i17.Call.values.forceUnsubscribeVersionNotify(location: location); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::limited_reserve_transfer_assets`]. - _i14.RuntimeCall limitedReserveTransferAssets({ - required _i5.VersionedMultiLocation dest, - required _i5.VersionedMultiLocation beneficiary, - required _i17.VersionedMultiAssets assets, + _i15.RuntimeCall limitedReserveTransferAssets({ + required _i5.VersionedLocation dest, + required _i5.VersionedLocation beneficiary, + required _i18.VersionedAssets assets, required int feeAssetItem, - required _i20.WeightLimit weightLimit, + required _i21.WeightLimit weightLimit, }) { - final _call = _i16.Call.values.limitedReserveTransferAssets( + final _call = _i17.Call.values.limitedReserveTransferAssets( dest: dest, beneficiary: beneficiary, assets: assets, feeAssetItem: feeAssetItem, weightLimit: weightLimit, ); - return _i14.RuntimeCall.values.polkadotXcm(_call); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::limited_teleport_assets`]. - _i14.RuntimeCall limitedTeleportAssets({ - required _i5.VersionedMultiLocation dest, - required _i5.VersionedMultiLocation beneficiary, - required _i17.VersionedMultiAssets assets, + _i15.RuntimeCall limitedTeleportAssets({ + required _i5.VersionedLocation dest, + required _i5.VersionedLocation beneficiary, + required _i18.VersionedAssets assets, required int feeAssetItem, - required _i20.WeightLimit weightLimit, + required _i21.WeightLimit weightLimit, }) { - final _call = _i16.Call.values.limitedTeleportAssets( + final _call = _i17.Call.values.limitedTeleportAssets( dest: dest, beneficiary: beneficiary, assets: assets, feeAssetItem: feeAssetItem, weightLimit: weightLimit, ); - return _i14.RuntimeCall.values.polkadotXcm(_call); + return _i15.RuntimeCall.values.polkadotXcm(_call); } /// See [`Pallet::force_suspension`]. - _i14.RuntimeCall forceSuspension({required bool suspended}) { - final _call = _i16.Call.values.forceSuspension(suspended: suspended); - return _i14.RuntimeCall.values.polkadotXcm(_call); + _i15.RuntimeCall forceSuspension({required bool suspended}) { + final _call = _i17.Call.values.forceSuspension(suspended: suspended); + return _i15.RuntimeCall.values.polkadotXcm(_call); + } + + /// See [`Pallet::transfer_assets`]. + _i15.RuntimeCall transferAssets({ + required _i5.VersionedLocation dest, + required _i5.VersionedLocation beneficiary, + required _i18.VersionedAssets assets, + required int feeAssetItem, + required _i21.WeightLimit weightLimit, + }) { + final _call = _i17.Call.values.transferAssets( + dest: dest, + beneficiary: beneficiary, + assets: assets, + feeAssetItem: feeAssetItem, + weightLimit: weightLimit, + ); + return _i15.RuntimeCall.values.polkadotXcm(_call); + } + + /// See [`Pallet::claim_assets`]. + _i15.RuntimeCall claimAssets({ + required _i18.VersionedAssets assets, + required _i5.VersionedLocation beneficiary, + }) { + final _call = _i17.Call.values.claimAssets( + assets: assets, + beneficiary: beneficiary, + ); + return _i15.RuntimeCall.values.polkadotXcm(_call); } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/proxy.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/proxy.dart index 2ab0a2551..4e8c47b2a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/proxy.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/proxy.dart @@ -5,8 +5,8 @@ import 'dart:typed_data' as _i8; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i5; -import '../types/encointer_runtime/proxy_type.dart' as _i11; -import '../types/encointer_runtime/runtime_call.dart' as _i9; +import '../types/encointer_kusama_runtime/proxy_type.dart' as _i11; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i9; import '../types/pallet_proxy/announcement.dart' as _i6; import '../types/pallet_proxy/pallet/call.dart' as _i12; import '../types/pallet_proxy/proxy_definition.dart' as _i4; @@ -249,14 +249,14 @@ class Constants { /// /// This is held for an additional storage item whose value size is /// `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes. - final BigInt proxyDepositBase = BigInt.from(32); + final BigInt proxyDepositBase = BigInt.from(6679999980); /// The amount of currency needed per proxy added. /// /// This is held for adding 32 bytes plus an instance of `ProxyType` more into a /// pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take /// into account `32 + proxy_type.encode().len()` bytes of data. - final BigInt proxyDepositFactor = BigInt.from(32); + final BigInt proxyDepositFactor = BigInt.from(10999989); /// The maximum amount of proxies allowed for a single account. final int maxProxies = 32; @@ -268,11 +268,11 @@ class Constants { /// /// This is held when a new storage item holding a `Balance` is created (typically 16 /// bytes). - final BigInt announcementDepositBase = BigInt.from(32); + final BigInt announcementDepositBase = BigInt.from(6682666644); /// The amount of currency needed per announcement made. /// /// This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes) /// into a pre-existing storage value. - final BigInt announcementDepositFactor = BigInt.from(32); + final BigInt announcementDepositFactor = BigInt.from(21999978); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/scheduler.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/scheduler.dart index b7f24ff4d..5c84afdda 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/scheduler.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/scheduler.dart @@ -5,7 +5,7 @@ import 'dart:typed_data' as _i6; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; -import '../types/encointer_runtime/runtime_call.dart' as _i7; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i7; import '../types/pallet_scheduler/pallet/call.dart' as _i8; import '../types/pallet_scheduler/scheduled.dart' as _i3; import '../types/sp_weights/weight_v2/weight.dart' as _i9; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/system.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/system.dart index b6a710c9e..1e3fbf2e2 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/system.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/system.dart @@ -1,29 +1,30 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i12; -import 'dart:typed_data' as _i15; +import 'dart:async' as _i13; +import 'dart:typed_data' as _i16; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i4; -import '../types/encointer_runtime/runtime_call.dart' as _i16; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i17; import '../types/frame_support/dispatch/per_dispatch_class_1.dart' as _i5; -import '../types/frame_support/dispatch/per_dispatch_class_2.dart' as _i19; -import '../types/frame_support/dispatch/per_dispatch_class_3.dart' as _i22; +import '../types/frame_support/dispatch/per_dispatch_class_2.dart' as _i20; +import '../types/frame_support/dispatch/per_dispatch_class_3.dart' as _i23; import '../types/frame_system/account_info.dart' as _i3; +import '../types/frame_system/code_upgrade_authorization.dart' as _i12; import '../types/frame_system/event_record.dart' as _i8; import '../types/frame_system/last_runtime_upgrade_info.dart' as _i10; -import '../types/frame_system/limits/block_length.dart' as _i21; -import '../types/frame_system/limits/block_weights.dart' as _i18; -import '../types/frame_system/limits/weights_per_class.dart' as _i20; -import '../types/frame_system/pallet/call.dart' as _i17; +import '../types/frame_system/limits/block_length.dart' as _i22; +import '../types/frame_system/limits/block_weights.dart' as _i19; +import '../types/frame_system/limits/weights_per_class.dart' as _i21; +import '../types/frame_system/pallet/call.dart' as _i18; import '../types/frame_system/phase.dart' as _i11; -import '../types/pallet_balances/types/account_data.dart' as _i13; +import '../types/pallet_balances/types/account_data.dart' as _i14; import '../types/primitive_types/h256.dart' as _i6; import '../types/sp_core/crypto/account_id32.dart' as _i2; import '../types/sp_runtime/generic/digest/digest.dart' as _i7; -import '../types/sp_version/runtime_version.dart' as _i24; -import '../types/sp_weights/runtime_db_weight.dart' as _i23; -import '../types/sp_weights/weight_v2/weight.dart' as _i14; +import '../types/sp_version/runtime_version.dart' as _i25; +import '../types/sp_weights/runtime_db_weight.dart' as _i24; +import '../types/sp_weights/weight_v2/weight.dart' as _i15; import '../types/tuples.dart' as _i9; class Queries { @@ -137,8 +138,15 @@ class Queries { valueCodec: _i11.Phase.codec, ); + final _i1.StorageValue<_i12.CodeUpgradeAuthorization> _authorizedUpgrade = + const _i1.StorageValue<_i12.CodeUpgradeAuthorization>( + prefix: 'System', + storage: 'AuthorizedUpgrade', + valueCodec: _i12.CodeUpgradeAuthorization.codec, + ); + /// The full account information for a particular account ID. - _i12.Future<_i3.AccountInfo> account( + _i13.Future<_i3.AccountInfo> account( _i2.AccountId32 key1, { _i1.BlockHash? at, }) async { @@ -155,7 +163,7 @@ class Queries { consumers: 0, providers: 0, sufficients: 0, - data: _i13.AccountData( + data: _i14.AccountData( free: BigInt.zero, reserved: BigInt.zero, frozen: BigInt.zero, @@ -168,7 +176,7 @@ class Queries { } /// Total extrinsics count for the current block. - _i12.Future extrinsicCount({_i1.BlockHash? at}) async { + _i13.Future extrinsicCount({_i1.BlockHash? at}) async { final hashedKey = _extrinsicCount.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -181,7 +189,7 @@ class Queries { } /// The current weight for the block. - _i12.Future<_i5.PerDispatchClass> blockWeight({_i1.BlockHash? at}) async { + _i13.Future<_i5.PerDispatchClass> blockWeight({_i1.BlockHash? at}) async { final hashedKey = _blockWeight.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -191,15 +199,15 @@ class Queries { return _blockWeight.decodeValue(bytes); } return _i5.PerDispatchClass( - normal: _i14.Weight( + normal: _i15.Weight( refTime: BigInt.zero, proofSize: BigInt.zero, ), - operational: _i14.Weight( + operational: _i15.Weight( refTime: BigInt.zero, proofSize: BigInt.zero, ), - mandatory: _i14.Weight( + mandatory: _i15.Weight( refTime: BigInt.zero, proofSize: BigInt.zero, ), @@ -207,7 +215,7 @@ class Queries { } /// Total length (in bytes) for all extrinsics put together, for the current block. - _i12.Future allExtrinsicsLen({_i1.BlockHash? at}) async { + _i13.Future allExtrinsicsLen({_i1.BlockHash? at}) async { final hashedKey = _allExtrinsicsLen.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -220,7 +228,7 @@ class Queries { } /// Map of block numbers to block hashes. - _i12.Future<_i6.H256> blockHash( + _i13.Future<_i6.H256> blockHash( int key1, { _i1.BlockHash? at, }) async { @@ -240,7 +248,7 @@ class Queries { } /// Extrinsics data for the current block (maps an extrinsic's index to its data). - _i12.Future> extrinsicData( + _i13.Future> extrinsicData( int key1, { _i1.BlockHash? at, }) async { @@ -260,7 +268,7 @@ class Queries { } /// The current block number being processed. Set by `execute_block`. - _i12.Future number({_i1.BlockHash? at}) async { + _i13.Future number({_i1.BlockHash? at}) async { final hashedKey = _number.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -273,7 +281,7 @@ class Queries { } /// Hash of the previous block. - _i12.Future<_i6.H256> parentHash({_i1.BlockHash? at}) async { + _i13.Future<_i6.H256> parentHash({_i1.BlockHash? at}) async { final hashedKey = _parentHash.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -290,7 +298,7 @@ class Queries { } /// Digest of the current block, also part of the block header. - _i12.Future<_i7.Digest> digest({_i1.BlockHash? at}) async { + _i13.Future<_i7.Digest> digest({_i1.BlockHash? at}) async { final hashedKey = _digest.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -309,7 +317,7 @@ class Queries { /// /// Events have a large in-memory size. Box the events to not go out-of-memory /// just in case someone still reads them from within the runtime. - _i12.Future> events({_i1.BlockHash? at}) async { + _i13.Future> events({_i1.BlockHash? at}) async { final hashedKey = _events.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -322,7 +330,7 @@ class Queries { } /// The number of events in the `Events` list. - _i12.Future eventCount({_i1.BlockHash? at}) async { + _i13.Future eventCount({_i1.BlockHash? at}) async { final hashedKey = _eventCount.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -344,7 +352,7 @@ class Queries { /// The value has the type `(BlockNumberFor, EventIndex)` because if we used only just /// the `EventIndex` then in case if the topic has the same contents on the next block /// no notification will be triggered thus the event might be lost. - _i12.Future>> eventTopics( + _i13.Future>> eventTopics( _i6.H256 key1, { _i1.BlockHash? at, }) async { @@ -360,7 +368,7 @@ class Queries { } /// Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened. - _i12.Future<_i10.LastRuntimeUpgradeInfo?> lastRuntimeUpgrade({_i1.BlockHash? at}) async { + _i13.Future<_i10.LastRuntimeUpgradeInfo?> lastRuntimeUpgrade({_i1.BlockHash? at}) async { final hashedKey = _lastRuntimeUpgrade.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -373,7 +381,7 @@ class Queries { } /// True if we have upgraded so that `type RefCount` is `u32`. False (default) if not. - _i12.Future upgradedToU32RefCount({_i1.BlockHash? at}) async { + _i13.Future upgradedToU32RefCount({_i1.BlockHash? at}) async { final hashedKey = _upgradedToU32RefCount.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -387,7 +395,7 @@ class Queries { /// True if we have upgraded so that AccountInfo contains three types of `RefCount`. False /// (default) if not. - _i12.Future upgradedToTripleRefCount({_i1.BlockHash? at}) async { + _i13.Future upgradedToTripleRefCount({_i1.BlockHash? at}) async { final hashedKey = _upgradedToTripleRefCount.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -400,7 +408,7 @@ class Queries { } /// The execution phase of the block. - _i12.Future<_i11.Phase?> executionPhase({_i1.BlockHash? at}) async { + _i13.Future<_i11.Phase?> executionPhase({_i1.BlockHash? at}) async { final hashedKey = _executionPhase.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -412,122 +420,141 @@ class Queries { return null; /* Nullable */ } + /// `Some` if a code upgrade has been authorized. + _i13.Future<_i12.CodeUpgradeAuthorization?> authorizedUpgrade({_i1.BlockHash? at}) async { + final hashedKey = _authorizedUpgrade.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _authorizedUpgrade.decodeValue(bytes); + } + return null; /* Nullable */ + } + /// Returns the storage key for `account`. - _i15.Uint8List accountKey(_i2.AccountId32 key1) { + _i16.Uint8List accountKey(_i2.AccountId32 key1) { final hashedKey = _account.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `extrinsicCount`. - _i15.Uint8List extrinsicCountKey() { + _i16.Uint8List extrinsicCountKey() { final hashedKey = _extrinsicCount.hashedKey(); return hashedKey; } /// Returns the storage key for `blockWeight`. - _i15.Uint8List blockWeightKey() { + _i16.Uint8List blockWeightKey() { final hashedKey = _blockWeight.hashedKey(); return hashedKey; } /// Returns the storage key for `allExtrinsicsLen`. - _i15.Uint8List allExtrinsicsLenKey() { + _i16.Uint8List allExtrinsicsLenKey() { final hashedKey = _allExtrinsicsLen.hashedKey(); return hashedKey; } /// Returns the storage key for `blockHash`. - _i15.Uint8List blockHashKey(int key1) { + _i16.Uint8List blockHashKey(int key1) { final hashedKey = _blockHash.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `extrinsicData`. - _i15.Uint8List extrinsicDataKey(int key1) { + _i16.Uint8List extrinsicDataKey(int key1) { final hashedKey = _extrinsicData.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `number`. - _i15.Uint8List numberKey() { + _i16.Uint8List numberKey() { final hashedKey = _number.hashedKey(); return hashedKey; } /// Returns the storage key for `parentHash`. - _i15.Uint8List parentHashKey() { + _i16.Uint8List parentHashKey() { final hashedKey = _parentHash.hashedKey(); return hashedKey; } /// Returns the storage key for `digest`. - _i15.Uint8List digestKey() { + _i16.Uint8List digestKey() { final hashedKey = _digest.hashedKey(); return hashedKey; } /// Returns the storage key for `events`. - _i15.Uint8List eventsKey() { + _i16.Uint8List eventsKey() { final hashedKey = _events.hashedKey(); return hashedKey; } /// Returns the storage key for `eventCount`. - _i15.Uint8List eventCountKey() { + _i16.Uint8List eventCountKey() { final hashedKey = _eventCount.hashedKey(); return hashedKey; } /// Returns the storage key for `eventTopics`. - _i15.Uint8List eventTopicsKey(_i6.H256 key1) { + _i16.Uint8List eventTopicsKey(_i6.H256 key1) { final hashedKey = _eventTopics.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `lastRuntimeUpgrade`. - _i15.Uint8List lastRuntimeUpgradeKey() { + _i16.Uint8List lastRuntimeUpgradeKey() { final hashedKey = _lastRuntimeUpgrade.hashedKey(); return hashedKey; } /// Returns the storage key for `upgradedToU32RefCount`. - _i15.Uint8List upgradedToU32RefCountKey() { + _i16.Uint8List upgradedToU32RefCountKey() { final hashedKey = _upgradedToU32RefCount.hashedKey(); return hashedKey; } /// Returns the storage key for `upgradedToTripleRefCount`. - _i15.Uint8List upgradedToTripleRefCountKey() { + _i16.Uint8List upgradedToTripleRefCountKey() { final hashedKey = _upgradedToTripleRefCount.hashedKey(); return hashedKey; } /// Returns the storage key for `executionPhase`. - _i15.Uint8List executionPhaseKey() { + _i16.Uint8List executionPhaseKey() { final hashedKey = _executionPhase.hashedKey(); return hashedKey; } + /// Returns the storage key for `authorizedUpgrade`. + _i16.Uint8List authorizedUpgradeKey() { + final hashedKey = _authorizedUpgrade.hashedKey(); + return hashedKey; + } + /// Returns the storage map key prefix for `account`. - _i15.Uint8List accountMapPrefix() { + _i16.Uint8List accountMapPrefix() { final hashedKey = _account.mapPrefix(); return hashedKey; } /// Returns the storage map key prefix for `blockHash`. - _i15.Uint8List blockHashMapPrefix() { + _i16.Uint8List blockHashMapPrefix() { final hashedKey = _blockHash.mapPrefix(); return hashedKey; } /// Returns the storage map key prefix for `extrinsicData`. - _i15.Uint8List extrinsicDataMapPrefix() { + _i16.Uint8List extrinsicDataMapPrefix() { final hashedKey = _extrinsicData.mapPrefix(); return hashedKey; } /// Returns the storage map key prefix for `eventTopics`. - _i15.Uint8List eventTopicsMapPrefix() { + _i16.Uint8List eventTopicsMapPrefix() { final hashedKey = _eventTopics.mapPrefix(); return hashedKey; } @@ -537,57 +564,75 @@ class Txs { const Txs(); /// See [`Pallet::remark`]. - _i16.RuntimeCall remark({required List remark}) { - final _call = _i17.Call.values.remark(remark: remark); - return _i16.RuntimeCall.values.system(_call); + _i17.RuntimeCall remark({required List remark}) { + final _call = _i18.Call.values.remark(remark: remark); + return _i17.RuntimeCall.values.system(_call); } /// See [`Pallet::set_heap_pages`]. - _i16.RuntimeCall setHeapPages({required BigInt pages}) { - final _call = _i17.Call.values.setHeapPages(pages: pages); - return _i16.RuntimeCall.values.system(_call); + _i17.RuntimeCall setHeapPages({required BigInt pages}) { + final _call = _i18.Call.values.setHeapPages(pages: pages); + return _i17.RuntimeCall.values.system(_call); } /// See [`Pallet::set_code`]. - _i16.RuntimeCall setCode({required List code}) { - final _call = _i17.Call.values.setCode(code: code); - return _i16.RuntimeCall.values.system(_call); + _i17.RuntimeCall setCode({required List code}) { + final _call = _i18.Call.values.setCode(code: code); + return _i17.RuntimeCall.values.system(_call); } /// See [`Pallet::set_code_without_checks`]. - _i16.RuntimeCall setCodeWithoutChecks({required List code}) { - final _call = _i17.Call.values.setCodeWithoutChecks(code: code); - return _i16.RuntimeCall.values.system(_call); + _i17.RuntimeCall setCodeWithoutChecks({required List code}) { + final _call = _i18.Call.values.setCodeWithoutChecks(code: code); + return _i17.RuntimeCall.values.system(_call); } /// See [`Pallet::set_storage`]. - _i16.RuntimeCall setStorage({required List<_i9.Tuple2, List>> items}) { - final _call = _i17.Call.values.setStorage(items: items); - return _i16.RuntimeCall.values.system(_call); + _i17.RuntimeCall setStorage({required List<_i9.Tuple2, List>> items}) { + final _call = _i18.Call.values.setStorage(items: items); + return _i17.RuntimeCall.values.system(_call); } /// See [`Pallet::kill_storage`]. - _i16.RuntimeCall killStorage({required List> keys}) { - final _call = _i17.Call.values.killStorage(keys: keys); - return _i16.RuntimeCall.values.system(_call); + _i17.RuntimeCall killStorage({required List> keys}) { + final _call = _i18.Call.values.killStorage(keys: keys); + return _i17.RuntimeCall.values.system(_call); } /// See [`Pallet::kill_prefix`]. - _i16.RuntimeCall killPrefix({ + _i17.RuntimeCall killPrefix({ required List prefix, required int subkeys, }) { - final _call = _i17.Call.values.killPrefix( + final _call = _i18.Call.values.killPrefix( prefix: prefix, subkeys: subkeys, ); - return _i16.RuntimeCall.values.system(_call); + return _i17.RuntimeCall.values.system(_call); } /// See [`Pallet::remark_with_event`]. - _i16.RuntimeCall remarkWithEvent({required List remark}) { - final _call = _i17.Call.values.remarkWithEvent(remark: remark); - return _i16.RuntimeCall.values.system(_call); + _i17.RuntimeCall remarkWithEvent({required List remark}) { + final _call = _i18.Call.values.remarkWithEvent(remark: remark); + return _i17.RuntimeCall.values.system(_call); + } + + /// See [`Pallet::authorize_upgrade`]. + _i17.RuntimeCall authorizeUpgrade({required _i6.H256 codeHash}) { + final _call = _i18.Call.values.authorizeUpgrade(codeHash: codeHash); + return _i17.RuntimeCall.values.system(_call); + } + + /// See [`Pallet::authorize_upgrade_without_checks`]. + _i17.RuntimeCall authorizeUpgradeWithoutChecks({required _i6.H256 codeHash}) { + final _call = _i18.Call.values.authorizeUpgradeWithoutChecks(codeHash: codeHash); + return _i17.RuntimeCall.values.system(_call); + } + + /// See [`Pallet::apply_authorized_upgrade`]. + _i17.RuntimeCall applyAuthorizedUpgrade({required List code}) { + final _call = _i18.Call.values.applyAuthorizedUpgrade(code: code); + return _i17.RuntimeCall.values.system(_call); } } @@ -595,54 +640,54 @@ class Constants { Constants(); /// Block & extrinsics weights: base values and limits. - final _i18.BlockWeights blockWeights = _i18.BlockWeights( - baseBlock: _i14.Weight( + final _i19.BlockWeights blockWeights = _i19.BlockWeights( + baseBlock: _i15.Weight( refTime: BigInt.from(5000000000), proofSize: BigInt.zero, ), - maxBlock: _i14.Weight( + maxBlock: _i15.Weight( refTime: BigInt.from(500000000000), proofSize: BigInt.from(5242880), ), - perClass: _i19.PerDispatchClass( - normal: _i20.WeightsPerClass( - baseExtrinsic: _i14.Weight( + perClass: _i20.PerDispatchClass( + normal: _i21.WeightsPerClass( + baseExtrinsic: _i15.Weight( refTime: BigInt.from(125000000), proofSize: BigInt.zero, ), - maxExtrinsic: _i14.Weight( + maxExtrinsic: _i15.Weight( refTime: BigInt.from(349875000000), proofSize: BigInt.from(3670016), ), - maxTotal: _i14.Weight( + maxTotal: _i15.Weight( refTime: BigInt.from(375000000000), proofSize: BigInt.from(3932160), ), - reserved: _i14.Weight( + reserved: _i15.Weight( refTime: BigInt.zero, proofSize: BigInt.zero, ), ), - operational: _i20.WeightsPerClass( - baseExtrinsic: _i14.Weight( + operational: _i21.WeightsPerClass( + baseExtrinsic: _i15.Weight( refTime: BigInt.from(125000000), proofSize: BigInt.zero, ), - maxExtrinsic: _i14.Weight( + maxExtrinsic: _i15.Weight( refTime: BigInt.from(474875000000), proofSize: BigInt.from(4980736), ), - maxTotal: _i14.Weight( + maxTotal: _i15.Weight( refTime: BigInt.from(500000000000), proofSize: BigInt.from(5242880), ), - reserved: _i14.Weight( + reserved: _i15.Weight( refTime: BigInt.from(125000000000), proofSize: BigInt.from(1310720), ), ), - mandatory: _i20.WeightsPerClass( - baseExtrinsic: _i14.Weight( + mandatory: _i21.WeightsPerClass( + baseExtrinsic: _i15.Weight( refTime: BigInt.from(125000000), proofSize: BigInt.zero, ), @@ -654,8 +699,8 @@ class Constants { ); /// The maximum length of a block (in bytes). - final _i21.BlockLength blockLength = const _i21.BlockLength( - max: _i22.PerDispatchClass( + final _i22.BlockLength blockLength = const _i22.BlockLength( + max: _i23.PerDispatchClass( normal: 3932160, operational: 5242880, mandatory: 5242880, @@ -665,17 +710,17 @@ class Constants { final int blockHashCount = 4096; /// The weight of runtime database operations the runtime can invoke. - final _i23.RuntimeDbWeight dbWeight = _i23.RuntimeDbWeight( + final _i24.RuntimeDbWeight dbWeight = _i24.RuntimeDbWeight( read: BigInt.from(25000000), write: BigInt.from(100000000), ); /// Get the chain's current version. - final _i24.RuntimeVersion version = const _i24.RuntimeVersion( + final _i25.RuntimeVersion version = const _i25.RuntimeVersion( specName: 'encointer-parachain', implName: 'encointer-parachain', authoringVersion: 1, - specVersion: 16, + specVersion: 1002000, implVersion: 1, apis: [ _i9.Tuple2, int>( @@ -860,6 +905,19 @@ class Constants { ], 1, ), + _i9.Tuple2, int>( + [ + 251, + 197, + 119, + 185, + 215, + 71, + 239, + 214, + ], + 1, + ), ], transactionVersion: 3, stateVersion: 0, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/timestamp.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/timestamp.dart index 07768e25a..012cad626 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/timestamp.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/timestamp.dart @@ -5,7 +5,7 @@ import 'dart:typed_data' as _i4; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; -import '../types/encointer_runtime/runtime_call.dart' as _i5; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i5; import '../types/pallet_timestamp/pallet/call.dart' as _i6; class Queries { @@ -25,7 +25,7 @@ class Queries { valueCodec: _i2.BoolCodec.codec, ); - /// Current time for the current block. + /// The current time for the current block. _i3.Future now({_i1.BlockHash? at}) async { final hashedKey = _now.hashedKey(); final bytes = await __api.getStorage( @@ -38,7 +38,10 @@ class Queries { return BigInt.zero; /* Default */ } - /// Did the timestamp get updated in this block? + /// Whether the timestamp has been updated in this block. + /// + /// This value is updated to `true` upon successful submission of a timestamp by a node. + /// It is then checked at the end of each block execution in the `on_finalize` hook. _i3.Future didUpdate({_i1.BlockHash? at}) async { final hashedKey = _didUpdate.hashedKey(); final bytes = await __api.getStorage( @@ -77,9 +80,11 @@ class Txs { class Constants { Constants(); - /// The minimum period between blocks. Beware that this is different to the *expected* - /// period that the block production apparatus provides. Your chosen consensus system will - /// generally work with this to determine a sensible block time. e.g. For Aura, it will be - /// double this period on default settings. + /// The minimum period between blocks. + /// + /// Be aware that this is different to the *expected* period that the block production + /// apparatus provides. Your chosen consensus system will generally work with this to + /// determine a sensible block time. For example, in the Aura pallet it will be double this + /// period on default settings. final BigInt minimumPeriod = BigInt.from(6000); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/transaction_payment.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/transaction_payment.dart index ba930d01c..c7c8b1b38 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/transaction_payment.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/transaction_payment.dart @@ -67,10 +67,10 @@ class Queries { class Constants { Constants(); - /// A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their + /// A fee multiplier for `Operational` extrinsics to compute "virtual tip" to boost their /// `priority` /// - /// This value is multipled by the `final_fee` to obtain a "virtual tip" that is later + /// This value is multiplied by the `final_fee` to obtain a "virtual tip" that is later /// added to a tip component in regular `priority` calculations. /// It means that a `Normal` transaction can front-run a similarly-sized `Operational` /// extrinsic (with no tip), by including a tip value greater than the virtual tip. diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/treasury.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/treasury.dart index fa16ecb58..7e4a249cc 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/treasury.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/treasury.dart @@ -1,16 +1,18 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i4; -import 'dart:typed_data' as _i5; +import 'dart:async' as _i5; +import 'dart:typed_data' as _i6; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; -import '../types/encointer_runtime/runtime_call.dart' as _i6; -import '../types/frame_support/pallet_id.dart' as _i10; -import '../types/pallet_treasury/pallet/call.dart' as _i8; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i7; +import '../types/frame_support/pallet_id.dart' as _i12; +import '../types/pallet_treasury/pallet/call.dart' as _i9; import '../types/pallet_treasury/proposal.dart' as _i3; -import '../types/sp_arithmetic/per_things/permill.dart' as _i9; -import '../types/sp_runtime/multiaddress/multi_address.dart' as _i7; +import '../types/pallet_treasury/spend_status.dart' as _i4; +import '../types/sp_arithmetic/per_things/permill.dart' as _i11; +import '../types/sp_core/crypto/account_id32.dart' as _i10; +import '../types/sp_runtime/multiaddress/multi_address.dart' as _i8; class Queries { const Queries(this.__api); @@ -42,8 +44,21 @@ class Queries { valueCodec: _i2.U32SequenceCodec.codec, ); + final _i1.StorageValue _spendCount = const _i1.StorageValue( + prefix: 'Treasury', + storage: 'SpendCount', + valueCodec: _i2.U32Codec.codec, + ); + + final _i1.StorageMap _spends = const _i1.StorageMap( + prefix: 'Treasury', + storage: 'Spends', + valueCodec: _i4.SpendStatus.codec, + hasher: _i1.StorageHasher.twoxx64Concat(_i2.U32Codec.codec), + ); + /// Number of proposals that have been made. - _i4.Future proposalCount({_i1.BlockHash? at}) async { + _i5.Future proposalCount({_i1.BlockHash? at}) async { final hashedKey = _proposalCount.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -56,7 +71,7 @@ class Queries { } /// Proposals that have been made. - _i4.Future<_i3.Proposal?> proposals( + _i5.Future<_i3.Proposal?> proposals( int key1, { _i1.BlockHash? at, }) async { @@ -72,7 +87,7 @@ class Queries { } /// The amount which has been reported as inactive to Currency. - _i4.Future deactivated({_i1.BlockHash? at}) async { + _i5.Future deactivated({_i1.BlockHash? at}) async { final hashedKey = _deactivated.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -85,7 +100,7 @@ class Queries { } /// Proposal indices that have been approved but not yet awarded. - _i4.Future> approvals({_i1.BlockHash? at}) async { + _i5.Future> approvals({_i1.BlockHash? at}) async { final hashedKey = _approvals.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -101,80 +116,161 @@ class Queries { ); /* Default */ } + /// The count of spends that have been made. + _i5.Future spendCount({_i1.BlockHash? at}) async { + final hashedKey = _spendCount.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _spendCount.decodeValue(bytes); + } + return 0; /* Default */ + } + + /// Spends that have been approved and being processed. + _i5.Future<_i4.SpendStatus?> spends( + int key1, { + _i1.BlockHash? at, + }) async { + final hashedKey = _spends.hashedKeyFor(key1); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _spends.decodeValue(bytes); + } + return null; /* Nullable */ + } + /// Returns the storage key for `proposalCount`. - _i5.Uint8List proposalCountKey() { + _i6.Uint8List proposalCountKey() { final hashedKey = _proposalCount.hashedKey(); return hashedKey; } /// Returns the storage key for `proposals`. - _i5.Uint8List proposalsKey(int key1) { + _i6.Uint8List proposalsKey(int key1) { final hashedKey = _proposals.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `deactivated`. - _i5.Uint8List deactivatedKey() { + _i6.Uint8List deactivatedKey() { final hashedKey = _deactivated.hashedKey(); return hashedKey; } /// Returns the storage key for `approvals`. - _i5.Uint8List approvalsKey() { + _i6.Uint8List approvalsKey() { final hashedKey = _approvals.hashedKey(); return hashedKey; } + /// Returns the storage key for `spendCount`. + _i6.Uint8List spendCountKey() { + final hashedKey = _spendCount.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `spends`. + _i6.Uint8List spendsKey(int key1) { + final hashedKey = _spends.hashedKeyFor(key1); + return hashedKey; + } + /// Returns the storage map key prefix for `proposals`. - _i5.Uint8List proposalsMapPrefix() { + _i6.Uint8List proposalsMapPrefix() { final hashedKey = _proposals.mapPrefix(); return hashedKey; } + + /// Returns the storage map key prefix for `spends`. + _i6.Uint8List spendsMapPrefix() { + final hashedKey = _spends.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); /// See [`Pallet::propose_spend`]. - _i6.RuntimeCall proposeSpend({ + _i7.RuntimeCall proposeSpend({ required BigInt value, - required _i7.MultiAddress beneficiary, + required _i8.MultiAddress beneficiary, }) { - final _call = _i8.Call.values.proposeSpend( + final _call = _i9.Call.values.proposeSpend( value: value, beneficiary: beneficiary, ); - return _i6.RuntimeCall.values.treasury(_call); + return _i7.RuntimeCall.values.treasury(_call); } /// See [`Pallet::reject_proposal`]. - _i6.RuntimeCall rejectProposal({required BigInt proposalId}) { - final _call = _i8.Call.values.rejectProposal(proposalId: proposalId); - return _i6.RuntimeCall.values.treasury(_call); + _i7.RuntimeCall rejectProposal({required BigInt proposalId}) { + final _call = _i9.Call.values.rejectProposal(proposalId: proposalId); + return _i7.RuntimeCall.values.treasury(_call); } /// See [`Pallet::approve_proposal`]. - _i6.RuntimeCall approveProposal({required BigInt proposalId}) { - final _call = _i8.Call.values.approveProposal(proposalId: proposalId); - return _i6.RuntimeCall.values.treasury(_call); + _i7.RuntimeCall approveProposal({required BigInt proposalId}) { + final _call = _i9.Call.values.approveProposal(proposalId: proposalId); + return _i7.RuntimeCall.values.treasury(_call); } - /// See [`Pallet::spend`]. - _i6.RuntimeCall spend({ + /// See [`Pallet::spend_local`]. + _i7.RuntimeCall spendLocal({ required BigInt amount, - required _i7.MultiAddress beneficiary, + required _i8.MultiAddress beneficiary, }) { - final _call = _i8.Call.values.spend( + final _call = _i9.Call.values.spendLocal( amount: amount, beneficiary: beneficiary, ); - return _i6.RuntimeCall.values.treasury(_call); + return _i7.RuntimeCall.values.treasury(_call); } /// See [`Pallet::remove_approval`]. - _i6.RuntimeCall removeApproval({required BigInt proposalId}) { - final _call = _i8.Call.values.removeApproval(proposalId: proposalId); - return _i6.RuntimeCall.values.treasury(_call); + _i7.RuntimeCall removeApproval({required BigInt proposalId}) { + final _call = _i9.Call.values.removeApproval(proposalId: proposalId); + return _i7.RuntimeCall.values.treasury(_call); + } + + /// See [`Pallet::spend`]. + _i7.RuntimeCall spend({ + required dynamic assetKind, + required BigInt amount, + required _i10.AccountId32 beneficiary, + int? validFrom, + }) { + final _call = _i9.Call.values.spend( + assetKind: assetKind, + amount: amount, + beneficiary: beneficiary, + validFrom: validFrom, + ); + return _i7.RuntimeCall.values.treasury(_call); + } + + /// See [`Pallet::payout`]. + _i7.RuntimeCall payout({required int index}) { + final _call = _i9.Call.values.payout(index: index); + return _i7.RuntimeCall.values.treasury(_call); + } + + /// See [`Pallet::check_status`]. + _i7.RuntimeCall checkStatus({required int index}) { + final _call = _i9.Call.values.checkStatus(index: index); + return _i7.RuntimeCall.values.treasury(_call); + } + + /// See [`Pallet::void_spend`]. + _i7.RuntimeCall voidSpend({required int index}) { + final _call = _i9.Call.values.voidSpend(index: index); + return _i7.RuntimeCall.values.treasury(_call); } } @@ -183,7 +279,7 @@ class Constants { /// Fraction of a proposal's value that should be bonded in order to place the proposal. /// An accepted proposal gets these back. A rejected proposal does not. - final _i9.Permill proposalBond = 50000; + final _i11.Permill proposalBond = 50000; /// Minimum amount of funds that should be placed in a deposit for making a proposal. final BigInt proposalBondMinimum = BigInt.from(33333300); @@ -195,10 +291,10 @@ class Constants { final int spendPeriod = 43200; /// Percentage of spare funds (if any) that are burnt per spend period. - final _i9.Permill burn = 0; + final _i11.Permill burn = 0; /// The treasury's pallet id, used for deriving its sovereign account ID. - final _i10.PalletId palletId = const [ + final _i12.PalletId palletId = const [ 112, 121, 47, @@ -213,4 +309,7 @@ class Constants { /// /// NOTE: This parameter is also used within the Bounties Pallet extension if enabled. final int maxApprovals = 10; + + /// The period during which an approved treasury spend has to be claimed. + final int payoutPeriod = 216000; } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/utility.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/utility.dart index c20bfdae6..9df94f0fd 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/utility.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/utility.dart @@ -1,6 +1,6 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import '../types/encointer_runtime/origin_caller.dart' as _i3; -import '../types/encointer_runtime/runtime_call.dart' as _i1; +import '../types/encointer_kusama_runtime/origin_caller.dart' as _i3; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i1; import '../types/pallet_utility/pallet/call.dart' as _i2; import '../types/sp_weights/weight_v2/weight.dart' as _i4; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/xcmp_queue.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/xcmp_queue.dart index 8fee74742..565845f87 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/xcmp_queue.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/pallets/xcmp_queue.dart @@ -1,61 +1,50 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; -import 'dart:typed_data' as _i10; +import 'dart:typed_data' as _i9; import 'package:polkadart/polkadart.dart' as _i1; -import 'package:polkadart/scale_codec.dart' as _i3; +import 'package:polkadart/scale_codec.dart' as _i4; -import '../types/cumulus_pallet_xcmp_queue/inbound_channel_details.dart' as _i2; -import '../types/cumulus_pallet_xcmp_queue/outbound_channel_details.dart' as _i5; -import '../types/cumulus_pallet_xcmp_queue/pallet/call.dart' as _i12; +import '../types/bounded_collections/bounded_btree_set/bounded_b_tree_set.dart' as _i2; +import '../types/cumulus_pallet_xcmp_queue/outbound_channel_details.dart' as _i3; +import '../types/cumulus_pallet_xcmp_queue/pallet/call.dart' as _i11; import '../types/cumulus_pallet_xcmp_queue/queue_config_data.dart' as _i6; -import '../types/encointer_runtime/runtime_call.dart' as _i11; -import '../types/polkadot_parachain/primitives/id.dart' as _i4; -import '../types/sp_weights/weight_v2/weight.dart' as _i9; -import '../types/tuples_2.dart' as _i7; +import '../types/encointer_kusama_runtime/runtime_call.dart' as _i10; +import '../types/polkadot_parachain_primitives/primitives/id.dart' as _i5; +import '../types/sp_arithmetic/fixed_point/fixed_u128.dart' as _i7; class Queries { const Queries(this.__api); final _i1.StateApi __api; - final _i1.StorageValue> _inboundXcmpStatus = - const _i1.StorageValue>( + final _i1.StorageValue<_i2.BoundedBTreeSet> _inboundXcmpSuspended = const _i1.StorageValue<_i2.BoundedBTreeSet>( prefix: 'XcmpQueue', - storage: 'InboundXcmpStatus', - valueCodec: _i3.SequenceCodec<_i2.InboundChannelDetails>(_i2.InboundChannelDetails.codec), + storage: 'InboundXcmpSuspended', + valueCodec: _i2.BoundedBTreeSetCodec(), ); - final _i1.StorageDoubleMap<_i4.Id, int, List> _inboundXcmpMessages = - const _i1.StorageDoubleMap<_i4.Id, int, List>( - prefix: 'XcmpQueue', - storage: 'InboundXcmpMessages', - valueCodec: _i3.U8SequenceCodec.codec, - hasher1: _i1.StorageHasher.blake2b128Concat(_i4.IdCodec()), - hasher2: _i1.StorageHasher.twoxx64Concat(_i3.U32Codec.codec), - ); - - final _i1.StorageValue> _outboundXcmpStatus = - const _i1.StorageValue>( + final _i1.StorageValue> _outboundXcmpStatus = + const _i1.StorageValue>( prefix: 'XcmpQueue', storage: 'OutboundXcmpStatus', - valueCodec: _i3.SequenceCodec<_i5.OutboundChannelDetails>(_i5.OutboundChannelDetails.codec), + valueCodec: _i4.SequenceCodec<_i3.OutboundChannelDetails>(_i3.OutboundChannelDetails.codec), ); - final _i1.StorageDoubleMap<_i4.Id, int, List> _outboundXcmpMessages = - const _i1.StorageDoubleMap<_i4.Id, int, List>( + final _i1.StorageDoubleMap<_i5.Id, int, List> _outboundXcmpMessages = + const _i1.StorageDoubleMap<_i5.Id, int, List>( prefix: 'XcmpQueue', storage: 'OutboundXcmpMessages', - valueCodec: _i3.U8SequenceCodec.codec, - hasher1: _i1.StorageHasher.blake2b128Concat(_i4.IdCodec()), - hasher2: _i1.StorageHasher.twoxx64Concat(_i3.U16Codec.codec), + valueCodec: _i4.U8SequenceCodec.codec, + hasher1: _i1.StorageHasher.blake2b128Concat(_i5.IdCodec()), + hasher2: _i1.StorageHasher.twoxx64Concat(_i4.U16Codec.codec), ); - final _i1.StorageMap<_i4.Id, List> _signalMessages = const _i1.StorageMap<_i4.Id, List>( + final _i1.StorageMap<_i5.Id, List> _signalMessages = const _i1.StorageMap<_i5.Id, List>( prefix: 'XcmpQueue', storage: 'SignalMessages', - valueCodec: _i3.U8SequenceCodec.codec, - hasher: _i1.StorageHasher.blake2b128Concat(_i4.IdCodec()), + valueCodec: _i4.U8SequenceCodec.codec, + hasher: _i1.StorageHasher.blake2b128Concat(_i5.IdCodec()), ); final _i1.StorageValue<_i6.QueueConfigData> _queueConfig = const _i1.StorageValue<_i6.QueueConfigData>( @@ -64,80 +53,46 @@ class Queries { valueCodec: _i6.QueueConfigData.codec, ); - final _i1.StorageMap>> _overweight = - const _i1.StorageMap>>( - prefix: 'XcmpQueue', - storage: 'Overweight', - valueCodec: _i7.Tuple3Codec<_i4.Id, int, List>( - _i4.IdCodec(), - _i3.U32Codec.codec, - _i3.U8SequenceCodec.codec, - ), - hasher: _i1.StorageHasher.twoxx64Concat(_i3.U64Codec.codec), - ); - - final _i1.StorageValue _counterForOverweight = const _i1.StorageValue( + final _i1.StorageValue _queueSuspended = const _i1.StorageValue( prefix: 'XcmpQueue', - storage: 'CounterForOverweight', - valueCodec: _i3.U32Codec.codec, + storage: 'QueueSuspended', + valueCodec: _i4.BoolCodec.codec, ); - final _i1.StorageValue _overweightCount = const _i1.StorageValue( + final _i1.StorageMap<_i5.Id, _i7.FixedU128> _deliveryFeeFactor = const _i1.StorageMap<_i5.Id, _i7.FixedU128>( prefix: 'XcmpQueue', - storage: 'OverweightCount', - valueCodec: _i3.U64Codec.codec, + storage: 'DeliveryFeeFactor', + valueCodec: _i7.FixedU128Codec(), + hasher: _i1.StorageHasher.twoxx64Concat(_i5.IdCodec()), ); - final _i1.StorageValue _queueSuspended = const _i1.StorageValue( - prefix: 'XcmpQueue', - storage: 'QueueSuspended', - valueCodec: _i3.BoolCodec.codec, - ); - - /// Status of the inbound XCMP channels. - _i8.Future> inboundXcmpStatus({_i1.BlockHash? at}) async { - final hashedKey = _inboundXcmpStatus.hashedKey(); + /// The suspended inbound XCMP channels. All others are not suspended. + /// + /// This is a `StorageValue` instead of a `StorageMap` since we expect multiple reads per block + /// to different keys with a one byte payload. The access to `BoundedBTreeSet` will be cached + /// within the block and therefore only included once in the proof size. + /// + /// NOTE: The PoV benchmarking cannot know this and will over-estimate, but the actual proof + /// will be smaller. + _i8.Future<_i2.BoundedBTreeSet> inboundXcmpSuspended({_i1.BlockHash? at}) async { + final hashedKey = _inboundXcmpSuspended.hashedKey(); final bytes = await __api.getStorage( hashedKey, at: at, ); if (bytes != null) { - return _inboundXcmpStatus.decodeValue(bytes); + return _inboundXcmpSuspended.decodeValue(bytes); } return []; /* Default */ } - /// Inbound aggregate XCMP messages. It can only be one per ParaId/block. - _i8.Future> inboundXcmpMessages( - _i4.Id key1, - int key2, { - _i1.BlockHash? at, - }) async { - final hashedKey = _inboundXcmpMessages.hashedKeyFor( - key1, - key2, - ); - final bytes = await __api.getStorage( - hashedKey, - at: at, - ); - if (bytes != null) { - return _inboundXcmpMessages.decodeValue(bytes); - } - return List.filled( - 0, - 0, - growable: true, - ); /* Default */ - } - /// The non-empty XCMP channels in order of becoming non-empty, and the index of the first /// and last outbound message. If the two indices are equal, then it indicates an empty /// queue and there must be a non-`Ok` `OutboundStatus`. We assume queues grow no greater /// than 65535 items. Queue indices for normal messages begin at one; zero is reserved in /// case of the need to send a high-priority signal message this block. /// The bool is true if there is a signal message waiting to be sent. - _i8.Future> outboundXcmpStatus({_i1.BlockHash? at}) async { + _i8.Future> outboundXcmpStatus({_i1.BlockHash? at}) async { final hashedKey = _outboundXcmpStatus.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -151,7 +106,7 @@ class Queries { /// The messages outbound in a given XCMP channel. _i8.Future> outboundXcmpMessages( - _i4.Id key1, + _i5.Id key1, int key2, { _i1.BlockHash? at, }) async { @@ -175,7 +130,7 @@ class Queries { /// Any signal messages waiting to be sent. _i8.Future> signalMessages( - _i4.Id key1, { + _i5.Id key1, { _i1.BlockHash? at, }) async { final hashedKey = _signalMessages.hashedKeyFor(key1); @@ -204,110 +159,59 @@ class Queries { return _queueConfig.decodeValue(bytes); } return _i6.QueueConfigData( - suspendThreshold: 2, - dropThreshold: 5, - resumeThreshold: 1, - thresholdWeight: _i9.Weight( - refTime: BigInt.from(100000), - proofSize: BigInt.zero, - ), - weightRestrictDecay: _i9.Weight( - refTime: BigInt.two, - proofSize: BigInt.zero, - ), - xcmpMaxIndividualWeight: _i9.Weight( - refTime: BigInt.from(20000000000), - proofSize: BigInt.from(65536), - ), + suspendThreshold: 32, + dropThreshold: 48, + resumeThreshold: 8, ); /* Default */ } - /// The messages that exceeded max individual message weight budget. - /// - /// These message stay in this storage map until they are manually dispatched via - /// `service_overweight`. - _i8.Future<_i7.Tuple3<_i4.Id, int, List>?> overweight( - BigInt key1, { - _i1.BlockHash? at, - }) async { - final hashedKey = _overweight.hashedKeyFor(key1); - final bytes = await __api.getStorage( - hashedKey, - at: at, - ); - if (bytes != null) { - return _overweight.decodeValue(bytes); - } - return null; /* Nullable */ - } - - /// Counter for the related counted storage map - _i8.Future counterForOverweight({_i1.BlockHash? at}) async { - final hashedKey = _counterForOverweight.hashedKey(); - final bytes = await __api.getStorage( - hashedKey, - at: at, - ); - if (bytes != null) { - return _counterForOverweight.decodeValue(bytes); - } - return 0; /* Default */ - } - - /// The number of overweight messages ever recorded in `Overweight`. Also doubles as the next - /// available free overweight index. - _i8.Future overweightCount({_i1.BlockHash? at}) async { - final hashedKey = _overweightCount.hashedKey(); + /// Whether or not the XCMP queue is suspended from executing incoming XCMs or not. + _i8.Future queueSuspended({_i1.BlockHash? at}) async { + final hashedKey = _queueSuspended.hashedKey(); final bytes = await __api.getStorage( hashedKey, at: at, ); if (bytes != null) { - return _overweightCount.decodeValue(bytes); + return _queueSuspended.decodeValue(bytes); } - return BigInt.zero; /* Default */ + return false; /* Default */ } - /// Whether or not the XCMP queue is suspended from executing incoming XCMs or not. - _i8.Future queueSuspended({_i1.BlockHash? at}) async { - final hashedKey = _queueSuspended.hashedKey(); + /// The factor to multiply the base delivery fee by. + _i8.Future<_i7.FixedU128> deliveryFeeFactor( + _i5.Id key1, { + _i1.BlockHash? at, + }) async { + final hashedKey = _deliveryFeeFactor.hashedKeyFor(key1); final bytes = await __api.getStorage( hashedKey, at: at, ); if (bytes != null) { - return _queueSuspended.decodeValue(bytes); + return _deliveryFeeFactor.decodeValue(bytes); } - return false; /* Default */ - } - - /// Returns the storage key for `inboundXcmpStatus`. - _i10.Uint8List inboundXcmpStatusKey() { - final hashedKey = _inboundXcmpStatus.hashedKey(); - return hashedKey; + return BigInt.parse( + '1000000000000000000', + radix: 10, + ); /* Default */ } - /// Returns the storage key for `inboundXcmpMessages`. - _i10.Uint8List inboundXcmpMessagesKey( - _i4.Id key1, - int key2, - ) { - final hashedKey = _inboundXcmpMessages.hashedKeyFor( - key1, - key2, - ); + /// Returns the storage key for `inboundXcmpSuspended`. + _i9.Uint8List inboundXcmpSuspendedKey() { + final hashedKey = _inboundXcmpSuspended.hashedKey(); return hashedKey; } /// Returns the storage key for `outboundXcmpStatus`. - _i10.Uint8List outboundXcmpStatusKey() { + _i9.Uint8List outboundXcmpStatusKey() { final hashedKey = _outboundXcmpStatus.hashedKey(); return hashedKey; } /// Returns the storage key for `outboundXcmpMessages`. - _i10.Uint8List outboundXcmpMessagesKey( - _i4.Id key1, + _i9.Uint8List outboundXcmpMessagesKey( + _i5.Id key1, int key2, ) { final hashedKey = _outboundXcmpMessages.hashedKeyFor( @@ -318,62 +222,44 @@ class Queries { } /// Returns the storage key for `signalMessages`. - _i10.Uint8List signalMessagesKey(_i4.Id key1) { + _i9.Uint8List signalMessagesKey(_i5.Id key1) { final hashedKey = _signalMessages.hashedKeyFor(key1); return hashedKey; } /// Returns the storage key for `queueConfig`. - _i10.Uint8List queueConfigKey() { + _i9.Uint8List queueConfigKey() { final hashedKey = _queueConfig.hashedKey(); return hashedKey; } - /// Returns the storage key for `overweight`. - _i10.Uint8List overweightKey(BigInt key1) { - final hashedKey = _overweight.hashedKeyFor(key1); - return hashedKey; - } - - /// Returns the storage key for `counterForOverweight`. - _i10.Uint8List counterForOverweightKey() { - final hashedKey = _counterForOverweight.hashedKey(); - return hashedKey; - } - - /// Returns the storage key for `overweightCount`. - _i10.Uint8List overweightCountKey() { - final hashedKey = _overweightCount.hashedKey(); - return hashedKey; - } - /// Returns the storage key for `queueSuspended`. - _i10.Uint8List queueSuspendedKey() { + _i9.Uint8List queueSuspendedKey() { final hashedKey = _queueSuspended.hashedKey(); return hashedKey; } - /// Returns the storage map key prefix for `inboundXcmpMessages`. - _i10.Uint8List inboundXcmpMessagesMapPrefix(_i4.Id key1) { - final hashedKey = _inboundXcmpMessages.mapPrefix(key1); + /// Returns the storage key for `deliveryFeeFactor`. + _i9.Uint8List deliveryFeeFactorKey(_i5.Id key1) { + final hashedKey = _deliveryFeeFactor.hashedKeyFor(key1); return hashedKey; } /// Returns the storage map key prefix for `outboundXcmpMessages`. - _i10.Uint8List outboundXcmpMessagesMapPrefix(_i4.Id key1) { + _i9.Uint8List outboundXcmpMessagesMapPrefix(_i5.Id key1) { final hashedKey = _outboundXcmpMessages.mapPrefix(key1); return hashedKey; } /// Returns the storage map key prefix for `signalMessages`. - _i10.Uint8List signalMessagesMapPrefix() { + _i9.Uint8List signalMessagesMapPrefix() { final hashedKey = _signalMessages.mapPrefix(); return hashedKey; } - /// Returns the storage map key prefix for `overweight`. - _i10.Uint8List overweightMapPrefix() { - final hashedKey = _overweight.mapPrefix(); + /// Returns the storage map key prefix for `deliveryFeeFactor`. + _i9.Uint8List deliveryFeeFactorMapPrefix() { + final hashedKey = _deliveryFeeFactor.mapPrefix(); return hashedKey; } } @@ -381,63 +267,44 @@ class Queries { class Txs { const Txs(); - /// See [`Pallet::service_overweight`]. - _i11.RuntimeCall serviceOverweight({ - required BigInt index, - required _i9.Weight weightLimit, - }) { - final _call = _i12.Call.values.serviceOverweight( - index: index, - weightLimit: weightLimit, - ); - return _i11.RuntimeCall.values.xcmpQueue(_call); - } - /// See [`Pallet::suspend_xcm_execution`]. - _i11.RuntimeCall suspendXcmExecution() { - final _call = _i12.Call.values.suspendXcmExecution(); - return _i11.RuntimeCall.values.xcmpQueue(_call); + _i10.RuntimeCall suspendXcmExecution() { + final _call = _i11.Call.values.suspendXcmExecution(); + return _i10.RuntimeCall.values.xcmpQueue(_call); } /// See [`Pallet::resume_xcm_execution`]. - _i11.RuntimeCall resumeXcmExecution() { - final _call = _i12.Call.values.resumeXcmExecution(); - return _i11.RuntimeCall.values.xcmpQueue(_call); + _i10.RuntimeCall resumeXcmExecution() { + final _call = _i11.Call.values.resumeXcmExecution(); + return _i10.RuntimeCall.values.xcmpQueue(_call); } /// See [`Pallet::update_suspend_threshold`]. - _i11.RuntimeCall updateSuspendThreshold({required int new_}) { - final _call = _i12.Call.values.updateSuspendThreshold(new_: new_); - return _i11.RuntimeCall.values.xcmpQueue(_call); + _i10.RuntimeCall updateSuspendThreshold({required int new_}) { + final _call = _i11.Call.values.updateSuspendThreshold(new_: new_); + return _i10.RuntimeCall.values.xcmpQueue(_call); } /// See [`Pallet::update_drop_threshold`]. - _i11.RuntimeCall updateDropThreshold({required int new_}) { - final _call = _i12.Call.values.updateDropThreshold(new_: new_); - return _i11.RuntimeCall.values.xcmpQueue(_call); + _i10.RuntimeCall updateDropThreshold({required int new_}) { + final _call = _i11.Call.values.updateDropThreshold(new_: new_); + return _i10.RuntimeCall.values.xcmpQueue(_call); } /// See [`Pallet::update_resume_threshold`]. - _i11.RuntimeCall updateResumeThreshold({required int new_}) { - final _call = _i12.Call.values.updateResumeThreshold(new_: new_); - return _i11.RuntimeCall.values.xcmpQueue(_call); - } - - /// See [`Pallet::update_threshold_weight`]. - _i11.RuntimeCall updateThresholdWeight({required _i9.Weight new_}) { - final _call = _i12.Call.values.updateThresholdWeight(new_: new_); - return _i11.RuntimeCall.values.xcmpQueue(_call); + _i10.RuntimeCall updateResumeThreshold({required int new_}) { + final _call = _i11.Call.values.updateResumeThreshold(new_: new_); + return _i10.RuntimeCall.values.xcmpQueue(_call); } +} - /// See [`Pallet::update_weight_restrict_decay`]. - _i11.RuntimeCall updateWeightRestrictDecay({required _i9.Weight new_}) { - final _call = _i12.Call.values.updateWeightRestrictDecay(new_: new_); - return _i11.RuntimeCall.values.xcmpQueue(_call); - } +class Constants { + Constants(); - /// See [`Pallet::update_xcmp_max_individual_weight`]. - _i11.RuntimeCall updateXcmpMaxIndividualWeight({required _i9.Weight new_}) { - final _call = _i12.Call.values.updateXcmpMaxIndividualWeight(new_: new_); - return _i11.RuntimeCall.values.xcmpQueue(_call); - } + /// The maximum number of inbound XCMP channels that can be suspended simultaneously. + /// + /// Any further channel suspensions will fail and messages may get dropped without further + /// notice. Choosing a high value (1000) is okay; the trade-off that is described in + /// [`InboundXcmpSuspended`] still applies at that scale. + final int maxInboundSuspended = 1000; } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/b_tree_set_1.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/b_tree_set_1.dart new file mode 100644 index 000000000..3b707cce4 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/b_tree_set_1.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef BTreeSet = List>; + +class BTreeSetCodec with _i1.Codec { + const BTreeSetCodec(); + + @override + BTreeSet decode(_i1.Input input) { + return const _i1.SequenceCodec>(_i1.U8SequenceCodec.codec).decode(input); + } + + @override + void encodeTo( + BTreeSet value, + _i1.Output output, + ) { + const _i1.SequenceCodec>(_i1.U8SequenceCodec.codec).encodeTo( + value, + output, + ); + } + + @override + int sizeHint(BTreeSet value) { + return const _i1.SequenceCodec>(_i1.U8SequenceCodec.codec).sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/b_tree_set_2.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/b_tree_set_2.dart new file mode 100644 index 000000000..dfe1db3ed --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/b_tree_set_2.dart @@ -0,0 +1,31 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i2; + +import 'polkadot_parachain_primitives/primitives/id.dart' as _i1; + +typedef BTreeSet = List<_i1.Id>; + +class BTreeSetCodec with _i2.Codec { + const BTreeSetCodec(); + + @override + BTreeSet decode(_i2.Input input) { + return const _i2.SequenceCodec<_i1.Id>(_i1.IdCodec()).decode(input); + } + + @override + void encodeTo( + BTreeSet value, + _i2.Output output, + ) { + const _i2.SequenceCodec<_i1.Id>(_i1.IdCodec()).encodeTo( + value, + output, + ); + } + + @override + int sizeHint(BTreeSet value) { + return const _i2.SequenceCodec<_i1.Id>(_i1.IdCodec()).sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/bounded_collections/bounded_btree_set/bounded_b_tree_set.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/bounded_collections/bounded_btree_set/bounded_b_tree_set.dart new file mode 100644 index 000000000..9ae4bec60 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/bounded_collections/bounded_btree_set/bounded_b_tree_set.dart @@ -0,0 +1,32 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i2; + +import '../../b_tree_set_2.dart' as _i1; +import '../../polkadot_parachain_primitives/primitives/id.dart' as _i3; + +typedef BoundedBTreeSet = _i1.BTreeSet; + +class BoundedBTreeSetCodec with _i2.Codec { + const BoundedBTreeSetCodec(); + + @override + BoundedBTreeSet decode(_i2.Input input) { + return const _i2.SequenceCodec<_i3.Id>(_i3.IdCodec()).decode(input); + } + + @override + void encodeTo( + BoundedBTreeSet value, + _i2.Output output, + ) { + const _i2.SequenceCodec<_i3.Id>(_i3.IdCodec()).encodeTo( + value, + output, + ); + } + + @override + int sizeHint(BoundedBTreeSet value) { + return const _i1.BTreeSetCodec().sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/call.dart index 0fb3d7212..2131386ac 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/call.dart @@ -1,61 +1,15 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:typed_data' as _i2; - import 'package:polkadart/scale_codec.dart' as _i1; -import '../../sp_weights/weight_v2/weight.dart' as _i3; - /// Contains a variant per dispatchable extrinsic that this pallet has. -abstract class Call { - const Call(); - - factory Call.decode(_i1.Input input) { - return codec.decode(input); - } - - static const $CallCodec codec = $CallCodec(); - - static const $Call values = $Call(); +typedef Call = dynamic; - _i2.Uint8List encode() { - final output = _i1.ByteOutput(codec.sizeHint(this)); - codec.encodeTo(this, output); - return output.toBytes(); - } - - int sizeHint() { - return codec.sizeHint(this); - } - - Map> toJson(); -} - -class $Call { - const $Call(); - - ServiceOverweight serviceOverweight({ - required BigInt index, - required _i3.Weight weightLimit, - }) { - return ServiceOverweight( - index: index, - weightLimit: weightLimit, - ); - } -} - -class $CallCodec with _i1.Codec { - const $CallCodec(); +class CallCodec with _i1.Codec { + const CallCodec(); @override Call decode(_i1.Input input) { - final index = _i1.U8Codec.codec.decode(input); - switch (index) { - case 0: - return ServiceOverweight._decode(input); - default: - throw Exception('Call: Invalid variant index: "$index"'); - } + return _i1.NullCodec.codec.decode(input); } @override @@ -63,87 +17,14 @@ class $CallCodec with _i1.Codec { Call value, _i1.Output output, ) { - switch (value.runtimeType) { - case ServiceOverweight: - (value as ServiceOverweight).encodeTo(output); - break; - default: - throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); - } - } - - @override - int sizeHint(Call value) { - switch (value.runtimeType) { - case ServiceOverweight: - return (value as ServiceOverweight)._sizeHint(); - default: - throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); - } - } -} - -/// See [`Pallet::service_overweight`]. -class ServiceOverweight extends Call { - const ServiceOverweight({ - required this.index, - required this.weightLimit, - }); - - factory ServiceOverweight._decode(_i1.Input input) { - return ServiceOverweight( - index: _i1.U64Codec.codec.decode(input), - weightLimit: _i3.Weight.codec.decode(input), - ); - } - - /// OverweightIndex - final BigInt index; - - /// Weight - final _i3.Weight weightLimit; - - @override - Map> toJson() => { - 'service_overweight': { - 'index': index, - 'weightLimit': weightLimit.toJson(), - } - }; - - int _sizeHint() { - int size = 1; - size = size + _i1.U64Codec.codec.sizeHint(index); - size = size + _i3.Weight.codec.sizeHint(weightLimit); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 0, - output, - ); - _i1.U64Codec.codec.encodeTo( - index, - output, - ); - _i3.Weight.codec.encodeTo( - weightLimit, + _i1.NullCodec.codec.encodeTo( + value, output, ); } @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is ServiceOverweight && other.index == index && other.weightLimit == weightLimit; - - @override - int get hashCode => Object.hash( - index, - weightLimit, - ); + int sizeHint(Call value) { + return _i1.NullCodec.codec.sizeHint(value); + } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/event.dart index f65700611..c76cd4c14 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/event.dart @@ -2,10 +2,6 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import 'package:quiver/collection.dart' as _i5; - -import '../../sp_weights/weight_v2/weight.dart' as _i4; -import '../../xcm/v3/traits/outcome.dart' as _i3; /// The `Event` enum of this pallet abstract class Event { @@ -29,72 +25,54 @@ abstract class Event { return codec.sizeHint(this); } - Map> toJson(); + Map toJson(); } class $Event { const $Event(); - InvalidFormat invalidFormat({required List messageHash}) { - return InvalidFormat(messageHash: messageHash); + StartedExport startedExport() { + return StartedExport(); } - UnsupportedVersion unsupportedVersion({required List messageHash}) { - return UnsupportedVersion(messageHash: messageHash); + Exported exported({required int page}) { + return Exported(page: page); } - ExecutedDownward executedDownward({ - required List messageHash, - required List messageId, - required _i3.Outcome outcome, - }) { - return ExecutedDownward( - messageHash: messageHash, - messageId: messageId, - outcome: outcome, - ); + ExportFailed exportFailed({required int page}) { + return ExportFailed(page: page); } - WeightExhausted weightExhausted({ - required List messageHash, - required List messageId, - required _i4.Weight remainingWeight, - required _i4.Weight requiredWeight, - }) { - return WeightExhausted( - messageHash: messageHash, - messageId: messageId, - remainingWeight: remainingWeight, - requiredWeight: requiredWeight, - ); + CompletedExport completedExport() { + return CompletedExport(); } - OverweightEnqueued overweightEnqueued({ - required List messageHash, - required List messageId, - required BigInt overweightIndex, - required _i4.Weight requiredWeight, - }) { - return OverweightEnqueued( - messageHash: messageHash, - messageId: messageId, - overweightIndex: overweightIndex, - requiredWeight: requiredWeight, - ); + StartedOverweightExport startedOverweightExport() { + return StartedOverweightExport(); } - OverweightServiced overweightServiced({ - required BigInt overweightIndex, - required _i4.Weight weightUsed, - }) { - return OverweightServiced( - overweightIndex: overweightIndex, - weightUsed: weightUsed, - ); + ExportedOverweight exportedOverweight({required BigInt index}) { + return ExportedOverweight(index: index); + } + + ExportOverweightFailed exportOverweightFailed({required BigInt index}) { + return ExportOverweightFailed(index: index); + } + + CompletedOverweightExport completedOverweightExport() { + return CompletedOverweightExport(); } - MaxMessagesExhausted maxMessagesExhausted({required List messageHash}) { - return MaxMessagesExhausted(messageHash: messageHash); + StartedCleanup startedCleanup() { + return StartedCleanup(); + } + + CleanedSome cleanedSome({required int keysRemoved}) { + return CleanedSome(keysRemoved: keysRemoved); + } + + Completed completed({required bool error}) { + return Completed(error: error); } } @@ -106,19 +84,27 @@ class $EventCodec with _i1.Codec { final index = _i1.U8Codec.codec.decode(input); switch (index) { case 0: - return InvalidFormat._decode(input); + return const StartedExport(); case 1: - return UnsupportedVersion._decode(input); + return Exported._decode(input); case 2: - return ExecutedDownward._decode(input); + return ExportFailed._decode(input); case 3: - return WeightExhausted._decode(input); + return const CompletedExport(); case 4: - return OverweightEnqueued._decode(input); + return const StartedOverweightExport(); case 5: - return OverweightServiced._decode(input); + return ExportedOverweight._decode(input); case 6: - return MaxMessagesExhausted._decode(input); + return ExportOverweightFailed._decode(input); + case 7: + return const CompletedOverweightExport(); + case 8: + return const StartedCleanup(); + case 9: + return CleanedSome._decode(input); + case 10: + return Completed._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); } @@ -130,26 +116,38 @@ class $EventCodec with _i1.Codec { _i1.Output output, ) { switch (value.runtimeType) { - case InvalidFormat: - (value as InvalidFormat).encodeTo(output); + case StartedExport: + (value as StartedExport).encodeTo(output); + break; + case Exported: + (value as Exported).encodeTo(output); + break; + case ExportFailed: + (value as ExportFailed).encodeTo(output); + break; + case CompletedExport: + (value as CompletedExport).encodeTo(output); + break; + case StartedOverweightExport: + (value as StartedOverweightExport).encodeTo(output); break; - case UnsupportedVersion: - (value as UnsupportedVersion).encodeTo(output); + case ExportedOverweight: + (value as ExportedOverweight).encodeTo(output); break; - case ExecutedDownward: - (value as ExecutedDownward).encodeTo(output); + case ExportOverweightFailed: + (value as ExportOverweightFailed).encodeTo(output); break; - case WeightExhausted: - (value as WeightExhausted).encodeTo(output); + case CompletedOverweightExport: + (value as CompletedOverweightExport).encodeTo(output); break; - case OverweightEnqueued: - (value as OverweightEnqueued).encodeTo(output); + case StartedCleanup: + (value as StartedCleanup).encodeTo(output); break; - case OverweightServiced: - (value as OverweightServiced).encodeTo(output); + case CleanedSome: + (value as CleanedSome).encodeTo(output); break; - case MaxMessagesExhausted: - (value as MaxMessagesExhausted).encodeTo(output); + case Completed: + (value as Completed).encodeTo(output); break; default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); @@ -159,94 +157,74 @@ class $EventCodec with _i1.Codec { @override int sizeHint(Event value) { switch (value.runtimeType) { - case InvalidFormat: - return (value as InvalidFormat)._sizeHint(); - case UnsupportedVersion: - return (value as UnsupportedVersion)._sizeHint(); - case ExecutedDownward: - return (value as ExecutedDownward)._sizeHint(); - case WeightExhausted: - return (value as WeightExhausted)._sizeHint(); - case OverweightEnqueued: - return (value as OverweightEnqueued)._sizeHint(); - case OverweightServiced: - return (value as OverweightServiced)._sizeHint(); - case MaxMessagesExhausted: - return (value as MaxMessagesExhausted)._sizeHint(); + case StartedExport: + return 1; + case Exported: + return (value as Exported)._sizeHint(); + case ExportFailed: + return (value as ExportFailed)._sizeHint(); + case CompletedExport: + return 1; + case StartedOverweightExport: + return 1; + case ExportedOverweight: + return (value as ExportedOverweight)._sizeHint(); + case ExportOverweightFailed: + return (value as ExportOverweightFailed)._sizeHint(); + case CompletedOverweightExport: + return 1; + case StartedCleanup: + return 1; + case CleanedSome: + return (value as CleanedSome)._sizeHint(); + case Completed: + return (value as Completed)._sizeHint(); default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } } } -/// Downward message is invalid XCM. -class InvalidFormat extends Event { - const InvalidFormat({required this.messageHash}); - - factory InvalidFormat._decode(_i1.Input input) { - return InvalidFormat(messageHash: const _i1.U8ArrayCodec(32).decode(input)); - } - - /// XcmHash - final List messageHash; +/// The export of pages started. +class StartedExport extends Event { + const StartedExport(); @override - Map>> toJson() => { - 'InvalidFormat': {'messageHash': messageHash.toList()} - }; - - int _sizeHint() { - int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); - return size; - } + Map toJson() => {'StartedExport': null}; void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( 0, output, ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, - output, - ); } @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is InvalidFormat && - _i5.listsEqual( - other.messageHash, - messageHash, - ); + bool operator ==(Object other) => other is StartedExport; @override - int get hashCode => messageHash.hashCode; + int get hashCode => runtimeType.hashCode; } -/// Downward message is unsupported version of XCM. -class UnsupportedVersion extends Event { - const UnsupportedVersion({required this.messageHash}); +/// The export of a page completed. +class Exported extends Event { + const Exported({required this.page}); - factory UnsupportedVersion._decode(_i1.Input input) { - return UnsupportedVersion(messageHash: const _i1.U8ArrayCodec(32).decode(input)); + factory Exported._decode(_i1.Input input) { + return Exported(page: _i1.U32Codec.codec.decode(input)); } - /// XcmHash - final List messageHash; + /// PageCounter + final int page; @override - Map>> toJson() => { - 'UnsupportedVersion': {'messageHash': messageHash.toList()} + Map> toJson() => { + 'Exported': {'page': page} }; int _sizeHint() { int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); + size = size + _i1.U32Codec.codec.sizeHint(page); return size; } @@ -255,8 +233,8 @@ class UnsupportedVersion extends Event { 1, output, ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, + _i1.U32Codec.codec.encodeTo( + page, output, ); } @@ -267,55 +245,33 @@ class UnsupportedVersion extends Event { this, other, ) || - other is UnsupportedVersion && - _i5.listsEqual( - other.messageHash, - messageHash, - ); + other is Exported && other.page == page; @override - int get hashCode => messageHash.hashCode; + int get hashCode => page.hashCode; } -/// Downward message executed with the given outcome. -class ExecutedDownward extends Event { - const ExecutedDownward({ - required this.messageHash, - required this.messageId, - required this.outcome, - }); - - factory ExecutedDownward._decode(_i1.Input input) { - return ExecutedDownward( - messageHash: const _i1.U8ArrayCodec(32).decode(input), - messageId: const _i1.U8ArrayCodec(32).decode(input), - outcome: _i3.Outcome.codec.decode(input), - ); - } +/// The export of a page failed. +/// +/// This should never be emitted. +class ExportFailed extends Event { + const ExportFailed({required this.page}); - /// XcmHash - final List messageHash; - - /// XcmHash - final List messageId; + factory ExportFailed._decode(_i1.Input input) { + return ExportFailed(page: _i1.U32Codec.codec.decode(input)); + } - /// Outcome - final _i3.Outcome outcome; + /// PageCounter + final int page; @override - Map> toJson() => { - 'ExecutedDownward': { - 'messageHash': messageHash.toList(), - 'messageId': messageId.toList(), - 'outcome': outcome.toJson(), - } + Map> toJson() => { + 'ExportFailed': {'page': page} }; int _sizeHint() { int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); - size = size + _i3.Outcome.codec.sizeHint(outcome); + size = size + _i1.U32Codec.codec.sizeHint(page); return size; } @@ -324,16 +280,8 @@ class ExecutedDownward extends Event { 2, output, ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageId, - output, - ); - _i3.Outcome.codec.encodeTo( - outcome, + _i1.U32Codec.codec.encodeTo( + page, output, ); } @@ -344,93 +292,83 @@ class ExecutedDownward extends Event { this, other, ) || - other is ExecutedDownward && - _i5.listsEqual( - other.messageHash, - messageHash, - ) && - _i5.listsEqual( - other.messageId, - messageId, - ) && - other.outcome == outcome; - - @override - int get hashCode => Object.hash( - messageHash, - messageId, - outcome, - ); + other is ExportFailed && other.page == page; + + @override + int get hashCode => page.hashCode; +} + +/// The export of pages completed. +class CompletedExport extends Event { + const CompletedExport(); + + @override + Map toJson() => {'CompletedExport': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + } + + @override + bool operator ==(Object other) => other is CompletedExport; + + @override + int get hashCode => runtimeType.hashCode; } -/// The weight limit for handling downward messages was reached. -class WeightExhausted extends Event { - const WeightExhausted({ - required this.messageHash, - required this.messageId, - required this.remainingWeight, - required this.requiredWeight, - }); - - factory WeightExhausted._decode(_i1.Input input) { - return WeightExhausted( - messageHash: const _i1.U8ArrayCodec(32).decode(input), - messageId: const _i1.U8ArrayCodec(32).decode(input), - remainingWeight: _i4.Weight.codec.decode(input), - requiredWeight: _i4.Weight.codec.decode(input), +/// The export of overweight messages started. +class StartedOverweightExport extends Event { + const StartedOverweightExport(); + + @override + Map toJson() => {'StartedOverweightExport': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, ); } - /// XcmHash - final List messageHash; + @override + bool operator ==(Object other) => other is StartedOverweightExport; - /// XcmHash - final List messageId; + @override + int get hashCode => runtimeType.hashCode; +} - /// Weight - final _i4.Weight remainingWeight; +/// The export of an overweight message completed. +class ExportedOverweight extends Event { + const ExportedOverweight({required this.index}); - /// Weight - final _i4.Weight requiredWeight; + factory ExportedOverweight._decode(_i1.Input input) { + return ExportedOverweight(index: _i1.U64Codec.codec.decode(input)); + } + + /// OverweightIndex + final BigInt index; @override - Map> toJson() => { - 'WeightExhausted': { - 'messageHash': messageHash.toList(), - 'messageId': messageId.toList(), - 'remainingWeight': remainingWeight.toJson(), - 'requiredWeight': requiredWeight.toJson(), - } + Map> toJson() => { + 'ExportedOverweight': {'index': index} }; int _sizeHint() { int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); - size = size + _i4.Weight.codec.sizeHint(remainingWeight); - size = size + _i4.Weight.codec.sizeHint(requiredWeight); + size = size + _i1.U64Codec.codec.sizeHint(index); return size; } void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 3, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageId, - output, - ); - _i4.Weight.codec.encodeTo( - remainingWeight, + 5, output, ); - _i4.Weight.codec.encodeTo( - requiredWeight, + _i1.U64Codec.codec.encodeTo( + index, output, ); } @@ -441,95 +379,43 @@ class WeightExhausted extends Event { this, other, ) || - other is WeightExhausted && - _i5.listsEqual( - other.messageHash, - messageHash, - ) && - _i5.listsEqual( - other.messageId, - messageId, - ) && - other.remainingWeight == remainingWeight && - other.requiredWeight == requiredWeight; - - @override - int get hashCode => Object.hash( - messageHash, - messageId, - remainingWeight, - requiredWeight, - ); -} + other is ExportedOverweight && other.index == index; -/// Downward message is overweight and was placed in the overweight queue. -class OverweightEnqueued extends Event { - const OverweightEnqueued({ - required this.messageHash, - required this.messageId, - required this.overweightIndex, - required this.requiredWeight, - }); - - factory OverweightEnqueued._decode(_i1.Input input) { - return OverweightEnqueued( - messageHash: const _i1.U8ArrayCodec(32).decode(input), - messageId: const _i1.U8ArrayCodec(32).decode(input), - overweightIndex: _i1.U64Codec.codec.decode(input), - requiredWeight: _i4.Weight.codec.decode(input), - ); - } + @override + int get hashCode => index.hashCode; +} - /// XcmHash - final List messageHash; +/// The export of an overweight message failed. +/// +/// This should never be emitted. +class ExportOverweightFailed extends Event { + const ExportOverweightFailed({required this.index}); - /// XcmHash - final List messageId; + factory ExportOverweightFailed._decode(_i1.Input input) { + return ExportOverweightFailed(index: _i1.U64Codec.codec.decode(input)); + } /// OverweightIndex - final BigInt overweightIndex; - - /// Weight - final _i4.Weight requiredWeight; + final BigInt index; @override - Map> toJson() => { - 'OverweightEnqueued': { - 'messageHash': messageHash.toList(), - 'messageId': messageId.toList(), - 'overweightIndex': overweightIndex, - 'requiredWeight': requiredWeight.toJson(), - } + Map> toJson() => { + 'ExportOverweightFailed': {'index': index} }; int _sizeHint() { int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); - size = size + _i1.U64Codec.codec.sizeHint(overweightIndex); - size = size + _i4.Weight.codec.sizeHint(requiredWeight); + size = size + _i1.U64Codec.codec.sizeHint(index); return size; } void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 4, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageId, + 6, output, ); _i1.U64Codec.codec.encodeTo( - overweightIndex, - output, - ); - _i4.Weight.codec.encodeTo( - requiredWeight, + index, output, ); } @@ -540,73 +426,83 @@ class OverweightEnqueued extends Event { this, other, ) || - other is OverweightEnqueued && - _i5.listsEqual( - other.messageHash, - messageHash, - ) && - _i5.listsEqual( - other.messageId, - messageId, - ) && - other.overweightIndex == overweightIndex && - other.requiredWeight == requiredWeight; - - @override - int get hashCode => Object.hash( - messageHash, - messageId, - overweightIndex, - requiredWeight, - ); + other is ExportOverweightFailed && other.index == index; + + @override + int get hashCode => index.hashCode; } -/// Downward message from the overweight queue was executed. -class OverweightServiced extends Event { - const OverweightServiced({ - required this.overweightIndex, - required this.weightUsed, - }); - - factory OverweightServiced._decode(_i1.Input input) { - return OverweightServiced( - overweightIndex: _i1.U64Codec.codec.decode(input), - weightUsed: _i4.Weight.codec.decode(input), +/// The export of overweight messages completed. +class CompletedOverweightExport extends Event { + const CompletedOverweightExport(); + + @override + Map toJson() => {'CompletedOverweightExport': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, ); } - /// OverweightIndex - final BigInt overweightIndex; + @override + bool operator ==(Object other) => other is CompletedOverweightExport; + + @override + int get hashCode => runtimeType.hashCode; +} + +/// The cleanup of remaining pallet storage started. +class StartedCleanup extends Event { + const StartedCleanup(); + + @override + Map toJson() => {'StartedCleanup': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 8, + output, + ); + } + + @override + bool operator ==(Object other) => other is StartedCleanup; + + @override + int get hashCode => runtimeType.hashCode; +} - /// Weight - final _i4.Weight weightUsed; +/// Some debris was cleaned up. +class CleanedSome extends Event { + const CleanedSome({required this.keysRemoved}); + + factory CleanedSome._decode(_i1.Input input) { + return CleanedSome(keysRemoved: _i1.U32Codec.codec.decode(input)); + } + + /// u32 + final int keysRemoved; @override - Map> toJson() => { - 'OverweightServiced': { - 'overweightIndex': overweightIndex, - 'weightUsed': weightUsed.toJson(), - } + Map> toJson() => { + 'CleanedSome': {'keysRemoved': keysRemoved} }; int _sizeHint() { int size = 1; - size = size + _i1.U64Codec.codec.sizeHint(overweightIndex); - size = size + _i4.Weight.codec.sizeHint(weightUsed); + size = size + _i1.U32Codec.codec.sizeHint(keysRemoved); return size; } void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 5, + 9, output, ); - _i1.U64Codec.codec.encodeTo( - overweightIndex, - output, - ); - _i4.Weight.codec.encodeTo( - weightUsed, + _i1.U32Codec.codec.encodeTo( + keysRemoved, output, ); } @@ -617,44 +513,41 @@ class OverweightServiced extends Event { this, other, ) || - other is OverweightServiced && other.overweightIndex == overweightIndex && other.weightUsed == weightUsed; + other is CleanedSome && other.keysRemoved == keysRemoved; @override - int get hashCode => Object.hash( - overweightIndex, - weightUsed, - ); + int get hashCode => keysRemoved.hashCode; } -/// The maximum number of downward messages was reached. -class MaxMessagesExhausted extends Event { - const MaxMessagesExhausted({required this.messageHash}); +/// The cleanup of remaining pallet storage completed. +class Completed extends Event { + const Completed({required this.error}); - factory MaxMessagesExhausted._decode(_i1.Input input) { - return MaxMessagesExhausted(messageHash: const _i1.U8ArrayCodec(32).decode(input)); + factory Completed._decode(_i1.Input input) { + return Completed(error: _i1.BoolCodec.codec.decode(input)); } - /// XcmHash - final List messageHash; + /// bool + final bool error; @override - Map>> toJson() => { - 'MaxMessagesExhausted': {'messageHash': messageHash.toList()} + Map> toJson() => { + 'Completed': {'error': error} }; int _sizeHint() { int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); + size = size + _i1.BoolCodec.codec.sizeHint(error); return size; } void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 6, + 10, output, ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, + _i1.BoolCodec.codec.encodeTo( + error, output, ); } @@ -665,12 +558,8 @@ class MaxMessagesExhausted extends Event { this, other, ) || - other is MaxMessagesExhausted && - _i5.listsEqual( - other.messageHash, - messageHash, - ); + other is Completed && other.error == error; @override - int get hashCode => messageHash.hashCode; + int get hashCode => error.hashCode; } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/migration_state.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/migration_state.dart new file mode 100644 index 000000000..7af3efc80 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_dmp_queue/pallet/migration_state.dart @@ -0,0 +1,353 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +abstract class MigrationState { + const MigrationState(); + + factory MigrationState.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $MigrationStateCodec codec = $MigrationStateCodec(); + + static const $MigrationState values = $MigrationState(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $MigrationState { + const $MigrationState(); + + NotStarted notStarted() { + return NotStarted(); + } + + StartedExport startedExport({required int nextBeginUsed}) { + return StartedExport(nextBeginUsed: nextBeginUsed); + } + + CompletedExport completedExport() { + return CompletedExport(); + } + + StartedOverweightExport startedOverweightExport({required BigInt nextOverweightIndex}) { + return StartedOverweightExport(nextOverweightIndex: nextOverweightIndex); + } + + CompletedOverweightExport completedOverweightExport() { + return CompletedOverweightExport(); + } + + StartedCleanup startedCleanup({List? cursor}) { + return StartedCleanup(cursor: cursor); + } + + Completed completed() { + return Completed(); + } +} + +class $MigrationStateCodec with _i1.Codec { + const $MigrationStateCodec(); + + @override + MigrationState decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return const NotStarted(); + case 1: + return StartedExport._decode(input); + case 2: + return const CompletedExport(); + case 3: + return StartedOverweightExport._decode(input); + case 4: + return const CompletedOverweightExport(); + case 5: + return StartedCleanup._decode(input); + case 6: + return const Completed(); + default: + throw Exception('MigrationState: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + MigrationState value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case NotStarted: + (value as NotStarted).encodeTo(output); + break; + case StartedExport: + (value as StartedExport).encodeTo(output); + break; + case CompletedExport: + (value as CompletedExport).encodeTo(output); + break; + case StartedOverweightExport: + (value as StartedOverweightExport).encodeTo(output); + break; + case CompletedOverweightExport: + (value as CompletedOverweightExport).encodeTo(output); + break; + case StartedCleanup: + (value as StartedCleanup).encodeTo(output); + break; + case Completed: + (value as Completed).encodeTo(output); + break; + default: + throw Exception('MigrationState: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(MigrationState value) { + switch (value.runtimeType) { + case NotStarted: + return 1; + case StartedExport: + return (value as StartedExport)._sizeHint(); + case CompletedExport: + return 1; + case StartedOverweightExport: + return (value as StartedOverweightExport)._sizeHint(); + case CompletedOverweightExport: + return 1; + case StartedCleanup: + return (value as StartedCleanup)._sizeHint(); + case Completed: + return 1; + default: + throw Exception('MigrationState: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class NotStarted extends MigrationState { + const NotStarted(); + + @override + Map toJson() => {'NotStarted': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is NotStarted; + + @override + int get hashCode => runtimeType.hashCode; +} + +class StartedExport extends MigrationState { + const StartedExport({required this.nextBeginUsed}); + + factory StartedExport._decode(_i1.Input input) { + return StartedExport(nextBeginUsed: _i1.U32Codec.codec.decode(input)); + } + + /// PageCounter + final int nextBeginUsed; + + @override + Map> toJson() => { + 'StartedExport': {'nextBeginUsed': nextBeginUsed} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(nextBeginUsed); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i1.U32Codec.codec.encodeTo( + nextBeginUsed, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is StartedExport && other.nextBeginUsed == nextBeginUsed; + + @override + int get hashCode => nextBeginUsed.hashCode; +} + +class CompletedExport extends MigrationState { + const CompletedExport(); + + @override + Map toJson() => {'CompletedExport': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + } + + @override + bool operator ==(Object other) => other is CompletedExport; + + @override + int get hashCode => runtimeType.hashCode; +} + +class StartedOverweightExport extends MigrationState { + const StartedOverweightExport({required this.nextOverweightIndex}); + + factory StartedOverweightExport._decode(_i1.Input input) { + return StartedOverweightExport(nextOverweightIndex: _i1.U64Codec.codec.decode(input)); + } + + /// u64 + final BigInt nextOverweightIndex; + + @override + Map> toJson() => { + 'StartedOverweightExport': {'nextOverweightIndex': nextOverweightIndex} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U64Codec.codec.sizeHint(nextOverweightIndex); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + _i1.U64Codec.codec.encodeTo( + nextOverweightIndex, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is StartedOverweightExport && other.nextOverweightIndex == nextOverweightIndex; + + @override + int get hashCode => nextOverweightIndex.hashCode; +} + +class CompletedOverweightExport extends MigrationState { + const CompletedOverweightExport(); + + @override + Map toJson() => {'CompletedOverweightExport': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + } + + @override + bool operator ==(Object other) => other is CompletedOverweightExport; + + @override + int get hashCode => runtimeType.hashCode; +} + +class StartedCleanup extends MigrationState { + const StartedCleanup({this.cursor}); + + factory StartedCleanup._decode(_i1.Input input) { + return StartedCleanup(cursor: const _i1.OptionCodec>(_i1.U8SequenceCodec.codec).decode(input)); + } + + /// Option>> + final List? cursor; + + @override + Map?>> toJson() => { + 'StartedCleanup': {'cursor': cursor} + }; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec>(_i1.U8SequenceCodec.codec).sizeHint(cursor); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + const _i1.OptionCodec>(_i1.U8SequenceCodec.codec).encodeTo( + cursor, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is StartedCleanup && other.cursor == cursor; + + @override + int get hashCode => cursor.hashCode; +} + +class Completed extends MigrationState { + const Completed(); + + @override + Map toJson() => {'Completed': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + } + + @override + bool operator ==(Object other) => other is Completed; + + @override + int get hashCode => runtimeType.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/pallet/event.dart index e1de58708..4a8b36821 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/pallet/event.dart @@ -4,8 +4,8 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i5; -import '../../primitive_types/h256.dart' as _i3; -import '../../sp_weights/weight_v2/weight.dart' as _i4; +import '../../primitive_types/h256.dart' as _i4; +import '../../sp_weights/weight_v2/weight.dart' as _i3; /// The `Event` enum of this pallet abstract class Event { @@ -47,17 +47,13 @@ class $Event { return ValidationFunctionDiscarded(); } - UpgradeAuthorized upgradeAuthorized({required _i3.H256 codeHash}) { - return UpgradeAuthorized(codeHash: codeHash); - } - DownwardMessagesReceived downwardMessagesReceived({required int count}) { return DownwardMessagesReceived(count: count); } DownwardMessagesProcessed downwardMessagesProcessed({ - required _i4.Weight weightUsed, - required _i3.H256 dmqHead, + required _i3.Weight weightUsed, + required _i4.H256 dmqHead, }) { return DownwardMessagesProcessed( weightUsed: weightUsed, @@ -84,12 +80,10 @@ class $EventCodec with _i1.Codec { case 2: return const ValidationFunctionDiscarded(); case 3: - return UpgradeAuthorized._decode(input); - case 4: return DownwardMessagesReceived._decode(input); - case 5: + case 4: return DownwardMessagesProcessed._decode(input); - case 6: + case 5: return UpwardMessageSent._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); @@ -111,9 +105,6 @@ class $EventCodec with _i1.Codec { case ValidationFunctionDiscarded: (value as ValidationFunctionDiscarded).encodeTo(output); break; - case UpgradeAuthorized: - (value as UpgradeAuthorized).encodeTo(output); - break; case DownwardMessagesReceived: (value as DownwardMessagesReceived).encodeTo(output); break; @@ -137,8 +128,6 @@ class $EventCodec with _i1.Codec { return (value as ValidationFunctionApplied)._sizeHint(); case ValidationFunctionDiscarded: return 1; - case UpgradeAuthorized: - return (value as UpgradeAuthorized)._sizeHint(); case DownwardMessagesReceived: return (value as DownwardMessagesReceived)._sizeHint(); case DownwardMessagesProcessed: @@ -238,55 +227,6 @@ class ValidationFunctionDiscarded extends Event { int get hashCode => runtimeType.hashCode; } -/// An upgrade has been authorized. -class UpgradeAuthorized extends Event { - const UpgradeAuthorized({required this.codeHash}); - - factory UpgradeAuthorized._decode(_i1.Input input) { - return UpgradeAuthorized(codeHash: const _i1.U8ArrayCodec(32).decode(input)); - } - - /// T::Hash - final _i3.H256 codeHash; - - @override - Map>> toJson() => { - 'UpgradeAuthorized': {'codeHash': codeHash.toList()} - }; - - int _sizeHint() { - int size = 1; - size = size + const _i3.H256Codec().sizeHint(codeHash); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 3, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - codeHash, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is UpgradeAuthorized && - _i5.listsEqual( - other.codeHash, - codeHash, - ); - - @override - int get hashCode => codeHash.hashCode; -} - /// Some downward messages have been received and will be processed. class DownwardMessagesReceived extends Event { const DownwardMessagesReceived({required this.count}); @@ -311,7 +251,7 @@ class DownwardMessagesReceived extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 4, + 3, output, ); _i1.U32Codec.codec.encodeTo( @@ -341,16 +281,16 @@ class DownwardMessagesProcessed extends Event { factory DownwardMessagesProcessed._decode(_i1.Input input) { return DownwardMessagesProcessed( - weightUsed: _i4.Weight.codec.decode(input), + weightUsed: _i3.Weight.codec.decode(input), dmqHead: const _i1.U8ArrayCodec(32).decode(input), ); } /// Weight - final _i4.Weight weightUsed; + final _i3.Weight weightUsed; /// relay_chain::Hash - final _i3.H256 dmqHead; + final _i4.H256 dmqHead; @override Map> toJson() => { @@ -362,17 +302,17 @@ class DownwardMessagesProcessed extends Event { int _sizeHint() { int size = 1; - size = size + _i4.Weight.codec.sizeHint(weightUsed); - size = size + const _i3.H256Codec().sizeHint(dmqHead); + size = size + _i3.Weight.codec.sizeHint(weightUsed); + size = size + const _i4.H256Codec().sizeHint(dmqHead); return size; } void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 5, + 4, output, ); - _i4.Weight.codec.encodeTo( + _i3.Weight.codec.encodeTo( weightUsed, output, ); @@ -426,7 +366,7 @@ class UpwardMessageSent extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 6, + 5, output, ); const _i1.OptionCodec>(_i1.U8ArrayCodec(32)).encodeTo( diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/relay_state_snapshot/messaging_state_snapshot.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/relay_state_snapshot/messaging_state_snapshot.dart index 379611bc6..da8a0db85 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/relay_state_snapshot/messaging_state_snapshot.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/relay_state_snapshot/messaging_state_snapshot.dart @@ -4,16 +4,16 @@ import 'dart:typed_data' as _i7; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i8; -import '../../polkadot_parachain/primitives/id.dart' as _i5; -import '../../polkadot_primitives/v5/abridged_hrmp_channel.dart' as _i6; +import '../../polkadot_parachain_primitives/primitives/id.dart' as _i5; +import '../../polkadot_primitives/v6/abridged_hrmp_channel.dart' as _i6; import '../../primitive_types/h256.dart' as _i2; import '../../tuples.dart' as _i4; -import 'relay_dispach_queue_size.dart' as _i3; +import 'relay_dispatch_queue_remaining_capacity.dart' as _i3; class MessagingStateSnapshot { const MessagingStateSnapshot({ required this.dmqMqcHead, - required this.relayDispatchQueueSize, + required this.relayDispatchQueueRemainingCapacity, required this.ingressChannels, required this.egressChannels, }); @@ -25,8 +25,8 @@ class MessagingStateSnapshot { /// relay_chain::Hash final _i2.H256 dmqMqcHead; - /// RelayDispachQueueSize - final _i3.RelayDispachQueueSize relayDispatchQueueSize; + /// RelayDispatchQueueRemainingCapacity + final _i3.RelayDispatchQueueRemainingCapacity relayDispatchQueueRemainingCapacity; /// Vec<(ParaId, AbridgedHrmpChannel)> final List<_i4.Tuple2<_i5.Id, _i6.AbridgedHrmpChannel>> ingressChannels; @@ -42,7 +42,7 @@ class MessagingStateSnapshot { Map toJson() => { 'dmqMqcHead': dmqMqcHead.toList(), - 'relayDispatchQueueSize': relayDispatchQueueSize.toJson(), + 'relayDispatchQueueRemainingCapacity': relayDispatchQueueRemainingCapacity.toJson(), 'ingressChannels': ingressChannels .map((value) => [ value.value0, @@ -68,7 +68,7 @@ class MessagingStateSnapshot { other.dmqMqcHead, dmqMqcHead, ) && - other.relayDispatchQueueSize == relayDispatchQueueSize && + other.relayDispatchQueueRemainingCapacity == relayDispatchQueueRemainingCapacity && _i8.listsEqual( other.ingressChannels, ingressChannels, @@ -81,7 +81,7 @@ class MessagingStateSnapshot { @override int get hashCode => Object.hash( dmqMqcHead, - relayDispatchQueueSize, + relayDispatchQueueRemainingCapacity, ingressChannels, egressChannels, ); @@ -99,8 +99,8 @@ class $MessagingStateSnapshotCodec with _i1.Codec { obj.dmqMqcHead, output, ); - _i3.RelayDispachQueueSize.codec.encodeTo( - obj.relayDispatchQueueSize, + _i3.RelayDispatchQueueRemainingCapacity.codec.encodeTo( + obj.relayDispatchQueueRemainingCapacity, output, ); const _i1.SequenceCodec<_i4.Tuple2<_i5.Id, _i6.AbridgedHrmpChannel>>( @@ -125,7 +125,7 @@ class $MessagingStateSnapshotCodec with _i1.Codec { MessagingStateSnapshot decode(_i1.Input input) { return MessagingStateSnapshot( dmqMqcHead: const _i1.U8ArrayCodec(32).decode(input), - relayDispatchQueueSize: _i3.RelayDispachQueueSize.codec.decode(input), + relayDispatchQueueRemainingCapacity: _i3.RelayDispatchQueueRemainingCapacity.codec.decode(input), ingressChannels: const _i1.SequenceCodec<_i4.Tuple2<_i5.Id, _i6.AbridgedHrmpChannel>>( _i4.Tuple2Codec<_i5.Id, _i6.AbridgedHrmpChannel>( _i5.IdCodec(), @@ -143,7 +143,7 @@ class $MessagingStateSnapshotCodec with _i1.Codec { int sizeHint(MessagingStateSnapshot obj) { int size = 0; size = size + const _i2.H256Codec().sizeHint(obj.dmqMqcHead); - size = size + _i3.RelayDispachQueueSize.codec.sizeHint(obj.relayDispatchQueueSize); + size = size + _i3.RelayDispatchQueueRemainingCapacity.codec.sizeHint(obj.relayDispatchQueueRemainingCapacity); size = size + const _i1.SequenceCodec<_i4.Tuple2<_i5.Id, _i6.AbridgedHrmpChannel>>( _i4.Tuple2Codec<_i5.Id, _i6.AbridgedHrmpChannel>( diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/relay_state_snapshot/relay_dispatch_queue_remaining_capacity.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/relay_state_snapshot/relay_dispatch_queue_remaining_capacity.dart new file mode 100644 index 000000000..e09c2bb0e --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/relay_state_snapshot/relay_dispatch_queue_remaining_capacity.dart @@ -0,0 +1,83 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +class RelayDispatchQueueRemainingCapacity { + const RelayDispatchQueueRemainingCapacity({ + required this.remainingCount, + required this.remainingSize, + }); + + factory RelayDispatchQueueRemainingCapacity.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u32 + final int remainingCount; + + /// u32 + final int remainingSize; + + static const $RelayDispatchQueueRemainingCapacityCodec codec = $RelayDispatchQueueRemainingCapacityCodec(); + + _i2.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'remainingCount': remainingCount, + 'remainingSize': remainingSize, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is RelayDispatchQueueRemainingCapacity && + other.remainingCount == remainingCount && + other.remainingSize == remainingSize; + + @override + int get hashCode => Object.hash( + remainingCount, + remainingSize, + ); +} + +class $RelayDispatchQueueRemainingCapacityCodec with _i1.Codec { + const $RelayDispatchQueueRemainingCapacityCodec(); + + @override + void encodeTo( + RelayDispatchQueueRemainingCapacity obj, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + obj.remainingCount, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.remainingSize, + output, + ); + } + + @override + RelayDispatchQueueRemainingCapacity decode(_i1.Input input) { + return RelayDispatchQueueRemainingCapacity( + remainingCount: _i1.U32Codec.codec.decode(input), + remainingSize: _i1.U32Codec.codec.decode(input), + ); + } + + @override + int sizeHint(RelayDispatchQueueRemainingCapacity obj) { + int size = 0; + size = size + _i1.U32Codec.codec.sizeHint(obj.remainingCount); + size = size + _i1.U32Codec.codec.sizeHint(obj.remainingSize); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/ancestor.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/ancestor.dart new file mode 100644 index 000000000..6db5e8abd --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/ancestor.dart @@ -0,0 +1,101 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i5; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../../polkadot_primitives/v6/upgrade_go_ahead.dart' as _i4; +import '../../primitive_types/h256.dart' as _i3; +import 'used_bandwidth.dart' as _i2; + +class Ancestor { + const Ancestor({ + required this.usedBandwidth, + this.paraHeadHash, + this.consumedGoAheadSignal, + }); + + factory Ancestor.decode(_i1.Input input) { + return codec.decode(input); + } + + /// UsedBandwidth + final _i2.UsedBandwidth usedBandwidth; + + /// Option + final _i3.H256? paraHeadHash; + + /// Option + final _i4.UpgradeGoAhead? consumedGoAheadSignal; + + static const $AncestorCodec codec = $AncestorCodec(); + + _i5.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'usedBandwidth': usedBandwidth.toJson(), + 'paraHeadHash': paraHeadHash?.toList(), + 'consumedGoAheadSignal': consumedGoAheadSignal?.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Ancestor && + other.usedBandwidth == usedBandwidth && + other.paraHeadHash == paraHeadHash && + other.consumedGoAheadSignal == consumedGoAheadSignal; + + @override + int get hashCode => Object.hash( + usedBandwidth, + paraHeadHash, + consumedGoAheadSignal, + ); +} + +class $AncestorCodec with _i1.Codec { + const $AncestorCodec(); + + @override + void encodeTo( + Ancestor obj, + _i1.Output output, + ) { + _i2.UsedBandwidth.codec.encodeTo( + obj.usedBandwidth, + output, + ); + const _i1.OptionCodec<_i3.H256>(_i3.H256Codec()).encodeTo( + obj.paraHeadHash, + output, + ); + const _i1.OptionCodec<_i4.UpgradeGoAhead>(_i4.UpgradeGoAhead.codec).encodeTo( + obj.consumedGoAheadSignal, + output, + ); + } + + @override + Ancestor decode(_i1.Input input) { + return Ancestor( + usedBandwidth: _i2.UsedBandwidth.codec.decode(input), + paraHeadHash: const _i1.OptionCodec<_i3.H256>(_i3.H256Codec()).decode(input), + consumedGoAheadSignal: const _i1.OptionCodec<_i4.UpgradeGoAhead>(_i4.UpgradeGoAhead.codec).decode(input), + ); + } + + @override + int sizeHint(Ancestor obj) { + int size = 0; + size = size + _i2.UsedBandwidth.codec.sizeHint(obj.usedBandwidth); + size = size + const _i1.OptionCodec<_i3.H256>(_i3.H256Codec()).sizeHint(obj.paraHeadHash); + size = + size + const _i1.OptionCodec<_i4.UpgradeGoAhead>(_i4.UpgradeGoAhead.codec).sizeHint(obj.consumedGoAheadSignal); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/hrmp_channel_update.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/hrmp_channel_update.dart new file mode 100644 index 000000000..57f4b7d93 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/hrmp_channel_update.dart @@ -0,0 +1,81 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +class HrmpChannelUpdate { + const HrmpChannelUpdate({ + required this.msgCount, + required this.totalBytes, + }); + + factory HrmpChannelUpdate.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u32 + final int msgCount; + + /// u32 + final int totalBytes; + + static const $HrmpChannelUpdateCodec codec = $HrmpChannelUpdateCodec(); + + _i2.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'msgCount': msgCount, + 'totalBytes': totalBytes, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is HrmpChannelUpdate && other.msgCount == msgCount && other.totalBytes == totalBytes; + + @override + int get hashCode => Object.hash( + msgCount, + totalBytes, + ); +} + +class $HrmpChannelUpdateCodec with _i1.Codec { + const $HrmpChannelUpdateCodec(); + + @override + void encodeTo( + HrmpChannelUpdate obj, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + obj.msgCount, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.totalBytes, + output, + ); + } + + @override + HrmpChannelUpdate decode(_i1.Input input) { + return HrmpChannelUpdate( + msgCount: _i1.U32Codec.codec.decode(input), + totalBytes: _i1.U32Codec.codec.decode(input), + ); + } + + @override + int sizeHint(HrmpChannelUpdate obj) { + int size = 0; + size = size + _i1.U32Codec.codec.sizeHint(obj.msgCount); + size = size + _i1.U32Codec.codec.sizeHint(obj.totalBytes); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/segment_tracker.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/segment_tracker.dart new file mode 100644 index 000000000..2c47a098e --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/segment_tracker.dart @@ -0,0 +1,100 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../../polkadot_primitives/v6/upgrade_go_ahead.dart' as _i3; +import 'used_bandwidth.dart' as _i2; + +class SegmentTracker { + const SegmentTracker({ + required this.usedBandwidth, + this.hrmpWatermark, + this.consumedGoAheadSignal, + }); + + factory SegmentTracker.decode(_i1.Input input) { + return codec.decode(input); + } + + /// UsedBandwidth + final _i2.UsedBandwidth usedBandwidth; + + /// Option + final int? hrmpWatermark; + + /// Option + final _i3.UpgradeGoAhead? consumedGoAheadSignal; + + static const $SegmentTrackerCodec codec = $SegmentTrackerCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'usedBandwidth': usedBandwidth.toJson(), + 'hrmpWatermark': hrmpWatermark, + 'consumedGoAheadSignal': consumedGoAheadSignal?.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SegmentTracker && + other.usedBandwidth == usedBandwidth && + other.hrmpWatermark == hrmpWatermark && + other.consumedGoAheadSignal == consumedGoAheadSignal; + + @override + int get hashCode => Object.hash( + usedBandwidth, + hrmpWatermark, + consumedGoAheadSignal, + ); +} + +class $SegmentTrackerCodec with _i1.Codec { + const $SegmentTrackerCodec(); + + @override + void encodeTo( + SegmentTracker obj, + _i1.Output output, + ) { + _i2.UsedBandwidth.codec.encodeTo( + obj.usedBandwidth, + output, + ); + const _i1.OptionCodec(_i1.U32Codec.codec).encodeTo( + obj.hrmpWatermark, + output, + ); + const _i1.OptionCodec<_i3.UpgradeGoAhead>(_i3.UpgradeGoAhead.codec).encodeTo( + obj.consumedGoAheadSignal, + output, + ); + } + + @override + SegmentTracker decode(_i1.Input input) { + return SegmentTracker( + usedBandwidth: _i2.UsedBandwidth.codec.decode(input), + hrmpWatermark: const _i1.OptionCodec(_i1.U32Codec.codec).decode(input), + consumedGoAheadSignal: const _i1.OptionCodec<_i3.UpgradeGoAhead>(_i3.UpgradeGoAhead.codec).decode(input), + ); + } + + @override + int sizeHint(SegmentTracker obj) { + int size = 0; + size = size + _i2.UsedBandwidth.codec.sizeHint(obj.usedBandwidth); + size = size + const _i1.OptionCodec(_i1.U32Codec.codec).sizeHint(obj.hrmpWatermark); + size = + size + const _i1.OptionCodec<_i3.UpgradeGoAhead>(_i3.UpgradeGoAhead.codec).sizeHint(obj.consumedGoAheadSignal); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/used_bandwidth.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/used_bandwidth.dart new file mode 100644 index 000000000..3ccc43b39 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_parachain_system/unincluded_segment/used_bandwidth.dart @@ -0,0 +1,120 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i5; + +import '../../polkadot_parachain_primitives/primitives/id.dart' as _i2; +import 'hrmp_channel_update.dart' as _i3; + +class UsedBandwidth { + const UsedBandwidth({ + required this.umpMsgCount, + required this.umpTotalBytes, + required this.hrmpOutgoing, + }); + + factory UsedBandwidth.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u32 + final int umpMsgCount; + + /// u32 + final int umpTotalBytes; + + /// BTreeMap + final Map<_i2.Id, _i3.HrmpChannelUpdate> hrmpOutgoing; + + static const $UsedBandwidthCodec codec = $UsedBandwidthCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'umpMsgCount': umpMsgCount, + 'umpTotalBytes': umpTotalBytes, + 'hrmpOutgoing': hrmpOutgoing.map(( + key, + value, + ) => + MapEntry( + key, + value.toJson(), + )), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UsedBandwidth && + other.umpMsgCount == umpMsgCount && + other.umpTotalBytes == umpTotalBytes && + _i5.mapsEqual( + other.hrmpOutgoing, + hrmpOutgoing, + ); + + @override + int get hashCode => Object.hash( + umpMsgCount, + umpTotalBytes, + hrmpOutgoing, + ); +} + +class $UsedBandwidthCodec with _i1.Codec { + const $UsedBandwidthCodec(); + + @override + void encodeTo( + UsedBandwidth obj, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + obj.umpMsgCount, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.umpTotalBytes, + output, + ); + const _i1.BTreeMapCodec<_i2.Id, _i3.HrmpChannelUpdate>( + keyCodec: _i2.IdCodec(), + valueCodec: _i3.HrmpChannelUpdate.codec, + ).encodeTo( + obj.hrmpOutgoing, + output, + ); + } + + @override + UsedBandwidth decode(_i1.Input input) { + return UsedBandwidth( + umpMsgCount: _i1.U32Codec.codec.decode(input), + umpTotalBytes: _i1.U32Codec.codec.decode(input), + hrmpOutgoing: const _i1.BTreeMapCodec<_i2.Id, _i3.HrmpChannelUpdate>( + keyCodec: _i2.IdCodec(), + valueCodec: _i3.HrmpChannelUpdate.codec, + ).decode(input), + ); + } + + @override + int sizeHint(UsedBandwidth obj) { + int size = 0; + size = size + _i1.U32Codec.codec.sizeHint(obj.umpMsgCount); + size = size + _i1.U32Codec.codec.sizeHint(obj.umpTotalBytes); + size = size + + const _i1.BTreeMapCodec<_i2.Id, _i3.HrmpChannelUpdate>( + keyCodec: _i2.IdCodec(), + valueCodec: _i3.HrmpChannelUpdate.codec, + ).sizeHint(obj.hrmpOutgoing); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/call.dart new file mode 100644 index 000000000..2131386ac --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/call.dart @@ -0,0 +1,30 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +/// Contains a variant per dispatchable extrinsic that this pallet has. +typedef Call = dynamic; + +class CallCodec with _i1.Codec { + const CallCodec(); + + @override + Call decode(_i1.Input input) { + return _i1.NullCodec.codec.decode(input); + } + + @override + void encodeTo( + Call value, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(Call value) { + return _i1.NullCodec.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/event.dart index 7e79b8d97..1b55715bb 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/event.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i4; -import '../../xcm/v3/traits/outcome.dart' as _i3; +import '../../staging_xcm/v4/traits/outcome.dart' as _i3; /// The `Event` enum of this pallet abstract class Event { diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/origin.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/origin.dart index 257f82050..c217a1437 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/origin.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcm/pallet/origin.dart @@ -3,7 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import '../../polkadot_parachain/primitives/id.dart' as _i3; +import '../../polkadot_parachain_primitives/primitives/id.dart' as _i3; abstract class Origin { const Origin(); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/outbound_channel_details.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/outbound_channel_details.dart index 92ec05aa7..b14739d2d 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/outbound_channel_details.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/outbound_channel_details.dart @@ -3,7 +3,7 @@ import 'dart:typed_data' as _i4; import 'package:polkadart/scale_codec.dart' as _i1; -import '../polkadot_parachain/primitives/id.dart' as _i2; +import '../polkadot_parachain_primitives/primitives/id.dart' as _i2; import 'outbound_state.dart' as _i3; class OutboundChannelDetails { diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/call.dart index 153d6d50b..01d2d5610 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/call.dart @@ -3,8 +3,6 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import '../../sp_weights/weight_v2/weight.dart' as _i3; - /// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -33,16 +31,6 @@ abstract class Call { class $Call { const $Call(); - ServiceOverweight serviceOverweight({ - required BigInt index, - required _i3.Weight weightLimit, - }) { - return ServiceOverweight( - index: index, - weightLimit: weightLimit, - ); - } - SuspendXcmExecution suspendXcmExecution() { return SuspendXcmExecution(); } @@ -62,18 +50,6 @@ class $Call { UpdateResumeThreshold updateResumeThreshold({required int new_}) { return UpdateResumeThreshold(new_: new_); } - - UpdateThresholdWeight updateThresholdWeight({required _i3.Weight new_}) { - return UpdateThresholdWeight(new_: new_); - } - - UpdateWeightRestrictDecay updateWeightRestrictDecay({required _i3.Weight new_}) { - return UpdateWeightRestrictDecay(new_: new_); - } - - UpdateXcmpMaxIndividualWeight updateXcmpMaxIndividualWeight({required _i3.Weight new_}) { - return UpdateXcmpMaxIndividualWeight(new_: new_); - } } class $CallCodec with _i1.Codec { @@ -83,8 +59,6 @@ class $CallCodec with _i1.Codec { Call decode(_i1.Input input) { final index = _i1.U8Codec.codec.decode(input); switch (index) { - case 0: - return ServiceOverweight._decode(input); case 1: return const SuspendXcmExecution(); case 2: @@ -95,12 +69,6 @@ class $CallCodec with _i1.Codec { return UpdateDropThreshold._decode(input); case 5: return UpdateResumeThreshold._decode(input); - case 6: - return UpdateThresholdWeight._decode(input); - case 7: - return UpdateWeightRestrictDecay._decode(input); - case 8: - return UpdateXcmpMaxIndividualWeight._decode(input); default: throw Exception('Call: Invalid variant index: "$index"'); } @@ -112,9 +80,6 @@ class $CallCodec with _i1.Codec { _i1.Output output, ) { switch (value.runtimeType) { - case ServiceOverweight: - (value as ServiceOverweight).encodeTo(output); - break; case SuspendXcmExecution: (value as SuspendXcmExecution).encodeTo(output); break; @@ -130,15 +95,6 @@ class $CallCodec with _i1.Codec { case UpdateResumeThreshold: (value as UpdateResumeThreshold).encodeTo(output); break; - case UpdateThresholdWeight: - (value as UpdateThresholdWeight).encodeTo(output); - break; - case UpdateWeightRestrictDecay: - (value as UpdateWeightRestrictDecay).encodeTo(output); - break; - case UpdateXcmpMaxIndividualWeight: - (value as UpdateXcmpMaxIndividualWeight).encodeTo(output); - break; default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -147,8 +103,6 @@ class $CallCodec with _i1.Codec { @override int sizeHint(Call value) { switch (value.runtimeType) { - case ServiceOverweight: - return (value as ServiceOverweight)._sizeHint(); case SuspendXcmExecution: return 1; case ResumeXcmExecution: @@ -159,83 +113,12 @@ class $CallCodec with _i1.Codec { return (value as UpdateDropThreshold)._sizeHint(); case UpdateResumeThreshold: return (value as UpdateResumeThreshold)._sizeHint(); - case UpdateThresholdWeight: - return (value as UpdateThresholdWeight)._sizeHint(); - case UpdateWeightRestrictDecay: - return (value as UpdateWeightRestrictDecay)._sizeHint(); - case UpdateXcmpMaxIndividualWeight: - return (value as UpdateXcmpMaxIndividualWeight)._sizeHint(); default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } } } -/// See [`Pallet::service_overweight`]. -class ServiceOverweight extends Call { - const ServiceOverweight({ - required this.index, - required this.weightLimit, - }); - - factory ServiceOverweight._decode(_i1.Input input) { - return ServiceOverweight( - index: _i1.U64Codec.codec.decode(input), - weightLimit: _i3.Weight.codec.decode(input), - ); - } - - /// OverweightIndex - final BigInt index; - - /// Weight - final _i3.Weight weightLimit; - - @override - Map> toJson() => { - 'service_overweight': { - 'index': index, - 'weightLimit': weightLimit.toJson(), - } - }; - - int _sizeHint() { - int size = 1; - size = size + _i1.U64Codec.codec.sizeHint(index); - size = size + _i3.Weight.codec.sizeHint(weightLimit); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 0, - output, - ); - _i1.U64Codec.codec.encodeTo( - index, - output, - ); - _i3.Weight.codec.encodeTo( - weightLimit, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is ServiceOverweight && other.index == index && other.weightLimit == weightLimit; - - @override - int get hashCode => Object.hash( - index, - weightLimit, - ); -} - /// See [`Pallet::suspend_xcm_execution`]. class SuspendXcmExecution extends Call { const SuspendXcmExecution(); @@ -412,138 +295,3 @@ class UpdateResumeThreshold extends Call { @override int get hashCode => new_.hashCode; } - -/// See [`Pallet::update_threshold_weight`]. -class UpdateThresholdWeight extends Call { - const UpdateThresholdWeight({required this.new_}); - - factory UpdateThresholdWeight._decode(_i1.Input input) { - return UpdateThresholdWeight(new_: _i3.Weight.codec.decode(input)); - } - - /// Weight - final _i3.Weight new_; - - @override - Map>> toJson() => { - 'update_threshold_weight': {'new': new_.toJson()} - }; - - int _sizeHint() { - int size = 1; - size = size + _i3.Weight.codec.sizeHint(new_); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 6, - output, - ); - _i3.Weight.codec.encodeTo( - new_, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is UpdateThresholdWeight && other.new_ == new_; - - @override - int get hashCode => new_.hashCode; -} - -/// See [`Pallet::update_weight_restrict_decay`]. -class UpdateWeightRestrictDecay extends Call { - const UpdateWeightRestrictDecay({required this.new_}); - - factory UpdateWeightRestrictDecay._decode(_i1.Input input) { - return UpdateWeightRestrictDecay(new_: _i3.Weight.codec.decode(input)); - } - - /// Weight - final _i3.Weight new_; - - @override - Map>> toJson() => { - 'update_weight_restrict_decay': {'new': new_.toJson()} - }; - - int _sizeHint() { - int size = 1; - size = size + _i3.Weight.codec.sizeHint(new_); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 7, - output, - ); - _i3.Weight.codec.encodeTo( - new_, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is UpdateWeightRestrictDecay && other.new_ == new_; - - @override - int get hashCode => new_.hashCode; -} - -/// See [`Pallet::update_xcmp_max_individual_weight`]. -class UpdateXcmpMaxIndividualWeight extends Call { - const UpdateXcmpMaxIndividualWeight({required this.new_}); - - factory UpdateXcmpMaxIndividualWeight._decode(_i1.Input input) { - return UpdateXcmpMaxIndividualWeight(new_: _i3.Weight.codec.decode(input)); - } - - /// Weight - final _i3.Weight new_; - - @override - Map>> toJson() => { - 'update_xcmp_max_individual_weight': {'new': new_.toJson()} - }; - - int _sizeHint() { - int size = 1; - size = size + _i3.Weight.codec.sizeHint(new_); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 8, - output, - ); - _i3.Weight.codec.encodeTo( - new_, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is UpdateXcmpMaxIndividualWeight && other.new_ == new_; - - @override - int get hashCode => new_.hashCode; -} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/error.dart index 80d1bfdd7..daa6dde2b 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/error.dart @@ -5,20 +5,14 @@ import 'package:polkadart/scale_codec.dart' as _i1; /// The `Error` enum of this pallet. enum Error { - /// Failed to send XCM message. - failedToSend('FailedToSend', 0), + /// Setting the queue config failed since one of its values was invalid. + badQueueConfig('BadQueueConfig', 0), - /// Bad XCM origin. - badXcmOrigin('BadXcmOrigin', 1), + /// The execution is already suspended. + alreadySuspended('AlreadySuspended', 1), - /// Bad XCM data. - badXcm('BadXcm', 2), - - /// Bad overweight index. - badOverweightIndex('BadOverweightIndex', 3), - - /// Provided weight is possibly not enough to execute the message. - weightOverLimit('WeightOverLimit', 4); + /// The execution is already resumed. + alreadyResumed('AlreadyResumed', 2); const Error( this.variantName, @@ -49,15 +43,11 @@ class $ErrorCodec with _i1.Codec { final index = _i1.U8Codec.codec.decode(input); switch (index) { case 0: - return Error.failedToSend; + return Error.badQueueConfig; case 1: - return Error.badXcmOrigin; + return Error.alreadySuspended; case 2: - return Error.badXcm; - case 3: - return Error.badOverweightIndex; - case 4: - return Error.weightOverLimit; + return Error.alreadyResumed; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/event.dart index 3e445331d..2219e54eb 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/pallet/event.dart @@ -2,11 +2,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import 'package:quiver/collection.dart' as _i6; - -import '../../polkadot_parachain/primitives/id.dart' as _i5; -import '../../sp_weights/weight_v2/weight.dart' as _i3; -import '../../xcm/v3/traits/error.dart' as _i4; +import 'package:quiver/collection.dart' as _i3; /// The `Event` enum of this pallet abstract class Event { @@ -30,73 +26,15 @@ abstract class Event { return codec.sizeHint(this); } - Map> toJson(); + Map>> toJson(); } class $Event { const $Event(); - Success success({ - required List messageHash, - required List messageId, - required _i3.Weight weight, - }) { - return Success( - messageHash: messageHash, - messageId: messageId, - weight: weight, - ); - } - - Fail fail({ - required List messageHash, - required List messageId, - required _i4.Error error, - required _i3.Weight weight, - }) { - return Fail( - messageHash: messageHash, - messageId: messageId, - error: error, - weight: weight, - ); - } - - BadVersion badVersion({required List messageHash}) { - return BadVersion(messageHash: messageHash); - } - - BadFormat badFormat({required List messageHash}) { - return BadFormat(messageHash: messageHash); - } - XcmpMessageSent xcmpMessageSent({required List messageHash}) { return XcmpMessageSent(messageHash: messageHash); } - - OverweightEnqueued overweightEnqueued({ - required _i5.Id sender, - required int sentAt, - required BigInt index, - required _i3.Weight required, - }) { - return OverweightEnqueued( - sender: sender, - sentAt: sentAt, - index: index, - required: required, - ); - } - - OverweightServiced overweightServiced({ - required BigInt index, - required _i3.Weight used, - }) { - return OverweightServiced( - index: index, - used: used, - ); - } } class $EventCodec with _i1.Codec { @@ -107,19 +45,7 @@ class $EventCodec with _i1.Codec { final index = _i1.U8Codec.codec.decode(input); switch (index) { case 0: - return Success._decode(input); - case 1: - return Fail._decode(input); - case 2: - return BadVersion._decode(input); - case 3: - return BadFormat._decode(input); - case 4: return XcmpMessageSent._decode(input); - case 5: - return OverweightEnqueued._decode(input); - case 6: - return OverweightServiced._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); } @@ -131,27 +57,9 @@ class $EventCodec with _i1.Codec { _i1.Output output, ) { switch (value.runtimeType) { - case Success: - (value as Success).encodeTo(output); - break; - case Fail: - (value as Fail).encodeTo(output); - break; - case BadVersion: - (value as BadVersion).encodeTo(output); - break; - case BadFormat: - (value as BadFormat).encodeTo(output); - break; case XcmpMessageSent: (value as XcmpMessageSent).encodeTo(output); break; - case OverweightEnqueued: - (value as OverweightEnqueued).encodeTo(output); - break; - case OverweightServiced: - (value as OverweightServiced).encodeTo(output); - break; default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -160,309 +68,14 @@ class $EventCodec with _i1.Codec { @override int sizeHint(Event value) { switch (value.runtimeType) { - case Success: - return (value as Success)._sizeHint(); - case Fail: - return (value as Fail)._sizeHint(); - case BadVersion: - return (value as BadVersion)._sizeHint(); - case BadFormat: - return (value as BadFormat)._sizeHint(); case XcmpMessageSent: return (value as XcmpMessageSent)._sizeHint(); - case OverweightEnqueued: - return (value as OverweightEnqueued)._sizeHint(); - case OverweightServiced: - return (value as OverweightServiced)._sizeHint(); default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } } } -/// Some XCM was executed ok. -class Success extends Event { - const Success({ - required this.messageHash, - required this.messageId, - required this.weight, - }); - - factory Success._decode(_i1.Input input) { - return Success( - messageHash: const _i1.U8ArrayCodec(32).decode(input), - messageId: const _i1.U8ArrayCodec(32).decode(input), - weight: _i3.Weight.codec.decode(input), - ); - } - - /// XcmHash - final List messageHash; - - /// XcmHash - final List messageId; - - /// Weight - final _i3.Weight weight; - - @override - Map> toJson() => { - 'Success': { - 'messageHash': messageHash.toList(), - 'messageId': messageId.toList(), - 'weight': weight.toJson(), - } - }; - - int _sizeHint() { - int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); - size = size + _i3.Weight.codec.sizeHint(weight); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 0, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageId, - output, - ); - _i3.Weight.codec.encodeTo( - weight, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is Success && - _i6.listsEqual( - other.messageHash, - messageHash, - ) && - _i6.listsEqual( - other.messageId, - messageId, - ) && - other.weight == weight; - - @override - int get hashCode => Object.hash( - messageHash, - messageId, - weight, - ); -} - -/// Some XCM failed. -class Fail extends Event { - const Fail({ - required this.messageHash, - required this.messageId, - required this.error, - required this.weight, - }); - - factory Fail._decode(_i1.Input input) { - return Fail( - messageHash: const _i1.U8ArrayCodec(32).decode(input), - messageId: const _i1.U8ArrayCodec(32).decode(input), - error: _i4.Error.codec.decode(input), - weight: _i3.Weight.codec.decode(input), - ); - } - - /// XcmHash - final List messageHash; - - /// XcmHash - final List messageId; - - /// XcmError - final _i4.Error error; - - /// Weight - final _i3.Weight weight; - - @override - Map> toJson() => { - 'Fail': { - 'messageHash': messageHash.toList(), - 'messageId': messageId.toList(), - 'error': error.toJson(), - 'weight': weight.toJson(), - } - }; - - int _sizeHint() { - int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); - size = size + _i4.Error.codec.sizeHint(error); - size = size + _i3.Weight.codec.sizeHint(weight); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 1, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageId, - output, - ); - _i4.Error.codec.encodeTo( - error, - output, - ); - _i3.Weight.codec.encodeTo( - weight, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is Fail && - _i6.listsEqual( - other.messageHash, - messageHash, - ) && - _i6.listsEqual( - other.messageId, - messageId, - ) && - other.error == error && - other.weight == weight; - - @override - int get hashCode => Object.hash( - messageHash, - messageId, - error, - weight, - ); -} - -/// Bad XCM version used. -class BadVersion extends Event { - const BadVersion({required this.messageHash}); - - factory BadVersion._decode(_i1.Input input) { - return BadVersion(messageHash: const _i1.U8ArrayCodec(32).decode(input)); - } - - /// XcmHash - final List messageHash; - - @override - Map>> toJson() => { - 'BadVersion': {'messageHash': messageHash.toList()} - }; - - int _sizeHint() { - int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 2, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is BadVersion && - _i6.listsEqual( - other.messageHash, - messageHash, - ); - - @override - int get hashCode => messageHash.hashCode; -} - -/// Bad XCM format used. -class BadFormat extends Event { - const BadFormat({required this.messageHash}); - - factory BadFormat._decode(_i1.Input input) { - return BadFormat(messageHash: const _i1.U8ArrayCodec(32).decode(input)); - } - - /// XcmHash - final List messageHash; - - @override - Map>> toJson() => { - 'BadFormat': {'messageHash': messageHash.toList()} - }; - - int _sizeHint() { - int size = 1; - size = size + const _i1.U8ArrayCodec(32).sizeHint(messageHash); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 3, - output, - ); - const _i1.U8ArrayCodec(32).encodeTo( - messageHash, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is BadFormat && - _i6.listsEqual( - other.messageHash, - messageHash, - ); - - @override - int get hashCode => messageHash.hashCode; -} - /// An HRMP message was sent to a sibling parachain. class XcmpMessageSent extends Event { const XcmpMessageSent({required this.messageHash}); @@ -487,7 +100,7 @@ class XcmpMessageSent extends Event { void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 4, + 0, output, ); const _i1.U8ArrayCodec(32).encodeTo( @@ -503,7 +116,7 @@ class XcmpMessageSent extends Event { other, ) || other is XcmpMessageSent && - _i6.listsEqual( + _i3.listsEqual( other.messageHash, messageHash, ); @@ -511,161 +124,3 @@ class XcmpMessageSent extends Event { @override int get hashCode => messageHash.hashCode; } - -/// An XCM exceeded the individual message weight budget. -class OverweightEnqueued extends Event { - const OverweightEnqueued({ - required this.sender, - required this.sentAt, - required this.index, - required this.required, - }); - - factory OverweightEnqueued._decode(_i1.Input input) { - return OverweightEnqueued( - sender: _i1.U32Codec.codec.decode(input), - sentAt: _i1.U32Codec.codec.decode(input), - index: _i1.U64Codec.codec.decode(input), - required: _i3.Weight.codec.decode(input), - ); - } - - /// ParaId - final _i5.Id sender; - - /// RelayBlockNumber - final int sentAt; - - /// OverweightIndex - final BigInt index; - - /// Weight - final _i3.Weight required; - - @override - Map> toJson() => { - 'OverweightEnqueued': { - 'sender': sender, - 'sentAt': sentAt, - 'index': index, - 'required': required.toJson(), - } - }; - - int _sizeHint() { - int size = 1; - size = size + const _i5.IdCodec().sizeHint(sender); - size = size + _i1.U32Codec.codec.sizeHint(sentAt); - size = size + _i1.U64Codec.codec.sizeHint(index); - size = size + _i3.Weight.codec.sizeHint(required); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 5, - output, - ); - _i1.U32Codec.codec.encodeTo( - sender, - output, - ); - _i1.U32Codec.codec.encodeTo( - sentAt, - output, - ); - _i1.U64Codec.codec.encodeTo( - index, - output, - ); - _i3.Weight.codec.encodeTo( - required, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is OverweightEnqueued && - other.sender == sender && - other.sentAt == sentAt && - other.index == index && - other.required == required; - - @override - int get hashCode => Object.hash( - sender, - sentAt, - index, - required, - ); -} - -/// An XCM from the overweight queue was executed with the given actual weight used. -class OverweightServiced extends Event { - const OverweightServiced({ - required this.index, - required this.used, - }); - - factory OverweightServiced._decode(_i1.Input input) { - return OverweightServiced( - index: _i1.U64Codec.codec.decode(input), - used: _i3.Weight.codec.decode(input), - ); - } - - /// OverweightIndex - final BigInt index; - - /// Weight - final _i3.Weight used; - - @override - Map> toJson() => { - 'OverweightServiced': { - 'index': index, - 'used': used.toJson(), - } - }; - - int _sizeHint() { - int size = 1; - size = size + _i1.U64Codec.codec.sizeHint(index); - size = size + _i3.Weight.codec.sizeHint(used); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 6, - output, - ); - _i1.U64Codec.codec.encodeTo( - index, - output, - ); - _i3.Weight.codec.encodeTo( - used, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is OverweightServiced && other.index == index && other.used == used; - - @override - int get hashCode => Object.hash( - index, - used, - ); -} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/queue_config_data.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/queue_config_data.dart index bec41a9b8..8afc52a9a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/queue_config_data.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_pallet_xcmp_queue/queue_config_data.dart @@ -1,18 +1,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:typed_data' as _i3; +import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import '../sp_weights/weight_v2/weight.dart' as _i2; - class QueueConfigData { const QueueConfigData({ required this.suspendThreshold, required this.dropThreshold, required this.resumeThreshold, - required this.thresholdWeight, - required this.weightRestrictDecay, - required this.xcmpMaxIndividualWeight, }); factory QueueConfigData.decode(_i1.Input input) { @@ -28,28 +23,16 @@ class QueueConfigData { /// u32 final int resumeThreshold; - /// Weight - final _i2.Weight thresholdWeight; - - /// Weight - final _i2.Weight weightRestrictDecay; - - /// Weight - final _i2.Weight xcmpMaxIndividualWeight; - static const $QueueConfigDataCodec codec = $QueueConfigDataCodec(); - _i3.Uint8List encode() { + _i2.Uint8List encode() { return codec.encode(this); } - Map toJson() => { + Map toJson() => { 'suspendThreshold': suspendThreshold, 'dropThreshold': dropThreshold, 'resumeThreshold': resumeThreshold, - 'thresholdWeight': thresholdWeight.toJson(), - 'weightRestrictDecay': weightRestrictDecay.toJson(), - 'xcmpMaxIndividualWeight': xcmpMaxIndividualWeight.toJson(), }; @override @@ -61,19 +44,13 @@ class QueueConfigData { other is QueueConfigData && other.suspendThreshold == suspendThreshold && other.dropThreshold == dropThreshold && - other.resumeThreshold == resumeThreshold && - other.thresholdWeight == thresholdWeight && - other.weightRestrictDecay == weightRestrictDecay && - other.xcmpMaxIndividualWeight == xcmpMaxIndividualWeight; + other.resumeThreshold == resumeThreshold; @override int get hashCode => Object.hash( suspendThreshold, dropThreshold, resumeThreshold, - thresholdWeight, - weightRestrictDecay, - xcmpMaxIndividualWeight, ); } @@ -97,18 +74,6 @@ class $QueueConfigDataCodec with _i1.Codec { obj.resumeThreshold, output, ); - _i2.Weight.codec.encodeTo( - obj.thresholdWeight, - output, - ); - _i2.Weight.codec.encodeTo( - obj.weightRestrictDecay, - output, - ); - _i2.Weight.codec.encodeTo( - obj.xcmpMaxIndividualWeight, - output, - ); } @override @@ -117,9 +82,6 @@ class $QueueConfigDataCodec with _i1.Codec { suspendThreshold: _i1.U32Codec.codec.decode(input), dropThreshold: _i1.U32Codec.codec.decode(input), resumeThreshold: _i1.U32Codec.codec.decode(input), - thresholdWeight: _i2.Weight.codec.decode(input), - weightRestrictDecay: _i2.Weight.codec.decode(input), - xcmpMaxIndividualWeight: _i2.Weight.codec.decode(input), ); } @@ -129,9 +91,6 @@ class $QueueConfigDataCodec with _i1.Codec { size = size + _i1.U32Codec.codec.sizeHint(obj.suspendThreshold); size = size + _i1.U32Codec.codec.sizeHint(obj.dropThreshold); size = size + _i1.U32Codec.codec.sizeHint(obj.resumeThreshold); - size = size + _i2.Weight.codec.sizeHint(obj.thresholdWeight); - size = size + _i2.Weight.codec.sizeHint(obj.weightRestrictDecay); - size = size + _i2.Weight.codec.sizeHint(obj.xcmpMaxIndividualWeight); return size; } } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_primitives_core/aggregate_message_origin.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_primitives_core/aggregate_message_origin.dart new file mode 100644 index 000000000..472a82e38 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_primitives_core/aggregate_message_origin.dart @@ -0,0 +1,181 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../polkadot_parachain_primitives/primitives/id.dart' as _i3; + +abstract class AggregateMessageOrigin { + const AggregateMessageOrigin(); + + factory AggregateMessageOrigin.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $AggregateMessageOriginCodec codec = $AggregateMessageOriginCodec(); + + static const $AggregateMessageOrigin values = $AggregateMessageOrigin(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $AggregateMessageOrigin { + const $AggregateMessageOrigin(); + + Here here() { + return Here(); + } + + Parent parent() { + return Parent(); + } + + Sibling sibling(_i3.Id value0) { + return Sibling(value0); + } +} + +class $AggregateMessageOriginCodec with _i1.Codec { + const $AggregateMessageOriginCodec(); + + @override + AggregateMessageOrigin decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return const Here(); + case 1: + return const Parent(); + case 2: + return Sibling._decode(input); + default: + throw Exception('AggregateMessageOrigin: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + AggregateMessageOrigin value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Here: + (value as Here).encodeTo(output); + break; + case Parent: + (value as Parent).encodeTo(output); + break; + case Sibling: + (value as Sibling).encodeTo(output); + break; + default: + throw Exception('AggregateMessageOrigin: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(AggregateMessageOrigin value) { + switch (value.runtimeType) { + case Here: + return 1; + case Parent: + return 1; + case Sibling: + return (value as Sibling)._sizeHint(); + default: + throw Exception('AggregateMessageOrigin: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Here extends AggregateMessageOrigin { + const Here(); + + @override + Map toJson() => {'Here': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is Here; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Parent extends AggregateMessageOrigin { + const Parent(); + + @override + Map toJson() => {'Parent': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + } + + @override + bool operator ==(Object other) => other is Parent; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Sibling extends AggregateMessageOrigin { + const Sibling(this.value0); + + factory Sibling._decode(_i1.Input input) { + return Sibling(_i1.U32Codec.codec.decode(input)); + } + + /// ParaId + final _i3.Id value0; + + @override + Map toJson() => {'Sibling': value0}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.IdCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + _i1.U32Codec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Sibling && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_primitives_parachain_inherent/parachain_inherent_data.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_primitives_parachain_inherent/parachain_inherent_data.dart index 028b81d8d..9729bc6b0 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_primitives_parachain_inherent/parachain_inherent_data.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/cumulus_primitives_parachain_inherent/parachain_inherent_data.dart @@ -6,8 +6,8 @@ import 'package:quiver/collection.dart' as _i8; import '../polkadot_core_primitives/inbound_downward_message.dart' as _i4; import '../polkadot_core_primitives/inbound_hrmp_message.dart' as _i6; -import '../polkadot_parachain/primitives/id.dart' as _i5; -import '../polkadot_primitives/v5/persisted_validation_data.dart' as _i2; +import '../polkadot_parachain_primitives/primitives/id.dart' as _i5; +import '../polkadot_primitives/v6/persisted_validation_data.dart' as _i2; import '../sp_trie/storage_proof/storage_proof.dart' as _i3; class ParachainInherentData { diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/origin_caller.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/origin_caller.dart similarity index 99% rename from packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/origin_caller.dart rename to packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/origin_caller.dart index c76d2fd37..7aee45e8b 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/origin_caller.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/origin_caller.dart @@ -299,7 +299,8 @@ class Void extends OriginCaller { return Void(_i1.NullCodec.codec.decode(input)); } - /// self::sp_api_hidden_includes_construct_runtime::hidden_include::Void + /// self::sp_api_hidden_includes_construct_runtime::hidden_include:: + ///__private::Void final _i7.Void value0; @override diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/proxy_type.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/proxy_type.dart similarity index 100% rename from packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/proxy_type.dart rename to packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/proxy_type.dart diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/runtime.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/runtime.dart similarity index 100% rename from packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/runtime.dart rename to packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/runtime.dart diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/runtime_call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/runtime_call.dart similarity index 78% rename from packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/runtime_call.dart rename to packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/runtime_call.dart index d6b6f014e..2d92bf952 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/runtime_call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/runtime_call.dart @@ -3,26 +3,29 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import '../cumulus_pallet_dmp_queue/pallet/call.dart' as _i9; +import '../cumulus_pallet_dmp_queue/pallet/call.dart' as _i11; import '../cumulus_pallet_parachain_system/pallet/call.dart' as _i4; -import '../cumulus_pallet_xcmp_queue/pallet/call.dart' as _i7; +import '../cumulus_pallet_xcm/pallet/call.dart' as _i10; +import '../cumulus_pallet_xcmp_queue/pallet/call.dart' as _i8; import '../frame_system/pallet/call.dart' as _i3; -import '../pallet_balances/pallet/call.dart' as _i6; -import '../pallet_collective/pallet/call.dart' as _i14; -import '../pallet_encointer_balances/pallet/call.dart' as _i19; -import '../pallet_encointer_bazaar/pallet/call.dart' as _i20; -import '../pallet_encointer_ceremonies/pallet/call.dart' as _i17; -import '../pallet_encointer_communities/pallet/call.dart' as _i18; -import '../pallet_encointer_faucet/pallet/call.dart' as _i22; -import '../pallet_encointer_reputation_commitments/pallet/call.dart' as _i21; -import '../pallet_encointer_scheduler/pallet/call.dart' as _i16; -import '../pallet_membership/pallet/call.dart' as _i15; -import '../pallet_proxy/pallet/call.dart' as _i12; -import '../pallet_scheduler/pallet/call.dart' as _i13; +import '../pallet_balances/pallet/call.dart' as _i7; +import '../pallet_collective/pallet/call.dart' as _i17; +import '../pallet_encointer_balances/pallet/call.dart' as _i22; +import '../pallet_encointer_bazaar/pallet/call.dart' as _i23; +import '../pallet_encointer_ceremonies/pallet/call.dart' as _i20; +import '../pallet_encointer_communities/pallet/call.dart' as _i21; +import '../pallet_encointer_faucet/pallet/call.dart' as _i25; +import '../pallet_encointer_reputation_commitments/pallet/call.dart' as _i24; +import '../pallet_encointer_scheduler/pallet/call.dart' as _i19; +import '../pallet_membership/pallet/call.dart' as _i18; +import '../pallet_message_queue/pallet/call.dart' as _i12; +import '../pallet_proxy/pallet/call.dart' as _i15; +import '../pallet_scheduler/pallet/call.dart' as _i16; import '../pallet_timestamp/pallet/call.dart' as _i5; -import '../pallet_treasury/pallet/call.dart' as _i11; -import '../pallet_utility/pallet/call.dart' as _i10; -import '../pallet_xcm/pallet/call.dart' as _i8; +import '../pallet_treasury/pallet/call.dart' as _i14; +import '../pallet_utility/pallet/call.dart' as _i13; +import '../pallet_xcm/pallet/call.dart' as _i9; +import '../staging_parachain_info/pallet/call.dart' as _i6; abstract class RuntimeCall { const RuntimeCall(); @@ -45,7 +48,7 @@ abstract class RuntimeCall { return codec.sizeHint(this); } - Map> toJson(); + Map toJson(); } class $RuntimeCall { @@ -63,71 +66,83 @@ class $RuntimeCall { return Timestamp(value0); } - Balances balances(_i6.Call value0) { + ParachainInfo parachainInfo(_i6.Call value0) { + return ParachainInfo(value0); + } + + Balances balances(_i7.Call value0) { return Balances(value0); } - XcmpQueue xcmpQueue(_i7.Call value0) { + XcmpQueue xcmpQueue(_i8.Call value0) { return XcmpQueue(value0); } - PolkadotXcm polkadotXcm(_i8.Call value0) { + PolkadotXcm polkadotXcm(_i9.Call value0) { return PolkadotXcm(value0); } - DmpQueue dmpQueue(_i9.Call value0) { + CumulusXcm cumulusXcm(_i10.Call value0) { + return CumulusXcm(value0); + } + + DmpQueue dmpQueue(_i11.Call value0) { return DmpQueue(value0); } - Utility utility(_i10.Call value0) { + MessageQueue messageQueue(_i12.Call value0) { + return MessageQueue(value0); + } + + Utility utility(_i13.Call value0) { return Utility(value0); } - Treasury treasury(_i11.Call value0) { + Treasury treasury(_i14.Call value0) { return Treasury(value0); } - Proxy proxy(_i12.Call value0) { + Proxy proxy(_i15.Call value0) { return Proxy(value0); } - Scheduler scheduler(_i13.Call value0) { + Scheduler scheduler(_i16.Call value0) { return Scheduler(value0); } - Collective collective(_i14.Call value0) { + Collective collective(_i17.Call value0) { return Collective(value0); } - Membership membership(_i15.Call value0) { + Membership membership(_i18.Call value0) { return Membership(value0); } - EncointerScheduler encointerScheduler(_i16.Call value0) { + EncointerScheduler encointerScheduler(_i19.Call value0) { return EncointerScheduler(value0); } - EncointerCeremonies encointerCeremonies(_i17.Call value0) { + EncointerCeremonies encointerCeremonies(_i20.Call value0) { return EncointerCeremonies(value0); } - EncointerCommunities encointerCommunities(_i18.Call value0) { + EncointerCommunities encointerCommunities(_i21.Call value0) { return EncointerCommunities(value0); } - EncointerBalances encointerBalances(_i19.Call value0) { + EncointerBalances encointerBalances(_i22.Call value0) { return EncointerBalances(value0); } - EncointerBazaar encointerBazaar(_i20.Call value0) { + EncointerBazaar encointerBazaar(_i23.Call value0) { return EncointerBazaar(value0); } - EncointerReputationCommitments encointerReputationCommitments(_i21.Call value0) { + EncointerReputationCommitments encointerReputationCommitments(_i24.Call value0) { return EncointerReputationCommitments(value0); } - EncointerFaucet encointerFaucet(_i22.Call value0) { + EncointerFaucet encointerFaucet(_i25.Call value0) { return EncointerFaucet(value0); } } @@ -145,14 +160,20 @@ class $RuntimeCallCodec with _i1.Codec { return ParachainSystem._decode(input); case 3: return Timestamp._decode(input); + case 4: + return ParachainInfo._decode(input); case 10: return Balances._decode(input); case 30: return XcmpQueue._decode(input); case 31: return PolkadotXcm._decode(input); + case 32: + return CumulusXcm._decode(input); case 33: return DmpQueue._decode(input); + case 35: + return MessageQueue._decode(input); case 40: return Utility._decode(input); case 43: @@ -199,6 +220,9 @@ class $RuntimeCallCodec with _i1.Codec { case Timestamp: (value as Timestamp).encodeTo(output); break; + case ParachainInfo: + (value as ParachainInfo).encodeTo(output); + break; case Balances: (value as Balances).encodeTo(output); break; @@ -208,9 +232,15 @@ class $RuntimeCallCodec with _i1.Codec { case PolkadotXcm: (value as PolkadotXcm).encodeTo(output); break; + case CumulusXcm: + (value as CumulusXcm).encodeTo(output); + break; case DmpQueue: (value as DmpQueue).encodeTo(output); break; + case MessageQueue: + (value as MessageQueue).encodeTo(output); + break; case Utility: (value as Utility).encodeTo(output); break; @@ -264,14 +294,20 @@ class $RuntimeCallCodec with _i1.Codec { return (value as ParachainSystem)._sizeHint(); case Timestamp: return (value as Timestamp)._sizeHint(); + case ParachainInfo: + return (value as ParachainInfo)._sizeHint(); case Balances: return (value as Balances)._sizeHint(); case XcmpQueue: return (value as XcmpQueue)._sizeHint(); case PolkadotXcm: return (value as PolkadotXcm)._sizeHint(); + case CumulusXcm: + return (value as CumulusXcm)._sizeHint(); case DmpQueue: return (value as DmpQueue)._sizeHint(); + case MessageQueue: + return (value as MessageQueue)._sizeHint(); case Utility: return (value as Utility)._sizeHint(); case Treasury: @@ -433,23 +469,66 @@ class Timestamp extends RuntimeCall { int get hashCode => value0.hashCode; } +class ParachainInfo extends RuntimeCall { + const ParachainInfo(this.value0); + + factory ParachainInfo._decode(_i1.Input input) { + return ParachainInfo(_i1.NullCodec.codec.decode(input)); + } + + /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch + ///::CallableCallFor + final _i6.Call value0; + + @override + Map toJson() => {'ParachainInfo': null}; + + int _sizeHint() { + int size = 1; + size = size + const _i6.CallCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + _i1.NullCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ParachainInfo && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + class Balances extends RuntimeCall { const Balances(this.value0); factory Balances._decode(_i1.Input input) { - return Balances(_i6.Call.codec.decode(input)); + return Balances(_i7.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i6.Call value0; + final _i7.Call value0; @override Map>> toJson() => {'Balances': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i6.Call.codec.sizeHint(value0); + size = size + _i7.Call.codec.sizeHint(value0); return size; } @@ -458,7 +537,7 @@ class Balances extends RuntimeCall { 10, output, ); - _i6.Call.codec.encodeTo( + _i7.Call.codec.encodeTo( value0, output, ); @@ -480,19 +559,19 @@ class XcmpQueue extends RuntimeCall { const XcmpQueue(this.value0); factory XcmpQueue._decode(_i1.Input input) { - return XcmpQueue(_i7.Call.codec.decode(input)); + return XcmpQueue(_i8.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i7.Call value0; + final _i8.Call value0; @override Map> toJson() => {'XcmpQueue': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i7.Call.codec.sizeHint(value0); + size = size + _i8.Call.codec.sizeHint(value0); return size; } @@ -501,7 +580,7 @@ class XcmpQueue extends RuntimeCall { 30, output, ); - _i7.Call.codec.encodeTo( + _i8.Call.codec.encodeTo( value0, output, ); @@ -523,19 +602,19 @@ class PolkadotXcm extends RuntimeCall { const PolkadotXcm(this.value0); factory PolkadotXcm._decode(_i1.Input input) { - return PolkadotXcm(_i8.Call.codec.decode(input)); + return PolkadotXcm(_i9.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i8.Call value0; + final _i9.Call value0; @override Map>> toJson() => {'PolkadotXcm': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i8.Call.codec.sizeHint(value0); + size = size + _i9.Call.codec.sizeHint(value0); return size; } @@ -544,7 +623,7 @@ class PolkadotXcm extends RuntimeCall { 31, output, ); - _i8.Call.codec.encodeTo( + _i9.Call.codec.encodeTo( value0, output, ); @@ -562,23 +641,66 @@ class PolkadotXcm extends RuntimeCall { int get hashCode => value0.hashCode; } +class CumulusXcm extends RuntimeCall { + const CumulusXcm(this.value0); + + factory CumulusXcm._decode(_i1.Input input) { + return CumulusXcm(_i1.NullCodec.codec.decode(input)); + } + + /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch + ///::CallableCallFor + final _i10.Call value0; + + @override + Map toJson() => {'CumulusXcm': null}; + + int _sizeHint() { + int size = 1; + size = size + const _i10.CallCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 32, + output, + ); + _i1.NullCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is CumulusXcm && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + class DmpQueue extends RuntimeCall { const DmpQueue(this.value0); factory DmpQueue._decode(_i1.Input input) { - return DmpQueue(_i9.Call.codec.decode(input)); + return DmpQueue(_i1.NullCodec.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i9.Call value0; + final _i11.Call value0; @override - Map>> toJson() => {'DmpQueue': value0.toJson()}; + Map toJson() => {'DmpQueue': null}; int _sizeHint() { int size = 1; - size = size + _i9.Call.codec.sizeHint(value0); + size = size + const _i11.CallCodec().sizeHint(value0); return size; } @@ -587,7 +709,7 @@ class DmpQueue extends RuntimeCall { 33, output, ); - _i9.Call.codec.encodeTo( + _i1.NullCodec.codec.encodeTo( value0, output, ); @@ -605,23 +727,66 @@ class DmpQueue extends RuntimeCall { int get hashCode => value0.hashCode; } +class MessageQueue extends RuntimeCall { + const MessageQueue(this.value0); + + factory MessageQueue._decode(_i1.Input input) { + return MessageQueue(_i12.Call.codec.decode(input)); + } + + /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch + ///::CallableCallFor + final _i12.Call value0; + + @override + Map>> toJson() => {'MessageQueue': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i12.Call.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 35, + output, + ); + _i12.Call.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is MessageQueue && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + class Utility extends RuntimeCall { const Utility(this.value0); factory Utility._decode(_i1.Input input) { - return Utility(_i10.Call.codec.decode(input)); + return Utility(_i13.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i10.Call value0; + final _i13.Call value0; @override Map>> toJson() => {'Utility': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i10.Call.codec.sizeHint(value0); + size = size + _i13.Call.codec.sizeHint(value0); return size; } @@ -630,7 +795,7 @@ class Utility extends RuntimeCall { 40, output, ); - _i10.Call.codec.encodeTo( + _i13.Call.codec.encodeTo( value0, output, ); @@ -652,19 +817,19 @@ class Treasury extends RuntimeCall { const Treasury(this.value0); factory Treasury._decode(_i1.Input input) { - return Treasury(_i11.Call.codec.decode(input)); + return Treasury(_i14.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i11.Call value0; + final _i14.Call value0; @override Map>> toJson() => {'Treasury': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i11.Call.codec.sizeHint(value0); + size = size + _i14.Call.codec.sizeHint(value0); return size; } @@ -673,7 +838,7 @@ class Treasury extends RuntimeCall { 43, output, ); - _i11.Call.codec.encodeTo( + _i14.Call.codec.encodeTo( value0, output, ); @@ -695,19 +860,19 @@ class Proxy extends RuntimeCall { const Proxy(this.value0); factory Proxy._decode(_i1.Input input) { - return Proxy(_i12.Call.codec.decode(input)); + return Proxy(_i15.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i12.Call value0; + final _i15.Call value0; @override Map> toJson() => {'Proxy': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i12.Call.codec.sizeHint(value0); + size = size + _i15.Call.codec.sizeHint(value0); return size; } @@ -716,7 +881,7 @@ class Proxy extends RuntimeCall { 44, output, ); - _i12.Call.codec.encodeTo( + _i15.Call.codec.encodeTo( value0, output, ); @@ -738,19 +903,19 @@ class Scheduler extends RuntimeCall { const Scheduler(this.value0); factory Scheduler._decode(_i1.Input input) { - return Scheduler(_i13.Call.codec.decode(input)); + return Scheduler(_i16.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i13.Call value0; + final _i16.Call value0; @override Map>> toJson() => {'Scheduler': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i13.Call.codec.sizeHint(value0); + size = size + _i16.Call.codec.sizeHint(value0); return size; } @@ -759,7 +924,7 @@ class Scheduler extends RuntimeCall { 48, output, ); - _i13.Call.codec.encodeTo( + _i16.Call.codec.encodeTo( value0, output, ); @@ -781,19 +946,19 @@ class Collective extends RuntimeCall { const Collective(this.value0); factory Collective._decode(_i1.Input input) { - return Collective(_i14.Call.codec.decode(input)); + return Collective(_i17.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i14.Call value0; + final _i17.Call value0; @override Map>> toJson() => {'Collective': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i14.Call.codec.sizeHint(value0); + size = size + _i17.Call.codec.sizeHint(value0); return size; } @@ -802,7 +967,7 @@ class Collective extends RuntimeCall { 50, output, ); - _i14.Call.codec.encodeTo( + _i17.Call.codec.encodeTo( value0, output, ); @@ -824,19 +989,19 @@ class Membership extends RuntimeCall { const Membership(this.value0); factory Membership._decode(_i1.Input input) { - return Membership(_i15.Call.codec.decode(input)); + return Membership(_i18.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i15.Call value0; + final _i18.Call value0; @override Map> toJson() => {'Membership': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i15.Call.codec.sizeHint(value0); + size = size + _i18.Call.codec.sizeHint(value0); return size; } @@ -845,7 +1010,7 @@ class Membership extends RuntimeCall { 51, output, ); - _i15.Call.codec.encodeTo( + _i18.Call.codec.encodeTo( value0, output, ); @@ -867,19 +1032,19 @@ class EncointerScheduler extends RuntimeCall { const EncointerScheduler(this.value0); factory EncointerScheduler._decode(_i1.Input input) { - return EncointerScheduler(_i16.Call.codec.decode(input)); + return EncointerScheduler(_i19.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i16.Call value0; + final _i19.Call value0; @override Map> toJson() => {'EncointerScheduler': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i16.Call.codec.sizeHint(value0); + size = size + _i19.Call.codec.sizeHint(value0); return size; } @@ -888,7 +1053,7 @@ class EncointerScheduler extends RuntimeCall { 60, output, ); - _i16.Call.codec.encodeTo( + _i19.Call.codec.encodeTo( value0, output, ); @@ -910,19 +1075,19 @@ class EncointerCeremonies extends RuntimeCall { const EncointerCeremonies(this.value0); factory EncointerCeremonies._decode(_i1.Input input) { - return EncointerCeremonies(_i17.Call.codec.decode(input)); + return EncointerCeremonies(_i20.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i17.Call value0; + final _i20.Call value0; @override Map>> toJson() => {'EncointerCeremonies': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i17.Call.codec.sizeHint(value0); + size = size + _i20.Call.codec.sizeHint(value0); return size; } @@ -931,7 +1096,7 @@ class EncointerCeremonies extends RuntimeCall { 61, output, ); - _i17.Call.codec.encodeTo( + _i20.Call.codec.encodeTo( value0, output, ); @@ -953,19 +1118,19 @@ class EncointerCommunities extends RuntimeCall { const EncointerCommunities(this.value0); factory EncointerCommunities._decode(_i1.Input input) { - return EncointerCommunities(_i18.Call.codec.decode(input)); + return EncointerCommunities(_i21.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i18.Call value0; + final _i21.Call value0; @override Map>> toJson() => {'EncointerCommunities': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i18.Call.codec.sizeHint(value0); + size = size + _i21.Call.codec.sizeHint(value0); return size; } @@ -974,7 +1139,7 @@ class EncointerCommunities extends RuntimeCall { 62, output, ); - _i18.Call.codec.encodeTo( + _i21.Call.codec.encodeTo( value0, output, ); @@ -996,19 +1161,19 @@ class EncointerBalances extends RuntimeCall { const EncointerBalances(this.value0); factory EncointerBalances._decode(_i1.Input input) { - return EncointerBalances(_i19.Call.codec.decode(input)); + return EncointerBalances(_i22.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i19.Call value0; + final _i22.Call value0; @override Map>> toJson() => {'EncointerBalances': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i19.Call.codec.sizeHint(value0); + size = size + _i22.Call.codec.sizeHint(value0); return size; } @@ -1017,7 +1182,7 @@ class EncointerBalances extends RuntimeCall { 63, output, ); - _i19.Call.codec.encodeTo( + _i22.Call.codec.encodeTo( value0, output, ); @@ -1039,19 +1204,19 @@ class EncointerBazaar extends RuntimeCall { const EncointerBazaar(this.value0); factory EncointerBazaar._decode(_i1.Input input) { - return EncointerBazaar(_i20.Call.codec.decode(input)); + return EncointerBazaar(_i23.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i20.Call value0; + final _i23.Call value0; @override Map>> toJson() => {'EncointerBazaar': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i20.Call.codec.sizeHint(value0); + size = size + _i23.Call.codec.sizeHint(value0); return size; } @@ -1060,7 +1225,7 @@ class EncointerBazaar extends RuntimeCall { 64, output, ); - _i20.Call.codec.encodeTo( + _i23.Call.codec.encodeTo( value0, output, ); @@ -1082,19 +1247,19 @@ class EncointerReputationCommitments extends RuntimeCall { const EncointerReputationCommitments(this.value0); factory EncointerReputationCommitments._decode(_i1.Input input) { - return EncointerReputationCommitments(_i21.Call.codec.decode(input)); + return EncointerReputationCommitments(_i24.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i21.Call value0; + final _i24.Call value0; @override Map>> toJson() => {'EncointerReputationCommitments': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i21.Call.codec.sizeHint(value0); + size = size + _i24.Call.codec.sizeHint(value0); return size; } @@ -1103,7 +1268,7 @@ class EncointerReputationCommitments extends RuntimeCall { 65, output, ); - _i21.Call.codec.encodeTo( + _i24.Call.codec.encodeTo( value0, output, ); @@ -1125,19 +1290,19 @@ class EncointerFaucet extends RuntimeCall { const EncointerFaucet(this.value0); factory EncointerFaucet._decode(_i1.Input input) { - return EncointerFaucet(_i22.Call.codec.decode(input)); + return EncointerFaucet(_i25.Call.codec.decode(input)); } /// self::sp_api_hidden_includes_construct_runtime::hidden_include::dispatch ///::CallableCallFor - final _i22.Call value0; + final _i25.Call value0; @override Map>> toJson() => {'EncointerFaucet': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i22.Call.codec.sizeHint(value0); + size = size + _i25.Call.codec.sizeHint(value0); return size; } @@ -1146,7 +1311,7 @@ class EncointerFaucet extends RuntimeCall { 66, output, ); - _i22.Call.codec.encodeTo( + _i25.Call.codec.encodeTo( value0, output, ); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/runtime_event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/runtime_event.dart similarity index 88% rename from packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/runtime_event.dart rename to packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/runtime_event.dart index 30e6f3926..6c65b9bca 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_runtime/runtime_event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_kusama_runtime/runtime_event.dart @@ -10,20 +10,21 @@ import '../cumulus_pallet_xcmp_queue/pallet/event.dart' as _i8; import '../frame_system/pallet/event.dart' as _i3; import '../pallet_asset_tx_payment/pallet/event.dart' as _i7; import '../pallet_balances/pallet/event.dart' as _i5; -import '../pallet_collective/pallet/event.dart' as _i16; -import '../pallet_encointer_balances/pallet/event.dart' as _i21; -import '../pallet_encointer_bazaar/pallet/event.dart' as _i22; -import '../pallet_encointer_ceremonies/pallet/event.dart' as _i19; -import '../pallet_encointer_communities/pallet/event.dart' as _i20; -import '../pallet_encointer_faucet/pallet/event.dart' as _i24; -import '../pallet_encointer_reputation_commitments/pallet/event.dart' as _i23; -import '../pallet_encointer_scheduler/pallet/event.dart' as _i18; -import '../pallet_membership/pallet/event.dart' as _i17; -import '../pallet_proxy/pallet/event.dart' as _i14; -import '../pallet_scheduler/pallet/event.dart' as _i15; +import '../pallet_collective/pallet/event.dart' as _i17; +import '../pallet_encointer_balances/pallet/event.dart' as _i22; +import '../pallet_encointer_bazaar/pallet/event.dart' as _i23; +import '../pallet_encointer_ceremonies/pallet/event.dart' as _i20; +import '../pallet_encointer_communities/pallet/event.dart' as _i21; +import '../pallet_encointer_faucet/pallet/event.dart' as _i25; +import '../pallet_encointer_reputation_commitments/pallet/event.dart' as _i24; +import '../pallet_encointer_scheduler/pallet/event.dart' as _i19; +import '../pallet_membership/pallet/event.dart' as _i18; +import '../pallet_message_queue/pallet/event.dart' as _i12; +import '../pallet_proxy/pallet/event.dart' as _i15; +import '../pallet_scheduler/pallet/event.dart' as _i16; import '../pallet_transaction_payment/pallet/event.dart' as _i6; -import '../pallet_treasury/pallet/event.dart' as _i13; -import '../pallet_utility/pallet/event.dart' as _i12; +import '../pallet_treasury/pallet/event.dart' as _i14; +import '../pallet_utility/pallet/event.dart' as _i13; import '../pallet_xcm/pallet/event.dart' as _i9; abstract class RuntimeEvent { @@ -89,55 +90,59 @@ class $RuntimeEvent { return DmpQueue(value0); } - Utility utility(_i12.Event value0) { + MessageQueue messageQueue(_i12.Event value0) { + return MessageQueue(value0); + } + + Utility utility(_i13.Event value0) { return Utility(value0); } - Treasury treasury(_i13.Event value0) { + Treasury treasury(_i14.Event value0) { return Treasury(value0); } - Proxy proxy(_i14.Event value0) { + Proxy proxy(_i15.Event value0) { return Proxy(value0); } - Scheduler scheduler(_i15.Event value0) { + Scheduler scheduler(_i16.Event value0) { return Scheduler(value0); } - Collective collective(_i16.Event value0) { + Collective collective(_i17.Event value0) { return Collective(value0); } - Membership membership(_i17.Event value0) { + Membership membership(_i18.Event value0) { return Membership(value0); } - EncointerScheduler encointerScheduler(_i18.Event value0) { + EncointerScheduler encointerScheduler(_i19.Event value0) { return EncointerScheduler(value0); } - EncointerCeremonies encointerCeremonies(_i19.Event value0) { + EncointerCeremonies encointerCeremonies(_i20.Event value0) { return EncointerCeremonies(value0); } - EncointerCommunities encointerCommunities(_i20.Event value0) { + EncointerCommunities encointerCommunities(_i21.Event value0) { return EncointerCommunities(value0); } - EncointerBalances encointerBalances(_i21.Event value0) { + EncointerBalances encointerBalances(_i22.Event value0) { return EncointerBalances(value0); } - EncointerBazaar encointerBazaar(_i22.Event value0) { + EncointerBazaar encointerBazaar(_i23.Event value0) { return EncointerBazaar(value0); } - EncointerReputationCommitments encointerReputationCommitments(_i23.Event value0) { + EncointerReputationCommitments encointerReputationCommitments(_i24.Event value0) { return EncointerReputationCommitments(value0); } - EncointerFaucet encointerFaucet(_i24.Event value0) { + EncointerFaucet encointerFaucet(_i25.Event value0) { return EncointerFaucet(value0); } } @@ -167,6 +172,8 @@ class $RuntimeEventCodec with _i1.Codec { return CumulusXcm._decode(input); case 33: return DmpQueue._decode(input); + case 35: + return MessageQueue._decode(input); case 40: return Utility._decode(input); case 43: @@ -231,6 +238,9 @@ class $RuntimeEventCodec with _i1.Codec { case DmpQueue: (value as DmpQueue).encodeTo(output); break; + case MessageQueue: + (value as MessageQueue).encodeTo(output); + break; case Utility: (value as Utility).encodeTo(output); break; @@ -296,6 +306,8 @@ class $RuntimeEventCodec with _i1.Codec { return (value as CumulusXcm)._sizeHint(); case DmpQueue: return (value as DmpQueue)._sizeHint(); + case MessageQueue: + return (value as MessageQueue)._sizeHint(); case Utility: return (value as Utility)._sizeHint(); case Treasury: @@ -549,7 +561,7 @@ class XcmpQueue extends RuntimeEvent { final _i8.Event value0; @override - Map>> toJson() => {'XcmpQueue': value0.toJson()}; + Map>>> toJson() => {'XcmpQueue': value0.toJson()}; int _sizeHint() { int size = 1; @@ -675,7 +687,7 @@ class DmpQueue extends RuntimeEvent { final _i11.Event value0; @override - Map>> toJson() => {'DmpQueue': value0.toJson()}; + Map> toJson() => {'DmpQueue': value0.toJson()}; int _sizeHint() { int size = 1; @@ -706,22 +718,64 @@ class DmpQueue extends RuntimeEvent { int get hashCode => value0.hashCode; } +class MessageQueue extends RuntimeEvent { + const MessageQueue(this.value0); + + factory MessageQueue._decode(_i1.Input input) { + return MessageQueue(_i12.Event.codec.decode(input)); + } + + /// pallet_message_queue::Event + final _i12.Event value0; + + @override + Map>> toJson() => {'MessageQueue': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i12.Event.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 35, + output, + ); + _i12.Event.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is MessageQueue && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + class Utility extends RuntimeEvent { const Utility(this.value0); factory Utility._decode(_i1.Input input) { - return Utility(_i12.Event.codec.decode(input)); + return Utility(_i13.Event.codec.decode(input)); } /// pallet_utility::Event - final _i12.Event value0; + final _i13.Event value0; @override Map> toJson() => {'Utility': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i12.Event.codec.sizeHint(value0); + size = size + _i13.Event.codec.sizeHint(value0); return size; } @@ -730,7 +784,7 @@ class Utility extends RuntimeEvent { 40, output, ); - _i12.Event.codec.encodeTo( + _i13.Event.codec.encodeTo( value0, output, ); @@ -752,18 +806,18 @@ class Treasury extends RuntimeEvent { const Treasury(this.value0); factory Treasury._decode(_i1.Input input) { - return Treasury(_i13.Event.codec.decode(input)); + return Treasury(_i14.Event.codec.decode(input)); } /// pallet_treasury::Event - final _i13.Event value0; + final _i14.Event value0; @override Map>> toJson() => {'Treasury': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i13.Event.codec.sizeHint(value0); + size = size + _i14.Event.codec.sizeHint(value0); return size; } @@ -772,7 +826,7 @@ class Treasury extends RuntimeEvent { 43, output, ); - _i13.Event.codec.encodeTo( + _i14.Event.codec.encodeTo( value0, output, ); @@ -794,18 +848,18 @@ class Proxy extends RuntimeEvent { const Proxy(this.value0); factory Proxy._decode(_i1.Input input) { - return Proxy(_i14.Event.codec.decode(input)); + return Proxy(_i15.Event.codec.decode(input)); } /// pallet_proxy::Event - final _i14.Event value0; + final _i15.Event value0; @override Map>> toJson() => {'Proxy': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i14.Event.codec.sizeHint(value0); + size = size + _i15.Event.codec.sizeHint(value0); return size; } @@ -814,7 +868,7 @@ class Proxy extends RuntimeEvent { 44, output, ); - _i14.Event.codec.encodeTo( + _i15.Event.codec.encodeTo( value0, output, ); @@ -836,18 +890,18 @@ class Scheduler extends RuntimeEvent { const Scheduler(this.value0); factory Scheduler._decode(_i1.Input input) { - return Scheduler(_i15.Event.codec.decode(input)); + return Scheduler(_i16.Event.codec.decode(input)); } /// pallet_scheduler::Event - final _i15.Event value0; + final _i16.Event value0; @override Map>> toJson() => {'Scheduler': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i15.Event.codec.sizeHint(value0); + size = size + _i16.Event.codec.sizeHint(value0); return size; } @@ -856,7 +910,7 @@ class Scheduler extends RuntimeEvent { 48, output, ); - _i15.Event.codec.encodeTo( + _i16.Event.codec.encodeTo( value0, output, ); @@ -878,18 +932,18 @@ class Collective extends RuntimeEvent { const Collective(this.value0); factory Collective._decode(_i1.Input input) { - return Collective(_i16.Event.codec.decode(input)); + return Collective(_i17.Event.codec.decode(input)); } /// pallet_collective::Event - final _i16.Event value0; + final _i17.Event value0; @override Map>> toJson() => {'Collective': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i16.Event.codec.sizeHint(value0); + size = size + _i17.Event.codec.sizeHint(value0); return size; } @@ -898,7 +952,7 @@ class Collective extends RuntimeEvent { 50, output, ); - _i16.Event.codec.encodeTo( + _i17.Event.codec.encodeTo( value0, output, ); @@ -920,18 +974,18 @@ class Membership extends RuntimeEvent { const Membership(this.value0); factory Membership._decode(_i1.Input input) { - return Membership(_i17.Event.codec.decode(input)); + return Membership(_i18.Event.codec.decode(input)); } /// pallet_membership::Event - final _i17.Event value0; + final _i18.Event value0; @override Map toJson() => {'Membership': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i17.Event.codec.sizeHint(value0); + size = size + _i18.Event.codec.sizeHint(value0); return size; } @@ -940,7 +994,7 @@ class Membership extends RuntimeEvent { 51, output, ); - _i17.Event.codec.encodeTo( + _i18.Event.codec.encodeTo( value0, output, ); @@ -962,18 +1016,18 @@ class EncointerScheduler extends RuntimeEvent { const EncointerScheduler(this.value0); factory EncointerScheduler._decode(_i1.Input input) { - return EncointerScheduler(_i18.Event.codec.decode(input)); + return EncointerScheduler(_i19.Event.codec.decode(input)); } /// pallet_encointer_scheduler::Event - final _i18.Event value0; + final _i19.Event value0; @override Map> toJson() => {'EncointerScheduler': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i18.Event.codec.sizeHint(value0); + size = size + _i19.Event.codec.sizeHint(value0); return size; } @@ -982,7 +1036,7 @@ class EncointerScheduler extends RuntimeEvent { 60, output, ); - _i18.Event.codec.encodeTo( + _i19.Event.codec.encodeTo( value0, output, ); @@ -1004,18 +1058,18 @@ class EncointerCeremonies extends RuntimeEvent { const EncointerCeremonies(this.value0); factory EncointerCeremonies._decode(_i1.Input input) { - return EncointerCeremonies(_i19.Event.codec.decode(input)); + return EncointerCeremonies(_i20.Event.codec.decode(input)); } /// pallet_encointer_ceremonies::Event - final _i19.Event value0; + final _i20.Event value0; @override Map> toJson() => {'EncointerCeremonies': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i19.Event.codec.sizeHint(value0); + size = size + _i20.Event.codec.sizeHint(value0); return size; } @@ -1024,7 +1078,7 @@ class EncointerCeremonies extends RuntimeEvent { 61, output, ); - _i19.Event.codec.encodeTo( + _i20.Event.codec.encodeTo( value0, output, ); @@ -1046,18 +1100,18 @@ class EncointerCommunities extends RuntimeEvent { const EncointerCommunities(this.value0); factory EncointerCommunities._decode(_i1.Input input) { - return EncointerCommunities(_i20.Event.codec.decode(input)); + return EncointerCommunities(_i21.Event.codec.decode(input)); } /// pallet_encointer_communities::Event - final _i20.Event value0; + final _i21.Event value0; @override Map> toJson() => {'EncointerCommunities': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i20.Event.codec.sizeHint(value0); + size = size + _i21.Event.codec.sizeHint(value0); return size; } @@ -1066,7 +1120,7 @@ class EncointerCommunities extends RuntimeEvent { 62, output, ); - _i20.Event.codec.encodeTo( + _i21.Event.codec.encodeTo( value0, output, ); @@ -1088,18 +1142,18 @@ class EncointerBalances extends RuntimeEvent { const EncointerBalances(this.value0); factory EncointerBalances._decode(_i1.Input input) { - return EncointerBalances(_i21.Event.codec.decode(input)); + return EncointerBalances(_i22.Event.codec.decode(input)); } /// pallet_encointer_balances::Event - final _i21.Event value0; + final _i22.Event value0; @override Map> toJson() => {'EncointerBalances': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i21.Event.codec.sizeHint(value0); + size = size + _i22.Event.codec.sizeHint(value0); return size; } @@ -1108,7 +1162,7 @@ class EncointerBalances extends RuntimeEvent { 63, output, ); - _i21.Event.codec.encodeTo( + _i22.Event.codec.encodeTo( value0, output, ); @@ -1130,18 +1184,18 @@ class EncointerBazaar extends RuntimeEvent { const EncointerBazaar(this.value0); factory EncointerBazaar._decode(_i1.Input input) { - return EncointerBazaar(_i22.Event.codec.decode(input)); + return EncointerBazaar(_i23.Event.codec.decode(input)); } /// pallet_encointer_bazaar::Event - final _i22.Event value0; + final _i23.Event value0; @override Map>> toJson() => {'EncointerBazaar': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i22.Event.codec.sizeHint(value0); + size = size + _i23.Event.codec.sizeHint(value0); return size; } @@ -1150,7 +1204,7 @@ class EncointerBazaar extends RuntimeEvent { 64, output, ); - _i22.Event.codec.encodeTo( + _i23.Event.codec.encodeTo( value0, output, ); @@ -1172,18 +1226,18 @@ class EncointerReputationCommitments extends RuntimeEvent { const EncointerReputationCommitments(this.value0); factory EncointerReputationCommitments._decode(_i1.Input input) { - return EncointerReputationCommitments(_i23.Event.codec.decode(input)); + return EncointerReputationCommitments(_i24.Event.codec.decode(input)); } /// pallet_encointer_reputation_commitments::Event - final _i23.Event value0; + final _i24.Event value0; @override Map> toJson() => {'EncointerReputationCommitments': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i23.Event.codec.sizeHint(value0); + size = size + _i24.Event.codec.sizeHint(value0); return size; } @@ -1192,7 +1246,7 @@ class EncointerReputationCommitments extends RuntimeEvent { 65, output, ); - _i23.Event.codec.encodeTo( + _i24.Event.codec.encodeTo( value0, output, ); @@ -1214,18 +1268,18 @@ class EncointerFaucet extends RuntimeEvent { const EncointerFaucet(this.value0); factory EncointerFaucet._decode(_i1.Input input) { - return EncointerFaucet(_i24.Event.codec.decode(input)); + return EncointerFaucet(_i25.Event.codec.decode(input)); } /// pallet_encointer_faucet::Event - final _i24.Event value0; + final _i25.Event value0; @override Map> toJson() => {'EncointerFaucet': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i24.Event.codec.sizeHint(value0); + size = size + _i25.Event.codec.sizeHint(value0); return size; } @@ -1234,7 +1288,7 @@ class EncointerFaucet extends RuntimeEvent { 66, output, ); - _i24.Event.codec.encodeTo( + _i25.Event.codec.encodeTo( value0, output, ); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/ceremonies/reputation.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/ceremonies/reputation.dart index b6aad3ae7..f60edc5ee 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/ceremonies/reputation.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/encointer_primitives/ceremonies/reputation.dart @@ -3,30 +3,47 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -enum Reputation { - unverified('Unverified', 0), - unverifiedReputable('UnverifiedReputable', 1), - verifiedUnlinked('VerifiedUnlinked', 2), - verifiedLinked('VerifiedLinked', 3); - - const Reputation( - this.variantName, - this.codecIndex, - ); +abstract class Reputation { + const Reputation(); factory Reputation.decode(_i1.Input input) { return codec.decode(input); } - final String variantName; - - final int codecIndex; - static const $ReputationCodec codec = $ReputationCodec(); - String toJson() => variantName; + static const $Reputation values = $Reputation(); + _i2.Uint8List encode() { - return codec.encode(this); + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $Reputation { + const $Reputation(); + + Unverified unverified() { + return Unverified(); + } + + UnverifiedReputable unverifiedReputable() { + return UnverifiedReputable(); + } + + VerifiedUnlinked verifiedUnlinked() { + return VerifiedUnlinked(); + } + + VerifiedLinked verifiedLinked(int value0) { + return VerifiedLinked(value0); } } @@ -38,13 +55,13 @@ class $ReputationCodec with _i1.Codec { final index = _i1.U8Codec.codec.decode(input); switch (index) { case 0: - return Reputation.unverified; + return const Unverified(); case 1: - return Reputation.unverifiedReputable; + return const UnverifiedReputable(); case 2: - return Reputation.verifiedUnlinked; + return const VerifiedUnlinked(); case 3: - return Reputation.verifiedLinked; + return VerifiedLinked._decode(input); default: throw Exception('Reputation: Invalid variant index: "$index"'); } @@ -55,9 +72,139 @@ class $ReputationCodec with _i1.Codec { Reputation value, _i1.Output output, ) { + switch (value.runtimeType) { + case Unverified: + (value as Unverified).encodeTo(output); + break; + case UnverifiedReputable: + (value as UnverifiedReputable).encodeTo(output); + break; + case VerifiedUnlinked: + (value as VerifiedUnlinked).encodeTo(output); + break; + case VerifiedLinked: + (value as VerifiedLinked).encodeTo(output); + break; + default: + throw Exception('Reputation: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Reputation value) { + switch (value.runtimeType) { + case Unverified: + return 1; + case UnverifiedReputable: + return 1; + case VerifiedUnlinked: + return 1; + case VerifiedLinked: + return (value as VerifiedLinked)._sizeHint(); + default: + throw Exception('Reputation: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Unverified extends Reputation { + const Unverified(); + + @override + Map toJson() => {'Unverified': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is Unverified; + + @override + int get hashCode => runtimeType.hashCode; +} + +class UnverifiedReputable extends Reputation { + const UnverifiedReputable(); + + @override + Map toJson() => {'UnverifiedReputable': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + } + + @override + bool operator ==(Object other) => other is UnverifiedReputable; + + @override + int get hashCode => runtimeType.hashCode; +} + +class VerifiedUnlinked extends Reputation { + const VerifiedUnlinked(); + + @override + Map toJson() => {'VerifiedUnlinked': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + } + + @override + bool operator ==(Object other) => other is VerifiedUnlinked; + + @override + int get hashCode => runtimeType.hashCode; +} + +class VerifiedLinked extends Reputation { + const VerifiedLinked(this.value0); + + factory VerifiedLinked._decode(_i1.Input input) { + return VerifiedLinked(_i1.U32Codec.codec.decode(input)); + } + + /// CeremonyIndexType + final int value0; + + @override + Map toJson() => {'VerifiedLinked': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - value.codecIndex, + 3, + output, + ); + _i1.U32Codec.codec.encodeTo( + value0, output, ); } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is VerifiedLinked && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/messages/process_message_error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/messages/process_message_error.dart new file mode 100644 index 000000000..2b10fd188 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/messages/process_message_error.dart @@ -0,0 +1,243 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../../../sp_weights/weight_v2/weight.dart' as _i3; + +abstract class ProcessMessageError { + const ProcessMessageError(); + + factory ProcessMessageError.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $ProcessMessageErrorCodec codec = $ProcessMessageErrorCodec(); + + static const $ProcessMessageError values = $ProcessMessageError(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $ProcessMessageError { + const $ProcessMessageError(); + + BadFormat badFormat() { + return BadFormat(); + } + + Corrupt corrupt() { + return Corrupt(); + } + + Unsupported unsupported() { + return Unsupported(); + } + + Overweight overweight(_i3.Weight value0) { + return Overweight(value0); + } + + Yield yield() { + return Yield(); + } +} + +class $ProcessMessageErrorCodec with _i1.Codec { + const $ProcessMessageErrorCodec(); + + @override + ProcessMessageError decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return const BadFormat(); + case 1: + return const Corrupt(); + case 2: + return const Unsupported(); + case 3: + return Overweight._decode(input); + case 4: + return const Yield(); + default: + throw Exception('ProcessMessageError: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + ProcessMessageError value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case BadFormat: + (value as BadFormat).encodeTo(output); + break; + case Corrupt: + (value as Corrupt).encodeTo(output); + break; + case Unsupported: + (value as Unsupported).encodeTo(output); + break; + case Overweight: + (value as Overweight).encodeTo(output); + break; + case Yield: + (value as Yield).encodeTo(output); + break; + default: + throw Exception('ProcessMessageError: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(ProcessMessageError value) { + switch (value.runtimeType) { + case BadFormat: + return 1; + case Corrupt: + return 1; + case Unsupported: + return 1; + case Overweight: + return (value as Overweight)._sizeHint(); + case Yield: + return 1; + default: + throw Exception('ProcessMessageError: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class BadFormat extends ProcessMessageError { + const BadFormat(); + + @override + Map toJson() => {'BadFormat': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is BadFormat; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Corrupt extends ProcessMessageError { + const Corrupt(); + + @override + Map toJson() => {'Corrupt': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + } + + @override + bool operator ==(Object other) => other is Corrupt; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Unsupported extends ProcessMessageError { + const Unsupported(); + + @override + Map toJson() => {'Unsupported': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + } + + @override + bool operator ==(Object other) => other is Unsupported; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Overweight extends ProcessMessageError { + const Overweight(this.value0); + + factory Overweight._decode(_i1.Input input) { + return Overweight(_i3.Weight.codec.decode(input)); + } + + /// Weight + final _i3.Weight value0; + + @override + Map> toJson() => {'Overweight': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i3.Weight.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + _i3.Weight.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Overweight && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class Yield extends ProcessMessageError { + const Yield(); + + @override + Map toJson() => {'Yield': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + } + + @override + bool operator ==(Object other) => other is Yield; + + @override + int get hashCode => runtimeType.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/preimages/bounded.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/preimages/bounded.dart index 35f827311..f45a5960a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/preimages/bounded.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_support/traits/preimages/bounded.dart @@ -112,7 +112,7 @@ class Legacy extends Bounded { return Legacy(hash: const _i1.U8ArrayCodec(32).decode(input)); } - /// Hash + /// H::Output final _i3.H256 hash; @override @@ -212,7 +212,7 @@ class Lookup extends Bounded { ); } - /// Hash + /// H::Output final _i3.H256 hash; /// u32 diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/code_upgrade_authorization.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/code_upgrade_authorization.dart new file mode 100644 index 000000000..8770ac09d --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/code_upgrade_authorization.dart @@ -0,0 +1,89 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i4; + +import '../primitive_types/h256.dart' as _i2; + +class CodeUpgradeAuthorization { + const CodeUpgradeAuthorization({ + required this.codeHash, + required this.checkVersion, + }); + + factory CodeUpgradeAuthorization.decode(_i1.Input input) { + return codec.decode(input); + } + + /// T::Hash + final _i2.H256 codeHash; + + /// bool + final bool checkVersion; + + static const $CodeUpgradeAuthorizationCodec codec = $CodeUpgradeAuthorizationCodec(); + + _i3.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'codeHash': codeHash.toList(), + 'checkVersion': checkVersion, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is CodeUpgradeAuthorization && + _i4.listsEqual( + other.codeHash, + codeHash, + ) && + other.checkVersion == checkVersion; + + @override + int get hashCode => Object.hash( + codeHash, + checkVersion, + ); +} + +class $CodeUpgradeAuthorizationCodec with _i1.Codec { + const $CodeUpgradeAuthorizationCodec(); + + @override + void encodeTo( + CodeUpgradeAuthorization obj, + _i1.Output output, + ) { + const _i1.U8ArrayCodec(32).encodeTo( + obj.codeHash, + output, + ); + _i1.BoolCodec.codec.encodeTo( + obj.checkVersion, + output, + ); + } + + @override + CodeUpgradeAuthorization decode(_i1.Input input) { + return CodeUpgradeAuthorization( + codeHash: const _i1.U8ArrayCodec(32).decode(input), + checkVersion: _i1.BoolCodec.codec.decode(input), + ); + } + + @override + int sizeHint(CodeUpgradeAuthorization obj) { + int size = 0; + size = size + const _i2.H256Codec().sizeHint(obj.codeHash); + size = size + _i1.BoolCodec.codec.sizeHint(obj.checkVersion); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/event_record.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/event_record.dart index 0898359ee..656bb824c 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/event_record.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/event_record.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i5; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i6; -import '../encointer_runtime/runtime_event.dart' as _i3; +import '../encointer_kusama_runtime/runtime_event.dart' as _i3; import '../primitive_types/h256.dart' as _i4; import 'phase.dart' as _i2; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/call.dart index 8283835a5..ff70b7cbc 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/call.dart @@ -2,8 +2,9 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import 'package:quiver/collection.dart' as _i4; +import 'package:quiver/collection.dart' as _i5; +import '../../primitive_types/h256.dart' as _i4; import '../../tuples.dart' as _i3; /// Contains a variant per dispatchable extrinsic that this pallet has. @@ -71,6 +72,18 @@ class $Call { RemarkWithEvent remarkWithEvent({required List remark}) { return RemarkWithEvent(remark: remark); } + + AuthorizeUpgrade authorizeUpgrade({required _i4.H256 codeHash}) { + return AuthorizeUpgrade(codeHash: codeHash); + } + + AuthorizeUpgradeWithoutChecks authorizeUpgradeWithoutChecks({required _i4.H256 codeHash}) { + return AuthorizeUpgradeWithoutChecks(codeHash: codeHash); + } + + ApplyAuthorizedUpgrade applyAuthorizedUpgrade({required List code}) { + return ApplyAuthorizedUpgrade(code: code); + } } class $CallCodec with _i1.Codec { @@ -96,6 +109,12 @@ class $CallCodec with _i1.Codec { return KillPrefix._decode(input); case 7: return RemarkWithEvent._decode(input); + case 9: + return AuthorizeUpgrade._decode(input); + case 10: + return AuthorizeUpgradeWithoutChecks._decode(input); + case 11: + return ApplyAuthorizedUpgrade._decode(input); default: throw Exception('Call: Invalid variant index: "$index"'); } @@ -131,6 +150,15 @@ class $CallCodec with _i1.Codec { case RemarkWithEvent: (value as RemarkWithEvent).encodeTo(output); break; + case AuthorizeUpgrade: + (value as AuthorizeUpgrade).encodeTo(output); + break; + case AuthorizeUpgradeWithoutChecks: + (value as AuthorizeUpgradeWithoutChecks).encodeTo(output); + break; + case ApplyAuthorizedUpgrade: + (value as ApplyAuthorizedUpgrade).encodeTo(output); + break; default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -155,6 +183,12 @@ class $CallCodec with _i1.Codec { return (value as KillPrefix)._sizeHint(); case RemarkWithEvent: return (value as RemarkWithEvent)._sizeHint(); + case AuthorizeUpgrade: + return (value as AuthorizeUpgrade)._sizeHint(); + case AuthorizeUpgradeWithoutChecks: + return (value as AuthorizeUpgradeWithoutChecks)._sizeHint(); + case ApplyAuthorizedUpgrade: + return (value as ApplyAuthorizedUpgrade)._sizeHint(); default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -201,7 +235,7 @@ class Remark extends Call { other, ) || other is Remark && - _i4.listsEqual( + _i5.listsEqual( other.remark, remark, ); @@ -295,7 +329,7 @@ class SetCode extends Call { other, ) || other is SetCode && - _i4.listsEqual( + _i5.listsEqual( other.code, code, ); @@ -344,7 +378,7 @@ class SetCodeWithoutChecks extends Call { other, ) || other is SetCodeWithoutChecks && - _i4.listsEqual( + _i5.listsEqual( other.code, code, ); @@ -411,7 +445,7 @@ class SetStorage extends Call { other, ) || other is SetStorage && - _i4.listsEqual( + _i5.listsEqual( other.items, items, ); @@ -460,7 +494,7 @@ class KillStorage extends Call { other, ) || other is KillStorage && - _i4.listsEqual( + _i5.listsEqual( other.keys, keys, ); @@ -526,7 +560,7 @@ class KillPrefix extends Call { other, ) || other is KillPrefix && - _i4.listsEqual( + _i5.listsEqual( other.prefix, prefix, ) && @@ -579,7 +613,7 @@ class RemarkWithEvent extends Call { other, ) || other is RemarkWithEvent && - _i4.listsEqual( + _i5.listsEqual( other.remark, remark, ); @@ -587,3 +621,150 @@ class RemarkWithEvent extends Call { @override int get hashCode => remark.hashCode; } + +/// See [`Pallet::authorize_upgrade`]. +class AuthorizeUpgrade extends Call { + const AuthorizeUpgrade({required this.codeHash}); + + factory AuthorizeUpgrade._decode(_i1.Input input) { + return AuthorizeUpgrade(codeHash: const _i1.U8ArrayCodec(32).decode(input)); + } + + /// T::Hash + final _i4.H256 codeHash; + + @override + Map>> toJson() => { + 'authorize_upgrade': {'codeHash': codeHash.toList()} + }; + + int _sizeHint() { + int size = 1; + size = size + const _i4.H256Codec().sizeHint(codeHash); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 9, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + codeHash, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AuthorizeUpgrade && + _i5.listsEqual( + other.codeHash, + codeHash, + ); + + @override + int get hashCode => codeHash.hashCode; +} + +/// See [`Pallet::authorize_upgrade_without_checks`]. +class AuthorizeUpgradeWithoutChecks extends Call { + const AuthorizeUpgradeWithoutChecks({required this.codeHash}); + + factory AuthorizeUpgradeWithoutChecks._decode(_i1.Input input) { + return AuthorizeUpgradeWithoutChecks(codeHash: const _i1.U8ArrayCodec(32).decode(input)); + } + + /// T::Hash + final _i4.H256 codeHash; + + @override + Map>> toJson() => { + 'authorize_upgrade_without_checks': {'codeHash': codeHash.toList()} + }; + + int _sizeHint() { + int size = 1; + size = size + const _i4.H256Codec().sizeHint(codeHash); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 10, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + codeHash, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AuthorizeUpgradeWithoutChecks && + _i5.listsEqual( + other.codeHash, + codeHash, + ); + + @override + int get hashCode => codeHash.hashCode; +} + +/// See [`Pallet::apply_authorized_upgrade`]. +class ApplyAuthorizedUpgrade extends Call { + const ApplyAuthorizedUpgrade({required this.code}); + + factory ApplyAuthorizedUpgrade._decode(_i1.Input input) { + return ApplyAuthorizedUpgrade(code: _i1.U8SequenceCodec.codec.decode(input)); + } + + /// Vec + final List code; + + @override + Map>> toJson() => { + 'apply_authorized_upgrade': {'code': code} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U8SequenceCodec.codec.sizeHint(code); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 11, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + code, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ApplyAuthorizedUpgrade && + _i5.listsEqual( + other.code, + code, + ); + + @override + int get hashCode => code.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/error.dart index 792e5e5d7..4cd910bbc 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/error.dart @@ -25,7 +25,13 @@ enum Error { nonZeroRefCount('NonZeroRefCount', 4), /// The origin filter prevent the call to be dispatched. - callFiltered('CallFiltered', 5); + callFiltered('CallFiltered', 5), + + /// No upgrade authorized. + nothingAuthorized('NothingAuthorized', 6), + + /// The submitted code is not authorized. + unauthorized('Unauthorized', 7); const Error( this.variantName, @@ -67,6 +73,10 @@ class $ErrorCodec with _i1.Codec { return Error.nonZeroRefCount; case 5: return Error.callFiltered; + case 6: + return Error.nothingAuthorized; + case 7: + return Error.unauthorized; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/event.dart index 0d2ebd745..b15fbc3bf 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/frame_system/pallet/event.dart @@ -72,6 +72,16 @@ class $Event { hash: hash, ); } + + UpgradeAuthorized upgradeAuthorized({ + required _i6.H256 codeHash, + required bool checkVersion, + }) { + return UpgradeAuthorized( + codeHash: codeHash, + checkVersion: checkVersion, + ); + } } class $EventCodec with _i1.Codec { @@ -93,6 +103,8 @@ class $EventCodec with _i1.Codec { return KilledAccount._decode(input); case 5: return Remarked._decode(input); + case 6: + return UpgradeAuthorized._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); } @@ -122,6 +134,9 @@ class $EventCodec with _i1.Codec { case Remarked: (value as Remarked).encodeTo(output); break; + case UpgradeAuthorized: + (value as UpgradeAuthorized).encodeTo(output); + break; default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -142,6 +157,8 @@ class $EventCodec with _i1.Codec { return (value as KilledAccount)._sizeHint(); case Remarked: return (value as Remarked)._sizeHint(); + case UpgradeAuthorized: + return (value as UpgradeAuthorized)._sizeHint(); default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -449,3 +466,73 @@ class Remarked extends Event { hash, ); } + +/// An upgrade was authorized. +class UpgradeAuthorized extends Event { + const UpgradeAuthorized({ + required this.codeHash, + required this.checkVersion, + }); + + factory UpgradeAuthorized._decode(_i1.Input input) { + return UpgradeAuthorized( + codeHash: const _i1.U8ArrayCodec(32).decode(input), + checkVersion: _i1.BoolCodec.codec.decode(input), + ); + } + + /// T::Hash + final _i6.H256 codeHash; + + /// bool + final bool checkVersion; + + @override + Map> toJson() => { + 'UpgradeAuthorized': { + 'codeHash': codeHash.toList(), + 'checkVersion': checkVersion, + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i6.H256Codec().sizeHint(codeHash); + size = size + _i1.BoolCodec.codec.sizeHint(checkVersion); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + codeHash, + output, + ); + _i1.BoolCodec.codec.encodeTo( + checkVersion, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UpgradeAuthorized && + _i7.listsEqual( + other.codeHash, + codeHash, + ) && + other.checkVersion == checkVersion; + + @override + int get hashCode => Object.hash( + codeHash, + checkVersion, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/call.dart index 4ced24f2a..6338314fe 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/call.dart @@ -2,10 +2,11 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import 'package:quiver/collection.dart' as _i5; +import 'package:quiver/collection.dart' as _i6; import '../../sp_core/crypto/account_id32.dart' as _i4; import '../../sp_runtime/multiaddress/multi_address.dart' as _i3; +import '../types/adjustment_direction.dart' as _i5; /// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { @@ -45,18 +46,6 @@ class $Call { ); } - SetBalanceDeprecated setBalanceDeprecated({ - required _i3.MultiAddress who, - required BigInt newFree, - required BigInt oldReserved, - }) { - return SetBalanceDeprecated( - who: who, - newFree: newFree, - oldReserved: oldReserved, - ); - } - ForceTransfer forceTransfer({ required _i3.MultiAddress source, required _i3.MultiAddress dest, @@ -103,16 +92,6 @@ class $Call { return UpgradeAccounts(who: who); } - Transfer transfer({ - required _i3.MultiAddress dest, - required BigInt value, - }) { - return Transfer( - dest: dest, - value: value, - ); - } - ForceSetBalance forceSetBalance({ required _i3.MultiAddress who, required BigInt newFree, @@ -122,6 +101,16 @@ class $Call { newFree: newFree, ); } + + ForceAdjustTotalIssuance forceAdjustTotalIssuance({ + required _i5.AdjustmentDirection direction, + required BigInt delta, + }) { + return ForceAdjustTotalIssuance( + direction: direction, + delta: delta, + ); + } } class $CallCodec with _i1.Codec { @@ -133,8 +122,6 @@ class $CallCodec with _i1.Codec { switch (index) { case 0: return TransferAllowDeath._decode(input); - case 1: - return SetBalanceDeprecated._decode(input); case 2: return ForceTransfer._decode(input); case 3: @@ -145,10 +132,10 @@ class $CallCodec with _i1.Codec { return ForceUnreserve._decode(input); case 6: return UpgradeAccounts._decode(input); - case 7: - return Transfer._decode(input); case 8: return ForceSetBalance._decode(input); + case 9: + return ForceAdjustTotalIssuance._decode(input); default: throw Exception('Call: Invalid variant index: "$index"'); } @@ -163,9 +150,6 @@ class $CallCodec with _i1.Codec { case TransferAllowDeath: (value as TransferAllowDeath).encodeTo(output); break; - case SetBalanceDeprecated: - (value as SetBalanceDeprecated).encodeTo(output); - break; case ForceTransfer: (value as ForceTransfer).encodeTo(output); break; @@ -181,12 +165,12 @@ class $CallCodec with _i1.Codec { case UpgradeAccounts: (value as UpgradeAccounts).encodeTo(output); break; - case Transfer: - (value as Transfer).encodeTo(output); - break; case ForceSetBalance: (value as ForceSetBalance).encodeTo(output); break; + case ForceAdjustTotalIssuance: + (value as ForceAdjustTotalIssuance).encodeTo(output); + break; default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -197,8 +181,6 @@ class $CallCodec with _i1.Codec { switch (value.runtimeType) { case TransferAllowDeath: return (value as TransferAllowDeath)._sizeHint(); - case SetBalanceDeprecated: - return (value as SetBalanceDeprecated)._sizeHint(); case ForceTransfer: return (value as ForceTransfer)._sizeHint(); case TransferKeepAlive: @@ -209,10 +191,10 @@ class $CallCodec with _i1.Codec { return (value as ForceUnreserve)._sizeHint(); case UpgradeAccounts: return (value as UpgradeAccounts)._sizeHint(); - case Transfer: - return (value as Transfer)._sizeHint(); case ForceSetBalance: return (value as ForceSetBalance)._sizeHint(); + case ForceAdjustTotalIssuance: + return (value as ForceAdjustTotalIssuance)._sizeHint(); default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -284,83 +266,6 @@ class TransferAllowDeath extends Call { ); } -/// See [`Pallet::set_balance_deprecated`]. -class SetBalanceDeprecated extends Call { - const SetBalanceDeprecated({ - required this.who, - required this.newFree, - required this.oldReserved, - }); - - factory SetBalanceDeprecated._decode(_i1.Input input) { - return SetBalanceDeprecated( - who: _i3.MultiAddress.codec.decode(input), - newFree: _i1.CompactBigIntCodec.codec.decode(input), - oldReserved: _i1.CompactBigIntCodec.codec.decode(input), - ); - } - - /// AccountIdLookupOf - final _i3.MultiAddress who; - - /// T::Balance - final BigInt newFree; - - /// T::Balance - final BigInt oldReserved; - - @override - Map> toJson() => { - 'set_balance_deprecated': { - 'who': who.toJson(), - 'newFree': newFree, - 'oldReserved': oldReserved, - } - }; - - int _sizeHint() { - int size = 1; - size = size + _i3.MultiAddress.codec.sizeHint(who); - size = size + _i1.CompactBigIntCodec.codec.sizeHint(newFree); - size = size + _i1.CompactBigIntCodec.codec.sizeHint(oldReserved); - return size; - } - - void encodeTo(_i1.Output output) { - _i1.U8Codec.codec.encodeTo( - 1, - output, - ); - _i3.MultiAddress.codec.encodeTo( - who, - output, - ); - _i1.CompactBigIntCodec.codec.encodeTo( - newFree, - output, - ); - _i1.CompactBigIntCodec.codec.encodeTo( - oldReserved, - output, - ); - } - - @override - bool operator ==(Object other) => - identical( - this, - other, - ) || - other is SetBalanceDeprecated && other.who == who && other.newFree == newFree && other.oldReserved == oldReserved; - - @override - int get hashCode => Object.hash( - who, - newFree, - oldReserved, - ); -} - /// See [`Pallet::force_transfer`]. class ForceTransfer extends Call { const ForceTransfer({ @@ -673,7 +578,7 @@ class UpgradeAccounts extends Call { other, ) || other is UpgradeAccounts && - _i5.listsEqual( + _i6.listsEqual( other.who, who, ); @@ -682,52 +587,52 @@ class UpgradeAccounts extends Call { int get hashCode => who.hashCode; } -/// See [`Pallet::transfer`]. -class Transfer extends Call { - const Transfer({ - required this.dest, - required this.value, +/// See [`Pallet::force_set_balance`]. +class ForceSetBalance extends Call { + const ForceSetBalance({ + required this.who, + required this.newFree, }); - factory Transfer._decode(_i1.Input input) { - return Transfer( - dest: _i3.MultiAddress.codec.decode(input), - value: _i1.CompactBigIntCodec.codec.decode(input), + factory ForceSetBalance._decode(_i1.Input input) { + return ForceSetBalance( + who: _i3.MultiAddress.codec.decode(input), + newFree: _i1.CompactBigIntCodec.codec.decode(input), ); } /// AccountIdLookupOf - final _i3.MultiAddress dest; + final _i3.MultiAddress who; /// T::Balance - final BigInt value; + final BigInt newFree; @override Map> toJson() => { - 'transfer': { - 'dest': dest.toJson(), - 'value': value, + 'force_set_balance': { + 'who': who.toJson(), + 'newFree': newFree, } }; int _sizeHint() { int size = 1; - size = size + _i3.MultiAddress.codec.sizeHint(dest); - size = size + _i1.CompactBigIntCodec.codec.sizeHint(value); + size = size + _i3.MultiAddress.codec.sizeHint(who); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(newFree); return size; } void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 7, + 8, output, ); _i3.MultiAddress.codec.encodeTo( - dest, + who, output, ); _i1.CompactBigIntCodec.codec.encodeTo( - value, + newFree, output, ); } @@ -738,61 +643,61 @@ class Transfer extends Call { this, other, ) || - other is Transfer && other.dest == dest && other.value == value; + other is ForceSetBalance && other.who == who && other.newFree == newFree; @override int get hashCode => Object.hash( - dest, - value, + who, + newFree, ); } -/// See [`Pallet::force_set_balance`]. -class ForceSetBalance extends Call { - const ForceSetBalance({ - required this.who, - required this.newFree, +/// See [`Pallet::force_adjust_total_issuance`]. +class ForceAdjustTotalIssuance extends Call { + const ForceAdjustTotalIssuance({ + required this.direction, + required this.delta, }); - factory ForceSetBalance._decode(_i1.Input input) { - return ForceSetBalance( - who: _i3.MultiAddress.codec.decode(input), - newFree: _i1.CompactBigIntCodec.codec.decode(input), + factory ForceAdjustTotalIssuance._decode(_i1.Input input) { + return ForceAdjustTotalIssuance( + direction: _i5.AdjustmentDirection.codec.decode(input), + delta: _i1.CompactBigIntCodec.codec.decode(input), ); } - /// AccountIdLookupOf - final _i3.MultiAddress who; + /// AdjustmentDirection + final _i5.AdjustmentDirection direction; /// T::Balance - final BigInt newFree; + final BigInt delta; @override Map> toJson() => { - 'force_set_balance': { - 'who': who.toJson(), - 'newFree': newFree, + 'force_adjust_total_issuance': { + 'direction': direction.toJson(), + 'delta': delta, } }; int _sizeHint() { int size = 1; - size = size + _i3.MultiAddress.codec.sizeHint(who); - size = size + _i1.CompactBigIntCodec.codec.sizeHint(newFree); + size = size + _i5.AdjustmentDirection.codec.sizeHint(direction); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(delta); return size; } void encodeTo(_i1.Output output) { _i1.U8Codec.codec.encodeTo( - 8, + 9, output, ); - _i3.MultiAddress.codec.encodeTo( - who, + _i5.AdjustmentDirection.codec.encodeTo( + direction, output, ); _i1.CompactBigIntCodec.codec.encodeTo( - newFree, + delta, output, ); } @@ -803,11 +708,11 @@ class ForceSetBalance extends Call { this, other, ) || - other is ForceSetBalance && other.who == who && other.newFree == newFree; + other is ForceAdjustTotalIssuance && other.direction == direction && other.delta == delta; @override int get hashCode => Object.hash( - who, - newFree, + direction, + delta, ); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/error.dart index a0652eb57..7d87a1435 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/error.dart @@ -29,11 +29,17 @@ enum Error { /// Number of named reserves exceed `MaxReserves`. tooManyReserves('TooManyReserves', 7), - /// Number of holds exceed `MaxHolds`. + /// Number of holds exceed `VariantCountOf`. tooManyHolds('TooManyHolds', 8), /// Number of freezes exceed `MaxFreezes`. - tooManyFreezes('TooManyFreezes', 9); + tooManyFreezes('TooManyFreezes', 9), + + /// The issuance cannot be modified since it is already deactivated. + issuanceDeactivated('IssuanceDeactivated', 10), + + /// The delta cannot be zero. + deltaZero('DeltaZero', 11); const Error( this.variantName, @@ -83,6 +89,10 @@ class $ErrorCodec with _i1.Codec { return Error.tooManyHolds; case 9: return Error.tooManyFreezes; + case 10: + return Error.issuanceDeactivated; + case 11: + return Error.deltaZero; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/event.dart index bdd9868ef..0be5c7ca0 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/pallet/event.dart @@ -232,6 +232,16 @@ class $Event { amount: amount, ); } + + TotalIssuanceForced totalIssuanceForced({ + required BigInt old, + required BigInt new_, + }) { + return TotalIssuanceForced( + old: old, + new_: new_, + ); + } } class $EventCodec with _i1.Codec { @@ -283,6 +293,8 @@ class $EventCodec with _i1.Codec { return Frozen._decode(input); case 20: return Thawed._decode(input); + case 21: + return TotalIssuanceForced._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); } @@ -357,6 +369,9 @@ class $EventCodec with _i1.Codec { case Thawed: (value as Thawed).encodeTo(output); break; + case TotalIssuanceForced: + (value as TotalIssuanceForced).encodeTo(output); + break; default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -407,6 +422,8 @@ class $EventCodec with _i1.Codec { return (value as Frozen)._sizeHint(); case Thawed: return (value as Thawed)._sizeHint(); + case TotalIssuanceForced: + return (value as TotalIssuanceForced)._sizeHint(); default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -1858,3 +1875,68 @@ class Thawed extends Event { amount, ); } + +/// The `TotalIssuance` was forcefully changed. +class TotalIssuanceForced extends Event { + const TotalIssuanceForced({ + required this.old, + required this.new_, + }); + + factory TotalIssuanceForced._decode(_i1.Input input) { + return TotalIssuanceForced( + old: _i1.U128Codec.codec.decode(input), + new_: _i1.U128Codec.codec.decode(input), + ); + } + + /// T::Balance + final BigInt old; + + /// T::Balance + final BigInt new_; + + @override + Map> toJson() => { + 'TotalIssuanceForced': { + 'old': old, + 'new': new_, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U128Codec.codec.sizeHint(old); + size = size + _i1.U128Codec.codec.sizeHint(new_); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 21, + output, + ); + _i1.U128Codec.codec.encodeTo( + old, + output, + ); + _i1.U128Codec.codec.encodeTo( + new_, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is TotalIssuanceForced && other.old == old && other.new_ == new_; + + @override + int get hashCode => Object.hash( + old, + new_, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/types/adjustment_direction.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/types/adjustment_direction.dart new file mode 100644 index 000000000..75cf19913 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_balances/types/adjustment_direction.dart @@ -0,0 +1,57 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +enum AdjustmentDirection { + increase('Increase', 0), + decrease('Decrease', 1); + + const AdjustmentDirection( + this.variantName, + this.codecIndex, + ); + + factory AdjustmentDirection.decode(_i1.Input input) { + return codec.decode(input); + } + + final String variantName; + + final int codecIndex; + + static const $AdjustmentDirectionCodec codec = $AdjustmentDirectionCodec(); + + String toJson() => variantName; + _i2.Uint8List encode() { + return codec.encode(this); + } +} + +class $AdjustmentDirectionCodec with _i1.Codec { + const $AdjustmentDirectionCodec(); + + @override + AdjustmentDirection decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return AdjustmentDirection.increase; + case 1: + return AdjustmentDirection.decrease; + default: + throw Exception('AdjustmentDirection: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + AdjustmentDirection value, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + value.codecIndex, + output, + ); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_collective/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_collective/pallet/call.dart index 804c36e69..29314067a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_collective/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_collective/pallet/call.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i7; -import '../../encointer_runtime/runtime_call.dart' as _i4; +import '../../encointer_kusama_runtime/runtime_call.dart' as _i4; import '../../primitive_types/h256.dart' as _i5; import '../../sp_core/crypto/account_id32.dart' as _i3; import '../../sp_weights/weight_v2/weight.dart' as _i6; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_collective/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_collective/pallet/error.dart index b345a0fa9..857106844 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_collective/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_collective/pallet/error.dart @@ -33,7 +33,10 @@ enum Error { wrongProposalWeight('WrongProposalWeight', 8), /// The given length bound for the proposal was too low. - wrongProposalLength('WrongProposalLength', 9); + wrongProposalLength('WrongProposalLength', 9), + + /// Prime account is not a member + primeAccountNotMember('PrimeAccountNotMember', 10); const Error( this.variantName, @@ -83,6 +86,8 @@ class $ErrorCodec with _i1.Codec { return Error.wrongProposalWeight; case 9: return Error.wrongProposalLength; + case 10: + return Error.primeAccountNotMember; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_ceremonies/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_ceremonies/pallet/error.dart index 1d12d4871..02d9ee410 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_ceremonies/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_encointer_ceremonies/pallet/error.dart @@ -14,104 +14,107 @@ enum Error { /// verification of signature of attendee failed badAttendeeSignature('BadAttendeeSignature', 2), + /// Bootstrapper reputation is non-transferrable to other accounts for security reasons + bootstrapperReputationIsUntransferrable('BootstrapperReputationIsUntransferrable', 3), + /// meetup location was not found - meetupLocationNotFound('MeetupLocationNotFound', 3), + meetupLocationNotFound('MeetupLocationNotFound', 4), /// meetup time calculation failed - meetupTimeCalculationError('MeetupTimeCalculationError', 4), + meetupTimeCalculationError('MeetupTimeCalculationError', 5), /// no valid claims were supplied - noValidAttestations('NoValidAttestations', 5), + noValidAttestations('NoValidAttestations', 6), /// the action can only be performed during ATTESTING phase - attestationPhaseRequired('AttestationPhaseRequired', 6), + attestationPhaseRequired('AttestationPhaseRequired', 7), /// the action can only be performed during REGISTERING or ATTESTING phase - registeringOrAttestationPhaseRequired('RegisteringOrAttestationPhaseRequired', 7), + registeringOrAttestationPhaseRequired('RegisteringOrAttestationPhaseRequired', 8), /// CommunityIdentifier not found - inexistentCommunity('InexistentCommunity', 8), + inexistentCommunity('InexistentCommunity', 9), /// proof is outdated - proofOutdated('ProofOutdated', 9), + proofOutdated('ProofOutdated', 10), /// proof is acausal - proofAcausal('ProofAcausal', 10), + proofAcausal('ProofAcausal', 11), /// supplied proof is not proving sender - wrongProofSubject('WrongProofSubject', 11), + wrongProofSubject('WrongProofSubject', 12), /// former attendance has not been verified or has already been linked to other account - attendanceUnverifiedOrAlreadyUsed('AttendanceUnverifiedOrAlreadyUsed', 12), + attendanceUnverifiedOrAlreadyUsed('AttendanceUnverifiedOrAlreadyUsed', 13), /// can't have more attestations than other meetup participants - tooManyAttestations('TooManyAttestations', 13), + tooManyAttestations('TooManyAttestations', 14), /// sender has run out of newbie tickets - noMoreNewbieTickets('NoMoreNewbieTickets', 14), + noMoreNewbieTickets('NoMoreNewbieTickets', 15), /// newbie is already endorsed - alreadyEndorsed('AlreadyEndorsed', 15), + alreadyEndorsed('AlreadyEndorsed', 16), /// Participant is not registered - participantIsNotRegistered('ParticipantIsNotRegistered', 16), + participantIsNotRegistered('ParticipantIsNotRegistered', 17), /// No locations are available for assigning participants - noLocationsAvailable('NoLocationsAvailable', 17), + noLocationsAvailable('NoLocationsAvailable', 18), /// Trying to issue rewards in a phase that is not REGISTERING - wrongPhaseForClaimingRewards('WrongPhaseForClaimingRewards', 18), + wrongPhaseForClaimingRewards('WrongPhaseForClaimingRewards', 19), /// Trying to issue rewards for a meetup for which UBI was already issued - rewardsAlreadyIssued('RewardsAlreadyIssued', 19), + rewardsAlreadyIssued('RewardsAlreadyIssued', 20), /// Trying to claim UBI for a meetup where votes are not dependable - votesNotDependable('VotesNotDependable', 20), + votesNotDependable('VotesNotDependable', 21), /// Overflow adding user to registry - registryOverflow('RegistryOverflow', 21), + registryOverflow('RegistryOverflow', 22), /// CheckedMath operation error - checkedMath('CheckedMath', 22), + checkedMath('CheckedMath', 23), /// Only Bootstrappers are allowed to be registered at this time - onlyBootstrappers('OnlyBootstrappers', 23), + onlyBootstrappers('OnlyBootstrappers', 24), /// MeetupTimeOffset can only be changed during registering - wrongPhaseForChangingMeetupTimeOffset('WrongPhaseForChangingMeetupTimeOffset', 24), + wrongPhaseForChangingMeetupTimeOffset('WrongPhaseForChangingMeetupTimeOffset', 25), /// MeetupTimeOffset needs to be in [-8h, 8h] - invalidMeetupTimeOffset('InvalidMeetupTimeOffset', 25), + invalidMeetupTimeOffset('InvalidMeetupTimeOffset', 26), /// the history for given ceremony index and community has been purged - communityCeremonyHistoryPurged('CommunityCeremonyHistoryPurged', 26), + communityCeremonyHistoryPurged('CommunityCeremonyHistoryPurged', 27), /// Unregistering can only be performed during the registering phase - wrongPhaseForUnregistering('WrongPhaseForUnregistering', 27), + wrongPhaseForUnregistering('WrongPhaseForUnregistering', 28), /// Error while finding meetup participants - getMeetupParticipantsError('GetMeetupParticipantsError', 28), + getMeetupParticipantsError('GetMeetupParticipantsError', 29), /// index out of bounds while validating the meetup - meetupValidationIndexOutOfBounds('MeetupValidationIndexOutOfBounds', 29), + meetupValidationIndexOutOfBounds('MeetupValidationIndexOutOfBounds', 30), /// Not possible to pay rewards in attestations phase - earlyRewardsNotPossible('EarlyRewardsNotPossible', 30), + earlyRewardsNotPossible('EarlyRewardsNotPossible', 31), /// Only newbies can upgrade their registration - mustBeNewbieToUpgradeRegistration('MustBeNewbieToUpgradeRegistration', 31), + mustBeNewbieToUpgradeRegistration('MustBeNewbieToUpgradeRegistration', 32), /// To unregister as a reputable you need to provide a provide a community ceremony where you have a linked reputation - reputationCommunityCeremonyRequired('ReputationCommunityCeremonyRequired', 32), + reputationCommunityCeremonyRequired('ReputationCommunityCeremonyRequired', 33), /// In order to unregister a reputable, the provided reputation must be linked - reputationMustBeLinked('ReputationMustBeLinked', 33), + reputationMustBeLinked('ReputationMustBeLinked', 34), /// Meetup Index > Meetup Count or < 1 - invalidMeetupIndex('InvalidMeetupIndex', 34), + invalidMeetupIndex('InvalidMeetupIndex', 35), /// BoundedVec bound reached - tooManyAttestationsInBoundedVec('TooManyAttestationsInBoundedVec', 35); + tooManyAttestationsInBoundedVec('TooManyAttestationsInBoundedVec', 36); const Error( this.variantName, @@ -148,70 +151,72 @@ class $ErrorCodec with _i1.Codec { case 2: return Error.badAttendeeSignature; case 3: - return Error.meetupLocationNotFound; + return Error.bootstrapperReputationIsUntransferrable; case 4: - return Error.meetupTimeCalculationError; + return Error.meetupLocationNotFound; case 5: - return Error.noValidAttestations; + return Error.meetupTimeCalculationError; case 6: - return Error.attestationPhaseRequired; + return Error.noValidAttestations; case 7: - return Error.registeringOrAttestationPhaseRequired; + return Error.attestationPhaseRequired; case 8: - return Error.inexistentCommunity; + return Error.registeringOrAttestationPhaseRequired; case 9: - return Error.proofOutdated; + return Error.inexistentCommunity; case 10: - return Error.proofAcausal; + return Error.proofOutdated; case 11: - return Error.wrongProofSubject; + return Error.proofAcausal; case 12: - return Error.attendanceUnverifiedOrAlreadyUsed; + return Error.wrongProofSubject; case 13: - return Error.tooManyAttestations; + return Error.attendanceUnverifiedOrAlreadyUsed; case 14: - return Error.noMoreNewbieTickets; + return Error.tooManyAttestations; case 15: - return Error.alreadyEndorsed; + return Error.noMoreNewbieTickets; case 16: - return Error.participantIsNotRegistered; + return Error.alreadyEndorsed; case 17: - return Error.noLocationsAvailable; + return Error.participantIsNotRegistered; case 18: - return Error.wrongPhaseForClaimingRewards; + return Error.noLocationsAvailable; case 19: - return Error.rewardsAlreadyIssued; + return Error.wrongPhaseForClaimingRewards; case 20: - return Error.votesNotDependable; + return Error.rewardsAlreadyIssued; case 21: - return Error.registryOverflow; + return Error.votesNotDependable; case 22: - return Error.checkedMath; + return Error.registryOverflow; case 23: - return Error.onlyBootstrappers; + return Error.checkedMath; case 24: - return Error.wrongPhaseForChangingMeetupTimeOffset; + return Error.onlyBootstrappers; case 25: - return Error.invalidMeetupTimeOffset; + return Error.wrongPhaseForChangingMeetupTimeOffset; case 26: - return Error.communityCeremonyHistoryPurged; + return Error.invalidMeetupTimeOffset; case 27: - return Error.wrongPhaseForUnregistering; + return Error.communityCeremonyHistoryPurged; case 28: - return Error.getMeetupParticipantsError; + return Error.wrongPhaseForUnregistering; case 29: - return Error.meetupValidationIndexOutOfBounds; + return Error.getMeetupParticipantsError; case 30: - return Error.earlyRewardsNotPossible; + return Error.meetupValidationIndexOutOfBounds; case 31: - return Error.mustBeNewbieToUpgradeRegistration; + return Error.earlyRewardsNotPossible; case 32: - return Error.reputationCommunityCeremonyRequired; + return Error.mustBeNewbieToUpgradeRegistration; case 33: - return Error.reputationMustBeLinked; + return Error.reputationCommunityCeremonyRequired; case 34: - return Error.invalidMeetupIndex; + return Error.reputationMustBeLinked; case 35: + return Error.invalidMeetupIndex; + case 36: return Error.tooManyAttestationsInBoundedVec; default: throw Exception('Error: Invalid variant index: "$index"'); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/book_state.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/book_state.dart new file mode 100644 index 000000000..e4fa40bb8 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/book_state.dart @@ -0,0 +1,137 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import 'neighbours.dart' as _i2; + +class BookState { + const BookState({ + required this.begin, + required this.end, + required this.count, + this.readyNeighbours, + required this.messageCount, + required this.size, + }); + + factory BookState.decode(_i1.Input input) { + return codec.decode(input); + } + + /// PageIndex + final int begin; + + /// PageIndex + final int end; + + /// PageIndex + final int count; + + /// Option> + final _i2.Neighbours? readyNeighbours; + + /// u64 + final BigInt messageCount; + + /// u64 + final BigInt size; + + static const $BookStateCodec codec = $BookStateCodec(); + + _i3.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'begin': begin, + 'end': end, + 'count': count, + 'readyNeighbours': readyNeighbours?.toJson(), + 'messageCount': messageCount, + 'size': size, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is BookState && + other.begin == begin && + other.end == end && + other.count == count && + other.readyNeighbours == readyNeighbours && + other.messageCount == messageCount && + other.size == size; + + @override + int get hashCode => Object.hash( + begin, + end, + count, + readyNeighbours, + messageCount, + size, + ); +} + +class $BookStateCodec with _i1.Codec { + const $BookStateCodec(); + + @override + void encodeTo( + BookState obj, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + obj.begin, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.end, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.count, + output, + ); + const _i1.OptionCodec<_i2.Neighbours>(_i2.Neighbours.codec).encodeTo( + obj.readyNeighbours, + output, + ); + _i1.U64Codec.codec.encodeTo( + obj.messageCount, + output, + ); + _i1.U64Codec.codec.encodeTo( + obj.size, + output, + ); + } + + @override + BookState decode(_i1.Input input) { + return BookState( + begin: _i1.U32Codec.codec.decode(input), + end: _i1.U32Codec.codec.decode(input), + count: _i1.U32Codec.codec.decode(input), + readyNeighbours: const _i1.OptionCodec<_i2.Neighbours>(_i2.Neighbours.codec).decode(input), + messageCount: _i1.U64Codec.codec.decode(input), + size: _i1.U64Codec.codec.decode(input), + ); + } + + @override + int sizeHint(BookState obj) { + int size = 0; + size = size + _i1.U32Codec.codec.sizeHint(obj.begin); + size = size + _i1.U32Codec.codec.sizeHint(obj.end); + size = size + _i1.U32Codec.codec.sizeHint(obj.count); + size = size + const _i1.OptionCodec<_i2.Neighbours>(_i2.Neighbours.codec).sizeHint(obj.readyNeighbours); + size = size + _i1.U64Codec.codec.sizeHint(obj.messageCount); + size = size + _i1.U64Codec.codec.sizeHint(obj.size); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/neighbours.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/neighbours.dart new file mode 100644 index 000000000..d91f48f6e --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/neighbours.dart @@ -0,0 +1,83 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../cumulus_primitives_core/aggregate_message_origin.dart' as _i2; + +class Neighbours { + const Neighbours({ + required this.prev, + required this.next, + }); + + factory Neighbours.decode(_i1.Input input) { + return codec.decode(input); + } + + /// MessageOrigin + final _i2.AggregateMessageOrigin prev; + + /// MessageOrigin + final _i2.AggregateMessageOrigin next; + + static const $NeighboursCodec codec = $NeighboursCodec(); + + _i3.Uint8List encode() { + return codec.encode(this); + } + + Map> toJson() => { + 'prev': prev.toJson(), + 'next': next.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Neighbours && other.prev == prev && other.next == next; + + @override + int get hashCode => Object.hash( + prev, + next, + ); +} + +class $NeighboursCodec with _i1.Codec { + const $NeighboursCodec(); + + @override + void encodeTo( + Neighbours obj, + _i1.Output output, + ) { + _i2.AggregateMessageOrigin.codec.encodeTo( + obj.prev, + output, + ); + _i2.AggregateMessageOrigin.codec.encodeTo( + obj.next, + output, + ); + } + + @override + Neighbours decode(_i1.Input input) { + return Neighbours( + prev: _i2.AggregateMessageOrigin.codec.decode(input), + next: _i2.AggregateMessageOrigin.codec.decode(input), + ); + } + + @override + int sizeHint(Neighbours obj) { + int size = 0; + size = size + _i2.AggregateMessageOrigin.codec.sizeHint(obj.prev); + size = size + _i2.AggregateMessageOrigin.codec.sizeHint(obj.next); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/page.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/page.dart new file mode 100644 index 000000000..2c6729580 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/page.dart @@ -0,0 +1,139 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i3; + +class Page { + const Page({ + required this.remaining, + required this.remainingSize, + required this.firstIndex, + required this.first, + required this.last, + required this.heap, + }); + + factory Page.decode(_i1.Input input) { + return codec.decode(input); + } + + /// Size + final int remaining; + + /// Size + final int remainingSize; + + /// Size + final int firstIndex; + + /// Size + final int first; + + /// Size + final int last; + + /// BoundedVec> + final List heap; + + static const $PageCodec codec = $PageCodec(); + + _i2.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'remaining': remaining, + 'remainingSize': remainingSize, + 'firstIndex': firstIndex, + 'first': first, + 'last': last, + 'heap': heap, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Page && + other.remaining == remaining && + other.remainingSize == remainingSize && + other.firstIndex == firstIndex && + other.first == first && + other.last == last && + _i3.listsEqual( + other.heap, + heap, + ); + + @override + int get hashCode => Object.hash( + remaining, + remainingSize, + firstIndex, + first, + last, + heap, + ); +} + +class $PageCodec with _i1.Codec { + const $PageCodec(); + + @override + void encodeTo( + Page obj, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + obj.remaining, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.remainingSize, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.firstIndex, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.first, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.last, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + obj.heap, + output, + ); + } + + @override + Page decode(_i1.Input input) { + return Page( + remaining: _i1.U32Codec.codec.decode(input), + remainingSize: _i1.U32Codec.codec.decode(input), + firstIndex: _i1.U32Codec.codec.decode(input), + first: _i1.U32Codec.codec.decode(input), + last: _i1.U32Codec.codec.decode(input), + heap: _i1.U8SequenceCodec.codec.decode(input), + ); + } + + @override + int sizeHint(Page obj) { + int size = 0; + size = size + _i1.U32Codec.codec.sizeHint(obj.remaining); + size = size + _i1.U32Codec.codec.sizeHint(obj.remainingSize); + size = size + _i1.U32Codec.codec.sizeHint(obj.firstIndex); + size = size + _i1.U32Codec.codec.sizeHint(obj.first); + size = size + _i1.U32Codec.codec.sizeHint(obj.last); + size = size + _i1.U8SequenceCodec.codec.sizeHint(obj.heap); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/call.dart new file mode 100644 index 000000000..06b42315c --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/call.dart @@ -0,0 +1,264 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../../cumulus_primitives_core/aggregate_message_origin.dart' as _i3; +import '../../sp_weights/weight_v2/weight.dart' as _i4; + +/// Contains a variant per dispatchable extrinsic that this pallet has. +abstract class Call { + const Call(); + + factory Call.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $CallCodec codec = $CallCodec(); + + static const $Call values = $Call(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map> toJson(); +} + +class $Call { + const $Call(); + + ReapPage reapPage({ + required _i3.AggregateMessageOrigin messageOrigin, + required int pageIndex, + }) { + return ReapPage( + messageOrigin: messageOrigin, + pageIndex: pageIndex, + ); + } + + ExecuteOverweight executeOverweight({ + required _i3.AggregateMessageOrigin messageOrigin, + required int page, + required int index, + required _i4.Weight weightLimit, + }) { + return ExecuteOverweight( + messageOrigin: messageOrigin, + page: page, + index: index, + weightLimit: weightLimit, + ); + } +} + +class $CallCodec with _i1.Codec { + const $CallCodec(); + + @override + Call decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return ReapPage._decode(input); + case 1: + return ExecuteOverweight._decode(input); + default: + throw Exception('Call: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Call value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case ReapPage: + (value as ReapPage).encodeTo(output); + break; + case ExecuteOverweight: + (value as ExecuteOverweight).encodeTo(output); + break; + default: + throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Call value) { + switch (value.runtimeType) { + case ReapPage: + return (value as ReapPage)._sizeHint(); + case ExecuteOverweight: + return (value as ExecuteOverweight)._sizeHint(); + default: + throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +/// See [`Pallet::reap_page`]. +class ReapPage extends Call { + const ReapPage({ + required this.messageOrigin, + required this.pageIndex, + }); + + factory ReapPage._decode(_i1.Input input) { + return ReapPage( + messageOrigin: _i3.AggregateMessageOrigin.codec.decode(input), + pageIndex: _i1.U32Codec.codec.decode(input), + ); + } + + /// MessageOriginOf + final _i3.AggregateMessageOrigin messageOrigin; + + /// PageIndex + final int pageIndex; + + @override + Map> toJson() => { + 'reap_page': { + 'messageOrigin': messageOrigin.toJson(), + 'pageIndex': pageIndex, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i3.AggregateMessageOrigin.codec.sizeHint(messageOrigin); + size = size + _i1.U32Codec.codec.sizeHint(pageIndex); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + _i3.AggregateMessageOrigin.codec.encodeTo( + messageOrigin, + output, + ); + _i1.U32Codec.codec.encodeTo( + pageIndex, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReapPage && other.messageOrigin == messageOrigin && other.pageIndex == pageIndex; + + @override + int get hashCode => Object.hash( + messageOrigin, + pageIndex, + ); +} + +/// See [`Pallet::execute_overweight`]. +class ExecuteOverweight extends Call { + const ExecuteOverweight({ + required this.messageOrigin, + required this.page, + required this.index, + required this.weightLimit, + }); + + factory ExecuteOverweight._decode(_i1.Input input) { + return ExecuteOverweight( + messageOrigin: _i3.AggregateMessageOrigin.codec.decode(input), + page: _i1.U32Codec.codec.decode(input), + index: _i1.U32Codec.codec.decode(input), + weightLimit: _i4.Weight.codec.decode(input), + ); + } + + /// MessageOriginOf + final _i3.AggregateMessageOrigin messageOrigin; + + /// PageIndex + final int page; + + /// T::Size + final int index; + + /// Weight + final _i4.Weight weightLimit; + + @override + Map> toJson() => { + 'execute_overweight': { + 'messageOrigin': messageOrigin.toJson(), + 'page': page, + 'index': index, + 'weightLimit': weightLimit.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i3.AggregateMessageOrigin.codec.sizeHint(messageOrigin); + size = size + _i1.U32Codec.codec.sizeHint(page); + size = size + _i1.U32Codec.codec.sizeHint(index); + size = size + _i4.Weight.codec.sizeHint(weightLimit); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i3.AggregateMessageOrigin.codec.encodeTo( + messageOrigin, + output, + ); + _i1.U32Codec.codec.encodeTo( + page, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + _i4.Weight.codec.encodeTo( + weightLimit, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExecuteOverweight && + other.messageOrigin == messageOrigin && + other.page == page && + other.index == index && + other.weightLimit == weightLimit; + + @override + int get hashCode => Object.hash( + messageOrigin, + page, + index, + weightLimit, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/error.dart new file mode 100644 index 000000000..b2ae63a0d --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/error.dart @@ -0,0 +1,102 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +/// The `Error` enum of this pallet. +enum Error { + /// Page is not reapable because it has items remaining to be processed and is not old + /// enough. + notReapable('NotReapable', 0), + + /// Page to be reaped does not exist. + noPage('NoPage', 1), + + /// The referenced message could not be found. + noMessage('NoMessage', 2), + + /// The message was already processed and cannot be processed again. + alreadyProcessed('AlreadyProcessed', 3), + + /// The message is queued for future execution. + queued('Queued', 4), + + /// There is temporarily not enough weight to continue servicing messages. + insufficientWeight('InsufficientWeight', 5), + + /// This message is temporarily unprocessable. + /// + /// Such errors are expected, but not guaranteed, to resolve themselves eventually through + /// retrying. + temporarilyUnprocessable('TemporarilyUnprocessable', 6), + + /// The queue is paused and no message can be executed from it. + /// + /// This can change at any time and may resolve in the future by re-trying. + queuePaused('QueuePaused', 7), + + /// Another call is in progress and needs to finish before this call can happen. + recursiveDisallowed('RecursiveDisallowed', 8); + + const Error( + this.variantName, + this.codecIndex, + ); + + factory Error.decode(_i1.Input input) { + return codec.decode(input); + } + + final String variantName; + + final int codecIndex; + + static const $ErrorCodec codec = $ErrorCodec(); + + String toJson() => variantName; + _i2.Uint8List encode() { + return codec.encode(this); + } +} + +class $ErrorCodec with _i1.Codec { + const $ErrorCodec(); + + @override + Error decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return Error.notReapable; + case 1: + return Error.noPage; + case 2: + return Error.noMessage; + case 3: + return Error.alreadyProcessed; + case 4: + return Error.queued; + case 5: + return Error.insufficientWeight; + case 6: + return Error.temporarilyUnprocessable; + case 7: + return Error.queuePaused; + case 8: + return Error.recursiveDisallowed; + default: + throw Exception('Error: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Error value, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + value.codecIndex, + output, + ); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/event.dart new file mode 100644 index 000000000..4151bf444 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_message_queue/pallet/event.dart @@ -0,0 +1,510 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i7; + +import '../../cumulus_primitives_core/aggregate_message_origin.dart' as _i4; +import '../../frame_support/traits/messages/process_message_error.dart' as _i5; +import '../../primitive_types/h256.dart' as _i3; +import '../../sp_weights/weight_v2/weight.dart' as _i6; + +/// The `Event` enum of this pallet +abstract class Event { + const Event(); + + factory Event.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $EventCodec codec = $EventCodec(); + + static const $Event values = $Event(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map> toJson(); +} + +class $Event { + const $Event(); + + ProcessingFailed processingFailed({ + required _i3.H256 id, + required _i4.AggregateMessageOrigin origin, + required _i5.ProcessMessageError error, + }) { + return ProcessingFailed( + id: id, + origin: origin, + error: error, + ); + } + + Processed processed({ + required _i3.H256 id, + required _i4.AggregateMessageOrigin origin, + required _i6.Weight weightUsed, + required bool success, + }) { + return Processed( + id: id, + origin: origin, + weightUsed: weightUsed, + success: success, + ); + } + + OverweightEnqueued overweightEnqueued({ + required List id, + required _i4.AggregateMessageOrigin origin, + required int pageIndex, + required int messageIndex, + }) { + return OverweightEnqueued( + id: id, + origin: origin, + pageIndex: pageIndex, + messageIndex: messageIndex, + ); + } + + PageReaped pageReaped({ + required _i4.AggregateMessageOrigin origin, + required int index, + }) { + return PageReaped( + origin: origin, + index: index, + ); + } +} + +class $EventCodec with _i1.Codec { + const $EventCodec(); + + @override + Event decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return ProcessingFailed._decode(input); + case 1: + return Processed._decode(input); + case 2: + return OverweightEnqueued._decode(input); + case 3: + return PageReaped._decode(input); + default: + throw Exception('Event: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Event value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case ProcessingFailed: + (value as ProcessingFailed).encodeTo(output); + break; + case Processed: + (value as Processed).encodeTo(output); + break; + case OverweightEnqueued: + (value as OverweightEnqueued).encodeTo(output); + break; + case PageReaped: + (value as PageReaped).encodeTo(output); + break; + default: + throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Event value) { + switch (value.runtimeType) { + case ProcessingFailed: + return (value as ProcessingFailed)._sizeHint(); + case Processed: + return (value as Processed)._sizeHint(); + case OverweightEnqueued: + return (value as OverweightEnqueued)._sizeHint(); + case PageReaped: + return (value as PageReaped)._sizeHint(); + default: + throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +/// Message discarded due to an error in the `MessageProcessor` (usually a format error). +class ProcessingFailed extends Event { + const ProcessingFailed({ + required this.id, + required this.origin, + required this.error, + }); + + factory ProcessingFailed._decode(_i1.Input input) { + return ProcessingFailed( + id: const _i1.U8ArrayCodec(32).decode(input), + origin: _i4.AggregateMessageOrigin.codec.decode(input), + error: _i5.ProcessMessageError.codec.decode(input), + ); + } + + /// H256 + /// The `blake2_256` hash of the message. + final _i3.H256 id; + + /// MessageOriginOf + /// The queue of the message. + final _i4.AggregateMessageOrigin origin; + + /// ProcessMessageError + /// The error that occurred. + /// + /// This error is pretty opaque. More fine-grained errors need to be emitted as events + /// by the `MessageProcessor`. + final _i5.ProcessMessageError error; + + @override + Map> toJson() => { + 'ProcessingFailed': { + 'id': id.toList(), + 'origin': origin.toJson(), + 'error': error.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.H256Codec().sizeHint(id); + size = size + _i4.AggregateMessageOrigin.codec.sizeHint(origin); + size = size + _i5.ProcessMessageError.codec.sizeHint(error); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + id, + output, + ); + _i4.AggregateMessageOrigin.codec.encodeTo( + origin, + output, + ); + _i5.ProcessMessageError.codec.encodeTo( + error, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ProcessingFailed && + _i7.listsEqual( + other.id, + id, + ) && + other.origin == origin && + other.error == error; + + @override + int get hashCode => Object.hash( + id, + origin, + error, + ); +} + +/// Message is processed. +class Processed extends Event { + const Processed({ + required this.id, + required this.origin, + required this.weightUsed, + required this.success, + }); + + factory Processed._decode(_i1.Input input) { + return Processed( + id: const _i1.U8ArrayCodec(32).decode(input), + origin: _i4.AggregateMessageOrigin.codec.decode(input), + weightUsed: _i6.Weight.codec.decode(input), + success: _i1.BoolCodec.codec.decode(input), + ); + } + + /// H256 + /// The `blake2_256` hash of the message. + final _i3.H256 id; + + /// MessageOriginOf + /// The queue of the message. + final _i4.AggregateMessageOrigin origin; + + /// Weight + /// How much weight was used to process the message. + final _i6.Weight weightUsed; + + /// bool + /// Whether the message was processed. + /// + /// Note that this does not mean that the underlying `MessageProcessor` was internally + /// successful. It *solely* means that the MQ pallet will treat this as a success + /// condition and discard the message. Any internal error needs to be emitted as events + /// by the `MessageProcessor`. + final bool success; + + @override + Map> toJson() => { + 'Processed': { + 'id': id.toList(), + 'origin': origin.toJson(), + 'weightUsed': weightUsed.toJson(), + 'success': success, + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.H256Codec().sizeHint(id); + size = size + _i4.AggregateMessageOrigin.codec.sizeHint(origin); + size = size + _i6.Weight.codec.sizeHint(weightUsed); + size = size + _i1.BoolCodec.codec.sizeHint(success); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + id, + output, + ); + _i4.AggregateMessageOrigin.codec.encodeTo( + origin, + output, + ); + _i6.Weight.codec.encodeTo( + weightUsed, + output, + ); + _i1.BoolCodec.codec.encodeTo( + success, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Processed && + _i7.listsEqual( + other.id, + id, + ) && + other.origin == origin && + other.weightUsed == weightUsed && + other.success == success; + + @override + int get hashCode => Object.hash( + id, + origin, + weightUsed, + success, + ); +} + +/// Message placed in overweight queue. +class OverweightEnqueued extends Event { + const OverweightEnqueued({ + required this.id, + required this.origin, + required this.pageIndex, + required this.messageIndex, + }); + + factory OverweightEnqueued._decode(_i1.Input input) { + return OverweightEnqueued( + id: const _i1.U8ArrayCodec(32).decode(input), + origin: _i4.AggregateMessageOrigin.codec.decode(input), + pageIndex: _i1.U32Codec.codec.decode(input), + messageIndex: _i1.U32Codec.codec.decode(input), + ); + } + + /// [u8; 32] + /// The `blake2_256` hash of the message. + final List id; + + /// MessageOriginOf + /// The queue of the message. + final _i4.AggregateMessageOrigin origin; + + /// PageIndex + /// The page of the message. + final int pageIndex; + + /// T::Size + /// The index of the message within the page. + final int messageIndex; + + @override + Map> toJson() => { + 'OverweightEnqueued': { + 'id': id.toList(), + 'origin': origin.toJson(), + 'pageIndex': pageIndex, + 'messageIndex': messageIndex, + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i1.U8ArrayCodec(32).sizeHint(id); + size = size + _i4.AggregateMessageOrigin.codec.sizeHint(origin); + size = size + _i1.U32Codec.codec.sizeHint(pageIndex); + size = size + _i1.U32Codec.codec.sizeHint(messageIndex); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + id, + output, + ); + _i4.AggregateMessageOrigin.codec.encodeTo( + origin, + output, + ); + _i1.U32Codec.codec.encodeTo( + pageIndex, + output, + ); + _i1.U32Codec.codec.encodeTo( + messageIndex, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is OverweightEnqueued && + _i7.listsEqual( + other.id, + id, + ) && + other.origin == origin && + other.pageIndex == pageIndex && + other.messageIndex == messageIndex; + + @override + int get hashCode => Object.hash( + id, + origin, + pageIndex, + messageIndex, + ); +} + +/// This page was reaped. +class PageReaped extends Event { + const PageReaped({ + required this.origin, + required this.index, + }); + + factory PageReaped._decode(_i1.Input input) { + return PageReaped( + origin: _i4.AggregateMessageOrigin.codec.decode(input), + index: _i1.U32Codec.codec.decode(input), + ); + } + + /// MessageOriginOf + /// The queue of the page. + final _i4.AggregateMessageOrigin origin; + + /// PageIndex + /// The index of the page. + final int index; + + @override + Map> toJson() => { + 'PageReaped': { + 'origin': origin.toJson(), + 'index': index, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i4.AggregateMessageOrigin.codec.sizeHint(origin); + size = size + _i1.U32Codec.codec.sizeHint(index); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + _i4.AggregateMessageOrigin.codec.encodeTo( + origin, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is PageReaped && other.origin == origin && other.index == index; + + @override + int get hashCode => Object.hash( + origin, + index, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/call.dart index c701a62e7..0618998eb 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/call.dart @@ -4,8 +4,8 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i7; -import '../../encointer_runtime/proxy_type.dart' as _i4; -import '../../encointer_runtime/runtime_call.dart' as _i5; +import '../../encointer_kusama_runtime/proxy_type.dart' as _i4; +import '../../encointer_kusama_runtime/runtime_call.dart' as _i5; import '../../primitive_types/h256.dart' as _i6; import '../../sp_runtime/multiaddress/multi_address.dart' as _i3; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/event.dart index 7571928b1..ef60d4677 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/pallet/event.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i7; -import '../../encointer_runtime/proxy_type.dart' as _i5; +import '../../encointer_kusama_runtime/proxy_type.dart' as _i5; import '../../primitive_types/h256.dart' as _i6; import '../../sp_core/crypto/account_id32.dart' as _i4; import '../../sp_runtime/dispatch_error.dart' as _i3; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/proxy_definition.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/proxy_definition.dart index 9554eec32..c80168cf1 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/proxy_definition.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_proxy/proxy_definition.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i4; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i5; -import '../encointer_runtime/proxy_type.dart' as _i3; +import '../encointer_kusama_runtime/proxy_type.dart' as _i3; import '../sp_core/crypto/account_id32.dart' as _i2; class ProxyDefinition { diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/pallet/call.dart index 08602fd23..099474a8e 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/pallet/call.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i5; -import '../../encointer_runtime/runtime_call.dart' as _i4; +import '../../encointer_kusama_runtime/runtime_call.dart' as _i4; import '../../tuples.dart' as _i3; /// Contains a variant per dispatchable extrinsic that this pallet has. diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/scheduled.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/scheduled.dart index 289c3eeee..27f16907e 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/scheduled.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_scheduler/scheduled.dart @@ -3,7 +3,7 @@ import 'dart:typed_data' as _i5; import 'package:polkadart/scale_codec.dart' as _i1; -import '../encointer_runtime/origin_caller.dart' as _i4; +import '../encointer_kusama_runtime/origin_caller.dart' as _i4; import '../frame_support/traits/preimages/bounded.dart' as _i2; import '../tuples.dart' as _i3; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/call.dart index 20fb49383..df2cf0064 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/call.dart @@ -2,7 +2,9 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i5; +import '../../sp_core/crypto/account_id32.dart' as _i4; import '../../sp_runtime/multiaddress/multi_address.dart' as _i3; /// Contains a variant per dispatchable extrinsic that this pallet has. @@ -51,11 +53,11 @@ class $Call { return ApproveProposal(proposalId: proposalId); } - Spend spend({ + SpendLocal spendLocal({ required BigInt amount, required _i3.MultiAddress beneficiary, }) { - return Spend( + return SpendLocal( amount: amount, beneficiary: beneficiary, ); @@ -64,6 +66,32 @@ class $Call { RemoveApproval removeApproval({required BigInt proposalId}) { return RemoveApproval(proposalId: proposalId); } + + Spend spend({ + required dynamic assetKind, + required BigInt amount, + required _i4.AccountId32 beneficiary, + int? validFrom, + }) { + return Spend( + assetKind: assetKind, + amount: amount, + beneficiary: beneficiary, + validFrom: validFrom, + ); + } + + Payout payout({required int index}) { + return Payout(index: index); + } + + CheckStatus checkStatus({required int index}) { + return CheckStatus(index: index); + } + + VoidSpend voidSpend({required int index}) { + return VoidSpend(index: index); + } } class $CallCodec with _i1.Codec { @@ -80,9 +108,17 @@ class $CallCodec with _i1.Codec { case 2: return ApproveProposal._decode(input); case 3: - return Spend._decode(input); + return SpendLocal._decode(input); case 4: return RemoveApproval._decode(input); + case 5: + return Spend._decode(input); + case 6: + return Payout._decode(input); + case 7: + return CheckStatus._decode(input); + case 8: + return VoidSpend._decode(input); default: throw Exception('Call: Invalid variant index: "$index"'); } @@ -103,12 +139,24 @@ class $CallCodec with _i1.Codec { case ApproveProposal: (value as ApproveProposal).encodeTo(output); break; - case Spend: - (value as Spend).encodeTo(output); + case SpendLocal: + (value as SpendLocal).encodeTo(output); break; case RemoveApproval: (value as RemoveApproval).encodeTo(output); break; + case Spend: + (value as Spend).encodeTo(output); + break; + case Payout: + (value as Payout).encodeTo(output); + break; + case CheckStatus: + (value as CheckStatus).encodeTo(output); + break; + case VoidSpend: + (value as VoidSpend).encodeTo(output); + break; default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -123,10 +171,18 @@ class $CallCodec with _i1.Codec { return (value as RejectProposal)._sizeHint(); case ApproveProposal: return (value as ApproveProposal)._sizeHint(); - case Spend: - return (value as Spend)._sizeHint(); + case SpendLocal: + return (value as SpendLocal)._sizeHint(); case RemoveApproval: return (value as RemoveApproval)._sizeHint(); + case Spend: + return (value as Spend)._sizeHint(); + case Payout: + return (value as Payout)._sizeHint(); + case CheckStatus: + return (value as CheckStatus)._sizeHint(); + case VoidSpend: + return (value as VoidSpend)._sizeHint(); default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -288,15 +344,15 @@ class ApproveProposal extends Call { int get hashCode => proposalId.hashCode; } -/// See [`Pallet::spend`]. -class Spend extends Call { - const Spend({ +/// See [`Pallet::spend_local`]. +class SpendLocal extends Call { + const SpendLocal({ required this.amount, required this.beneficiary, }); - factory Spend._decode(_i1.Input input) { - return Spend( + factory SpendLocal._decode(_i1.Input input) { + return SpendLocal( amount: _i1.CompactBigIntCodec.codec.decode(input), beneficiary: _i3.MultiAddress.codec.decode(input), ); @@ -310,7 +366,7 @@ class Spend extends Call { @override Map> toJson() => { - 'spend': { + 'spend_local': { 'amount': amount, 'beneficiary': beneficiary.toJson(), } @@ -344,7 +400,7 @@ class Spend extends Call { this, other, ) || - other is Spend && other.amount == amount && other.beneficiary == beneficiary; + other is SpendLocal && other.amount == amount && other.beneficiary == beneficiary; @override int get hashCode => Object.hash( @@ -397,3 +453,234 @@ class RemoveApproval extends Call { @override int get hashCode => proposalId.hashCode; } + +/// See [`Pallet::spend`]. +class Spend extends Call { + const Spend({ + required this.assetKind, + required this.amount, + required this.beneficiary, + this.validFrom, + }); + + factory Spend._decode(_i1.Input input) { + return Spend( + assetKind: _i1.NullCodec.codec.decode(input), + amount: _i1.CompactBigIntCodec.codec.decode(input), + beneficiary: const _i1.U8ArrayCodec(32).decode(input), + validFrom: const _i1.OptionCodec(_i1.U32Codec.codec).decode(input), + ); + } + + /// Box + final dynamic assetKind; + + /// AssetBalanceOf + final BigInt amount; + + /// Box> + final _i4.AccountId32 beneficiary; + + /// Option> + final int? validFrom; + + @override + Map> toJson() => { + 'spend': { + 'assetKind': null, + 'amount': amount, + 'beneficiary': beneficiary.toList(), + 'validFrom': validFrom, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.NullCodec.codec.sizeHint(assetKind); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(amount); + size = size + const _i4.AccountId32Codec().sizeHint(beneficiary); + size = size + const _i1.OptionCodec(_i1.U32Codec.codec).sizeHint(validFrom); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + _i1.NullCodec.codec.encodeTo( + assetKind, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + amount, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + beneficiary, + output, + ); + const _i1.OptionCodec(_i1.U32Codec.codec).encodeTo( + validFrom, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Spend && + other.assetKind == assetKind && + other.amount == amount && + _i5.listsEqual( + other.beneficiary, + beneficiary, + ) && + other.validFrom == validFrom; + + @override + int get hashCode => Object.hash( + assetKind, + amount, + beneficiary, + validFrom, + ); +} + +/// See [`Pallet::payout`]. +class Payout extends Call { + const Payout({required this.index}); + + factory Payout._decode(_i1.Input input) { + return Payout(index: _i1.U32Codec.codec.decode(input)); + } + + /// SpendIndex + final int index; + + @override + Map> toJson() => { + 'payout': {'index': index} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(index); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Payout && other.index == index; + + @override + int get hashCode => index.hashCode; +} + +/// See [`Pallet::check_status`]. +class CheckStatus extends Call { + const CheckStatus({required this.index}); + + factory CheckStatus._decode(_i1.Input input) { + return CheckStatus(index: _i1.U32Codec.codec.decode(input)); + } + + /// SpendIndex + final int index; + + @override + Map> toJson() => { + 'check_status': {'index': index} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(index); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is CheckStatus && other.index == index; + + @override + int get hashCode => index.hashCode; +} + +/// See [`Pallet::void_spend`]. +class VoidSpend extends Call { + const VoidSpend({required this.index}); + + factory VoidSpend._decode(_i1.Input input) { + return VoidSpend(index: _i1.U32Codec.codec.decode(input)); + } + + /// SpendIndex + final int index; + + @override + Map> toJson() => { + 'void_spend': {'index': index} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(index); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 8, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is VoidSpend && other.index == index; + + @override + int get hashCode => index.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/error.dart index 0ee35e841..f340f4e49 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/error.dart @@ -8,7 +8,7 @@ enum Error { /// Proposer's balance is too low. insufficientProposersBalance('InsufficientProposersBalance', 0), - /// No proposal or bounty at that index. + /// No proposal, bounty or spend at that index. invalidIndex('InvalidIndex', 1), /// Too many approvals in the queue. @@ -19,7 +19,28 @@ enum Error { insufficientPermission('InsufficientPermission', 3), /// Proposal has not been approved. - proposalNotApproved('ProposalNotApproved', 4); + proposalNotApproved('ProposalNotApproved', 4), + + /// The balance of the asset kind is not convertible to the balance of the native asset. + failedToConvertBalance('FailedToConvertBalance', 5), + + /// The spend has expired and cannot be claimed. + spendExpired('SpendExpired', 6), + + /// The spend is not yet eligible for payout. + earlyPayout('EarlyPayout', 7), + + /// The payment has already been attempted. + alreadyAttempted('AlreadyAttempted', 8), + + /// There was some issue with the mechanism of payment. + payoutError('PayoutError', 9), + + /// The payout was not yet attempted/claimed. + notAttempted('NotAttempted', 10), + + /// The payment has neither failed nor succeeded yet. + inconclusive('Inconclusive', 11); const Error( this.variantName, @@ -59,6 +80,20 @@ class $ErrorCodec with _i1.Codec { return Error.insufficientPermission; case 4: return Error.proposalNotApproved; + case 5: + return Error.failedToConvertBalance; + case 6: + return Error.spendExpired; + case 7: + return Error.earlyPayout; + case 8: + return Error.alreadyAttempted; + case 9: + return Error.payoutError; + case 10: + return Error.notAttempted; + case 11: + return Error.inconclusive; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/event.dart index b7730bdc7..e76814ff0 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/pallet/event.dart @@ -97,6 +97,52 @@ class $Event { deactivated: deactivated, ); } + + AssetSpendApproved assetSpendApproved({ + required int index, + required dynamic assetKind, + required BigInt amount, + required _i3.AccountId32 beneficiary, + required int validFrom, + required int expireAt, + }) { + return AssetSpendApproved( + index: index, + assetKind: assetKind, + amount: amount, + beneficiary: beneficiary, + validFrom: validFrom, + expireAt: expireAt, + ); + } + + AssetSpendVoided assetSpendVoided({required int index}) { + return AssetSpendVoided(index: index); + } + + Paid paid({ + required int index, + required dynamic paymentId, + }) { + return Paid( + index: index, + paymentId: paymentId, + ); + } + + PaymentFailed paymentFailed({ + required int index, + required dynamic paymentId, + }) { + return PaymentFailed( + index: index, + paymentId: paymentId, + ); + } + + SpendProcessed spendProcessed({required int index}) { + return SpendProcessed(index: index); + } } class $EventCodec with _i1.Codec { @@ -124,6 +170,16 @@ class $EventCodec with _i1.Codec { return SpendApproved._decode(input); case 8: return UpdatedInactive._decode(input); + case 9: + return AssetSpendApproved._decode(input); + case 10: + return AssetSpendVoided._decode(input); + case 11: + return Paid._decode(input); + case 12: + return PaymentFailed._decode(input); + case 13: + return SpendProcessed._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); } @@ -162,6 +218,21 @@ class $EventCodec with _i1.Codec { case UpdatedInactive: (value as UpdatedInactive).encodeTo(output); break; + case AssetSpendApproved: + (value as AssetSpendApproved).encodeTo(output); + break; + case AssetSpendVoided: + (value as AssetSpendVoided).encodeTo(output); + break; + case Paid: + (value as Paid).encodeTo(output); + break; + case PaymentFailed: + (value as PaymentFailed).encodeTo(output); + break; + case SpendProcessed: + (value as SpendProcessed).encodeTo(output); + break; default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -188,6 +259,16 @@ class $EventCodec with _i1.Codec { return (value as SpendApproved)._sizeHint(); case UpdatedInactive: return (value as UpdatedInactive)._sizeHint(); + case AssetSpendApproved: + return (value as AssetSpendApproved)._sizeHint(); + case AssetSpendVoided: + return (value as AssetSpendVoided)._sizeHint(); + case Paid: + return (value as Paid)._sizeHint(); + case PaymentFailed: + return (value as PaymentFailed)._sizeHint(); + case SpendProcessed: + return (value as SpendProcessed)._sizeHint(); default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -714,3 +795,346 @@ class UpdatedInactive extends Event { deactivated, ); } + +/// A new asset spend proposal has been approved. +class AssetSpendApproved extends Event { + const AssetSpendApproved({ + required this.index, + required this.assetKind, + required this.amount, + required this.beneficiary, + required this.validFrom, + required this.expireAt, + }); + + factory AssetSpendApproved._decode(_i1.Input input) { + return AssetSpendApproved( + index: _i1.U32Codec.codec.decode(input), + assetKind: _i1.NullCodec.codec.decode(input), + amount: _i1.U128Codec.codec.decode(input), + beneficiary: const _i1.U8ArrayCodec(32).decode(input), + validFrom: _i1.U32Codec.codec.decode(input), + expireAt: _i1.U32Codec.codec.decode(input), + ); + } + + /// SpendIndex + final int index; + + /// T::AssetKind + final dynamic assetKind; + + /// AssetBalanceOf + final BigInt amount; + + /// T::Beneficiary + final _i3.AccountId32 beneficiary; + + /// BlockNumberFor + final int validFrom; + + /// BlockNumberFor + final int expireAt; + + @override + Map> toJson() => { + 'AssetSpendApproved': { + 'index': index, + 'assetKind': null, + 'amount': amount, + 'beneficiary': beneficiary.toList(), + 'validFrom': validFrom, + 'expireAt': expireAt, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(index); + size = size + _i1.NullCodec.codec.sizeHint(assetKind); + size = size + _i1.U128Codec.codec.sizeHint(amount); + size = size + const _i3.AccountId32Codec().sizeHint(beneficiary); + size = size + _i1.U32Codec.codec.sizeHint(validFrom); + size = size + _i1.U32Codec.codec.sizeHint(expireAt); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 9, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + _i1.NullCodec.codec.encodeTo( + assetKind, + output, + ); + _i1.U128Codec.codec.encodeTo( + amount, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + beneficiary, + output, + ); + _i1.U32Codec.codec.encodeTo( + validFrom, + output, + ); + _i1.U32Codec.codec.encodeTo( + expireAt, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AssetSpendApproved && + other.index == index && + other.assetKind == assetKind && + other.amount == amount && + _i4.listsEqual( + other.beneficiary, + beneficiary, + ) && + other.validFrom == validFrom && + other.expireAt == expireAt; + + @override + int get hashCode => Object.hash( + index, + assetKind, + amount, + beneficiary, + validFrom, + expireAt, + ); +} + +/// An approved spend was voided. +class AssetSpendVoided extends Event { + const AssetSpendVoided({required this.index}); + + factory AssetSpendVoided._decode(_i1.Input input) { + return AssetSpendVoided(index: _i1.U32Codec.codec.decode(input)); + } + + /// SpendIndex + final int index; + + @override + Map> toJson() => { + 'AssetSpendVoided': {'index': index} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(index); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 10, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AssetSpendVoided && other.index == index; + + @override + int get hashCode => index.hashCode; +} + +/// A payment happened. +class Paid extends Event { + const Paid({ + required this.index, + required this.paymentId, + }); + + factory Paid._decode(_i1.Input input) { + return Paid( + index: _i1.U32Codec.codec.decode(input), + paymentId: _i1.NullCodec.codec.decode(input), + ); + } + + /// SpendIndex + final int index; + + /// ::Id + final dynamic paymentId; + + @override + Map> toJson() => { + 'Paid': { + 'index': index, + 'paymentId': null, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(index); + size = size + _i1.NullCodec.codec.sizeHint(paymentId); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 11, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + _i1.NullCodec.codec.encodeTo( + paymentId, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Paid && other.index == index && other.paymentId == paymentId; + + @override + int get hashCode => Object.hash( + index, + paymentId, + ); +} + +/// A payment failed and can be retried. +class PaymentFailed extends Event { + const PaymentFailed({ + required this.index, + required this.paymentId, + }); + + factory PaymentFailed._decode(_i1.Input input) { + return PaymentFailed( + index: _i1.U32Codec.codec.decode(input), + paymentId: _i1.NullCodec.codec.decode(input), + ); + } + + /// SpendIndex + final int index; + + /// ::Id + final dynamic paymentId; + + @override + Map> toJson() => { + 'PaymentFailed': { + 'index': index, + 'paymentId': null, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(index); + size = size + _i1.NullCodec.codec.sizeHint(paymentId); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 12, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + _i1.NullCodec.codec.encodeTo( + paymentId, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is PaymentFailed && other.index == index && other.paymentId == paymentId; + + @override + int get hashCode => Object.hash( + index, + paymentId, + ); +} + +/// A spend was processed and removed from the storage. It might have been successfully +/// paid or it may have expired. +class SpendProcessed extends Event { + const SpendProcessed({required this.index}); + + factory SpendProcessed._decode(_i1.Input input) { + return SpendProcessed(index: _i1.U32Codec.codec.decode(input)); + } + + /// SpendIndex + final int index; + + @override + Map> toJson() => { + 'SpendProcessed': {'index': index} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(index); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 13, + output, + ); + _i1.U32Codec.codec.encodeTo( + index, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SpendProcessed && other.index == index; + + @override + int get hashCode => index.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/payment_state.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/payment_state.dart new file mode 100644 index 000000000..1582bf2ec --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/payment_state.dart @@ -0,0 +1,181 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +abstract class PaymentState { + const PaymentState(); + + factory PaymentState.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $PaymentStateCodec codec = $PaymentStateCodec(); + + static const $PaymentState values = $PaymentState(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $PaymentState { + const $PaymentState(); + + Pending pending() { + return Pending(); + } + + Attempted attempted({required dynamic id}) { + return Attempted(id: id); + } + + Failed failed() { + return Failed(); + } +} + +class $PaymentStateCodec with _i1.Codec { + const $PaymentStateCodec(); + + @override + PaymentState decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return const Pending(); + case 1: + return Attempted._decode(input); + case 2: + return const Failed(); + default: + throw Exception('PaymentState: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + PaymentState value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Pending: + (value as Pending).encodeTo(output); + break; + case Attempted: + (value as Attempted).encodeTo(output); + break; + case Failed: + (value as Failed).encodeTo(output); + break; + default: + throw Exception('PaymentState: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(PaymentState value) { + switch (value.runtimeType) { + case Pending: + return 1; + case Attempted: + return (value as Attempted)._sizeHint(); + case Failed: + return 1; + default: + throw Exception('PaymentState: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Pending extends PaymentState { + const Pending(); + + @override + Map toJson() => {'Pending': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is Pending; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Attempted extends PaymentState { + const Attempted({required this.id}); + + factory Attempted._decode(_i1.Input input) { + return Attempted(id: _i1.NullCodec.codec.decode(input)); + } + + /// Id + final dynamic id; + + @override + Map> toJson() => { + 'Attempted': {'id': null} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.NullCodec.codec.sizeHint(id); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i1.NullCodec.codec.encodeTo( + id, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Attempted && other.id == id; + + @override + int get hashCode => id.hashCode; +} + +class Failed extends PaymentState { + const Failed(); + + @override + Map toJson() => {'Failed': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + } + + @override + bool operator ==(Object other) => other is Failed; + + @override + int get hashCode => runtimeType.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/spend_status.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/spend_status.dart new file mode 100644 index 000000000..d3d720e0d --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_treasury/spend_status.dart @@ -0,0 +1,142 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i5; + +import '../sp_core/crypto/account_id32.dart' as _i2; +import 'payment_state.dart' as _i3; + +class SpendStatus { + const SpendStatus({ + required this.assetKind, + required this.amount, + required this.beneficiary, + required this.validFrom, + required this.expireAt, + required this.status, + }); + + factory SpendStatus.decode(_i1.Input input) { + return codec.decode(input); + } + + /// AssetKind + final dynamic assetKind; + + /// AssetBalance + final BigInt amount; + + /// Beneficiary + final _i2.AccountId32 beneficiary; + + /// BlockNumber + final int validFrom; + + /// BlockNumber + final int expireAt; + + /// PaymentState + final _i3.PaymentState status; + + static const $SpendStatusCodec codec = $SpendStatusCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'assetKind': null, + 'amount': amount, + 'beneficiary': beneficiary.toList(), + 'validFrom': validFrom, + 'expireAt': expireAt, + 'status': status.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SpendStatus && + other.assetKind == assetKind && + other.amount == amount && + _i5.listsEqual( + other.beneficiary, + beneficiary, + ) && + other.validFrom == validFrom && + other.expireAt == expireAt && + other.status == status; + + @override + int get hashCode => Object.hash( + assetKind, + amount, + beneficiary, + validFrom, + expireAt, + status, + ); +} + +class $SpendStatusCodec with _i1.Codec { + const $SpendStatusCodec(); + + @override + void encodeTo( + SpendStatus obj, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + obj.assetKind, + output, + ); + _i1.U128Codec.codec.encodeTo( + obj.amount, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + obj.beneficiary, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.validFrom, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.expireAt, + output, + ); + _i3.PaymentState.codec.encodeTo( + obj.status, + output, + ); + } + + @override + SpendStatus decode(_i1.Input input) { + return SpendStatus( + assetKind: _i1.NullCodec.codec.decode(input), + amount: _i1.U128Codec.codec.decode(input), + beneficiary: const _i1.U8ArrayCodec(32).decode(input), + validFrom: _i1.U32Codec.codec.decode(input), + expireAt: _i1.U32Codec.codec.decode(input), + status: _i3.PaymentState.codec.decode(input), + ); + } + + @override + int sizeHint(SpendStatus obj) { + int size = 0; + size = size + _i1.NullCodec.codec.sizeHint(obj.assetKind); + size = size + _i1.U128Codec.codec.sizeHint(obj.amount); + size = size + const _i2.AccountId32Codec().sizeHint(obj.beneficiary); + size = size + _i1.U32Codec.codec.sizeHint(obj.validFrom); + size = size + _i1.U32Codec.codec.sizeHint(obj.expireAt); + size = size + _i3.PaymentState.codec.sizeHint(obj.status); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_utility/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_utility/pallet/call.dart index 12a9f7b89..ba0269df5 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_utility/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_utility/pallet/call.dart @@ -4,8 +4,8 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i6; -import '../../encointer_runtime/origin_caller.dart' as _i4; -import '../../encointer_runtime/runtime_call.dart' as _i3; +import '../../encointer_kusama_runtime/origin_caller.dart' as _i4; +import '../../encointer_kusama_runtime/runtime_call.dart' as _i3; import '../../sp_weights/weight_v2/weight.dart' as _i5; /// Contains a variant per dispatchable extrinsic that this pallet has. @@ -165,7 +165,7 @@ class Batch extends Call { final List<_i3.RuntimeCall> calls; @override - Map>>>> toJson() => { + Map>>> toJson() => { 'batch': {'calls': calls.map((value) => value.toJson()).toList()} }; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/call.dart index e45ce07ea..925a8a2e2 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/call.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/call.dart @@ -4,10 +4,10 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import '../../sp_weights/weight_v2/weight.dart' as _i7; -import '../../xcm/v3/multilocation/multi_location.dart' as _i8; +import '../../staging_xcm/v4/location/location.dart' as _i8; import '../../xcm/v3/weight_limit.dart' as _i9; -import '../../xcm/versioned_multi_assets.dart' as _i5; -import '../../xcm/versioned_multi_location.dart' as _i3; +import '../../xcm/versioned_assets.dart' as _i5; +import '../../xcm/versioned_location.dart' as _i3; import '../../xcm/versioned_xcm_1.dart' as _i4; import '../../xcm/versioned_xcm_2.dart' as _i6; @@ -40,7 +40,7 @@ class $Call { const $Call(); Send send({ - required _i3.VersionedMultiLocation dest, + required _i3.VersionedLocation dest, required _i4.VersionedXcm message, }) { return Send( @@ -50,9 +50,9 @@ class $Call { } TeleportAssets teleportAssets({ - required _i3.VersionedMultiLocation dest, - required _i3.VersionedMultiLocation beneficiary, - required _i5.VersionedMultiAssets assets, + required _i3.VersionedLocation dest, + required _i3.VersionedLocation beneficiary, + required _i5.VersionedAssets assets, required int feeAssetItem, }) { return TeleportAssets( @@ -64,9 +64,9 @@ class $Call { } ReserveTransferAssets reserveTransferAssets({ - required _i3.VersionedMultiLocation dest, - required _i3.VersionedMultiLocation beneficiary, - required _i5.VersionedMultiAssets assets, + required _i3.VersionedLocation dest, + required _i3.VersionedLocation beneficiary, + required _i5.VersionedAssets assets, required int feeAssetItem, }) { return ReserveTransferAssets( @@ -88,7 +88,7 @@ class $Call { } ForceXcmVersion forceXcmVersion({ - required _i8.MultiLocation location, + required _i8.Location location, required int version, }) { return ForceXcmVersion( @@ -101,18 +101,18 @@ class $Call { return ForceDefaultXcmVersion(maybeXcmVersion: maybeXcmVersion); } - ForceSubscribeVersionNotify forceSubscribeVersionNotify({required _i3.VersionedMultiLocation location}) { + ForceSubscribeVersionNotify forceSubscribeVersionNotify({required _i3.VersionedLocation location}) { return ForceSubscribeVersionNotify(location: location); } - ForceUnsubscribeVersionNotify forceUnsubscribeVersionNotify({required _i3.VersionedMultiLocation location}) { + ForceUnsubscribeVersionNotify forceUnsubscribeVersionNotify({required _i3.VersionedLocation location}) { return ForceUnsubscribeVersionNotify(location: location); } LimitedReserveTransferAssets limitedReserveTransferAssets({ - required _i3.VersionedMultiLocation dest, - required _i3.VersionedMultiLocation beneficiary, - required _i5.VersionedMultiAssets assets, + required _i3.VersionedLocation dest, + required _i3.VersionedLocation beneficiary, + required _i5.VersionedAssets assets, required int feeAssetItem, required _i9.WeightLimit weightLimit, }) { @@ -126,9 +126,9 @@ class $Call { } LimitedTeleportAssets limitedTeleportAssets({ - required _i3.VersionedMultiLocation dest, - required _i3.VersionedMultiLocation beneficiary, - required _i5.VersionedMultiAssets assets, + required _i3.VersionedLocation dest, + required _i3.VersionedLocation beneficiary, + required _i5.VersionedAssets assets, required int feeAssetItem, required _i9.WeightLimit weightLimit, }) { @@ -144,6 +144,32 @@ class $Call { ForceSuspension forceSuspension({required bool suspended}) { return ForceSuspension(suspended: suspended); } + + TransferAssets transferAssets({ + required _i3.VersionedLocation dest, + required _i3.VersionedLocation beneficiary, + required _i5.VersionedAssets assets, + required int feeAssetItem, + required _i9.WeightLimit weightLimit, + }) { + return TransferAssets( + dest: dest, + beneficiary: beneficiary, + assets: assets, + feeAssetItem: feeAssetItem, + weightLimit: weightLimit, + ); + } + + ClaimAssets claimAssets({ + required _i5.VersionedAssets assets, + required _i3.VersionedLocation beneficiary, + }) { + return ClaimAssets( + assets: assets, + beneficiary: beneficiary, + ); + } } class $CallCodec with _i1.Codec { @@ -175,6 +201,10 @@ class $CallCodec with _i1.Codec { return LimitedTeleportAssets._decode(input); case 10: return ForceSuspension._decode(input); + case 11: + return TransferAssets._decode(input); + case 12: + return ClaimAssets._decode(input); default: throw Exception('Call: Invalid variant index: "$index"'); } @@ -219,6 +249,12 @@ class $CallCodec with _i1.Codec { case ForceSuspension: (value as ForceSuspension).encodeTo(output); break; + case TransferAssets: + (value as TransferAssets).encodeTo(output); + break; + case ClaimAssets: + (value as ClaimAssets).encodeTo(output); + break; default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -249,6 +285,10 @@ class $CallCodec with _i1.Codec { return (value as LimitedTeleportAssets)._sizeHint(); case ForceSuspension: return (value as ForceSuspension)._sizeHint(); + case TransferAssets: + return (value as TransferAssets)._sizeHint(); + case ClaimAssets: + return (value as ClaimAssets)._sizeHint(); default: throw Exception('Call: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -264,13 +304,13 @@ class Send extends Call { factory Send._decode(_i1.Input input) { return Send( - dest: _i3.VersionedMultiLocation.codec.decode(input), + dest: _i3.VersionedLocation.codec.decode(input), message: _i4.VersionedXcm.codec.decode(input), ); } - /// Box - final _i3.VersionedMultiLocation dest; + /// Box + final _i3.VersionedLocation dest; /// Box> final _i4.VersionedXcm message; @@ -285,7 +325,7 @@ class Send extends Call { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(dest); + size = size + _i3.VersionedLocation.codec.sizeHint(dest); size = size + _i4.VersionedXcm.codec.sizeHint(message); return size; } @@ -295,7 +335,7 @@ class Send extends Call { 0, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( dest, output, ); @@ -331,21 +371,21 @@ class TeleportAssets extends Call { factory TeleportAssets._decode(_i1.Input input) { return TeleportAssets( - dest: _i3.VersionedMultiLocation.codec.decode(input), - beneficiary: _i3.VersionedMultiLocation.codec.decode(input), - assets: _i5.VersionedMultiAssets.codec.decode(input), + dest: _i3.VersionedLocation.codec.decode(input), + beneficiary: _i3.VersionedLocation.codec.decode(input), + assets: _i5.VersionedAssets.codec.decode(input), feeAssetItem: _i1.U32Codec.codec.decode(input), ); } - /// Box - final _i3.VersionedMultiLocation dest; + /// Box + final _i3.VersionedLocation dest; - /// Box - final _i3.VersionedMultiLocation beneficiary; + /// Box + final _i3.VersionedLocation beneficiary; - /// Box - final _i5.VersionedMultiAssets assets; + /// Box + final _i5.VersionedAssets assets; /// u32 final int feeAssetItem; @@ -362,9 +402,9 @@ class TeleportAssets extends Call { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(dest); - size = size + _i3.VersionedMultiLocation.codec.sizeHint(beneficiary); - size = size + _i5.VersionedMultiAssets.codec.sizeHint(assets); + size = size + _i3.VersionedLocation.codec.sizeHint(dest); + size = size + _i3.VersionedLocation.codec.sizeHint(beneficiary); + size = size + _i5.VersionedAssets.codec.sizeHint(assets); size = size + _i1.U32Codec.codec.sizeHint(feeAssetItem); return size; } @@ -374,15 +414,15 @@ class TeleportAssets extends Call { 1, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( dest, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( beneficiary, output, ); - _i5.VersionedMultiAssets.codec.encodeTo( + _i5.VersionedAssets.codec.encodeTo( assets, output, ); @@ -424,21 +464,21 @@ class ReserveTransferAssets extends Call { factory ReserveTransferAssets._decode(_i1.Input input) { return ReserveTransferAssets( - dest: _i3.VersionedMultiLocation.codec.decode(input), - beneficiary: _i3.VersionedMultiLocation.codec.decode(input), - assets: _i5.VersionedMultiAssets.codec.decode(input), + dest: _i3.VersionedLocation.codec.decode(input), + beneficiary: _i3.VersionedLocation.codec.decode(input), + assets: _i5.VersionedAssets.codec.decode(input), feeAssetItem: _i1.U32Codec.codec.decode(input), ); } - /// Box - final _i3.VersionedMultiLocation dest; + /// Box + final _i3.VersionedLocation dest; - /// Box - final _i3.VersionedMultiLocation beneficiary; + /// Box + final _i3.VersionedLocation beneficiary; - /// Box - final _i5.VersionedMultiAssets assets; + /// Box + final _i5.VersionedAssets assets; /// u32 final int feeAssetItem; @@ -455,9 +495,9 @@ class ReserveTransferAssets extends Call { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(dest); - size = size + _i3.VersionedMultiLocation.codec.sizeHint(beneficiary); - size = size + _i5.VersionedMultiAssets.codec.sizeHint(assets); + size = size + _i3.VersionedLocation.codec.sizeHint(dest); + size = size + _i3.VersionedLocation.codec.sizeHint(beneficiary); + size = size + _i5.VersionedAssets.codec.sizeHint(assets); size = size + _i1.U32Codec.codec.sizeHint(feeAssetItem); return size; } @@ -467,15 +507,15 @@ class ReserveTransferAssets extends Call { 2, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( dest, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( beneficiary, output, ); - _i5.VersionedMultiAssets.codec.encodeTo( + _i5.VersionedAssets.codec.encodeTo( assets, output, ); @@ -520,7 +560,7 @@ class Execute extends Call { ); } - /// Box::RuntimeCall>> + /// Box::RuntimeCall>> final _i6.VersionedXcm message; /// Weight @@ -580,13 +620,13 @@ class ForceXcmVersion extends Call { factory ForceXcmVersion._decode(_i1.Input input) { return ForceXcmVersion( - location: _i8.MultiLocation.codec.decode(input), + location: _i8.Location.codec.decode(input), version: _i1.U32Codec.codec.decode(input), ); } - /// Box - final _i8.MultiLocation location; + /// Box + final _i8.Location location; /// XcmVersion final int version; @@ -601,7 +641,7 @@ class ForceXcmVersion extends Call { int _sizeHint() { int size = 1; - size = size + _i8.MultiLocation.codec.sizeHint(location); + size = size + _i8.Location.codec.sizeHint(location); size = size + _i1.U32Codec.codec.sizeHint(version); return size; } @@ -611,7 +651,7 @@ class ForceXcmVersion extends Call { 4, output, ); - _i8.MultiLocation.codec.encodeTo( + _i8.Location.codec.encodeTo( location, output, ); @@ -686,11 +726,11 @@ class ForceSubscribeVersionNotify extends Call { const ForceSubscribeVersionNotify({required this.location}); factory ForceSubscribeVersionNotify._decode(_i1.Input input) { - return ForceSubscribeVersionNotify(location: _i3.VersionedMultiLocation.codec.decode(input)); + return ForceSubscribeVersionNotify(location: _i3.VersionedLocation.codec.decode(input)); } - /// Box - final _i3.VersionedMultiLocation location; + /// Box + final _i3.VersionedLocation location; @override Map>>> toJson() => { @@ -699,7 +739,7 @@ class ForceSubscribeVersionNotify extends Call { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(location); + size = size + _i3.VersionedLocation.codec.sizeHint(location); return size; } @@ -708,7 +748,7 @@ class ForceSubscribeVersionNotify extends Call { 6, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( location, output, ); @@ -731,11 +771,11 @@ class ForceUnsubscribeVersionNotify extends Call { const ForceUnsubscribeVersionNotify({required this.location}); factory ForceUnsubscribeVersionNotify._decode(_i1.Input input) { - return ForceUnsubscribeVersionNotify(location: _i3.VersionedMultiLocation.codec.decode(input)); + return ForceUnsubscribeVersionNotify(location: _i3.VersionedLocation.codec.decode(input)); } - /// Box - final _i3.VersionedMultiLocation location; + /// Box + final _i3.VersionedLocation location; @override Map>>> toJson() => { @@ -744,7 +784,7 @@ class ForceUnsubscribeVersionNotify extends Call { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(location); + size = size + _i3.VersionedLocation.codec.sizeHint(location); return size; } @@ -753,7 +793,7 @@ class ForceUnsubscribeVersionNotify extends Call { 7, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( location, output, ); @@ -783,22 +823,22 @@ class LimitedReserveTransferAssets extends Call { factory LimitedReserveTransferAssets._decode(_i1.Input input) { return LimitedReserveTransferAssets( - dest: _i3.VersionedMultiLocation.codec.decode(input), - beneficiary: _i3.VersionedMultiLocation.codec.decode(input), - assets: _i5.VersionedMultiAssets.codec.decode(input), + dest: _i3.VersionedLocation.codec.decode(input), + beneficiary: _i3.VersionedLocation.codec.decode(input), + assets: _i5.VersionedAssets.codec.decode(input), feeAssetItem: _i1.U32Codec.codec.decode(input), weightLimit: _i9.WeightLimit.codec.decode(input), ); } - /// Box - final _i3.VersionedMultiLocation dest; + /// Box + final _i3.VersionedLocation dest; - /// Box - final _i3.VersionedMultiLocation beneficiary; + /// Box + final _i3.VersionedLocation beneficiary; - /// Box - final _i5.VersionedMultiAssets assets; + /// Box + final _i5.VersionedAssets assets; /// u32 final int feeAssetItem; @@ -819,9 +859,9 @@ class LimitedReserveTransferAssets extends Call { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(dest); - size = size + _i3.VersionedMultiLocation.codec.sizeHint(beneficiary); - size = size + _i5.VersionedMultiAssets.codec.sizeHint(assets); + size = size + _i3.VersionedLocation.codec.sizeHint(dest); + size = size + _i3.VersionedLocation.codec.sizeHint(beneficiary); + size = size + _i5.VersionedAssets.codec.sizeHint(assets); size = size + _i1.U32Codec.codec.sizeHint(feeAssetItem); size = size + _i9.WeightLimit.codec.sizeHint(weightLimit); return size; @@ -832,15 +872,15 @@ class LimitedReserveTransferAssets extends Call { 8, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( dest, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( beneficiary, output, ); - _i5.VersionedMultiAssets.codec.encodeTo( + _i5.VersionedAssets.codec.encodeTo( assets, output, ); @@ -889,22 +929,22 @@ class LimitedTeleportAssets extends Call { factory LimitedTeleportAssets._decode(_i1.Input input) { return LimitedTeleportAssets( - dest: _i3.VersionedMultiLocation.codec.decode(input), - beneficiary: _i3.VersionedMultiLocation.codec.decode(input), - assets: _i5.VersionedMultiAssets.codec.decode(input), + dest: _i3.VersionedLocation.codec.decode(input), + beneficiary: _i3.VersionedLocation.codec.decode(input), + assets: _i5.VersionedAssets.codec.decode(input), feeAssetItem: _i1.U32Codec.codec.decode(input), weightLimit: _i9.WeightLimit.codec.decode(input), ); } - /// Box - final _i3.VersionedMultiLocation dest; + /// Box + final _i3.VersionedLocation dest; - /// Box - final _i3.VersionedMultiLocation beneficiary; + /// Box + final _i3.VersionedLocation beneficiary; - /// Box - final _i5.VersionedMultiAssets assets; + /// Box + final _i5.VersionedAssets assets; /// u32 final int feeAssetItem; @@ -925,9 +965,9 @@ class LimitedTeleportAssets extends Call { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(dest); - size = size + _i3.VersionedMultiLocation.codec.sizeHint(beneficiary); - size = size + _i5.VersionedMultiAssets.codec.sizeHint(assets); + size = size + _i3.VersionedLocation.codec.sizeHint(dest); + size = size + _i3.VersionedLocation.codec.sizeHint(beneficiary); + size = size + _i5.VersionedAssets.codec.sizeHint(assets); size = size + _i1.U32Codec.codec.sizeHint(feeAssetItem); size = size + _i9.WeightLimit.codec.sizeHint(weightLimit); return size; @@ -938,15 +978,15 @@ class LimitedTeleportAssets extends Call { 9, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( dest, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( beneficiary, output, ); - _i5.VersionedMultiAssets.codec.encodeTo( + _i5.VersionedAssets.codec.encodeTo( assets, output, ); @@ -1027,3 +1067,174 @@ class ForceSuspension extends Call { @override int get hashCode => suspended.hashCode; } + +/// See [`Pallet::transfer_assets`]. +class TransferAssets extends Call { + const TransferAssets({ + required this.dest, + required this.beneficiary, + required this.assets, + required this.feeAssetItem, + required this.weightLimit, + }); + + factory TransferAssets._decode(_i1.Input input) { + return TransferAssets( + dest: _i3.VersionedLocation.codec.decode(input), + beneficiary: _i3.VersionedLocation.codec.decode(input), + assets: _i5.VersionedAssets.codec.decode(input), + feeAssetItem: _i1.U32Codec.codec.decode(input), + weightLimit: _i9.WeightLimit.codec.decode(input), + ); + } + + /// Box + final _i3.VersionedLocation dest; + + /// Box + final _i3.VersionedLocation beneficiary; + + /// Box + final _i5.VersionedAssets assets; + + /// u32 + final int feeAssetItem; + + /// WeightLimit + final _i9.WeightLimit weightLimit; + + @override + Map> toJson() => { + 'transfer_assets': { + 'dest': dest.toJson(), + 'beneficiary': beneficiary.toJson(), + 'assets': assets.toJson(), + 'feeAssetItem': feeAssetItem, + 'weightLimit': weightLimit.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i3.VersionedLocation.codec.sizeHint(dest); + size = size + _i3.VersionedLocation.codec.sizeHint(beneficiary); + size = size + _i5.VersionedAssets.codec.sizeHint(assets); + size = size + _i1.U32Codec.codec.sizeHint(feeAssetItem); + size = size + _i9.WeightLimit.codec.sizeHint(weightLimit); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 11, + output, + ); + _i3.VersionedLocation.codec.encodeTo( + dest, + output, + ); + _i3.VersionedLocation.codec.encodeTo( + beneficiary, + output, + ); + _i5.VersionedAssets.codec.encodeTo( + assets, + output, + ); + _i1.U32Codec.codec.encodeTo( + feeAssetItem, + output, + ); + _i9.WeightLimit.codec.encodeTo( + weightLimit, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is TransferAssets && + other.dest == dest && + other.beneficiary == beneficiary && + other.assets == assets && + other.feeAssetItem == feeAssetItem && + other.weightLimit == weightLimit; + + @override + int get hashCode => Object.hash( + dest, + beneficiary, + assets, + feeAssetItem, + weightLimit, + ); +} + +/// See [`Pallet::claim_assets`]. +class ClaimAssets extends Call { + const ClaimAssets({ + required this.assets, + required this.beneficiary, + }); + + factory ClaimAssets._decode(_i1.Input input) { + return ClaimAssets( + assets: _i5.VersionedAssets.codec.decode(input), + beneficiary: _i3.VersionedLocation.codec.decode(input), + ); + } + + /// Box + final _i5.VersionedAssets assets; + + /// Box + final _i3.VersionedLocation beneficiary; + + @override + Map>> toJson() => { + 'claim_assets': { + 'assets': assets.toJson(), + 'beneficiary': beneficiary.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i5.VersionedAssets.codec.sizeHint(assets); + size = size + _i3.VersionedLocation.codec.sizeHint(beneficiary); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 12, + output, + ); + _i5.VersionedAssets.codec.encodeTo( + assets, + output, + ); + _i3.VersionedLocation.codec.encodeTo( + beneficiary, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ClaimAssets && other.assets == assets && other.beneficiary == beneficiary; + + @override + int get hashCode => Object.hash( + assets, + beneficiary, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/error.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/error.dart index 308aef168..c1d07b40a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/error.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/error.dart @@ -9,8 +9,8 @@ enum Error { /// to it. unreachable('Unreachable', 0), - /// There was some other issue (i.e. not to do with routing) in sending the message. Perhaps - /// a lack of space for buffering the message. + /// There was some other issue (i.e. not to do with routing) in sending the message. + /// Perhaps a lack of space for buffering the message. sendFailure('SendFailure', 1), /// The message execution fails the filter. @@ -19,7 +19,7 @@ enum Error { /// The message's weight could not be determined. unweighableMessage('UnweighableMessage', 3), - /// The destination `MultiLocation` provided cannot be inverted. + /// The destination `Location` provided cannot be inverted. destinationNotInvertible('DestinationNotInvertible', 4), /// The assets to be sent are empty. @@ -47,8 +47,8 @@ enum Error { /// The location is invalid since it already has a subscription from us. alreadySubscribed('AlreadySubscribed', 12), - /// Invalid asset for the operation. - invalidAsset('InvalidAsset', 13), + /// Could not check-out the assets for teleportation to the destination chain. + cannotCheckOutTeleport('CannotCheckOutTeleport', 13), /// The owner does not own (all) of the asset that they wish to do the operation on. lowBalance('LowBalance', 14), @@ -66,7 +66,22 @@ enum Error { lockNotFound('LockNotFound', 18), /// The unlock operation cannot succeed because there are still consumers of the lock. - inUse('InUse', 19); + inUse('InUse', 19), + + /// Invalid non-concrete asset. + invalidAssetNotConcrete('InvalidAssetNotConcrete', 20), + + /// Invalid asset, reserve chain could not be determined for it. + invalidAssetUnknownReserve('InvalidAssetUnknownReserve', 21), + + /// Invalid asset, do not support remote asset reserves with different fees reserves. + invalidAssetUnsupportedReserve('InvalidAssetUnsupportedReserve', 22), + + /// Too many assets with different reserve locations have been attempted for transfer. + tooManyReserves('TooManyReserves', 23), + + /// Local XCM execution incomplete. + localExecutionIncomplete('LocalExecutionIncomplete', 24); const Error( this.variantName, @@ -123,7 +138,7 @@ class $ErrorCodec with _i1.Codec { case 12: return Error.alreadySubscribed; case 13: - return Error.invalidAsset; + return Error.cannotCheckOutTeleport; case 14: return Error.lowBalance; case 15: @@ -136,6 +151,16 @@ class $ErrorCodec with _i1.Codec { return Error.lockNotFound; case 19: return Error.inUse; + case 20: + return Error.invalidAssetNotConcrete; + case 21: + return Error.invalidAssetUnknownReserve; + case 22: + return Error.invalidAssetUnsupportedReserve; + case 23: + return Error.tooManyReserves; + case 24: + return Error.localExecutionIncomplete; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/event.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/event.dart index fb9695218..a7ee630ea 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/event.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/event.dart @@ -6,16 +6,16 @@ import 'package:quiver/collection.dart' as _i14; import '../../primitive_types/h256.dart' as _i8; import '../../sp_weights/weight_v2/weight.dart' as _i7; -import '../../xcm/v3/instruction_1.dart' as _i13; -import '../../xcm/v3/multiasset/multi_asset.dart' as _i15; -import '../../xcm/v3/multiasset/multi_assets.dart' as _i10; -import '../../xcm/v3/multilocation/multi_location.dart' as _i4; -import '../../xcm/v3/response.dart' as _i6; +import '../../staging_xcm/v4/asset/asset.dart' as _i15; +import '../../staging_xcm/v4/asset/assets.dart' as _i10; +import '../../staging_xcm/v4/instruction_1.dart' as _i13; +import '../../staging_xcm/v4/location/location.dart' as _i4; +import '../../staging_xcm/v4/response.dart' as _i6; +import '../../staging_xcm/v4/traits/outcome.dart' as _i3; +import '../../staging_xcm/v4/xcm_1.dart' as _i5; import '../../xcm/v3/traits/error.dart' as _i11; -import '../../xcm/v3/traits/outcome.dart' as _i3; -import '../../xcm/v3/xcm_1.dart' as _i5; -import '../../xcm/versioned_multi_assets.dart' as _i9; -import '../../xcm/versioned_multi_location.dart' as _i12; +import '../../xcm/versioned_assets.dart' as _i9; +import '../../xcm/versioned_location.dart' as _i12; /// The `Event` enum of this pallet abstract class Event { @@ -50,8 +50,8 @@ class $Event { } Sent sent({ - required _i4.MultiLocation origin, - required _i4.MultiLocation destination, + required _i4.Location origin, + required _i4.Location destination, required _i5.Xcm message, required List messageId, }) { @@ -64,7 +64,7 @@ class $Event { } UnexpectedResponse unexpectedResponse({ - required _i4.MultiLocation origin, + required _i4.Location origin, required BigInt queryId, }) { return UnexpectedResponse( @@ -136,9 +136,9 @@ class $Event { } InvalidResponder invalidResponder({ - required _i4.MultiLocation origin, + required _i4.Location origin, required BigInt queryId, - _i4.MultiLocation? expectedLocation, + _i4.Location? expectedLocation, }) { return InvalidResponder( origin: origin, @@ -148,7 +148,7 @@ class $Event { } InvalidResponderVersion invalidResponderVersion({ - required _i4.MultiLocation origin, + required _i4.Location origin, required BigInt queryId, }) { return InvalidResponderVersion( @@ -163,8 +163,8 @@ class $Event { AssetsTrapped assetsTrapped({ required _i8.H256 hash, - required _i4.MultiLocation origin, - required _i9.VersionedMultiAssets assets, + required _i4.Location origin, + required _i9.VersionedAssets assets, }) { return AssetsTrapped( hash: hash, @@ -174,9 +174,9 @@ class $Event { } VersionChangeNotified versionChangeNotified({ - required _i4.MultiLocation destination, + required _i4.Location destination, required int result, - required _i10.MultiAssets cost, + required _i10.Assets cost, required List messageId, }) { return VersionChangeNotified( @@ -188,7 +188,7 @@ class $Event { } SupportedVersionChanged supportedVersionChanged({ - required _i4.MultiLocation location, + required _i4.Location location, required int version, }) { return SupportedVersionChanged( @@ -198,7 +198,7 @@ class $Event { } NotifyTargetSendFail notifyTargetSendFail({ - required _i4.MultiLocation location, + required _i4.Location location, required BigInt queryId, required _i11.Error error, }) { @@ -210,7 +210,7 @@ class $Event { } NotifyTargetMigrationFail notifyTargetMigrationFail({ - required _i12.VersionedMultiLocation location, + required _i12.VersionedLocation location, required BigInt queryId, }) { return NotifyTargetMigrationFail( @@ -220,7 +220,7 @@ class $Event { } InvalidQuerierVersion invalidQuerierVersion({ - required _i4.MultiLocation origin, + required _i4.Location origin, required BigInt queryId, }) { return InvalidQuerierVersion( @@ -230,10 +230,10 @@ class $Event { } InvalidQuerier invalidQuerier({ - required _i4.MultiLocation origin, + required _i4.Location origin, required BigInt queryId, - required _i4.MultiLocation expectedQuerier, - _i4.MultiLocation? maybeActualQuerier, + required _i4.Location expectedQuerier, + _i4.Location? maybeActualQuerier, }) { return InvalidQuerier( origin: origin, @@ -244,8 +244,8 @@ class $Event { } VersionNotifyStarted versionNotifyStarted({ - required _i4.MultiLocation destination, - required _i10.MultiAssets cost, + required _i4.Location destination, + required _i10.Assets cost, required List messageId, }) { return VersionNotifyStarted( @@ -256,8 +256,8 @@ class $Event { } VersionNotifyRequested versionNotifyRequested({ - required _i4.MultiLocation destination, - required _i10.MultiAssets cost, + required _i4.Location destination, + required _i10.Assets cost, required List messageId, }) { return VersionNotifyRequested( @@ -268,8 +268,8 @@ class $Event { } VersionNotifyUnrequested versionNotifyUnrequested({ - required _i4.MultiLocation destination, - required _i10.MultiAssets cost, + required _i4.Location destination, + required _i10.Assets cost, required List messageId, }) { return VersionNotifyUnrequested( @@ -280,8 +280,8 @@ class $Event { } FeesPaid feesPaid({ - required _i4.MultiLocation paying, - required _i10.MultiAssets fees, + required _i4.Location paying, + required _i10.Assets fees, }) { return FeesPaid( paying: paying, @@ -291,8 +291,8 @@ class $Event { AssetsClaimed assetsClaimed({ required _i8.H256 hash, - required _i4.MultiLocation origin, - required _i9.VersionedMultiAssets assets, + required _i4.Location origin, + required _i9.VersionedAssets assets, }) { return AssetsClaimed( hash: hash, @@ -300,6 +300,10 @@ class $Event { assets: assets, ); } + + VersionMigrationFinished versionMigrationFinished({required int version}) { + return VersionMigrationFinished(version: version); + } } class $EventCodec with _i1.Codec { @@ -355,6 +359,8 @@ class $EventCodec with _i1.Codec { return FeesPaid._decode(input); case 22: return AssetsClaimed._decode(input); + case 23: + return VersionMigrationFinished._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); } @@ -435,6 +441,9 @@ class $EventCodec with _i1.Codec { case AssetsClaimed: (value as AssetsClaimed).encodeTo(output); break; + case VersionMigrationFinished: + (value as VersionMigrationFinished).encodeTo(output); + break; default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -489,6 +498,8 @@ class $EventCodec with _i1.Codec { return (value as FeesPaid)._sizeHint(); case AssetsClaimed: return (value as AssetsClaimed)._sizeHint(); + case VersionMigrationFinished: + return (value as VersionMigrationFinished)._sizeHint(); default: throw Exception('Event: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -507,7 +518,7 @@ class Attempted extends Event { final _i3.Outcome outcome; @override - Map>> toJson() => { + Map>>>> toJson() => { 'Attempted': {'outcome': outcome.toJson()} }; @@ -551,18 +562,18 @@ class Sent extends Event { factory Sent._decode(_i1.Input input) { return Sent( - origin: _i4.MultiLocation.codec.decode(input), - destination: _i4.MultiLocation.codec.decode(input), + origin: _i4.Location.codec.decode(input), + destination: _i4.Location.codec.decode(input), message: const _i1.SequenceCodec<_i13.Instruction>(_i13.Instruction.codec).decode(input), messageId: const _i1.U8ArrayCodec(32).decode(input), ); } - /// MultiLocation - final _i4.MultiLocation origin; + /// Location + final _i4.Location origin; - /// MultiLocation - final _i4.MultiLocation destination; + /// Location + final _i4.Location destination; /// Xcm<()> final _i5.Xcm message; @@ -582,8 +593,8 @@ class Sent extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(origin); - size = size + _i4.MultiLocation.codec.sizeHint(destination); + size = size + _i4.Location.codec.sizeHint(origin); + size = size + _i4.Location.codec.sizeHint(destination); size = size + const _i5.XcmCodec().sizeHint(message); size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); return size; @@ -594,11 +605,11 @@ class Sent extends Event { 1, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( origin, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( destination, output, ); @@ -650,13 +661,13 @@ class UnexpectedResponse extends Event { factory UnexpectedResponse._decode(_i1.Input input) { return UnexpectedResponse( - origin: _i4.MultiLocation.codec.decode(input), + origin: _i4.Location.codec.decode(input), queryId: _i1.U64Codec.codec.decode(input), ); } - /// MultiLocation - final _i4.MultiLocation origin; + /// Location + final _i4.Location origin; /// QueryId final BigInt queryId; @@ -671,7 +682,7 @@ class UnexpectedResponse extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(origin); + size = size + _i4.Location.codec.sizeHint(origin); size = size + _i1.U64Codec.codec.sizeHint(queryId); return size; } @@ -681,7 +692,7 @@ class UnexpectedResponse extends Event { 2, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( origin, output, ); @@ -850,8 +861,8 @@ class Notified extends Event { ); } -/// Query response has been received and query is removed. The registered notification could -/// not be dispatched because the dispatch weight is greater than the maximum weight +/// Query response has been received and query is removed. The registered notification +/// could not be dispatched because the dispatch weight is greater than the maximum weight /// originally budgeted by this runtime for the query result. class NotifyOverweight extends Event { const NotifyOverweight({ @@ -1133,20 +1144,20 @@ class InvalidResponder extends Event { factory InvalidResponder._decode(_i1.Input input) { return InvalidResponder( - origin: _i4.MultiLocation.codec.decode(input), + origin: _i4.Location.codec.decode(input), queryId: _i1.U64Codec.codec.decode(input), - expectedLocation: const _i1.OptionCodec<_i4.MultiLocation>(_i4.MultiLocation.codec).decode(input), + expectedLocation: const _i1.OptionCodec<_i4.Location>(_i4.Location.codec).decode(input), ); } - /// MultiLocation - final _i4.MultiLocation origin; + /// Location + final _i4.Location origin; /// QueryId final BigInt queryId; - /// Option - final _i4.MultiLocation? expectedLocation; + /// Option + final _i4.Location? expectedLocation; @override Map> toJson() => { @@ -1159,9 +1170,9 @@ class InvalidResponder extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(origin); + size = size + _i4.Location.codec.sizeHint(origin); size = size + _i1.U64Codec.codec.sizeHint(queryId); - size = size + const _i1.OptionCodec<_i4.MultiLocation>(_i4.MultiLocation.codec).sizeHint(expectedLocation); + size = size + const _i1.OptionCodec<_i4.Location>(_i4.Location.codec).sizeHint(expectedLocation); return size; } @@ -1170,7 +1181,7 @@ class InvalidResponder extends Event { 8, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( origin, output, ); @@ -1178,7 +1189,7 @@ class InvalidResponder extends Event { queryId, output, ); - const _i1.OptionCodec<_i4.MultiLocation>(_i4.MultiLocation.codec).encodeTo( + const _i1.OptionCodec<_i4.Location>(_i4.Location.codec).encodeTo( expectedLocation, output, ); @@ -1218,13 +1229,13 @@ class InvalidResponderVersion extends Event { factory InvalidResponderVersion._decode(_i1.Input input) { return InvalidResponderVersion( - origin: _i4.MultiLocation.codec.decode(input), + origin: _i4.Location.codec.decode(input), queryId: _i1.U64Codec.codec.decode(input), ); } - /// MultiLocation - final _i4.MultiLocation origin; + /// Location + final _i4.Location origin; /// QueryId final BigInt queryId; @@ -1239,7 +1250,7 @@ class InvalidResponderVersion extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(origin); + size = size + _i4.Location.codec.sizeHint(origin); size = size + _i1.U64Codec.codec.sizeHint(queryId); return size; } @@ -1249,7 +1260,7 @@ class InvalidResponderVersion extends Event { 9, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( origin, output, ); @@ -1330,19 +1341,19 @@ class AssetsTrapped extends Event { factory AssetsTrapped._decode(_i1.Input input) { return AssetsTrapped( hash: const _i1.U8ArrayCodec(32).decode(input), - origin: _i4.MultiLocation.codec.decode(input), - assets: _i9.VersionedMultiAssets.codec.decode(input), + origin: _i4.Location.codec.decode(input), + assets: _i9.VersionedAssets.codec.decode(input), ); } /// H256 final _i8.H256 hash; - /// MultiLocation - final _i4.MultiLocation origin; + /// Location + final _i4.Location origin; - /// VersionedMultiAssets - final _i9.VersionedMultiAssets assets; + /// VersionedAssets + final _i9.VersionedAssets assets; @override Map> toJson() => { @@ -1356,8 +1367,8 @@ class AssetsTrapped extends Event { int _sizeHint() { int size = 1; size = size + const _i8.H256Codec().sizeHint(hash); - size = size + _i4.MultiLocation.codec.sizeHint(origin); - size = size + _i9.VersionedMultiAssets.codec.sizeHint(assets); + size = size + _i4.Location.codec.sizeHint(origin); + size = size + _i9.VersionedAssets.codec.sizeHint(assets); return size; } @@ -1370,11 +1381,11 @@ class AssetsTrapped extends Event { hash, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( origin, output, ); - _i9.VersionedMultiAssets.codec.encodeTo( + _i9.VersionedAssets.codec.encodeTo( assets, output, ); @@ -1415,21 +1426,21 @@ class VersionChangeNotified extends Event { factory VersionChangeNotified._decode(_i1.Input input) { return VersionChangeNotified( - destination: _i4.MultiLocation.codec.decode(input), + destination: _i4.Location.codec.decode(input), result: _i1.U32Codec.codec.decode(input), - cost: const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).decode(input), + cost: const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).decode(input), messageId: const _i1.U8ArrayCodec(32).decode(input), ); } - /// MultiLocation - final _i4.MultiLocation destination; + /// Location + final _i4.Location destination; /// XcmVersion final int result; - /// MultiAssets - final _i10.MultiAssets cost; + /// Assets + final _i10.Assets cost; /// XcmHash final List messageId; @@ -1446,9 +1457,9 @@ class VersionChangeNotified extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(destination); + size = size + _i4.Location.codec.sizeHint(destination); size = size + _i1.U32Codec.codec.sizeHint(result); - size = size + const _i10.MultiAssetsCodec().sizeHint(cost); + size = size + const _i10.AssetsCodec().sizeHint(cost); size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); return size; } @@ -1458,7 +1469,7 @@ class VersionChangeNotified extends Event { 12, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( destination, output, ); @@ -1466,7 +1477,7 @@ class VersionChangeNotified extends Event { result, output, ); - const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).encodeTo( + const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).encodeTo( cost, output, ); @@ -1513,13 +1524,13 @@ class SupportedVersionChanged extends Event { factory SupportedVersionChanged._decode(_i1.Input input) { return SupportedVersionChanged( - location: _i4.MultiLocation.codec.decode(input), + location: _i4.Location.codec.decode(input), version: _i1.U32Codec.codec.decode(input), ); } - /// MultiLocation - final _i4.MultiLocation location; + /// Location + final _i4.Location location; /// XcmVersion final int version; @@ -1534,7 +1545,7 @@ class SupportedVersionChanged extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(location); + size = size + _i4.Location.codec.sizeHint(location); size = size + _i1.U32Codec.codec.sizeHint(version); return size; } @@ -1544,7 +1555,7 @@ class SupportedVersionChanged extends Event { 13, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( location, output, ); @@ -1580,14 +1591,14 @@ class NotifyTargetSendFail extends Event { factory NotifyTargetSendFail._decode(_i1.Input input) { return NotifyTargetSendFail( - location: _i4.MultiLocation.codec.decode(input), + location: _i4.Location.codec.decode(input), queryId: _i1.U64Codec.codec.decode(input), error: _i11.Error.codec.decode(input), ); } - /// MultiLocation - final _i4.MultiLocation location; + /// Location + final _i4.Location location; /// QueryId final BigInt queryId; @@ -1606,7 +1617,7 @@ class NotifyTargetSendFail extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(location); + size = size + _i4.Location.codec.sizeHint(location); size = size + _i1.U64Codec.codec.sizeHint(queryId); size = size + _i11.Error.codec.sizeHint(error); return size; @@ -1617,7 +1628,7 @@ class NotifyTargetSendFail extends Event { 14, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( location, output, ); @@ -1657,13 +1668,13 @@ class NotifyTargetMigrationFail extends Event { factory NotifyTargetMigrationFail._decode(_i1.Input input) { return NotifyTargetMigrationFail( - location: _i12.VersionedMultiLocation.codec.decode(input), + location: _i12.VersionedLocation.codec.decode(input), queryId: _i1.U64Codec.codec.decode(input), ); } - /// VersionedMultiLocation - final _i12.VersionedMultiLocation location; + /// VersionedLocation + final _i12.VersionedLocation location; /// QueryId final BigInt queryId; @@ -1678,7 +1689,7 @@ class NotifyTargetMigrationFail extends Event { int _sizeHint() { int size = 1; - size = size + _i12.VersionedMultiLocation.codec.sizeHint(location); + size = size + _i12.VersionedLocation.codec.sizeHint(location); size = size + _i1.U64Codec.codec.sizeHint(queryId); return size; } @@ -1688,7 +1699,7 @@ class NotifyTargetMigrationFail extends Event { 15, output, ); - _i12.VersionedMultiLocation.codec.encodeTo( + _i12.VersionedLocation.codec.encodeTo( location, output, ); @@ -1728,13 +1739,13 @@ class InvalidQuerierVersion extends Event { factory InvalidQuerierVersion._decode(_i1.Input input) { return InvalidQuerierVersion( - origin: _i4.MultiLocation.codec.decode(input), + origin: _i4.Location.codec.decode(input), queryId: _i1.U64Codec.codec.decode(input), ); } - /// MultiLocation - final _i4.MultiLocation origin; + /// Location + final _i4.Location origin; /// QueryId final BigInt queryId; @@ -1749,7 +1760,7 @@ class InvalidQuerierVersion extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(origin); + size = size + _i4.Location.codec.sizeHint(origin); size = size + _i1.U64Codec.codec.sizeHint(queryId); return size; } @@ -1759,7 +1770,7 @@ class InvalidQuerierVersion extends Event { 16, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( origin, output, ); @@ -1797,24 +1808,24 @@ class InvalidQuerier extends Event { factory InvalidQuerier._decode(_i1.Input input) { return InvalidQuerier( - origin: _i4.MultiLocation.codec.decode(input), + origin: _i4.Location.codec.decode(input), queryId: _i1.U64Codec.codec.decode(input), - expectedQuerier: _i4.MultiLocation.codec.decode(input), - maybeActualQuerier: const _i1.OptionCodec<_i4.MultiLocation>(_i4.MultiLocation.codec).decode(input), + expectedQuerier: _i4.Location.codec.decode(input), + maybeActualQuerier: const _i1.OptionCodec<_i4.Location>(_i4.Location.codec).decode(input), ); } - /// MultiLocation - final _i4.MultiLocation origin; + /// Location + final _i4.Location origin; /// QueryId final BigInt queryId; - /// MultiLocation - final _i4.MultiLocation expectedQuerier; + /// Location + final _i4.Location expectedQuerier; - /// Option - final _i4.MultiLocation? maybeActualQuerier; + /// Option + final _i4.Location? maybeActualQuerier; @override Map> toJson() => { @@ -1828,10 +1839,10 @@ class InvalidQuerier extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(origin); + size = size + _i4.Location.codec.sizeHint(origin); size = size + _i1.U64Codec.codec.sizeHint(queryId); - size = size + _i4.MultiLocation.codec.sizeHint(expectedQuerier); - size = size + const _i1.OptionCodec<_i4.MultiLocation>(_i4.MultiLocation.codec).sizeHint(maybeActualQuerier); + size = size + _i4.Location.codec.sizeHint(expectedQuerier); + size = size + const _i1.OptionCodec<_i4.Location>(_i4.Location.codec).sizeHint(maybeActualQuerier); return size; } @@ -1840,7 +1851,7 @@ class InvalidQuerier extends Event { 17, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( origin, output, ); @@ -1848,11 +1859,11 @@ class InvalidQuerier extends Event { queryId, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( expectedQuerier, output, ); - const _i1.OptionCodec<_i4.MultiLocation>(_i4.MultiLocation.codec).encodeTo( + const _i1.OptionCodec<_i4.Location>(_i4.Location.codec).encodeTo( maybeActualQuerier, output, ); @@ -1890,17 +1901,17 @@ class VersionNotifyStarted extends Event { factory VersionNotifyStarted._decode(_i1.Input input) { return VersionNotifyStarted( - destination: _i4.MultiLocation.codec.decode(input), - cost: const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).decode(input), + destination: _i4.Location.codec.decode(input), + cost: const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).decode(input), messageId: const _i1.U8ArrayCodec(32).decode(input), ); } - /// MultiLocation - final _i4.MultiLocation destination; + /// Location + final _i4.Location destination; - /// MultiAssets - final _i10.MultiAssets cost; + /// Assets + final _i10.Assets cost; /// XcmHash final List messageId; @@ -1916,8 +1927,8 @@ class VersionNotifyStarted extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(destination); - size = size + const _i10.MultiAssetsCodec().sizeHint(cost); + size = size + _i4.Location.codec.sizeHint(destination); + size = size + const _i10.AssetsCodec().sizeHint(cost); size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); return size; } @@ -1927,11 +1938,11 @@ class VersionNotifyStarted extends Event { 18, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( destination, output, ); - const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).encodeTo( + const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).encodeTo( cost, output, ); @@ -1976,17 +1987,17 @@ class VersionNotifyRequested extends Event { factory VersionNotifyRequested._decode(_i1.Input input) { return VersionNotifyRequested( - destination: _i4.MultiLocation.codec.decode(input), - cost: const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).decode(input), + destination: _i4.Location.codec.decode(input), + cost: const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).decode(input), messageId: const _i1.U8ArrayCodec(32).decode(input), ); } - /// MultiLocation - final _i4.MultiLocation destination; + /// Location + final _i4.Location destination; - /// MultiAssets - final _i10.MultiAssets cost; + /// Assets + final _i10.Assets cost; /// XcmHash final List messageId; @@ -2002,8 +2013,8 @@ class VersionNotifyRequested extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(destination); - size = size + const _i10.MultiAssetsCodec().sizeHint(cost); + size = size + _i4.Location.codec.sizeHint(destination); + size = size + const _i10.AssetsCodec().sizeHint(cost); size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); return size; } @@ -2013,11 +2024,11 @@ class VersionNotifyRequested extends Event { 19, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( destination, output, ); - const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).encodeTo( + const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).encodeTo( cost, output, ); @@ -2052,7 +2063,8 @@ class VersionNotifyRequested extends Event { ); } -/// We have requested that a remote chain stops sending us XCM version change notifications. +/// We have requested that a remote chain stops sending us XCM version change +/// notifications. class VersionNotifyUnrequested extends Event { const VersionNotifyUnrequested({ required this.destination, @@ -2062,17 +2074,17 @@ class VersionNotifyUnrequested extends Event { factory VersionNotifyUnrequested._decode(_i1.Input input) { return VersionNotifyUnrequested( - destination: _i4.MultiLocation.codec.decode(input), - cost: const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).decode(input), + destination: _i4.Location.codec.decode(input), + cost: const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).decode(input), messageId: const _i1.U8ArrayCodec(32).decode(input), ); } - /// MultiLocation - final _i4.MultiLocation destination; + /// Location + final _i4.Location destination; - /// MultiAssets - final _i10.MultiAssets cost; + /// Assets + final _i10.Assets cost; /// XcmHash final List messageId; @@ -2088,8 +2100,8 @@ class VersionNotifyUnrequested extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(destination); - size = size + const _i10.MultiAssetsCodec().sizeHint(cost); + size = size + _i4.Location.codec.sizeHint(destination); + size = size + const _i10.AssetsCodec().sizeHint(cost); size = size + const _i1.U8ArrayCodec(32).sizeHint(messageId); return size; } @@ -2099,11 +2111,11 @@ class VersionNotifyUnrequested extends Event { 20, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( destination, output, ); - const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).encodeTo( + const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).encodeTo( cost, output, ); @@ -2147,16 +2159,16 @@ class FeesPaid extends Event { factory FeesPaid._decode(_i1.Input input) { return FeesPaid( - paying: _i4.MultiLocation.codec.decode(input), - fees: const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).decode(input), + paying: _i4.Location.codec.decode(input), + fees: const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).decode(input), ); } - /// MultiLocation - final _i4.MultiLocation paying; + /// Location + final _i4.Location paying; - /// MultiAssets - final _i10.MultiAssets fees; + /// Assets + final _i10.Assets fees; @override Map> toJson() => { @@ -2168,8 +2180,8 @@ class FeesPaid extends Event { int _sizeHint() { int size = 1; - size = size + _i4.MultiLocation.codec.sizeHint(paying); - size = size + const _i10.MultiAssetsCodec().sizeHint(fees); + size = size + _i4.Location.codec.sizeHint(paying); + size = size + const _i10.AssetsCodec().sizeHint(fees); return size; } @@ -2178,11 +2190,11 @@ class FeesPaid extends Event { 21, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( paying, output, ); - const _i1.SequenceCodec<_i15.MultiAsset>(_i15.MultiAsset.codec).encodeTo( + const _i1.SequenceCodec<_i15.Asset>(_i15.Asset.codec).encodeTo( fees, output, ); @@ -2219,19 +2231,19 @@ class AssetsClaimed extends Event { factory AssetsClaimed._decode(_i1.Input input) { return AssetsClaimed( hash: const _i1.U8ArrayCodec(32).decode(input), - origin: _i4.MultiLocation.codec.decode(input), - assets: _i9.VersionedMultiAssets.codec.decode(input), + origin: _i4.Location.codec.decode(input), + assets: _i9.VersionedAssets.codec.decode(input), ); } /// H256 final _i8.H256 hash; - /// MultiLocation - final _i4.MultiLocation origin; + /// Location + final _i4.Location origin; - /// VersionedMultiAssets - final _i9.VersionedMultiAssets assets; + /// VersionedAssets + final _i9.VersionedAssets assets; @override Map> toJson() => { @@ -2245,8 +2257,8 @@ class AssetsClaimed extends Event { int _sizeHint() { int size = 1; size = size + const _i8.H256Codec().sizeHint(hash); - size = size + _i4.MultiLocation.codec.sizeHint(origin); - size = size + _i9.VersionedMultiAssets.codec.sizeHint(assets); + size = size + _i4.Location.codec.sizeHint(origin); + size = size + _i9.VersionedAssets.codec.sizeHint(assets); return size; } @@ -2259,11 +2271,11 @@ class AssetsClaimed extends Event { hash, output, ); - _i4.MultiLocation.codec.encodeTo( + _i4.Location.codec.encodeTo( origin, output, ); - _i9.VersionedMultiAssets.codec.encodeTo( + _i9.VersionedAssets.codec.encodeTo( assets, output, ); @@ -2290,3 +2302,48 @@ class AssetsClaimed extends Event { assets, ); } + +/// A XCM version migration finished. +class VersionMigrationFinished extends Event { + const VersionMigrationFinished({required this.version}); + + factory VersionMigrationFinished._decode(_i1.Input input) { + return VersionMigrationFinished(version: _i1.U32Codec.codec.decode(input)); + } + + /// XcmVersion + final int version; + + @override + Map> toJson() => { + 'VersionMigrationFinished': {'version': version} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(version); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 23, + output, + ); + _i1.U32Codec.codec.encodeTo( + version, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is VersionMigrationFinished && other.version == version; + + @override + int get hashCode => version.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/origin.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/origin.dart index 57543fa45..c6ecba18d 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/origin.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/origin.dart @@ -3,7 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import '../../xcm/v3/multilocation/multi_location.dart' as _i3; +import '../../staging_xcm/v4/location/location.dart' as _i3; abstract class Origin { const Origin(); @@ -32,11 +32,11 @@ abstract class Origin { class $Origin { const $Origin(); - Xcm xcm(_i3.MultiLocation value0) { + Xcm xcm(_i3.Location value0) { return Xcm(value0); } - Response response(_i3.MultiLocation value0) { + Response response(_i3.Location value0) { return Response(value0); } } @@ -91,18 +91,18 @@ class Xcm extends Origin { const Xcm(this.value0); factory Xcm._decode(_i1.Input input) { - return Xcm(_i3.MultiLocation.codec.decode(input)); + return Xcm(_i3.Location.codec.decode(input)); } - /// MultiLocation - final _i3.MultiLocation value0; + /// Location + final _i3.Location value0; @override Map> toJson() => {'Xcm': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i3.MultiLocation.codec.sizeHint(value0); + size = size + _i3.Location.codec.sizeHint(value0); return size; } @@ -111,7 +111,7 @@ class Xcm extends Origin { 0, output, ); - _i3.MultiLocation.codec.encodeTo( + _i3.Location.codec.encodeTo( value0, output, ); @@ -133,18 +133,18 @@ class Response extends Origin { const Response(this.value0); factory Response._decode(_i1.Input input) { - return Response(_i3.MultiLocation.codec.decode(input)); + return Response(_i3.Location.codec.decode(input)); } - /// MultiLocation - final _i3.MultiLocation value0; + /// Location + final _i3.Location value0; @override Map> toJson() => {'Response': value0.toJson()}; int _sizeHint() { int size = 1; - size = size + _i3.MultiLocation.codec.sizeHint(value0); + size = size + _i3.Location.codec.sizeHint(value0); return size; } @@ -153,7 +153,7 @@ class Response extends Origin { 1, output, ); - _i3.MultiLocation.codec.encodeTo( + _i3.Location.codec.encodeTo( value0, output, ); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/query_status.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/query_status.dart index e71653339..31a99e35a 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/query_status.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/query_status.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import '../../tuples.dart' as _i4; -import '../../xcm/versioned_multi_location.dart' as _i3; +import '../../xcm/versioned_location.dart' as _i3; import '../../xcm/versioned_response.dart' as _i5; abstract class QueryStatus { @@ -35,8 +35,8 @@ class $QueryStatus { const $QueryStatus(); Pending pending({ - required _i3.VersionedMultiLocation responder, - _i3.VersionedMultiLocation? maybeMatchQuerier, + required _i3.VersionedLocation responder, + _i3.VersionedLocation? maybeMatchQuerier, _i4.Tuple2? maybeNotify, required int timeout, }) { @@ -49,7 +49,7 @@ class $QueryStatus { } VersionNotifier versionNotifier({ - required _i3.VersionedMultiLocation origin, + required _i3.VersionedLocation origin, required bool isActive, }) { return VersionNotifier( @@ -132,9 +132,8 @@ class Pending extends QueryStatus { factory Pending._decode(_i1.Input input) { return Pending( - responder: _i3.VersionedMultiLocation.codec.decode(input), - maybeMatchQuerier: - const _i1.OptionCodec<_i3.VersionedMultiLocation>(_i3.VersionedMultiLocation.codec).decode(input), + responder: _i3.VersionedLocation.codec.decode(input), + maybeMatchQuerier: const _i1.OptionCodec<_i3.VersionedLocation>(_i3.VersionedLocation.codec).decode(input), maybeNotify: const _i1.OptionCodec<_i4.Tuple2>(_i4.Tuple2Codec( _i1.U8Codec.codec, _i1.U8Codec.codec, @@ -143,11 +142,11 @@ class Pending extends QueryStatus { ); } - /// VersionedMultiLocation - final _i3.VersionedMultiLocation responder; + /// VersionedLocation + final _i3.VersionedLocation responder; - /// Option - final _i3.VersionedMultiLocation? maybeMatchQuerier; + /// Option + final _i3.VersionedLocation? maybeMatchQuerier; /// Option<(u8, u8)> final _i4.Tuple2? maybeNotify; @@ -170,9 +169,8 @@ class Pending extends QueryStatus { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(responder); - size = size + - const _i1.OptionCodec<_i3.VersionedMultiLocation>(_i3.VersionedMultiLocation.codec).sizeHint(maybeMatchQuerier); + size = size + _i3.VersionedLocation.codec.sizeHint(responder); + size = size + const _i1.OptionCodec<_i3.VersionedLocation>(_i3.VersionedLocation.codec).sizeHint(maybeMatchQuerier); size = size + const _i1.OptionCodec<_i4.Tuple2>(_i4.Tuple2Codec( _i1.U8Codec.codec, @@ -187,11 +185,11 @@ class Pending extends QueryStatus { 0, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( responder, output, ); - const _i1.OptionCodec<_i3.VersionedMultiLocation>(_i3.VersionedMultiLocation.codec).encodeTo( + const _i1.OptionCodec<_i3.VersionedLocation>(_i3.VersionedLocation.codec).encodeTo( maybeMatchQuerier, output, ); @@ -237,13 +235,13 @@ class VersionNotifier extends QueryStatus { factory VersionNotifier._decode(_i1.Input input) { return VersionNotifier( - origin: _i3.VersionedMultiLocation.codec.decode(input), + origin: _i3.VersionedLocation.codec.decode(input), isActive: _i1.BoolCodec.codec.decode(input), ); } - /// VersionedMultiLocation - final _i3.VersionedMultiLocation origin; + /// VersionedLocation + final _i3.VersionedLocation origin; /// bool final bool isActive; @@ -258,7 +256,7 @@ class VersionNotifier extends QueryStatus { int _sizeHint() { int size = 1; - size = size + _i3.VersionedMultiLocation.codec.sizeHint(origin); + size = size + _i3.VersionedLocation.codec.sizeHint(origin); size = size + _i1.BoolCodec.codec.sizeHint(isActive); return size; } @@ -268,7 +266,7 @@ class VersionNotifier extends QueryStatus { 1, output, ); - _i3.VersionedMultiLocation.codec.encodeTo( + _i3.VersionedLocation.codec.encodeTo( origin, output, ); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/remote_locked_fungible_record.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/remote_locked_fungible_record.dart index fc5c8ea5b..ebbc88133 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/remote_locked_fungible_record.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/pallet_xcm/pallet/remote_locked_fungible_record.dart @@ -5,7 +5,7 @@ import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i5; import '../../tuples.dart' as _i3; -import '../../xcm/versioned_multi_location.dart' as _i2; +import '../../xcm/versioned_location.dart' as _i2; class RemoteLockedFungibleRecord { const RemoteLockedFungibleRecord({ @@ -22,11 +22,11 @@ class RemoteLockedFungibleRecord { /// u128 final BigInt amount; - /// VersionedMultiLocation - final _i2.VersionedMultiLocation owner; + /// VersionedLocation + final _i2.VersionedLocation owner; - /// VersionedMultiLocation - final _i2.VersionedMultiLocation locker; + /// VersionedLocation + final _i2.VersionedLocation locker; /// BoundedVec<(ConsumerIdentifier, u128), MaxConsumers> final List<_i3.Tuple2> consumers; @@ -85,11 +85,11 @@ class $RemoteLockedFungibleRecordCodec with _i1.Codec>(_i3.Tuple2Codec( _i1.NullCodec.codec, _i1.U128Codec.codec, @@ -119,8 +119,8 @@ class $RemoteLockedFungibleRecordCodec with _i1.Codec>(_i3.Tuple2Codec( _i1.NullCodec.codec, diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_core_primitives/outbound_hrmp_message.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_core_primitives/outbound_hrmp_message.dart index f14a8487d..e86261614 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_core_primitives/outbound_hrmp_message.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_core_primitives/outbound_hrmp_message.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i3; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i4; -import '../polkadot_parachain/primitives/id.dart' as _i2; +import '../polkadot_parachain_primitives/primitives/id.dart' as _i2; class OutboundHrmpMessage { const OutboundHrmpMessage({ diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_parachain_primitives/primitives/head_data.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_parachain_primitives/primitives/head_data.dart new file mode 100644 index 000000000..f95980963 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_parachain_primitives/primitives/head_data.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef HeadData = List; + +class HeadDataCodec with _i1.Codec { + const HeadDataCodec(); + + @override + HeadData decode(_i1.Input input) { + return _i1.U8SequenceCodec.codec.decode(input); + } + + @override + void encodeTo( + HeadData value, + _i1.Output output, + ) { + _i1.U8SequenceCodec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(HeadData value) { + return _i1.U8SequenceCodec.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_parachain_primitives/primitives/id.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_parachain_primitives/primitives/id.dart new file mode 100644 index 000000000..65fd48c55 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_parachain_primitives/primitives/id.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef Id = int; + +class IdCodec with _i1.Codec { + const IdCodec(); + + @override + Id decode(_i1.Input input) { + return _i1.U32Codec.codec.decode(input); + } + + @override + void encodeTo( + Id value, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(Id value) { + return _i1.U32Codec.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/abridged_host_configuration.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/abridged_host_configuration.dart new file mode 100644 index 000000000..d4ba1b0fe --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/abridged_host_configuration.dart @@ -0,0 +1,189 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import 'async_backing/async_backing_params.dart' as _i2; + +class AbridgedHostConfiguration { + const AbridgedHostConfiguration({ + required this.maxCodeSize, + required this.maxHeadDataSize, + required this.maxUpwardQueueCount, + required this.maxUpwardQueueSize, + required this.maxUpwardMessageSize, + required this.maxUpwardMessageNumPerCandidate, + required this.hrmpMaxMessageNumPerCandidate, + required this.validationUpgradeCooldown, + required this.validationUpgradeDelay, + required this.asyncBackingParams, + }); + + factory AbridgedHostConfiguration.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u32 + final int maxCodeSize; + + /// u32 + final int maxHeadDataSize; + + /// u32 + final int maxUpwardQueueCount; + + /// u32 + final int maxUpwardQueueSize; + + /// u32 + final int maxUpwardMessageSize; + + /// u32 + final int maxUpwardMessageNumPerCandidate; + + /// u32 + final int hrmpMaxMessageNumPerCandidate; + + /// BlockNumber + final int validationUpgradeCooldown; + + /// BlockNumber + final int validationUpgradeDelay; + + /// AsyncBackingParams + final _i2.AsyncBackingParams asyncBackingParams; + + static const $AbridgedHostConfigurationCodec codec = $AbridgedHostConfigurationCodec(); + + _i3.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'maxCodeSize': maxCodeSize, + 'maxHeadDataSize': maxHeadDataSize, + 'maxUpwardQueueCount': maxUpwardQueueCount, + 'maxUpwardQueueSize': maxUpwardQueueSize, + 'maxUpwardMessageSize': maxUpwardMessageSize, + 'maxUpwardMessageNumPerCandidate': maxUpwardMessageNumPerCandidate, + 'hrmpMaxMessageNumPerCandidate': hrmpMaxMessageNumPerCandidate, + 'validationUpgradeCooldown': validationUpgradeCooldown, + 'validationUpgradeDelay': validationUpgradeDelay, + 'asyncBackingParams': asyncBackingParams.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AbridgedHostConfiguration && + other.maxCodeSize == maxCodeSize && + other.maxHeadDataSize == maxHeadDataSize && + other.maxUpwardQueueCount == maxUpwardQueueCount && + other.maxUpwardQueueSize == maxUpwardQueueSize && + other.maxUpwardMessageSize == maxUpwardMessageSize && + other.maxUpwardMessageNumPerCandidate == maxUpwardMessageNumPerCandidate && + other.hrmpMaxMessageNumPerCandidate == hrmpMaxMessageNumPerCandidate && + other.validationUpgradeCooldown == validationUpgradeCooldown && + other.validationUpgradeDelay == validationUpgradeDelay && + other.asyncBackingParams == asyncBackingParams; + + @override + int get hashCode => Object.hash( + maxCodeSize, + maxHeadDataSize, + maxUpwardQueueCount, + maxUpwardQueueSize, + maxUpwardMessageSize, + maxUpwardMessageNumPerCandidate, + hrmpMaxMessageNumPerCandidate, + validationUpgradeCooldown, + validationUpgradeDelay, + asyncBackingParams, + ); +} + +class $AbridgedHostConfigurationCodec with _i1.Codec { + const $AbridgedHostConfigurationCodec(); + + @override + void encodeTo( + AbridgedHostConfiguration obj, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + obj.maxCodeSize, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.maxHeadDataSize, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.maxUpwardQueueCount, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.maxUpwardQueueSize, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.maxUpwardMessageSize, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.maxUpwardMessageNumPerCandidate, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.hrmpMaxMessageNumPerCandidate, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.validationUpgradeCooldown, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.validationUpgradeDelay, + output, + ); + _i2.AsyncBackingParams.codec.encodeTo( + obj.asyncBackingParams, + output, + ); + } + + @override + AbridgedHostConfiguration decode(_i1.Input input) { + return AbridgedHostConfiguration( + maxCodeSize: _i1.U32Codec.codec.decode(input), + maxHeadDataSize: _i1.U32Codec.codec.decode(input), + maxUpwardQueueCount: _i1.U32Codec.codec.decode(input), + maxUpwardQueueSize: _i1.U32Codec.codec.decode(input), + maxUpwardMessageSize: _i1.U32Codec.codec.decode(input), + maxUpwardMessageNumPerCandidate: _i1.U32Codec.codec.decode(input), + hrmpMaxMessageNumPerCandidate: _i1.U32Codec.codec.decode(input), + validationUpgradeCooldown: _i1.U32Codec.codec.decode(input), + validationUpgradeDelay: _i1.U32Codec.codec.decode(input), + asyncBackingParams: _i2.AsyncBackingParams.codec.decode(input), + ); + } + + @override + int sizeHint(AbridgedHostConfiguration obj) { + int size = 0; + size = size + _i1.U32Codec.codec.sizeHint(obj.maxCodeSize); + size = size + _i1.U32Codec.codec.sizeHint(obj.maxHeadDataSize); + size = size + _i1.U32Codec.codec.sizeHint(obj.maxUpwardQueueCount); + size = size + _i1.U32Codec.codec.sizeHint(obj.maxUpwardQueueSize); + size = size + _i1.U32Codec.codec.sizeHint(obj.maxUpwardMessageSize); + size = size + _i1.U32Codec.codec.sizeHint(obj.maxUpwardMessageNumPerCandidate); + size = size + _i1.U32Codec.codec.sizeHint(obj.hrmpMaxMessageNumPerCandidate); + size = size + _i1.U32Codec.codec.sizeHint(obj.validationUpgradeCooldown); + size = size + _i1.U32Codec.codec.sizeHint(obj.validationUpgradeDelay); + size = size + _i2.AsyncBackingParams.codec.sizeHint(obj.asyncBackingParams); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/abridged_hrmp_channel.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/abridged_hrmp_channel.dart new file mode 100644 index 000000000..2d9fad211 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/abridged_hrmp_channel.dart @@ -0,0 +1,137 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../../primitive_types/h256.dart' as _i2; + +class AbridgedHrmpChannel { + const AbridgedHrmpChannel({ + required this.maxCapacity, + required this.maxTotalSize, + required this.maxMessageSize, + required this.msgCount, + required this.totalSize, + this.mqcHead, + }); + + factory AbridgedHrmpChannel.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u32 + final int maxCapacity; + + /// u32 + final int maxTotalSize; + + /// u32 + final int maxMessageSize; + + /// u32 + final int msgCount; + + /// u32 + final int totalSize; + + /// Option + final _i2.H256? mqcHead; + + static const $AbridgedHrmpChannelCodec codec = $AbridgedHrmpChannelCodec(); + + _i3.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'maxCapacity': maxCapacity, + 'maxTotalSize': maxTotalSize, + 'maxMessageSize': maxMessageSize, + 'msgCount': msgCount, + 'totalSize': totalSize, + 'mqcHead': mqcHead?.toList(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AbridgedHrmpChannel && + other.maxCapacity == maxCapacity && + other.maxTotalSize == maxTotalSize && + other.maxMessageSize == maxMessageSize && + other.msgCount == msgCount && + other.totalSize == totalSize && + other.mqcHead == mqcHead; + + @override + int get hashCode => Object.hash( + maxCapacity, + maxTotalSize, + maxMessageSize, + msgCount, + totalSize, + mqcHead, + ); +} + +class $AbridgedHrmpChannelCodec with _i1.Codec { + const $AbridgedHrmpChannelCodec(); + + @override + void encodeTo( + AbridgedHrmpChannel obj, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + obj.maxCapacity, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.maxTotalSize, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.maxMessageSize, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.msgCount, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.totalSize, + output, + ); + const _i1.OptionCodec<_i2.H256>(_i2.H256Codec()).encodeTo( + obj.mqcHead, + output, + ); + } + + @override + AbridgedHrmpChannel decode(_i1.Input input) { + return AbridgedHrmpChannel( + maxCapacity: _i1.U32Codec.codec.decode(input), + maxTotalSize: _i1.U32Codec.codec.decode(input), + maxMessageSize: _i1.U32Codec.codec.decode(input), + msgCount: _i1.U32Codec.codec.decode(input), + totalSize: _i1.U32Codec.codec.decode(input), + mqcHead: const _i1.OptionCodec<_i2.H256>(_i2.H256Codec()).decode(input), + ); + } + + @override + int sizeHint(AbridgedHrmpChannel obj) { + int size = 0; + size = size + _i1.U32Codec.codec.sizeHint(obj.maxCapacity); + size = size + _i1.U32Codec.codec.sizeHint(obj.maxTotalSize); + size = size + _i1.U32Codec.codec.sizeHint(obj.maxMessageSize); + size = size + _i1.U32Codec.codec.sizeHint(obj.msgCount); + size = size + _i1.U32Codec.codec.sizeHint(obj.totalSize); + size = size + const _i1.OptionCodec<_i2.H256>(_i2.H256Codec()).sizeHint(obj.mqcHead); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/async_backing/async_backing_params.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/async_backing/async_backing_params.dart new file mode 100644 index 000000000..00f090af9 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/async_backing/async_backing_params.dart @@ -0,0 +1,83 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +class AsyncBackingParams { + const AsyncBackingParams({ + required this.maxCandidateDepth, + required this.allowedAncestryLen, + }); + + factory AsyncBackingParams.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u32 + final int maxCandidateDepth; + + /// u32 + final int allowedAncestryLen; + + static const $AsyncBackingParamsCodec codec = $AsyncBackingParamsCodec(); + + _i2.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'maxCandidateDepth': maxCandidateDepth, + 'allowedAncestryLen': allowedAncestryLen, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AsyncBackingParams && + other.maxCandidateDepth == maxCandidateDepth && + other.allowedAncestryLen == allowedAncestryLen; + + @override + int get hashCode => Object.hash( + maxCandidateDepth, + allowedAncestryLen, + ); +} + +class $AsyncBackingParamsCodec with _i1.Codec { + const $AsyncBackingParamsCodec(); + + @override + void encodeTo( + AsyncBackingParams obj, + _i1.Output output, + ) { + _i1.U32Codec.codec.encodeTo( + obj.maxCandidateDepth, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.allowedAncestryLen, + output, + ); + } + + @override + AsyncBackingParams decode(_i1.Input input) { + return AsyncBackingParams( + maxCandidateDepth: _i1.U32Codec.codec.decode(input), + allowedAncestryLen: _i1.U32Codec.codec.decode(input), + ); + } + + @override + int sizeHint(AsyncBackingParams obj) { + int size = 0; + size = size + _i1.U32Codec.codec.sizeHint(obj.maxCandidateDepth); + size = size + _i1.U32Codec.codec.sizeHint(obj.allowedAncestryLen); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/persisted_validation_data.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/persisted_validation_data.dart new file mode 100644 index 000000000..1dd7d71ec --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/persisted_validation_data.dart @@ -0,0 +1,119 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i5; + +import '../../polkadot_parachain_primitives/primitives/head_data.dart' as _i2; +import '../../primitive_types/h256.dart' as _i3; + +class PersistedValidationData { + const PersistedValidationData({ + required this.parentHead, + required this.relayParentNumber, + required this.relayParentStorageRoot, + required this.maxPovSize, + }); + + factory PersistedValidationData.decode(_i1.Input input) { + return codec.decode(input); + } + + /// HeadData + final _i2.HeadData parentHead; + + /// N + final int relayParentNumber; + + /// H + final _i3.H256 relayParentStorageRoot; + + /// u32 + final int maxPovSize; + + static const $PersistedValidationDataCodec codec = $PersistedValidationDataCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'parentHead': parentHead, + 'relayParentNumber': relayParentNumber, + 'relayParentStorageRoot': relayParentStorageRoot.toList(), + 'maxPovSize': maxPovSize, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is PersistedValidationData && + _i5.listsEqual( + other.parentHead, + parentHead, + ) && + other.relayParentNumber == relayParentNumber && + _i5.listsEqual( + other.relayParentStorageRoot, + relayParentStorageRoot, + ) && + other.maxPovSize == maxPovSize; + + @override + int get hashCode => Object.hash( + parentHead, + relayParentNumber, + relayParentStorageRoot, + maxPovSize, + ); +} + +class $PersistedValidationDataCodec with _i1.Codec { + const $PersistedValidationDataCodec(); + + @override + void encodeTo( + PersistedValidationData obj, + _i1.Output output, + ) { + _i1.U8SequenceCodec.codec.encodeTo( + obj.parentHead, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.relayParentNumber, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + obj.relayParentStorageRoot, + output, + ); + _i1.U32Codec.codec.encodeTo( + obj.maxPovSize, + output, + ); + } + + @override + PersistedValidationData decode(_i1.Input input) { + return PersistedValidationData( + parentHead: _i1.U8SequenceCodec.codec.decode(input), + relayParentNumber: _i1.U32Codec.codec.decode(input), + relayParentStorageRoot: const _i1.U8ArrayCodec(32).decode(input), + maxPovSize: _i1.U32Codec.codec.decode(input), + ); + } + + @override + int sizeHint(PersistedValidationData obj) { + int size = 0; + size = size + const _i2.HeadDataCodec().sizeHint(obj.parentHead); + size = size + _i1.U32Codec.codec.sizeHint(obj.relayParentNumber); + size = size + const _i3.H256Codec().sizeHint(obj.relayParentStorageRoot); + size = size + _i1.U32Codec.codec.sizeHint(obj.maxPovSize); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/upgrade_go_ahead.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/upgrade_go_ahead.dart new file mode 100644 index 000000000..38852c91e --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/upgrade_go_ahead.dart @@ -0,0 +1,57 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +enum UpgradeGoAhead { + abort('Abort', 0), + goAhead('GoAhead', 1); + + const UpgradeGoAhead( + this.variantName, + this.codecIndex, + ); + + factory UpgradeGoAhead.decode(_i1.Input input) { + return codec.decode(input); + } + + final String variantName; + + final int codecIndex; + + static const $UpgradeGoAheadCodec codec = $UpgradeGoAheadCodec(); + + String toJson() => variantName; + _i2.Uint8List encode() { + return codec.encode(this); + } +} + +class $UpgradeGoAheadCodec with _i1.Codec { + const $UpgradeGoAheadCodec(); + + @override + UpgradeGoAhead decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return UpgradeGoAhead.abort; + case 1: + return UpgradeGoAhead.goAhead; + default: + throw Exception('UpgradeGoAhead: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + UpgradeGoAhead value, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + value.codecIndex, + output, + ); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/upgrade_restriction.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/upgrade_restriction.dart new file mode 100644 index 000000000..940a264be --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/polkadot_primitives/v6/upgrade_restriction.dart @@ -0,0 +1,54 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +enum UpgradeRestriction { + present('Present', 0); + + const UpgradeRestriction( + this.variantName, + this.codecIndex, + ); + + factory UpgradeRestriction.decode(_i1.Input input) { + return codec.decode(input); + } + + final String variantName; + + final int codecIndex; + + static const $UpgradeRestrictionCodec codec = $UpgradeRestrictionCodec(); + + String toJson() => variantName; + _i2.Uint8List encode() { + return codec.encode(this); + } +} + +class $UpgradeRestrictionCodec with _i1.Codec { + const $UpgradeRestrictionCodec(); + + @override + UpgradeRestriction decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return UpgradeRestriction.present; + default: + throw Exception('UpgradeRestriction: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + UpgradeRestriction value, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + value.codecIndex, + output, + ); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_runtime/traits/blake_two256.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_runtime/traits/blake_two256.dart new file mode 100644 index 000000000..84c37e184 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_runtime/traits/blake_two256.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef BlakeTwo256 = dynamic; + +class BlakeTwo256Codec with _i1.Codec { + const BlakeTwo256Codec(); + + @override + BlakeTwo256 decode(_i1.Input input) { + return _i1.NullCodec.codec.decode(input); + } + + @override + void encodeTo( + BlakeTwo256 value, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(BlakeTwo256 value) { + return _i1.NullCodec.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_trie/storage_proof/storage_proof.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_trie/storage_proof/storage_proof.dart index 2e142ee10..2f4bf6c3f 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_trie/storage_proof/storage_proof.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/sp_trie/storage_proof/storage_proof.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i3; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i4; -import '../../b_tree_set.dart' as _i2; +import '../../b_tree_set_1.dart' as _i2; class StorageProof { const StorageProof({required this.trieNodes}); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_parachain_info/pallet/call.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_parachain_info/pallet/call.dart new file mode 100644 index 000000000..2131386ac --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_parachain_info/pallet/call.dart @@ -0,0 +1,30 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +/// Contains a variant per dispatchable extrinsic that this pallet has. +typedef Call = dynamic; + +class CallCodec with _i1.Codec { + const CallCodec(); + + @override + Call decode(_i1.Input input) { + return _i1.NullCodec.codec.decode(input); + } + + @override + void encodeTo( + Call value, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(Call value) { + return _i1.NullCodec.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v3/multilocation/multi_location.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v3/multilocation/multi_location.dart new file mode 100644 index 000000000..ea99a1131 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v3/multilocation/multi_location.dart @@ -0,0 +1,83 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../../../xcm/v3/junctions/junctions.dart' as _i2; + +class MultiLocation { + const MultiLocation({ + required this.parents, + required this.interior, + }); + + factory MultiLocation.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u8 + final int parents; + + /// Junctions + final _i2.Junctions interior; + + static const $MultiLocationCodec codec = $MultiLocationCodec(); + + _i3.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'parents': parents, + 'interior': interior.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is MultiLocation && other.parents == parents && other.interior == interior; + + @override + int get hashCode => Object.hash( + parents, + interior, + ); +} + +class $MultiLocationCodec with _i1.Codec { + const $MultiLocationCodec(); + + @override + void encodeTo( + MultiLocation obj, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + obj.parents, + output, + ); + _i2.Junctions.codec.encodeTo( + obj.interior, + output, + ); + } + + @override + MultiLocation decode(_i1.Input input) { + return MultiLocation( + parents: _i1.U8Codec.codec.decode(input), + interior: _i2.Junctions.codec.decode(input), + ); + } + + @override + int sizeHint(MultiLocation obj) { + int size = 0; + size = size + _i1.U8Codec.codec.sizeHint(obj.parents); + size = size + _i2.Junctions.codec.sizeHint(obj.interior); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset.dart new file mode 100644 index 000000000..c5ac12e3a --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset.dart @@ -0,0 +1,85 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../location/location.dart' as _i5; +import 'asset_id.dart' as _i2; +import 'fungibility.dart' as _i3; + +class Asset { + const Asset({ + required this.id, + required this.fun, + }); + + factory Asset.decode(_i1.Input input) { + return codec.decode(input); + } + + /// AssetId + final _i2.AssetId id; + + /// Fungibility + final _i3.Fungibility fun; + + static const $AssetCodec codec = $AssetCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map> toJson() => { + 'id': id.toJson(), + 'fun': fun.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Asset && other.id == id && other.fun == fun; + + @override + int get hashCode => Object.hash( + id, + fun, + ); +} + +class $AssetCodec with _i1.Codec { + const $AssetCodec(); + + @override + void encodeTo( + Asset obj, + _i1.Output output, + ) { + _i5.Location.codec.encodeTo( + obj.id, + output, + ); + _i3.Fungibility.codec.encodeTo( + obj.fun, + output, + ); + } + + @override + Asset decode(_i1.Input input) { + return Asset( + id: _i5.Location.codec.decode(input), + fun: _i3.Fungibility.codec.decode(input), + ); + } + + @override + int sizeHint(Asset obj) { + int size = 0; + size = size + const _i2.AssetIdCodec().sizeHint(obj.id); + size = size + _i3.Fungibility.codec.sizeHint(obj.fun); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_filter.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_filter.dart new file mode 100644 index 000000000..cf57d556b --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_filter.dart @@ -0,0 +1,180 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i6; + +import 'asset.dart' as _i5; +import 'assets.dart' as _i3; +import 'wild_asset.dart' as _i4; + +abstract class AssetFilter { + const AssetFilter(); + + factory AssetFilter.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $AssetFilterCodec codec = $AssetFilterCodec(); + + static const $AssetFilter values = $AssetFilter(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $AssetFilter { + const $AssetFilter(); + + Definite definite(_i3.Assets value0) { + return Definite(value0); + } + + Wild wild(_i4.WildAsset value0) { + return Wild(value0); + } +} + +class $AssetFilterCodec with _i1.Codec { + const $AssetFilterCodec(); + + @override + AssetFilter decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return Definite._decode(input); + case 1: + return Wild._decode(input); + default: + throw Exception('AssetFilter: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + AssetFilter value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Definite: + (value as Definite).encodeTo(output); + break; + case Wild: + (value as Wild).encodeTo(output); + break; + default: + throw Exception('AssetFilter: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(AssetFilter value) { + switch (value.runtimeType) { + case Definite: + return (value as Definite)._sizeHint(); + case Wild: + return (value as Wild)._sizeHint(); + default: + throw Exception('AssetFilter: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Definite extends AssetFilter { + const Definite(this.value0); + + factory Definite._decode(_i1.Input input) { + return Definite(const _i1.SequenceCodec<_i5.Asset>(_i5.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'Definite': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + const _i1.SequenceCodec<_i5.Asset>(_i5.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Definite && + _i6.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class Wild extends AssetFilter { + const Wild(this.value0); + + factory Wild._decode(_i1.Input input) { + return Wild(_i4.WildAsset.codec.decode(input)); + } + + /// WildAsset + final _i4.WildAsset value0; + + @override + Map> toJson() => {'Wild': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i4.WildAsset.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i4.WildAsset.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Wild && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_id.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_id.dart new file mode 100644 index 000000000..a314a3d9a --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_id.dart @@ -0,0 +1,31 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i2; + +import '../location/location.dart' as _i1; + +typedef AssetId = _i1.Location; + +class AssetIdCodec with _i2.Codec { + const AssetIdCodec(); + + @override + AssetId decode(_i2.Input input) { + return _i1.Location.codec.decode(input); + } + + @override + void encodeTo( + AssetId value, + _i2.Output output, + ) { + _i1.Location.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(AssetId value) { + return _i1.Location.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_instance.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_instance.dart new file mode 100644 index 000000000..b98421c0b --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/asset_instance.dart @@ -0,0 +1,377 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i3; + +abstract class AssetInstance { + const AssetInstance(); + + factory AssetInstance.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $AssetInstanceCodec codec = $AssetInstanceCodec(); + + static const $AssetInstance values = $AssetInstance(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $AssetInstance { + const $AssetInstance(); + + Undefined undefined() { + return Undefined(); + } + + Index index(BigInt value0) { + return Index(value0); + } + + Array4 array4(List value0) { + return Array4(value0); + } + + Array8 array8(List value0) { + return Array8(value0); + } + + Array16 array16(List value0) { + return Array16(value0); + } + + Array32 array32(List value0) { + return Array32(value0); + } +} + +class $AssetInstanceCodec with _i1.Codec { + const $AssetInstanceCodec(); + + @override + AssetInstance decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return const Undefined(); + case 1: + return Index._decode(input); + case 2: + return Array4._decode(input); + case 3: + return Array8._decode(input); + case 4: + return Array16._decode(input); + case 5: + return Array32._decode(input); + default: + throw Exception('AssetInstance: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + AssetInstance value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Undefined: + (value as Undefined).encodeTo(output); + break; + case Index: + (value as Index).encodeTo(output); + break; + case Array4: + (value as Array4).encodeTo(output); + break; + case Array8: + (value as Array8).encodeTo(output); + break; + case Array16: + (value as Array16).encodeTo(output); + break; + case Array32: + (value as Array32).encodeTo(output); + break; + default: + throw Exception('AssetInstance: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(AssetInstance value) { + switch (value.runtimeType) { + case Undefined: + return 1; + case Index: + return (value as Index)._sizeHint(); + case Array4: + return (value as Array4)._sizeHint(); + case Array8: + return (value as Array8)._sizeHint(); + case Array16: + return (value as Array16)._sizeHint(); + case Array32: + return (value as Array32)._sizeHint(); + default: + throw Exception('AssetInstance: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Undefined extends AssetInstance { + const Undefined(); + + @override + Map toJson() => {'Undefined': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is Undefined; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Index extends AssetInstance { + const Index(this.value0); + + factory Index._decode(_i1.Input input) { + return Index(_i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u128 + final BigInt value0; + + @override + Map toJson() => {'Index': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Index && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class Array4 extends AssetInstance { + const Array4(this.value0); + + factory Array4._decode(_i1.Input input) { + return Array4(const _i1.U8ArrayCodec(4).decode(input)); + } + + /// [u8; 4] + final List value0; + + @override + Map> toJson() => {'Array4': value0.toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.U8ArrayCodec(4).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + const _i1.U8ArrayCodec(4).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Array4 && + _i3.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class Array8 extends AssetInstance { + const Array8(this.value0); + + factory Array8._decode(_i1.Input input) { + return Array8(const _i1.U8ArrayCodec(8).decode(input)); + } + + /// [u8; 8] + final List value0; + + @override + Map> toJson() => {'Array8': value0.toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.U8ArrayCodec(8).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + const _i1.U8ArrayCodec(8).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Array8 && + _i3.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class Array16 extends AssetInstance { + const Array16(this.value0); + + factory Array16._decode(_i1.Input input) { + return Array16(const _i1.U8ArrayCodec(16).decode(input)); + } + + /// [u8; 16] + final List value0; + + @override + Map> toJson() => {'Array16': value0.toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.U8ArrayCodec(16).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + const _i1.U8ArrayCodec(16).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Array16 && + _i3.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class Array32 extends AssetInstance { + const Array32(this.value0); + + factory Array32._decode(_i1.Input input) { + return Array32(const _i1.U8ArrayCodec(32).decode(input)); + } + + /// [u8; 32] + final List value0; + + @override + Map> toJson() => {'Array32': value0.toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.U8ArrayCodec(32).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Array32 && + _i3.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/assets.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/assets.dart new file mode 100644 index 000000000..7feeeac6d --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/assets.dart @@ -0,0 +1,31 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i2; + +import 'asset.dart' as _i1; + +typedef Assets = List<_i1.Asset>; + +class AssetsCodec with _i2.Codec { + const AssetsCodec(); + + @override + Assets decode(_i2.Input input) { + return const _i2.SequenceCodec<_i1.Asset>(_i1.Asset.codec).decode(input); + } + + @override + void encodeTo( + Assets value, + _i2.Output output, + ) { + const _i2.SequenceCodec<_i1.Asset>(_i1.Asset.codec).encodeTo( + value, + output, + ); + } + + @override + int sizeHint(Assets value) { + return const _i2.SequenceCodec<_i1.Asset>(_i1.Asset.codec).sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/fungibility.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/fungibility.dart new file mode 100644 index 000000000..314bfb686 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/fungibility.dart @@ -0,0 +1,172 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import 'asset_instance.dart' as _i3; + +abstract class Fungibility { + const Fungibility(); + + factory Fungibility.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $FungibilityCodec codec = $FungibilityCodec(); + + static const $Fungibility values = $Fungibility(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $Fungibility { + const $Fungibility(); + + Fungible fungible(BigInt value0) { + return Fungible(value0); + } + + NonFungible nonFungible(_i3.AssetInstance value0) { + return NonFungible(value0); + } +} + +class $FungibilityCodec with _i1.Codec { + const $FungibilityCodec(); + + @override + Fungibility decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return Fungible._decode(input); + case 1: + return NonFungible._decode(input); + default: + throw Exception('Fungibility: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Fungibility value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Fungible: + (value as Fungible).encodeTo(output); + break; + case NonFungible: + (value as NonFungible).encodeTo(output); + break; + default: + throw Exception('Fungibility: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Fungibility value) { + switch (value.runtimeType) { + case Fungible: + return (value as Fungible)._sizeHint(); + case NonFungible: + return (value as NonFungible)._sizeHint(); + default: + throw Exception('Fungibility: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Fungible extends Fungibility { + const Fungible(this.value0); + + factory Fungible._decode(_i1.Input input) { + return Fungible(_i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u128 + final BigInt value0; + + @override + Map toJson() => {'Fungible': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Fungible && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class NonFungible extends Fungibility { + const NonFungible(this.value0); + + factory NonFungible._decode(_i1.Input input) { + return NonFungible(_i3.AssetInstance.codec.decode(input)); + } + + /// AssetInstance + final _i3.AssetInstance value0; + + @override + Map> toJson() => {'NonFungible': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i3.AssetInstance.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i3.AssetInstance.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is NonFungible && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/wild_asset.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/wild_asset.dart new file mode 100644 index 000000000..8fcadd409 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/wild_asset.dart @@ -0,0 +1,328 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../location/location.dart' as _i5; +import 'asset_id.dart' as _i3; +import 'wild_fungibility.dart' as _i4; + +abstract class WildAsset { + const WildAsset(); + + factory WildAsset.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $WildAssetCodec codec = $WildAssetCodec(); + + static const $WildAsset values = $WildAsset(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $WildAsset { + const $WildAsset(); + + All all() { + return All(); + } + + AllOf allOf({ + required _i3.AssetId id, + required _i4.WildFungibility fun, + }) { + return AllOf( + id: id, + fun: fun, + ); + } + + AllCounted allCounted(BigInt value0) { + return AllCounted(value0); + } + + AllOfCounted allOfCounted({ + required _i3.AssetId id, + required _i4.WildFungibility fun, + required BigInt count, + }) { + return AllOfCounted( + id: id, + fun: fun, + count: count, + ); + } +} + +class $WildAssetCodec with _i1.Codec { + const $WildAssetCodec(); + + @override + WildAsset decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return const All(); + case 1: + return AllOf._decode(input); + case 2: + return AllCounted._decode(input); + case 3: + return AllOfCounted._decode(input); + default: + throw Exception('WildAsset: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + WildAsset value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case All: + (value as All).encodeTo(output); + break; + case AllOf: + (value as AllOf).encodeTo(output); + break; + case AllCounted: + (value as AllCounted).encodeTo(output); + break; + case AllOfCounted: + (value as AllOfCounted).encodeTo(output); + break; + default: + throw Exception('WildAsset: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(WildAsset value) { + switch (value.runtimeType) { + case All: + return 1; + case AllOf: + return (value as AllOf)._sizeHint(); + case AllCounted: + return (value as AllCounted)._sizeHint(); + case AllOfCounted: + return (value as AllOfCounted)._sizeHint(); + default: + throw Exception('WildAsset: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class All extends WildAsset { + const All(); + + @override + Map toJson() => {'All': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is All; + + @override + int get hashCode => runtimeType.hashCode; +} + +class AllOf extends WildAsset { + const AllOf({ + required this.id, + required this.fun, + }); + + factory AllOf._decode(_i1.Input input) { + return AllOf( + id: _i5.Location.codec.decode(input), + fun: _i4.WildFungibility.codec.decode(input), + ); + } + + /// AssetId + final _i3.AssetId id; + + /// WildFungibility + final _i4.WildFungibility fun; + + @override + Map> toJson() => { + 'AllOf': { + 'id': id.toJson(), + 'fun': fun.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetIdCodec().sizeHint(id); + size = size + _i4.WildFungibility.codec.sizeHint(fun); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i5.Location.codec.encodeTo( + id, + output, + ); + _i4.WildFungibility.codec.encodeTo( + fun, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AllOf && other.id == id && other.fun == fun; + + @override + int get hashCode => Object.hash( + id, + fun, + ); +} + +class AllCounted extends WildAsset { + const AllCounted(this.value0); + + factory AllCounted._decode(_i1.Input input) { + return AllCounted(_i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u32 + final BigInt value0; + + @override + Map toJson() => {'AllCounted': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AllCounted && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class AllOfCounted extends WildAsset { + const AllOfCounted({ + required this.id, + required this.fun, + required this.count, + }); + + factory AllOfCounted._decode(_i1.Input input) { + return AllOfCounted( + id: _i5.Location.codec.decode(input), + fun: _i4.WildFungibility.codec.decode(input), + count: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + /// AssetId + final _i3.AssetId id; + + /// WildFungibility + final _i4.WildFungibility fun; + + /// u32 + final BigInt count; + + @override + Map> toJson() => { + 'AllOfCounted': { + 'id': id.toJson(), + 'fun': fun.toJson(), + 'count': count, + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetIdCodec().sizeHint(id); + size = size + _i4.WildFungibility.codec.sizeHint(fun); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(count); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + _i5.Location.codec.encodeTo( + id, + output, + ); + _i4.WildFungibility.codec.encodeTo( + fun, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + count, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AllOfCounted && other.id == id && other.fun == fun && other.count == count; + + @override + int get hashCode => Object.hash( + id, + fun, + count, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/wild_fungibility.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/wild_fungibility.dart new file mode 100644 index 000000000..ef52d2ee2 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/asset/wild_fungibility.dart @@ -0,0 +1,57 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +enum WildFungibility { + fungible('Fungible', 0), + nonFungible('NonFungible', 1); + + const WildFungibility( + this.variantName, + this.codecIndex, + ); + + factory WildFungibility.decode(_i1.Input input) { + return codec.decode(input); + } + + final String variantName; + + final int codecIndex; + + static const $WildFungibilityCodec codec = $WildFungibilityCodec(); + + String toJson() => variantName; + _i2.Uint8List encode() { + return codec.encode(this); + } +} + +class $WildFungibilityCodec with _i1.Codec { + const $WildFungibilityCodec(); + + @override + WildFungibility decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return WildFungibility.fungible; + case 1: + return WildFungibility.nonFungible; + default: + throw Exception('WildFungibility: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + WildFungibility value, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + value.codecIndex, + output, + ); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/instruction_1.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/instruction_1.dart new file mode 100644 index 000000000..509269fbd --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/instruction_1.dart @@ -0,0 +1,3470 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i20; + +import '../../sp_weights/weight_v2/weight.dart' as _i5; +import '../../tuples_1.dart' as _i15; +import '../../xcm/double_encoded/double_encoded_1.dart' as _i9; +import '../../xcm/v2/origin_kind.dart' as _i8; +import '../../xcm/v3/maybe_error_code.dart' as _i17; +import '../../xcm/v3/traits/error.dart' as _i16; +import '../../xcm/v3/weight_limit.dart' as _i14; +import 'asset/asset.dart' as _i13; +import 'asset/asset_filter.dart' as _i12; +import 'asset/assets.dart' as _i3; +import 'instruction_1.dart' as _i21; +import 'junction/junction.dart' as _i18; +import 'junction/network_id.dart' as _i19; +import 'junctions/junctions.dart' as _i10; +import 'location/location.dart' as _i6; +import 'query_response_info.dart' as _i11; +import 'response.dart' as _i4; +import 'xcm_1.dart' as _i7; + +abstract class Instruction { + const Instruction(); + + factory Instruction.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $InstructionCodec codec = $InstructionCodec(); + + static const $Instruction values = $Instruction(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $Instruction { + const $Instruction(); + + WithdrawAsset withdrawAsset(_i3.Assets value0) { + return WithdrawAsset(value0); + } + + ReserveAssetDeposited reserveAssetDeposited(_i3.Assets value0) { + return ReserveAssetDeposited(value0); + } + + ReceiveTeleportedAsset receiveTeleportedAsset(_i3.Assets value0) { + return ReceiveTeleportedAsset(value0); + } + + QueryResponse queryResponse({ + required BigInt queryId, + required _i4.Response response, + required _i5.Weight maxWeight, + _i6.Location? querier, + }) { + return QueryResponse( + queryId: queryId, + response: response, + maxWeight: maxWeight, + querier: querier, + ); + } + + TransferAsset transferAsset({ + required _i3.Assets assets, + required _i6.Location beneficiary, + }) { + return TransferAsset( + assets: assets, + beneficiary: beneficiary, + ); + } + + TransferReserveAsset transferReserveAsset({ + required _i3.Assets assets, + required _i6.Location dest, + required _i7.Xcm xcm, + }) { + return TransferReserveAsset( + assets: assets, + dest: dest, + xcm: xcm, + ); + } + + Transact transact({ + required _i8.OriginKind originKind, + required _i5.Weight requireWeightAtMost, + required _i9.DoubleEncoded call, + }) { + return Transact( + originKind: originKind, + requireWeightAtMost: requireWeightAtMost, + call: call, + ); + } + + HrmpNewChannelOpenRequest hrmpNewChannelOpenRequest({ + required BigInt sender, + required BigInt maxMessageSize, + required BigInt maxCapacity, + }) { + return HrmpNewChannelOpenRequest( + sender: sender, + maxMessageSize: maxMessageSize, + maxCapacity: maxCapacity, + ); + } + + HrmpChannelAccepted hrmpChannelAccepted({required BigInt recipient}) { + return HrmpChannelAccepted(recipient: recipient); + } + + HrmpChannelClosing hrmpChannelClosing({ + required BigInt initiator, + required BigInt sender, + required BigInt recipient, + }) { + return HrmpChannelClosing( + initiator: initiator, + sender: sender, + recipient: recipient, + ); + } + + ClearOrigin clearOrigin() { + return ClearOrigin(); + } + + DescendOrigin descendOrigin(_i10.Junctions value0) { + return DescendOrigin(value0); + } + + ReportError reportError(_i11.QueryResponseInfo value0) { + return ReportError(value0); + } + + DepositAsset depositAsset({ + required _i12.AssetFilter assets, + required _i6.Location beneficiary, + }) { + return DepositAsset( + assets: assets, + beneficiary: beneficiary, + ); + } + + DepositReserveAsset depositReserveAsset({ + required _i12.AssetFilter assets, + required _i6.Location dest, + required _i7.Xcm xcm, + }) { + return DepositReserveAsset( + assets: assets, + dest: dest, + xcm: xcm, + ); + } + + ExchangeAsset exchangeAsset({ + required _i12.AssetFilter give, + required _i3.Assets want, + required bool maximal, + }) { + return ExchangeAsset( + give: give, + want: want, + maximal: maximal, + ); + } + + InitiateReserveWithdraw initiateReserveWithdraw({ + required _i12.AssetFilter assets, + required _i6.Location reserve, + required _i7.Xcm xcm, + }) { + return InitiateReserveWithdraw( + assets: assets, + reserve: reserve, + xcm: xcm, + ); + } + + InitiateTeleport initiateTeleport({ + required _i12.AssetFilter assets, + required _i6.Location dest, + required _i7.Xcm xcm, + }) { + return InitiateTeleport( + assets: assets, + dest: dest, + xcm: xcm, + ); + } + + ReportHolding reportHolding({ + required _i11.QueryResponseInfo responseInfo, + required _i12.AssetFilter assets, + }) { + return ReportHolding( + responseInfo: responseInfo, + assets: assets, + ); + } + + BuyExecution buyExecution({ + required _i13.Asset fees, + required _i14.WeightLimit weightLimit, + }) { + return BuyExecution( + fees: fees, + weightLimit: weightLimit, + ); + } + + RefundSurplus refundSurplus() { + return RefundSurplus(); + } + + SetErrorHandler setErrorHandler(_i7.Xcm value0) { + return SetErrorHandler(value0); + } + + SetAppendix setAppendix(_i7.Xcm value0) { + return SetAppendix(value0); + } + + ClearError clearError() { + return ClearError(); + } + + ClaimAsset claimAsset({ + required _i3.Assets assets, + required _i6.Location ticket, + }) { + return ClaimAsset( + assets: assets, + ticket: ticket, + ); + } + + Trap trap(BigInt value0) { + return Trap(value0); + } + + SubscribeVersion subscribeVersion({ + required BigInt queryId, + required _i5.Weight maxResponseWeight, + }) { + return SubscribeVersion( + queryId: queryId, + maxResponseWeight: maxResponseWeight, + ); + } + + UnsubscribeVersion unsubscribeVersion() { + return UnsubscribeVersion(); + } + + BurnAsset burnAsset(_i3.Assets value0) { + return BurnAsset(value0); + } + + ExpectAsset expectAsset(_i3.Assets value0) { + return ExpectAsset(value0); + } + + ExpectOrigin expectOrigin(_i6.Location? value0) { + return ExpectOrigin(value0); + } + + ExpectError expectError(_i15.Tuple2? value0) { + return ExpectError(value0); + } + + ExpectTransactStatus expectTransactStatus(_i17.MaybeErrorCode value0) { + return ExpectTransactStatus(value0); + } + + QueryPallet queryPallet({ + required List moduleName, + required _i11.QueryResponseInfo responseInfo, + }) { + return QueryPallet( + moduleName: moduleName, + responseInfo: responseInfo, + ); + } + + ExpectPallet expectPallet({ + required BigInt index, + required List name, + required List moduleName, + required BigInt crateMajor, + required BigInt minCrateMinor, + }) { + return ExpectPallet( + index: index, + name: name, + moduleName: moduleName, + crateMajor: crateMajor, + minCrateMinor: minCrateMinor, + ); + } + + ReportTransactStatus reportTransactStatus(_i11.QueryResponseInfo value0) { + return ReportTransactStatus(value0); + } + + ClearTransactStatus clearTransactStatus() { + return ClearTransactStatus(); + } + + UniversalOrigin universalOrigin(_i18.Junction value0) { + return UniversalOrigin(value0); + } + + ExportMessage exportMessage({ + required _i19.NetworkId network, + required _i10.Junctions destination, + required _i7.Xcm xcm, + }) { + return ExportMessage( + network: network, + destination: destination, + xcm: xcm, + ); + } + + LockAsset lockAsset({ + required _i13.Asset asset, + required _i6.Location unlocker, + }) { + return LockAsset( + asset: asset, + unlocker: unlocker, + ); + } + + UnlockAsset unlockAsset({ + required _i13.Asset asset, + required _i6.Location target, + }) { + return UnlockAsset( + asset: asset, + target: target, + ); + } + + NoteUnlockable noteUnlockable({ + required _i13.Asset asset, + required _i6.Location owner, + }) { + return NoteUnlockable( + asset: asset, + owner: owner, + ); + } + + RequestUnlock requestUnlock({ + required _i13.Asset asset, + required _i6.Location locker, + }) { + return RequestUnlock( + asset: asset, + locker: locker, + ); + } + + SetFeesMode setFeesMode({required bool jitWithdraw}) { + return SetFeesMode(jitWithdraw: jitWithdraw); + } + + SetTopic setTopic(List value0) { + return SetTopic(value0); + } + + ClearTopic clearTopic() { + return ClearTopic(); + } + + AliasOrigin aliasOrigin(_i6.Location value0) { + return AliasOrigin(value0); + } + + UnpaidExecution unpaidExecution({ + required _i14.WeightLimit weightLimit, + _i6.Location? checkOrigin, + }) { + return UnpaidExecution( + weightLimit: weightLimit, + checkOrigin: checkOrigin, + ); + } +} + +class $InstructionCodec with _i1.Codec { + const $InstructionCodec(); + + @override + Instruction decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return WithdrawAsset._decode(input); + case 1: + return ReserveAssetDeposited._decode(input); + case 2: + return ReceiveTeleportedAsset._decode(input); + case 3: + return QueryResponse._decode(input); + case 4: + return TransferAsset._decode(input); + case 5: + return TransferReserveAsset._decode(input); + case 6: + return Transact._decode(input); + case 7: + return HrmpNewChannelOpenRequest._decode(input); + case 8: + return HrmpChannelAccepted._decode(input); + case 9: + return HrmpChannelClosing._decode(input); + case 10: + return const ClearOrigin(); + case 11: + return DescendOrigin._decode(input); + case 12: + return ReportError._decode(input); + case 13: + return DepositAsset._decode(input); + case 14: + return DepositReserveAsset._decode(input); + case 15: + return ExchangeAsset._decode(input); + case 16: + return InitiateReserveWithdraw._decode(input); + case 17: + return InitiateTeleport._decode(input); + case 18: + return ReportHolding._decode(input); + case 19: + return BuyExecution._decode(input); + case 20: + return const RefundSurplus(); + case 21: + return SetErrorHandler._decode(input); + case 22: + return SetAppendix._decode(input); + case 23: + return const ClearError(); + case 24: + return ClaimAsset._decode(input); + case 25: + return Trap._decode(input); + case 26: + return SubscribeVersion._decode(input); + case 27: + return const UnsubscribeVersion(); + case 28: + return BurnAsset._decode(input); + case 29: + return ExpectAsset._decode(input); + case 30: + return ExpectOrigin._decode(input); + case 31: + return ExpectError._decode(input); + case 32: + return ExpectTransactStatus._decode(input); + case 33: + return QueryPallet._decode(input); + case 34: + return ExpectPallet._decode(input); + case 35: + return ReportTransactStatus._decode(input); + case 36: + return const ClearTransactStatus(); + case 37: + return UniversalOrigin._decode(input); + case 38: + return ExportMessage._decode(input); + case 39: + return LockAsset._decode(input); + case 40: + return UnlockAsset._decode(input); + case 41: + return NoteUnlockable._decode(input); + case 42: + return RequestUnlock._decode(input); + case 43: + return SetFeesMode._decode(input); + case 44: + return SetTopic._decode(input); + case 45: + return const ClearTopic(); + case 46: + return AliasOrigin._decode(input); + case 47: + return UnpaidExecution._decode(input); + default: + throw Exception('Instruction: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Instruction value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case WithdrawAsset: + (value as WithdrawAsset).encodeTo(output); + break; + case ReserveAssetDeposited: + (value as ReserveAssetDeposited).encodeTo(output); + break; + case ReceiveTeleportedAsset: + (value as ReceiveTeleportedAsset).encodeTo(output); + break; + case QueryResponse: + (value as QueryResponse).encodeTo(output); + break; + case TransferAsset: + (value as TransferAsset).encodeTo(output); + break; + case TransferReserveAsset: + (value as TransferReserveAsset).encodeTo(output); + break; + case Transact: + (value as Transact).encodeTo(output); + break; + case HrmpNewChannelOpenRequest: + (value as HrmpNewChannelOpenRequest).encodeTo(output); + break; + case HrmpChannelAccepted: + (value as HrmpChannelAccepted).encodeTo(output); + break; + case HrmpChannelClosing: + (value as HrmpChannelClosing).encodeTo(output); + break; + case ClearOrigin: + (value as ClearOrigin).encodeTo(output); + break; + case DescendOrigin: + (value as DescendOrigin).encodeTo(output); + break; + case ReportError: + (value as ReportError).encodeTo(output); + break; + case DepositAsset: + (value as DepositAsset).encodeTo(output); + break; + case DepositReserveAsset: + (value as DepositReserveAsset).encodeTo(output); + break; + case ExchangeAsset: + (value as ExchangeAsset).encodeTo(output); + break; + case InitiateReserveWithdraw: + (value as InitiateReserveWithdraw).encodeTo(output); + break; + case InitiateTeleport: + (value as InitiateTeleport).encodeTo(output); + break; + case ReportHolding: + (value as ReportHolding).encodeTo(output); + break; + case BuyExecution: + (value as BuyExecution).encodeTo(output); + break; + case RefundSurplus: + (value as RefundSurplus).encodeTo(output); + break; + case SetErrorHandler: + (value as SetErrorHandler).encodeTo(output); + break; + case SetAppendix: + (value as SetAppendix).encodeTo(output); + break; + case ClearError: + (value as ClearError).encodeTo(output); + break; + case ClaimAsset: + (value as ClaimAsset).encodeTo(output); + break; + case Trap: + (value as Trap).encodeTo(output); + break; + case SubscribeVersion: + (value as SubscribeVersion).encodeTo(output); + break; + case UnsubscribeVersion: + (value as UnsubscribeVersion).encodeTo(output); + break; + case BurnAsset: + (value as BurnAsset).encodeTo(output); + break; + case ExpectAsset: + (value as ExpectAsset).encodeTo(output); + break; + case ExpectOrigin: + (value as ExpectOrigin).encodeTo(output); + break; + case ExpectError: + (value as ExpectError).encodeTo(output); + break; + case ExpectTransactStatus: + (value as ExpectTransactStatus).encodeTo(output); + break; + case QueryPallet: + (value as QueryPallet).encodeTo(output); + break; + case ExpectPallet: + (value as ExpectPallet).encodeTo(output); + break; + case ReportTransactStatus: + (value as ReportTransactStatus).encodeTo(output); + break; + case ClearTransactStatus: + (value as ClearTransactStatus).encodeTo(output); + break; + case UniversalOrigin: + (value as UniversalOrigin).encodeTo(output); + break; + case ExportMessage: + (value as ExportMessage).encodeTo(output); + break; + case LockAsset: + (value as LockAsset).encodeTo(output); + break; + case UnlockAsset: + (value as UnlockAsset).encodeTo(output); + break; + case NoteUnlockable: + (value as NoteUnlockable).encodeTo(output); + break; + case RequestUnlock: + (value as RequestUnlock).encodeTo(output); + break; + case SetFeesMode: + (value as SetFeesMode).encodeTo(output); + break; + case SetTopic: + (value as SetTopic).encodeTo(output); + break; + case ClearTopic: + (value as ClearTopic).encodeTo(output); + break; + case AliasOrigin: + (value as AliasOrigin).encodeTo(output); + break; + case UnpaidExecution: + (value as UnpaidExecution).encodeTo(output); + break; + default: + throw Exception('Instruction: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Instruction value) { + switch (value.runtimeType) { + case WithdrawAsset: + return (value as WithdrawAsset)._sizeHint(); + case ReserveAssetDeposited: + return (value as ReserveAssetDeposited)._sizeHint(); + case ReceiveTeleportedAsset: + return (value as ReceiveTeleportedAsset)._sizeHint(); + case QueryResponse: + return (value as QueryResponse)._sizeHint(); + case TransferAsset: + return (value as TransferAsset)._sizeHint(); + case TransferReserveAsset: + return (value as TransferReserveAsset)._sizeHint(); + case Transact: + return (value as Transact)._sizeHint(); + case HrmpNewChannelOpenRequest: + return (value as HrmpNewChannelOpenRequest)._sizeHint(); + case HrmpChannelAccepted: + return (value as HrmpChannelAccepted)._sizeHint(); + case HrmpChannelClosing: + return (value as HrmpChannelClosing)._sizeHint(); + case ClearOrigin: + return 1; + case DescendOrigin: + return (value as DescendOrigin)._sizeHint(); + case ReportError: + return (value as ReportError)._sizeHint(); + case DepositAsset: + return (value as DepositAsset)._sizeHint(); + case DepositReserveAsset: + return (value as DepositReserveAsset)._sizeHint(); + case ExchangeAsset: + return (value as ExchangeAsset)._sizeHint(); + case InitiateReserveWithdraw: + return (value as InitiateReserveWithdraw)._sizeHint(); + case InitiateTeleport: + return (value as InitiateTeleport)._sizeHint(); + case ReportHolding: + return (value as ReportHolding)._sizeHint(); + case BuyExecution: + return (value as BuyExecution)._sizeHint(); + case RefundSurplus: + return 1; + case SetErrorHandler: + return (value as SetErrorHandler)._sizeHint(); + case SetAppendix: + return (value as SetAppendix)._sizeHint(); + case ClearError: + return 1; + case ClaimAsset: + return (value as ClaimAsset)._sizeHint(); + case Trap: + return (value as Trap)._sizeHint(); + case SubscribeVersion: + return (value as SubscribeVersion)._sizeHint(); + case UnsubscribeVersion: + return 1; + case BurnAsset: + return (value as BurnAsset)._sizeHint(); + case ExpectAsset: + return (value as ExpectAsset)._sizeHint(); + case ExpectOrigin: + return (value as ExpectOrigin)._sizeHint(); + case ExpectError: + return (value as ExpectError)._sizeHint(); + case ExpectTransactStatus: + return (value as ExpectTransactStatus)._sizeHint(); + case QueryPallet: + return (value as QueryPallet)._sizeHint(); + case ExpectPallet: + return (value as ExpectPallet)._sizeHint(); + case ReportTransactStatus: + return (value as ReportTransactStatus)._sizeHint(); + case ClearTransactStatus: + return 1; + case UniversalOrigin: + return (value as UniversalOrigin)._sizeHint(); + case ExportMessage: + return (value as ExportMessage)._sizeHint(); + case LockAsset: + return (value as LockAsset)._sizeHint(); + case UnlockAsset: + return (value as UnlockAsset)._sizeHint(); + case NoteUnlockable: + return (value as NoteUnlockable)._sizeHint(); + case RequestUnlock: + return (value as RequestUnlock)._sizeHint(); + case SetFeesMode: + return (value as SetFeesMode)._sizeHint(); + case SetTopic: + return (value as SetTopic)._sizeHint(); + case ClearTopic: + return 1; + case AliasOrigin: + return (value as AliasOrigin)._sizeHint(); + case UnpaidExecution: + return (value as UnpaidExecution)._sizeHint(); + default: + throw Exception('Instruction: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class WithdrawAsset extends Instruction { + const WithdrawAsset(this.value0); + + factory WithdrawAsset._decode(_i1.Input input) { + return WithdrawAsset(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'WithdrawAsset': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is WithdrawAsset && + _i20.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ReserveAssetDeposited extends Instruction { + const ReserveAssetDeposited(this.value0); + + factory ReserveAssetDeposited._decode(_i1.Input input) { + return ReserveAssetDeposited(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'ReserveAssetDeposited': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReserveAssetDeposited && + _i20.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ReceiveTeleportedAsset extends Instruction { + const ReceiveTeleportedAsset(this.value0); + + factory ReceiveTeleportedAsset._decode(_i1.Input input) { + return ReceiveTeleportedAsset(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'ReceiveTeleportedAsset': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReceiveTeleportedAsset && + _i20.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class QueryResponse extends Instruction { + const QueryResponse({ + required this.queryId, + required this.response, + required this.maxWeight, + this.querier, + }); + + factory QueryResponse._decode(_i1.Input input) { + return QueryResponse( + queryId: _i1.CompactBigIntCodec.codec.decode(input), + response: _i4.Response.codec.decode(input), + maxWeight: _i5.Weight.codec.decode(input), + querier: const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).decode(input), + ); + } + + /// QueryId + final BigInt queryId; + + /// Response + final _i4.Response response; + + /// Weight + final _i5.Weight maxWeight; + + /// Option + final _i6.Location? querier; + + @override + Map> toJson() => { + 'QueryResponse': { + 'queryId': queryId, + 'response': response.toJson(), + 'maxWeight': maxWeight.toJson(), + 'querier': querier?.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(queryId); + size = size + _i4.Response.codec.sizeHint(response); + size = size + _i5.Weight.codec.sizeHint(maxWeight); + size = size + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).sizeHint(querier); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + queryId, + output, + ); + _i4.Response.codec.encodeTo( + response, + output, + ); + _i5.Weight.codec.encodeTo( + maxWeight, + output, + ); + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).encodeTo( + querier, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is QueryResponse && + other.queryId == queryId && + other.response == response && + other.maxWeight == maxWeight && + other.querier == querier; + + @override + int get hashCode => Object.hash( + queryId, + response, + maxWeight, + querier, + ); +} + +class TransferAsset extends Instruction { + const TransferAsset({ + required this.assets, + required this.beneficiary, + }); + + factory TransferAsset._decode(_i1.Input input) { + return TransferAsset( + assets: const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input), + beneficiary: _i6.Location.codec.decode(input), + ); + } + + /// Assets + final _i3.Assets assets; + + /// Location + final _i6.Location beneficiary; + + @override + Map> toJson() => { + 'TransferAsset': { + 'assets': assets.map((value) => value.toJson()).toList(), + 'beneficiary': beneficiary.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(beneficiary); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + beneficiary, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is TransferAsset && + _i20.listsEqual( + other.assets, + assets, + ) && + other.beneficiary == beneficiary; + + @override + int get hashCode => Object.hash( + assets, + beneficiary, + ); +} + +class TransferReserveAsset extends Instruction { + const TransferReserveAsset({ + required this.assets, + required this.dest, + required this.xcm, + }); + + factory TransferReserveAsset._decode(_i1.Input input) { + return TransferReserveAsset( + assets: const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input), + dest: _i6.Location.codec.decode(input), + xcm: const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).decode(input), + ); + } + + /// Assets + final _i3.Assets assets; + + /// Location + final _i6.Location dest; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'TransferReserveAsset': { + 'assets': assets.map((value) => value.toJson()).toList(), + 'dest': dest.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(dest); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + dest, + output, + ); + const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is TransferReserveAsset && + _i20.listsEqual( + other.assets, + assets, + ) && + other.dest == dest && + _i20.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + assets, + dest, + xcm, + ); +} + +class Transact extends Instruction { + const Transact({ + required this.originKind, + required this.requireWeightAtMost, + required this.call, + }); + + factory Transact._decode(_i1.Input input) { + return Transact( + originKind: _i8.OriginKind.codec.decode(input), + requireWeightAtMost: _i5.Weight.codec.decode(input), + call: _i9.DoubleEncoded.codec.decode(input), + ); + } + + /// OriginKind + final _i8.OriginKind originKind; + + /// Weight + final _i5.Weight requireWeightAtMost; + + /// DoubleEncoded + final _i9.DoubleEncoded call; + + @override + Map> toJson() => { + 'Transact': { + 'originKind': originKind.toJson(), + 'requireWeightAtMost': requireWeightAtMost.toJson(), + 'call': call.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i8.OriginKind.codec.sizeHint(originKind); + size = size + _i5.Weight.codec.sizeHint(requireWeightAtMost); + size = size + _i9.DoubleEncoded.codec.sizeHint(call); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + _i8.OriginKind.codec.encodeTo( + originKind, + output, + ); + _i5.Weight.codec.encodeTo( + requireWeightAtMost, + output, + ); + _i9.DoubleEncoded.codec.encodeTo( + call, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Transact && + other.originKind == originKind && + other.requireWeightAtMost == requireWeightAtMost && + other.call == call; + + @override + int get hashCode => Object.hash( + originKind, + requireWeightAtMost, + call, + ); +} + +class HrmpNewChannelOpenRequest extends Instruction { + const HrmpNewChannelOpenRequest({ + required this.sender, + required this.maxMessageSize, + required this.maxCapacity, + }); + + factory HrmpNewChannelOpenRequest._decode(_i1.Input input) { + return HrmpNewChannelOpenRequest( + sender: _i1.CompactBigIntCodec.codec.decode(input), + maxMessageSize: _i1.CompactBigIntCodec.codec.decode(input), + maxCapacity: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + /// u32 + final BigInt sender; + + /// u32 + final BigInt maxMessageSize; + + /// u32 + final BigInt maxCapacity; + + @override + Map> toJson() => { + 'HrmpNewChannelOpenRequest': { + 'sender': sender, + 'maxMessageSize': maxMessageSize, + 'maxCapacity': maxCapacity, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(sender); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(maxMessageSize); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(maxCapacity); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + sender, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + maxMessageSize, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + maxCapacity, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is HrmpNewChannelOpenRequest && + other.sender == sender && + other.maxMessageSize == maxMessageSize && + other.maxCapacity == maxCapacity; + + @override + int get hashCode => Object.hash( + sender, + maxMessageSize, + maxCapacity, + ); +} + +class HrmpChannelAccepted extends Instruction { + const HrmpChannelAccepted({required this.recipient}); + + factory HrmpChannelAccepted._decode(_i1.Input input) { + return HrmpChannelAccepted(recipient: _i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u32 + final BigInt recipient; + + @override + Map> toJson() => { + 'HrmpChannelAccepted': {'recipient': recipient} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(recipient); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 8, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + recipient, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is HrmpChannelAccepted && other.recipient == recipient; + + @override + int get hashCode => recipient.hashCode; +} + +class HrmpChannelClosing extends Instruction { + const HrmpChannelClosing({ + required this.initiator, + required this.sender, + required this.recipient, + }); + + factory HrmpChannelClosing._decode(_i1.Input input) { + return HrmpChannelClosing( + initiator: _i1.CompactBigIntCodec.codec.decode(input), + sender: _i1.CompactBigIntCodec.codec.decode(input), + recipient: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + /// u32 + final BigInt initiator; + + /// u32 + final BigInt sender; + + /// u32 + final BigInt recipient; + + @override + Map> toJson() => { + 'HrmpChannelClosing': { + 'initiator': initiator, + 'sender': sender, + 'recipient': recipient, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(initiator); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(sender); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(recipient); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 9, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + initiator, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + sender, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + recipient, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is HrmpChannelClosing && + other.initiator == initiator && + other.sender == sender && + other.recipient == recipient; + + @override + int get hashCode => Object.hash( + initiator, + sender, + recipient, + ); +} + +class ClearOrigin extends Instruction { + const ClearOrigin(); + + @override + Map toJson() => {'ClearOrigin': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 10, + output, + ); + } + + @override + bool operator ==(Object other) => other is ClearOrigin; + + @override + int get hashCode => runtimeType.hashCode; +} + +class DescendOrigin extends Instruction { + const DescendOrigin(this.value0); + + factory DescendOrigin._decode(_i1.Input input) { + return DescendOrigin(_i10.Junctions.codec.decode(input)); + } + + /// InteriorLocation + final _i10.Junctions value0; + + @override + Map> toJson() => {'DescendOrigin': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i10.Junctions.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 11, + output, + ); + _i10.Junctions.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is DescendOrigin && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ReportError extends Instruction { + const ReportError(this.value0); + + factory ReportError._decode(_i1.Input input) { + return ReportError(_i11.QueryResponseInfo.codec.decode(input)); + } + + /// QueryResponseInfo + final _i11.QueryResponseInfo value0; + + @override + Map> toJson() => {'ReportError': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i11.QueryResponseInfo.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 12, + output, + ); + _i11.QueryResponseInfo.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReportError && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class DepositAsset extends Instruction { + const DepositAsset({ + required this.assets, + required this.beneficiary, + }); + + factory DepositAsset._decode(_i1.Input input) { + return DepositAsset( + assets: _i12.AssetFilter.codec.decode(input), + beneficiary: _i6.Location.codec.decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter assets; + + /// Location + final _i6.Location beneficiary; + + @override + Map>> toJson() => { + 'DepositAsset': { + 'assets': assets.toJson(), + 'beneficiary': beneficiary.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(beneficiary); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 13, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + beneficiary, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is DepositAsset && other.assets == assets && other.beneficiary == beneficiary; + + @override + int get hashCode => Object.hash( + assets, + beneficiary, + ); +} + +class DepositReserveAsset extends Instruction { + const DepositReserveAsset({ + required this.assets, + required this.dest, + required this.xcm, + }); + + factory DepositReserveAsset._decode(_i1.Input input) { + return DepositReserveAsset( + assets: _i12.AssetFilter.codec.decode(input), + dest: _i6.Location.codec.decode(input), + xcm: const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter assets; + + /// Location + final _i6.Location dest; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'DepositReserveAsset': { + 'assets': assets.toJson(), + 'dest': dest.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(dest); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 14, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + dest, + output, + ); + const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is DepositReserveAsset && + other.assets == assets && + other.dest == dest && + _i20.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + assets, + dest, + xcm, + ); +} + +class ExchangeAsset extends Instruction { + const ExchangeAsset({ + required this.give, + required this.want, + required this.maximal, + }); + + factory ExchangeAsset._decode(_i1.Input input) { + return ExchangeAsset( + give: _i12.AssetFilter.codec.decode(input), + want: const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input), + maximal: _i1.BoolCodec.codec.decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter give; + + /// Assets + final _i3.Assets want; + + /// bool + final bool maximal; + + @override + Map> toJson() => { + 'ExchangeAsset': { + 'give': give.toJson(), + 'want': want.map((value) => value.toJson()).toList(), + 'maximal': maximal, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(give); + size = size + const _i3.AssetsCodec().sizeHint(want); + size = size + _i1.BoolCodec.codec.sizeHint(maximal); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 15, + output, + ); + _i12.AssetFilter.codec.encodeTo( + give, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + want, + output, + ); + _i1.BoolCodec.codec.encodeTo( + maximal, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExchangeAsset && + other.give == give && + _i20.listsEqual( + other.want, + want, + ) && + other.maximal == maximal; + + @override + int get hashCode => Object.hash( + give, + want, + maximal, + ); +} + +class InitiateReserveWithdraw extends Instruction { + const InitiateReserveWithdraw({ + required this.assets, + required this.reserve, + required this.xcm, + }); + + factory InitiateReserveWithdraw._decode(_i1.Input input) { + return InitiateReserveWithdraw( + assets: _i12.AssetFilter.codec.decode(input), + reserve: _i6.Location.codec.decode(input), + xcm: const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter assets; + + /// Location + final _i6.Location reserve; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'InitiateReserveWithdraw': { + 'assets': assets.toJson(), + 'reserve': reserve.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(reserve); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 16, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + reserve, + output, + ); + const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is InitiateReserveWithdraw && + other.assets == assets && + other.reserve == reserve && + _i20.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + assets, + reserve, + xcm, + ); +} + +class InitiateTeleport extends Instruction { + const InitiateTeleport({ + required this.assets, + required this.dest, + required this.xcm, + }); + + factory InitiateTeleport._decode(_i1.Input input) { + return InitiateTeleport( + assets: _i12.AssetFilter.codec.decode(input), + dest: _i6.Location.codec.decode(input), + xcm: const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter assets; + + /// Location + final _i6.Location dest; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'InitiateTeleport': { + 'assets': assets.toJson(), + 'dest': dest.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(dest); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 17, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + dest, + output, + ); + const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is InitiateTeleport && + other.assets == assets && + other.dest == dest && + _i20.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + assets, + dest, + xcm, + ); +} + +class ReportHolding extends Instruction { + const ReportHolding({ + required this.responseInfo, + required this.assets, + }); + + factory ReportHolding._decode(_i1.Input input) { + return ReportHolding( + responseInfo: _i11.QueryResponseInfo.codec.decode(input), + assets: _i12.AssetFilter.codec.decode(input), + ); + } + + /// QueryResponseInfo + final _i11.QueryResponseInfo responseInfo; + + /// AssetFilter + final _i12.AssetFilter assets; + + @override + Map>> toJson() => { + 'ReportHolding': { + 'responseInfo': responseInfo.toJson(), + 'assets': assets.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i11.QueryResponseInfo.codec.sizeHint(responseInfo); + size = size + _i12.AssetFilter.codec.sizeHint(assets); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 18, + output, + ); + _i11.QueryResponseInfo.codec.encodeTo( + responseInfo, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReportHolding && other.responseInfo == responseInfo && other.assets == assets; + + @override + int get hashCode => Object.hash( + responseInfo, + assets, + ); +} + +class BuyExecution extends Instruction { + const BuyExecution({ + required this.fees, + required this.weightLimit, + }); + + factory BuyExecution._decode(_i1.Input input) { + return BuyExecution( + fees: _i13.Asset.codec.decode(input), + weightLimit: _i14.WeightLimit.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset fees; + + /// WeightLimit + final _i14.WeightLimit weightLimit; + + @override + Map>> toJson() => { + 'BuyExecution': { + 'fees': fees.toJson(), + 'weightLimit': weightLimit.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(fees); + size = size + _i14.WeightLimit.codec.sizeHint(weightLimit); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 19, + output, + ); + _i13.Asset.codec.encodeTo( + fees, + output, + ); + _i14.WeightLimit.codec.encodeTo( + weightLimit, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is BuyExecution && other.fees == fees && other.weightLimit == weightLimit; + + @override + int get hashCode => Object.hash( + fees, + weightLimit, + ); +} + +class RefundSurplus extends Instruction { + const RefundSurplus(); + + @override + Map toJson() => {'RefundSurplus': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 20, + output, + ); + } + + @override + bool operator ==(Object other) => other is RefundSurplus; + + @override + int get hashCode => runtimeType.hashCode; +} + +class SetErrorHandler extends Instruction { + const SetErrorHandler(this.value0); + + factory SetErrorHandler._decode(_i1.Input input) { + return SetErrorHandler(const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).decode(input)); + } + + /// Xcm + final _i7.Xcm value0; + + @override + Map> toJson() => {'SetErrorHandler': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i7.XcmCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 21, + output, + ); + const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SetErrorHandler && + _i20.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class SetAppendix extends Instruction { + const SetAppendix(this.value0); + + factory SetAppendix._decode(_i1.Input input) { + return SetAppendix(const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).decode(input)); + } + + /// Xcm + final _i7.Xcm value0; + + @override + Map> toJson() => {'SetAppendix': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i7.XcmCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 22, + output, + ); + const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SetAppendix && + _i20.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ClearError extends Instruction { + const ClearError(); + + @override + Map toJson() => {'ClearError': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 23, + output, + ); + } + + @override + bool operator ==(Object other) => other is ClearError; + + @override + int get hashCode => runtimeType.hashCode; +} + +class ClaimAsset extends Instruction { + const ClaimAsset({ + required this.assets, + required this.ticket, + }); + + factory ClaimAsset._decode(_i1.Input input) { + return ClaimAsset( + assets: const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input), + ticket: _i6.Location.codec.decode(input), + ); + } + + /// Assets + final _i3.Assets assets; + + /// Location + final _i6.Location ticket; + + @override + Map> toJson() => { + 'ClaimAsset': { + 'assets': assets.map((value) => value.toJson()).toList(), + 'ticket': ticket.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(ticket); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 24, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + ticket, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ClaimAsset && + _i20.listsEqual( + other.assets, + assets, + ) && + other.ticket == ticket; + + @override + int get hashCode => Object.hash( + assets, + ticket, + ); +} + +class Trap extends Instruction { + const Trap(this.value0); + + factory Trap._decode(_i1.Input input) { + return Trap(_i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u64 + final BigInt value0; + + @override + Map toJson() => {'Trap': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 25, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Trap && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class SubscribeVersion extends Instruction { + const SubscribeVersion({ + required this.queryId, + required this.maxResponseWeight, + }); + + factory SubscribeVersion._decode(_i1.Input input) { + return SubscribeVersion( + queryId: _i1.CompactBigIntCodec.codec.decode(input), + maxResponseWeight: _i5.Weight.codec.decode(input), + ); + } + + /// QueryId + final BigInt queryId; + + /// Weight + final _i5.Weight maxResponseWeight; + + @override + Map> toJson() => { + 'SubscribeVersion': { + 'queryId': queryId, + 'maxResponseWeight': maxResponseWeight.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(queryId); + size = size + _i5.Weight.codec.sizeHint(maxResponseWeight); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 26, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + queryId, + output, + ); + _i5.Weight.codec.encodeTo( + maxResponseWeight, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SubscribeVersion && other.queryId == queryId && other.maxResponseWeight == maxResponseWeight; + + @override + int get hashCode => Object.hash( + queryId, + maxResponseWeight, + ); +} + +class UnsubscribeVersion extends Instruction { + const UnsubscribeVersion(); + + @override + Map toJson() => {'UnsubscribeVersion': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 27, + output, + ); + } + + @override + bool operator ==(Object other) => other is UnsubscribeVersion; + + @override + int get hashCode => runtimeType.hashCode; +} + +class BurnAsset extends Instruction { + const BurnAsset(this.value0); + + factory BurnAsset._decode(_i1.Input input) { + return BurnAsset(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'BurnAsset': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 28, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is BurnAsset && + _i20.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ExpectAsset extends Instruction { + const ExpectAsset(this.value0); + + factory ExpectAsset._decode(_i1.Input input) { + return ExpectAsset(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'ExpectAsset': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 29, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectAsset && + _i20.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ExpectOrigin extends Instruction { + const ExpectOrigin(this.value0); + + factory ExpectOrigin._decode(_i1.Input input) { + return ExpectOrigin(const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).decode(input)); + } + + /// Option + final _i6.Location? value0; + + @override + Map?> toJson() => {'ExpectOrigin': value0?.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 30, + output, + ); + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectOrigin && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ExpectError extends Instruction { + const ExpectError(this.value0); + + factory ExpectError._decode(_i1.Input input) { + return ExpectError(const _i1.OptionCodec<_i15.Tuple2>(_i15.Tuple2Codec( + _i1.U32Codec.codec, + _i16.Error.codec, + )).decode(input)); + } + + /// Option<(u32, Error)> + final _i15.Tuple2? value0; + + @override + Map?> toJson() => { + 'ExpectError': [ + value0?.value0, + value0?.value1.toJson(), + ] + }; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.OptionCodec<_i15.Tuple2>(_i15.Tuple2Codec( + _i1.U32Codec.codec, + _i16.Error.codec, + )).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 31, + output, + ); + const _i1.OptionCodec<_i15.Tuple2>(_i15.Tuple2Codec( + _i1.U32Codec.codec, + _i16.Error.codec, + )).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectError && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ExpectTransactStatus extends Instruction { + const ExpectTransactStatus(this.value0); + + factory ExpectTransactStatus._decode(_i1.Input input) { + return ExpectTransactStatus(_i17.MaybeErrorCode.codec.decode(input)); + } + + /// MaybeErrorCode + final _i17.MaybeErrorCode value0; + + @override + Map> toJson() => {'ExpectTransactStatus': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i17.MaybeErrorCode.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 32, + output, + ); + _i17.MaybeErrorCode.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectTransactStatus && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class QueryPallet extends Instruction { + const QueryPallet({ + required this.moduleName, + required this.responseInfo, + }); + + factory QueryPallet._decode(_i1.Input input) { + return QueryPallet( + moduleName: _i1.U8SequenceCodec.codec.decode(input), + responseInfo: _i11.QueryResponseInfo.codec.decode(input), + ); + } + + /// Vec + final List moduleName; + + /// QueryResponseInfo + final _i11.QueryResponseInfo responseInfo; + + @override + Map> toJson() => { + 'QueryPallet': { + 'moduleName': moduleName, + 'responseInfo': responseInfo.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U8SequenceCodec.codec.sizeHint(moduleName); + size = size + _i11.QueryResponseInfo.codec.sizeHint(responseInfo); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 33, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + moduleName, + output, + ); + _i11.QueryResponseInfo.codec.encodeTo( + responseInfo, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is QueryPallet && + _i20.listsEqual( + other.moduleName, + moduleName, + ) && + other.responseInfo == responseInfo; + + @override + int get hashCode => Object.hash( + moduleName, + responseInfo, + ); +} + +class ExpectPallet extends Instruction { + const ExpectPallet({ + required this.index, + required this.name, + required this.moduleName, + required this.crateMajor, + required this.minCrateMinor, + }); + + factory ExpectPallet._decode(_i1.Input input) { + return ExpectPallet( + index: _i1.CompactBigIntCodec.codec.decode(input), + name: _i1.U8SequenceCodec.codec.decode(input), + moduleName: _i1.U8SequenceCodec.codec.decode(input), + crateMajor: _i1.CompactBigIntCodec.codec.decode(input), + minCrateMinor: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + /// u32 + final BigInt index; + + /// Vec + final List name; + + /// Vec + final List moduleName; + + /// u32 + final BigInt crateMajor; + + /// u32 + final BigInt minCrateMinor; + + @override + Map> toJson() => { + 'ExpectPallet': { + 'index': index, + 'name': name, + 'moduleName': moduleName, + 'crateMajor': crateMajor, + 'minCrateMinor': minCrateMinor, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(index); + size = size + _i1.U8SequenceCodec.codec.sizeHint(name); + size = size + _i1.U8SequenceCodec.codec.sizeHint(moduleName); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(crateMajor); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(minCrateMinor); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 34, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + index, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + name, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + moduleName, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + crateMajor, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + minCrateMinor, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectPallet && + other.index == index && + _i20.listsEqual( + other.name, + name, + ) && + _i20.listsEqual( + other.moduleName, + moduleName, + ) && + other.crateMajor == crateMajor && + other.minCrateMinor == minCrateMinor; + + @override + int get hashCode => Object.hash( + index, + name, + moduleName, + crateMajor, + minCrateMinor, + ); +} + +class ReportTransactStatus extends Instruction { + const ReportTransactStatus(this.value0); + + factory ReportTransactStatus._decode(_i1.Input input) { + return ReportTransactStatus(_i11.QueryResponseInfo.codec.decode(input)); + } + + /// QueryResponseInfo + final _i11.QueryResponseInfo value0; + + @override + Map> toJson() => {'ReportTransactStatus': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i11.QueryResponseInfo.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 35, + output, + ); + _i11.QueryResponseInfo.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReportTransactStatus && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ClearTransactStatus extends Instruction { + const ClearTransactStatus(); + + @override + Map toJson() => {'ClearTransactStatus': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 36, + output, + ); + } + + @override + bool operator ==(Object other) => other is ClearTransactStatus; + + @override + int get hashCode => runtimeType.hashCode; +} + +class UniversalOrigin extends Instruction { + const UniversalOrigin(this.value0); + + factory UniversalOrigin._decode(_i1.Input input) { + return UniversalOrigin(_i18.Junction.codec.decode(input)); + } + + /// Junction + final _i18.Junction value0; + + @override + Map> toJson() => {'UniversalOrigin': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i18.Junction.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 37, + output, + ); + _i18.Junction.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UniversalOrigin && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ExportMessage extends Instruction { + const ExportMessage({ + required this.network, + required this.destination, + required this.xcm, + }); + + factory ExportMessage._decode(_i1.Input input) { + return ExportMessage( + network: _i19.NetworkId.codec.decode(input), + destination: _i10.Junctions.codec.decode(input), + xcm: const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).decode(input), + ); + } + + /// NetworkId + final _i19.NetworkId network; + + /// InteriorLocation + final _i10.Junctions destination; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'ExportMessage': { + 'network': network.toJson(), + 'destination': destination.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i19.NetworkId.codec.sizeHint(network); + size = size + _i10.Junctions.codec.sizeHint(destination); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 38, + output, + ); + _i19.NetworkId.codec.encodeTo( + network, + output, + ); + _i10.Junctions.codec.encodeTo( + destination, + output, + ); + const _i1.SequenceCodec<_i21.Instruction>(_i21.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExportMessage && + other.network == network && + other.destination == destination && + _i20.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + network, + destination, + xcm, + ); +} + +class LockAsset extends Instruction { + const LockAsset({ + required this.asset, + required this.unlocker, + }); + + factory LockAsset._decode(_i1.Input input) { + return LockAsset( + asset: _i13.Asset.codec.decode(input), + unlocker: _i6.Location.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset asset; + + /// Location + final _i6.Location unlocker; + + @override + Map>> toJson() => { + 'LockAsset': { + 'asset': asset.toJson(), + 'unlocker': unlocker.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(asset); + size = size + _i6.Location.codec.sizeHint(unlocker); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 39, + output, + ); + _i13.Asset.codec.encodeTo( + asset, + output, + ); + _i6.Location.codec.encodeTo( + unlocker, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is LockAsset && other.asset == asset && other.unlocker == unlocker; + + @override + int get hashCode => Object.hash( + asset, + unlocker, + ); +} + +class UnlockAsset extends Instruction { + const UnlockAsset({ + required this.asset, + required this.target, + }); + + factory UnlockAsset._decode(_i1.Input input) { + return UnlockAsset( + asset: _i13.Asset.codec.decode(input), + target: _i6.Location.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset asset; + + /// Location + final _i6.Location target; + + @override + Map>> toJson() => { + 'UnlockAsset': { + 'asset': asset.toJson(), + 'target': target.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(asset); + size = size + _i6.Location.codec.sizeHint(target); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 40, + output, + ); + _i13.Asset.codec.encodeTo( + asset, + output, + ); + _i6.Location.codec.encodeTo( + target, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UnlockAsset && other.asset == asset && other.target == target; + + @override + int get hashCode => Object.hash( + asset, + target, + ); +} + +class NoteUnlockable extends Instruction { + const NoteUnlockable({ + required this.asset, + required this.owner, + }); + + factory NoteUnlockable._decode(_i1.Input input) { + return NoteUnlockable( + asset: _i13.Asset.codec.decode(input), + owner: _i6.Location.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset asset; + + /// Location + final _i6.Location owner; + + @override + Map>> toJson() => { + 'NoteUnlockable': { + 'asset': asset.toJson(), + 'owner': owner.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(asset); + size = size + _i6.Location.codec.sizeHint(owner); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 41, + output, + ); + _i13.Asset.codec.encodeTo( + asset, + output, + ); + _i6.Location.codec.encodeTo( + owner, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is NoteUnlockable && other.asset == asset && other.owner == owner; + + @override + int get hashCode => Object.hash( + asset, + owner, + ); +} + +class RequestUnlock extends Instruction { + const RequestUnlock({ + required this.asset, + required this.locker, + }); + + factory RequestUnlock._decode(_i1.Input input) { + return RequestUnlock( + asset: _i13.Asset.codec.decode(input), + locker: _i6.Location.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset asset; + + /// Location + final _i6.Location locker; + + @override + Map>> toJson() => { + 'RequestUnlock': { + 'asset': asset.toJson(), + 'locker': locker.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(asset); + size = size + _i6.Location.codec.sizeHint(locker); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 42, + output, + ); + _i13.Asset.codec.encodeTo( + asset, + output, + ); + _i6.Location.codec.encodeTo( + locker, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is RequestUnlock && other.asset == asset && other.locker == locker; + + @override + int get hashCode => Object.hash( + asset, + locker, + ); +} + +class SetFeesMode extends Instruction { + const SetFeesMode({required this.jitWithdraw}); + + factory SetFeesMode._decode(_i1.Input input) { + return SetFeesMode(jitWithdraw: _i1.BoolCodec.codec.decode(input)); + } + + /// bool + final bool jitWithdraw; + + @override + Map> toJson() => { + 'SetFeesMode': {'jitWithdraw': jitWithdraw} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.BoolCodec.codec.sizeHint(jitWithdraw); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 43, + output, + ); + _i1.BoolCodec.codec.encodeTo( + jitWithdraw, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SetFeesMode && other.jitWithdraw == jitWithdraw; + + @override + int get hashCode => jitWithdraw.hashCode; +} + +class SetTopic extends Instruction { + const SetTopic(this.value0); + + factory SetTopic._decode(_i1.Input input) { + return SetTopic(const _i1.U8ArrayCodec(32).decode(input)); + } + + /// [u8; 32] + final List value0; + + @override + Map> toJson() => {'SetTopic': value0.toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.U8ArrayCodec(32).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 44, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SetTopic && + _i20.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ClearTopic extends Instruction { + const ClearTopic(); + + @override + Map toJson() => {'ClearTopic': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 45, + output, + ); + } + + @override + bool operator ==(Object other) => other is ClearTopic; + + @override + int get hashCode => runtimeType.hashCode; +} + +class AliasOrigin extends Instruction { + const AliasOrigin(this.value0); + + factory AliasOrigin._decode(_i1.Input input) { + return AliasOrigin(_i6.Location.codec.decode(input)); + } + + /// Location + final _i6.Location value0; + + @override + Map> toJson() => {'AliasOrigin': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i6.Location.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 46, + output, + ); + _i6.Location.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AliasOrigin && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class UnpaidExecution extends Instruction { + const UnpaidExecution({ + required this.weightLimit, + this.checkOrigin, + }); + + factory UnpaidExecution._decode(_i1.Input input) { + return UnpaidExecution( + weightLimit: _i14.WeightLimit.codec.decode(input), + checkOrigin: const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).decode(input), + ); + } + + /// WeightLimit + final _i14.WeightLimit weightLimit; + + /// Option + final _i6.Location? checkOrigin; + + @override + Map?>> toJson() => { + 'UnpaidExecution': { + 'weightLimit': weightLimit.toJson(), + 'checkOrigin': checkOrigin?.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i14.WeightLimit.codec.sizeHint(weightLimit); + size = size + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).sizeHint(checkOrigin); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 47, + output, + ); + _i14.WeightLimit.codec.encodeTo( + weightLimit, + output, + ); + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).encodeTo( + checkOrigin, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UnpaidExecution && other.weightLimit == weightLimit && other.checkOrigin == checkOrigin; + + @override + int get hashCode => Object.hash( + weightLimit, + checkOrigin, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/instruction_2.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/instruction_2.dart new file mode 100644 index 000000000..a847b9ade --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/instruction_2.dart @@ -0,0 +1,3473 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i21; + +import '../../sp_weights/weight_v2/weight.dart' as _i5; +import '../../tuples_1.dart' as _i16; +import '../../xcm/double_encoded/double_encoded_2.dart' as _i9; +import '../../xcm/v2/origin_kind.dart' as _i8; +import '../../xcm/v3/maybe_error_code.dart' as _i18; +import '../../xcm/v3/traits/error.dart' as _i17; +import '../../xcm/v3/weight_limit.dart' as _i14; +import 'asset/asset.dart' as _i13; +import 'asset/asset_filter.dart' as _i12; +import 'asset/assets.dart' as _i3; +import 'instruction_1.dart' as _i22; +import 'instruction_2.dart' as _i23; +import 'junction/junction.dart' as _i19; +import 'junction/network_id.dart' as _i20; +import 'junctions/junctions.dart' as _i10; +import 'location/location.dart' as _i6; +import 'query_response_info.dart' as _i11; +import 'response.dart' as _i4; +import 'xcm_1.dart' as _i7; +import 'xcm_2.dart' as _i15; + +abstract class Instruction { + const Instruction(); + + factory Instruction.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $InstructionCodec codec = $InstructionCodec(); + + static const $Instruction values = $Instruction(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $Instruction { + const $Instruction(); + + WithdrawAsset withdrawAsset(_i3.Assets value0) { + return WithdrawAsset(value0); + } + + ReserveAssetDeposited reserveAssetDeposited(_i3.Assets value0) { + return ReserveAssetDeposited(value0); + } + + ReceiveTeleportedAsset receiveTeleportedAsset(_i3.Assets value0) { + return ReceiveTeleportedAsset(value0); + } + + QueryResponse queryResponse({ + required BigInt queryId, + required _i4.Response response, + required _i5.Weight maxWeight, + _i6.Location? querier, + }) { + return QueryResponse( + queryId: queryId, + response: response, + maxWeight: maxWeight, + querier: querier, + ); + } + + TransferAsset transferAsset({ + required _i3.Assets assets, + required _i6.Location beneficiary, + }) { + return TransferAsset( + assets: assets, + beneficiary: beneficiary, + ); + } + + TransferReserveAsset transferReserveAsset({ + required _i3.Assets assets, + required _i6.Location dest, + required _i7.Xcm xcm, + }) { + return TransferReserveAsset( + assets: assets, + dest: dest, + xcm: xcm, + ); + } + + Transact transact({ + required _i8.OriginKind originKind, + required _i5.Weight requireWeightAtMost, + required _i9.DoubleEncoded call, + }) { + return Transact( + originKind: originKind, + requireWeightAtMost: requireWeightAtMost, + call: call, + ); + } + + HrmpNewChannelOpenRequest hrmpNewChannelOpenRequest({ + required BigInt sender, + required BigInt maxMessageSize, + required BigInt maxCapacity, + }) { + return HrmpNewChannelOpenRequest( + sender: sender, + maxMessageSize: maxMessageSize, + maxCapacity: maxCapacity, + ); + } + + HrmpChannelAccepted hrmpChannelAccepted({required BigInt recipient}) { + return HrmpChannelAccepted(recipient: recipient); + } + + HrmpChannelClosing hrmpChannelClosing({ + required BigInt initiator, + required BigInt sender, + required BigInt recipient, + }) { + return HrmpChannelClosing( + initiator: initiator, + sender: sender, + recipient: recipient, + ); + } + + ClearOrigin clearOrigin() { + return ClearOrigin(); + } + + DescendOrigin descendOrigin(_i10.Junctions value0) { + return DescendOrigin(value0); + } + + ReportError reportError(_i11.QueryResponseInfo value0) { + return ReportError(value0); + } + + DepositAsset depositAsset({ + required _i12.AssetFilter assets, + required _i6.Location beneficiary, + }) { + return DepositAsset( + assets: assets, + beneficiary: beneficiary, + ); + } + + DepositReserveAsset depositReserveAsset({ + required _i12.AssetFilter assets, + required _i6.Location dest, + required _i7.Xcm xcm, + }) { + return DepositReserveAsset( + assets: assets, + dest: dest, + xcm: xcm, + ); + } + + ExchangeAsset exchangeAsset({ + required _i12.AssetFilter give, + required _i3.Assets want, + required bool maximal, + }) { + return ExchangeAsset( + give: give, + want: want, + maximal: maximal, + ); + } + + InitiateReserveWithdraw initiateReserveWithdraw({ + required _i12.AssetFilter assets, + required _i6.Location reserve, + required _i7.Xcm xcm, + }) { + return InitiateReserveWithdraw( + assets: assets, + reserve: reserve, + xcm: xcm, + ); + } + + InitiateTeleport initiateTeleport({ + required _i12.AssetFilter assets, + required _i6.Location dest, + required _i7.Xcm xcm, + }) { + return InitiateTeleport( + assets: assets, + dest: dest, + xcm: xcm, + ); + } + + ReportHolding reportHolding({ + required _i11.QueryResponseInfo responseInfo, + required _i12.AssetFilter assets, + }) { + return ReportHolding( + responseInfo: responseInfo, + assets: assets, + ); + } + + BuyExecution buyExecution({ + required _i13.Asset fees, + required _i14.WeightLimit weightLimit, + }) { + return BuyExecution( + fees: fees, + weightLimit: weightLimit, + ); + } + + RefundSurplus refundSurplus() { + return RefundSurplus(); + } + + SetErrorHandler setErrorHandler(_i15.Xcm value0) { + return SetErrorHandler(value0); + } + + SetAppendix setAppendix(_i15.Xcm value0) { + return SetAppendix(value0); + } + + ClearError clearError() { + return ClearError(); + } + + ClaimAsset claimAsset({ + required _i3.Assets assets, + required _i6.Location ticket, + }) { + return ClaimAsset( + assets: assets, + ticket: ticket, + ); + } + + Trap trap(BigInt value0) { + return Trap(value0); + } + + SubscribeVersion subscribeVersion({ + required BigInt queryId, + required _i5.Weight maxResponseWeight, + }) { + return SubscribeVersion( + queryId: queryId, + maxResponseWeight: maxResponseWeight, + ); + } + + UnsubscribeVersion unsubscribeVersion() { + return UnsubscribeVersion(); + } + + BurnAsset burnAsset(_i3.Assets value0) { + return BurnAsset(value0); + } + + ExpectAsset expectAsset(_i3.Assets value0) { + return ExpectAsset(value0); + } + + ExpectOrigin expectOrigin(_i6.Location? value0) { + return ExpectOrigin(value0); + } + + ExpectError expectError(_i16.Tuple2? value0) { + return ExpectError(value0); + } + + ExpectTransactStatus expectTransactStatus(_i18.MaybeErrorCode value0) { + return ExpectTransactStatus(value0); + } + + QueryPallet queryPallet({ + required List moduleName, + required _i11.QueryResponseInfo responseInfo, + }) { + return QueryPallet( + moduleName: moduleName, + responseInfo: responseInfo, + ); + } + + ExpectPallet expectPallet({ + required BigInt index, + required List name, + required List moduleName, + required BigInt crateMajor, + required BigInt minCrateMinor, + }) { + return ExpectPallet( + index: index, + name: name, + moduleName: moduleName, + crateMajor: crateMajor, + minCrateMinor: minCrateMinor, + ); + } + + ReportTransactStatus reportTransactStatus(_i11.QueryResponseInfo value0) { + return ReportTransactStatus(value0); + } + + ClearTransactStatus clearTransactStatus() { + return ClearTransactStatus(); + } + + UniversalOrigin universalOrigin(_i19.Junction value0) { + return UniversalOrigin(value0); + } + + ExportMessage exportMessage({ + required _i20.NetworkId network, + required _i10.Junctions destination, + required _i7.Xcm xcm, + }) { + return ExportMessage( + network: network, + destination: destination, + xcm: xcm, + ); + } + + LockAsset lockAsset({ + required _i13.Asset asset, + required _i6.Location unlocker, + }) { + return LockAsset( + asset: asset, + unlocker: unlocker, + ); + } + + UnlockAsset unlockAsset({ + required _i13.Asset asset, + required _i6.Location target, + }) { + return UnlockAsset( + asset: asset, + target: target, + ); + } + + NoteUnlockable noteUnlockable({ + required _i13.Asset asset, + required _i6.Location owner, + }) { + return NoteUnlockable( + asset: asset, + owner: owner, + ); + } + + RequestUnlock requestUnlock({ + required _i13.Asset asset, + required _i6.Location locker, + }) { + return RequestUnlock( + asset: asset, + locker: locker, + ); + } + + SetFeesMode setFeesMode({required bool jitWithdraw}) { + return SetFeesMode(jitWithdraw: jitWithdraw); + } + + SetTopic setTopic(List value0) { + return SetTopic(value0); + } + + ClearTopic clearTopic() { + return ClearTopic(); + } + + AliasOrigin aliasOrigin(_i6.Location value0) { + return AliasOrigin(value0); + } + + UnpaidExecution unpaidExecution({ + required _i14.WeightLimit weightLimit, + _i6.Location? checkOrigin, + }) { + return UnpaidExecution( + weightLimit: weightLimit, + checkOrigin: checkOrigin, + ); + } +} + +class $InstructionCodec with _i1.Codec { + const $InstructionCodec(); + + @override + Instruction decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return WithdrawAsset._decode(input); + case 1: + return ReserveAssetDeposited._decode(input); + case 2: + return ReceiveTeleportedAsset._decode(input); + case 3: + return QueryResponse._decode(input); + case 4: + return TransferAsset._decode(input); + case 5: + return TransferReserveAsset._decode(input); + case 6: + return Transact._decode(input); + case 7: + return HrmpNewChannelOpenRequest._decode(input); + case 8: + return HrmpChannelAccepted._decode(input); + case 9: + return HrmpChannelClosing._decode(input); + case 10: + return const ClearOrigin(); + case 11: + return DescendOrigin._decode(input); + case 12: + return ReportError._decode(input); + case 13: + return DepositAsset._decode(input); + case 14: + return DepositReserveAsset._decode(input); + case 15: + return ExchangeAsset._decode(input); + case 16: + return InitiateReserveWithdraw._decode(input); + case 17: + return InitiateTeleport._decode(input); + case 18: + return ReportHolding._decode(input); + case 19: + return BuyExecution._decode(input); + case 20: + return const RefundSurplus(); + case 21: + return SetErrorHandler._decode(input); + case 22: + return SetAppendix._decode(input); + case 23: + return const ClearError(); + case 24: + return ClaimAsset._decode(input); + case 25: + return Trap._decode(input); + case 26: + return SubscribeVersion._decode(input); + case 27: + return const UnsubscribeVersion(); + case 28: + return BurnAsset._decode(input); + case 29: + return ExpectAsset._decode(input); + case 30: + return ExpectOrigin._decode(input); + case 31: + return ExpectError._decode(input); + case 32: + return ExpectTransactStatus._decode(input); + case 33: + return QueryPallet._decode(input); + case 34: + return ExpectPallet._decode(input); + case 35: + return ReportTransactStatus._decode(input); + case 36: + return const ClearTransactStatus(); + case 37: + return UniversalOrigin._decode(input); + case 38: + return ExportMessage._decode(input); + case 39: + return LockAsset._decode(input); + case 40: + return UnlockAsset._decode(input); + case 41: + return NoteUnlockable._decode(input); + case 42: + return RequestUnlock._decode(input); + case 43: + return SetFeesMode._decode(input); + case 44: + return SetTopic._decode(input); + case 45: + return const ClearTopic(); + case 46: + return AliasOrigin._decode(input); + case 47: + return UnpaidExecution._decode(input); + default: + throw Exception('Instruction: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Instruction value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case WithdrawAsset: + (value as WithdrawAsset).encodeTo(output); + break; + case ReserveAssetDeposited: + (value as ReserveAssetDeposited).encodeTo(output); + break; + case ReceiveTeleportedAsset: + (value as ReceiveTeleportedAsset).encodeTo(output); + break; + case QueryResponse: + (value as QueryResponse).encodeTo(output); + break; + case TransferAsset: + (value as TransferAsset).encodeTo(output); + break; + case TransferReserveAsset: + (value as TransferReserveAsset).encodeTo(output); + break; + case Transact: + (value as Transact).encodeTo(output); + break; + case HrmpNewChannelOpenRequest: + (value as HrmpNewChannelOpenRequest).encodeTo(output); + break; + case HrmpChannelAccepted: + (value as HrmpChannelAccepted).encodeTo(output); + break; + case HrmpChannelClosing: + (value as HrmpChannelClosing).encodeTo(output); + break; + case ClearOrigin: + (value as ClearOrigin).encodeTo(output); + break; + case DescendOrigin: + (value as DescendOrigin).encodeTo(output); + break; + case ReportError: + (value as ReportError).encodeTo(output); + break; + case DepositAsset: + (value as DepositAsset).encodeTo(output); + break; + case DepositReserveAsset: + (value as DepositReserveAsset).encodeTo(output); + break; + case ExchangeAsset: + (value as ExchangeAsset).encodeTo(output); + break; + case InitiateReserveWithdraw: + (value as InitiateReserveWithdraw).encodeTo(output); + break; + case InitiateTeleport: + (value as InitiateTeleport).encodeTo(output); + break; + case ReportHolding: + (value as ReportHolding).encodeTo(output); + break; + case BuyExecution: + (value as BuyExecution).encodeTo(output); + break; + case RefundSurplus: + (value as RefundSurplus).encodeTo(output); + break; + case SetErrorHandler: + (value as SetErrorHandler).encodeTo(output); + break; + case SetAppendix: + (value as SetAppendix).encodeTo(output); + break; + case ClearError: + (value as ClearError).encodeTo(output); + break; + case ClaimAsset: + (value as ClaimAsset).encodeTo(output); + break; + case Trap: + (value as Trap).encodeTo(output); + break; + case SubscribeVersion: + (value as SubscribeVersion).encodeTo(output); + break; + case UnsubscribeVersion: + (value as UnsubscribeVersion).encodeTo(output); + break; + case BurnAsset: + (value as BurnAsset).encodeTo(output); + break; + case ExpectAsset: + (value as ExpectAsset).encodeTo(output); + break; + case ExpectOrigin: + (value as ExpectOrigin).encodeTo(output); + break; + case ExpectError: + (value as ExpectError).encodeTo(output); + break; + case ExpectTransactStatus: + (value as ExpectTransactStatus).encodeTo(output); + break; + case QueryPallet: + (value as QueryPallet).encodeTo(output); + break; + case ExpectPallet: + (value as ExpectPallet).encodeTo(output); + break; + case ReportTransactStatus: + (value as ReportTransactStatus).encodeTo(output); + break; + case ClearTransactStatus: + (value as ClearTransactStatus).encodeTo(output); + break; + case UniversalOrigin: + (value as UniversalOrigin).encodeTo(output); + break; + case ExportMessage: + (value as ExportMessage).encodeTo(output); + break; + case LockAsset: + (value as LockAsset).encodeTo(output); + break; + case UnlockAsset: + (value as UnlockAsset).encodeTo(output); + break; + case NoteUnlockable: + (value as NoteUnlockable).encodeTo(output); + break; + case RequestUnlock: + (value as RequestUnlock).encodeTo(output); + break; + case SetFeesMode: + (value as SetFeesMode).encodeTo(output); + break; + case SetTopic: + (value as SetTopic).encodeTo(output); + break; + case ClearTopic: + (value as ClearTopic).encodeTo(output); + break; + case AliasOrigin: + (value as AliasOrigin).encodeTo(output); + break; + case UnpaidExecution: + (value as UnpaidExecution).encodeTo(output); + break; + default: + throw Exception('Instruction: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Instruction value) { + switch (value.runtimeType) { + case WithdrawAsset: + return (value as WithdrawAsset)._sizeHint(); + case ReserveAssetDeposited: + return (value as ReserveAssetDeposited)._sizeHint(); + case ReceiveTeleportedAsset: + return (value as ReceiveTeleportedAsset)._sizeHint(); + case QueryResponse: + return (value as QueryResponse)._sizeHint(); + case TransferAsset: + return (value as TransferAsset)._sizeHint(); + case TransferReserveAsset: + return (value as TransferReserveAsset)._sizeHint(); + case Transact: + return (value as Transact)._sizeHint(); + case HrmpNewChannelOpenRequest: + return (value as HrmpNewChannelOpenRequest)._sizeHint(); + case HrmpChannelAccepted: + return (value as HrmpChannelAccepted)._sizeHint(); + case HrmpChannelClosing: + return (value as HrmpChannelClosing)._sizeHint(); + case ClearOrigin: + return 1; + case DescendOrigin: + return (value as DescendOrigin)._sizeHint(); + case ReportError: + return (value as ReportError)._sizeHint(); + case DepositAsset: + return (value as DepositAsset)._sizeHint(); + case DepositReserveAsset: + return (value as DepositReserveAsset)._sizeHint(); + case ExchangeAsset: + return (value as ExchangeAsset)._sizeHint(); + case InitiateReserveWithdraw: + return (value as InitiateReserveWithdraw)._sizeHint(); + case InitiateTeleport: + return (value as InitiateTeleport)._sizeHint(); + case ReportHolding: + return (value as ReportHolding)._sizeHint(); + case BuyExecution: + return (value as BuyExecution)._sizeHint(); + case RefundSurplus: + return 1; + case SetErrorHandler: + return (value as SetErrorHandler)._sizeHint(); + case SetAppendix: + return (value as SetAppendix)._sizeHint(); + case ClearError: + return 1; + case ClaimAsset: + return (value as ClaimAsset)._sizeHint(); + case Trap: + return (value as Trap)._sizeHint(); + case SubscribeVersion: + return (value as SubscribeVersion)._sizeHint(); + case UnsubscribeVersion: + return 1; + case BurnAsset: + return (value as BurnAsset)._sizeHint(); + case ExpectAsset: + return (value as ExpectAsset)._sizeHint(); + case ExpectOrigin: + return (value as ExpectOrigin)._sizeHint(); + case ExpectError: + return (value as ExpectError)._sizeHint(); + case ExpectTransactStatus: + return (value as ExpectTransactStatus)._sizeHint(); + case QueryPallet: + return (value as QueryPallet)._sizeHint(); + case ExpectPallet: + return (value as ExpectPallet)._sizeHint(); + case ReportTransactStatus: + return (value as ReportTransactStatus)._sizeHint(); + case ClearTransactStatus: + return 1; + case UniversalOrigin: + return (value as UniversalOrigin)._sizeHint(); + case ExportMessage: + return (value as ExportMessage)._sizeHint(); + case LockAsset: + return (value as LockAsset)._sizeHint(); + case UnlockAsset: + return (value as UnlockAsset)._sizeHint(); + case NoteUnlockable: + return (value as NoteUnlockable)._sizeHint(); + case RequestUnlock: + return (value as RequestUnlock)._sizeHint(); + case SetFeesMode: + return (value as SetFeesMode)._sizeHint(); + case SetTopic: + return (value as SetTopic)._sizeHint(); + case ClearTopic: + return 1; + case AliasOrigin: + return (value as AliasOrigin)._sizeHint(); + case UnpaidExecution: + return (value as UnpaidExecution)._sizeHint(); + default: + throw Exception('Instruction: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class WithdrawAsset extends Instruction { + const WithdrawAsset(this.value0); + + factory WithdrawAsset._decode(_i1.Input input) { + return WithdrawAsset(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'WithdrawAsset': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is WithdrawAsset && + _i21.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ReserveAssetDeposited extends Instruction { + const ReserveAssetDeposited(this.value0); + + factory ReserveAssetDeposited._decode(_i1.Input input) { + return ReserveAssetDeposited(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'ReserveAssetDeposited': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReserveAssetDeposited && + _i21.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ReceiveTeleportedAsset extends Instruction { + const ReceiveTeleportedAsset(this.value0); + + factory ReceiveTeleportedAsset._decode(_i1.Input input) { + return ReceiveTeleportedAsset(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'ReceiveTeleportedAsset': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReceiveTeleportedAsset && + _i21.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class QueryResponse extends Instruction { + const QueryResponse({ + required this.queryId, + required this.response, + required this.maxWeight, + this.querier, + }); + + factory QueryResponse._decode(_i1.Input input) { + return QueryResponse( + queryId: _i1.CompactBigIntCodec.codec.decode(input), + response: _i4.Response.codec.decode(input), + maxWeight: _i5.Weight.codec.decode(input), + querier: const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).decode(input), + ); + } + + /// QueryId + final BigInt queryId; + + /// Response + final _i4.Response response; + + /// Weight + final _i5.Weight maxWeight; + + /// Option + final _i6.Location? querier; + + @override + Map> toJson() => { + 'QueryResponse': { + 'queryId': queryId, + 'response': response.toJson(), + 'maxWeight': maxWeight.toJson(), + 'querier': querier?.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(queryId); + size = size + _i4.Response.codec.sizeHint(response); + size = size + _i5.Weight.codec.sizeHint(maxWeight); + size = size + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).sizeHint(querier); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + queryId, + output, + ); + _i4.Response.codec.encodeTo( + response, + output, + ); + _i5.Weight.codec.encodeTo( + maxWeight, + output, + ); + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).encodeTo( + querier, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is QueryResponse && + other.queryId == queryId && + other.response == response && + other.maxWeight == maxWeight && + other.querier == querier; + + @override + int get hashCode => Object.hash( + queryId, + response, + maxWeight, + querier, + ); +} + +class TransferAsset extends Instruction { + const TransferAsset({ + required this.assets, + required this.beneficiary, + }); + + factory TransferAsset._decode(_i1.Input input) { + return TransferAsset( + assets: const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input), + beneficiary: _i6.Location.codec.decode(input), + ); + } + + /// Assets + final _i3.Assets assets; + + /// Location + final _i6.Location beneficiary; + + @override + Map> toJson() => { + 'TransferAsset': { + 'assets': assets.map((value) => value.toJson()).toList(), + 'beneficiary': beneficiary.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(beneficiary); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + beneficiary, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is TransferAsset && + _i21.listsEqual( + other.assets, + assets, + ) && + other.beneficiary == beneficiary; + + @override + int get hashCode => Object.hash( + assets, + beneficiary, + ); +} + +class TransferReserveAsset extends Instruction { + const TransferReserveAsset({ + required this.assets, + required this.dest, + required this.xcm, + }); + + factory TransferReserveAsset._decode(_i1.Input input) { + return TransferReserveAsset( + assets: const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input), + dest: _i6.Location.codec.decode(input), + xcm: const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).decode(input), + ); + } + + /// Assets + final _i3.Assets assets; + + /// Location + final _i6.Location dest; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'TransferReserveAsset': { + 'assets': assets.map((value) => value.toJson()).toList(), + 'dest': dest.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(dest); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + dest, + output, + ); + const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is TransferReserveAsset && + _i21.listsEqual( + other.assets, + assets, + ) && + other.dest == dest && + _i21.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + assets, + dest, + xcm, + ); +} + +class Transact extends Instruction { + const Transact({ + required this.originKind, + required this.requireWeightAtMost, + required this.call, + }); + + factory Transact._decode(_i1.Input input) { + return Transact( + originKind: _i8.OriginKind.codec.decode(input), + requireWeightAtMost: _i5.Weight.codec.decode(input), + call: _i9.DoubleEncoded.codec.decode(input), + ); + } + + /// OriginKind + final _i8.OriginKind originKind; + + /// Weight + final _i5.Weight requireWeightAtMost; + + /// DoubleEncoded + final _i9.DoubleEncoded call; + + @override + Map> toJson() => { + 'Transact': { + 'originKind': originKind.toJson(), + 'requireWeightAtMost': requireWeightAtMost.toJson(), + 'call': call.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i8.OriginKind.codec.sizeHint(originKind); + size = size + _i5.Weight.codec.sizeHint(requireWeightAtMost); + size = size + _i9.DoubleEncoded.codec.sizeHint(call); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + _i8.OriginKind.codec.encodeTo( + originKind, + output, + ); + _i5.Weight.codec.encodeTo( + requireWeightAtMost, + output, + ); + _i9.DoubleEncoded.codec.encodeTo( + call, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Transact && + other.originKind == originKind && + other.requireWeightAtMost == requireWeightAtMost && + other.call == call; + + @override + int get hashCode => Object.hash( + originKind, + requireWeightAtMost, + call, + ); +} + +class HrmpNewChannelOpenRequest extends Instruction { + const HrmpNewChannelOpenRequest({ + required this.sender, + required this.maxMessageSize, + required this.maxCapacity, + }); + + factory HrmpNewChannelOpenRequest._decode(_i1.Input input) { + return HrmpNewChannelOpenRequest( + sender: _i1.CompactBigIntCodec.codec.decode(input), + maxMessageSize: _i1.CompactBigIntCodec.codec.decode(input), + maxCapacity: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + /// u32 + final BigInt sender; + + /// u32 + final BigInt maxMessageSize; + + /// u32 + final BigInt maxCapacity; + + @override + Map> toJson() => { + 'HrmpNewChannelOpenRequest': { + 'sender': sender, + 'maxMessageSize': maxMessageSize, + 'maxCapacity': maxCapacity, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(sender); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(maxMessageSize); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(maxCapacity); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + sender, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + maxMessageSize, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + maxCapacity, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is HrmpNewChannelOpenRequest && + other.sender == sender && + other.maxMessageSize == maxMessageSize && + other.maxCapacity == maxCapacity; + + @override + int get hashCode => Object.hash( + sender, + maxMessageSize, + maxCapacity, + ); +} + +class HrmpChannelAccepted extends Instruction { + const HrmpChannelAccepted({required this.recipient}); + + factory HrmpChannelAccepted._decode(_i1.Input input) { + return HrmpChannelAccepted(recipient: _i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u32 + final BigInt recipient; + + @override + Map> toJson() => { + 'HrmpChannelAccepted': {'recipient': recipient} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(recipient); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 8, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + recipient, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is HrmpChannelAccepted && other.recipient == recipient; + + @override + int get hashCode => recipient.hashCode; +} + +class HrmpChannelClosing extends Instruction { + const HrmpChannelClosing({ + required this.initiator, + required this.sender, + required this.recipient, + }); + + factory HrmpChannelClosing._decode(_i1.Input input) { + return HrmpChannelClosing( + initiator: _i1.CompactBigIntCodec.codec.decode(input), + sender: _i1.CompactBigIntCodec.codec.decode(input), + recipient: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + /// u32 + final BigInt initiator; + + /// u32 + final BigInt sender; + + /// u32 + final BigInt recipient; + + @override + Map> toJson() => { + 'HrmpChannelClosing': { + 'initiator': initiator, + 'sender': sender, + 'recipient': recipient, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(initiator); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(sender); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(recipient); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 9, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + initiator, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + sender, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + recipient, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is HrmpChannelClosing && + other.initiator == initiator && + other.sender == sender && + other.recipient == recipient; + + @override + int get hashCode => Object.hash( + initiator, + sender, + recipient, + ); +} + +class ClearOrigin extends Instruction { + const ClearOrigin(); + + @override + Map toJson() => {'ClearOrigin': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 10, + output, + ); + } + + @override + bool operator ==(Object other) => other is ClearOrigin; + + @override + int get hashCode => runtimeType.hashCode; +} + +class DescendOrigin extends Instruction { + const DescendOrigin(this.value0); + + factory DescendOrigin._decode(_i1.Input input) { + return DescendOrigin(_i10.Junctions.codec.decode(input)); + } + + /// InteriorLocation + final _i10.Junctions value0; + + @override + Map> toJson() => {'DescendOrigin': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i10.Junctions.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 11, + output, + ); + _i10.Junctions.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is DescendOrigin && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ReportError extends Instruction { + const ReportError(this.value0); + + factory ReportError._decode(_i1.Input input) { + return ReportError(_i11.QueryResponseInfo.codec.decode(input)); + } + + /// QueryResponseInfo + final _i11.QueryResponseInfo value0; + + @override + Map> toJson() => {'ReportError': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i11.QueryResponseInfo.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 12, + output, + ); + _i11.QueryResponseInfo.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReportError && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class DepositAsset extends Instruction { + const DepositAsset({ + required this.assets, + required this.beneficiary, + }); + + factory DepositAsset._decode(_i1.Input input) { + return DepositAsset( + assets: _i12.AssetFilter.codec.decode(input), + beneficiary: _i6.Location.codec.decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter assets; + + /// Location + final _i6.Location beneficiary; + + @override + Map>> toJson() => { + 'DepositAsset': { + 'assets': assets.toJson(), + 'beneficiary': beneficiary.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(beneficiary); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 13, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + beneficiary, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is DepositAsset && other.assets == assets && other.beneficiary == beneficiary; + + @override + int get hashCode => Object.hash( + assets, + beneficiary, + ); +} + +class DepositReserveAsset extends Instruction { + const DepositReserveAsset({ + required this.assets, + required this.dest, + required this.xcm, + }); + + factory DepositReserveAsset._decode(_i1.Input input) { + return DepositReserveAsset( + assets: _i12.AssetFilter.codec.decode(input), + dest: _i6.Location.codec.decode(input), + xcm: const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter assets; + + /// Location + final _i6.Location dest; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'DepositReserveAsset': { + 'assets': assets.toJson(), + 'dest': dest.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(dest); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 14, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + dest, + output, + ); + const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is DepositReserveAsset && + other.assets == assets && + other.dest == dest && + _i21.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + assets, + dest, + xcm, + ); +} + +class ExchangeAsset extends Instruction { + const ExchangeAsset({ + required this.give, + required this.want, + required this.maximal, + }); + + factory ExchangeAsset._decode(_i1.Input input) { + return ExchangeAsset( + give: _i12.AssetFilter.codec.decode(input), + want: const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input), + maximal: _i1.BoolCodec.codec.decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter give; + + /// Assets + final _i3.Assets want; + + /// bool + final bool maximal; + + @override + Map> toJson() => { + 'ExchangeAsset': { + 'give': give.toJson(), + 'want': want.map((value) => value.toJson()).toList(), + 'maximal': maximal, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(give); + size = size + const _i3.AssetsCodec().sizeHint(want); + size = size + _i1.BoolCodec.codec.sizeHint(maximal); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 15, + output, + ); + _i12.AssetFilter.codec.encodeTo( + give, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + want, + output, + ); + _i1.BoolCodec.codec.encodeTo( + maximal, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExchangeAsset && + other.give == give && + _i21.listsEqual( + other.want, + want, + ) && + other.maximal == maximal; + + @override + int get hashCode => Object.hash( + give, + want, + maximal, + ); +} + +class InitiateReserveWithdraw extends Instruction { + const InitiateReserveWithdraw({ + required this.assets, + required this.reserve, + required this.xcm, + }); + + factory InitiateReserveWithdraw._decode(_i1.Input input) { + return InitiateReserveWithdraw( + assets: _i12.AssetFilter.codec.decode(input), + reserve: _i6.Location.codec.decode(input), + xcm: const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter assets; + + /// Location + final _i6.Location reserve; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'InitiateReserveWithdraw': { + 'assets': assets.toJson(), + 'reserve': reserve.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(reserve); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 16, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + reserve, + output, + ); + const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is InitiateReserveWithdraw && + other.assets == assets && + other.reserve == reserve && + _i21.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + assets, + reserve, + xcm, + ); +} + +class InitiateTeleport extends Instruction { + const InitiateTeleport({ + required this.assets, + required this.dest, + required this.xcm, + }); + + factory InitiateTeleport._decode(_i1.Input input) { + return InitiateTeleport( + assets: _i12.AssetFilter.codec.decode(input), + dest: _i6.Location.codec.decode(input), + xcm: const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).decode(input), + ); + } + + /// AssetFilter + final _i12.AssetFilter assets; + + /// Location + final _i6.Location dest; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'InitiateTeleport': { + 'assets': assets.toJson(), + 'dest': dest.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i12.AssetFilter.codec.sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(dest); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 17, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + dest, + output, + ); + const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is InitiateTeleport && + other.assets == assets && + other.dest == dest && + _i21.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + assets, + dest, + xcm, + ); +} + +class ReportHolding extends Instruction { + const ReportHolding({ + required this.responseInfo, + required this.assets, + }); + + factory ReportHolding._decode(_i1.Input input) { + return ReportHolding( + responseInfo: _i11.QueryResponseInfo.codec.decode(input), + assets: _i12.AssetFilter.codec.decode(input), + ); + } + + /// QueryResponseInfo + final _i11.QueryResponseInfo responseInfo; + + /// AssetFilter + final _i12.AssetFilter assets; + + @override + Map>> toJson() => { + 'ReportHolding': { + 'responseInfo': responseInfo.toJson(), + 'assets': assets.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i11.QueryResponseInfo.codec.sizeHint(responseInfo); + size = size + _i12.AssetFilter.codec.sizeHint(assets); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 18, + output, + ); + _i11.QueryResponseInfo.codec.encodeTo( + responseInfo, + output, + ); + _i12.AssetFilter.codec.encodeTo( + assets, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReportHolding && other.responseInfo == responseInfo && other.assets == assets; + + @override + int get hashCode => Object.hash( + responseInfo, + assets, + ); +} + +class BuyExecution extends Instruction { + const BuyExecution({ + required this.fees, + required this.weightLimit, + }); + + factory BuyExecution._decode(_i1.Input input) { + return BuyExecution( + fees: _i13.Asset.codec.decode(input), + weightLimit: _i14.WeightLimit.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset fees; + + /// WeightLimit + final _i14.WeightLimit weightLimit; + + @override + Map>> toJson() => { + 'BuyExecution': { + 'fees': fees.toJson(), + 'weightLimit': weightLimit.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(fees); + size = size + _i14.WeightLimit.codec.sizeHint(weightLimit); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 19, + output, + ); + _i13.Asset.codec.encodeTo( + fees, + output, + ); + _i14.WeightLimit.codec.encodeTo( + weightLimit, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is BuyExecution && other.fees == fees && other.weightLimit == weightLimit; + + @override + int get hashCode => Object.hash( + fees, + weightLimit, + ); +} + +class RefundSurplus extends Instruction { + const RefundSurplus(); + + @override + Map toJson() => {'RefundSurplus': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 20, + output, + ); + } + + @override + bool operator ==(Object other) => other is RefundSurplus; + + @override + int get hashCode => runtimeType.hashCode; +} + +class SetErrorHandler extends Instruction { + const SetErrorHandler(this.value0); + + factory SetErrorHandler._decode(_i1.Input input) { + return SetErrorHandler(const _i1.SequenceCodec<_i23.Instruction>(_i23.Instruction.codec).decode(input)); + } + + /// Xcm + final _i15.Xcm value0; + + @override + Map>> toJson() => + {'SetErrorHandler': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i15.XcmCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 21, + output, + ); + const _i1.SequenceCodec<_i23.Instruction>(_i23.Instruction.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SetErrorHandler && + _i21.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class SetAppendix extends Instruction { + const SetAppendix(this.value0); + + factory SetAppendix._decode(_i1.Input input) { + return SetAppendix(const _i1.SequenceCodec<_i23.Instruction>(_i23.Instruction.codec).decode(input)); + } + + /// Xcm + final _i15.Xcm value0; + + @override + Map> toJson() => {'SetAppendix': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i15.XcmCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 22, + output, + ); + const _i1.SequenceCodec<_i23.Instruction>(_i23.Instruction.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SetAppendix && + _i21.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ClearError extends Instruction { + const ClearError(); + + @override + Map toJson() => {'ClearError': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 23, + output, + ); + } + + @override + bool operator ==(Object other) => other is ClearError; + + @override + int get hashCode => runtimeType.hashCode; +} + +class ClaimAsset extends Instruction { + const ClaimAsset({ + required this.assets, + required this.ticket, + }); + + factory ClaimAsset._decode(_i1.Input input) { + return ClaimAsset( + assets: const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input), + ticket: _i6.Location.codec.decode(input), + ); + } + + /// Assets + final _i3.Assets assets; + + /// Location + final _i6.Location ticket; + + @override + Map> toJson() => { + 'ClaimAsset': { + 'assets': assets.map((value) => value.toJson()).toList(), + 'ticket': ticket.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(assets); + size = size + _i6.Location.codec.sizeHint(ticket); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 24, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + assets, + output, + ); + _i6.Location.codec.encodeTo( + ticket, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ClaimAsset && + _i21.listsEqual( + other.assets, + assets, + ) && + other.ticket == ticket; + + @override + int get hashCode => Object.hash( + assets, + ticket, + ); +} + +class Trap extends Instruction { + const Trap(this.value0); + + factory Trap._decode(_i1.Input input) { + return Trap(_i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u64 + final BigInt value0; + + @override + Map toJson() => {'Trap': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 25, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Trap && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class SubscribeVersion extends Instruction { + const SubscribeVersion({ + required this.queryId, + required this.maxResponseWeight, + }); + + factory SubscribeVersion._decode(_i1.Input input) { + return SubscribeVersion( + queryId: _i1.CompactBigIntCodec.codec.decode(input), + maxResponseWeight: _i5.Weight.codec.decode(input), + ); + } + + /// QueryId + final BigInt queryId; + + /// Weight + final _i5.Weight maxResponseWeight; + + @override + Map> toJson() => { + 'SubscribeVersion': { + 'queryId': queryId, + 'maxResponseWeight': maxResponseWeight.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(queryId); + size = size + _i5.Weight.codec.sizeHint(maxResponseWeight); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 26, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + queryId, + output, + ); + _i5.Weight.codec.encodeTo( + maxResponseWeight, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SubscribeVersion && other.queryId == queryId && other.maxResponseWeight == maxResponseWeight; + + @override + int get hashCode => Object.hash( + queryId, + maxResponseWeight, + ); +} + +class UnsubscribeVersion extends Instruction { + const UnsubscribeVersion(); + + @override + Map toJson() => {'UnsubscribeVersion': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 27, + output, + ); + } + + @override + bool operator ==(Object other) => other is UnsubscribeVersion; + + @override + int get hashCode => runtimeType.hashCode; +} + +class BurnAsset extends Instruction { + const BurnAsset(this.value0); + + factory BurnAsset._decode(_i1.Input input) { + return BurnAsset(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'BurnAsset': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 28, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is BurnAsset && + _i21.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ExpectAsset extends Instruction { + const ExpectAsset(this.value0); + + factory ExpectAsset._decode(_i1.Input input) { + return ExpectAsset(const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'ExpectAsset': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 29, + output, + ); + const _i1.SequenceCodec<_i13.Asset>(_i13.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectAsset && + _i21.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ExpectOrigin extends Instruction { + const ExpectOrigin(this.value0); + + factory ExpectOrigin._decode(_i1.Input input) { + return ExpectOrigin(const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).decode(input)); + } + + /// Option + final _i6.Location? value0; + + @override + Map?> toJson() => {'ExpectOrigin': value0?.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 30, + output, + ); + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectOrigin && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ExpectError extends Instruction { + const ExpectError(this.value0); + + factory ExpectError._decode(_i1.Input input) { + return ExpectError(const _i1.OptionCodec<_i16.Tuple2>(_i16.Tuple2Codec( + _i1.U32Codec.codec, + _i17.Error.codec, + )).decode(input)); + } + + /// Option<(u32, Error)> + final _i16.Tuple2? value0; + + @override + Map?> toJson() => { + 'ExpectError': [ + value0?.value0, + value0?.value1.toJson(), + ] + }; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.OptionCodec<_i16.Tuple2>(_i16.Tuple2Codec( + _i1.U32Codec.codec, + _i17.Error.codec, + )).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 31, + output, + ); + const _i1.OptionCodec<_i16.Tuple2>(_i16.Tuple2Codec( + _i1.U32Codec.codec, + _i17.Error.codec, + )).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectError && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ExpectTransactStatus extends Instruction { + const ExpectTransactStatus(this.value0); + + factory ExpectTransactStatus._decode(_i1.Input input) { + return ExpectTransactStatus(_i18.MaybeErrorCode.codec.decode(input)); + } + + /// MaybeErrorCode + final _i18.MaybeErrorCode value0; + + @override + Map> toJson() => {'ExpectTransactStatus': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i18.MaybeErrorCode.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 32, + output, + ); + _i18.MaybeErrorCode.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectTransactStatus && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class QueryPallet extends Instruction { + const QueryPallet({ + required this.moduleName, + required this.responseInfo, + }); + + factory QueryPallet._decode(_i1.Input input) { + return QueryPallet( + moduleName: _i1.U8SequenceCodec.codec.decode(input), + responseInfo: _i11.QueryResponseInfo.codec.decode(input), + ); + } + + /// Vec + final List moduleName; + + /// QueryResponseInfo + final _i11.QueryResponseInfo responseInfo; + + @override + Map> toJson() => { + 'QueryPallet': { + 'moduleName': moduleName, + 'responseInfo': responseInfo.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U8SequenceCodec.codec.sizeHint(moduleName); + size = size + _i11.QueryResponseInfo.codec.sizeHint(responseInfo); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 33, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + moduleName, + output, + ); + _i11.QueryResponseInfo.codec.encodeTo( + responseInfo, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is QueryPallet && + _i21.listsEqual( + other.moduleName, + moduleName, + ) && + other.responseInfo == responseInfo; + + @override + int get hashCode => Object.hash( + moduleName, + responseInfo, + ); +} + +class ExpectPallet extends Instruction { + const ExpectPallet({ + required this.index, + required this.name, + required this.moduleName, + required this.crateMajor, + required this.minCrateMinor, + }); + + factory ExpectPallet._decode(_i1.Input input) { + return ExpectPallet( + index: _i1.CompactBigIntCodec.codec.decode(input), + name: _i1.U8SequenceCodec.codec.decode(input), + moduleName: _i1.U8SequenceCodec.codec.decode(input), + crateMajor: _i1.CompactBigIntCodec.codec.decode(input), + minCrateMinor: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + /// u32 + final BigInt index; + + /// Vec + final List name; + + /// Vec + final List moduleName; + + /// u32 + final BigInt crateMajor; + + /// u32 + final BigInt minCrateMinor; + + @override + Map> toJson() => { + 'ExpectPallet': { + 'index': index, + 'name': name, + 'moduleName': moduleName, + 'crateMajor': crateMajor, + 'minCrateMinor': minCrateMinor, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(index); + size = size + _i1.U8SequenceCodec.codec.sizeHint(name); + size = size + _i1.U8SequenceCodec.codec.sizeHint(moduleName); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(crateMajor); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(minCrateMinor); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 34, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + index, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + name, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + moduleName, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + crateMajor, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + minCrateMinor, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExpectPallet && + other.index == index && + _i21.listsEqual( + other.name, + name, + ) && + _i21.listsEqual( + other.moduleName, + moduleName, + ) && + other.crateMajor == crateMajor && + other.minCrateMinor == minCrateMinor; + + @override + int get hashCode => Object.hash( + index, + name, + moduleName, + crateMajor, + minCrateMinor, + ); +} + +class ReportTransactStatus extends Instruction { + const ReportTransactStatus(this.value0); + + factory ReportTransactStatus._decode(_i1.Input input) { + return ReportTransactStatus(_i11.QueryResponseInfo.codec.decode(input)); + } + + /// QueryResponseInfo + final _i11.QueryResponseInfo value0; + + @override + Map> toJson() => {'ReportTransactStatus': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i11.QueryResponseInfo.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 35, + output, + ); + _i11.QueryResponseInfo.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ReportTransactStatus && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ClearTransactStatus extends Instruction { + const ClearTransactStatus(); + + @override + Map toJson() => {'ClearTransactStatus': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 36, + output, + ); + } + + @override + bool operator ==(Object other) => other is ClearTransactStatus; + + @override + int get hashCode => runtimeType.hashCode; +} + +class UniversalOrigin extends Instruction { + const UniversalOrigin(this.value0); + + factory UniversalOrigin._decode(_i1.Input input) { + return UniversalOrigin(_i19.Junction.codec.decode(input)); + } + + /// Junction + final _i19.Junction value0; + + @override + Map> toJson() => {'UniversalOrigin': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i19.Junction.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 37, + output, + ); + _i19.Junction.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UniversalOrigin && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class ExportMessage extends Instruction { + const ExportMessage({ + required this.network, + required this.destination, + required this.xcm, + }); + + factory ExportMessage._decode(_i1.Input input) { + return ExportMessage( + network: _i20.NetworkId.codec.decode(input), + destination: _i10.Junctions.codec.decode(input), + xcm: const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).decode(input), + ); + } + + /// NetworkId + final _i20.NetworkId network; + + /// InteriorLocation + final _i10.Junctions destination; + + /// Xcm<()> + final _i7.Xcm xcm; + + @override + Map> toJson() => { + 'ExportMessage': { + 'network': network.toJson(), + 'destination': destination.toJson(), + 'xcm': xcm.map((value) => value.toJson()).toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i20.NetworkId.codec.sizeHint(network); + size = size + _i10.Junctions.codec.sizeHint(destination); + size = size + const _i7.XcmCodec().sizeHint(xcm); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 38, + output, + ); + _i20.NetworkId.codec.encodeTo( + network, + output, + ); + _i10.Junctions.codec.encodeTo( + destination, + output, + ); + const _i1.SequenceCodec<_i22.Instruction>(_i22.Instruction.codec).encodeTo( + xcm, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExportMessage && + other.network == network && + other.destination == destination && + _i21.listsEqual( + other.xcm, + xcm, + ); + + @override + int get hashCode => Object.hash( + network, + destination, + xcm, + ); +} + +class LockAsset extends Instruction { + const LockAsset({ + required this.asset, + required this.unlocker, + }); + + factory LockAsset._decode(_i1.Input input) { + return LockAsset( + asset: _i13.Asset.codec.decode(input), + unlocker: _i6.Location.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset asset; + + /// Location + final _i6.Location unlocker; + + @override + Map>> toJson() => { + 'LockAsset': { + 'asset': asset.toJson(), + 'unlocker': unlocker.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(asset); + size = size + _i6.Location.codec.sizeHint(unlocker); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 39, + output, + ); + _i13.Asset.codec.encodeTo( + asset, + output, + ); + _i6.Location.codec.encodeTo( + unlocker, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is LockAsset && other.asset == asset && other.unlocker == unlocker; + + @override + int get hashCode => Object.hash( + asset, + unlocker, + ); +} + +class UnlockAsset extends Instruction { + const UnlockAsset({ + required this.asset, + required this.target, + }); + + factory UnlockAsset._decode(_i1.Input input) { + return UnlockAsset( + asset: _i13.Asset.codec.decode(input), + target: _i6.Location.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset asset; + + /// Location + final _i6.Location target; + + @override + Map>> toJson() => { + 'UnlockAsset': { + 'asset': asset.toJson(), + 'target': target.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(asset); + size = size + _i6.Location.codec.sizeHint(target); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 40, + output, + ); + _i13.Asset.codec.encodeTo( + asset, + output, + ); + _i6.Location.codec.encodeTo( + target, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UnlockAsset && other.asset == asset && other.target == target; + + @override + int get hashCode => Object.hash( + asset, + target, + ); +} + +class NoteUnlockable extends Instruction { + const NoteUnlockable({ + required this.asset, + required this.owner, + }); + + factory NoteUnlockable._decode(_i1.Input input) { + return NoteUnlockable( + asset: _i13.Asset.codec.decode(input), + owner: _i6.Location.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset asset; + + /// Location + final _i6.Location owner; + + @override + Map>> toJson() => { + 'NoteUnlockable': { + 'asset': asset.toJson(), + 'owner': owner.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(asset); + size = size + _i6.Location.codec.sizeHint(owner); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 41, + output, + ); + _i13.Asset.codec.encodeTo( + asset, + output, + ); + _i6.Location.codec.encodeTo( + owner, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is NoteUnlockable && other.asset == asset && other.owner == owner; + + @override + int get hashCode => Object.hash( + asset, + owner, + ); +} + +class RequestUnlock extends Instruction { + const RequestUnlock({ + required this.asset, + required this.locker, + }); + + factory RequestUnlock._decode(_i1.Input input) { + return RequestUnlock( + asset: _i13.Asset.codec.decode(input), + locker: _i6.Location.codec.decode(input), + ); + } + + /// Asset + final _i13.Asset asset; + + /// Location + final _i6.Location locker; + + @override + Map>> toJson() => { + 'RequestUnlock': { + 'asset': asset.toJson(), + 'locker': locker.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i13.Asset.codec.sizeHint(asset); + size = size + _i6.Location.codec.sizeHint(locker); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 42, + output, + ); + _i13.Asset.codec.encodeTo( + asset, + output, + ); + _i6.Location.codec.encodeTo( + locker, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is RequestUnlock && other.asset == asset && other.locker == locker; + + @override + int get hashCode => Object.hash( + asset, + locker, + ); +} + +class SetFeesMode extends Instruction { + const SetFeesMode({required this.jitWithdraw}); + + factory SetFeesMode._decode(_i1.Input input) { + return SetFeesMode(jitWithdraw: _i1.BoolCodec.codec.decode(input)); + } + + /// bool + final bool jitWithdraw; + + @override + Map> toJson() => { + 'SetFeesMode': {'jitWithdraw': jitWithdraw} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.BoolCodec.codec.sizeHint(jitWithdraw); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 43, + output, + ); + _i1.BoolCodec.codec.encodeTo( + jitWithdraw, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SetFeesMode && other.jitWithdraw == jitWithdraw; + + @override + int get hashCode => jitWithdraw.hashCode; +} + +class SetTopic extends Instruction { + const SetTopic(this.value0); + + factory SetTopic._decode(_i1.Input input) { + return SetTopic(const _i1.U8ArrayCodec(32).decode(input)); + } + + /// [u8; 32] + final List value0; + + @override + Map> toJson() => {'SetTopic': value0.toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.U8ArrayCodec(32).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 44, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is SetTopic && + _i21.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ClearTopic extends Instruction { + const ClearTopic(); + + @override + Map toJson() => {'ClearTopic': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 45, + output, + ); + } + + @override + bool operator ==(Object other) => other is ClearTopic; + + @override + int get hashCode => runtimeType.hashCode; +} + +class AliasOrigin extends Instruction { + const AliasOrigin(this.value0); + + factory AliasOrigin._decode(_i1.Input input) { + return AliasOrigin(_i6.Location.codec.decode(input)); + } + + /// Location + final _i6.Location value0; + + @override + Map> toJson() => {'AliasOrigin': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i6.Location.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 46, + output, + ); + _i6.Location.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AliasOrigin && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class UnpaidExecution extends Instruction { + const UnpaidExecution({ + required this.weightLimit, + this.checkOrigin, + }); + + factory UnpaidExecution._decode(_i1.Input input) { + return UnpaidExecution( + weightLimit: _i14.WeightLimit.codec.decode(input), + checkOrigin: const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).decode(input), + ); + } + + /// WeightLimit + final _i14.WeightLimit weightLimit; + + /// Option + final _i6.Location? checkOrigin; + + @override + Map?>> toJson() => { + 'UnpaidExecution': { + 'weightLimit': weightLimit.toJson(), + 'checkOrigin': checkOrigin?.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i14.WeightLimit.codec.sizeHint(weightLimit); + size = size + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).sizeHint(checkOrigin); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 47, + output, + ); + _i14.WeightLimit.codec.encodeTo( + weightLimit, + output, + ); + const _i1.OptionCodec<_i6.Location>(_i6.Location.codec).encodeTo( + checkOrigin, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UnpaidExecution && other.weightLimit == weightLimit && other.checkOrigin == checkOrigin; + + @override + int get hashCode => Object.hash( + weightLimit, + checkOrigin, + ); +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junction/junction.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junction/junction.dart new file mode 100644 index 000000000..508d46d3c --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junction/junction.dart @@ -0,0 +1,732 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i6; + +import '../../../xcm/v3/junction/body_id.dart' as _i4; +import '../../../xcm/v3/junction/body_part.dart' as _i5; +import 'network_id.dart' as _i3; + +abstract class Junction { + const Junction(); + + factory Junction.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $JunctionCodec codec = $JunctionCodec(); + + static const $Junction values = $Junction(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $Junction { + const $Junction(); + + Parachain parachain(BigInt value0) { + return Parachain(value0); + } + + AccountId32 accountId32({ + _i3.NetworkId? network, + required List id, + }) { + return AccountId32( + network: network, + id: id, + ); + } + + AccountIndex64 accountIndex64({ + _i3.NetworkId? network, + required BigInt index, + }) { + return AccountIndex64( + network: network, + index: index, + ); + } + + AccountKey20 accountKey20({ + _i3.NetworkId? network, + required List key, + }) { + return AccountKey20( + network: network, + key: key, + ); + } + + PalletInstance palletInstance(int value0) { + return PalletInstance(value0); + } + + GeneralIndex generalIndex(BigInt value0) { + return GeneralIndex(value0); + } + + GeneralKey generalKey({ + required int length, + required List data, + }) { + return GeneralKey( + length: length, + data: data, + ); + } + + OnlyChild onlyChild() { + return OnlyChild(); + } + + Plurality plurality({ + required _i4.BodyId id, + required _i5.BodyPart part, + }) { + return Plurality( + id: id, + part: part, + ); + } + + GlobalConsensus globalConsensus(_i3.NetworkId value0) { + return GlobalConsensus(value0); + } +} + +class $JunctionCodec with _i1.Codec { + const $JunctionCodec(); + + @override + Junction decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return Parachain._decode(input); + case 1: + return AccountId32._decode(input); + case 2: + return AccountIndex64._decode(input); + case 3: + return AccountKey20._decode(input); + case 4: + return PalletInstance._decode(input); + case 5: + return GeneralIndex._decode(input); + case 6: + return GeneralKey._decode(input); + case 7: + return const OnlyChild(); + case 8: + return Plurality._decode(input); + case 9: + return GlobalConsensus._decode(input); + default: + throw Exception('Junction: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Junction value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Parachain: + (value as Parachain).encodeTo(output); + break; + case AccountId32: + (value as AccountId32).encodeTo(output); + break; + case AccountIndex64: + (value as AccountIndex64).encodeTo(output); + break; + case AccountKey20: + (value as AccountKey20).encodeTo(output); + break; + case PalletInstance: + (value as PalletInstance).encodeTo(output); + break; + case GeneralIndex: + (value as GeneralIndex).encodeTo(output); + break; + case GeneralKey: + (value as GeneralKey).encodeTo(output); + break; + case OnlyChild: + (value as OnlyChild).encodeTo(output); + break; + case Plurality: + (value as Plurality).encodeTo(output); + break; + case GlobalConsensus: + (value as GlobalConsensus).encodeTo(output); + break; + default: + throw Exception('Junction: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Junction value) { + switch (value.runtimeType) { + case Parachain: + return (value as Parachain)._sizeHint(); + case AccountId32: + return (value as AccountId32)._sizeHint(); + case AccountIndex64: + return (value as AccountIndex64)._sizeHint(); + case AccountKey20: + return (value as AccountKey20)._sizeHint(); + case PalletInstance: + return (value as PalletInstance)._sizeHint(); + case GeneralIndex: + return (value as GeneralIndex)._sizeHint(); + case GeneralKey: + return (value as GeneralKey)._sizeHint(); + case OnlyChild: + return 1; + case Plurality: + return (value as Plurality)._sizeHint(); + case GlobalConsensus: + return (value as GlobalConsensus)._sizeHint(); + default: + throw Exception('Junction: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Parachain extends Junction { + const Parachain(this.value0); + + factory Parachain._decode(_i1.Input input) { + return Parachain(_i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u32 + final BigInt value0; + + @override + Map toJson() => {'Parachain': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Parachain && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class AccountId32 extends Junction { + const AccountId32({ + this.network, + required this.id, + }); + + factory AccountId32._decode(_i1.Input input) { + return AccountId32( + network: const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).decode(input), + id: const _i1.U8ArrayCodec(32).decode(input), + ); + } + + /// Option + final _i3.NetworkId? network; + + /// [u8; 32] + final List id; + + @override + Map> toJson() => { + 'AccountId32': { + 'network': network?.toJson(), + 'id': id.toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).sizeHint(network); + size = size + const _i1.U8ArrayCodec(32).sizeHint(id); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).encodeTo( + network, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + id, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AccountId32 && + other.network == network && + _i6.listsEqual( + other.id, + id, + ); + + @override + int get hashCode => Object.hash( + network, + id, + ); +} + +class AccountIndex64 extends Junction { + const AccountIndex64({ + this.network, + required this.index, + }); + + factory AccountIndex64._decode(_i1.Input input) { + return AccountIndex64( + network: const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).decode(input), + index: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + /// Option + final _i3.NetworkId? network; + + /// u64 + final BigInt index; + + @override + Map> toJson() => { + 'AccountIndex64': { + 'network': network?.toJson(), + 'index': index, + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).sizeHint(network); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(index); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).encodeTo( + network, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + index, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AccountIndex64 && other.network == network && other.index == index; + + @override + int get hashCode => Object.hash( + network, + index, + ); +} + +class AccountKey20 extends Junction { + const AccountKey20({ + this.network, + required this.key, + }); + + factory AccountKey20._decode(_i1.Input input) { + return AccountKey20( + network: const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).decode(input), + key: const _i1.U8ArrayCodec(20).decode(input), + ); + } + + /// Option + final _i3.NetworkId? network; + + /// [u8; 20] + final List key; + + @override + Map> toJson() => { + 'AccountKey20': { + 'network': network?.toJson(), + 'key': key.toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).sizeHint(network); + size = size + const _i1.U8ArrayCodec(20).sizeHint(key); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + const _i1.OptionCodec<_i3.NetworkId>(_i3.NetworkId.codec).encodeTo( + network, + output, + ); + const _i1.U8ArrayCodec(20).encodeTo( + key, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is AccountKey20 && + other.network == network && + _i6.listsEqual( + other.key, + key, + ); + + @override + int get hashCode => Object.hash( + network, + key, + ); +} + +class PalletInstance extends Junction { + const PalletInstance(this.value0); + + factory PalletInstance._decode(_i1.Input input) { + return PalletInstance(_i1.U8Codec.codec.decode(input)); + } + + /// u8 + final int value0; + + @override + Map toJson() => {'PalletInstance': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.U8Codec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + _i1.U8Codec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is PalletInstance && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class GeneralIndex extends Junction { + const GeneralIndex(this.value0); + + factory GeneralIndex._decode(_i1.Input input) { + return GeneralIndex(_i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u128 + final BigInt value0; + + @override + Map toJson() => {'GeneralIndex': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is GeneralIndex && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class GeneralKey extends Junction { + const GeneralKey({ + required this.length, + required this.data, + }); + + factory GeneralKey._decode(_i1.Input input) { + return GeneralKey( + length: _i1.U8Codec.codec.decode(input), + data: const _i1.U8ArrayCodec(32).decode(input), + ); + } + + /// u8 + final int length; + + /// [u8; 32] + final List data; + + @override + Map> toJson() => { + 'GeneralKey': { + 'length': length, + 'data': data.toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U8Codec.codec.sizeHint(length); + size = size + const _i1.U8ArrayCodec(32).sizeHint(data); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + _i1.U8Codec.codec.encodeTo( + length, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + data, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is GeneralKey && + other.length == length && + _i6.listsEqual( + other.data, + data, + ); + + @override + int get hashCode => Object.hash( + length, + data, + ); +} + +class OnlyChild extends Junction { + const OnlyChild(); + + @override + Map toJson() => {'OnlyChild': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, + ); + } + + @override + bool operator ==(Object other) => other is OnlyChild; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Plurality extends Junction { + const Plurality({ + required this.id, + required this.part, + }); + + factory Plurality._decode(_i1.Input input) { + return Plurality( + id: _i4.BodyId.codec.decode(input), + part: _i5.BodyPart.codec.decode(input), + ); + } + + /// BodyId + final _i4.BodyId id; + + /// BodyPart + final _i5.BodyPart part; + + @override + Map>> toJson() => { + 'Plurality': { + 'id': id.toJson(), + 'part': part.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i4.BodyId.codec.sizeHint(id); + size = size + _i5.BodyPart.codec.sizeHint(part); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 8, + output, + ); + _i4.BodyId.codec.encodeTo( + id, + output, + ); + _i5.BodyPart.codec.encodeTo( + part, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Plurality && other.id == id && other.part == part; + + @override + int get hashCode => Object.hash( + id, + part, + ); +} + +class GlobalConsensus extends Junction { + const GlobalConsensus(this.value0); + + factory GlobalConsensus._decode(_i1.Input input) { + return GlobalConsensus(_i3.NetworkId.codec.decode(input)); + } + + /// NetworkId + final _i3.NetworkId value0; + + @override + Map> toJson() => {'GlobalConsensus': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i3.NetworkId.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 9, + output, + ); + _i3.NetworkId.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is GlobalConsensus && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junction/network_id.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junction/network_id.dart new file mode 100644 index 000000000..d4079c315 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junction/network_id.dart @@ -0,0 +1,511 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i3; + +abstract class NetworkId { + const NetworkId(); + + factory NetworkId.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $NetworkIdCodec codec = $NetworkIdCodec(); + + static const $NetworkId values = $NetworkId(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $NetworkId { + const $NetworkId(); + + ByGenesis byGenesis(List value0) { + return ByGenesis(value0); + } + + ByFork byFork({ + required BigInt blockNumber, + required List blockHash, + }) { + return ByFork( + blockNumber: blockNumber, + blockHash: blockHash, + ); + } + + Polkadot polkadot() { + return Polkadot(); + } + + Kusama kusama() { + return Kusama(); + } + + Westend westend() { + return Westend(); + } + + Rococo rococo() { + return Rococo(); + } + + Wococo wococo() { + return Wococo(); + } + + Ethereum ethereum({required BigInt chainId}) { + return Ethereum(chainId: chainId); + } + + BitcoinCore bitcoinCore() { + return BitcoinCore(); + } + + BitcoinCash bitcoinCash() { + return BitcoinCash(); + } + + PolkadotBulletin polkadotBulletin() { + return PolkadotBulletin(); + } +} + +class $NetworkIdCodec with _i1.Codec { + const $NetworkIdCodec(); + + @override + NetworkId decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return ByGenesis._decode(input); + case 1: + return ByFork._decode(input); + case 2: + return const Polkadot(); + case 3: + return const Kusama(); + case 4: + return const Westend(); + case 5: + return const Rococo(); + case 6: + return const Wococo(); + case 7: + return Ethereum._decode(input); + case 8: + return const BitcoinCore(); + case 9: + return const BitcoinCash(); + case 10: + return const PolkadotBulletin(); + default: + throw Exception('NetworkId: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + NetworkId value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case ByGenesis: + (value as ByGenesis).encodeTo(output); + break; + case ByFork: + (value as ByFork).encodeTo(output); + break; + case Polkadot: + (value as Polkadot).encodeTo(output); + break; + case Kusama: + (value as Kusama).encodeTo(output); + break; + case Westend: + (value as Westend).encodeTo(output); + break; + case Rococo: + (value as Rococo).encodeTo(output); + break; + case Wococo: + (value as Wococo).encodeTo(output); + break; + case Ethereum: + (value as Ethereum).encodeTo(output); + break; + case BitcoinCore: + (value as BitcoinCore).encodeTo(output); + break; + case BitcoinCash: + (value as BitcoinCash).encodeTo(output); + break; + case PolkadotBulletin: + (value as PolkadotBulletin).encodeTo(output); + break; + default: + throw Exception('NetworkId: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(NetworkId value) { + switch (value.runtimeType) { + case ByGenesis: + return (value as ByGenesis)._sizeHint(); + case ByFork: + return (value as ByFork)._sizeHint(); + case Polkadot: + return 1; + case Kusama: + return 1; + case Westend: + return 1; + case Rococo: + return 1; + case Wococo: + return 1; + case Ethereum: + return (value as Ethereum)._sizeHint(); + case BitcoinCore: + return 1; + case BitcoinCash: + return 1; + case PolkadotBulletin: + return 1; + default: + throw Exception('NetworkId: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class ByGenesis extends NetworkId { + const ByGenesis(this.value0); + + factory ByGenesis._decode(_i1.Input input) { + return ByGenesis(const _i1.U8ArrayCodec(32).decode(input)); + } + + /// [u8; 32] + final List value0; + + @override + Map> toJson() => {'ByGenesis': value0.toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.U8ArrayCodec(32).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ByGenesis && + _i3.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ByFork extends NetworkId { + const ByFork({ + required this.blockNumber, + required this.blockHash, + }); + + factory ByFork._decode(_i1.Input input) { + return ByFork( + blockNumber: _i1.U64Codec.codec.decode(input), + blockHash: const _i1.U8ArrayCodec(32).decode(input), + ); + } + + /// u64 + final BigInt blockNumber; + + /// [u8; 32] + final List blockHash; + + @override + Map> toJson() => { + 'ByFork': { + 'blockNumber': blockNumber, + 'blockHash': blockHash.toList(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U64Codec.codec.sizeHint(blockNumber); + size = size + const _i1.U8ArrayCodec(32).sizeHint(blockHash); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i1.U64Codec.codec.encodeTo( + blockNumber, + output, + ); + const _i1.U8ArrayCodec(32).encodeTo( + blockHash, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ByFork && + other.blockNumber == blockNumber && + _i3.listsEqual( + other.blockHash, + blockHash, + ); + + @override + int get hashCode => Object.hash( + blockNumber, + blockHash, + ); +} + +class Polkadot extends NetworkId { + const Polkadot(); + + @override + Map toJson() => {'Polkadot': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + } + + @override + bool operator ==(Object other) => other is Polkadot; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Kusama extends NetworkId { + const Kusama(); + + @override + Map toJson() => {'Kusama': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + } + + @override + bool operator ==(Object other) => other is Kusama; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Westend extends NetworkId { + const Westend(); + + @override + Map toJson() => {'Westend': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + } + + @override + bool operator ==(Object other) => other is Westend; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Rococo extends NetworkId { + const Rococo(); + + @override + Map toJson() => {'Rococo': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + } + + @override + bool operator ==(Object other) => other is Rococo; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Wococo extends NetworkId { + const Wococo(); + + @override + Map toJson() => {'Wococo': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + } + + @override + bool operator ==(Object other) => other is Wococo; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Ethereum extends NetworkId { + const Ethereum({required this.chainId}); + + factory Ethereum._decode(_i1.Input input) { + return Ethereum(chainId: _i1.CompactBigIntCodec.codec.decode(input)); + } + + /// u64 + final BigInt chainId; + + @override + Map> toJson() => { + 'Ethereum': {'chainId': chainId} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(chainId); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + chainId, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Ethereum && other.chainId == chainId; + + @override + int get hashCode => chainId.hashCode; +} + +class BitcoinCore extends NetworkId { + const BitcoinCore(); + + @override + Map toJson() => {'BitcoinCore': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 8, + output, + ); + } + + @override + bool operator ==(Object other) => other is BitcoinCore; + + @override + int get hashCode => runtimeType.hashCode; +} + +class BitcoinCash extends NetworkId { + const BitcoinCash(); + + @override + Map toJson() => {'BitcoinCash': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 9, + output, + ); + } + + @override + bool operator ==(Object other) => other is BitcoinCash; + + @override + int get hashCode => runtimeType.hashCode; +} + +class PolkadotBulletin extends NetworkId { + const PolkadotBulletin(); + + @override + Map toJson() => {'PolkadotBulletin': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 10, + output, + ); + } + + @override + bool operator ==(Object other) => other is PolkadotBulletin; + + @override + int get hashCode => runtimeType.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junctions/junctions.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junctions/junctions.dart new file mode 100644 index 000000000..0ff9f4992 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/junctions/junctions.dart @@ -0,0 +1,634 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i4; + +import '../junction/junction.dart' as _i3; + +abstract class Junctions { + const Junctions(); + + factory Junctions.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $JunctionsCodec codec = $JunctionsCodec(); + + static const $Junctions values = $Junctions(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $Junctions { + const $Junctions(); + + Here here() { + return Here(); + } + + X1 x1(List<_i3.Junction> value0) { + return X1(value0); + } + + X2 x2(List<_i3.Junction> value0) { + return X2(value0); + } + + X3 x3(List<_i3.Junction> value0) { + return X3(value0); + } + + X4 x4(List<_i3.Junction> value0) { + return X4(value0); + } + + X5 x5(List<_i3.Junction> value0) { + return X5(value0); + } + + X6 x6(List<_i3.Junction> value0) { + return X6(value0); + } + + X7 x7(List<_i3.Junction> value0) { + return X7(value0); + } + + X8 x8(List<_i3.Junction> value0) { + return X8(value0); + } +} + +class $JunctionsCodec with _i1.Codec { + const $JunctionsCodec(); + + @override + Junctions decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return const Here(); + case 1: + return X1._decode(input); + case 2: + return X2._decode(input); + case 3: + return X3._decode(input); + case 4: + return X4._decode(input); + case 5: + return X5._decode(input); + case 6: + return X6._decode(input); + case 7: + return X7._decode(input); + case 8: + return X8._decode(input); + default: + throw Exception('Junctions: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Junctions value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Here: + (value as Here).encodeTo(output); + break; + case X1: + (value as X1).encodeTo(output); + break; + case X2: + (value as X2).encodeTo(output); + break; + case X3: + (value as X3).encodeTo(output); + break; + case X4: + (value as X4).encodeTo(output); + break; + case X5: + (value as X5).encodeTo(output); + break; + case X6: + (value as X6).encodeTo(output); + break; + case X7: + (value as X7).encodeTo(output); + break; + case X8: + (value as X8).encodeTo(output); + break; + default: + throw Exception('Junctions: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Junctions value) { + switch (value.runtimeType) { + case Here: + return 1; + case X1: + return (value as X1)._sizeHint(); + case X2: + return (value as X2)._sizeHint(); + case X3: + return (value as X3)._sizeHint(); + case X4: + return (value as X4)._sizeHint(); + case X5: + return (value as X5)._sizeHint(); + case X6: + return (value as X6)._sizeHint(); + case X7: + return (value as X7)._sizeHint(); + case X8: + return (value as X8)._sizeHint(); + default: + throw Exception('Junctions: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Here extends Junctions { + const Here(); + + @override + Map toJson() => {'Here': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is Here; + + @override + int get hashCode => runtimeType.hashCode; +} + +class X1 extends Junctions { + const X1(this.value0); + + factory X1._decode(_i1.Input input) { + return X1(const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 1, + ).decode(input)); + } + + /// Arc<[Junction; 1]> + final List<_i3.Junction> value0; + + @override + Map>> toJson() => {'X1': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 1, + ).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 1, + ).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is X1 && + _i4.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class X2 extends Junctions { + const X2(this.value0); + + factory X2._decode(_i1.Input input) { + return X2(const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 2, + ).decode(input)); + } + + /// Arc<[Junction; 2]> + final List<_i3.Junction> value0; + + @override + Map>> toJson() => {'X2': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 2, + ).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 2, + ).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is X2 && + _i4.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class X3 extends Junctions { + const X3(this.value0); + + factory X3._decode(_i1.Input input) { + return X3(const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 3, + ).decode(input)); + } + + /// Arc<[Junction; 3]> + final List<_i3.Junction> value0; + + @override + Map>> toJson() => {'X3': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 3, + ).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 3, + ).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is X3 && + _i4.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class X4 extends Junctions { + const X4(this.value0); + + factory X4._decode(_i1.Input input) { + return X4(const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 4, + ).decode(input)); + } + + /// Arc<[Junction; 4]> + final List<_i3.Junction> value0; + + @override + Map>> toJson() => {'X4': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 4, + ).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 4, + ).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is X4 && + _i4.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class X5 extends Junctions { + const X5(this.value0); + + factory X5._decode(_i1.Input input) { + return X5(const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 5, + ).decode(input)); + } + + /// Arc<[Junction; 5]> + final List<_i3.Junction> value0; + + @override + Map>> toJson() => {'X5': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 5, + ).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 5, + ).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is X5 && + _i4.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class X6 extends Junctions { + const X6(this.value0); + + factory X6._decode(_i1.Input input) { + return X6(const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 6, + ).decode(input)); + } + + /// Arc<[Junction; 6]> + final List<_i3.Junction> value0; + + @override + Map>> toJson() => {'X6': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 6, + ).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 6, + output, + ); + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 6, + ).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is X6 && + _i4.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class X7 extends Junctions { + const X7(this.value0); + + factory X7._decode(_i1.Input input) { + return X7(const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 7, + ).decode(input)); + } + + /// Arc<[Junction; 7]> + final List<_i3.Junction> value0; + + @override + Map>> toJson() => {'X7': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 7, + ).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 7, + output, + ); + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 7, + ).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is X7 && + _i4.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class X8 extends Junctions { + const X8(this.value0); + + factory X8._decode(_i1.Input input) { + return X8(const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 8, + ).decode(input)); + } + + /// Arc<[Junction; 8]> + final List<_i3.Junction> value0; + + @override + Map>> toJson() => {'X8': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 8, + ).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 8, + output, + ); + const _i1.ArrayCodec<_i3.Junction>( + _i3.Junction.codec, + 8, + ).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is X8 && + _i4.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/location/location.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/location/location.dart new file mode 100644 index 000000000..5a31a7b5b --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/location/location.dart @@ -0,0 +1,83 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i3; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../junctions/junctions.dart' as _i2; + +class Location { + const Location({ + required this.parents, + required this.interior, + }); + + factory Location.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u8 + final int parents; + + /// Junctions + final _i2.Junctions interior; + + static const $LocationCodec codec = $LocationCodec(); + + _i3.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'parents': parents, + 'interior': interior.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Location && other.parents == parents && other.interior == interior; + + @override + int get hashCode => Object.hash( + parents, + interior, + ); +} + +class $LocationCodec with _i1.Codec { + const $LocationCodec(); + + @override + void encodeTo( + Location obj, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + obj.parents, + output, + ); + _i2.Junctions.codec.encodeTo( + obj.interior, + output, + ); + } + + @override + Location decode(_i1.Input input) { + return Location( + parents: _i1.U8Codec.codec.decode(input), + interior: _i2.Junctions.codec.decode(input), + ); + } + + @override + int sizeHint(Location obj) { + int size = 0; + size = size + _i1.U8Codec.codec.sizeHint(obj.parents); + size = size + _i2.Junctions.codec.sizeHint(obj.interior); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/pallet_info.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/pallet_info.dart new file mode 100644 index 000000000..b8dcf927e --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/pallet_info.dart @@ -0,0 +1,142 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i3; + +class PalletInfo { + const PalletInfo({ + required this.index, + required this.name, + required this.moduleName, + required this.major, + required this.minor, + required this.patch, + }); + + factory PalletInfo.decode(_i1.Input input) { + return codec.decode(input); + } + + /// u32 + final BigInt index; + + /// BoundedVec + final List name; + + /// BoundedVec + final List moduleName; + + /// u32 + final BigInt major; + + /// u32 + final BigInt minor; + + /// u32 + final BigInt patch; + + static const $PalletInfoCodec codec = $PalletInfoCodec(); + + _i2.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'index': index, + 'name': name, + 'moduleName': moduleName, + 'major': major, + 'minor': minor, + 'patch': patch, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is PalletInfo && + other.index == index && + _i3.listsEqual( + other.name, + name, + ) && + _i3.listsEqual( + other.moduleName, + moduleName, + ) && + other.major == major && + other.minor == minor && + other.patch == patch; + + @override + int get hashCode => Object.hash( + index, + name, + moduleName, + major, + minor, + patch, + ); +} + +class $PalletInfoCodec with _i1.Codec { + const $PalletInfoCodec(); + + @override + void encodeTo( + PalletInfo obj, + _i1.Output output, + ) { + _i1.CompactBigIntCodec.codec.encodeTo( + obj.index, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + obj.name, + output, + ); + _i1.U8SequenceCodec.codec.encodeTo( + obj.moduleName, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + obj.major, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + obj.minor, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + obj.patch, + output, + ); + } + + @override + PalletInfo decode(_i1.Input input) { + return PalletInfo( + index: _i1.CompactBigIntCodec.codec.decode(input), + name: _i1.U8SequenceCodec.codec.decode(input), + moduleName: _i1.U8SequenceCodec.codec.decode(input), + major: _i1.CompactBigIntCodec.codec.decode(input), + minor: _i1.CompactBigIntCodec.codec.decode(input), + patch: _i1.CompactBigIntCodec.codec.decode(input), + ); + } + + @override + int sizeHint(PalletInfo obj) { + int size = 0; + size = size + _i1.CompactBigIntCodec.codec.sizeHint(obj.index); + size = size + _i1.U8SequenceCodec.codec.sizeHint(obj.name); + size = size + _i1.U8SequenceCodec.codec.sizeHint(obj.moduleName); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(obj.major); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(obj.minor); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(obj.patch); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/query_response_info.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/query_response_info.dart new file mode 100644 index 000000000..6d1485a84 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/query_response_info.dart @@ -0,0 +1,99 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../../sp_weights/weight_v2/weight.dart' as _i3; +import 'location/location.dart' as _i2; + +class QueryResponseInfo { + const QueryResponseInfo({ + required this.destination, + required this.queryId, + required this.maxWeight, + }); + + factory QueryResponseInfo.decode(_i1.Input input) { + return codec.decode(input); + } + + /// Location + final _i2.Location destination; + + /// QueryId + final BigInt queryId; + + /// Weight + final _i3.Weight maxWeight; + + static const $QueryResponseInfoCodec codec = $QueryResponseInfoCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'destination': destination.toJson(), + 'queryId': queryId, + 'maxWeight': maxWeight.toJson(), + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is QueryResponseInfo && + other.destination == destination && + other.queryId == queryId && + other.maxWeight == maxWeight; + + @override + int get hashCode => Object.hash( + destination, + queryId, + maxWeight, + ); +} + +class $QueryResponseInfoCodec with _i1.Codec { + const $QueryResponseInfoCodec(); + + @override + void encodeTo( + QueryResponseInfo obj, + _i1.Output output, + ) { + _i2.Location.codec.encodeTo( + obj.destination, + output, + ); + _i1.CompactBigIntCodec.codec.encodeTo( + obj.queryId, + output, + ); + _i3.Weight.codec.encodeTo( + obj.maxWeight, + output, + ); + } + + @override + QueryResponseInfo decode(_i1.Input input) { + return QueryResponseInfo( + destination: _i2.Location.codec.decode(input), + queryId: _i1.CompactBigIntCodec.codec.decode(input), + maxWeight: _i3.Weight.codec.decode(input), + ); + } + + @override + int sizeHint(QueryResponseInfo obj) { + int size = 0; + size = size + _i2.Location.codec.sizeHint(obj.destination); + size = size + _i1.CompactBigIntCodec.codec.sizeHint(obj.queryId); + size = size + _i3.Weight.codec.sizeHint(obj.maxWeight); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/response.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/response.dart new file mode 100644 index 000000000..f0c8c09ae --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/response.dart @@ -0,0 +1,392 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i9; + +import '../../tuples_1.dart' as _i4; +import '../../xcm/v3/maybe_error_code.dart' as _i7; +import '../../xcm/v3/traits/error.dart' as _i5; +import 'asset/asset.dart' as _i8; +import 'asset/assets.dart' as _i3; +import 'pallet_info.dart' as _i6; + +abstract class Response { + const Response(); + + factory Response.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $ResponseCodec codec = $ResponseCodec(); + + static const $Response values = $Response(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map toJson(); +} + +class $Response { + const $Response(); + + Null null_() { + return Null(); + } + + Assets assets(_i3.Assets value0) { + return Assets(value0); + } + + ExecutionResult executionResult(_i4.Tuple2? value0) { + return ExecutionResult(value0); + } + + Version version(int value0) { + return Version(value0); + } + + PalletsInfo palletsInfo(List<_i6.PalletInfo> value0) { + return PalletsInfo(value0); + } + + DispatchResult dispatchResult(_i7.MaybeErrorCode value0) { + return DispatchResult(value0); + } +} + +class $ResponseCodec with _i1.Codec { + const $ResponseCodec(); + + @override + Response decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return const Null(); + case 1: + return Assets._decode(input); + case 2: + return ExecutionResult._decode(input); + case 3: + return Version._decode(input); + case 4: + return PalletsInfo._decode(input); + case 5: + return DispatchResult._decode(input); + default: + throw Exception('Response: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Response value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Null: + (value as Null).encodeTo(output); + break; + case Assets: + (value as Assets).encodeTo(output); + break; + case ExecutionResult: + (value as ExecutionResult).encodeTo(output); + break; + case Version: + (value as Version).encodeTo(output); + break; + case PalletsInfo: + (value as PalletsInfo).encodeTo(output); + break; + case DispatchResult: + (value as DispatchResult).encodeTo(output); + break; + default: + throw Exception('Response: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Response value) { + switch (value.runtimeType) { + case Null: + return 1; + case Assets: + return (value as Assets)._sizeHint(); + case ExecutionResult: + return (value as ExecutionResult)._sizeHint(); + case Version: + return (value as Version)._sizeHint(); + case PalletsInfo: + return (value as PalletsInfo)._sizeHint(); + case DispatchResult: + return (value as DispatchResult)._sizeHint(); + default: + throw Exception('Response: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Null extends Response { + const Null(); + + @override + Map toJson() => {'Null': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + } + + @override + bool operator ==(Object other) => other is Null; + + @override + int get hashCode => runtimeType.hashCode; +} + +class Assets extends Response { + const Assets(this.value0); + + factory Assets._decode(_i1.Input input) { + return Assets(const _i1.SequenceCodec<_i8.Asset>(_i8.Asset.codec).decode(input)); + } + + /// Assets + final _i3.Assets value0; + + @override + Map>>> toJson() => + {'Assets': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + const _i1.SequenceCodec<_i8.Asset>(_i8.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Assets && + _i9.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class ExecutionResult extends Response { + const ExecutionResult(this.value0); + + factory ExecutionResult._decode(_i1.Input input) { + return ExecutionResult(const _i1.OptionCodec<_i4.Tuple2>(_i4.Tuple2Codec( + _i1.U32Codec.codec, + _i5.Error.codec, + )).decode(input)); + } + + /// Option<(u32, Error)> + final _i4.Tuple2? value0; + + @override + Map?> toJson() => { + 'ExecutionResult': [ + value0?.value0, + value0?.value1.toJson(), + ] + }; + + int _sizeHint() { + int size = 1; + size = size + + const _i1.OptionCodec<_i4.Tuple2>(_i4.Tuple2Codec( + _i1.U32Codec.codec, + _i5.Error.codec, + )).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + const _i1.OptionCodec<_i4.Tuple2>(_i4.Tuple2Codec( + _i1.U32Codec.codec, + _i5.Error.codec, + )).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ExecutionResult && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class Version extends Response { + const Version(this.value0); + + factory Version._decode(_i1.Input input) { + return Version(_i1.U32Codec.codec.decode(input)); + } + + /// super::Version + final int value0; + + @override + Map toJson() => {'Version': value0}; + + int _sizeHint() { + int size = 1; + size = size + _i1.U32Codec.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + _i1.U32Codec.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Version && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class PalletsInfo extends Response { + const PalletsInfo(this.value0); + + factory PalletsInfo._decode(_i1.Input input) { + return PalletsInfo(const _i1.SequenceCodec<_i6.PalletInfo>(_i6.PalletInfo.codec).decode(input)); + } + + /// BoundedVec + final List<_i6.PalletInfo> value0; + + @override + Map>> toJson() => {'PalletsInfo': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i1.SequenceCodec<_i6.PalletInfo>(_i6.PalletInfo.codec).sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + const _i1.SequenceCodec<_i6.PalletInfo>(_i6.PalletInfo.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is PalletsInfo && + _i9.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class DispatchResult extends Response { + const DispatchResult(this.value0); + + factory DispatchResult._decode(_i1.Input input) { + return DispatchResult(_i7.MaybeErrorCode.codec.decode(input)); + } + + /// MaybeErrorCode + final _i7.MaybeErrorCode value0; + + @override + Map> toJson() => {'DispatchResult': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i7.MaybeErrorCode.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 5, + output, + ); + _i7.MaybeErrorCode.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is DispatchResult && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/traits/outcome.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/traits/outcome.dart new file mode 100644 index 000000000..d73b9b948 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/traits/outcome.dart @@ -0,0 +1,258 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../../../sp_weights/weight_v2/weight.dart' as _i3; +import '../../../xcm/v3/traits/error.dart' as _i4; + +abstract class Outcome { + const Outcome(); + + factory Outcome.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $OutcomeCodec codec = $OutcomeCodec(); + + static const $Outcome values = $Outcome(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map>> toJson(); +} + +class $Outcome { + const $Outcome(); + + Complete complete({required _i3.Weight used}) { + return Complete(used: used); + } + + Incomplete incomplete({ + required _i3.Weight used, + required _i4.Error error, + }) { + return Incomplete( + used: used, + error: error, + ); + } + + Error error({required _i4.Error error}) { + return Error(error: error); + } +} + +class $OutcomeCodec with _i1.Codec { + const $OutcomeCodec(); + + @override + Outcome decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return Complete._decode(input); + case 1: + return Incomplete._decode(input); + case 2: + return Error._decode(input); + default: + throw Exception('Outcome: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + Outcome value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case Complete: + (value as Complete).encodeTo(output); + break; + case Incomplete: + (value as Incomplete).encodeTo(output); + break; + case Error: + (value as Error).encodeTo(output); + break; + default: + throw Exception('Outcome: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(Outcome value) { + switch (value.runtimeType) { + case Complete: + return (value as Complete)._sizeHint(); + case Incomplete: + return (value as Incomplete)._sizeHint(); + case Error: + return (value as Error)._sizeHint(); + default: + throw Exception('Outcome: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class Complete extends Outcome { + const Complete({required this.used}); + + factory Complete._decode(_i1.Input input) { + return Complete(used: _i3.Weight.codec.decode(input)); + } + + /// Weight + final _i3.Weight used; + + @override + Map>> toJson() => { + 'Complete': {'used': used.toJson()} + }; + + int _sizeHint() { + int size = 1; + size = size + _i3.Weight.codec.sizeHint(used); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 0, + output, + ); + _i3.Weight.codec.encodeTo( + used, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Complete && other.used == used; + + @override + int get hashCode => used.hashCode; +} + +class Incomplete extends Outcome { + const Incomplete({ + required this.used, + required this.error, + }); + + factory Incomplete._decode(_i1.Input input) { + return Incomplete( + used: _i3.Weight.codec.decode(input), + error: _i4.Error.codec.decode(input), + ); + } + + /// Weight + final _i3.Weight used; + + /// Error + final _i4.Error error; + + @override + Map>> toJson() => { + 'Incomplete': { + 'used': used.toJson(), + 'error': error.toJson(), + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i3.Weight.codec.sizeHint(used); + size = size + _i4.Error.codec.sizeHint(error); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i3.Weight.codec.encodeTo( + used, + output, + ); + _i4.Error.codec.encodeTo( + error, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Incomplete && other.used == used && other.error == error; + + @override + int get hashCode => Object.hash( + used, + error, + ); +} + +class Error extends Outcome { + const Error({required this.error}); + + factory Error._decode(_i1.Input input) { + return Error(error: _i4.Error.codec.decode(input)); + } + + /// Error + final _i4.Error error; + + @override + Map>> toJson() => { + 'Error': {'error': error.toJson()} + }; + + int _sizeHint() { + int size = 1; + size = size + _i4.Error.codec.sizeHint(error); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 2, + output, + ); + _i4.Error.codec.encodeTo( + error, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is Error && other.error == error; + + @override + int get hashCode => error.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/xcm_1.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/xcm_1.dart new file mode 100644 index 000000000..31ff8c238 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/xcm_1.dart @@ -0,0 +1,31 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i2; + +import 'instruction_1.dart' as _i1; + +typedef Xcm = List<_i1.Instruction>; + +class XcmCodec with _i2.Codec { + const XcmCodec(); + + @override + Xcm decode(_i2.Input input) { + return const _i2.SequenceCodec<_i1.Instruction>(_i1.Instruction.codec).decode(input); + } + + @override + void encodeTo( + Xcm value, + _i2.Output output, + ) { + const _i2.SequenceCodec<_i1.Instruction>(_i1.Instruction.codec).encodeTo( + value, + output, + ); + } + + @override + int sizeHint(Xcm value) { + return const _i2.SequenceCodec<_i1.Instruction>(_i1.Instruction.codec).sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/xcm_2.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/xcm_2.dart new file mode 100644 index 000000000..8c682f3b3 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/staging_xcm/v4/xcm_2.dart @@ -0,0 +1,31 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i2; + +import 'instruction_2.dart' as _i1; + +typedef Xcm = List<_i1.Instruction>; + +class XcmCodec with _i2.Codec { + const XcmCodec(); + + @override + Xcm decode(_i2.Input input) { + return const _i2.SequenceCodec<_i1.Instruction>(_i1.Instruction.codec).decode(input); + } + + @override + void encodeTo( + Xcm value, + _i2.Output output, + ) { + const _i2.SequenceCodec<_i1.Instruction>(_i1.Instruction.codec).encodeTo( + value, + output, + ); + } + + @override + int sizeHint(Xcm value) { + return const _i2.SequenceCodec<_i1.Instruction>(_i1.Instruction.codec).sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_geohash/geo_hash.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_geohash/geo_hash.dart new file mode 100644 index 000000000..547a2ad6c --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_geohash/geo_hash.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef GeoHash = List; + +class GeoHashCodec with _i1.Codec { + const GeoHashCodec(); + + @override + GeoHash decode(_i1.Input input) { + return const _i1.U8ArrayCodec(5).decode(input); + } + + @override + void encodeTo( + GeoHash value, + _i1.Output output, + ) { + const _i1.U8ArrayCodec(5).encodeTo( + value, + output, + ); + } + + @override + int sizeHint(GeoHash value) { + return const _i1.U8ArrayCodec(5).sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/bit/b0.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/bit/b0.dart new file mode 100644 index 000000000..f8ef24cef --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/bit/b0.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef B0 = dynamic; + +class B0Codec with _i1.Codec { + const B0Codec(); + + @override + B0 decode(_i1.Input input) { + return _i1.NullCodec.codec.decode(input); + } + + @override + void encodeTo( + B0 value, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(B0 value) { + return _i1.NullCodec.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/bit/b1.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/bit/b1.dart new file mode 100644 index 000000000..95d8346da --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/bit/b1.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef B1 = dynamic; + +class B1Codec with _i1.Codec { + const B1Codec(); + + @override + B1 decode(_i1.Input input) { + return _i1.NullCodec.codec.decode(input); + } + + @override + void encodeTo( + B1 value, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(B1 value) { + return _i1.NullCodec.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_1.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_1.dart new file mode 100644 index 000000000..75738a3b0 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_1.dart @@ -0,0 +1,84 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../bit/b0.dart' as _i3; +import 'u_int_2.dart' as _i2; + +class UInt { + const UInt({ + required this.msb, + required this.lsb, + }); + + factory UInt.decode(_i1.Input input) { + return codec.decode(input); + } + + /// U + final _i2.UInt msb; + + /// B + final _i3.B0 lsb; + + static const $UIntCodec codec = $UIntCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'msb': msb.toJson(), + 'lsb': null, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UInt && other.msb == msb && other.lsb == lsb; + + @override + int get hashCode => Object.hash( + msb, + lsb, + ); +} + +class $UIntCodec with _i1.Codec { + const $UIntCodec(); + + @override + void encodeTo( + UInt obj, + _i1.Output output, + ) { + _i2.UInt.codec.encodeTo( + obj.msb, + output, + ); + _i1.NullCodec.codec.encodeTo( + obj.lsb, + output, + ); + } + + @override + UInt decode(_i1.Input input) { + return UInt( + msb: _i2.UInt.codec.decode(input), + lsb: _i1.NullCodec.codec.decode(input), + ); + } + + @override + int sizeHint(UInt obj) { + int size = 0; + size = size + _i2.UInt.codec.sizeHint(obj.msb); + size = size + const _i3.B0Codec().sizeHint(obj.lsb); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_2.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_2.dart new file mode 100644 index 000000000..dd23a1afb --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_2.dart @@ -0,0 +1,84 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../bit/b0.dart' as _i3; +import 'u_int_3.dart' as _i2; + +class UInt { + const UInt({ + required this.msb, + required this.lsb, + }); + + factory UInt.decode(_i1.Input input) { + return codec.decode(input); + } + + /// U + final _i2.UInt msb; + + /// B + final _i3.B0 lsb; + + static const $UIntCodec codec = $UIntCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'msb': msb.toJson(), + 'lsb': null, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UInt && other.msb == msb && other.lsb == lsb; + + @override + int get hashCode => Object.hash( + msb, + lsb, + ); +} + +class $UIntCodec with _i1.Codec { + const $UIntCodec(); + + @override + void encodeTo( + UInt obj, + _i1.Output output, + ) { + _i2.UInt.codec.encodeTo( + obj.msb, + output, + ); + _i1.NullCodec.codec.encodeTo( + obj.lsb, + output, + ); + } + + @override + UInt decode(_i1.Input input) { + return UInt( + msb: _i2.UInt.codec.decode(input), + lsb: _i1.NullCodec.codec.decode(input), + ); + } + + @override + int sizeHint(UInt obj) { + int size = 0; + size = size + _i2.UInt.codec.sizeHint(obj.msb); + size = size + const _i3.B0Codec().sizeHint(obj.lsb); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_3.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_3.dart new file mode 100644 index 000000000..28a7c5fc4 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_3.dart @@ -0,0 +1,84 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../bit/b0.dart' as _i3; +import 'u_int_4.dart' as _i2; + +class UInt { + const UInt({ + required this.msb, + required this.lsb, + }); + + factory UInt.decode(_i1.Input input) { + return codec.decode(input); + } + + /// U + final _i2.UInt msb; + + /// B + final _i3.B0 lsb; + + static const $UIntCodec codec = $UIntCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'msb': msb.toJson(), + 'lsb': null, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UInt && other.msb == msb && other.lsb == lsb; + + @override + int get hashCode => Object.hash( + msb, + lsb, + ); +} + +class $UIntCodec with _i1.Codec { + const $UIntCodec(); + + @override + void encodeTo( + UInt obj, + _i1.Output output, + ) { + _i2.UInt.codec.encodeTo( + obj.msb, + output, + ); + _i1.NullCodec.codec.encodeTo( + obj.lsb, + output, + ); + } + + @override + UInt decode(_i1.Input input) { + return UInt( + msb: _i2.UInt.codec.decode(input), + lsb: _i1.NullCodec.codec.decode(input), + ); + } + + @override + int sizeHint(UInt obj) { + int size = 0; + size = size + _i2.UInt.codec.sizeHint(obj.msb); + size = size + const _i3.B0Codec().sizeHint(obj.lsb); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_4.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_4.dart new file mode 100644 index 000000000..3a91a0cf2 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_4.dart @@ -0,0 +1,84 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../bit/b0.dart' as _i3; +import 'u_int_5.dart' as _i2; + +class UInt { + const UInt({ + required this.msb, + required this.lsb, + }); + + factory UInt.decode(_i1.Input input) { + return codec.decode(input); + } + + /// U + final _i2.UInt msb; + + /// B + final _i3.B0 lsb; + + static const $UIntCodec codec = $UIntCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'msb': msb.toJson(), + 'lsb': null, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UInt && other.msb == msb && other.lsb == lsb; + + @override + int get hashCode => Object.hash( + msb, + lsb, + ); +} + +class $UIntCodec with _i1.Codec { + const $UIntCodec(); + + @override + void encodeTo( + UInt obj, + _i1.Output output, + ) { + _i2.UInt.codec.encodeTo( + obj.msb, + output, + ); + _i1.NullCodec.codec.encodeTo( + obj.lsb, + output, + ); + } + + @override + UInt decode(_i1.Input input) { + return UInt( + msb: _i2.UInt.codec.decode(input), + lsb: _i1.NullCodec.codec.decode(input), + ); + } + + @override + int sizeHint(UInt obj) { + int size = 0; + size = size + _i2.UInt.codec.sizeHint(obj.msb); + size = size + const _i3.B0Codec().sizeHint(obj.lsb); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_5.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_5.dart new file mode 100644 index 000000000..8d1447211 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_5.dart @@ -0,0 +1,84 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../bit/b0.dart' as _i3; +import 'u_int_6.dart' as _i2; + +class UInt { + const UInt({ + required this.msb, + required this.lsb, + }); + + factory UInt.decode(_i1.Input input) { + return codec.decode(input); + } + + /// U + final _i2.UInt msb; + + /// B + final _i3.B0 lsb; + + static const $UIntCodec codec = $UIntCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'msb': msb.toJson(), + 'lsb': null, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UInt && other.msb == msb && other.lsb == lsb; + + @override + int get hashCode => Object.hash( + msb, + lsb, + ); +} + +class $UIntCodec with _i1.Codec { + const $UIntCodec(); + + @override + void encodeTo( + UInt obj, + _i1.Output output, + ) { + _i2.UInt.codec.encodeTo( + obj.msb, + output, + ); + _i1.NullCodec.codec.encodeTo( + obj.lsb, + output, + ); + } + + @override + UInt decode(_i1.Input input) { + return UInt( + msb: _i2.UInt.codec.decode(input), + lsb: _i1.NullCodec.codec.decode(input), + ); + } + + @override + int sizeHint(UInt obj) { + int size = 0; + size = size + _i2.UInt.codec.sizeHint(obj.msb); + size = size + const _i3.B0Codec().sizeHint(obj.lsb); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_6.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_6.dart new file mode 100644 index 000000000..55c2b47fa --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_6.dart @@ -0,0 +1,84 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../bit/b0.dart' as _i3; +import 'u_int_7.dart' as _i2; + +class UInt { + const UInt({ + required this.msb, + required this.lsb, + }); + + factory UInt.decode(_i1.Input input) { + return codec.decode(input); + } + + /// U + final _i2.UInt msb; + + /// B + final _i3.B0 lsb; + + static const $UIntCodec codec = $UIntCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'msb': msb.toJson(), + 'lsb': null, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UInt && other.msb == msb && other.lsb == lsb; + + @override + int get hashCode => Object.hash( + msb, + lsb, + ); +} + +class $UIntCodec with _i1.Codec { + const $UIntCodec(); + + @override + void encodeTo( + UInt obj, + _i1.Output output, + ) { + _i2.UInt.codec.encodeTo( + obj.msb, + output, + ); + _i1.NullCodec.codec.encodeTo( + obj.lsb, + output, + ); + } + + @override + UInt decode(_i1.Input input) { + return UInt( + msb: _i2.UInt.codec.decode(input), + lsb: _i1.NullCodec.codec.decode(input), + ); + } + + @override + int sizeHint(UInt obj) { + int size = 0; + size = size + _i2.UInt.codec.sizeHint(obj.msb); + size = size + const _i3.B0Codec().sizeHint(obj.lsb); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_7.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_7.dart new file mode 100644 index 000000000..78ddf6d74 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_int_7.dart @@ -0,0 +1,84 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i4; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../bit/b1.dart' as _i3; +import 'u_term.dart' as _i2; + +class UInt { + const UInt({ + required this.msb, + required this.lsb, + }); + + factory UInt.decode(_i1.Input input) { + return codec.decode(input); + } + + /// U + final _i2.UTerm msb; + + /// B + final _i3.B1 lsb; + + static const $UIntCodec codec = $UIntCodec(); + + _i4.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'msb': null, + 'lsb': null, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is UInt && other.msb == msb && other.lsb == lsb; + + @override + int get hashCode => Object.hash( + msb, + lsb, + ); +} + +class $UIntCodec with _i1.Codec { + const $UIntCodec(); + + @override + void encodeTo( + UInt obj, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + obj.msb, + output, + ); + _i1.NullCodec.codec.encodeTo( + obj.lsb, + output, + ); + } + + @override + UInt decode(_i1.Input input) { + return UInt( + msb: _i1.NullCodec.codec.decode(input), + lsb: _i1.NullCodec.codec.decode(input), + ); + } + + @override + int sizeHint(UInt obj) { + int size = 0; + size = size + const _i2.UTermCodec().sizeHint(obj.msb); + size = size + const _i3.B1Codec().sizeHint(obj.lsb); + return size; + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_term.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_term.dart new file mode 100644 index 000000000..9074f7cd5 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/substrate_typenum/uint/u_term.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef UTerm = dynamic; + +class UTermCodec with _i1.Codec { + const UTermCodec(); + + @override + UTerm decode(_i1.Input input) { + return _i1.NullCodec.codec.decode(input); + } + + @override + void encodeTo( + UTerm value, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(UTerm value) { + return _i1.NullCodec.codec.sizeHint(value); + } +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/instruction_1.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/instruction_1.dart index 69e2e3590..9892def29 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/instruction_1.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/instruction_1.dart @@ -5,6 +5,7 @@ import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i20; import '../../sp_weights/weight_v2/weight.dart' as _i5; +import '../../staging_xcm/v3/multilocation/multi_location.dart' as _i6; import '../../tuples_1.dart' as _i15; import '../double_encoded/double_encoded_1.dart' as _i9; import '../v2/origin_kind.dart' as _i8; @@ -16,7 +17,6 @@ import 'maybe_error_code.dart' as _i17; import 'multiasset/multi_asset.dart' as _i13; import 'multiasset/multi_asset_filter.dart' as _i12; import 'multiasset/multi_assets.dart' as _i3; -import 'multilocation/multi_location.dart' as _i6; import 'query_response_info.dart' as _i11; import 'response.dart' as _i4; import 'traits/error.dart' as _i16; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/instruction_2.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/instruction_2.dart index 7b323adfa..f1759c912 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/instruction_2.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/instruction_2.dart @@ -5,6 +5,7 @@ import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i21; import '../../sp_weights/weight_v2/weight.dart' as _i5; +import '../../staging_xcm/v3/multilocation/multi_location.dart' as _i6; import '../../tuples_1.dart' as _i16; import '../double_encoded/double_encoded_2.dart' as _i9; import '../v2/origin_kind.dart' as _i8; @@ -17,7 +18,6 @@ import 'maybe_error_code.dart' as _i18; import 'multiasset/multi_asset.dart' as _i13; import 'multiasset/multi_asset_filter.dart' as _i12; import 'multiasset/multi_assets.dart' as _i3; -import 'multilocation/multi_location.dart' as _i6; import 'query_response_info.dart' as _i11; import 'response.dart' as _i4; import 'traits/error.dart' as _i17; diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/junction/network_id.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/junction/network_id.dart index 6ba9ab16c..d4079c315 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/junction/network_id.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/junction/network_id.dart @@ -76,6 +76,10 @@ class $NetworkId { BitcoinCash bitcoinCash() { return BitcoinCash(); } + + PolkadotBulletin polkadotBulletin() { + return PolkadotBulletin(); + } } class $NetworkIdCodec with _i1.Codec { @@ -105,6 +109,8 @@ class $NetworkIdCodec with _i1.Codec { return const BitcoinCore(); case 9: return const BitcoinCash(); + case 10: + return const PolkadotBulletin(); default: throw Exception('NetworkId: Invalid variant index: "$index"'); } @@ -146,6 +152,9 @@ class $NetworkIdCodec with _i1.Codec { case BitcoinCash: (value as BitcoinCash).encodeTo(output); break; + case PolkadotBulletin: + (value as PolkadotBulletin).encodeTo(output); + break; default: throw Exception('NetworkId: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -174,6 +183,8 @@ class $NetworkIdCodec with _i1.Codec { return 1; case BitcoinCash: return 1; + case PolkadotBulletin: + return 1; default: throw Exception('NetworkId: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -478,3 +489,23 @@ class BitcoinCash extends NetworkId { @override int get hashCode => runtimeType.hashCode; } + +class PolkadotBulletin extends NetworkId { + const PolkadotBulletin(); + + @override + Map toJson() => {'PolkadotBulletin': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 10, + output, + ); + } + + @override + bool operator ==(Object other) => other is PolkadotBulletin; + + @override + int get hashCode => runtimeType.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/multiasset/asset_id.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/multiasset/asset_id.dart index 6bca1acc8..2c874d7b8 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/multiasset/asset_id.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/multiasset/asset_id.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; import 'package:quiver/collection.dart' as _i4; -import '../multilocation/multi_location.dart' as _i3; +import '../../../staging_xcm/v3/multilocation/multi_location.dart' as _i3; abstract class AssetId { const AssetId(); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/query_response_info.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/query_response_info.dart index b152f737e..a2fc12b61 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/query_response_info.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/v3/query_response_info.dart @@ -4,7 +4,7 @@ import 'dart:typed_data' as _i4; import 'package:polkadart/scale_codec.dart' as _i1; import '../../sp_weights/weight_v2/weight.dart' as _i3; -import 'multilocation/multi_location.dart' as _i2; +import '../../staging_xcm/v3/multilocation/multi_location.dart' as _i2; class QueryResponseInfo { const QueryResponseInfo({ diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_asset_id.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_asset_id.dart index 97e93d995..9a44f17b3 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_asset_id.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_asset_id.dart @@ -3,6 +3,8 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; +import '../staging_xcm/v4/asset/asset_id.dart' as _i4; +import '../staging_xcm/v4/location/location.dart' as _i5; import 'v3/multiasset/asset_id.dart' as _i3; abstract class VersionedAssetId { @@ -35,6 +37,10 @@ class $VersionedAssetId { V3 v3(_i3.AssetId value0) { return V3(value0); } + + V4 v4(_i4.AssetId value0) { + return V4(value0); + } } class $VersionedAssetIdCodec with _i1.Codec { @@ -46,6 +52,8 @@ class $VersionedAssetIdCodec with _i1.Codec { switch (index) { case 3: return V3._decode(input); + case 4: + return V4._decode(input); default: throw Exception('VersionedAssetId: Invalid variant index: "$index"'); } @@ -60,6 +68,9 @@ class $VersionedAssetIdCodec with _i1.Codec { case V3: (value as V3).encodeTo(output); break; + case V4: + (value as V4).encodeTo(output); + break; default: throw Exception('VersionedAssetId: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -70,6 +81,8 @@ class $VersionedAssetIdCodec with _i1.Codec { switch (value.runtimeType) { case V3: return (value as V3)._sizeHint(); + case V4: + return (value as V4)._sizeHint(); default: throw Exception('VersionedAssetId: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -117,3 +130,45 @@ class V3 extends VersionedAssetId { @override int get hashCode => value0.hashCode; } + +class V4 extends VersionedAssetId { + const V4(this.value0); + + factory V4._decode(_i1.Input input) { + return V4(_i5.Location.codec.decode(input)); + } + + /// v4::AssetId + final _i4.AssetId value0; + + @override + Map> toJson() => {'V4': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + const _i4.AssetIdCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + _i5.Location.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V4 && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_assets.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_assets.dart new file mode 100644 index 000000000..b68e882f3 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_assets.dart @@ -0,0 +1,246 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; +import 'package:quiver/collection.dart' as _i7; + +import '../staging_xcm/v4/asset/asset.dart' as _i9; +import '../staging_xcm/v4/asset/assets.dart' as _i5; +import 'v2/multiasset/multi_asset.dart' as _i6; +import 'v2/multiasset/multi_assets.dart' as _i3; +import 'v3/multiasset/multi_asset.dart' as _i8; +import 'v3/multiasset/multi_assets.dart' as _i4; + +abstract class VersionedAssets { + const VersionedAssets(); + + factory VersionedAssets.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $VersionedAssetsCodec codec = $VersionedAssetsCodec(); + + static const $VersionedAssets values = $VersionedAssets(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map>>> toJson(); +} + +class $VersionedAssets { + const $VersionedAssets(); + + V2 v2(_i3.MultiAssets value0) { + return V2(value0); + } + + V3 v3(_i4.MultiAssets value0) { + return V3(value0); + } + + V4 v4(_i5.Assets value0) { + return V4(value0); + } +} + +class $VersionedAssetsCodec with _i1.Codec { + const $VersionedAssetsCodec(); + + @override + VersionedAssets decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 1: + return V2._decode(input); + case 3: + return V3._decode(input); + case 4: + return V4._decode(input); + default: + throw Exception('VersionedAssets: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + VersionedAssets value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case V2: + (value as V2).encodeTo(output); + break; + case V3: + (value as V3).encodeTo(output); + break; + case V4: + (value as V4).encodeTo(output); + break; + default: + throw Exception('VersionedAssets: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(VersionedAssets value) { + switch (value.runtimeType) { + case V2: + return (value as V2)._sizeHint(); + case V3: + return (value as V3)._sizeHint(); + case V4: + return (value as V4)._sizeHint(); + default: + throw Exception('VersionedAssets: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class V2 extends VersionedAssets { + const V2(this.value0); + + factory V2._decode(_i1.Input input) { + return V2(const _i1.SequenceCodec<_i6.MultiAsset>(_i6.MultiAsset.codec).decode(input)); + } + + /// v2::MultiAssets + final _i3.MultiAssets value0; + + @override + Map>>> toJson() => + {'V2': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i3.MultiAssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + const _i1.SequenceCodec<_i6.MultiAsset>(_i6.MultiAsset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V2 && + _i7.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class V3 extends VersionedAssets { + const V3(this.value0); + + factory V3._decode(_i1.Input input) { + return V3(const _i1.SequenceCodec<_i8.MultiAsset>(_i8.MultiAsset.codec).decode(input)); + } + + /// v3::MultiAssets + final _i4.MultiAssets value0; + + @override + Map>>> toJson() => + {'V3': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i4.MultiAssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + const _i1.SequenceCodec<_i8.MultiAsset>(_i8.MultiAsset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V3 && + _i7.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class V4 extends VersionedAssets { + const V4(this.value0); + + factory V4._decode(_i1.Input input) { + return V4(const _i1.SequenceCodec<_i9.Asset>(_i9.Asset.codec).decode(input)); + } + + /// v4::Assets + final _i5.Assets value0; + + @override + Map>>> toJson() => + {'V4': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i5.AssetsCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + const _i1.SequenceCodec<_i9.Asset>(_i9.Asset.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V4 && + _i7.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_location.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_location.dart new file mode 100644 index 000000000..460f56b41 --- /dev/null +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_location.dart @@ -0,0 +1,227 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +import '../staging_xcm/v3/multilocation/multi_location.dart' as _i4; +import '../staging_xcm/v4/location/location.dart' as _i5; +import 'v2/multilocation/multi_location.dart' as _i3; + +abstract class VersionedLocation { + const VersionedLocation(); + + factory VersionedLocation.decode(_i1.Input input) { + return codec.decode(input); + } + + static const $VersionedLocationCodec codec = $VersionedLocationCodec(); + + static const $VersionedLocation values = $VersionedLocation(); + + _i2.Uint8List encode() { + final output = _i1.ByteOutput(codec.sizeHint(this)); + codec.encodeTo(this, output); + return output.toBytes(); + } + + int sizeHint() { + return codec.sizeHint(this); + } + + Map> toJson(); +} + +class $VersionedLocation { + const $VersionedLocation(); + + V2 v2(_i3.MultiLocation value0) { + return V2(value0); + } + + V3 v3(_i4.MultiLocation value0) { + return V3(value0); + } + + V4 v4(_i5.Location value0) { + return V4(value0); + } +} + +class $VersionedLocationCodec with _i1.Codec { + const $VersionedLocationCodec(); + + @override + VersionedLocation decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 1: + return V2._decode(input); + case 3: + return V3._decode(input); + case 4: + return V4._decode(input); + default: + throw Exception('VersionedLocation: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + VersionedLocation value, + _i1.Output output, + ) { + switch (value.runtimeType) { + case V2: + (value as V2).encodeTo(output); + break; + case V3: + (value as V3).encodeTo(output); + break; + case V4: + (value as V4).encodeTo(output); + break; + default: + throw Exception('VersionedLocation: Unsupported "$value" of type "${value.runtimeType}"'); + } + } + + @override + int sizeHint(VersionedLocation value) { + switch (value.runtimeType) { + case V2: + return (value as V2)._sizeHint(); + case V3: + return (value as V3)._sizeHint(); + case V4: + return (value as V4)._sizeHint(); + default: + throw Exception('VersionedLocation: Unsupported "$value" of type "${value.runtimeType}"'); + } + } +} + +class V2 extends VersionedLocation { + const V2(this.value0); + + factory V2._decode(_i1.Input input) { + return V2(_i3.MultiLocation.codec.decode(input)); + } + + /// v2::MultiLocation + final _i3.MultiLocation value0; + + @override + Map> toJson() => {'V2': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i3.MultiLocation.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 1, + output, + ); + _i3.MultiLocation.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V2 && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class V3 extends VersionedLocation { + const V3(this.value0); + + factory V3._decode(_i1.Input input) { + return V3(_i4.MultiLocation.codec.decode(input)); + } + + /// v3::MultiLocation + final _i4.MultiLocation value0; + + @override + Map> toJson() => {'V3': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i4.MultiLocation.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 3, + output, + ); + _i4.MultiLocation.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V3 && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} + +class V4 extends VersionedLocation { + const V4(this.value0); + + factory V4._decode(_i1.Input input) { + return V4(_i5.Location.codec.decode(input)); + } + + /// v4::Location + final _i5.Location value0; + + @override + Map> toJson() => {'V4': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i5.Location.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + _i5.Location.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V4 && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_response.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_response.dart index 30b4bf07f..c0f75c56c 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_response.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_response.dart @@ -3,6 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; +import '../staging_xcm/v4/response.dart' as _i5; import 'v2/response.dart' as _i3; import 'v3/response.dart' as _i4; @@ -40,6 +41,10 @@ class $VersionedResponse { V3 v3(_i4.Response value0) { return V3(value0); } + + V4 v4(_i5.Response value0) { + return V4(value0); + } } class $VersionedResponseCodec with _i1.Codec { @@ -53,6 +58,8 @@ class $VersionedResponseCodec with _i1.Codec { return V2._decode(input); case 3: return V3._decode(input); + case 4: + return V4._decode(input); default: throw Exception('VersionedResponse: Invalid variant index: "$index"'); } @@ -70,6 +77,9 @@ class $VersionedResponseCodec with _i1.Codec { case V3: (value as V3).encodeTo(output); break; + case V4: + (value as V4).encodeTo(output); + break; default: throw Exception('VersionedResponse: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -82,6 +92,8 @@ class $VersionedResponseCodec with _i1.Codec { return (value as V2)._sizeHint(); case V3: return (value as V3)._sizeHint(); + case V4: + return (value as V4)._sizeHint(); default: throw Exception('VersionedResponse: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -171,3 +183,45 @@ class V3 extends VersionedResponse { @override int get hashCode => value0.hashCode; } + +class V4 extends VersionedResponse { + const V4(this.value0); + + factory V4._decode(_i1.Input input) { + return V4(_i5.Response.codec.decode(input)); + } + + /// v4::Response + final _i5.Response value0; + + @override + Map> toJson() => {'V4': value0.toJson()}; + + int _sizeHint() { + int size = 1; + size = size + _i5.Response.codec.sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + _i5.Response.codec.encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V4 && other.value0 == value0; + + @override + int get hashCode => value0.hashCode; +} diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_xcm_1.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_xcm_1.dart index 8a3eb8dbe..db7ce5b58 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_xcm_1.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_xcm_1.dart @@ -2,11 +2,13 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import 'package:quiver/collection.dart' as _i6; +import 'package:quiver/collection.dart' as _i7; -import 'v2/instruction_1.dart' as _i5; +import '../staging_xcm/v4/instruction_1.dart' as _i9; +import '../staging_xcm/v4/xcm_1.dart' as _i5; +import 'v2/instruction_1.dart' as _i6; import 'v2/xcm_1.dart' as _i3; -import 'v3/instruction_1.dart' as _i7; +import 'v3/instruction_1.dart' as _i8; import 'v3/xcm_1.dart' as _i4; abstract class VersionedXcm { @@ -43,6 +45,10 @@ class $VersionedXcm { V3 v3(_i4.Xcm value0) { return V3(value0); } + + V4 v4(_i5.Xcm value0) { + return V4(value0); + } } class $VersionedXcmCodec with _i1.Codec { @@ -56,6 +62,8 @@ class $VersionedXcmCodec with _i1.Codec { return V2._decode(input); case 3: return V3._decode(input); + case 4: + return V4._decode(input); default: throw Exception('VersionedXcm: Invalid variant index: "$index"'); } @@ -73,6 +81,9 @@ class $VersionedXcmCodec with _i1.Codec { case V3: (value as V3).encodeTo(output); break; + case V4: + (value as V4).encodeTo(output); + break; default: throw Exception('VersionedXcm: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -85,6 +96,8 @@ class $VersionedXcmCodec with _i1.Codec { return (value as V2)._sizeHint(); case V3: return (value as V3)._sizeHint(); + case V4: + return (value as V4)._sizeHint(); default: throw Exception('VersionedXcm: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -95,7 +108,7 @@ class V2 extends VersionedXcm { const V2(this.value0); factory V2._decode(_i1.Input input) { - return V2(const _i1.SequenceCodec<_i5.Instruction>(_i5.Instruction.codec).decode(input)); + return V2(const _i1.SequenceCodec<_i6.Instruction>(_i6.Instruction.codec).decode(input)); } /// v2::Xcm @@ -115,7 +128,7 @@ class V2 extends VersionedXcm { 2, output, ); - const _i1.SequenceCodec<_i5.Instruction>(_i5.Instruction.codec).encodeTo( + const _i1.SequenceCodec<_i6.Instruction>(_i6.Instruction.codec).encodeTo( value0, output, ); @@ -128,7 +141,7 @@ class V2 extends VersionedXcm { other, ) || other is V2 && - _i6.listsEqual( + _i7.listsEqual( other.value0, value0, ); @@ -141,7 +154,7 @@ class V3 extends VersionedXcm { const V3(this.value0); factory V3._decode(_i1.Input input) { - return V3(const _i1.SequenceCodec<_i7.Instruction>(_i7.Instruction.codec).decode(input)); + return V3(const _i1.SequenceCodec<_i8.Instruction>(_i8.Instruction.codec).decode(input)); } /// v3::Xcm @@ -161,7 +174,7 @@ class V3 extends VersionedXcm { 3, output, ); - const _i1.SequenceCodec<_i7.Instruction>(_i7.Instruction.codec).encodeTo( + const _i1.SequenceCodec<_i8.Instruction>(_i8.Instruction.codec).encodeTo( value0, output, ); @@ -174,7 +187,53 @@ class V3 extends VersionedXcm { other, ) || other is V3 && - _i6.listsEqual( + _i7.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class V4 extends VersionedXcm { + const V4(this.value0); + + factory V4._decode(_i1.Input input) { + return V4(const _i1.SequenceCodec<_i9.Instruction>(_i9.Instruction.codec).decode(input)); + } + + /// v4::Xcm + final _i5.Xcm value0; + + @override + Map>> toJson() => {'V4': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i5.XcmCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + const _i1.SequenceCodec<_i9.Instruction>(_i9.Instruction.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V4 && + _i7.listsEqual( other.value0, value0, ); diff --git a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_xcm_2.dart b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_xcm_2.dart index 1de3bb36d..9d5a36044 100644 --- a/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_xcm_2.dart +++ b/packages/ew_polkadart/lib/generated/encointer_kusama/types/xcm/versioned_xcm_2.dart @@ -2,11 +2,13 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -import 'package:quiver/collection.dart' as _i6; +import 'package:quiver/collection.dart' as _i7; -import 'v2/instruction_2.dart' as _i5; +import '../staging_xcm/v4/instruction_2.dart' as _i9; +import '../staging_xcm/v4/xcm_2.dart' as _i5; +import 'v2/instruction_2.dart' as _i6; import 'v2/xcm_2.dart' as _i3; -import 'v3/instruction_2.dart' as _i7; +import 'v3/instruction_2.dart' as _i8; import 'v3/xcm_2.dart' as _i4; abstract class VersionedXcm { @@ -43,6 +45,10 @@ class $VersionedXcm { V3 v3(_i4.Xcm value0) { return V3(value0); } + + V4 v4(_i5.Xcm value0) { + return V4(value0); + } } class $VersionedXcmCodec with _i1.Codec { @@ -56,6 +62,8 @@ class $VersionedXcmCodec with _i1.Codec { return V2._decode(input); case 3: return V3._decode(input); + case 4: + return V4._decode(input); default: throw Exception('VersionedXcm: Invalid variant index: "$index"'); } @@ -73,6 +81,9 @@ class $VersionedXcmCodec with _i1.Codec { case V3: (value as V3).encodeTo(output); break; + case V4: + (value as V4).encodeTo(output); + break; default: throw Exception('VersionedXcm: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -85,6 +96,8 @@ class $VersionedXcmCodec with _i1.Codec { return (value as V2)._sizeHint(); case V3: return (value as V3)._sizeHint(); + case V4: + return (value as V4)._sizeHint(); default: throw Exception('VersionedXcm: Unsupported "$value" of type "${value.runtimeType}"'); } @@ -95,7 +108,7 @@ class V2 extends VersionedXcm { const V2(this.value0); factory V2._decode(_i1.Input input) { - return V2(const _i1.SequenceCodec<_i5.Instruction>(_i5.Instruction.codec).decode(input)); + return V2(const _i1.SequenceCodec<_i6.Instruction>(_i6.Instruction.codec).decode(input)); } /// v2::Xcm @@ -115,7 +128,7 @@ class V2 extends VersionedXcm { 2, output, ); - const _i1.SequenceCodec<_i5.Instruction>(_i5.Instruction.codec).encodeTo( + const _i1.SequenceCodec<_i6.Instruction>(_i6.Instruction.codec).encodeTo( value0, output, ); @@ -128,7 +141,7 @@ class V2 extends VersionedXcm { other, ) || other is V2 && - _i6.listsEqual( + _i7.listsEqual( other.value0, value0, ); @@ -141,7 +154,7 @@ class V3 extends VersionedXcm { const V3(this.value0); factory V3._decode(_i1.Input input) { - return V3(const _i1.SequenceCodec<_i7.Instruction>(_i7.Instruction.codec).decode(input)); + return V3(const _i1.SequenceCodec<_i8.Instruction>(_i8.Instruction.codec).decode(input)); } /// v3::Xcm @@ -161,7 +174,7 @@ class V3 extends VersionedXcm { 3, output, ); - const _i1.SequenceCodec<_i7.Instruction>(_i7.Instruction.codec).encodeTo( + const _i1.SequenceCodec<_i8.Instruction>(_i8.Instruction.codec).encodeTo( value0, output, ); @@ -174,7 +187,53 @@ class V3 extends VersionedXcm { other, ) || other is V3 && - _i6.listsEqual( + _i7.listsEqual( + other.value0, + value0, + ); + + @override + int get hashCode => value0.hashCode; +} + +class V4 extends VersionedXcm { + const V4(this.value0); + + factory V4._decode(_i1.Input input) { + return V4(const _i1.SequenceCodec<_i9.Instruction>(_i9.Instruction.codec).decode(input)); + } + + /// v4::Xcm + final _i5.Xcm value0; + + @override + Map>> toJson() => {'V4': value0.map((value) => value.toJson()).toList()}; + + int _sizeHint() { + int size = 1; + size = size + const _i5.XcmCodec().sizeHint(value0); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 4, + output, + ); + const _i1.SequenceCodec<_i9.Instruction>(_i9.Instruction.codec).encodeTo( + value0, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is V4 && + _i7.listsEqual( other.value0, value0, ); diff --git a/packages/ew_polkadart/lib/runtime_call.dart b/packages/ew_polkadart/lib/runtime_call.dart index bd73d69b6..fc5d3ecc8 100644 --- a/packages/ew_polkadart/lib/runtime_call.dart +++ b/packages/ew_polkadart/lib/runtime_call.dart @@ -2,4 +2,4 @@ /// /// Export them under the `runtime_call.dart` domain due to name conflicts with other runtime types. -export 'generated/encointer_kusama/types/encointer_runtime/runtime_call.dart'; +export 'generated/encointer_kusama/types/encointer_kusama_runtime/runtime_call.dart'; diff --git a/packages/ew_polkadart/lib/runtime_event.dart b/packages/ew_polkadart/lib/runtime_event.dart index 9ae9e6c08..416065006 100644 --- a/packages/ew_polkadart/lib/runtime_event.dart +++ b/packages/ew_polkadart/lib/runtime_event.dart @@ -2,4 +2,4 @@ /// /// Export them under the `runtime_event.dart` domain due to name conflicts with other types. -export 'generated/encointer_kusama/types/encointer_runtime/runtime_event.dart'; +export 'generated/encointer_kusama/types/encointer_kusama_runtime/runtime_event.dart'; diff --git a/packages/ew_polkadart/pubspec.yaml b/packages/ew_polkadart/pubspec.yaml index b12fab8cc..4621e23bc 100644 --- a/packages/ew_polkadart/pubspec.yaml +++ b/packages/ew_polkadart/pubspec.yaml @@ -83,4 +83,4 @@ dependency_overrides: polkadart: output_dir: lib/generated chains: - encointer_kusama: wss://kusama.api.encointer.org \ No newline at end of file + encointer_kusama: ws://127.0.0.1:9945 \ No newline at end of file