diff --git a/packages/signer/pubspec.lock b/packages/signer/pubspec.lock index 78a5534e..7468cf8e 100644 --- a/packages/signer/pubspec.lock +++ b/packages/signer/pubspec.lock @@ -58,10 +58,10 @@ packages: dependency: transitive description: name: bip39_mnemonic - sha256: "3ae6ed74b97a0b820e71d01b75ac4bc5b036a8bb427d5ee5827427d2872eefb0" + sha256: e36c1f1fecd938d433b8f7a1e74d5bc721e16816b59dbac5b31307f079d3b3bc url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "3.0.9" boolean_selector: dependency: transitive description: @@ -94,6 +94,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.11.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" crypto: dependency: transitive description: @@ -182,6 +190,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + hashlib_codecs: + dependency: transitive + description: + name: hashlib_codecs + sha256: "8cea9ccafcfeaa7324d2ae52c61c69f7ff71f4237507a018caab31b9e416e3b1" + url: "https://pub.dev" + source: hosted + version: "2.6.0" hex: dependency: "direct main" description: @@ -190,6 +206,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.0" + http: + dependency: transitive + description: + name: http + sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" + url: "https://pub.dev" + source: hosted + version: "1.4.0" http_multi_server: dependency: transitive description: @@ -222,6 +246,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + json_schema: + dependency: transitive + description: + name: json_schema + sha256: fc8c3e280c7647ed8e94f2565ba107ef4aff94b096764b8460a7e1ae39f20382 + url: "https://pub.dev" + source: hosted + version: "5.2.1" lints: dependency: "direct dev" description: @@ -310,22 +342,30 @@ packages: url: "https://pub.dev" source: hosted version: "3.9.1" + polkadart: + dependency: transitive + description: + name: polkadart + sha256: b2369eeb33ee155dcdf2a7af18de8961037b9cc28640e200f1475cea497bc3ab + url: "https://pub.dev" + source: hosted + version: "0.7.1" polkadart_keyring: dependency: "direct main" description: name: polkadart_keyring - sha256: bed5af744e801e88bf7d067ea477fc7eb0a5955801491a8b3e57b578d9de8bea + sha256: e99a93c845466dfb53e23bf650bd6ccd772d7cefe7c7ff2c93c6e86d387e5215 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.7.0" polkadart_scale_codec: dependency: transitive description: name: polkadart_scale_codec - sha256: a9b295ddbd8ace501066800ab521575095464f324cb4185be386bd78ee9316d0 + sha256: db0d61adc58d8b395e663558ba6b2aed2ab2291d343733c49c693de62a2498d2 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.5.0" pool: dependency: transitive description: @@ -350,6 +390,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.2" + rfc_6901: + dependency: transitive + description: + name: rfc_6901 + sha256: df1bbfa3d023009598f19636d6114c6ac1e0b7bb7bf6a260f0e6e6ce91416820 + url: "https://pub.dev" + source: hosted + version: "0.2.0" ristretto255: dependency: transitive description: @@ -362,10 +410,10 @@ packages: dependency: transitive description: name: secp256k1_ecdsa - sha256: "8d516e3f9ad716e721a4e961b890bb03bf3c68ba51bca256a617a055e3c7ef89" + sha256: "50bca61d6ad872829f6bd05c17a96441c1bcfe456ed5bf8cba710ceac86db5f1" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.6.1" shelf: dependency: transitive description: @@ -426,18 +474,18 @@ packages: dependency: transitive description: name: sr25519 - sha256: d10247ff98330efb658042357c8c7fc46074c3c160ea16d3dcdfedf8a9a87b60 + sha256: "122c930a933da6af018ec4a2ccdb853a7d0eb1a0891bfb03467e366b56f86f12" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.7.0" ss58: dependency: transitive description: name: ss58 - sha256: "74dce6fbfbac9dba5f87b8f104ed2b7253c6aeac39d508f088044cf4827d9cd7" + sha256: ad12bcdc909e73648aba52754b1eab81880bd2cbc4fc6cbaa02695affe49201d url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" stack_trace: dependency: transitive description: @@ -474,10 +522,18 @@ packages: dependency: transitive description: name: substrate_bip39 - sha256: "6680dc10eb4f165659374eec5c5aa75920e720b3c00b65490e1dfe3d5ea5a52d" + sha256: ba880015808079804f40a0fde8c5bff0315ec6792fe3a4281a704e408f1c6bdb + url: "https://pub.dev" + source: hosted + version: "0.7.0" + substrate_metadata: + dependency: transitive + description: + name: substrate_metadata + sha256: "6f9e9e3e1078c0c143dd63824043370b9df582d34c431a759253ce2f9cbb7f13" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "1.5.0" term_glyph: dependency: transitive description: @@ -526,6 +582,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.0" + uri: + dependency: transitive + description: + name: uri + sha256: "889eea21e953187c6099802b7b4cf5219ba8f3518f604a1033064d45b1b8268a" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + utility: + dependency: transitive + description: + name: utility + sha256: "200d264c3804e87da7ea36aa81bd73fb845d2cb7b2e820f3f357a0a2bd4e37f5" + url: "https://pub.dev" + source: hosted + version: "1.0.3" vm_service: dependency: transitive description: @@ -566,6 +638,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.1" + web_socket_client: + dependency: transitive + description: + name: web_socket_client + sha256: "22264cb5143e9bb55c943d6b051d207fdd6470ffb77ee45778c9a7a0fda100bc" + url: "https://pub.dev" + source: hosted + version: "0.2.0" webkit_inspection_protocol: dependency: transitive description: diff --git a/packages/signer/pubspec.yaml b/packages/signer/pubspec.yaml index 9c730263..e39a1aea 100644 --- a/packages/signer/pubspec.yaml +++ b/packages/signer/pubspec.yaml @@ -7,7 +7,7 @@ environment: dependencies: hex: ^0.2.0 - polkadart_keyring: ^0.5.0 + polkadart_keyring: ^0.7.0 dev_dependencies: lints: ^5.1.1 diff --git a/packages/stellar_client/lib/src/client.dart b/packages/stellar_client/lib/src/client.dart index 2915798b..789ce4ce 100644 --- a/packages/stellar_client/lib/src/client.dart +++ b/packages/stellar_client/lib/src/client.dart @@ -14,12 +14,12 @@ class Client { var logger = Logger( printer: PrettyPrinter( - methodCount: 2, - errorMethodCount: 8, - lineLength: 120, - colors: true, - printEmojis: true, - printTime: true), + methodCount: 2, + errorMethodCount: 8, + lineLength: 120, + colors: true, + printEmojis: true, + ), level: Level.debug, filter: ProductionFilter(), ); diff --git a/packages/tfchain_client/lib/generated/dev/pallets/aura.dart b/packages/tfchain_client/lib/generated/dev/pallets/aura.dart index 612b483e..aeaace68 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/aura.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/aura.dart @@ -1,5 +1,6 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes 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 _i3; @@ -53,4 +54,16 @@ class Queries { } return BigInt.zero; /* Default */ } + + /// Returns the storage key for `authorities`. + _i6.Uint8List authoritiesKey() { + final hashedKey = _authorities.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `currentSlot`. + _i6.Uint8List currentSlotKey() { + final hashedKey = _currentSlot.hashedKey(); + return hashedKey; + } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/authorship.dart b/packages/tfchain_client/lib/generated/dev/pallets/authorship.dart index 09f945bd..0f02dbfb 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/authorship.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/authorship.dart @@ -1,5 +1,6 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; +import 'dart:typed_data' as _i4; import 'package:polkadart/polkadart.dart' as _i1; @@ -29,4 +30,10 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `author`. + _i4.Uint8List authorKey() { + final hashedKey = _author.hashedKey(); + return hashedKey; + } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/balances.dart b/packages/tfchain_client/lib/generated/dev/pallets/balances.dart index cd8725a7..858a3a23 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/balances.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/balances.dart @@ -1,16 +1,18 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i8; +import 'dart:typed_data' as _i9; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; -import '../types/pallet_balances/pallet/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/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; import '../types/sp_core/crypto/account_id32.dart' as _i3; -import '../types/tfchain_runtime/runtime_call.dart' as _i9; +import '../types/sp_runtime/multiaddress/multi_address.dart' as _i11; +import '../types/tfchain_runtime/runtime_call.dart' as _i10; class Queries { const Queries(this.__api); @@ -208,159 +210,178 @@ class Queries { } return []; /* Default */ } + + /// Returns the storage key for `totalIssuance`. + _i9.Uint8List totalIssuanceKey() { + final hashedKey = _totalIssuance.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `inactiveIssuance`. + _i9.Uint8List inactiveIssuanceKey() { + final hashedKey = _inactiveIssuance.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `account`. + _i9.Uint8List accountKey(_i3.AccountId32 key1) { + final hashedKey = _account.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `locks`. + _i9.Uint8List locksKey(_i3.AccountId32 key1) { + final hashedKey = _locks.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `reserves`. + _i9.Uint8List reservesKey(_i3.AccountId32 key1) { + final hashedKey = _reserves.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `holds`. + _i9.Uint8List holdsKey(_i3.AccountId32 key1) { + final hashedKey = _holds.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `freezes`. + _i9.Uint8List freezesKey(_i3.AccountId32 key1) { + final hashedKey = _freezes.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `account`. + _i9.Uint8List accountMapPrefix() { + final hashedKey = _account.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `locks`. + _i9.Uint8List locksMapPrefix() { + final hashedKey = _locks.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `reserves`. + _i9.Uint8List reservesMapPrefix() { + final hashedKey = _reserves.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `holds`. + _i9.Uint8List holdsMapPrefix() { + final hashedKey = _holds.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `freezes`. + _i9.Uint8List freezesMapPrefix() { + final hashedKey = _freezes.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - /// Transfer some liquid free balance to another account. - /// - /// `transfer_allow_death` will set the `FreeBalance` of the sender and receiver. - /// If the sender's account is below the existential deposit as a result - /// of the transfer, the account will be reaped. - /// - /// The dispatch origin for this call must be `Signed` by the transactor. - _i9.RuntimeCall transferAllowDeath({ - required dest, - required value, + /// See [`Pallet::transfer_allow_death`]. + _i10.Balances transferAllowDeath({ + required _i11.MultiAddress dest, + required BigInt value, }) { - final _call = _i10.Call.values.transferAllowDeath( + return _i10.Balances(_i12.TransferAllowDeath( dest: dest, value: value, - ); - return _i9.RuntimeCall.values.balances(_call); + )); } - /// Set the regular balance of a given account; it also takes a reserved balance but this - /// must be the same as the account's current reserved balance. - /// - /// The dispatch origin for this call is `root`. - /// - /// WARNING: This call is DEPRECATED! Use `force_set_balance` instead. - _i9.RuntimeCall setBalanceDeprecated({ - required who, - required newFree, - required oldReserved, + /// See [`Pallet::set_balance_deprecated`]. + _i10.Balances setBalanceDeprecated({ + required _i11.MultiAddress who, + required BigInt newFree, + required BigInt oldReserved, }) { - final _call = _i10.Call.values.setBalanceDeprecated( + return _i10.Balances(_i12.SetBalanceDeprecated( who: who, newFree: newFree, oldReserved: oldReserved, - ); - return _i9.RuntimeCall.values.balances(_call); + )); } - /// Exactly as `transfer_allow_death`, except the origin must be root and the source account - /// may be specified. - _i9.RuntimeCall forceTransfer({ - required source, - required dest, - required value, + /// See [`Pallet::force_transfer`]. + _i10.Balances forceTransfer({ + required _i11.MultiAddress source, + required _i11.MultiAddress dest, + required BigInt value, }) { - final _call = _i10.Call.values.forceTransfer( + return _i10.Balances(_i12.ForceTransfer( source: source, dest: dest, value: value, - ); - return _i9.RuntimeCall.values.balances(_call); + )); } - /// Same as the [`transfer_allow_death`] call, but with a check that the transfer will not - /// kill the origin account. - /// - /// 99% of the time you want [`transfer_allow_death`] instead. - /// - /// [`transfer_allow_death`]: struct.Pallet.html#method.transfer - _i9.RuntimeCall transferKeepAlive({ - required dest, - required value, + /// See [`Pallet::transfer_keep_alive`]. + _i10.Balances transferKeepAlive({ + required _i11.MultiAddress dest, + required BigInt value, }) { - final _call = _i10.Call.values.transferKeepAlive( + return _i10.Balances(_i12.TransferKeepAlive( dest: dest, value: value, - ); - return _i9.RuntimeCall.values.balances(_call); + )); } - /// Transfer the entire transferable balance from the caller account. - /// - /// NOTE: This function only attempts to transfer _transferable_ balances. This means that - /// any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be - /// transferred by this function. To ensure that this function results in a killed account, - /// you might need to prepare the account by removing any reference counters, storage - /// deposits, etc... - /// - /// The dispatch origin of this call must be Signed. - /// - /// - `dest`: The recipient of the transfer. - /// - `keep_alive`: A boolean to determine if the `transfer_all` operation should send all - /// of the funds the account has, causing the sender account to be killed (false), or - /// transfer everything except at least the existential deposit, which will guarantee to - /// keep the sender account alive (true). - _i9.RuntimeCall transferAll({ - required dest, - required keepAlive, + /// See [`Pallet::transfer_all`]. + _i10.Balances transferAll({ + required _i11.MultiAddress dest, + required bool keepAlive, }) { - final _call = _i10.Call.values.transferAll( + return _i10.Balances(_i12.TransferAll( dest: dest, keepAlive: keepAlive, - ); - return _i9.RuntimeCall.values.balances(_call); + )); } - /// Unreserve some balance from a user by force. - /// - /// Can only be called by ROOT. - _i9.RuntimeCall forceUnreserve({ - required who, - required amount, + /// See [`Pallet::force_unreserve`]. + _i10.Balances forceUnreserve({ + required _i11.MultiAddress who, + required BigInt amount, }) { - final _call = _i10.Call.values.forceUnreserve( + return _i10.Balances(_i12.ForceUnreserve( who: who, amount: amount, - ); - return _i9.RuntimeCall.values.balances(_call); + )); } - /// Upgrade a specified account. - /// - /// - `origin`: Must be `Signed`. - /// - `who`: The account to be upgraded. - /// - /// This will waive the transaction fee if at least all but 10% of the accounts needed to - /// be upgraded. (We let some not have to be upgraded just in order to allow for the - /// possibililty of churn). - _i9.RuntimeCall upgradeAccounts({required who}) { - final _call = _i10.Call.values.upgradeAccounts(who: who); - return _i9.RuntimeCall.values.balances(_call); + /// See [`Pallet::upgrade_accounts`]. + _i10.Balances upgradeAccounts({required List<_i3.AccountId32> who}) { + return _i10.Balances(_i12.UpgradeAccounts(who: who)); } - /// Alias for `transfer_allow_death`, provided only for name-wise compatibility. - /// - /// WARNING: DEPRECATED! Will be released in approximately 3 months. - _i9.RuntimeCall transfer({ - required dest, - required value, + /// See [`Pallet::transfer`]. + _i10.Balances transfer({ + required _i11.MultiAddress dest, + required BigInt value, }) { - final _call = _i10.Call.values.transfer( + return _i10.Balances(_i12.Transfer( dest: dest, value: value, - ); - return _i9.RuntimeCall.values.balances(_call); + )); } - /// Set the regular balance of a given account. - /// - /// The dispatch origin for this call is `root`. - _i9.RuntimeCall forceSetBalance({ - required who, - required newFree, + /// See [`Pallet::force_set_balance`]. + _i10.Balances forceSetBalance({ + required _i11.MultiAddress who, + required BigInt newFree, }) { - final _call = _i10.Call.values.forceSetBalance( + return _i10.Balances(_i12.ForceSetBalance( who: who, newFree: newFree, - ); - return _i9.RuntimeCall.values.balances(_call); + )); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/burning_module.dart b/packages/tfchain_client/lib/generated/dev/pallets/burning_module.dart index 30db43ab..5bdd12d3 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/burning_module.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/burning_module.dart @@ -1,12 +1,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/pallet_burning/pallet/call.dart' as _i6; +import '../types/pallet_burning/pallet/call.dart' as _i7; import '../types/pallet_burning/types/burn.dart' as _i2; -import '../types/tfchain_runtime/runtime_call.dart' as _i5; +import '../types/tfchain_runtime/runtime_call.dart' as _i6; class Queries { const Queries(this.__api); @@ -31,19 +32,25 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `burns`. + _i5.Uint8List burnsKey() { + final hashedKey = _burns.hashedKey(); + return hashedKey; + } } class Txs { const Txs(); - _i5.RuntimeCall burnTft({ - required amount, - required message, + /// See [`Pallet::burn_tft`]. + _i6.BurningModule burnTft({ + required BigInt amount, + required List message, }) { - final _call = _i6.Call.values.burnTft( + return _i6.BurningModule(_i7.BurnTft( amount: amount, message: message, - ); - return _i5.RuntimeCall.values.burningModule(_call); + )); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/council.dart b/packages/tfchain_client/lib/generated/dev/pallets/council.dart index ea32cf41..47977701 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/council.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/council.dart @@ -1,14 +1,15 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; +import 'dart:typed_data' as _i8; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/pallet_collective/pallet/call.dart' as _i8; +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; import '../types/sp_core/crypto/account_id32.dart' as _i6; -import '../types/sp_weights/weight_v2/weight.dart' as _i9; +import '../types/sp_weights/weight_v2/weight.dart' as _i10; import '../types/tfchain_runtime/runtime_call.dart' as _i4; class Queries { @@ -142,170 +143,127 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `proposals`. + _i8.Uint8List proposalsKey() { + final hashedKey = _proposals.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `proposalOf`. + _i8.Uint8List proposalOfKey(_i2.H256 key1) { + final hashedKey = _proposalOf.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `voting`. + _i8.Uint8List votingKey(_i2.H256 key1) { + final hashedKey = _voting.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `proposalCount`. + _i8.Uint8List proposalCountKey() { + final hashedKey = _proposalCount.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `members`. + _i8.Uint8List membersKey() { + final hashedKey = _members.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `prime`. + _i8.Uint8List primeKey() { + final hashedKey = _prime.hashedKey(); + return hashedKey; + } + + /// Returns the storage map key prefix for `proposalOf`. + _i8.Uint8List proposalOfMapPrefix() { + final hashedKey = _proposalOf.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `voting`. + _i8.Uint8List votingMapPrefix() { + final hashedKey = _voting.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - /// Set the collective's membership. - /// - /// - `new_members`: The new member list. Be nice to the chain and provide it sorted. - /// - `prime`: The prime member whose vote sets the default. - /// - `old_count`: The upper bound for the previous number of members in storage. Used for - /// weight estimation. - /// - /// The dispatch of this call must be `SetMembersOrigin`. - /// - /// NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but - /// the weight estimations rely on it to estimate dispatchable weight. - /// - /// # WARNING: - /// - /// The `pallet-collective` can also be managed by logic outside of the pallet through the - /// implementation of the trait [`ChangeMembers`]. - /// Any call to `set_members` must be careful that the member set doesn't get out of sync - /// with other logic managing the member set. - /// - /// ## Complexity: - /// - `O(MP + N)` where: - /// - `M` old-members-count (code- and governance-bounded) - /// - `N` new-members-count (code- and governance-bounded) - /// - `P` proposals-count (code-bounded) - _i4.RuntimeCall setMembers({ - required newMembers, - prime, - required oldCount, + /// See [`Pallet::set_members`]. + _i4.Council setMembers({ + required List<_i6.AccountId32> newMembers, + _i6.AccountId32? prime, + required int oldCount, }) { - final _call = _i8.Call.values.setMembers( + return _i4.Council(_i9.SetMembers( newMembers: newMembers, prime: prime, oldCount: oldCount, - ); - return _i4.RuntimeCall.values.council(_call); + )); } - /// Dispatch a proposal from a member using the `Member` origin. - /// - /// Origin must be a member of the collective. - /// - /// ## Complexity: - /// - `O(B + M + P)` where: - /// - `B` is `proposal` size in bytes (length-fee-bounded) - /// - `M` members-count (code-bounded) - /// - `P` complexity of dispatching `proposal` - _i4.RuntimeCall execute({ - required proposal, - required lengthBound, + /// See [`Pallet::execute`]. + _i4.Council execute({ + required _i4.RuntimeCall proposal, + required BigInt lengthBound, }) { - final _call = _i8.Call.values.execute( + return _i4.Council(_i9.Execute( proposal: proposal, lengthBound: lengthBound, - ); - return _i4.RuntimeCall.values.council(_call); + )); } - /// Add a new proposal to either be voted on or executed directly. - /// - /// Requires the sender to be member. - /// - /// `threshold` determines whether `proposal` is executed directly (`threshold < 2`) - /// or put up for voting. - /// - /// ## Complexity - /// - `O(B + M + P1)` or `O(B + M + P2)` where: - /// - `B` is `proposal` size in bytes (length-fee-bounded) - /// - `M` is members-count (code- and governance-bounded) - /// - branching is influenced by `threshold` where: - /// - `P1` is proposal execution complexity (`threshold < 2`) - /// - `P2` is proposals-count (code-bounded) (`threshold >= 2`) - _i4.RuntimeCall propose({ - required threshold, - required proposal, - required lengthBound, + /// See [`Pallet::propose`]. + _i4.Council propose({ + required BigInt threshold, + required _i4.RuntimeCall proposal, + required BigInt lengthBound, }) { - final _call = _i8.Call.values.propose( + return _i4.Council(_i9.Propose( threshold: threshold, proposal: proposal, lengthBound: lengthBound, - ); - return _i4.RuntimeCall.values.council(_call); + )); } - /// Add an aye or nay vote for the sender to the given proposal. - /// - /// Requires the sender to be a member. - /// - /// Transaction fees will be waived if the member is voting on any particular proposal - /// for the first time and the call is successful. Subsequent vote changes will charge a - /// fee. - /// ## Complexity - /// - `O(M)` where `M` is members-count (code- and governance-bounded) - _i4.RuntimeCall vote({ - required proposal, - required index, - required approve, + /// See [`Pallet::vote`]. + _i4.Council vote({ + required _i2.H256 proposal, + required BigInt index, + required bool approve, }) { - final _call = _i8.Call.values.vote( + return _i4.Council(_i9.Vote( proposal: proposal, index: index, approve: approve, - ); - return _i4.RuntimeCall.values.council(_call); + )); } - /// Disapprove a proposal, close, and remove it from the system, regardless of its current - /// state. - /// - /// Must be called by the Root origin. - /// - /// Parameters: - /// * `proposal_hash`: The hash of the proposal that should be disapproved. - /// - /// ## Complexity - /// O(P) where P is the number of max proposals - _i4.RuntimeCall disapproveProposal({required proposalHash}) { - final _call = - _i8.Call.values.disapproveProposal(proposalHash: proposalHash); - return _i4.RuntimeCall.values.council(_call); + /// See [`Pallet::disapprove_proposal`]. + _i4.Council disapproveProposal({required _i2.H256 proposalHash}) { + return _i4.Council(_i9.DisapproveProposal(proposalHash: proposalHash)); } - /// Close a vote that is either approved, disapproved or whose voting period has ended. - /// - /// May be called by any signed account in order to finish voting and close the proposal. - /// - /// If called before the end of the voting period it will only close the vote if it is - /// has enough votes to be approved or disapproved. - /// - /// If called after the end of the voting period abstentions are counted as rejections - /// unless there is a prime member set and the prime member cast an approval. - /// - /// If the close operation completes successfully with disapproval, the transaction fee will - /// be waived. Otherwise execution of the approved operation will be charged to the caller. - /// - /// + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed - /// proposal. - /// + `length_bound`: The upper bound for the length of the proposal in storage. Checked via - /// `storage::read` so it is `size_of::() == 4` larger than the pure length. - /// - /// ## Complexity - /// - `O(B + M + P1 + P2)` where: - /// - `B` is `proposal` size in bytes (length-fee-bounded) - /// - `M` is members-count (code- and governance-bounded) - /// - `P1` is the complexity of `proposal` preimage. - /// - `P2` is proposal-count (code-bounded) - _i4.RuntimeCall close({ - required proposalHash, - required index, - required proposalWeightBound, - required lengthBound, + /// See [`Pallet::close`]. + _i4.Council close({ + required _i2.H256 proposalHash, + required BigInt index, + required _i10.Weight proposalWeightBound, + required BigInt lengthBound, }) { - final _call = _i8.Call.values.close( + return _i4.Council(_i9.Close( proposalHash: proposalHash, index: index, proposalWeightBound: proposalWeightBound, lengthBound: lengthBound, - ); - return _i4.RuntimeCall.values.council(_call); + )); } } @@ -313,7 +271,7 @@ class Constants { Constants(); /// The maximum weight of a dispatch call that can be proposed and executed. - final _i9.Weight maxProposalWeight = _i9.Weight( + final _i10.Weight maxProposalWeight = _i10.Weight( refTime: BigInt.from(1000000000000), proofSize: BigInt.parse( '9223372036854775807', diff --git a/packages/tfchain_client/lib/generated/dev/pallets/council_membership.dart b/packages/tfchain_client/lib/generated/dev/pallets/council_membership.dart index d33a4306..9705d0d5 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/council_membership.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/council_membership.dart @@ -1,12 +1,14 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/pallet_membership/pallet/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/tfchain_runtime/runtime_call.dart' as _i5; +import '../types/sp_runtime/multiaddress/multi_address.dart' as _i7; +import '../types/tfchain_runtime/runtime_call.dart' as _i6; class Queries { const Queries(this.__api); @@ -52,75 +54,61 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `members`. + _i5.Uint8List membersKey() { + final hashedKey = _members.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `prime`. + _i5.Uint8List primeKey() { + final hashedKey = _prime.hashedKey(); + return hashedKey; + } } class Txs { const Txs(); - /// Add a member `who` to the set. - /// - /// May only be called from `T::AddOrigin`. - _i5.RuntimeCall addMember({required who}) { - final _call = _i6.Call.values.addMember(who: who); - return _i5.RuntimeCall.values.councilMembership(_call); + /// See [`Pallet::add_member`]. + _i6.CouncilMembership addMember({required _i7.MultiAddress who}) { + return _i6.CouncilMembership(_i8.AddMember(who: who)); } - /// Remove a member `who` from the set. - /// - /// May only be called from `T::RemoveOrigin`. - _i5.RuntimeCall removeMember({required who}) { - final _call = _i6.Call.values.removeMember(who: who); - return _i5.RuntimeCall.values.councilMembership(_call); + /// See [`Pallet::remove_member`]. + _i6.CouncilMembership removeMember({required _i7.MultiAddress who}) { + return _i6.CouncilMembership(_i8.RemoveMember(who: who)); } - /// Swap out one member `remove` for another `add`. - /// - /// May only be called from `T::SwapOrigin`. - /// - /// Prime membership is *not* passed from `remove` to `add`, if extant. - _i5.RuntimeCall swapMember({ - required remove, - required add, + /// See [`Pallet::swap_member`]. + _i6.CouncilMembership swapMember({ + required _i7.MultiAddress remove, + required _i7.MultiAddress add, }) { - final _call = _i6.Call.values.swapMember( + return _i6.CouncilMembership(_i8.SwapMember( remove: remove, add: add, - ); - return _i5.RuntimeCall.values.councilMembership(_call); + )); } - /// Change the membership to a new set, disregarding the existing membership. Be nice and - /// pass `members` pre-sorted. - /// - /// May only be called from `T::ResetOrigin`. - _i5.RuntimeCall resetMembers({required members}) { - final _call = _i6.Call.values.resetMembers(members: members); - return _i5.RuntimeCall.values.councilMembership(_call); + /// See [`Pallet::reset_members`]. + _i6.CouncilMembership resetMembers({required List<_i2.AccountId32> members}) { + return _i6.CouncilMembership(_i8.ResetMembers(members: members)); } - /// Swap out the sending member for some other key `new`. - /// - /// May only be called from `Signed` origin of a current member. - /// - /// Prime membership is passed from the origin account to `new`, if extant. - _i5.RuntimeCall changeKey({required new_}) { - final _call = _i6.Call.values.changeKey(new_: new_); - return _i5.RuntimeCall.values.councilMembership(_call); + /// See [`Pallet::change_key`]. + _i6.CouncilMembership changeKey({required _i7.MultiAddress new_}) { + return _i6.CouncilMembership(_i8.ChangeKey(new_: new_)); } - /// Set the prime member. Must be a current member. - /// - /// May only be called from `T::PrimeOrigin`. - _i5.RuntimeCall setPrime({required who}) { - final _call = _i6.Call.values.setPrime(who: who); - return _i5.RuntimeCall.values.councilMembership(_call); + /// See [`Pallet::set_prime`]. + _i6.CouncilMembership setPrime({required _i7.MultiAddress who}) { + return _i6.CouncilMembership(_i8.SetPrime(who: who)); } - /// Remove the prime member if it exists. - /// - /// May only be called from `T::PrimeOrigin`. - _i5.RuntimeCall clearPrime() { - final _call = _i6.Call.values.clearPrime(); - return _i5.RuntimeCall.values.councilMembership(_call); + /// See [`Pallet::clear_prime`]. + _i6.CouncilMembership clearPrime() { + return _i6.CouncilMembership(_i8.ClearPrime()); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/dao.dart b/packages/tfchain_client/lib/generated/dev/pallets/dao.dart index b2c676a9..086a9a42 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/dao.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/dao.dart @@ -1,10 +1,11 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; +import 'dart:typed_data' as _i8; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/pallet_dao/pallet/call.dart' as _i8; +import '../types/pallet_dao/pallet/call.dart' as _i9; import '../types/pallet_dao/proposal/dao_proposal.dart' as _i4; import '../types/pallet_dao/proposal/dao_votes.dart' as _i6; import '../types/primitive_types/h256.dart' as _i2; @@ -147,54 +148,114 @@ class Queries { } return BigInt.zero; /* Default */ } + + /// Returns the storage key for `proposalList`. + _i8.Uint8List proposalListKey() { + final hashedKey = _proposalList.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `proposals`. + _i8.Uint8List proposalsKey(_i2.H256 key1) { + final hashedKey = _proposals.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `proposalOf`. + _i8.Uint8List proposalOfKey(_i2.H256 key1) { + final hashedKey = _proposalOf.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `voting`. + _i8.Uint8List votingKey(_i2.H256 key1) { + final hashedKey = _voting.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `proposalCount`. + _i8.Uint8List proposalCountKey() { + final hashedKey = _proposalCount.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `farmWeight`. + _i8.Uint8List farmWeightKey(int key1) { + final hashedKey = _farmWeight.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `proposals`. + _i8.Uint8List proposalsMapPrefix() { + final hashedKey = _proposals.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `proposalOf`. + _i8.Uint8List proposalOfMapPrefix() { + final hashedKey = _proposalOf.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `voting`. + _i8.Uint8List votingMapPrefix() { + final hashedKey = _voting.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `farmWeight`. + _i8.Uint8List farmWeightMapPrefix() { + final hashedKey = _farmWeight.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - _i5.RuntimeCall propose({ - required threshold, - required action, - required description, - required link, - duration, + /// See [`Pallet::propose`]. + _i5.Dao propose({ + required BigInt threshold, + required _i5.RuntimeCall action, + required List description, + required List link, + int? duration, }) { - final _call = _i8.Call.values.propose( + return _i5.Dao(_i9.Propose( threshold: threshold, action: action, description: description, link: link, duration: duration, - ); - return _i5.RuntimeCall.values.dao(_call); + )); } - _i5.RuntimeCall vote({ - required farmId, - required proposalHash, - required approve, + /// See [`Pallet::vote`]. + _i5.Dao vote({ + required int farmId, + required _i2.H256 proposalHash, + required bool approve, }) { - final _call = _i8.Call.values.vote( + return _i5.Dao(_i9.Vote( farmId: farmId, proposalHash: proposalHash, approve: approve, - ); - return _i5.RuntimeCall.values.dao(_call); + )); } - _i5.RuntimeCall veto({required proposalHash}) { - final _call = _i8.Call.values.veto(proposalHash: proposalHash); - return _i5.RuntimeCall.values.dao(_call); + /// See [`Pallet::veto`]. + _i5.Dao veto({required _i2.H256 proposalHash}) { + return _i5.Dao(_i9.Veto(proposalHash: proposalHash)); } - _i5.RuntimeCall close({ - required proposalHash, - required proposalIndex, + /// See [`Pallet::close`]. + _i5.Dao close({ + required _i2.H256 proposalHash, + required BigInt proposalIndex, }) { - final _call = _i8.Call.values.close( + return _i5.Dao(_i9.Close( proposalHash: proposalHash, proposalIndex: proposalIndex, - ); - return _i5.RuntimeCall.values.dao(_call); + )); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/grandpa.dart b/packages/tfchain_client/lib/generated/dev/pallets/grandpa.dart index d3c7daee..f07b366c 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/grandpa.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/grandpa.dart @@ -1,13 +1,16 @@ // 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 _i4; -import '../types/pallet_grandpa/pallet/call.dart' as _i8; +import '../types/pallet_grandpa/pallet/call.dart' as _i11; import '../types/pallet_grandpa/stored_pending_change.dart' as _i3; import '../types/pallet_grandpa/stored_state.dart' as _i2; -import '../types/tfchain_runtime/runtime_call.dart' as _i7; +import '../types/sp_consensus_grandpa/equivocation_proof.dart' as _i9; +import '../types/sp_core/void.dart' as _i10; +import '../types/tfchain_runtime/runtime_call.dart' as _i8; import '../types/tuples_1.dart' as _i5; class Queries { @@ -150,67 +153,84 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `state`. + _i7.Uint8List stateKey() { + final hashedKey = _state.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `pendingChange`. + _i7.Uint8List pendingChangeKey() { + final hashedKey = _pendingChange.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `nextForced`. + _i7.Uint8List nextForcedKey() { + final hashedKey = _nextForced.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `stalled`. + _i7.Uint8List stalledKey() { + final hashedKey = _stalled.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `currentSetId`. + _i7.Uint8List currentSetIdKey() { + final hashedKey = _currentSetId.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `setIdSession`. + _i7.Uint8List setIdSessionKey(BigInt key1) { + final hashedKey = _setIdSession.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `setIdSession`. + _i7.Uint8List setIdSessionMapPrefix() { + final hashedKey = _setIdSession.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - /// Report voter equivocation/misbehavior. This method will verify the - /// equivocation proof and validate the given key ownership proof - /// against the extracted offender. If both are valid, the offence - /// will be reported. - _i7.RuntimeCall reportEquivocation({ - required equivocationProof, - required keyOwnerProof, + /// See [`Pallet::report_equivocation`]. + _i8.Grandpa reportEquivocation({ + required _i9.EquivocationProof equivocationProof, + required _i10.Void keyOwnerProof, }) { - final _call = _i8.Call.values.reportEquivocation( + return _i8.Grandpa(_i11.ReportEquivocation( equivocationProof: equivocationProof, keyOwnerProof: keyOwnerProof, - ); - return _i7.RuntimeCall.values.grandpa(_call); + )); } - /// Report voter equivocation/misbehavior. This method will verify the - /// equivocation proof and validate the given key ownership proof - /// against the extracted offender. If both are valid, the offence - /// will be reported. - /// - /// This extrinsic must be called unsigned and it is expected that only - /// block authors will call it (validated in `ValidateUnsigned`), as such - /// if the block author is defined it will be defined as the equivocation - /// reporter. - _i7.RuntimeCall reportEquivocationUnsigned({ - required equivocationProof, - required keyOwnerProof, + /// See [`Pallet::report_equivocation_unsigned`]. + _i8.Grandpa reportEquivocationUnsigned({ + required _i9.EquivocationProof equivocationProof, + required _i10.Void keyOwnerProof, }) { - final _call = _i8.Call.values.reportEquivocationUnsigned( + return _i8.Grandpa(_i11.ReportEquivocationUnsigned( equivocationProof: equivocationProof, keyOwnerProof: keyOwnerProof, - ); - return _i7.RuntimeCall.values.grandpa(_call); + )); } - /// Note that the current authority set of the GRANDPA finality gadget has stalled. - /// - /// This will trigger a forced authority set change at the beginning of the next session, to - /// be enacted `delay` blocks after that. The `delay` should be high enough to safely assume - /// that the block signalling the forced change will not be re-orged e.g. 1000 blocks. - /// The block production rate (which may be slowed down because of finality lagging) should - /// be taken into account when choosing the `delay`. The GRANDPA voters based on the new - /// authority will start voting on top of `best_finalized_block_number` for new finalized - /// blocks. `best_finalized_block_number` should be the highest of the latest finalized - /// block of all validators of the new authority set. - /// - /// Only callable by root. - _i7.RuntimeCall noteStalled({ - required delay, - required bestFinalizedBlockNumber, + /// See [`Pallet::note_stalled`]. + _i8.Grandpa noteStalled({ + required int delay, + required int bestFinalizedBlockNumber, }) { - final _call = _i8.Call.values.noteStalled( + return _i8.Grandpa(_i11.NoteStalled( delay: delay, bestFinalizedBlockNumber: bestFinalizedBlockNumber, - ); - return _i7.RuntimeCall.values.grandpa(_call); + )); } } @@ -220,6 +240,9 @@ class Constants { /// Max Authorities in use final int maxAuthorities = 100; + /// The maximum number of nominators for each validator. + final int maxNominators = 0; + /// The maximum number of entries to keep in the set id to session index mapping. /// /// Since the `SetIdSession` map is only used for validating equivocations this diff --git a/packages/tfchain_client/lib/generated/dev/pallets/runtime_upgrade.dart b/packages/tfchain_client/lib/generated/dev/pallets/runtime_upgrade.dart index a7cc00dd..6ea2e6a4 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/runtime_upgrade.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/runtime_upgrade.dart @@ -5,8 +5,8 @@ import '../types/tfchain_runtime/runtime_call.dart' as _i1; class Txs { const Txs(); - _i1.RuntimeCall setCode({required code}) { - final _call = _i2.Call.values.setCode(code: code); - return _i1.RuntimeCall.values.runtimeUpgrade(_call); + /// See [`Pallet::set_code`]. + _i1.RuntimeUpgrade setCode({required List code}) { + return _i1.RuntimeUpgrade(_i2.SetCode(code: code)); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/scheduler.dart b/packages/tfchain_client/lib/generated/dev/pallets/scheduler.dart index b75f5d53..860cdfec 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/scheduler.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/scheduler.dart @@ -1,13 +1,14 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes 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/pallet_scheduler/pallet/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 _i8; -import '../types/tfchain_runtime/runtime_call.dart' as _i6; +import '../types/sp_weights/weight_v2/weight.dart' as _i9; +import '../types/tfchain_runtime/runtime_call.dart' as _i7; import '../types/tuples_1.dart' as _i4; class Queries { @@ -87,95 +88,119 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `incompleteSince`. + _i6.Uint8List incompleteSinceKey() { + final hashedKey = _incompleteSince.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `agenda`. + _i6.Uint8List agendaKey(int key1) { + final hashedKey = _agenda.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `lookup`. + _i6.Uint8List lookupKey(List key1) { + final hashedKey = _lookup.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `agenda`. + _i6.Uint8List agendaMapPrefix() { + final hashedKey = _agenda.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `lookup`. + _i6.Uint8List lookupMapPrefix() { + final hashedKey = _lookup.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - /// Anonymously schedule a task. - _i6.RuntimeCall schedule({ - required when, - maybePeriodic, - required priority, - required call, + /// See [`Pallet::schedule`]. + _i7.Scheduler schedule({ + required int when, + _i4.Tuple2? maybePeriodic, + required int priority, + required _i7.RuntimeCall call, }) { - final _call = _i7.Call.values.schedule( + return _i7.Scheduler(_i8.Schedule( when: when, maybePeriodic: maybePeriodic, priority: priority, call: call, - ); - return _i6.RuntimeCall.values.scheduler(_call); + )); } - /// Cancel an anonymously scheduled task. - _i6.RuntimeCall cancel({ - required when, - required index, + /// See [`Pallet::cancel`]. + _i7.Scheduler cancel({ + required int when, + required int index, }) { - final _call = _i7.Call.values.cancel( + return _i7.Scheduler(_i8.Cancel( when: when, index: index, - ); - return _i6.RuntimeCall.values.scheduler(_call); + )); } - /// Schedule a named task. - _i6.RuntimeCall scheduleNamed({ - required id, - required when, - maybePeriodic, - required priority, - required call, + /// See [`Pallet::schedule_named`]. + _i7.Scheduler scheduleNamed({ + required List id, + required int when, + _i4.Tuple2? maybePeriodic, + required int priority, + required _i7.RuntimeCall call, }) { - final _call = _i7.Call.values.scheduleNamed( + return _i7.Scheduler(_i8.ScheduleNamed( id: id, when: when, maybePeriodic: maybePeriodic, priority: priority, call: call, - ); - return _i6.RuntimeCall.values.scheduler(_call); + )); } - /// Cancel a named scheduled task. - _i6.RuntimeCall cancelNamed({required id}) { - final _call = _i7.Call.values.cancelNamed(id: id); - return _i6.RuntimeCall.values.scheduler(_call); + /// See [`Pallet::cancel_named`]. + _i7.Scheduler cancelNamed({required List id}) { + return _i7.Scheduler(_i8.CancelNamed(id: id)); } - /// Anonymously schedule a task after a delay. - _i6.RuntimeCall scheduleAfter({ - required after, - maybePeriodic, - required priority, - required call, + /// See [`Pallet::schedule_after`]. + _i7.Scheduler scheduleAfter({ + required int after, + _i4.Tuple2? maybePeriodic, + required int priority, + required _i7.RuntimeCall call, }) { - final _call = _i7.Call.values.scheduleAfter( + return _i7.Scheduler(_i8.ScheduleAfter( after: after, maybePeriodic: maybePeriodic, priority: priority, call: call, - ); - return _i6.RuntimeCall.values.scheduler(_call); + )); } - /// Schedule a named task after a delay. - _i6.RuntimeCall scheduleNamedAfter({ - required id, - required after, - maybePeriodic, - required priority, - required call, + /// See [`Pallet::schedule_named_after`]. + _i7.Scheduler scheduleNamedAfter({ + required List id, + required int after, + _i4.Tuple2? maybePeriodic, + required int priority, + required _i7.RuntimeCall call, }) { - final _call = _i7.Call.values.scheduleNamedAfter( + return _i7.Scheduler(_i8.ScheduleNamedAfter( id: id, after: after, maybePeriodic: maybePeriodic, priority: priority, call: call, - ); - return _i6.RuntimeCall.values.scheduler(_call); + )); } } @@ -183,7 +208,7 @@ class Constants { Constants(); /// The maximum weight that may be scheduled per block for any dispatchables. - final _i8.Weight maximumWeight = _i8.Weight( + final _i9.Weight maximumWeight = _i9.Weight( refTime: BigInt.from(1600000000000), proofSize: BigInt.parse( '14757395258967641292', diff --git a/packages/tfchain_client/lib/generated/dev/pallets/session.dart b/packages/tfchain_client/lib/generated/dev/pallets/session.dart index debda38f..cc4a0259 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/session.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/session.dart @@ -1,14 +1,15 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; +import 'dart:typed_data' as _i8; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/pallet_session/pallet/call.dart' as _i9; +import '../types/pallet_session/pallet/call.dart' as _i10; import '../types/sp_core/crypto/account_id32.dart' as _i2; import '../types/sp_core/crypto/key_type_id.dart' as _i6; import '../types/tfchain_runtime/opaque/session_keys.dart' as _i5; -import '../types/tfchain_runtime/runtime_call.dart' as _i8; +import '../types/tfchain_runtime/runtime_call.dart' as _i9; import '../types/tuples.dart' as _i4; class Queries { @@ -182,45 +183,78 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `validators`. + _i8.Uint8List validatorsKey() { + final hashedKey = _validators.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `currentIndex`. + _i8.Uint8List currentIndexKey() { + final hashedKey = _currentIndex.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `queuedChanged`. + _i8.Uint8List queuedChangedKey() { + final hashedKey = _queuedChanged.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `queuedKeys`. + _i8.Uint8List queuedKeysKey() { + final hashedKey = _queuedKeys.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `disabledValidators`. + _i8.Uint8List disabledValidatorsKey() { + final hashedKey = _disabledValidators.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `nextKeys`. + _i8.Uint8List nextKeysKey(_i2.AccountId32 key1) { + final hashedKey = _nextKeys.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `keyOwner`. + _i8.Uint8List keyOwnerKey(_i4.Tuple2<_i6.KeyTypeId, List> key1) { + final hashedKey = _keyOwner.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `nextKeys`. + _i8.Uint8List nextKeysMapPrefix() { + final hashedKey = _nextKeys.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `keyOwner`. + _i8.Uint8List keyOwnerMapPrefix() { + final hashedKey = _keyOwner.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - /// Sets the session key(s) of the function caller to `keys`. - /// Allows an account to set its session key prior to becoming a validator. - /// This doesn't take effect until the next session. - /// - /// The dispatch origin of this function must be signed. - /// - /// ## Complexity - /// - `O(1)`. Actual cost depends on the number of length of `T::Keys::key_ids()` which is - /// fixed. - _i8.RuntimeCall setKeys({ - required keys, - required proof, + /// See [`Pallet::set_keys`]. + _i9.Session setKeys({ + required _i5.SessionKeys keys, + required List proof, }) { - final _call = _i9.Call.values.setKeys( + return _i9.Session(_i10.SetKeys( keys: keys, proof: proof, - ); - return _i8.RuntimeCall.values.session(_call); + )); } - /// Removes any session key(s) of the function caller. - /// - /// This doesn't take effect until the next session. - /// - /// The dispatch origin of this function must be Signed and the account must be either be - /// convertible to a validator ID using the chain's typical addressing system (this usually - /// means being a controller account) or directly convertible into a validator ID (which - /// usually means being a stash account). - /// - /// ## Complexity - /// - `O(1)` in number of key types. Actual cost depends on the number of length of - /// `T::Keys::key_ids()` which is fixed. - _i8.RuntimeCall purgeKeys() { - final _call = _i9.Call.values.purgeKeys(); - return _i8.RuntimeCall.values.session(_call); + /// See [`Pallet::purge_keys`]. + _i9.Session purgeKeys() { + return _i9.Session(_i10.PurgeKeys()); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/smart_contract_module.dart b/packages/tfchain_client/lib/generated/dev/pallets/smart_contract_module.dart index 5d4e2a69..5b9cc85a 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/smart_contract_module.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/smart_contract_module.dart @@ -1,22 +1,28 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i11; +import 'dart:async' as _i12; +import 'dart:typed_data' as _i14; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; import '../types/pallet_smart_contract/grid_contract/name_contract_name.dart' as _i7; -import '../types/pallet_smart_contract/pallet/call.dart' as _i14; +import '../types/pallet_smart_contract/pallet/call.dart' as _i16; import '../types/pallet_smart_contract/types/contract.dart' as _i2; import '../types/pallet_smart_contract/types/contract_billing_information.dart' as _i4; import '../types/pallet_smart_contract/types/contract_lock.dart' as _i6; +import '../types/pallet_smart_contract/types/contract_payment_state.dart' + as _i11; import '../types/pallet_smart_contract/types/contract_resources.dart' as _i5; +import '../types/pallet_smart_contract/types/nru_consumption.dart' as _i17; +import '../types/pallet_smart_contract/types/provider.dart' as _i18; import '../types/pallet_smart_contract/types/service_contract.dart' as _i10; import '../types/pallet_smart_contract/types/solution_provider.dart' as _i8; import '../types/pallet_smart_contract/types/storage_version.dart' as _i9; -import '../types/tfchain_runtime/runtime_call.dart' as _i13; -import '../types/tfchain_support/resources/resources.dart' as _i12; +import '../types/sp_core/crypto/account_id32.dart' as _i19; +import '../types/tfchain_runtime/runtime_call.dart' as _i15; +import '../types/tfchain_support/resources/resources.dart' as _i13; class Queries { const Queries(this.__api); @@ -58,16 +64,16 @@ class Queries { hasher2: _i1.StorageHasher.blake2b128Concat(_i3.U8ArrayCodec(32)), ); - final _i1.StorageMap> _activeNodeContracts = - const _i1.StorageMap>( + final _i1.StorageMap> _activeNodeContracts = + const _i1.StorageMap>( prefix: 'SmartContractModule', storage: 'ActiveNodeContracts', valueCodec: _i3.U64SequenceCodec.codec, hasher: _i1.StorageHasher.blake2b128Concat(_i3.U32Codec.codec), ); - final _i1.StorageMap> _contractsToBillAt = - const _i1.StorageMap>( + final _i1.StorageMap> _contractsToBillAt = + const _i1.StorageMap>( prefix: 'SmartContractModule', storage: 'ContractsToBillAt', valueCodec: _i3.U64SequenceCodec.codec, @@ -164,7 +170,16 @@ class Queries { hasher: _i1.StorageHasher.blake2b128Concat(_i3.U32Codec.codec), ); - _i11.Future<_i2.Contract?> contracts( + final _i1.StorageMap + _contractPaymentState = + const _i1.StorageMap( + prefix: 'SmartContractModule', + storage: 'ContractPaymentState', + valueCodec: _i11.ContractPaymentState.codec, + hasher: _i1.StorageHasher.blake2b128Concat(_i3.U64Codec.codec), + ); + + _i12.Future<_i2.Contract?> contracts( BigInt key1, { _i1.BlockHash? at, }) async { @@ -179,7 +194,7 @@ class Queries { return null; /* Nullable */ } - _i11.Future<_i4.ContractBillingInformation> contractBillingInformationByID( + _i12.Future<_i4.ContractBillingInformation> contractBillingInformationByID( BigInt key1, { _i1.BlockHash? at, }) async { @@ -198,7 +213,7 @@ class Queries { ); /* Default */ } - _i11.Future<_i5.ContractResources> nodeContractResources( + _i12.Future<_i5.ContractResources> nodeContractResources( BigInt key1, { _i1.BlockHash? at, }) async { @@ -212,7 +227,7 @@ class Queries { } return _i5.ContractResources( contractId: BigInt.zero, - used: _i12.Resources( + used: _i13.Resources( hru: BigInt.zero, sru: BigInt.zero, cru: BigInt.zero, @@ -221,7 +236,7 @@ class Queries { ); /* Default */ } - _i11.Future contractIDByNodeIDAndHash( + _i12.Future contractIDByNodeIDAndHash( int key1, List key2, { _i1.BlockHash? at, @@ -240,7 +255,7 @@ class Queries { return BigInt.zero; /* Default */ } - _i11.Future> activeNodeContracts( + _i12.Future> activeNodeContracts( int key1, { _i1.BlockHash? at, }) async { @@ -252,14 +267,14 @@ class Queries { if (bytes != null) { return _activeNodeContracts.decodeValue(bytes); } - return List.filled( - 0, + return List.filled( 0, + BigInt.zero, growable: true, ); /* Default */ } - _i11.Future> contractsToBillAt( + _i12.Future> contractsToBillAt( BigInt key1, { _i1.BlockHash? at, }) async { @@ -271,14 +286,14 @@ class Queries { if (bytes != null) { return _contractsToBillAt.decodeValue(bytes); } - return List.filled( - 0, + return List.filled( 0, + BigInt.zero, growable: true, ); /* Default */ } - _i11.Future<_i6.ContractLock> contractLock( + _i12.Future<_i6.ContractLock> contractLock( BigInt key1, { _i1.BlockHash? at, }) async { @@ -298,7 +313,7 @@ class Queries { ); /* Default */ } - _i11.Future contractIDByNameRegistration( + _i12.Future contractIDByNameRegistration( _i7.NameContractName key1, { _i1.BlockHash? at, }) async { @@ -313,7 +328,7 @@ class Queries { return BigInt.zero; /* Default */ } - _i11.Future activeRentContractForNode( + _i12.Future activeRentContractForNode( int key1, { _i1.BlockHash? at, }) async { @@ -328,7 +343,7 @@ class Queries { return null; /* Nullable */ } - _i11.Future contractID({_i1.BlockHash? at}) async { + _i12.Future contractID({_i1.BlockHash? at}) async { final hashedKey = _contractID.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -340,7 +355,7 @@ class Queries { return BigInt.zero; /* Default */ } - _i11.Future<_i8.SolutionProvider?> solutionProviders( + _i12.Future<_i8.SolutionProvider?> solutionProviders( BigInt key1, { _i1.BlockHash? at, }) async { @@ -355,7 +370,7 @@ class Queries { return null; /* Nullable */ } - _i11.Future solutionProviderID({_i1.BlockHash? at}) async { + _i12.Future solutionProviderID({_i1.BlockHash? at}) async { final hashedKey = _solutionProviderID.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -367,7 +382,7 @@ class Queries { return BigInt.zero; /* Default */ } - _i11.Future<_i9.StorageVersion> palletVersion({_i1.BlockHash? at}) async { + _i12.Future<_i9.StorageVersion> palletVersion({_i1.BlockHash? at}) async { final hashedKey = _palletVersion.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -379,7 +394,7 @@ class Queries { return _i9.StorageVersion.v10; /* Default */ } - _i11.Future billingFrequency({_i1.BlockHash? at}) async { + _i12.Future billingFrequency({_i1.BlockHash? at}) async { final hashedKey = _billingFrequency.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -391,7 +406,7 @@ class Queries { return BigInt.from(600); /* Default */ } - _i11.Future<_i10.ServiceContract?> serviceContracts( + _i12.Future<_i10.ServiceContract?> serviceContracts( BigInt key1, { _i1.BlockHash? at, }) async { @@ -406,7 +421,7 @@ class Queries { return null; /* Nullable */ } - _i11.Future serviceContractID({_i1.BlockHash? at}) async { + _i12.Future serviceContractID({_i1.BlockHash? at}) async { final hashedKey = _serviceContractID.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -419,7 +434,7 @@ class Queries { } /// The current migration's stage, if any. - _i11.Future currentMigrationStage({_i1.BlockHash? at}) async { + _i12.Future currentMigrationStage({_i1.BlockHash? at}) async { final hashedKey = _currentMigrationStage.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -431,7 +446,7 @@ class Queries { return null; /* Nullable */ } - _i11.Future dedicatedNodesExtraFee( + _i12.Future dedicatedNodesExtraFee( int key1, { _i1.BlockHash? at, }) async { @@ -445,193 +460,421 @@ class Queries { } return BigInt.zero; /* Default */ } + + _i12.Future<_i11.ContractPaymentState?> contractPaymentState( + BigInt key1, { + _i1.BlockHash? at, + }) async { + final hashedKey = _contractPaymentState.hashedKeyFor(key1); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _contractPaymentState.decodeValue(bytes); + } + return null; /* Nullable */ + } + + /// Returns the storage key for `contracts`. + _i14.Uint8List contractsKey(BigInt key1) { + final hashedKey = _contracts.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `contractBillingInformationByID`. + _i14.Uint8List contractBillingInformationByIDKey(BigInt key1) { + final hashedKey = _contractBillingInformationByID.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `nodeContractResources`. + _i14.Uint8List nodeContractResourcesKey(BigInt key1) { + final hashedKey = _nodeContractResources.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `contractIDByNodeIDAndHash`. + _i14.Uint8List contractIDByNodeIDAndHashKey( + int key1, + List key2, + ) { + final hashedKey = _contractIDByNodeIDAndHash.hashedKeyFor( + key1, + key2, + ); + return hashedKey; + } + + /// Returns the storage key for `activeNodeContracts`. + _i14.Uint8List activeNodeContractsKey(int key1) { + final hashedKey = _activeNodeContracts.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `contractsToBillAt`. + _i14.Uint8List contractsToBillAtKey(BigInt key1) { + final hashedKey = _contractsToBillAt.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `contractLock`. + _i14.Uint8List contractLockKey(BigInt key1) { + final hashedKey = _contractLock.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `contractIDByNameRegistration`. + _i14.Uint8List contractIDByNameRegistrationKey(_i7.NameContractName key1) { + final hashedKey = _contractIDByNameRegistration.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `activeRentContractForNode`. + _i14.Uint8List activeRentContractForNodeKey(int key1) { + final hashedKey = _activeRentContractForNode.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `contractID`. + _i14.Uint8List contractIDKey() { + final hashedKey = _contractID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `solutionProviders`. + _i14.Uint8List solutionProvidersKey(BigInt key1) { + final hashedKey = _solutionProviders.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `solutionProviderID`. + _i14.Uint8List solutionProviderIDKey() { + final hashedKey = _solutionProviderID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `palletVersion`. + _i14.Uint8List palletVersionKey() { + final hashedKey = _palletVersion.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `billingFrequency`. + _i14.Uint8List billingFrequencyKey() { + final hashedKey = _billingFrequency.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `serviceContracts`. + _i14.Uint8List serviceContractsKey(BigInt key1) { + final hashedKey = _serviceContracts.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `serviceContractID`. + _i14.Uint8List serviceContractIDKey() { + final hashedKey = _serviceContractID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `currentMigrationStage`. + _i14.Uint8List currentMigrationStageKey() { + final hashedKey = _currentMigrationStage.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `dedicatedNodesExtraFee`. + _i14.Uint8List dedicatedNodesExtraFeeKey(int key1) { + final hashedKey = _dedicatedNodesExtraFee.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `contractPaymentState`. + _i14.Uint8List contractPaymentStateKey(BigInt key1) { + final hashedKey = _contractPaymentState.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `contracts`. + _i14.Uint8List contractsMapPrefix() { + final hashedKey = _contracts.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `contractBillingInformationByID`. + _i14.Uint8List contractBillingInformationByIDMapPrefix() { + final hashedKey = _contractBillingInformationByID.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `nodeContractResources`. + _i14.Uint8List nodeContractResourcesMapPrefix() { + final hashedKey = _nodeContractResources.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `contractIDByNodeIDAndHash`. + _i14.Uint8List contractIDByNodeIDAndHashMapPrefix(int key1) { + final hashedKey = _contractIDByNodeIDAndHash.mapPrefix(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `activeNodeContracts`. + _i14.Uint8List activeNodeContractsMapPrefix() { + final hashedKey = _activeNodeContracts.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `contractsToBillAt`. + _i14.Uint8List contractsToBillAtMapPrefix() { + final hashedKey = _contractsToBillAt.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `contractLock`. + _i14.Uint8List contractLockMapPrefix() { + final hashedKey = _contractLock.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `contractIDByNameRegistration`. + _i14.Uint8List contractIDByNameRegistrationMapPrefix() { + final hashedKey = _contractIDByNameRegistration.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `activeRentContractForNode`. + _i14.Uint8List activeRentContractForNodeMapPrefix() { + final hashedKey = _activeRentContractForNode.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `solutionProviders`. + _i14.Uint8List solutionProvidersMapPrefix() { + final hashedKey = _solutionProviders.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `serviceContracts`. + _i14.Uint8List serviceContractsMapPrefix() { + final hashedKey = _serviceContracts.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `dedicatedNodesExtraFee`. + _i14.Uint8List dedicatedNodesExtraFeeMapPrefix() { + final hashedKey = _dedicatedNodesExtraFee.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `contractPaymentState`. + _i14.Uint8List contractPaymentStateMapPrefix() { + final hashedKey = _contractPaymentState.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - _i13.RuntimeCall createNodeContract({ - required nodeId, - required deploymentHash, - required deploymentData, - required publicIps, - solutionProviderId, + /// See [`Pallet::create_node_contract`]. + _i15.SmartContractModule createNodeContract({ + required int nodeId, + required List deploymentHash, + required List deploymentData, + required int publicIps, + BigInt? solutionProviderId, }) { - final _call = _i14.Call.values.createNodeContract( + return _i15.SmartContractModule(_i16.CreateNodeContract( nodeId: nodeId, deploymentHash: deploymentHash, deploymentData: deploymentData, publicIps: publicIps, solutionProviderId: solutionProviderId, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall updateNodeContract({ - required contractId, - required deploymentHash, - required deploymentData, + /// See [`Pallet::update_node_contract`]. + _i15.SmartContractModule updateNodeContract({ + required BigInt contractId, + required List deploymentHash, + required List deploymentData, }) { - final _call = _i14.Call.values.updateNodeContract( + return _i15.SmartContractModule(_i16.UpdateNodeContract( contractId: contractId, deploymentHash: deploymentHash, deploymentData: deploymentData, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall cancelContract({required contractId}) { - final _call = _i14.Call.values.cancelContract(contractId: contractId); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::cancel_contract`]. + _i15.SmartContractModule cancelContract({required BigInt contractId}) { + return _i15.SmartContractModule( + _i16.CancelContract(contractId: contractId)); } - _i13.RuntimeCall createNameContract({required name}) { - final _call = _i14.Call.values.createNameContract(name: name); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::create_name_contract`]. + _i15.SmartContractModule createNameContract({required List name}) { + return _i15.SmartContractModule(_i16.CreateNameContract(name: name)); } - _i13.RuntimeCall addNruReports({required reports}) { - final _call = _i14.Call.values.addNruReports(reports: reports); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::add_nru_reports`]. + _i15.SmartContractModule addNruReports( + {required List<_i17.NruConsumption> reports}) { + return _i15.SmartContractModule(_i16.AddNruReports(reports: reports)); } - _i13.RuntimeCall reportContractResources({required contractResources}) { - final _call = _i14.Call.values - .reportContractResources(contractResources: contractResources); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::report_contract_resources`]. + _i15.SmartContractModule reportContractResources( + {required List<_i5.ContractResources> contractResources}) { + return _i15.SmartContractModule( + _i16.ReportContractResources(contractResources: contractResources)); } - _i13.RuntimeCall createRentContract({ - required nodeId, - solutionProviderId, + /// See [`Pallet::create_rent_contract`]. + _i15.SmartContractModule createRentContract({ + required int nodeId, + BigInt? solutionProviderId, }) { - final _call = _i14.Call.values.createRentContract( + return _i15.SmartContractModule(_i16.CreateRentContract( nodeId: nodeId, solutionProviderId: solutionProviderId, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall createSolutionProvider({ - required description, - required link, - required providers, + /// See [`Pallet::create_solution_provider`]. + _i15.SmartContractModule createSolutionProvider({ + required List description, + required List link, + required List<_i18.Provider> providers, }) { - final _call = _i14.Call.values.createSolutionProvider( + return _i15.SmartContractModule(_i16.CreateSolutionProvider( description: description, link: link, providers: providers, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall approveSolutionProvider({ - required solutionProviderId, - required approve, + /// See [`Pallet::approve_solution_provider`]. + _i15.SmartContractModule approveSolutionProvider({ + required BigInt solutionProviderId, + required bool approve, }) { - final _call = _i14.Call.values.approveSolutionProvider( + return _i15.SmartContractModule(_i16.ApproveSolutionProvider( solutionProviderId: solutionProviderId, approve: approve, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall billContractForBlock({required contractId}) { - final _call = _i14.Call.values.billContractForBlock(contractId: contractId); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::bill_contract_for_block`]. + _i15.SmartContractModule billContractForBlock({required BigInt contractId}) { + return _i15.SmartContractModule( + _i16.BillContractForBlock(contractId: contractId)); } - _i13.RuntimeCall serviceContractCreate({ - required serviceAccount, - required consumerAccount, + /// See [`Pallet::service_contract_create`]. + _i15.SmartContractModule serviceContractCreate({ + required _i19.AccountId32 serviceAccount, + required _i19.AccountId32 consumerAccount, }) { - final _call = _i14.Call.values.serviceContractCreate( + return _i15.SmartContractModule(_i16.ServiceContractCreate( serviceAccount: serviceAccount, consumerAccount: consumerAccount, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall serviceContractSetMetadata({ - required serviceContractId, - required metadata, + /// See [`Pallet::service_contract_set_metadata`]. + _i15.SmartContractModule serviceContractSetMetadata({ + required BigInt serviceContractId, + required List metadata, }) { - final _call = _i14.Call.values.serviceContractSetMetadata( + return _i15.SmartContractModule(_i16.ServiceContractSetMetadata( serviceContractId: serviceContractId, metadata: metadata, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall serviceContractSetFees({ - required serviceContractId, - required baseFee, - required variableFee, + /// See [`Pallet::service_contract_set_fees`]. + _i15.SmartContractModule serviceContractSetFees({ + required BigInt serviceContractId, + required BigInt baseFee, + required BigInt variableFee, }) { - final _call = _i14.Call.values.serviceContractSetFees( + return _i15.SmartContractModule(_i16.ServiceContractSetFees( serviceContractId: serviceContractId, baseFee: baseFee, variableFee: variableFee, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall serviceContractApprove({required serviceContractId}) { - final _call = _i14.Call.values - .serviceContractApprove(serviceContractId: serviceContractId); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::service_contract_approve`]. + _i15.SmartContractModule serviceContractApprove( + {required BigInt serviceContractId}) { + return _i15.SmartContractModule( + _i16.ServiceContractApprove(serviceContractId: serviceContractId)); } - _i13.RuntimeCall serviceContractReject({required serviceContractId}) { - final _call = _i14.Call.values - .serviceContractReject(serviceContractId: serviceContractId); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::service_contract_reject`]. + _i15.SmartContractModule serviceContractReject( + {required BigInt serviceContractId}) { + return _i15.SmartContractModule( + _i16.ServiceContractReject(serviceContractId: serviceContractId)); } - _i13.RuntimeCall serviceContractCancel({required serviceContractId}) { - final _call = _i14.Call.values - .serviceContractCancel(serviceContractId: serviceContractId); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::service_contract_cancel`]. + _i15.SmartContractModule serviceContractCancel( + {required BigInt serviceContractId}) { + return _i15.SmartContractModule( + _i16.ServiceContractCancel(serviceContractId: serviceContractId)); } - _i13.RuntimeCall serviceContractBill({ - required serviceContractId, - required variableAmount, - required metadata, + /// See [`Pallet::service_contract_bill`]. + _i15.SmartContractModule serviceContractBill({ + required BigInt serviceContractId, + required BigInt variableAmount, + required List metadata, }) { - final _call = _i14.Call.values.serviceContractBill( + return _i15.SmartContractModule(_i16.ServiceContractBill( serviceContractId: serviceContractId, variableAmount: variableAmount, metadata: metadata, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall changeBillingFrequency({required frequency}) { - final _call = _i14.Call.values.changeBillingFrequency(frequency: frequency); - return _i13.RuntimeCall.values.smartContractModule(_call); + /// See [`Pallet::change_billing_frequency`]. + _i15.SmartContractModule changeBillingFrequency({required BigInt frequency}) { + return _i15.SmartContractModule( + _i16.ChangeBillingFrequency(frequency: frequency)); } - _i13.RuntimeCall attachSolutionProviderId({ - required contractId, - required solutionProviderId, + /// See [`Pallet::attach_solution_provider_id`]. + _i15.SmartContractModule attachSolutionProviderId({ + required BigInt contractId, + required BigInt solutionProviderId, }) { - final _call = _i14.Call.values.attachSolutionProviderId( + return _i15.SmartContractModule(_i16.AttachSolutionProviderId( contractId: contractId, solutionProviderId: solutionProviderId, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); } - _i13.RuntimeCall setDedicatedNodeExtraFee({ - required nodeId, - required extraFee, + /// See [`Pallet::set_dedicated_node_extra_fee`]. + _i15.SmartContractModule setDedicatedNodeExtraFee({ + required int nodeId, + required BigInt extraFee, }) { - final _call = _i14.Call.values.setDedicatedNodeExtraFee( + return _i15.SmartContractModule(_i16.SetDedicatedNodeExtraFee( nodeId: nodeId, extraFee: extraFee, - ); - return _i13.RuntimeCall.values.smartContractModule(_call); + )); + } + + /// See [`Pallet::cancel_contract_collective`]. + _i15.SmartContractModule cancelContractCollective( + {required BigInt contractId}) { + return _i15.SmartContractModule( + _i16.CancelContractCollective(contractId: contractId)); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/system.dart b/packages/tfchain_client/lib/generated/dev/pallets/system.dart index c886d321..7b08fe99 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/system.dart +++ b/packages/tfchain_client/lib/generated/dev/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 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i4; import '../types/frame_support/dispatch/per_dispatch_class_1.dart' as _i5; -import '../types/frame_support/dispatch/per_dispatch_class_2.dart' as _i18; -import '../types/frame_support/dispatch/per_dispatch_class_3.dart' as _i21; +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/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 _i20; -import '../types/frame_system/limits/block_weights.dart' as _i17; -import '../types/frame_system/limits/weights_per_class.dart' as _i19; -import '../types/frame_system/pallet/call.dart' as _i16; +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 _i17; import '../types/frame_system/phase.dart' as _i11; import '../types/pallet_balances/types/account_data.dart' as _i13; 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 _i23; -import '../types/sp_weights/runtime_db_weight.dart' as _i22; +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 _i14; -import '../types/tfchain_runtime/runtime_call.dart' as _i15; -import '../types/tuples.dart' as _i24; +import '../types/tfchain_runtime/runtime_call.dart' as _i16; +import '../types/tuples.dart' as _i18; import '../types/tuples_1.dart' as _i9; class Queries { @@ -351,7 +352,7 @@ class Queries { /// allows light-clients to leverage the changes trie storage tracking mechanism and /// in case of changes fetch the list of events of interest. /// - /// The value has the type `(T::BlockNumber, EventIndex)` because if we used only just + /// 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( @@ -422,75 +423,176 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `account`. + _i15.Uint8List accountKey(_i2.AccountId32 key1) { + final hashedKey = _account.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `extrinsicCount`. + _i15.Uint8List extrinsicCountKey() { + final hashedKey = _extrinsicCount.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `blockWeight`. + _i15.Uint8List blockWeightKey() { + final hashedKey = _blockWeight.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `allExtrinsicsLen`. + _i15.Uint8List allExtrinsicsLenKey() { + final hashedKey = _allExtrinsicsLen.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `blockHash`. + _i15.Uint8List blockHashKey(int key1) { + final hashedKey = _blockHash.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `extrinsicData`. + _i15.Uint8List extrinsicDataKey(int key1) { + final hashedKey = _extrinsicData.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `number`. + _i15.Uint8List numberKey() { + final hashedKey = _number.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `parentHash`. + _i15.Uint8List parentHashKey() { + final hashedKey = _parentHash.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `digest`. + _i15.Uint8List digestKey() { + final hashedKey = _digest.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `events`. + _i15.Uint8List eventsKey() { + final hashedKey = _events.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `eventCount`. + _i15.Uint8List eventCountKey() { + final hashedKey = _eventCount.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `eventTopics`. + _i15.Uint8List eventTopicsKey(_i6.H256 key1) { + final hashedKey = _eventTopics.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `lastRuntimeUpgrade`. + _i15.Uint8List lastRuntimeUpgradeKey() { + final hashedKey = _lastRuntimeUpgrade.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `upgradedToU32RefCount`. + _i15.Uint8List upgradedToU32RefCountKey() { + final hashedKey = _upgradedToU32RefCount.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `upgradedToTripleRefCount`. + _i15.Uint8List upgradedToTripleRefCountKey() { + final hashedKey = _upgradedToTripleRefCount.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `executionPhase`. + _i15.Uint8List executionPhaseKey() { + final hashedKey = _executionPhase.hashedKey(); + return hashedKey; + } + + /// Returns the storage map key prefix for `account`. + _i15.Uint8List accountMapPrefix() { + final hashedKey = _account.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `blockHash`. + _i15.Uint8List blockHashMapPrefix() { + final hashedKey = _blockHash.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `extrinsicData`. + _i15.Uint8List extrinsicDataMapPrefix() { + final hashedKey = _extrinsicData.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `eventTopics`. + _i15.Uint8List eventTopicsMapPrefix() { + final hashedKey = _eventTopics.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - /// Make some on-chain remark. - /// - /// ## Complexity - /// - `O(1)` - _i15.RuntimeCall remark({required remark}) { - final _call = _i16.Call.values.remark(remark: remark); - return _i15.RuntimeCall.values.system(_call); + /// See [`Pallet::remark`]. + _i16.System remark({required List remark}) { + return _i16.System(_i17.Remark(remark: remark)); } - /// Set the number of pages in the WebAssembly environment's heap. - _i15.RuntimeCall setHeapPages({required pages}) { - final _call = _i16.Call.values.setHeapPages(pages: pages); - return _i15.RuntimeCall.values.system(_call); + /// See [`Pallet::set_heap_pages`]. + _i16.System setHeapPages({required BigInt pages}) { + return _i16.System(_i17.SetHeapPages(pages: pages)); } - /// Set the new runtime code. - /// - /// ## Complexity - /// - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code` - _i15.RuntimeCall setCode({required code}) { - final _call = _i16.Call.values.setCode(code: code); - return _i15.RuntimeCall.values.system(_call); + /// See [`Pallet::set_code`]. + _i16.System setCode({required List code}) { + return _i16.System(_i17.SetCode(code: code)); } - /// Set the new runtime code without doing any checks of the given `code`. - /// - /// ## Complexity - /// - `O(C)` where `C` length of `code` - _i15.RuntimeCall setCodeWithoutChecks({required code}) { - final _call = _i16.Call.values.setCodeWithoutChecks(code: code); - return _i15.RuntimeCall.values.system(_call); + /// See [`Pallet::set_code_without_checks`]. + _i16.System setCodeWithoutChecks({required List code}) { + return _i16.System(_i17.SetCodeWithoutChecks(code: code)); } - /// Set some items of storage. - _i15.RuntimeCall setStorage({required items}) { - final _call = _i16.Call.values.setStorage(items: items); - return _i15.RuntimeCall.values.system(_call); + /// See [`Pallet::set_storage`]. + _i16.System setStorage( + {required List<_i18.Tuple2, List>> items}) { + return _i16.System(_i17.SetStorage(items: items)); } - /// Kill some items from storage. - _i15.RuntimeCall killStorage({required keys}) { - final _call = _i16.Call.values.killStorage(keys: keys); - return _i15.RuntimeCall.values.system(_call); + /// See [`Pallet::kill_storage`]. + _i16.System killStorage({required List> keys}) { + return _i16.System(_i17.KillStorage(keys: keys)); } - /// Kill all storage items with a key that starts with the given prefix. - /// - /// **NOTE:** We rely on the Root origin to provide us the number of subkeys under - /// the prefix we are removing to accurately calculate the weight of this function. - _i15.RuntimeCall killPrefix({ - required prefix, - required subkeys, + /// See [`Pallet::kill_prefix`]. + _i16.System killPrefix({ + required List prefix, + required int subkeys, }) { - final _call = _i16.Call.values.killPrefix( + return _i16.System(_i17.KillPrefix( prefix: prefix, subkeys: subkeys, - ); - return _i15.RuntimeCall.values.system(_call); + )); } - /// Make some on-chain remark and emit event. - _i15.RuntimeCall remarkWithEvent({required remark}) { - final _call = _i16.Call.values.remarkWithEvent(remark: remark); - return _i15.RuntimeCall.values.system(_call); + /// See [`Pallet::remark_with_event`]. + _i16.System remarkWithEvent({required List remark}) { + return _i16.System(_i17.RemarkWithEvent(remark: remark)); } } @@ -498,9 +600,9 @@ class Constants { Constants(); /// Block & extrinsics weights: base values and limits. - final _i17.BlockWeights blockWeights = _i17.BlockWeights( + final _i19.BlockWeights blockWeights = _i19.BlockWeights( baseBlock: _i14.Weight( - refTime: BigInt.from(392184000), + refTime: BigInt.from(390584000), proofSize: BigInt.zero, ), maxBlock: _i14.Weight( @@ -510,14 +612,14 @@ class Constants { radix: 10, ), ), - perClass: _i18.PerDispatchClass( - normal: _i19.WeightsPerClass( + perClass: _i20.PerDispatchClass( + normal: _i21.WeightsPerClass( baseExtrinsic: _i14.Weight( - refTime: BigInt.from(113638000), + refTime: BigInt.from(124414000), proofSize: BigInt.zero, ), maxExtrinsic: _i14.Weight( - refTime: BigInt.from(1299886362000), + refTime: BigInt.from(1299875586000), proofSize: BigInt.parse( '11990383647911208550', radix: 10, @@ -535,13 +637,13 @@ class Constants { proofSize: BigInt.zero, ), ), - operational: _i19.WeightsPerClass( + operational: _i21.WeightsPerClass( baseExtrinsic: _i14.Weight( - refTime: BigInt.from(113638000), + refTime: BigInt.from(124414000), proofSize: BigInt.zero, ), maxExtrinsic: _i14.Weight( - refTime: BigInt.from(1799886362000), + refTime: BigInt.from(1799875586000), proofSize: BigInt.parse( '16602069666338596454', radix: 10, @@ -562,9 +664,9 @@ class Constants { ), ), ), - mandatory: _i19.WeightsPerClass( + mandatory: _i21.WeightsPerClass( baseExtrinsic: _i14.Weight( - refTime: BigInt.from(113638000), + refTime: BigInt.from(124414000), proofSize: BigInt.zero, ), maxExtrinsic: null, @@ -575,8 +677,8 @@ class Constants { ); /// The maximum length of a block (in bytes). - final _i20.BlockLength blockLength = const _i20.BlockLength( - max: _i21.PerDispatchClass( + final _i22.BlockLength blockLength = const _i22.BlockLength( + max: _i23.PerDispatchClass( normal: 3932160, operational: 5242880, mandatory: 5242880, @@ -586,20 +688,20 @@ class Constants { final int blockHashCount = 2400; /// The weight of runtime database operations the runtime can invoke. - final _i22.RuntimeDbWeight dbWeight = _i22.RuntimeDbWeight( + final _i24.RuntimeDbWeight dbWeight = _i24.RuntimeDbWeight( read: BigInt.from(25000000), write: BigInt.from(100000000), ); /// Get the chain's current version. - final _i23.RuntimeVersion version = const _i23.RuntimeVersion( + final _i25.RuntimeVersion version = const _i25.RuntimeVersion( specName: 'substrate-threefold', implName: 'substrate-threefold', authoringVersion: 1, - specVersion: 146, + specVersion: 153, implVersion: 1, apis: [ - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 223, 106, @@ -612,7 +714,7 @@ class Constants { ], 4, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 55, 227, @@ -625,7 +727,7 @@ class Constants { ], 2, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 64, 254, @@ -638,7 +740,7 @@ class Constants { ], 6, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 210, 188, @@ -651,7 +753,7 @@ class Constants { ], 3, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 247, 139, @@ -664,7 +766,7 @@ class Constants { ], 2, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 221, 113, @@ -677,7 +779,7 @@ class Constants { ], 1, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 171, 60, @@ -690,7 +792,7 @@ class Constants { ], 1, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 237, 153, @@ -703,7 +805,7 @@ class Constants { ], 3, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 188, 157, @@ -716,7 +818,7 @@ class Constants { ], 1, ), - _i24.Tuple2, int>( + _i18.Tuple2, int>( [ 55, 200, diff --git a/packages/tfchain_client/lib/generated/dev/pallets/t_f_k_v_store.dart b/packages/tfchain_client/lib/generated/dev/pallets/t_f_k_v_store.dart index 6125e4b0..df851ae0 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/t_f_k_v_store.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/t_f_k_v_store.dart @@ -1,12 +1,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/pallet_kvstore/pallet/call.dart' as _i6; +import '../types/pallet_kvstore/pallet/call.dart' as _i7; import '../types/sp_core/crypto/account_id32.dart' as _i2; -import '../types/tfchain_runtime/runtime_call.dart' as _i5; +import '../types/tfchain_runtime/runtime_call.dart' as _i6; class Queries { const Queries(this.__api); @@ -44,27 +45,42 @@ class Queries { growable: true, ); /* Default */ } + + /// Returns the storage key for `tFKVStore`. + _i5.Uint8List tFKVStoreKey( + _i2.AccountId32 key1, + List key2, + ) { + final hashedKey = _tFKVStore.hashedKeyFor( + key1, + key2, + ); + return hashedKey; + } + + /// Returns the storage map key prefix for `tFKVStore`. + _i5.Uint8List tFKVStoreMapPrefix(_i2.AccountId32 key1) { + final hashedKey = _tFKVStore.mapPrefix(key1); + return hashedKey; + } } class Txs { const Txs(); - /// Set the value stored at a particular key - _i5.RuntimeCall set({ - required key, - required value, + /// See [`Pallet::set`]. + _i6.TFKVStore set({ + required List key, + required List value, }) { - final _call = _i6.Call.values.set( + return _i6.TFKVStore(_i7.Set( key: key, value: value, - ); - return _i5.RuntimeCall.values.tFKVStore(_call); + )); } - /// Read the value stored at a particular key, while removing it from the map. - /// Also emit the read value in an event - _i5.RuntimeCall delete({required key}) { - final _call = _i6.Call.values.delete(key: key); - return _i5.RuntimeCall.values.tFKVStore(_call); + /// See [`Pallet::delete`]. + _i6.TFKVStore delete({required List key}) { + return _i6.TFKVStore(_i7.Delete(key: key)); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/t_f_t_bridge_module.dart b/packages/tfchain_client/lib/generated/dev/pallets/t_f_t_bridge_module.dart index 34718511..1a4c4cd0 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/t_f_t_bridge_module.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/t_f_t_bridge_module.dart @@ -1,15 +1,17 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i7; +import 'dart:async' as _i8; +import 'dart:typed_data' as _i9; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/pallet_tft_bridge/pallet/call.dart' as _i9; +import '../types/pallet_tft_bridge/pallet/call.dart' as _i11; import '../types/pallet_tft_bridge/types/burn_transaction.dart' as _i5; import '../types/pallet_tft_bridge/types/mint_transaction.dart' as _i4; import '../types/pallet_tft_bridge/types/refund_transaction.dart' as _i6; +import '../types/pallet_tft_bridge/types/storage_version.dart' as _i7; import '../types/sp_core/crypto/account_id32.dart' as _i2; -import '../types/tfchain_runtime/runtime_call.dart' as _i8; +import '../types/tfchain_runtime/runtime_call.dart' as _i10; class Queries { const Queries(this.__api); @@ -99,7 +101,14 @@ class Queries { valueCodec: _i3.U64Codec.codec, ); - _i7.Future> validators({_i1.BlockHash? at}) async { + final _i1.StorageValue<_i7.StorageVersion> _palletVersion = + const _i1.StorageValue<_i7.StorageVersion>( + prefix: 'TFTBridgeModule', + storage: 'PalletVersion', + valueCodec: _i7.StorageVersion.codec, + ); + + _i8.Future> validators({_i1.BlockHash? at}) async { final hashedKey = _validators.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -111,7 +120,7 @@ class Queries { return []; /* Default */ } - _i7.Future<_i2.AccountId32?> feeAccount({_i1.BlockHash? at}) async { + _i8.Future<_i2.AccountId32?> feeAccount({_i1.BlockHash? at}) async { final hashedKey = _feeAccount.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -123,7 +132,7 @@ class Queries { return null; /* Nullable */ } - _i7.Future<_i4.MintTransaction?> mintTransactions( + _i8.Future<_i4.MintTransaction?> mintTransactions( List key1, { _i1.BlockHash? at, }) async { @@ -138,7 +147,7 @@ class Queries { return null; /* Nullable */ } - _i7.Future<_i4.MintTransaction?> executedMintTransactions( + _i8.Future<_i4.MintTransaction?> executedMintTransactions( List key1, { _i1.BlockHash? at, }) async { @@ -153,7 +162,7 @@ class Queries { return null; /* Nullable */ } - _i7.Future<_i5.BurnTransaction> burnTransactions( + _i8.Future<_i5.BurnTransaction?> burnTransactions( BigInt key1, { _i1.BlockHash? at, }) async { @@ -165,20 +174,10 @@ class Queries { if (bytes != null) { return _burnTransactions.decodeValue(bytes); } - return _i5.BurnTransaction( - block: 0, - amount: BigInt.zero, - target: List.filled( - 0, - 0, - growable: true, - ), - signatures: [], - sequenceNumber: BigInt.zero, - ); /* Default */ + return null; /* Nullable */ } - _i7.Future<_i5.BurnTransaction> executedBurnTransactions( + _i8.Future<_i5.BurnTransaction?> executedBurnTransactions( BigInt key1, { _i1.BlockHash? at, }) async { @@ -190,20 +189,10 @@ class Queries { if (bytes != null) { return _executedBurnTransactions.decodeValue(bytes); } - return _i5.BurnTransaction( - block: 0, - amount: BigInt.zero, - target: List.filled( - 0, - 0, - growable: true, - ), - signatures: [], - sequenceNumber: BigInt.zero, - ); /* Default */ + return null; /* Nullable */ } - _i7.Future<_i6.RefundTransaction> refundTransactions( + _i8.Future<_i6.RefundTransaction> refundTransactions( List key1, { _i1.BlockHash? at, }) async { @@ -233,7 +222,7 @@ class Queries { ); /* Default */ } - _i7.Future<_i6.RefundTransaction> executedRefundTransactions( + _i8.Future<_i6.RefundTransaction> executedRefundTransactions( List key1, { _i1.BlockHash? at, }) async { @@ -263,7 +252,7 @@ class Queries { ); /* Default */ } - _i7.Future burnTransactionID({_i1.BlockHash? at}) async { + _i8.Future burnTransactionID({_i1.BlockHash? at}) async { final hashedKey = _burnTransactionID.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -275,7 +264,7 @@ class Queries { return BigInt.zero; /* Default */ } - _i7.Future withdrawFee({_i1.BlockHash? at}) async { + _i8.Future withdrawFee({_i1.BlockHash? at}) async { final hashedKey = _withdrawFee.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -287,7 +276,7 @@ class Queries { return BigInt.zero; /* Default */ } - _i7.Future depositFee({_i1.BlockHash? at}) async { + _i8.Future depositFee({_i1.BlockHash? at}) async { final hashedKey = _depositFee.hashedKey(); final bytes = await __api.getStorage( hashedKey, @@ -298,106 +287,230 @@ class Queries { } return BigInt.zero; /* Default */ } + + _i8.Future<_i7.StorageVersion> palletVersion({_i1.BlockHash? at}) async { + final hashedKey = _palletVersion.hashedKey(); + final bytes = await __api.getStorage( + hashedKey, + at: at, + ); + if (bytes != null) { + return _palletVersion.decodeValue(bytes); + } + return _i7.StorageVersion.v1; /* Default */ + } + + /// Returns the storage key for `validators`. + _i9.Uint8List validatorsKey() { + final hashedKey = _validators.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `feeAccount`. + _i9.Uint8List feeAccountKey() { + final hashedKey = _feeAccount.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `mintTransactions`. + _i9.Uint8List mintTransactionsKey(List key1) { + final hashedKey = _mintTransactions.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `executedMintTransactions`. + _i9.Uint8List executedMintTransactionsKey(List key1) { + final hashedKey = _executedMintTransactions.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `burnTransactions`. + _i9.Uint8List burnTransactionsKey(BigInt key1) { + final hashedKey = _burnTransactions.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `executedBurnTransactions`. + _i9.Uint8List executedBurnTransactionsKey(BigInt key1) { + final hashedKey = _executedBurnTransactions.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `refundTransactions`. + _i9.Uint8List refundTransactionsKey(List key1) { + final hashedKey = _refundTransactions.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `executedRefundTransactions`. + _i9.Uint8List executedRefundTransactionsKey(List key1) { + final hashedKey = _executedRefundTransactions.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `burnTransactionID`. + _i9.Uint8List burnTransactionIDKey() { + final hashedKey = _burnTransactionID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `withdrawFee`. + _i9.Uint8List withdrawFeeKey() { + final hashedKey = _withdrawFee.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `depositFee`. + _i9.Uint8List depositFeeKey() { + final hashedKey = _depositFee.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `palletVersion`. + _i9.Uint8List palletVersionKey() { + final hashedKey = _palletVersion.hashedKey(); + return hashedKey; + } + + /// Returns the storage map key prefix for `mintTransactions`. + _i9.Uint8List mintTransactionsMapPrefix() { + final hashedKey = _mintTransactions.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `executedMintTransactions`. + _i9.Uint8List executedMintTransactionsMapPrefix() { + final hashedKey = _executedMintTransactions.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `burnTransactions`. + _i9.Uint8List burnTransactionsMapPrefix() { + final hashedKey = _burnTransactions.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `executedBurnTransactions`. + _i9.Uint8List executedBurnTransactionsMapPrefix() { + final hashedKey = _executedBurnTransactions.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `refundTransactions`. + _i9.Uint8List refundTransactionsMapPrefix() { + final hashedKey = _refundTransactions.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `executedRefundTransactions`. + _i9.Uint8List executedRefundTransactionsMapPrefix() { + final hashedKey = _executedRefundTransactions.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - _i8.RuntimeCall addBridgeValidator({required target}) { - final _call = _i9.Call.values.addBridgeValidator(target: target); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + /// See [`Pallet::add_bridge_validator`]. + _i10.TFTBridgeModule addBridgeValidator({required _i2.AccountId32 target}) { + return _i10.TFTBridgeModule(_i11.AddBridgeValidator(target: target)); } - _i8.RuntimeCall removeBridgeValidator({required target}) { - final _call = _i9.Call.values.removeBridgeValidator(target: target); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + /// See [`Pallet::remove_bridge_validator`]. + _i10.TFTBridgeModule removeBridgeValidator( + {required _i2.AccountId32 target}) { + return _i10.TFTBridgeModule(_i11.RemoveBridgeValidator(target: target)); } - _i8.RuntimeCall setFeeAccount({required target}) { - final _call = _i9.Call.values.setFeeAccount(target: target); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + /// See [`Pallet::set_fee_account`]. + _i10.TFTBridgeModule setFeeAccount({required _i2.AccountId32 target}) { + return _i10.TFTBridgeModule(_i11.SetFeeAccount(target: target)); } - _i8.RuntimeCall setWithdrawFee({required amount}) { - final _call = _i9.Call.values.setWithdrawFee(amount: amount); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + /// See [`Pallet::set_withdraw_fee`]. + _i10.TFTBridgeModule setWithdrawFee({required BigInt amount}) { + return _i10.TFTBridgeModule(_i11.SetWithdrawFee(amount: amount)); } - _i8.RuntimeCall setDepositFee({required amount}) { - final _call = _i9.Call.values.setDepositFee(amount: amount); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + /// See [`Pallet::set_deposit_fee`]. + _i10.TFTBridgeModule setDepositFee({required BigInt amount}) { + return _i10.TFTBridgeModule(_i11.SetDepositFee(amount: amount)); } - _i8.RuntimeCall swapToStellar({ - required targetStellarAddress, - required amount, + /// See [`Pallet::swap_to_stellar`]. + _i10.TFTBridgeModule swapToStellar({ + required List targetStellarAddress, + required BigInt amount, }) { - final _call = _i9.Call.values.swapToStellar( + return _i10.TFTBridgeModule(_i11.SwapToStellar( targetStellarAddress: targetStellarAddress, amount: amount, - ); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + )); } - _i8.RuntimeCall proposeOrVoteMintTransaction({ - required transaction, - required target, - required amount, + /// See [`Pallet::propose_or_vote_mint_transaction`]. + _i10.TFTBridgeModule proposeOrVoteMintTransaction({ + required List transaction, + required _i2.AccountId32 target, + required BigInt amount, }) { - final _call = _i9.Call.values.proposeOrVoteMintTransaction( + return _i10.TFTBridgeModule(_i11.ProposeOrVoteMintTransaction( transaction: transaction, target: target, amount: amount, - ); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + )); } - _i8.RuntimeCall proposeBurnTransactionOrAddSig({ - required transactionId, - required target, - required amount, - required signature, - required stellarPubKey, - required sequenceNumber, + /// See [`Pallet::propose_burn_transaction_or_add_sig`]. + _i10.TFTBridgeModule proposeBurnTransactionOrAddSig({ + required BigInt transactionId, + required List target, + required BigInt amount, + required List signature, + required List stellarPubKey, + required BigInt sequenceNumber, }) { - final _call = _i9.Call.values.proposeBurnTransactionOrAddSig( + return _i10.TFTBridgeModule(_i11.ProposeBurnTransactionOrAddSig( transactionId: transactionId, target: target, amount: amount, signature: signature, stellarPubKey: stellarPubKey, sequenceNumber: sequenceNumber, - ); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + )); } - _i8.RuntimeCall setBurnTransactionExecuted({required transactionId}) { - final _call = _i9.Call.values - .setBurnTransactionExecuted(transactionId: transactionId); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + /// See [`Pallet::set_burn_transaction_executed`]. + _i10.TFTBridgeModule setBurnTransactionExecuted( + {required BigInt transactionId}) { + return _i10.TFTBridgeModule( + _i11.SetBurnTransactionExecuted(transactionId: transactionId)); } - _i8.RuntimeCall createRefundTransactionOrAddSig({ - required txHash, - required target, - required amount, - required signature, - required stellarPubKey, - required sequenceNumber, + /// See [`Pallet::create_refund_transaction_or_add_sig`]. + _i10.TFTBridgeModule createRefundTransactionOrAddSig({ + required List txHash, + required List target, + required BigInt amount, + required List signature, + required List stellarPubKey, + required BigInt sequenceNumber, }) { - final _call = _i9.Call.values.createRefundTransactionOrAddSig( + return _i10.TFTBridgeModule(_i11.CreateRefundTransactionOrAddSig( txHash: txHash, target: target, amount: amount, signature: signature, stellarPubKey: stellarPubKey, sequenceNumber: sequenceNumber, - ); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + )); } - _i8.RuntimeCall setRefundTransactionExecuted({required txHash}) { - final _call = _i9.Call.values.setRefundTransactionExecuted(txHash: txHash); - return _i8.RuntimeCall.values.tFTBridgeModule(_call); + /// See [`Pallet::set_refund_transaction_executed`]. + _i10.TFTBridgeModule setRefundTransactionExecuted( + {required List txHash}) { + return _i10.TFTBridgeModule( + _i11.SetRefundTransactionExecuted(txHash: txHash)); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/t_f_t_price_module.dart b/packages/tfchain_client/lib/generated/dev/pallets/t_f_t_price_module.dart index d75a5464..daf4b5b2 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/t_f_t_price_module.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/t_f_t_price_module.dart @@ -1,11 +1,12 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i2; -import '../types/pallet_tft_price/pallet/call.dart' as _i6; -import '../types/tfchain_runtime/runtime_call.dart' as _i5; +import '../types/pallet_tft_price/pallet/call.dart' as _i7; +import '../types/tfchain_runtime/runtime_call.dart' as _i6; import '../types/tuples.dart' as _i3; class Queries { @@ -150,29 +151,77 @@ class Queries { } return 0; /* Default */ } + + /// Returns the storage key for `tftPrice`. + _i5.Uint8List tftPriceKey() { + final hashedKey = _tftPrice.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `lastBlockSet`. + _i5.Uint8List lastBlockSetKey() { + final hashedKey = _lastBlockSet.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `averageTftPrice`. + _i5.Uint8List averageTftPriceKey() { + final hashedKey = _averageTftPrice.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `tftPriceHistory`. + _i5.Uint8List tftPriceHistoryKey(int key1) { + final hashedKey = _tftPriceHistory.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `bufferRange`. + _i5.Uint8List bufferRangeKey() { + final hashedKey = _bufferRange.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `minTftPrice`. + _i5.Uint8List minTftPriceKey() { + final hashedKey = _minTftPrice.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `maxTftPrice`. + _i5.Uint8List maxTftPriceKey() { + final hashedKey = _maxTftPrice.hashedKey(); + return hashedKey; + } + + /// Returns the storage map key prefix for `tftPriceHistory`. + _i5.Uint8List tftPriceHistoryMapPrefix() { + final hashedKey = _tftPriceHistory.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - _i5.RuntimeCall setPrices({ - required price, - required blockNumber, + /// See [`Pallet::set_prices`]. + _i6.TFTPriceModule setPrices({ + required int price, + required int blockNumber, }) { - final _call = _i6.Call.values.setPrices( + return _i6.TFTPriceModule(_i7.SetPrices( price: price, blockNumber: blockNumber, - ); - return _i5.RuntimeCall.values.tFTPriceModule(_call); + )); } - _i5.RuntimeCall setMinTftPrice({required price}) { - final _call = _i6.Call.values.setMinTftPrice(price: price); - return _i5.RuntimeCall.values.tFTPriceModule(_call); + /// See [`Pallet::set_min_tft_price`]. + _i6.TFTPriceModule setMinTftPrice({required int price}) { + return _i6.TFTPriceModule(_i7.SetMinTftPrice(price: price)); } - _i5.RuntimeCall setMaxTftPrice({required price}) { - final _call = _i6.Call.values.setMaxTftPrice(price: price); - return _i5.RuntimeCall.values.tFTPriceModule(_call); + /// See [`Pallet::set_max_tft_price`]. + _i6.TFTPriceModule setMaxTftPrice({required int price}) { + return _i6.TFTPriceModule(_i7.SetMaxTftPrice(price: price)); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/tfgrid_module.dart b/packages/tfchain_client/lib/generated/dev/pallets/tfgrid_module.dart index 8c74d9a9..a85745e7 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/tfgrid_module.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/tfgrid_module.dart @@ -1,25 +1,33 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i13; +import 'dart:typed_data' as _i18; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; -import '../types/pallet_tfgrid/pallet/call.dart' as _i19; +import '../types/pallet_tfgrid/pallet/call.dart' as _i20; import '../types/pallet_tfgrid/terms_cond/terms_and_conditions.dart' as _i10; import '../types/pallet_tfgrid/types/entity.dart' as _i5; import '../types/pallet_tfgrid/types/farming_policy.dart' as _i9; +import '../types/pallet_tfgrid/types/location_input.dart' as _i23; +import '../types/pallet_tfgrid/types/policy.dart' as _i26; import '../types/pallet_tfgrid/types/pricing_policy.dart' as _i8; import '../types/pallet_tfgrid/types/storage_version.dart' as _i11; import '../types/pallet_tfgrid/types/twin.dart' as _i7; import '../types/sp_core/crypto/account_id32.dart' as _i6; -import '../types/tfchain_runtime/runtime_call.dart' as _i18; +import '../types/tfchain_runtime/runtime_call.dart' as _i19; +import '../types/tfchain_support/resources/resources.dart' as _i22; import '../types/tfchain_support/types/farm.dart' as _i2; import '../types/tfchain_support/types/farm_certification.dart' as _i15; +import '../types/tfchain_support/types/farming_policy_limit.dart' as _i27; +import '../types/tfchain_support/types/interface_2.dart' as _i24; +import '../types/tfchain_support/types/ip4.dart' as _i21; import '../types/tfchain_support/types/node.dart' as _i4; import '../types/tfchain_support/types/node_certification.dart' as _i14; import '../types/tfchain_support/types/node_power.dart' as _i12; import '../types/tfchain_support/types/power.dart' as _i17; import '../types/tfchain_support/types/power_state.dart' as _i16; +import '../types/tfchain_support/types/public_config.dart' as _i25; class Queries { const Queries(this.__api); @@ -636,94 +644,359 @@ class Queries { target: _i17.Power.up, ); /* Default */ } + + /// Returns the storage key for `farms`. + _i18.Uint8List farmsKey(int key1) { + final hashedKey = _farms.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `nodesByFarmID`. + _i18.Uint8List nodesByFarmIDKey(int key1) { + final hashedKey = _nodesByFarmID.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `farmIdByName`. + _i18.Uint8List farmIdByNameKey(List key1) { + final hashedKey = _farmIdByName.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `farmPayoutV2AddressByFarmID`. + _i18.Uint8List farmPayoutV2AddressByFarmIDKey(int key1) { + final hashedKey = _farmPayoutV2AddressByFarmID.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `nodes`. + _i18.Uint8List nodesKey(int key1) { + final hashedKey = _nodes.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `nodeIdByTwinID`. + _i18.Uint8List nodeIdByTwinIDKey(int key1) { + final hashedKey = _nodeIdByTwinID.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `entities`. + _i18.Uint8List entitiesKey(int key1) { + final hashedKey = _entities.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `entityIdByAccountID`. + _i18.Uint8List entityIdByAccountIDKey(_i6.AccountId32 key1) { + final hashedKey = _entityIdByAccountID.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `entityIdByName`. + _i18.Uint8List entityIdByNameKey(List key1) { + final hashedKey = _entityIdByName.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `twins`. + _i18.Uint8List twinsKey(int key1) { + final hashedKey = _twins.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `twinIdByAccountID`. + _i18.Uint8List twinIdByAccountIDKey(_i6.AccountId32 key1) { + final hashedKey = _twinIdByAccountID.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `twinBoundedAccountID`. + _i18.Uint8List twinBoundedAccountIDKey(int key1) { + final hashedKey = _twinBoundedAccountID.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `pricingPolicies`. + _i18.Uint8List pricingPoliciesKey(int key1) { + final hashedKey = _pricingPolicies.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `pricingPolicyIdByName`. + _i18.Uint8List pricingPolicyIdByNameKey(List key1) { + final hashedKey = _pricingPolicyIdByName.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `farmingPoliciesMap`. + _i18.Uint8List farmingPoliciesMapKey(int key1) { + final hashedKey = _farmingPoliciesMap.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `usersTermsAndConditions`. + _i18.Uint8List usersTermsAndConditionsKey(_i6.AccountId32 key1) { + final hashedKey = _usersTermsAndConditions.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `allowedNodeCertifiers`. + _i18.Uint8List allowedNodeCertifiersKey() { + final hashedKey = _allowedNodeCertifiers.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `connectionPrice`. + _i18.Uint8List connectionPriceKey() { + final hashedKey = _connectionPrice.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `farmID`. + _i18.Uint8List farmIDKey() { + final hashedKey = _farmID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `nodeID`. + _i18.Uint8List nodeIDKey() { + final hashedKey = _nodeID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `entityID`. + _i18.Uint8List entityIDKey() { + final hashedKey = _entityID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `twinID`. + _i18.Uint8List twinIDKey() { + final hashedKey = _twinID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `pricingPolicyID`. + _i18.Uint8List pricingPolicyIDKey() { + final hashedKey = _pricingPolicyID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `farmingPolicyID`. + _i18.Uint8List farmingPolicyIDKey() { + final hashedKey = _farmingPolicyID.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `palletVersion`. + _i18.Uint8List palletVersionKey() { + final hashedKey = _palletVersion.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `zosVersion`. + _i18.Uint8List zosVersionKey() { + final hashedKey = _zosVersion.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `nodePower`. + _i18.Uint8List nodePowerKey(int key1) { + final hashedKey = _nodePower.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `farms`. + _i18.Uint8List farmsMapPrefix() { + final hashedKey = _farms.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `nodesByFarmID`. + _i18.Uint8List nodesByFarmIDMapPrefix() { + final hashedKey = _nodesByFarmID.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `farmIdByName`. + _i18.Uint8List farmIdByNameMapPrefix() { + final hashedKey = _farmIdByName.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `farmPayoutV2AddressByFarmID`. + _i18.Uint8List farmPayoutV2AddressByFarmIDMapPrefix() { + final hashedKey = _farmPayoutV2AddressByFarmID.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `nodes`. + _i18.Uint8List nodesMapPrefix() { + final hashedKey = _nodes.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `nodeIdByTwinID`. + _i18.Uint8List nodeIdByTwinIDMapPrefix() { + final hashedKey = _nodeIdByTwinID.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `entities`. + _i18.Uint8List entitiesMapPrefix() { + final hashedKey = _entities.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `entityIdByAccountID`. + _i18.Uint8List entityIdByAccountIDMapPrefix() { + final hashedKey = _entityIdByAccountID.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `entityIdByName`. + _i18.Uint8List entityIdByNameMapPrefix() { + final hashedKey = _entityIdByName.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `twins`. + _i18.Uint8List twinsMapPrefix() { + final hashedKey = _twins.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `twinIdByAccountID`. + _i18.Uint8List twinIdByAccountIDMapPrefix() { + final hashedKey = _twinIdByAccountID.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `twinBoundedAccountID`. + _i18.Uint8List twinBoundedAccountIDMapPrefix() { + final hashedKey = _twinBoundedAccountID.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `pricingPolicies`. + _i18.Uint8List pricingPoliciesMapPrefix() { + final hashedKey = _pricingPolicies.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `pricingPolicyIdByName`. + _i18.Uint8List pricingPolicyIdByNameMapPrefix() { + final hashedKey = _pricingPolicyIdByName.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `farmingPoliciesMap`. + _i18.Uint8List farmingPoliciesMapMapPrefix() { + final hashedKey = _farmingPoliciesMap.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `usersTermsAndConditions`. + _i18.Uint8List usersTermsAndConditionsMapPrefix() { + final hashedKey = _usersTermsAndConditions.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `nodePower`. + _i18.Uint8List nodePowerMapPrefix() { + final hashedKey = _nodePower.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - _i18.RuntimeCall setStorageVersion({required version}) { - final _call = _i19.Call.values.setStorageVersion(version: version); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::set_storage_version`]. + _i19.TfgridModule setStorageVersion({required _i11.StorageVersion version}) { + return _i19.TfgridModule(_i20.SetStorageVersion(version: version)); } - _i18.RuntimeCall createFarm({ - required name, - required publicIps, + /// See [`Pallet::create_farm`]. + _i19.TfgridModule createFarm({ + required List name, + required List<_i21.Ip4> publicIps, }) { - final _call = _i19.Call.values.createFarm( + return _i19.TfgridModule(_i20.CreateFarm( name: name, publicIps: publicIps, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall updateFarm({ - required farmId, - required name, + /// See [`Pallet::update_farm`]. + _i19.TfgridModule updateFarm({ + required int farmId, + required List name, }) { - final _call = _i19.Call.values.updateFarm( + return _i19.TfgridModule(_i20.UpdateFarm( farmId: farmId, name: name, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall addStellarPayoutV2address({ - required farmId, - required stellarAddress, + /// See [`Pallet::add_stellar_payout_v2address`]. + _i19.TfgridModule addStellarPayoutV2address({ + required int farmId, + required List stellarAddress, }) { - final _call = _i19.Call.values.addStellarPayoutV2address( + return _i19.TfgridModule(_i20.AddStellarPayoutV2address( farmId: farmId, stellarAddress: stellarAddress, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall setFarmCertification({ - required farmId, - required certification, + /// See [`Pallet::set_farm_certification`]. + _i19.TfgridModule setFarmCertification({ + required int farmId, + required _i15.FarmCertification certification, }) { - final _call = _i19.Call.values.setFarmCertification( + return _i19.TfgridModule(_i20.SetFarmCertification( farmId: farmId, certification: certification, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall addFarmIp({ - required farmId, - required ip, - required gw, + /// See [`Pallet::add_farm_ip`]. + _i19.TfgridModule addFarmIp({ + required int farmId, + required List ip, + required List gw, }) { - final _call = _i19.Call.values.addFarmIp( + return _i19.TfgridModule(_i20.AddFarmIp( farmId: farmId, ip: ip, gw: gw, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall removeFarmIp({ - required farmId, - required ip, + /// See [`Pallet::remove_farm_ip`]. + _i19.TfgridModule removeFarmIp({ + required int farmId, + required List ip, }) { - final _call = _i19.Call.values.removeFarmIp( + return _i19.TfgridModule(_i20.RemoveFarmIp( farmId: farmId, ip: ip, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); - } - - _i18.RuntimeCall createNode({ - required farmId, - required resources, - required location, - required interfaces, - required secureBoot, - required virtualized, - serialNumber, + )); + } + + /// See [`Pallet::create_node`]. + _i19.TfgridModule createNode({ + required int farmId, + required _i22.Resources resources, + required _i23.LocationInput location, + required List<_i24.Interface> interfaces, + required bool secureBoot, + required bool virtualized, + List? serialNumber, }) { - final _call = _i19.Call.values.createNode( + return _i19.TfgridModule(_i20.CreateNode( farmId: farmId, resources: resources, location: location, @@ -731,21 +1004,21 @@ class Txs { secureBoot: secureBoot, virtualized: virtualized, serialNumber: serialNumber, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); - } - - _i18.RuntimeCall updateNode({ - required nodeId, - required farmId, - required resources, - required location, - required interfaces, - required secureBoot, - required virtualized, - serialNumber, + )); + } + + /// See [`Pallet::update_node`]. + _i19.TfgridModule updateNode({ + required int nodeId, + required int farmId, + required _i22.Resources resources, + required _i23.LocationInput location, + required List<_i24.Interface> interfaces, + required bool secureBoot, + required bool virtualized, + List? serialNumber, }) { - final _call = _i19.Call.values.updateNode( + return _i19.TfgridModule(_i20.UpdateNode( nodeId: nodeId, farmId: farmId, resources: resources, @@ -754,138 +1027,138 @@ class Txs { secureBoot: secureBoot, virtualized: virtualized, serialNumber: serialNumber, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall setNodeCertification({ - required nodeId, - required nodeCertification, + /// See [`Pallet::set_node_certification`]. + _i19.TfgridModule setNodeCertification({ + required int nodeId, + required _i14.NodeCertification nodeCertification, }) { - final _call = _i19.Call.values.setNodeCertification( + return _i19.TfgridModule(_i20.SetNodeCertification( nodeId: nodeId, nodeCertification: nodeCertification, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall reportUptime({required uptime}) { - final _call = _i19.Call.values.reportUptime(uptime: uptime); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::report_uptime`]. + _i19.TfgridModule reportUptime({required BigInt uptime}) { + return _i19.TfgridModule(_i20.ReportUptime(uptime: uptime)); } - _i18.RuntimeCall addNodePublicConfig({ - required farmId, - required nodeId, - publicConfig, + /// See [`Pallet::add_node_public_config`]. + _i19.TfgridModule addNodePublicConfig({ + required int farmId, + required int nodeId, + _i25.PublicConfig? publicConfig, }) { - final _call = _i19.Call.values.addNodePublicConfig( + return _i19.TfgridModule(_i20.AddNodePublicConfig( farmId: farmId, nodeId: nodeId, publicConfig: publicConfig, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall deleteNode({required nodeId}) { - final _call = _i19.Call.values.deleteNode(nodeId: nodeId); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::delete_node`]. + _i19.TfgridModule deleteNode({required int nodeId}) { + return _i19.TfgridModule(_i20.DeleteNode(nodeId: nodeId)); } - _i18.RuntimeCall createEntity({ - required target, - required name, - required country, - required city, - required signature, + /// See [`Pallet::create_entity`]. + _i19.TfgridModule createEntity({ + required _i6.AccountId32 target, + required List name, + required List country, + required List city, + required List signature, }) { - final _call = _i19.Call.values.createEntity( + return _i19.TfgridModule(_i20.CreateEntity( target: target, name: name, country: country, city: city, signature: signature, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall updateEntity({ - required name, - required country, - required city, + /// See [`Pallet::update_entity`]. + _i19.TfgridModule updateEntity({ + required List name, + required List country, + required List city, }) { - final _call = _i19.Call.values.updateEntity( + return _i19.TfgridModule(_i20.UpdateEntity( name: name, country: country, city: city, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall deleteEntity() { - final _call = _i19.Call.values.deleteEntity(); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::delete_entity`]. + _i19.TfgridModule deleteEntity() { + return _i19.TfgridModule(_i20.DeleteEntity()); } - _i18.RuntimeCall createTwin({ - relay, - pk, + /// See [`Pallet::create_twin`]. + _i19.TfgridModule createTwin({ + List? relay, + List? pk, }) { - final _call = _i19.Call.values.createTwin( + return _i19.TfgridModule(_i20.CreateTwin( relay: relay, pk: pk, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall updateTwin({ - relay, - pk, + /// See [`Pallet::update_twin`]. + _i19.TfgridModule updateTwin({ + List? relay, + List? pk, }) { - final _call = _i19.Call.values.updateTwin( + return _i19.TfgridModule(_i20.UpdateTwin( relay: relay, pk: pk, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall addTwinEntity({ - required twinId, - required entityId, - required signature, + /// See [`Pallet::add_twin_entity`]. + _i19.TfgridModule addTwinEntity({ + required int twinId, + required int entityId, + required List signature, }) { - final _call = _i19.Call.values.addTwinEntity( + return _i19.TfgridModule(_i20.AddTwinEntity( twinId: twinId, entityId: entityId, signature: signature, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall deleteTwinEntity({ - required twinId, - required entityId, + /// See [`Pallet::delete_twin_entity`]. + _i19.TfgridModule deleteTwinEntity({ + required int twinId, + required int entityId, }) { - final _call = _i19.Call.values.deleteTwinEntity( + return _i19.TfgridModule(_i20.DeleteTwinEntity( twinId: twinId, entityId: entityId, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); - } - - _i18.RuntimeCall createPricingPolicy({ - required name, - required su, - required cu, - required nu, - required ipu, - required uniqueName, - required domainName, - required foundationAccount, - required certifiedSalesAccount, - required discountForDedicationNodes, + )); + } + + /// See [`Pallet::create_pricing_policy`]. + _i19.TfgridModule createPricingPolicy({ + required List name, + required _i26.Policy su, + required _i26.Policy cu, + required _i26.Policy nu, + required _i26.Policy ipu, + required _i26.Policy uniqueName, + required _i26.Policy domainName, + required _i6.AccountId32 foundationAccount, + required _i6.AccountId32 certifiedSalesAccount, + required int discountForDedicationNodes, }) { - final _call = _i19.Call.values.createPricingPolicy( + return _i19.TfgridModule(_i20.CreatePricingPolicy( name: name, su: su, cu: cu, @@ -896,24 +1169,24 @@ class Txs { foundationAccount: foundationAccount, certifiedSalesAccount: certifiedSalesAccount, discountForDedicationNodes: discountForDedicationNodes, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); - } - - _i18.RuntimeCall updatePricingPolicy({ - required pricingPolicyId, - required name, - required su, - required cu, - required nu, - required ipu, - required uniqueName, - required domainName, - required foundationAccount, - required certifiedSalesAccount, - required discountForDedicationNodes, + )); + } + + /// See [`Pallet::update_pricing_policy`]. + _i19.TfgridModule updatePricingPolicy({ + required int pricingPolicyId, + required List name, + required _i26.Policy su, + required _i26.Policy cu, + required _i26.Policy nu, + required _i26.Policy ipu, + required _i26.Policy uniqueName, + required _i26.Policy domainName, + required _i6.AccountId32 foundationAccount, + required _i6.AccountId32 certifiedSalesAccount, + required int discountForDedicationNodes, }) { - final _call = _i19.Call.values.updatePricingPolicy( + return _i19.TfgridModule(_i20.UpdatePricingPolicy( pricingPolicyId: pricingPolicyId, name: name, su: su, @@ -925,24 +1198,24 @@ class Txs { foundationAccount: foundationAccount, certifiedSalesAccount: certifiedSalesAccount, discountForDedicationNodes: discountForDedicationNodes, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); - } - - _i18.RuntimeCall createFarmingPolicy({ - required name, - required su, - required cu, - required nu, - required ipv4, - required minimalUptime, - required policyEnd, - required immutable, - required default_, - required nodeCertification, - required farmCertification, + )); + } + + /// See [`Pallet::create_farming_policy`]. + _i19.TfgridModule createFarmingPolicy({ + required List name, + required int su, + required int cu, + required int nu, + required int ipv4, + required int minimalUptime, + required int policyEnd, + required bool immutable, + required bool default_, + required _i14.NodeCertification nodeCertification, + required _i15.FarmCertification farmCertification, }) { - final _call = _i19.Call.values.createFarmingPolicy( + return _i19.TfgridModule(_i20.CreateFarmingPolicy( name: name, su: su, cu: cu, @@ -954,77 +1227,77 @@ class Txs { default_: default_, nodeCertification: nodeCertification, farmCertification: farmCertification, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall userAcceptTc({ - required documentLink, - required documentHash, + /// See [`Pallet::user_accept_tc`]. + _i19.TfgridModule userAcceptTc({ + required List documentLink, + required List documentHash, }) { - final _call = _i19.Call.values.userAcceptTc( + return _i19.TfgridModule(_i20.UserAcceptTc( documentLink: documentLink, documentHash: documentHash, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall deleteNodeFarm({required nodeId}) { - final _call = _i19.Call.values.deleteNodeFarm(nodeId: nodeId); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::delete_node_farm`]. + _i19.TfgridModule deleteNodeFarm({required int nodeId}) { + return _i19.TfgridModule(_i20.DeleteNodeFarm(nodeId: nodeId)); } - _i18.RuntimeCall setFarmDedicated({ - required farmId, - required dedicated, + /// See [`Pallet::set_farm_dedicated`]. + _i19.TfgridModule setFarmDedicated({ + required int farmId, + required bool dedicated, }) { - final _call = _i19.Call.values.setFarmDedicated( + return _i19.TfgridModule(_i20.SetFarmDedicated( farmId: farmId, dedicated: dedicated, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall forceResetFarmIp({ - required farmId, - required ip, + /// See [`Pallet::force_reset_farm_ip`]. + _i19.TfgridModule forceResetFarmIp({ + required int farmId, + required List ip, }) { - final _call = _i19.Call.values.forceResetFarmIp( + return _i19.TfgridModule(_i20.ForceResetFarmIp( farmId: farmId, ip: ip, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall setConnectionPrice({required price}) { - final _call = _i19.Call.values.setConnectionPrice(price: price); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::set_connection_price`]. + _i19.TfgridModule setConnectionPrice({required int price}) { + return _i19.TfgridModule(_i20.SetConnectionPrice(price: price)); } - _i18.RuntimeCall addNodeCertifier({required certifier}) { - final _call = _i19.Call.values.addNodeCertifier(certifier: certifier); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::add_node_certifier`]. + _i19.TfgridModule addNodeCertifier({required _i6.AccountId32 certifier}) { + return _i19.TfgridModule(_i20.AddNodeCertifier(certifier: certifier)); } - _i18.RuntimeCall removeNodeCertifier({required certifier}) { - final _call = _i19.Call.values.removeNodeCertifier(certifier: certifier); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::remove_node_certifier`]. + _i19.TfgridModule removeNodeCertifier({required _i6.AccountId32 certifier}) { + return _i19.TfgridModule(_i20.RemoveNodeCertifier(certifier: certifier)); } - _i18.RuntimeCall updateFarmingPolicy({ - required farmingPolicyId, - required name, - required su, - required cu, - required nu, - required ipv4, - required minimalUptime, - required policyEnd, - required default_, - required nodeCertification, - required farmCertification, + /// See [`Pallet::update_farming_policy`]. + _i19.TfgridModule updateFarmingPolicy({ + required int farmingPolicyId, + required List name, + required int su, + required int cu, + required int nu, + required int ipv4, + required int minimalUptime, + required int policyEnd, + required bool default_, + required _i14.NodeCertification nodeCertification, + required _i15.FarmCertification farmCertification, }) { - final _call = _i19.Call.values.updateFarmingPolicy( + return _i19.TfgridModule(_i20.UpdateFarmingPolicy( farmingPolicyId: farmingPolicyId, name: name, su: su, @@ -1036,56 +1309,55 @@ class Txs { default_: default_, nodeCertification: nodeCertification, farmCertification: farmCertification, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall attachPolicyToFarm({ - required farmId, - limits, + /// See [`Pallet::attach_policy_to_farm`]. + _i19.TfgridModule attachPolicyToFarm({ + required int farmId, + _i27.FarmingPolicyLimit? limits, }) { - final _call = _i19.Call.values.attachPolicyToFarm( + return _i19.TfgridModule(_i20.AttachPolicyToFarm( farmId: farmId, limits: limits, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall setZosVersion({required zosVersion}) { - final _call = _i19.Call.values.setZosVersion(zosVersion: zosVersion); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::set_zos_version`]. + _i19.TfgridModule setZosVersion({required List zosVersion}) { + return _i19.TfgridModule(_i20.SetZosVersion(zosVersion: zosVersion)); } - _i18.RuntimeCall changePowerState({required powerState}) { - final _call = _i19.Call.values.changePowerState(powerState: powerState); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::change_power_state`]. + _i19.TfgridModule changePowerState({required _i17.Power powerState}) { + return _i19.TfgridModule(_i20.ChangePowerState(powerState: powerState)); } - _i18.RuntimeCall changePowerTarget({ - required nodeId, - required powerTarget, + /// See [`Pallet::change_power_target`]. + _i19.TfgridModule changePowerTarget({ + required int nodeId, + required _i17.Power powerTarget, }) { - final _call = _i19.Call.values.changePowerTarget( + return _i19.TfgridModule(_i20.ChangePowerTarget( nodeId: nodeId, powerTarget: powerTarget, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } - _i18.RuntimeCall bondTwinAccount({required twinId}) { - final _call = _i19.Call.values.bondTwinAccount(twinId: twinId); - return _i18.RuntimeCall.values.tfgridModule(_call); + /// See [`Pallet::bond_twin_account`]. + _i19.TfgridModule bondTwinAccount({required int twinId}) { + return _i19.TfgridModule(_i20.BondTwinAccount(twinId: twinId)); } - _i18.RuntimeCall reportUptimeV2({ - required uptime, - required timestampHint, + /// See [`Pallet::report_uptime_v2`]. + _i19.TfgridModule reportUptimeV2({ + required BigInt uptime, + required BigInt timestampHint, }) { - final _call = _i19.Call.values.reportUptimeV2( + return _i19.TfgridModule(_i20.ReportUptimeV2( uptime: uptime, timestampHint: timestampHint, - ); - return _i18.RuntimeCall.values.tfgridModule(_call); + )); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/timestamp.dart b/packages/tfchain_client/lib/generated/dev/pallets/timestamp.dart index 549f8ca3..4f09b4f6 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/timestamp.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/timestamp.dart @@ -1,11 +1,12 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes 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 _i2; -import '../types/pallet_timestamp/pallet/call.dart' as _i5; -import '../types/tfchain_runtime/runtime_call.dart' as _i4; +import '../types/pallet_timestamp/pallet/call.dart' as _i6; +import '../types/tfchain_runtime/runtime_call.dart' as _i5; class Queries { const Queries(this.__api); @@ -49,29 +50,26 @@ class Queries { } return false; /* Default */ } + + /// Returns the storage key for `now`. + _i4.Uint8List nowKey() { + final hashedKey = _now.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `didUpdate`. + _i4.Uint8List didUpdateKey() { + final hashedKey = _didUpdate.hashedKey(); + return hashedKey; + } } class Txs { const Txs(); - /// Set the current time. - /// - /// This call should be invoked exactly once per block. It will panic at the finalization - /// phase, if this call hasn't been invoked by that time. - /// - /// The timestamp should be greater than the previous one by the amount specified by - /// `MinimumPeriod`. - /// - /// The dispatch origin for this call must be `Inherent`. - /// - /// ## Complexity - /// - `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`) - /// - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in - /// `on_finalize`) - /// - 1 event handler `on_timestamp_set`. Must be `O(1)`. - _i4.RuntimeCall set({required now}) { - final _call = _i5.Call.values.set(now: now); - return _i4.RuntimeCall.values.timestamp(_call); + /// See [`Pallet::set`]. + _i5.Timestamp set({required BigInt now}) { + return _i5.Timestamp(_i6.Set(now: now)); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/transaction_payment.dart b/packages/tfchain_client/lib/generated/dev/pallets/transaction_payment.dart index a8f98f8e..c3cda6bf 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/transaction_payment.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/transaction_payment.dart @@ -1,5 +1,6 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; @@ -51,6 +52,18 @@ class Queries { } return _i3.Releases.v1Ancient; /* Default */ } + + /// Returns the storage key for `nextFeeMultiplier`. + _i5.Uint8List nextFeeMultiplierKey() { + final hashedKey = _nextFeeMultiplier.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `storageVersion`. + _i5.Uint8List storageVersionKey() { + final hashedKey = _storageVersion.hashedKey(); + return hashedKey; + } } class Constants { diff --git a/packages/tfchain_client/lib/generated/dev/pallets/utility.dart b/packages/tfchain_client/lib/generated/dev/pallets/utility.dart index c1e4819c..680554ff 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/utility.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/utility.dart @@ -1,125 +1,58 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import '../types/pallet_utility/pallet/call.dart' as _i2; +import '../types/sp_weights/weight_v2/weight.dart' as _i4; +import '../types/tfchain_runtime/origin_caller.dart' as _i3; import '../types/tfchain_runtime/runtime_call.dart' as _i1; class Txs { const Txs(); - /// Send a batch of dispatch calls. - /// - /// May be called from any origin except `None`. - /// - /// - `calls`: The calls to be dispatched from the same origin. The number of call must not - /// exceed the constant: `batched_calls_limit` (available in constant metadata). - /// - /// If origin is root then the calls are dispatched without checking origin filter. (This - /// includes bypassing `frame_system::Config::BaseCallFilter`). - /// - /// ## Complexity - /// - O(C) where C is the number of calls to be batched. - /// - /// This will return `Ok` in all circumstances. To determine the success of the batch, an - /// event is deposited. If a call failed and the batch was interrupted, then the - /// `BatchInterrupted` event is deposited, along with the number of successful calls made - /// and the error of the failed call. If all were successful, then the `BatchCompleted` - /// event is deposited. - _i1.RuntimeCall batch({required calls}) { - final _call = _i2.Call.values.batch(calls: calls); - return _i1.RuntimeCall.values.utility(_call); + /// See [`Pallet::batch`]. + _i1.Utility batch({required List<_i1.RuntimeCall> calls}) { + return _i1.Utility(_i2.Batch(calls: calls)); } - /// Send a call through an indexed pseudonym of the sender. - /// - /// Filter from origin are passed along. The call will be dispatched with an origin which - /// use the same filter as the origin of this call. - /// - /// NOTE: If you need to ensure that any account-based filtering is not honored (i.e. - /// because you expect `proxy` to have been used prior in the call stack and you do not want - /// the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1` - /// in the Multisig pallet instead. - /// - /// NOTE: Prior to version *12, this was called `as_limited_sub`. - /// - /// The dispatch origin for this call must be _Signed_. - _i1.RuntimeCall asDerivative({ - required index, - required call, + /// See [`Pallet::as_derivative`]. + _i1.Utility asDerivative({ + required int index, + required _i1.RuntimeCall call, }) { - final _call = _i2.Call.values.asDerivative( + return _i1.Utility(_i2.AsDerivative( index: index, call: call, - ); - return _i1.RuntimeCall.values.utility(_call); + )); } - /// Send a batch of dispatch calls and atomically execute them. - /// The whole transaction will rollback and fail if any of the calls failed. - /// - /// May be called from any origin except `None`. - /// - /// - `calls`: The calls to be dispatched from the same origin. The number of call must not - /// exceed the constant: `batched_calls_limit` (available in constant metadata). - /// - /// If origin is root then the calls are dispatched without checking origin filter. (This - /// includes bypassing `frame_system::Config::BaseCallFilter`). - /// - /// ## Complexity - /// - O(C) where C is the number of calls to be batched. - _i1.RuntimeCall batchAll({required calls}) { - final _call = _i2.Call.values.batchAll(calls: calls); - return _i1.RuntimeCall.values.utility(_call); + /// See [`Pallet::batch_all`]. + _i1.Utility batchAll({required List<_i1.RuntimeCall> calls}) { + return _i1.Utility(_i2.BatchAll(calls: calls)); } - /// Dispatches a function call with a provided origin. - /// - /// The dispatch origin for this call must be _Root_. - /// - /// ## Complexity - /// - O(1). - _i1.RuntimeCall dispatchAs({ - required asOrigin, - required call, + /// See [`Pallet::dispatch_as`]. + _i1.Utility dispatchAs({ + required _i3.OriginCaller asOrigin, + required _i1.RuntimeCall call, }) { - final _call = _i2.Call.values.dispatchAs( + return _i1.Utility(_i2.DispatchAs( asOrigin: asOrigin, call: call, - ); - return _i1.RuntimeCall.values.utility(_call); + )); } - /// Send a batch of dispatch calls. - /// Unlike `batch`, it allows errors and won't interrupt. - /// - /// May be called from any origin except `None`. - /// - /// - `calls`: The calls to be dispatched from the same origin. The number of call must not - /// exceed the constant: `batched_calls_limit` (available in constant metadata). - /// - /// If origin is root then the calls are dispatch without checking origin filter. (This - /// includes bypassing `frame_system::Config::BaseCallFilter`). - /// - /// ## Complexity - /// - O(C) where C is the number of calls to be batched. - _i1.RuntimeCall forceBatch({required calls}) { - final _call = _i2.Call.values.forceBatch(calls: calls); - return _i1.RuntimeCall.values.utility(_call); + /// See [`Pallet::force_batch`]. + _i1.Utility forceBatch({required List<_i1.RuntimeCall> calls}) { + return _i1.Utility(_i2.ForceBatch(calls: calls)); } - /// Dispatch a function call with a specified weight. - /// - /// This function does not check the weight of the call, and instead allows the - /// Root origin to specify the weight of the call. - /// - /// The dispatch origin for this call must be _Root_. - _i1.RuntimeCall withWeight({ - required call, - required weight, + /// See [`Pallet::with_weight`]. + _i1.Utility withWeight({ + required _i1.RuntimeCall call, + required _i4.Weight weight, }) { - final _call = _i2.Call.values.withWeight( + return _i1.Utility(_i2.WithWeight( call: call, weight: weight, - ); - return _i1.RuntimeCall.values.utility(_call); + )); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/validator.dart b/packages/tfchain_client/lib/generated/dev/pallets/validator.dart index f761f5a6..96ee5d79 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/validator.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/validator.dart @@ -1,12 +1,14 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; -import '../types/pallet_validator/pallet/call.dart' as _i6; +import '../types/pallet_validator/pallet/call.dart' as _i7; import '../types/pallet_validator/types/validator.dart' as _i3; import '../types/sp_core/crypto/account_id32.dart' as _i2; -import '../types/tfchain_runtime/runtime_call.dart' as _i5; +import '../types/sp_runtime/multiaddress/multi_address.dart' as _i8; +import '../types/tfchain_runtime/runtime_call.dart' as _i6; class Queries { const Queries(this.__api); @@ -58,81 +60,78 @@ class Queries { } return null; /* Nullable */ } + + /// Returns the storage key for `validator`. + _i5.Uint8List validatorKey(_i2.AccountId32 key1) { + final hashedKey = _validator.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage key for `bonded`. + _i5.Uint8List bondedKey(_i2.AccountId32 key1) { + final hashedKey = _bonded.hashedKeyFor(key1); + return hashedKey; + } + + /// Returns the storage map key prefix for `validator`. + _i5.Uint8List validatorMapPrefix() { + final hashedKey = _validator.mapPrefix(); + return hashedKey; + } + + /// Returns the storage map key prefix for `bonded`. + _i5.Uint8List bondedMapPrefix() { + final hashedKey = _bonded.mapPrefix(); + return hashedKey; + } } class Txs { const Txs(); - /// Create a request to become a validator - /// Validator account (signer): the account of the validator (this account will be added to the council) - /// Validator node account: the account that will validate on consensus layer - /// Stash account: the "bank" account of the validator (where rewards should be sent to) the stash should be bonded to a validator - /// Description: why someone wants to become a validator - /// Tf Connect ID: the threefold connect ID of the person who wants to become a validator - /// Info: some public info about the validator (website link, blog link, ..) - /// A user can only have 1 validator request at a time - _i5.RuntimeCall createValidatorRequest({ - required validatorNodeAccount, - required stashAccount, - required description, - required tfConnectId, - required info, + /// See [`Pallet::create_validator_request`]. + _i6.Validator createValidatorRequest({ + required _i2.AccountId32 validatorNodeAccount, + required _i2.AccountId32 stashAccount, + required List description, + required List tfConnectId, + required List info, }) { - final _call = _i6.Call.values.createValidatorRequest( + return _i6.Validator(_i7.CreateValidatorRequest( validatorNodeAccount: validatorNodeAccount, stashAccount: stashAccount, description: description, tfConnectId: tfConnectId, info: info, - ); - return _i5.RuntimeCall.values.validator(_call); + )); } - /// Start participating in consensus - /// Will activate the Validator node account on consensus level - /// A user can only call this if his request to be a validator is approved by the council - /// Should be called when his node is synced and ready to start validating - _i5.RuntimeCall activateValidatorNode() { - final _call = _i6.Call.values.activateValidatorNode(); - return _i5.RuntimeCall.values.validator(_call); + /// See [`Pallet::activate_validator_node`]. + _i6.Validator activateValidatorNode() { + return _i6.Validator(_i7.ActivateValidatorNode()); } - /// Change validator node account - /// In case the Validator wishes to change his validator node account - /// he can call this method with the new node validator account - /// this new account will be added as a new consensus validator if he is validating already - _i5.RuntimeCall changeValidatorNodeAccount( - {required newNodeValidatorAccount}) { - final _call = _i6.Call.values.changeValidatorNodeAccount( - newNodeValidatorAccount: newNodeValidatorAccount); - return _i5.RuntimeCall.values.validator(_call); + /// See [`Pallet::change_validator_node_account`]. + _i6.Validator changeValidatorNodeAccount( + {required _i2.AccountId32 newNodeValidatorAccount}) { + return _i6.Validator(_i7.ChangeValidatorNodeAccount( + newNodeValidatorAccount: newNodeValidatorAccount)); } - /// Bond an account to a validator account - /// Just proves that the stash account is indeed under control of the validator account - _i5.RuntimeCall bond({required validator}) { - final _call = _i6.Call.values.bond(validator: validator); - return _i5.RuntimeCall.values.validator(_call); + /// See [`Pallet::bond`]. + _i6.Validator bond({required _i8.MultiAddress validator}) { + return _i6.Validator(_i7.Bond(validator: validator)); } - /// Approve validator (council) - /// Approves a validator to be added as a council member and - /// to participate in consensus - _i5.RuntimeCall approveValidator({required validatorAccount}) { - final _call = - _i6.Call.values.approveValidator(validatorAccount: validatorAccount); - return _i5.RuntimeCall.values.validator(_call); + /// See [`Pallet::approve_validator`]. + _i6.Validator approveValidator({required _i8.MultiAddress validatorAccount}) { + return _i6.Validator( + _i7.ApproveValidator(validatorAccount: validatorAccount)); } - /// Remove validator - /// Removes a validator from: - /// 1. Council - /// 2. Storage - /// 3. Consensus - /// Can only be called by the user or the council - _i5.RuntimeCall removeValidator({required validatorAccount}) { - final _call = - _i6.Call.values.removeValidator(validatorAccount: validatorAccount); - return _i5.RuntimeCall.values.validator(_call); + /// See [`Pallet::remove_validator`]. + _i6.Validator removeValidator({required _i8.MultiAddress validatorAccount}) { + return _i6.Validator( + _i7.RemoveValidator(validatorAccount: validatorAccount)); } } diff --git a/packages/tfchain_client/lib/generated/dev/pallets/validator_set.dart b/packages/tfchain_client/lib/generated/dev/pallets/validator_set.dart index 4022a24a..2800f656 100644 --- a/packages/tfchain_client/lib/generated/dev/pallets/validator_set.dart +++ b/packages/tfchain_client/lib/generated/dev/pallets/validator_set.dart @@ -1,12 +1,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:polkadart/polkadart.dart' as _i1; import 'package:polkadart/scale_codec.dart' as _i3; import '../types/sp_core/crypto/account_id32.dart' as _i2; -import '../types/substrate_validator_set/pallet/call.dart' as _i6; -import '../types/tfchain_runtime/runtime_call.dart' as _i5; +import '../types/substrate_validator_set/pallet/call.dart' as _i7; +import '../types/tfchain_runtime/runtime_call.dart' as _i6; class Queries { const Queries(this.__api); @@ -71,37 +72,41 @@ class Queries { } return []; /* Default */ } + + /// Returns the storage key for `validators`. + _i5.Uint8List validatorsKey() { + final hashedKey = _validators.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `approvedValidators`. + _i5.Uint8List approvedValidatorsKey() { + final hashedKey = _approvedValidators.hashedKey(); + return hashedKey; + } + + /// Returns the storage key for `offlineValidators`. + _i5.Uint8List offlineValidatorsKey() { + final hashedKey = _offlineValidators.hashedKey(); + return hashedKey; + } } class Txs { const Txs(); - /// Add a new validator. - /// - /// New validator's session keys should be set in Session pallet before - /// calling this. - /// - /// The origin can be configured using the `AddRemoveOrigin` type in the - /// host runtime. Can also be set to sudo/root. - _i5.RuntimeCall addValidator({required validatorId}) { - final _call = _i6.Call.values.addValidator(validatorId: validatorId); - return _i5.RuntimeCall.values.validatorSet(_call); + /// See [`Pallet::add_validator`]. + _i6.ValidatorSet addValidator({required _i2.AccountId32 validatorId}) { + return _i6.ValidatorSet(_i7.AddValidator(validatorId: validatorId)); } - /// Remove a validator. - /// - /// The origin can be configured using the `AddRemoveOrigin` type in the - /// host runtime. Can also be set to sudo/root. - _i5.RuntimeCall removeValidator({required validatorId}) { - final _call = _i6.Call.values.removeValidator(validatorId: validatorId); - return _i5.RuntimeCall.values.validatorSet(_call); + /// See [`Pallet::remove_validator`]. + _i6.ValidatorSet removeValidator({required _i2.AccountId32 validatorId}) { + return _i6.ValidatorSet(_i7.RemoveValidator(validatorId: validatorId)); } - /// Add an approved validator again when it comes back online. - /// - /// For this call, the dispatch origin must be the validator itself. - _i5.RuntimeCall addValidatorAgain({required validatorId}) { - final _call = _i6.Call.values.addValidatorAgain(validatorId: validatorId); - return _i5.RuntimeCall.values.validatorSet(_call); + /// See [`Pallet::add_validator_again`]. + _i6.ValidatorSet addValidatorAgain({required _i2.AccountId32 validatorId}) { + return _i6.ValidatorSet(_i7.AddValidatorAgain(validatorId: validatorId)); } } diff --git a/packages/tfchain_client/lib/generated/dev/types/frame_system/account_info.dart b/packages/tfchain_client/lib/generated/dev/types/frame_system/account_info.dart index 09b586e6..3faadbb0 100644 --- a/packages/tfchain_client/lib/generated/dev/types/frame_system/account_info.dart +++ b/packages/tfchain_client/lib/generated/dev/types/frame_system/account_info.dart @@ -18,7 +18,7 @@ class AccountInfo { return codec.decode(input); } - /// Index + /// Nonce final int nonce; /// RefCount diff --git a/packages/tfchain_client/lib/generated/dev/types/frame_system/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/frame_system/pallet/call.dart index 75bc023f..1598d0e7 100644 --- a/packages/tfchain_client/lib/generated/dev/types/frame_system/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/frame_system/pallet/call.dart @@ -6,7 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../tuples.dart' as _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -164,10 +164,7 @@ class $CallCodec with _i1.Codec { } } -/// Make some on-chain remark. -/// -/// ## Complexity -/// - `O(1)` +/// See [`Pallet::remark`]. class Remark extends Call { const Remark({required this.remark}); @@ -216,7 +213,7 @@ class Remark extends Call { int get hashCode => remark.hashCode; } -/// Set the number of pages in the WebAssembly environment's heap. +/// See [`Pallet::set_heap_pages`]. class SetHeapPages extends Call { const SetHeapPages({required this.pages}); @@ -261,10 +258,7 @@ class SetHeapPages extends Call { int get hashCode => pages.hashCode; } -/// Set the new runtime code. -/// -/// ## Complexity -/// - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code` +/// See [`Pallet::set_code`]. class SetCode extends Call { const SetCode({required this.code}); @@ -313,10 +307,7 @@ class SetCode extends Call { int get hashCode => code.hashCode; } -/// Set the new runtime code without doing any checks of the given `code`. -/// -/// ## Complexity -/// - `O(C)` where `C` length of `code` +/// See [`Pallet::set_code_without_checks`]. class SetCodeWithoutChecks extends Call { const SetCodeWithoutChecks({required this.code}); @@ -365,7 +356,7 @@ class SetCodeWithoutChecks extends Call { int get hashCode => code.hashCode; } -/// Set some items of storage. +/// See [`Pallet::set_storage`]. class SetStorage extends Call { const SetStorage({required this.items}); @@ -435,7 +426,7 @@ class SetStorage extends Call { int get hashCode => items.hashCode; } -/// Kill some items from storage. +/// See [`Pallet::kill_storage`]. class KillStorage extends Call { const KillStorage({required this.keys}); @@ -488,10 +479,7 @@ class KillStorage extends Call { int get hashCode => keys.hashCode; } -/// Kill all storage items with a key that starts with the given prefix. -/// -/// **NOTE:** We rely on the Root origin to provide us the number of subkeys under -/// the prefix we are removing to accurately calculate the weight of this function. +/// See [`Pallet::kill_prefix`]. class KillPrefix extends Call { const KillPrefix({ required this.prefix, @@ -561,7 +549,7 @@ class KillPrefix extends Call { ); } -/// Make some on-chain remark and emit event. +/// See [`Pallet::remark_with_event`]. class RemarkWithEvent extends Call { const RemarkWithEvent({required this.remark}); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/call.dart index 6682013e..68184446 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/call.dart @@ -7,7 +7,7 @@ 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 one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -221,13 +221,7 @@ class $CallCodec with _i1.Codec { } } -/// Transfer some liquid free balance to another account. -/// -/// `transfer_allow_death` will set the `FreeBalance` of the sender and receiver. -/// If the sender's account is below the existential deposit as a result -/// of the transfer, the account will be reaped. -/// -/// The dispatch origin for this call must be `Signed` by the transactor. +/// See [`Pallet::transfer_allow_death`]. class TransferAllowDeath extends Call { const TransferAllowDeath({ required this.dest, @@ -292,12 +286,7 @@ class TransferAllowDeath extends Call { ); } -/// Set the regular balance of a given account; it also takes a reserved balance but this -/// must be the same as the account's current reserved balance. -/// -/// The dispatch origin for this call is `root`. -/// -/// WARNING: This call is DEPRECATED! Use `force_set_balance` instead. +/// See [`Pallet::set_balance_deprecated`]. class SetBalanceDeprecated extends Call { const SetBalanceDeprecated({ required this.who, @@ -377,8 +366,7 @@ class SetBalanceDeprecated extends Call { ); } -/// Exactly as `transfer_allow_death`, except the origin must be root and the source account -/// may be specified. +/// See [`Pallet::force_transfer`]. class ForceTransfer extends Call { const ForceTransfer({ required this.source, @@ -458,12 +446,7 @@ class ForceTransfer extends Call { ); } -/// Same as the [`transfer_allow_death`] call, but with a check that the transfer will not -/// kill the origin account. -/// -/// 99% of the time you want [`transfer_allow_death`] instead. -/// -/// [`transfer_allow_death`]: struct.Pallet.html#method.transfer +/// See [`Pallet::transfer_keep_alive`]. class TransferKeepAlive extends Call { const TransferKeepAlive({ required this.dest, @@ -528,21 +511,7 @@ class TransferKeepAlive extends Call { ); } -/// Transfer the entire transferable balance from the caller account. -/// -/// NOTE: This function only attempts to transfer _transferable_ balances. This means that -/// any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be -/// transferred by this function. To ensure that this function results in a killed account, -/// you might need to prepare the account by removing any reference counters, storage -/// deposits, etc... -/// -/// The dispatch origin of this call must be Signed. -/// -/// - `dest`: The recipient of the transfer. -/// - `keep_alive`: A boolean to determine if the `transfer_all` operation should send all -/// of the funds the account has, causing the sender account to be killed (false), or -/// transfer everything except at least the existential deposit, which will guarantee to -/// keep the sender account alive (true). +/// See [`Pallet::transfer_all`]. class TransferAll extends Call { const TransferAll({ required this.dest, @@ -609,9 +578,7 @@ class TransferAll extends Call { ); } -/// Unreserve some balance from a user by force. -/// -/// Can only be called by ROOT. +/// See [`Pallet::force_unreserve`]. class ForceUnreserve extends Call { const ForceUnreserve({ required this.who, @@ -676,14 +643,7 @@ class ForceUnreserve extends Call { ); } -/// Upgrade a specified account. -/// -/// - `origin`: Must be `Signed`. -/// - `who`: The account to be upgraded. -/// -/// This will waive the transaction fee if at least all but 10% of the accounts needed to -/// be upgraded. (We let some not have to be upgraded just in order to allow for the -/// possibililty of churn). +/// See [`Pallet::upgrade_accounts`]. class UpgradeAccounts extends Call { const UpgradeAccounts({required this.who}); @@ -736,9 +696,7 @@ class UpgradeAccounts extends Call { int get hashCode => who.hashCode; } -/// Alias for `transfer_allow_death`, provided only for name-wise compatibility. -/// -/// WARNING: DEPRECATED! Will be released in approximately 3 months. +/// See [`Pallet::transfer`]. class Transfer extends Call { const Transfer({ required this.dest, @@ -803,9 +761,7 @@ class Transfer extends Call { ); } -/// Set the regular balance of a given account. -/// -/// The dispatch origin for this call is `root`. +/// See [`Pallet::force_set_balance`]. class ForceSetBalance extends Call { const ForceSetBalance({ required this.who, diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/error.dart index db4cd3c2..a0652eb5 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { /// Vesting balance too high to send value. vestingBalance('VestingBalance', 0), diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/event.dart index a6326fa7..65113915 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_balances/pallet/event.dart @@ -7,10 +7,7 @@ import 'package:quiver/collection.dart' as _i5; import '../../frame_support/traits/tokens/misc/balance_status.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/call.dart index ecd15c04..2341280c 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_burning/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 _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -84,6 +84,7 @@ class $CallCodec with _i1.Codec { } } +/// See [`Pallet::burn_tft`]. class BurnTft extends Call { const BurnTft({ required this.amount, diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/error.dart index 1511ed33..b64578d9 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { notEnoughBalanceToBurn('NotEnoughBalanceToBurn', 0); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/event.dart index 8a75c640..0b246ac1 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_burning/pallet/event.dart @@ -6,10 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); @@ -116,7 +113,7 @@ class BurnTransactionCreated extends Event { /// BalanceOf final BigInt value1; - /// T::BlockNumber + /// BlockNumberFor final int value2; /// Vec diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/call.dart index 4b4df6e9..7be0a8a7 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/call.dart @@ -9,7 +9,7 @@ import '../../sp_core/crypto/account_id32.dart' as _i3; import '../../sp_weights/weight_v2/weight.dart' as _i6; import '../../tfchain_runtime/runtime_call.dart' as _i4; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -178,30 +178,7 @@ class $CallCodec with _i1.Codec { } } -/// Set the collective's membership. -/// -/// - `new_members`: The new member list. Be nice to the chain and provide it sorted. -/// - `prime`: The prime member whose vote sets the default. -/// - `old_count`: The upper bound for the previous number of members in storage. Used for -/// weight estimation. -/// -/// The dispatch of this call must be `SetMembersOrigin`. -/// -/// NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but -/// the weight estimations rely on it to estimate dispatchable weight. -/// -/// # WARNING: -/// -/// The `pallet-collective` can also be managed by logic outside of the pallet through the -/// implementation of the trait [`ChangeMembers`]. -/// Any call to `set_members` must be careful that the member set doesn't get out of sync -/// with other logic managing the member set. -/// -/// ## Complexity: -/// - `O(MP + N)` where: -/// - `M` old-members-count (code- and governance-bounded) -/// - `N` new-members-count (code- and governance-bounded) -/// - `P` proposals-count (code-bounded) +/// See [`Pallet::set_members`]. class SetMembers extends Call { const SetMembers({ required this.newMembers, @@ -291,15 +268,7 @@ class SetMembers extends Call { ); } -/// Dispatch a proposal from a member using the `Member` origin. -/// -/// Origin must be a member of the collective. -/// -/// ## Complexity: -/// - `O(B + M + P)` where: -/// - `B` is `proposal` size in bytes (length-fee-bounded) -/// - `M` members-count (code-bounded) -/// - `P` complexity of dispatching `proposal` +/// See [`Pallet::execute`]. class Execute extends Call { const Execute({ required this.proposal, @@ -366,20 +335,7 @@ class Execute extends Call { ); } -/// Add a new proposal to either be voted on or executed directly. -/// -/// Requires the sender to be member. -/// -/// `threshold` determines whether `proposal` is executed directly (`threshold < 2`) -/// or put up for voting. -/// -/// ## Complexity -/// - `O(B + M + P1)` or `O(B + M + P2)` where: -/// - `B` is `proposal` size in bytes (length-fee-bounded) -/// - `M` is members-count (code- and governance-bounded) -/// - branching is influenced by `threshold` where: -/// - `P1` is proposal execution complexity (`threshold < 2`) -/// - `P2` is proposals-count (code-bounded) (`threshold >= 2`) +/// See [`Pallet::propose`]. class Propose extends Call { const Propose({ required this.threshold, @@ -459,15 +415,7 @@ class Propose extends Call { ); } -/// Add an aye or nay vote for the sender to the given proposal. -/// -/// Requires the sender to be a member. -/// -/// Transaction fees will be waived if the member is voting on any particular proposal -/// for the first time and the call is successful. Subsequent vote changes will charge a -/// fee. -/// ## Complexity -/// - `O(M)` where `M` is members-count (code- and governance-bounded) +/// See [`Pallet::vote`]. class Vote extends Call { const Vote({ required this.proposal, @@ -550,16 +498,7 @@ class Vote extends Call { ); } -/// Disapprove a proposal, close, and remove it from the system, regardless of its current -/// state. -/// -/// Must be called by the Root origin. -/// -/// Parameters: -/// * `proposal_hash`: The hash of the proposal that should be disapproved. -/// -/// ## Complexity -/// O(P) where P is the number of max proposals +/// See [`Pallet::disapprove_proposal`]. class DisapproveProposal extends Call { const DisapproveProposal({required this.proposalHash}); @@ -609,30 +548,7 @@ class DisapproveProposal extends Call { int get hashCode => proposalHash.hashCode; } -/// Close a vote that is either approved, disapproved or whose voting period has ended. -/// -/// May be called by any signed account in order to finish voting and close the proposal. -/// -/// If called before the end of the voting period it will only close the vote if it is -/// has enough votes to be approved or disapproved. -/// -/// If called after the end of the voting period abstentions are counted as rejections -/// unless there is a prime member set and the prime member cast an approval. -/// -/// If the close operation completes successfully with disapproval, the transaction fee will -/// be waived. Otherwise execution of the approved operation will be charged to the caller. -/// -/// + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed -/// proposal. -/// + `length_bound`: The upper bound for the length of the proposal in storage. Checked via -/// `storage::read` so it is `size_of::() == 4` larger than the pure length. -/// -/// ## Complexity -/// - `O(B + M + P1 + P2)` where: -/// - `B` is `proposal` size in bytes (length-fee-bounded) -/// - `M` is members-count (code- and governance-bounded) -/// - `P1` is the complexity of `proposal` preimage. -/// - `P2` is proposal-count (code-bounded) +/// See [`Pallet::close`]. class Close extends Call { const Close({ required this.proposalHash, diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/error.dart index 959ec645..85710684 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { /// Account is not a member notMember('NotMember', 0), @@ -36,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, @@ -86,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/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/event.dart index 9f1cd4d1..021d8d83 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_collective/pallet/event.dart @@ -8,10 +8,7 @@ import '../../primitive_types/h256.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; import '../../sp_runtime/dispatch_error.dart' as _i5; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/call.dart index 78dbb9da..618cbcbc 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/call.dart @@ -7,7 +7,7 @@ import 'package:quiver/collection.dart' as _i5; import '../../primitive_types/h256.dart' as _i4; import '../../tfchain_runtime/runtime_call.dart' as _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -140,6 +140,7 @@ class $CallCodec with _i1.Codec { } } +/// See [`Pallet::propose`]. class Propose extends Call { const Propose({ required this.threshold, @@ -171,7 +172,7 @@ class Propose extends Call { /// Vec final List link; - /// Option + /// Option> final int? duration; @override @@ -252,6 +253,7 @@ class Propose extends Call { ); } +/// See [`Pallet::vote`]. class Vote extends Call { const Vote({ required this.farmId, @@ -334,6 +336,7 @@ class Vote extends Call { ); } +/// See [`Pallet::veto`]. class Veto extends Call { const Veto({required this.proposalHash}); @@ -382,6 +385,7 @@ class Veto extends Call { int get hashCode => proposalHash.hashCode; } +/// See [`Pallet::close`]. class Close extends Call { const Close({ required this.proposalHash, diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/error.dart index a6e34350..322c32c2 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { noneValue('NoneValue', 0), storageOverflow('StorageOverflow', 1), @@ -24,7 +21,8 @@ enum Error { timeLimitReached('TimeLimitReached', 13), ongoingVoteAndTresholdStillNotMet('OngoingVoteAndTresholdStillNotMet', 14), farmHasNoNodes('FarmHasNoNodes', 15), - invalidProposalDuration('InvalidProposalDuration', 16); + invalidProposalDuration('InvalidProposalDuration', 16), + thresholdTooLow('ThresholdTooLow', 17); const Error( this.variantName, @@ -88,6 +86,8 @@ class $ErrorCodec with _i1.Codec { return Error.farmHasNoNodes; case 16: return Error.invalidProposalDuration; + case 17: + return Error.thresholdTooLow; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/event.dart index faa0bb20..a60471ec 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_dao/pallet/event.dart @@ -8,10 +8,7 @@ import '../../primitive_types/h256.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; import '../../sp_runtime/dispatch_error.dart' as _i5; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/call.dart index 77d0a495..0cca88db 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/call.dart @@ -6,7 +6,7 @@ import 'package:polkadart/scale_codec.dart' as _i1; import '../../sp_consensus_grandpa/equivocation_proof.dart' as _i3; import '../../sp_core/void.dart' as _i4; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -120,10 +120,7 @@ class $CallCodec with _i1.Codec { } } -/// Report voter equivocation/misbehavior. This method will verify the -/// equivocation proof and validate the given key ownership proof -/// against the extracted offender. If both are valid, the offence -/// will be reported. +/// See [`Pallet::report_equivocation`]. class ReportEquivocation extends Call { const ReportEquivocation({ required this.equivocationProof, @@ -137,7 +134,7 @@ class ReportEquivocation extends Call { ); } - /// Box> + /// Box>> final _i3.EquivocationProof equivocationProof; /// T::KeyOwnerProof @@ -190,15 +187,7 @@ class ReportEquivocation extends Call { ); } -/// Report voter equivocation/misbehavior. This method will verify the -/// equivocation proof and validate the given key ownership proof -/// against the extracted offender. If both are valid, the offence -/// will be reported. -/// -/// This extrinsic must be called unsigned and it is expected that only -/// block authors will call it (validated in `ValidateUnsigned`), as such -/// if the block author is defined it will be defined as the equivocation -/// reporter. +/// See [`Pallet::report_equivocation_unsigned`]. class ReportEquivocationUnsigned extends Call { const ReportEquivocationUnsigned({ required this.equivocationProof, @@ -212,7 +201,7 @@ class ReportEquivocationUnsigned extends Call { ); } - /// Box> + /// Box>> final _i3.EquivocationProof equivocationProof; /// T::KeyOwnerProof @@ -265,18 +254,7 @@ class ReportEquivocationUnsigned extends Call { ); } -/// Note that the current authority set of the GRANDPA finality gadget has stalled. -/// -/// This will trigger a forced authority set change at the beginning of the next session, to -/// be enacted `delay` blocks after that. The `delay` should be high enough to safely assume -/// that the block signalling the forced change will not be re-orged e.g. 1000 blocks. -/// The block production rate (which may be slowed down because of finality lagging) should -/// be taken into account when choosing the `delay`. The GRANDPA voters based on the new -/// authority will start voting on top of `best_finalized_block_number` for new finalized -/// blocks. `best_finalized_block_number` should be the highest of the latest finalized -/// block of all validators of the new authority set. -/// -/// Only callable by root. +/// See [`Pallet::note_stalled`]. class NoteStalled extends Call { const NoteStalled({ required this.delay, @@ -290,10 +268,10 @@ class NoteStalled extends Call { ); } - /// T::BlockNumber + /// BlockNumberFor final int delay; - /// T::BlockNumber + /// BlockNumberFor final int bestFinalizedBlockNumber; @override diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/error.dart index ce1c602c..8ace26ac 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { /// Attempt to signal GRANDPA pause when the authority set isn't live /// (either paused or already pending pause). diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/event.dart index 921787ed..acef6cc8 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_grandpa/pallet/event.dart @@ -7,10 +7,7 @@ import 'package:quiver/collection.dart' as _i5; import '../../sp_consensus_grandpa/app/public.dart' as _i4; import '../../tuples.dart' as _i3; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/call.dart index 00386271..b402008d 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/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 _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -95,7 +95,7 @@ class $CallCodec with _i1.Codec { } } -/// Set the value stored at a particular key +/// See [`Pallet::set`]. class Set extends Call { const Set({ required this.key, @@ -168,8 +168,7 @@ class Set extends Call { ); } -/// Read the value stored at a particular key, while removing it from the map. -/// Also emit the read value in an event +/// See [`Pallet::delete`]. class Delete extends Call { const Delete({required this.key}); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/error.dart index b1c79145..ffb89868 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { /// The requested user has not stored a value yet noValueStored('NoValueStored', 0), diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/event.dart index 868dd872..10e3e875 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_kvstore/pallet/event.dart @@ -6,10 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/call.dart index 4cbb4327..60398af7 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/call.dart @@ -7,7 +7,7 @@ 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 one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -153,9 +153,7 @@ class $CallCodec with _i1.Codec { } } -/// Add a member `who` to the set. -/// -/// May only be called from `T::AddOrigin`. +/// See [`Pallet::add_member`]. class AddMember extends Call { const AddMember({required this.who}); @@ -200,9 +198,7 @@ class AddMember extends Call { int get hashCode => who.hashCode; } -/// Remove a member `who` from the set. -/// -/// May only be called from `T::RemoveOrigin`. +/// See [`Pallet::remove_member`]. class RemoveMember extends Call { const RemoveMember({required this.who}); @@ -247,11 +243,7 @@ class RemoveMember extends Call { int get hashCode => who.hashCode; } -/// Swap out one member `remove` for another `add`. -/// -/// May only be called from `T::SwapOrigin`. -/// -/// Prime membership is *not* passed from `remove` to `add`, if extant. +/// See [`Pallet::swap_member`]. class SwapMember extends Call { const SwapMember({ required this.remove, @@ -316,10 +308,7 @@ class SwapMember extends Call { ); } -/// Change the membership to a new set, disregarding the existing membership. Be nice and -/// pass `members` pre-sorted. -/// -/// May only be called from `T::ResetOrigin`. +/// See [`Pallet::reset_members`]. class ResetMembers extends Call { const ResetMembers({required this.members}); @@ -375,11 +364,7 @@ class ResetMembers extends Call { int get hashCode => members.hashCode; } -/// Swap out the sending member for some other key `new`. -/// -/// May only be called from `Signed` origin of a current member. -/// -/// Prime membership is passed from the origin account to `new`, if extant. +/// See [`Pallet::change_key`]. class ChangeKey extends Call { const ChangeKey({required this.new_}); @@ -424,9 +409,7 @@ class ChangeKey extends Call { int get hashCode => new_.hashCode; } -/// Set the prime member. Must be a current member. -/// -/// May only be called from `T::PrimeOrigin`. +/// See [`Pallet::set_prime`]. class SetPrime extends Call { const SetPrime({required this.who}); @@ -471,9 +454,7 @@ class SetPrime extends Call { int get hashCode => who.hashCode; } -/// Remove the prime member if it exists. -/// -/// May only be called from `T::PrimeOrigin`. +/// See [`Pallet::clear_prime`]. class ClearPrime extends Call { const ClearPrime(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/error.dart index 8303840b..d6729f5c 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { /// Already a member. alreadyMember('AlreadyMember', 0), diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/event.dart index ae73cb9b..824ba691 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_membership/pallet/event.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet enum Event { /// The given member was added; see the transaction for who. memberAdded('MemberAdded', 0), diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_runtime_upgrade/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_runtime_upgrade/pallet/call.dart index a8b507e0..0cf42649 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_runtime_upgrade/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_runtime_upgrade/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 _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -78,6 +78,7 @@ class $CallCodec with _i1.Codec { } } +/// See [`Pallet::set_code`]. class SetCode extends Call { const SetCode({required this.code}); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/call.dart index 0bd59ed7..fa98e413 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/call.dart @@ -7,7 +7,7 @@ import 'package:quiver/collection.dart' as _i5; import '../../tfchain_runtime/runtime_call.dart' as _i4; import '../../tuples_1.dart' as _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -186,7 +186,7 @@ class $CallCodec with _i1.Codec { } } -/// Anonymously schedule a task. +/// See [`Pallet::schedule`]. class Schedule extends Call { const Schedule({ required this.when, @@ -208,10 +208,10 @@ class Schedule extends Call { ); } - /// T::BlockNumber + /// BlockNumberFor final int when; - /// Option> + /// Option>> final _i3.Tuple2? maybePeriodic; /// schedule::Priority @@ -293,7 +293,7 @@ class Schedule extends Call { ); } -/// Cancel an anonymously scheduled task. +/// See [`Pallet::cancel`]. class Cancel extends Call { const Cancel({ required this.when, @@ -307,7 +307,7 @@ class Cancel extends Call { ); } - /// T::BlockNumber + /// BlockNumberFor final int when; /// u32 @@ -358,7 +358,7 @@ class Cancel extends Call { ); } -/// Schedule a named task. +/// See [`Pallet::schedule_named`]. class ScheduleNamed extends Call { const ScheduleNamed({ required this.id, @@ -385,10 +385,10 @@ class ScheduleNamed extends Call { /// TaskName final List id; - /// T::BlockNumber + /// BlockNumberFor final int when; - /// Option> + /// Option>> final _i3.Tuple2? maybePeriodic; /// schedule::Priority @@ -481,7 +481,7 @@ class ScheduleNamed extends Call { ); } -/// Cancel a named scheduled task. +/// See [`Pallet::cancel_named`]. class CancelNamed extends Call { const CancelNamed({required this.id}); @@ -530,7 +530,7 @@ class CancelNamed extends Call { int get hashCode => id.hashCode; } -/// Anonymously schedule a task after a delay. +/// See [`Pallet::schedule_after`]. class ScheduleAfter extends Call { const ScheduleAfter({ required this.after, @@ -552,10 +552,10 @@ class ScheduleAfter extends Call { ); } - /// T::BlockNumber + /// BlockNumberFor final int after; - /// Option> + /// Option>> final _i3.Tuple2? maybePeriodic; /// schedule::Priority @@ -637,7 +637,7 @@ class ScheduleAfter extends Call { ); } -/// Schedule a named task after a delay. +/// See [`Pallet::schedule_named_after`]. class ScheduleNamedAfter extends Call { const ScheduleNamedAfter({ required this.id, @@ -664,10 +664,10 @@ class ScheduleNamedAfter extends Call { /// TaskName final List id; - /// T::BlockNumber + /// BlockNumberFor final int after; - /// Option> + /// Option>> final _i3.Tuple2? maybePeriodic; /// schedule::Priority diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/error.dart index aab707cc..506e1259 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { /// Failed to schedule a call failedToSchedule('FailedToSchedule', 0), diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/event.dart index 25c79a4f..bd44be90 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_scheduler/pallet/event.dart @@ -187,7 +187,7 @@ class Scheduled extends Event { ); } - /// T::BlockNumber + /// BlockNumberFor final int when; /// u32 @@ -252,7 +252,7 @@ class Canceled extends Event { ); } - /// T::BlockNumber + /// BlockNumberFor final int when; /// u32 @@ -325,7 +325,7 @@ class Dispatched extends Event { ); } - /// TaskAddress + /// TaskAddress> final _i3.Tuple2 task; /// Option @@ -424,7 +424,7 @@ class CallUnavailable extends Event { ); } - /// TaskAddress + /// TaskAddress> final _i3.Tuple2 task; /// Option @@ -503,7 +503,7 @@ class PeriodicFailed extends Event { ); } - /// TaskAddress + /// TaskAddress> final _i3.Tuple2 task; /// Option @@ -582,7 +582,7 @@ class PermanentlyOverweight extends Event { ); } - /// TaskAddress + /// TaskAddress> final _i3.Tuple2 task; /// Option diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_session/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_session/pallet/call.dart index 5d1bfb3c..15e1662d 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_session/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_session/pallet/call.dart @@ -6,7 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../tfchain_runtime/opaque/session_keys.dart' as _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -97,15 +97,7 @@ class $CallCodec with _i1.Codec { } } -/// Sets the session key(s) of the function caller to `keys`. -/// Allows an account to set its session key prior to becoming a validator. -/// This doesn't take effect until the next session. -/// -/// The dispatch origin of this function must be signed. -/// -/// ## Complexity -/// - `O(1)`. Actual cost depends on the number of length of `T::Keys::key_ids()` which is -/// fixed. +/// See [`Pallet::set_keys`]. class SetKeys extends Call { const SetKeys({ required this.keys, @@ -175,18 +167,7 @@ class SetKeys extends Call { ); } -/// Removes any session key(s) of the function caller. -/// -/// This doesn't take effect until the next session. -/// -/// The dispatch origin of this function must be Signed and the account must be either be -/// convertible to a validator ID using the chain's typical addressing system (this usually -/// means being a controller account) or directly convertible into a validator ID (which -/// usually means being a stash account). -/// -/// ## Complexity -/// - `O(1)` in number of key types. Actual cost depends on the number of length of -/// `T::Keys::key_ids()` which is fixed. +/// See [`Pallet::purge_keys`]. class PurgeKeys extends Call { const PurgeKeys(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_session/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_session/pallet/event.dart index 5e8eaea7..11945f3b 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_session/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_session/pallet/event.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/call.dart index 744bb792..746402b3 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/call.dart @@ -9,7 +9,7 @@ import '../types/contract_resources.dart' as _i4; import '../types/nru_consumption.dart' as _i3; import '../types/provider.dart' as _i5; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -200,6 +200,11 @@ class $Call { extraFee: extraFee, ); } + + CancelContractCollective cancelContractCollective( + {required BigInt contractId}) { + return CancelContractCollective(contractId: contractId); + } } class $CallCodec with _i1.Codec { @@ -249,6 +254,8 @@ class $CallCodec with _i1.Codec { return AttachSolutionProviderId._decode(input); case 20: return SetDedicatedNodeExtraFee._decode(input); + case 21: + return CancelContractCollective._decode(input); default: throw Exception('Call: Invalid variant index: "$index"'); } @@ -320,6 +327,9 @@ class $CallCodec with _i1.Codec { case SetDedicatedNodeExtraFee: (value as SetDedicatedNodeExtraFee).encodeTo(output); break; + case CancelContractCollective: + (value as CancelContractCollective).encodeTo(output); + break; default: throw Exception( 'Call: Unsupported "$value" of type "${value.runtimeType}"'); @@ -369,6 +379,8 @@ class $CallCodec with _i1.Codec { return (value as AttachSolutionProviderId)._sizeHint(); case SetDedicatedNodeExtraFee: return (value as SetDedicatedNodeExtraFee)._sizeHint(); + case CancelContractCollective: + return (value as CancelContractCollective)._sizeHint(); default: throw Exception( 'Call: Unsupported "$value" of type "${value.runtimeType}"'); @@ -376,6 +388,7 @@ class $CallCodec with _i1.Codec { } } +/// See [`Pallet::create_node_contract`]. class CreateNodeContract extends Call { const CreateNodeContract({ required this.nodeId, @@ -490,6 +503,7 @@ class CreateNodeContract extends Call { ); } +/// See [`Pallet::update_node_contract`]. class UpdateNodeContract extends Call { const UpdateNodeContract({ required this.contractId, @@ -575,6 +589,7 @@ class UpdateNodeContract extends Call { ); } +/// See [`Pallet::cancel_contract`]. class CancelContract extends Call { const CancelContract({required this.contractId}); @@ -619,6 +634,7 @@ class CancelContract extends Call { int get hashCode => contractId.hashCode; } +/// See [`Pallet::create_name_contract`]. class CreateNameContract extends Call { const CreateNameContract({required this.name}); @@ -667,6 +683,7 @@ class CreateNameContract extends Call { int get hashCode => name.hashCode; } +/// See [`Pallet::add_nru_reports`]. class AddNruReports extends Call { const AddNruReports({required this.reports}); @@ -723,6 +740,7 @@ class AddNruReports extends Call { int get hashCode => reports.hashCode; } +/// See [`Pallet::report_contract_resources`]. class ReportContractResources extends Call { const ReportContractResources({required this.contractResources}); @@ -781,6 +799,7 @@ class ReportContractResources extends Call { int get hashCode => contractResources.hashCode; } +/// See [`Pallet::create_rent_contract`]. class CreateRentContract extends Call { const CreateRentContract({ required this.nodeId, @@ -850,6 +869,7 @@ class CreateRentContract extends Call { ); } +/// See [`Pallet::create_solution_provider`]. class CreateSolutionProvider extends Call { const CreateSolutionProvider({ required this.description, @@ -941,6 +961,7 @@ class CreateSolutionProvider extends Call { ); } +/// See [`Pallet::approve_solution_provider`]. class ApproveSolutionProvider extends Call { const ApproveSolutionProvider({ required this.solutionProviderId, @@ -1007,6 +1028,7 @@ class ApproveSolutionProvider extends Call { ); } +/// See [`Pallet::bill_contract_for_block`]. class BillContractForBlock extends Call { const BillContractForBlock({required this.contractId}); @@ -1051,6 +1073,7 @@ class BillContractForBlock extends Call { int get hashCode => contractId.hashCode; } +/// See [`Pallet::service_contract_create`]. class ServiceContractCreate extends Call { const ServiceContractCreate({ required this.serviceAccount, @@ -1123,6 +1146,7 @@ class ServiceContractCreate extends Call { ); } +/// See [`Pallet::service_contract_set_metadata`]. class ServiceContractSetMetadata extends Call { const ServiceContractSetMetadata({ required this.serviceContractId, @@ -1192,6 +1216,7 @@ class ServiceContractSetMetadata extends Call { ); } +/// See [`Pallet::service_contract_set_fees`]. class ServiceContractSetFees extends Call { const ServiceContractSetFees({ required this.serviceContractId, @@ -1271,6 +1296,7 @@ class ServiceContractSetFees extends Call { ); } +/// See [`Pallet::service_contract_approve`]. class ServiceContractApprove extends Call { const ServiceContractApprove({required this.serviceContractId}); @@ -1317,6 +1343,7 @@ class ServiceContractApprove extends Call { int get hashCode => serviceContractId.hashCode; } +/// See [`Pallet::service_contract_reject`]. class ServiceContractReject extends Call { const ServiceContractReject({required this.serviceContractId}); @@ -1363,6 +1390,7 @@ class ServiceContractReject extends Call { int get hashCode => serviceContractId.hashCode; } +/// See [`Pallet::service_contract_cancel`]. class ServiceContractCancel extends Call { const ServiceContractCancel({required this.serviceContractId}); @@ -1409,6 +1437,7 @@ class ServiceContractCancel extends Call { int get hashCode => serviceContractId.hashCode; } +/// See [`Pallet::service_contract_bill`]. class ServiceContractBill extends Call { const ServiceContractBill({ required this.serviceContractId, @@ -1491,6 +1520,7 @@ class ServiceContractBill extends Call { ); } +/// See [`Pallet::change_billing_frequency`]. class ChangeBillingFrequency extends Call { const ChangeBillingFrequency({required this.frequency}); @@ -1535,6 +1565,7 @@ class ChangeBillingFrequency extends Call { int get hashCode => frequency.hashCode; } +/// See [`Pallet::attach_solution_provider_id`]. class AttachSolutionProviderId extends Call { const AttachSolutionProviderId({ required this.contractId, @@ -1601,6 +1632,7 @@ class AttachSolutionProviderId extends Call { ); } +/// See [`Pallet::set_dedicated_node_extra_fee`]. class SetDedicatedNodeExtraFee extends Call { const SetDedicatedNodeExtraFee({ required this.nodeId, @@ -1666,3 +1698,49 @@ class SetDedicatedNodeExtraFee extends Call { extraFee, ); } + +/// See [`Pallet::cancel_contract_collective`]. +class CancelContractCollective extends Call { + const CancelContractCollective({required this.contractId}); + + factory CancelContractCollective._decode(_i1.Input input) { + return CancelContractCollective( + contractId: _i1.U64Codec.codec.decode(input)); + } + + /// u64 + final BigInt contractId; + + @override + Map> toJson() => { + 'cancel_contract_collective': {'contractId': contractId} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U64Codec.codec.sizeHint(contractId); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 21, + output, + ); + _i1.U64Codec.codec.encodeTo( + contractId, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is CancelContractCollective && other.contractId == contractId; + + @override + int get hashCode => contractId.hashCode; +} diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/error.dart index 71faace5..98d7f488 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { twinNotExists('TwinNotExists', 0), nodeNotExists('NodeNotExists', 1), @@ -65,7 +62,9 @@ enum Error { wrongAuthority('WrongAuthority', 49), unauthorizedToChangeSolutionProviderId( 'UnauthorizedToChangeSolutionProviderId', 50), - unauthorizedToSetExtraFee('UnauthorizedToSetExtraFee', 51); + unauthorizedToSetExtraFee('UnauthorizedToSetExtraFee', 51), + rewardDistributionError('RewardDistributionError', 52), + contractPaymentStateNotExists('ContractPaymentStateNotExists', 53); const Error( this.variantName, @@ -199,6 +198,10 @@ class $ErrorCodec with _i1.Codec { return Error.unauthorizedToChangeSolutionProviderId; case 51: return Error.unauthorizedToSetExtraFee; + case 52: + return Error.rewardDistributionError; + case 53: + return Error.contractPaymentStateNotExists; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/event.dart index 7f9fdc5a..4454b72e 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/pallet/event.dart @@ -16,10 +16,7 @@ import '../types/service_contract.dart' as _i11; import '../types/service_contract_bill.dart' as _i13; import '../types/solution_provider.dart' as _i10; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); @@ -225,6 +222,46 @@ class $Event { extraFee: extraFee, ); } + + RentWaived rentWaived({required BigInt contractId}) { + return RentWaived(contractId: contractId); + } + + ContractGracePeriodElapsed contractGracePeriodElapsed({ + required BigInt contractId, + required BigInt gracePeriod, + }) { + return ContractGracePeriodElapsed( + contractId: contractId, + gracePeriod: gracePeriod, + ); + } + + ContractPaymentOverdrawn contractPaymentOverdrawn({ + required BigInt contractId, + required BigInt timestamp, + required BigInt partiallyBilledAmount, + required BigInt overdraft, + }) { + return ContractPaymentOverdrawn( + contractId: contractId, + timestamp: timestamp, + partiallyBilledAmount: partiallyBilledAmount, + overdraft: overdraft, + ); + } + + RewardDistributed rewardDistributed({ + required BigInt contractId, + required BigInt standardRewards, + required BigInt additionalRewards, + }) { + return RewardDistributed( + contractId: contractId, + standardRewards: standardRewards, + additionalRewards: additionalRewards, + ); + } } class $EventCodec with _i1.Codec { @@ -284,6 +321,14 @@ class $EventCodec with _i1.Codec { return BillingFrequencyChanged._decode(input); case 24: return NodeExtraFeeSet._decode(input); + case 25: + return RentWaived._decode(input); + case 26: + return ContractGracePeriodElapsed._decode(input); + case 27: + return ContractPaymentOverdrawn._decode(input); + case 28: + return RewardDistributed._decode(input); default: throw Exception('Event: Invalid variant index: "$index"'); } @@ -370,6 +415,18 @@ class $EventCodec with _i1.Codec { case NodeExtraFeeSet: (value as NodeExtraFeeSet).encodeTo(output); break; + case RentWaived: + (value as RentWaived).encodeTo(output); + break; + case ContractGracePeriodElapsed: + (value as ContractGracePeriodElapsed).encodeTo(output); + break; + case ContractPaymentOverdrawn: + (value as ContractPaymentOverdrawn).encodeTo(output); + break; + case RewardDistributed: + (value as RewardDistributed).encodeTo(output); + break; default: throw Exception( 'Event: Unsupported "$value" of type "${value.runtimeType}"'); @@ -429,6 +486,14 @@ class $EventCodec with _i1.Codec { return (value as BillingFrequencyChanged)._sizeHint(); case NodeExtraFeeSet: return (value as NodeExtraFeeSet)._sizeHint(); + case RentWaived: + return (value as RentWaived)._sizeHint(); + case ContractGracePeriodElapsed: + return (value as ContractGracePeriodElapsed)._sizeHint(); + case ContractPaymentOverdrawn: + return (value as ContractPaymentOverdrawn)._sizeHint(); + case RewardDistributed: + return (value as RewardDistributed)._sizeHint(); default: throw Exception( 'Event: Unsupported "$value" of type "${value.runtimeType}"'); @@ -1152,7 +1217,7 @@ class RentContractCanceled extends Event { int get hashCode => contractId.hashCode; } -/// A Contract grace period is triggered +/// A Contract grace period is triggered due to overdarfted class ContractGracePeriodStarted extends Event { const ContractGracePeriodStarted({ required this.contractId, @@ -1245,7 +1310,7 @@ class ContractGracePeriodStarted extends Event { ); } -/// A Contract grace period was ended +/// A Contract grace period was ended due to overdarfted being settled class ContractGracePeriodEnded extends Event { const ContractGracePeriodEnded({ required this.contractId, @@ -1864,3 +1929,284 @@ class NodeExtraFeeSet extends Event { extraFee, ); } + +class RentWaived extends Event { + const RentWaived({required this.contractId}); + + factory RentWaived._decode(_i1.Input input) { + return RentWaived(contractId: _i1.U64Codec.codec.decode(input)); + } + + /// u64 + final BigInt contractId; + + @override + Map> toJson() => { + 'RentWaived': {'contractId': contractId} + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U64Codec.codec.sizeHint(contractId); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 25, + output, + ); + _i1.U64Codec.codec.encodeTo( + contractId, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is RentWaived && other.contractId == contractId; + + @override + int get hashCode => contractId.hashCode; +} + +class ContractGracePeriodElapsed extends Event { + const ContractGracePeriodElapsed({ + required this.contractId, + required this.gracePeriod, + }); + + factory ContractGracePeriodElapsed._decode(_i1.Input input) { + return ContractGracePeriodElapsed( + contractId: _i1.U64Codec.codec.decode(input), + gracePeriod: _i1.U64Codec.codec.decode(input), + ); + } + + /// u64 + final BigInt contractId; + + /// u64 + final BigInt gracePeriod; + + @override + Map> toJson() => { + 'ContractGracePeriodElapsed': { + 'contractId': contractId, + 'gracePeriod': gracePeriod, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U64Codec.codec.sizeHint(contractId); + size = size + _i1.U64Codec.codec.sizeHint(gracePeriod); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 26, + output, + ); + _i1.U64Codec.codec.encodeTo( + contractId, + output, + ); + _i1.U64Codec.codec.encodeTo( + gracePeriod, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ContractGracePeriodElapsed && + other.contractId == contractId && + other.gracePeriod == gracePeriod; + + @override + int get hashCode => Object.hash( + contractId, + gracePeriod, + ); +} + +class ContractPaymentOverdrawn extends Event { + const ContractPaymentOverdrawn({ + required this.contractId, + required this.timestamp, + required this.partiallyBilledAmount, + required this.overdraft, + }); + + factory ContractPaymentOverdrawn._decode(_i1.Input input) { + return ContractPaymentOverdrawn( + contractId: _i1.U64Codec.codec.decode(input), + timestamp: _i1.U64Codec.codec.decode(input), + partiallyBilledAmount: _i1.U128Codec.codec.decode(input), + overdraft: _i1.U128Codec.codec.decode(input), + ); + } + + /// u64 + final BigInt contractId; + + /// u64 + final BigInt timestamp; + + /// BalanceOf + final BigInt partiallyBilledAmount; + + /// BalanceOf + final BigInt overdraft; + + @override + Map> toJson() => { + 'ContractPaymentOverdrawn': { + 'contractId': contractId, + 'timestamp': timestamp, + 'partiallyBilledAmount': partiallyBilledAmount, + 'overdraft': overdraft, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U64Codec.codec.sizeHint(contractId); + size = size + _i1.U64Codec.codec.sizeHint(timestamp); + size = size + _i1.U128Codec.codec.sizeHint(partiallyBilledAmount); + size = size + _i1.U128Codec.codec.sizeHint(overdraft); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 27, + output, + ); + _i1.U64Codec.codec.encodeTo( + contractId, + output, + ); + _i1.U64Codec.codec.encodeTo( + timestamp, + output, + ); + _i1.U128Codec.codec.encodeTo( + partiallyBilledAmount, + output, + ); + _i1.U128Codec.codec.encodeTo( + overdraft, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ContractPaymentOverdrawn && + other.contractId == contractId && + other.timestamp == timestamp && + other.partiallyBilledAmount == partiallyBilledAmount && + other.overdraft == overdraft; + + @override + int get hashCode => Object.hash( + contractId, + timestamp, + partiallyBilledAmount, + overdraft, + ); +} + +class RewardDistributed extends Event { + const RewardDistributed({ + required this.contractId, + required this.standardRewards, + required this.additionalRewards, + }); + + factory RewardDistributed._decode(_i1.Input input) { + return RewardDistributed( + contractId: _i1.U64Codec.codec.decode(input), + standardRewards: _i1.U128Codec.codec.decode(input), + additionalRewards: _i1.U128Codec.codec.decode(input), + ); + } + + /// u64 + final BigInt contractId; + + /// BalanceOf + final BigInt standardRewards; + + /// BalanceOf + final BigInt additionalRewards; + + @override + Map> toJson() => { + 'RewardDistributed': { + 'contractId': contractId, + 'standardRewards': standardRewards, + 'additionalRewards': additionalRewards, + } + }; + + int _sizeHint() { + int size = 1; + size = size + _i1.U64Codec.codec.sizeHint(contractId); + size = size + _i1.U128Codec.codec.sizeHint(standardRewards); + size = size + _i1.U128Codec.codec.sizeHint(additionalRewards); + return size; + } + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 28, + output, + ); + _i1.U64Codec.codec.encodeTo( + contractId, + output, + ); + _i1.U128Codec.codec.encodeTo( + standardRewards, + output, + ); + _i1.U128Codec.codec.encodeTo( + additionalRewards, + output, + ); + } + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is RewardDistributed && + other.contractId == contractId && + other.standardRewards == standardRewards && + other.additionalRewards == additionalRewards; + + @override + int get hashCode => Object.hash( + contractId, + standardRewards, + additionalRewards, + ); +} diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/cause.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/cause.dart index da064958..587b2fd4 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/cause.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/cause.dart @@ -5,7 +5,8 @@ import 'package:polkadart/scale_codec.dart' as _i1; enum Cause { canceledByUser('CanceledByUser', 0), - outOfFunds('OutOfFunds', 1); + outOfFunds('OutOfFunds', 1), + canceledByCollective('CanceledByCollective', 2); const Cause( this.variantName, @@ -39,6 +40,8 @@ class $CauseCodec with _i1.Codec { return Cause.canceledByUser; case 1: return Cause.outOfFunds; + case 2: + return Cause.canceledByCollective; default: throw Exception('Cause: Invalid variant index: "$index"'); } diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/contract_id_provides.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/contract_id_provides.dart new file mode 100644 index 00000000..cb7c03cb --- /dev/null +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/contract_id_provides.dart @@ -0,0 +1,29 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:polkadart/scale_codec.dart' as _i1; + +typedef ContractIdProvides = dynamic; + +class ContractIdProvidesCodec with _i1.Codec { + const ContractIdProvidesCodec(); + + @override + ContractIdProvides decode(_i1.Input input) { + return _i1.NullCodec.codec.decode(input); + } + + @override + void encodeTo( + ContractIdProvides value, + _i1.Output output, + ) { + _i1.NullCodec.codec.encodeTo( + value, + output, + ); + } + + @override + int sizeHint(ContractIdProvides value) { + return _i1.NullCodec.codec.sizeHint(value); + } +} diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/contract_payment_state.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/contract_payment_state.dart new file mode 100644 index 00000000..46a2892c --- /dev/null +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/contract_payment_state.dart @@ -0,0 +1,135 @@ +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:typed_data' as _i2; + +import 'package:polkadart/scale_codec.dart' as _i1; + +class ContractPaymentState { + const ContractPaymentState({ + required this.standardReserve, + required this.additionalReserve, + required this.standardOverdraft, + required this.additionalOverdraft, + required this.lastUpdatedSeconds, + required this.cycles, + }); + + factory ContractPaymentState.decode(_i1.Input input) { + return codec.decode(input); + } + + /// BalanceOf + final BigInt standardReserve; + + /// BalanceOf + final BigInt additionalReserve; + + /// BalanceOf + final BigInt standardOverdraft; + + /// BalanceOf + final BigInt additionalOverdraft; + + /// u64 + final BigInt lastUpdatedSeconds; + + /// u16 + final int cycles; + + static const $ContractPaymentStateCodec codec = $ContractPaymentStateCodec(); + + _i2.Uint8List encode() { + return codec.encode(this); + } + + Map toJson() => { + 'standardReserve': standardReserve, + 'additionalReserve': additionalReserve, + 'standardOverdraft': standardOverdraft, + 'additionalOverdraft': additionalOverdraft, + 'lastUpdatedSeconds': lastUpdatedSeconds, + 'cycles': cycles, + }; + + @override + bool operator ==(Object other) => + identical( + this, + other, + ) || + other is ContractPaymentState && + other.standardReserve == standardReserve && + other.additionalReserve == additionalReserve && + other.standardOverdraft == standardOverdraft && + other.additionalOverdraft == additionalOverdraft && + other.lastUpdatedSeconds == lastUpdatedSeconds && + other.cycles == cycles; + + @override + int get hashCode => Object.hash( + standardReserve, + additionalReserve, + standardOverdraft, + additionalOverdraft, + lastUpdatedSeconds, + cycles, + ); +} + +class $ContractPaymentStateCodec with _i1.Codec { + const $ContractPaymentStateCodec(); + + @override + void encodeTo( + ContractPaymentState obj, + _i1.Output output, + ) { + _i1.U128Codec.codec.encodeTo( + obj.standardReserve, + output, + ); + _i1.U128Codec.codec.encodeTo( + obj.additionalReserve, + output, + ); + _i1.U128Codec.codec.encodeTo( + obj.standardOverdraft, + output, + ); + _i1.U128Codec.codec.encodeTo( + obj.additionalOverdraft, + output, + ); + _i1.U64Codec.codec.encodeTo( + obj.lastUpdatedSeconds, + output, + ); + _i1.U16Codec.codec.encodeTo( + obj.cycles, + output, + ); + } + + @override + ContractPaymentState decode(_i1.Input input) { + return ContractPaymentState( + standardReserve: _i1.U128Codec.codec.decode(input), + additionalReserve: _i1.U128Codec.codec.decode(input), + standardOverdraft: _i1.U128Codec.codec.decode(input), + additionalOverdraft: _i1.U128Codec.codec.decode(input), + lastUpdatedSeconds: _i1.U64Codec.codec.decode(input), + cycles: _i1.U16Codec.codec.decode(input), + ); + } + + @override + int sizeHint(ContractPaymentState obj) { + int size = 0; + size = size + _i1.U128Codec.codec.sizeHint(obj.standardReserve); + size = size + _i1.U128Codec.codec.sizeHint(obj.additionalReserve); + size = size + _i1.U128Codec.codec.sizeHint(obj.standardOverdraft); + size = size + _i1.U128Codec.codec.sizeHint(obj.additionalOverdraft); + size = size + _i1.U64Codec.codec.sizeHint(obj.lastUpdatedSeconds); + size = size + _i1.U16Codec.codec.sizeHint(obj.cycles); + return size; + } +} diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/storage_version.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/storage_version.dart index ce5bd919..5f4b40c5 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/storage_version.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_smart_contract/types/storage_version.dart @@ -14,7 +14,8 @@ enum StorageVersion { v8('V8', 7), v9('V9', 8), v10('V10', 9), - v11('V11', 10); + v11('V11', 10), + v12('V12', 11); const StorageVersion( this.variantName, @@ -66,6 +67,8 @@ class $StorageVersionCodec with _i1.Codec { return StorageVersion.v10; case 10: return StorageVersion.v11; + case 11: + return StorageVersion.v12; default: throw Exception('StorageVersion: Invalid variant index: "$index"'); } diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/call.dart index 358ae6a3..6b3bc739 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/call.dart @@ -17,7 +17,7 @@ import '../types/location_input.dart' as _i7; import '../types/policy.dart' as _i12; import '../types/storage_version.dart' as _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -750,6 +750,7 @@ class $CallCodec with _i1.Codec { } } +/// See [`Pallet::set_storage_version`]. class SetStorageVersion extends Call { const SetStorageVersion({required this.version}); @@ -794,6 +795,7 @@ class SetStorageVersion extends Call { int get hashCode => version.hashCode; } +/// See [`Pallet::create_farm`]. class CreateFarm extends Call { const CreateFarm({ required this.name, @@ -867,6 +869,7 @@ class CreateFarm extends Call { ); } +/// See [`Pallet::update_farm`]. class UpdateFarm extends Call { const UpdateFarm({ required this.farmId, @@ -936,6 +939,7 @@ class UpdateFarm extends Call { ); } +/// See [`Pallet::add_stellar_payout_v2address`]. class AddStellarPayoutV2address extends Call { const AddStellarPayoutV2address({ required this.farmId, @@ -1005,6 +1009,7 @@ class AddStellarPayoutV2address extends Call { ); } +/// See [`Pallet::set_farm_certification`]. class SetFarmCertification extends Call { const SetFarmCertification({ required this.farmId, @@ -1071,6 +1076,7 @@ class SetFarmCertification extends Call { ); } +/// See [`Pallet::add_farm_ip`]. class AddFarmIp extends Call { const AddFarmIp({ required this.farmId, @@ -1156,6 +1162,7 @@ class AddFarmIp extends Call { ); } +/// See [`Pallet::remove_farm_ip`]. class RemoveFarmIp extends Call { const RemoveFarmIp({ required this.farmId, @@ -1225,6 +1232,7 @@ class RemoveFarmIp extends Call { ); } +/// See [`Pallet::create_node`]. class CreateNode extends Call { const CreateNode({ required this.farmId, @@ -1365,6 +1373,7 @@ class CreateNode extends Call { ); } +/// See [`Pallet::update_node`]. class UpdateNode extends Call { const UpdateNode({ required this.nodeId, @@ -1518,6 +1527,7 @@ class UpdateNode extends Call { ); } +/// See [`Pallet::set_node_certification`]. class SetNodeCertification extends Call { const SetNodeCertification({ required this.nodeId, @@ -1584,6 +1594,7 @@ class SetNodeCertification extends Call { ); } +/// See [`Pallet::report_uptime`]. class ReportUptime extends Call { const ReportUptime({required this.uptime}); @@ -1628,6 +1639,7 @@ class ReportUptime extends Call { int get hashCode => uptime.hashCode; } +/// See [`Pallet::add_node_public_config`]. class AddNodePublicConfig extends Call { const AddNodePublicConfig({ required this.farmId, @@ -1711,6 +1723,7 @@ class AddNodePublicConfig extends Call { ); } +/// See [`Pallet::delete_node`]. class DeleteNode extends Call { const DeleteNode({required this.nodeId}); @@ -1755,6 +1768,7 @@ class DeleteNode extends Call { int get hashCode => nodeId.hashCode; } +/// See [`Pallet::create_entity`]. class CreateEntity extends Call { const CreateEntity({ required this.target, @@ -1875,6 +1889,7 @@ class CreateEntity extends Call { ); } +/// See [`Pallet::update_entity`]. class UpdateEntity extends Call { const UpdateEntity({ required this.name, @@ -1963,6 +1978,7 @@ class UpdateEntity extends Call { ); } +/// See [`Pallet::delete_entity`]. class DeleteEntity extends Call { const DeleteEntity(); @@ -1983,6 +1999,7 @@ class DeleteEntity extends Call { int get hashCode => runtimeType.hashCode; } +/// See [`Pallet::create_twin`]. class CreateTwin extends Call { const CreateTwin({ this.relay, @@ -2053,6 +2070,7 @@ class CreateTwin extends Call { ); } +/// See [`Pallet::update_twin`]. class UpdateTwin extends Call { const UpdateTwin({ this.relay, @@ -2123,6 +2141,7 @@ class UpdateTwin extends Call { ); } +/// See [`Pallet::add_twin_entity`]. class AddTwinEntity extends Call { const AddTwinEntity({ required this.twinId, @@ -2205,6 +2224,7 @@ class AddTwinEntity extends Call { ); } +/// See [`Pallet::delete_twin_entity`]. class DeleteTwinEntity extends Call { const DeleteTwinEntity({ required this.twinId, @@ -2271,6 +2291,7 @@ class DeleteTwinEntity extends Call { ); } +/// See [`Pallet::create_pricing_policy`]. class CreatePricingPolicy extends Call { const CreatePricingPolicy({ required this.name, @@ -2450,6 +2471,7 @@ class CreatePricingPolicy extends Call { ); } +/// See [`Pallet::update_pricing_policy`]. class UpdatePricingPolicy extends Call { const UpdatePricingPolicy({ required this.pricingPolicyId, @@ -2642,6 +2664,7 @@ class UpdatePricingPolicy extends Call { ); } +/// See [`Pallet::create_farming_policy`]. class CreateFarmingPolicy extends Call { const CreateFarmingPolicy({ required this.name, @@ -2691,7 +2714,7 @@ class CreateFarmingPolicy extends Call { /// u16 final int minimalUptime; - /// T::BlockNumber + /// BlockNumberFor final int policyEnd; /// bool @@ -2828,6 +2851,7 @@ class CreateFarmingPolicy extends Call { ); } +/// See [`Pallet::user_accept_tc`]. class UserAcceptTc extends Call { const UserAcceptTc({ required this.documentLink, @@ -2900,6 +2924,7 @@ class UserAcceptTc extends Call { ); } +/// See [`Pallet::delete_node_farm`]. class DeleteNodeFarm extends Call { const DeleteNodeFarm({required this.nodeId}); @@ -2944,6 +2969,7 @@ class DeleteNodeFarm extends Call { int get hashCode => nodeId.hashCode; } +/// See [`Pallet::set_farm_dedicated`]. class SetFarmDedicated extends Call { const SetFarmDedicated({ required this.farmId, @@ -3010,6 +3036,7 @@ class SetFarmDedicated extends Call { ); } +/// See [`Pallet::force_reset_farm_ip`]. class ForceResetFarmIp extends Call { const ForceResetFarmIp({ required this.farmId, @@ -3079,6 +3106,7 @@ class ForceResetFarmIp extends Call { ); } +/// See [`Pallet::set_connection_price`]. class SetConnectionPrice extends Call { const SetConnectionPrice({required this.price}); @@ -3123,6 +3151,7 @@ class SetConnectionPrice extends Call { int get hashCode => price.hashCode; } +/// See [`Pallet::add_node_certifier`]. class AddNodeCertifier extends Call { const AddNodeCertifier({required this.certifier}); @@ -3172,6 +3201,7 @@ class AddNodeCertifier extends Call { int get hashCode => certifier.hashCode; } +/// See [`Pallet::remove_node_certifier`]. class RemoveNodeCertifier extends Call { const RemoveNodeCertifier({required this.certifier}); @@ -3221,6 +3251,7 @@ class RemoveNodeCertifier extends Call { int get hashCode => certifier.hashCode; } +/// See [`Pallet::update_farming_policy`]. class UpdateFarmingPolicy extends Call { const UpdateFarmingPolicy({ required this.farmingPolicyId, @@ -3273,7 +3304,7 @@ class UpdateFarmingPolicy extends Call { /// u16 final int minimalUptime; - /// T::BlockNumber + /// BlockNumberFor final int policyEnd; /// bool @@ -3407,6 +3438,7 @@ class UpdateFarmingPolicy extends Call { ); } +/// See [`Pallet::attach_policy_to_farm`]. class AttachPolicyToFarm extends Call { const AttachPolicyToFarm({ required this.farmId, @@ -3480,6 +3512,7 @@ class AttachPolicyToFarm extends Call { ); } +/// See [`Pallet::set_zos_version`]. class SetZosVersion extends Call { const SetZosVersion({required this.zosVersion}); @@ -3528,6 +3561,7 @@ class SetZosVersion extends Call { int get hashCode => zosVersion.hashCode; } +/// See [`Pallet::change_power_state`]. class ChangePowerState extends Call { const ChangePowerState({required this.powerState}); @@ -3572,6 +3606,7 @@ class ChangePowerState extends Call { int get hashCode => powerState.hashCode; } +/// See [`Pallet::change_power_target`]. class ChangePowerTarget extends Call { const ChangePowerTarget({ required this.nodeId, @@ -3638,6 +3673,7 @@ class ChangePowerTarget extends Call { ); } +/// See [`Pallet::bond_twin_account`]. class BondTwinAccount extends Call { const BondTwinAccount({required this.twinId}); @@ -3682,6 +3718,7 @@ class BondTwinAccount extends Call { int get hashCode => twinId.hashCode; } +/// See [`Pallet::report_uptime_v2`]. class ReportUptimeV2 extends Call { const ReportUptimeV2({ required this.uptime, diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/error.dart index 6cc6304f..a0a654cb 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { noneValue('NoneValue', 0), storageOverflow('StorageOverflow', 1), @@ -120,8 +117,10 @@ enum Error { invalidDocumentHashInput('InvalidDocumentHashInput', 109), invalidPublicConfig('InvalidPublicConfig', 110), unauthorizedToChangePowerTarget('UnauthorizedToChangePowerTarget', 111), - invalidRelayAddress('InvalidRelayAddress', 112), - invalidTimestampHint('InvalidTimestampHint', 113); + nodeHasActiveContracts('NodeHasActiveContracts', 112), + invalidRelayAddress('InvalidRelayAddress', 113), + invalidTimestampHint('InvalidTimestampHint', 114), + invalidStorageInput('InvalidStorageInput', 115); const Error( this.variantName, @@ -376,9 +375,13 @@ class $ErrorCodec with _i1.Codec { case 111: return Error.unauthorizedToChangePowerTarget; case 112: - return Error.invalidRelayAddress; + return Error.nodeHasActiveContracts; case 113: + return Error.invalidRelayAddress; + case 114: return Error.invalidTimestampHint; + case 115: + return Error.invalidStorageInput; default: throw Exception('Error: Invalid variant index: "$index"'); } diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/event.dart index 9dd003b2..e70a294d 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tfgrid/pallet/event.dart @@ -18,10 +18,7 @@ import '../types/farming_policy.dart' as _i10; import '../types/pricing_policy.dart' as _i9; import '../types/twin.dart' as _i7; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); @@ -1423,7 +1420,7 @@ class FarmingPolicyStored extends Event { return FarmingPolicyStored(_i10.FarmingPolicy.codec.decode(input)); } - /// types::FarmingPolicy + /// types::FarmingPolicy> final _i10.FarmingPolicy value0; @override @@ -1777,7 +1774,7 @@ class FarmingPolicyUpdated extends Event { return FarmingPolicyUpdated(_i10.FarmingPolicy.codec.decode(input)); } - /// types::FarmingPolicy + /// types::FarmingPolicy> final _i10.FarmingPolicy value0; @override @@ -2099,7 +2096,7 @@ class PowerStateChanged extends Event { /// u32 final int nodeId; - /// PowerState + /// PowerState> final _i15.PowerState powerState; @override diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/call.dart index efad41ad..478a539b 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/call.dart @@ -6,7 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -235,6 +235,7 @@ class $CallCodec with _i1.Codec { } } +/// See [`Pallet::add_bridge_validator`]. class AddBridgeValidator extends Call { const AddBridgeValidator({required this.target}); @@ -283,6 +284,7 @@ class AddBridgeValidator extends Call { int get hashCode => target.hashCode; } +/// See [`Pallet::remove_bridge_validator`]. class RemoveBridgeValidator extends Call { const RemoveBridgeValidator({required this.target}); @@ -332,6 +334,7 @@ class RemoveBridgeValidator extends Call { int get hashCode => target.hashCode; } +/// See [`Pallet::set_fee_account`]. class SetFeeAccount extends Call { const SetFeeAccount({required this.target}); @@ -380,6 +383,7 @@ class SetFeeAccount extends Call { int get hashCode => target.hashCode; } +/// See [`Pallet::set_withdraw_fee`]. class SetWithdrawFee extends Call { const SetWithdrawFee({required this.amount}); @@ -424,6 +428,7 @@ class SetWithdrawFee extends Call { int get hashCode => amount.hashCode; } +/// See [`Pallet::set_deposit_fee`]. class SetDepositFee extends Call { const SetDepositFee({required this.amount}); @@ -468,6 +473,7 @@ class SetDepositFee extends Call { int get hashCode => amount.hashCode; } +/// See [`Pallet::swap_to_stellar`]. class SwapToStellar extends Call { const SwapToStellar({ required this.targetStellarAddress, @@ -537,6 +543,7 @@ class SwapToStellar extends Call { ); } +/// See [`Pallet::propose_or_vote_mint_transaction`]. class ProposeOrVoteMintTransaction extends Call { const ProposeOrVoteMintTransaction({ required this.transaction, @@ -622,6 +629,7 @@ class ProposeOrVoteMintTransaction extends Call { ); } +/// See [`Pallet::propose_burn_transaction_or_add_sig`]. class ProposeBurnTransactionOrAddSig extends Call { const ProposeBurnTransactionOrAddSig({ required this.transactionId, @@ -749,6 +757,7 @@ class ProposeBurnTransactionOrAddSig extends Call { ); } +/// See [`Pallet::set_burn_transaction_executed`]. class SetBurnTransactionExecuted extends Call { const SetBurnTransactionExecuted({required this.transactionId}); @@ -795,6 +804,7 @@ class SetBurnTransactionExecuted extends Call { int get hashCode => transactionId.hashCode; } +/// See [`Pallet::create_refund_transaction_or_add_sig`]. class CreateRefundTransactionOrAddSig extends Call { const CreateRefundTransactionOrAddSig({ required this.txHash, @@ -925,6 +935,7 @@ class CreateRefundTransactionOrAddSig extends Call { ); } +/// See [`Pallet::set_refund_transaction_executed`]. class SetRefundTransactionExecuted extends Call { const SetRefundTransactionExecuted({required this.txHash}); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/error.dart index 7c8ba7c9..e7471a9f 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { validatorExists('ValidatorExists', 0), validatorNotExists('ValidatorNotExists', 1), diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/event.dart index f81930ac..d2f2fa3c 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/pallet/event.dart @@ -10,10 +10,7 @@ import '../types/mint_transaction.dart' as _i4; import '../types/refund_transaction.dart' as _i7; import '../types/stellar_signature.dart' as _i5; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); @@ -57,8 +54,14 @@ class $Event { return MintTransactionVoted(value0); } - MintCompleted mintCompleted(_i4.MintTransaction value0) { - return MintCompleted(value0); + MintCompleted mintCompleted( + _i4.MintTransaction value0, + List value1, + ) { + return MintCompleted( + value0, + value1, + ); } MintTransactionExpired mintTransactionExpired( @@ -120,13 +123,15 @@ class $Event { BurnTransactionExpired burnTransactionExpired( BigInt value0, - List value1, - BigInt value2, + _i3.AccountId32? value1, + List value2, + BigInt value3, ) { return BurnTransactionExpired( value0, value1, value2, + value3, ); } @@ -445,22 +450,36 @@ class MintTransactionVoted extends Event { } class MintCompleted extends Event { - const MintCompleted(this.value0); + const MintCompleted( + this.value0, + this.value1, + ); factory MintCompleted._decode(_i1.Input input) { - return MintCompleted(_i4.MintTransaction.codec.decode(input)); + return MintCompleted( + _i4.MintTransaction.codec.decode(input), + _i1.U8SequenceCodec.codec.decode(input), + ); } - /// MintTransaction + /// MintTransaction> final _i4.MintTransaction value0; + /// Vec + final List value1; + @override - Map> toJson() => - {'MintCompleted': value0.toJson()}; + Map> toJson() => { + 'MintCompleted': [ + value0.toJson(), + value1, + ] + }; int _sizeHint() { int size = 1; size = size + _i4.MintTransaction.codec.sizeHint(value0); + size = size + _i1.U8SequenceCodec.codec.sizeHint(value1); return size; } @@ -473,6 +492,10 @@ class MintCompleted extends Event { value0, output, ); + _i1.U8SequenceCodec.codec.encodeTo( + value1, + output, + ); } @override @@ -481,10 +504,18 @@ class MintCompleted extends Event { this, other, ) || - other is MintCompleted && other.value0 == value0; + other is MintCompleted && + other.value0 == value0 && + _i8.listsEqual( + other.value1, + value1, + ); @override - int get hashCode => value0.hashCode; + int get hashCode => Object.hash( + value0, + value1, + ); } class MintTransactionExpired extends Event { @@ -867,7 +898,7 @@ class BurnTransactionProcessed extends Event { return BurnTransactionProcessed(_i6.BurnTransaction.codec.decode(input)); } - /// BurnTransaction + /// BurnTransaction> final _i6.BurnTransaction value0; @override @@ -908,11 +939,14 @@ class BurnTransactionExpired extends Event { this.value0, this.value1, this.value2, + this.value3, ); factory BurnTransactionExpired._decode(_i1.Input input) { return BurnTransactionExpired( _i1.U64Codec.codec.decode(input), + const _i1.OptionCodec<_i3.AccountId32>(_i3.AccountId32Codec()) + .decode(input), _i1.U8SequenceCodec.codec.decode(input), _i1.U64Codec.codec.decode(input), ); @@ -921,26 +955,33 @@ class BurnTransactionExpired extends Event { /// u64 final BigInt value0; + /// Option + final _i3.AccountId32? value1; + /// Vec - final List value1; + final List value2; /// u64 - final BigInt value2; + final BigInt value3; @override Map> toJson() => { 'BurnTransactionExpired': [ value0, - value1, + value1?.toList(), value2, + value3, ] }; int _sizeHint() { int size = 1; size = size + _i1.U64Codec.codec.sizeHint(value0); - size = size + _i1.U8SequenceCodec.codec.sizeHint(value1); - size = size + _i1.U64Codec.codec.sizeHint(value2); + size = size + + const _i1.OptionCodec<_i3.AccountId32>(_i3.AccountId32Codec()) + .sizeHint(value1); + size = size + _i1.U8SequenceCodec.codec.sizeHint(value2); + size = size + _i1.U64Codec.codec.sizeHint(value3); return size; } @@ -953,14 +994,18 @@ class BurnTransactionExpired extends Event { value0, output, ); - _i1.U8SequenceCodec.codec.encodeTo( + const _i1.OptionCodec<_i3.AccountId32>(_i3.AccountId32Codec()).encodeTo( value1, output, ); - _i1.U64Codec.codec.encodeTo( + _i1.U8SequenceCodec.codec.encodeTo( value2, output, ); + _i1.U64Codec.codec.encodeTo( + value3, + output, + ); } @override @@ -971,17 +1016,19 @@ class BurnTransactionExpired extends Event { ) || other is BurnTransactionExpired && other.value0 == value0 && + other.value1 == value1 && _i8.listsEqual( - other.value1, - value1, + other.value2, + value2, ) && - other.value2 == value2; + other.value3 == value3; @override int get hashCode => Object.hash( value0, value1, value2, + value3, ); } @@ -1193,7 +1240,7 @@ class RefundTransactionProcessed extends Event { _i7.RefundTransaction.codec.decode(input)); } - /// RefundTransaction + /// RefundTransaction> final _i7.RefundTransaction value0; @override diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/types/burn_transaction.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/types/burn_transaction.dart index 7ceae5ee..3c8a91aa 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/types/burn_transaction.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/types/burn_transaction.dart @@ -1,15 +1,17 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:typed_data' as _i3; +import 'dart:typed_data' as _i4; import 'package:polkadart/scale_codec.dart' as _i1; -import 'package:quiver/collection.dart' as _i4; +import 'package:quiver/collection.dart' as _i5; -import 'stellar_signature.dart' as _i2; +import '../../sp_core/crypto/account_id32.dart' as _i2; +import 'stellar_signature.dart' as _i3; class BurnTransaction { const BurnTransaction({ required this.block, required this.amount, + this.source, required this.target, required this.signatures, required this.sequenceNumber, @@ -25,24 +27,28 @@ class BurnTransaction { /// u64 final BigInt amount; + /// Option + final _i2.AccountId32? source; + /// Vec final List target; /// Vec - final List<_i2.StellarSignature> signatures; + final List<_i3.StellarSignature> signatures; /// u64 final BigInt sequenceNumber; static const $BurnTransactionCodec codec = $BurnTransactionCodec(); - _i3.Uint8List encode() { + _i4.Uint8List encode() { return codec.encode(this); } Map toJson() => { 'block': block, 'amount': amount, + 'source': source?.toList(), 'target': target, 'signatures': signatures.map((value) => value.toJson()).toList(), 'sequenceNumber': sequenceNumber, @@ -57,11 +63,12 @@ class BurnTransaction { other is BurnTransaction && other.block == block && other.amount == amount && - _i4.listsEqual( + other.source == source && + _i5.listsEqual( other.target, target, ) && - _i4.listsEqual( + _i5.listsEqual( other.signatures, signatures, ) && @@ -71,6 +78,7 @@ class BurnTransaction { int get hashCode => Object.hash( block, amount, + source, target, signatures, sequenceNumber, @@ -93,11 +101,15 @@ class $BurnTransactionCodec with _i1.Codec { obj.amount, output, ); + const _i1.OptionCodec<_i2.AccountId32>(_i2.AccountId32Codec()).encodeTo( + obj.source, + output, + ); _i1.U8SequenceCodec.codec.encodeTo( obj.target, output, ); - const _i1.SequenceCodec<_i2.StellarSignature>(_i2.StellarSignature.codec) + const _i1.SequenceCodec<_i3.StellarSignature>(_i3.StellarSignature.codec) .encodeTo( obj.signatures, output, @@ -113,9 +125,11 @@ class $BurnTransactionCodec with _i1.Codec { return BurnTransaction( block: _i1.U32Codec.codec.decode(input), amount: _i1.U64Codec.codec.decode(input), + source: const _i1.OptionCodec<_i2.AccountId32>(_i2.AccountId32Codec()) + .decode(input), target: _i1.U8SequenceCodec.codec.decode(input), - signatures: const _i1.SequenceCodec<_i2.StellarSignature>( - _i2.StellarSignature.codec) + signatures: const _i1.SequenceCodec<_i3.StellarSignature>( + _i3.StellarSignature.codec) .decode(input), sequenceNumber: _i1.U64Codec.codec.decode(input), ); @@ -126,10 +140,13 @@ class $BurnTransactionCodec with _i1.Codec { int size = 0; size = size + _i1.U32Codec.codec.sizeHint(obj.block); size = size + _i1.U64Codec.codec.sizeHint(obj.amount); + size = size + + const _i1.OptionCodec<_i2.AccountId32>(_i2.AccountId32Codec()) + .sizeHint(obj.source); size = size + _i1.U8SequenceCodec.codec.sizeHint(obj.target); size = size + - const _i1.SequenceCodec<_i2.StellarSignature>( - _i2.StellarSignature.codec) + const _i1.SequenceCodec<_i3.StellarSignature>( + _i3.StellarSignature.codec) .sizeHint(obj.signatures); size = size + _i1.U64Codec.codec.sizeHint(obj.sequenceNumber); return size; diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/types/storage_version.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/types/storage_version.dart new file mode 100644 index 00000000..b08e2b4a --- /dev/null +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_bridge/types/storage_version.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 StorageVersion { + v1('V1', 0), + v2('V2', 1); + + const StorageVersion( + this.variantName, + this.codecIndex, + ); + + factory StorageVersion.decode(_i1.Input input) { + return codec.decode(input); + } + + final String variantName; + + final int codecIndex; + + static const $StorageVersionCodec codec = $StorageVersionCodec(); + + String toJson() => variantName; + _i2.Uint8List encode() { + return codec.encode(this); + } +} + +class $StorageVersionCodec with _i1.Codec { + const $StorageVersionCodec(); + + @override + StorageVersion decode(_i1.Input input) { + final index = _i1.U8Codec.codec.decode(input); + switch (index) { + case 0: + return StorageVersion.v1; + case 1: + return StorageVersion.v2; + default: + throw Exception('StorageVersion: Invalid variant index: "$index"'); + } + } + + @override + void encodeTo( + StorageVersion value, + _i1.Output output, + ) { + _i1.U8Codec.codec.encodeTo( + value.codecIndex, + output, + ); + } +} diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/call.dart index f026a251..d54710d3 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/call.dart @@ -3,7 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -105,6 +105,7 @@ class $CallCodec with _i1.Codec { } } +/// See [`Pallet::set_prices`]. class SetPrices extends Call { const SetPrices({ required this.price, @@ -121,7 +122,7 @@ class SetPrices extends Call { /// u32 final int price; - /// T::BlockNumber + /// BlockNumberFor final int blockNumber; @override @@ -171,6 +172,7 @@ class SetPrices extends Call { ); } +/// See [`Pallet::set_min_tft_price`]. class SetMinTftPrice extends Call { const SetMinTftPrice({required this.price}); @@ -215,6 +217,7 @@ class SetMinTftPrice extends Call { int get hashCode => price.hashCode; } +/// See [`Pallet::set_max_tft_price`]. class SetMaxTftPrice extends Call { const SetMaxTftPrice({required this.price}); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/error.dart index 32cfe03a..2a5c4b2f 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { errFetchingPrice('ErrFetchingPrice', 0), offchainSignedTxError('OffchainSignedTxError', 1), diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/event.dart index d11b2f3e..1c97631a 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_tft_price/pallet/event.dart @@ -6,10 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_timestamp/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_timestamp/pallet/call.dart index 8599457a..ab12e58f 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_timestamp/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_timestamp/pallet/call.dart @@ -3,7 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -77,21 +77,7 @@ class $CallCodec with _i1.Codec { } } -/// Set the current time. -/// -/// This call should be invoked exactly once per block. It will panic at the finalization -/// phase, if this call hasn't been invoked by that time. -/// -/// The timestamp should be greater than the previous one by the amount specified by -/// `MinimumPeriod`. -/// -/// The dispatch origin for this call must be `Inherent`. -/// -/// ## Complexity -/// - `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`) -/// - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in -/// `on_finalize`) -/// - 1 event handler `on_timestamp_set`. Must be `O(1)`. +/// See [`Pallet::set`]. class Set extends Call { const Set({required this.now}); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_transaction_payment/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_transaction_payment/pallet/event.dart index c89e3965..c596daed 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_transaction_payment/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_transaction_payment/pallet/event.dart @@ -6,10 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/call.dart index b034992c..0226c010 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/call.dart @@ -8,7 +8,7 @@ import '../../sp_weights/weight_v2/weight.dart' as _i5; import '../../tfchain_runtime/origin_caller.dart' as _i4; import '../../tfchain_runtime/runtime_call.dart' as _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -155,24 +155,7 @@ class $CallCodec with _i1.Codec { } } -/// Send a batch of dispatch calls. -/// -/// May be called from any origin except `None`. -/// -/// - `calls`: The calls to be dispatched from the same origin. The number of call must not -/// exceed the constant: `batched_calls_limit` (available in constant metadata). -/// -/// If origin is root then the calls are dispatched without checking origin filter. (This -/// includes bypassing `frame_system::Config::BaseCallFilter`). -/// -/// ## Complexity -/// - O(C) where C is the number of calls to be batched. -/// -/// This will return `Ok` in all circumstances. To determine the success of the batch, an -/// event is deposited. If a call failed and the batch was interrupted, then the -/// `BatchInterrupted` event is deposited, along with the number of successful calls made -/// and the error of the failed call. If all were successful, then the `BatchCompleted` -/// event is deposited. +/// See [`Pallet::batch`]. class Batch extends Call { const Batch({required this.calls}); @@ -226,19 +209,7 @@ class Batch extends Call { int get hashCode => calls.hashCode; } -/// Send a call through an indexed pseudonym of the sender. -/// -/// Filter from origin are passed along. The call will be dispatched with an origin which -/// use the same filter as the origin of this call. -/// -/// NOTE: If you need to ensure that any account-based filtering is not honored (i.e. -/// because you expect `proxy` to have been used prior in the call stack and you do not want -/// the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1` -/// in the Multisig pallet instead. -/// -/// NOTE: Prior to version *12, this was called `as_limited_sub`. -/// -/// The dispatch origin for this call must be _Signed_. +/// See [`Pallet::as_derivative`]. class AsDerivative extends Call { const AsDerivative({ required this.index, @@ -303,19 +274,7 @@ class AsDerivative extends Call { ); } -/// Send a batch of dispatch calls and atomically execute them. -/// The whole transaction will rollback and fail if any of the calls failed. -/// -/// May be called from any origin except `None`. -/// -/// - `calls`: The calls to be dispatched from the same origin. The number of call must not -/// exceed the constant: `batched_calls_limit` (available in constant metadata). -/// -/// If origin is root then the calls are dispatched without checking origin filter. (This -/// includes bypassing `frame_system::Config::BaseCallFilter`). -/// -/// ## Complexity -/// - O(C) where C is the number of calls to be batched. +/// See [`Pallet::batch_all`]. class BatchAll extends Call { const BatchAll({required this.calls}); @@ -368,12 +327,7 @@ class BatchAll extends Call { int get hashCode => calls.hashCode; } -/// Dispatches a function call with a provided origin. -/// -/// The dispatch origin for this call must be _Root_. -/// -/// ## Complexity -/// - O(1). +/// See [`Pallet::dispatch_as`]. class DispatchAs extends Call { const DispatchAs({ required this.asOrigin, @@ -438,19 +392,7 @@ class DispatchAs extends Call { ); } -/// Send a batch of dispatch calls. -/// Unlike `batch`, it allows errors and won't interrupt. -/// -/// May be called from any origin except `None`. -/// -/// - `calls`: The calls to be dispatched from the same origin. The number of call must not -/// exceed the constant: `batched_calls_limit` (available in constant metadata). -/// -/// If origin is root then the calls are dispatch without checking origin filter. (This -/// includes bypassing `frame_system::Config::BaseCallFilter`). -/// -/// ## Complexity -/// - O(C) where C is the number of calls to be batched. +/// See [`Pallet::force_batch`]. class ForceBatch extends Call { const ForceBatch({required this.calls}); @@ -503,12 +445,7 @@ class ForceBatch extends Call { int get hashCode => calls.hashCode; } -/// Dispatch a function call with a specified weight. -/// -/// This function does not check the weight of the call, and instead allows the -/// Root origin to specify the weight of the call. -/// -/// The dispatch origin for this call must be _Root_. +/// See [`Pallet::with_weight`]. class WithWeight extends Call { const WithWeight({ required this.call, diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/error.dart index b13816e1..6649ae69 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { /// Too many calls batched. tooManyCalls('TooManyCalls', 0); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/event.dart index 0475e14d..0481142b 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_utility/pallet/event.dart @@ -5,10 +5,7 @@ import 'package:polkadart/scale_codec.dart' as _i1; import '../../sp_runtime/dispatch_error.dart' as _i3; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/call.dart index 5ab232aa..a1af67d1 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/call.dart @@ -7,7 +7,7 @@ import 'package:quiver/collection.dart' as _i5; import '../../sp_core/crypto/account_id32.dart' as _i3; import '../../sp_runtime/multiaddress/multi_address.dart' as _i4; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -152,14 +152,7 @@ class $CallCodec with _i1.Codec { } } -/// Create a request to become a validator -/// Validator account (signer): the account of the validator (this account will be added to the council) -/// Validator node account: the account that will validate on consensus layer -/// Stash account: the "bank" account of the validator (where rewards should be sent to) the stash should be bonded to a validator -/// Description: why someone wants to become a validator -/// Tf Connect ID: the threefold connect ID of the person who wants to become a validator -/// Info: some public info about the validator (website link, blog link, ..) -/// A user can only have 1 validator request at a time +/// See [`Pallet::create_validator_request`]. class CreateValidatorRequest extends Call { const CreateValidatorRequest({ required this.validatorNodeAccount, @@ -280,10 +273,7 @@ class CreateValidatorRequest extends Call { ); } -/// Start participating in consensus -/// Will activate the Validator node account on consensus level -/// A user can only call this if his request to be a validator is approved by the council -/// Should be called when his node is synced and ready to start validating +/// See [`Pallet::activate_validator_node`]. class ActivateValidatorNode extends Call { const ActivateValidatorNode(); @@ -304,10 +294,7 @@ class ActivateValidatorNode extends Call { int get hashCode => runtimeType.hashCode; } -/// Change validator node account -/// In case the Validator wishes to change his validator node account -/// he can call this method with the new node validator account -/// this new account will be added as a new consensus validator if he is validating already +/// See [`Pallet::change_validator_node_account`]. class ChangeValidatorNodeAccount extends Call { const ChangeValidatorNodeAccount({required this.newNodeValidatorAccount}); @@ -360,8 +347,7 @@ class ChangeValidatorNodeAccount extends Call { int get hashCode => newNodeValidatorAccount.hashCode; } -/// Bond an account to a validator account -/// Just proves that the stash account is indeed under control of the validator account +/// See [`Pallet::bond`]. class Bond extends Call { const Bond({required this.validator}); @@ -406,9 +392,7 @@ class Bond extends Call { int get hashCode => validator.hashCode; } -/// Approve validator (council) -/// Approves a validator to be added as a council member and -/// to participate in consensus +/// See [`Pallet::approve_validator`]. class ApproveValidator extends Call { const ApproveValidator({required this.validatorAccount}); @@ -454,12 +438,7 @@ class ApproveValidator extends Call { int get hashCode => validatorAccount.hashCode; } -/// Remove validator -/// Removes a validator from: -/// 1. Council -/// 2. Storage -/// 3. Consensus -/// Can only be called by the user or the council +/// See [`Pallet::remove_validator`]. class RemoveValidator extends Call { const RemoveValidator({required this.validatorAccount}); diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/error.dart index 513902a4..71a53b87 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { badOrigin('BadOrigin', 0), notCouncilMember('NotCouncilMember', 1), diff --git a/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/event.dart index 4f63c4fa..3a4e9833 100644 --- a/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/pallet_validator/pallet/event.dart @@ -7,10 +7,7 @@ import 'package:quiver/collection.dart' as _i5; import '../../sp_core/crypto/account_id32.dart' as _i3; import '../types/validator.dart' as _i4; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/sp_runtime/dispatch_error.dart b/packages/tfchain_client/lib/generated/dev/types/sp_runtime/dispatch_error.dart index 5f1401c9..11c8c8b1 100644 --- a/packages/tfchain_client/lib/generated/dev/types/sp_runtime/dispatch_error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/sp_runtime/dispatch_error.dart @@ -86,6 +86,10 @@ class $DispatchError { Unavailable unavailable() { return Unavailable(); } + + RootNotAllowed rootNotAllowed() { + return RootNotAllowed(); + } } class $DispatchErrorCodec with _i1.Codec { @@ -121,6 +125,8 @@ class $DispatchErrorCodec with _i1.Codec { return const Corruption(); case 12: return const Unavailable(); + case 13: + return const RootNotAllowed(); default: throw Exception('DispatchError: Invalid variant index: "$index"'); } @@ -171,6 +177,9 @@ class $DispatchErrorCodec with _i1.Codec { case Unavailable: (value as Unavailable).encodeTo(output); break; + case RootNotAllowed: + (value as RootNotAllowed).encodeTo(output); + break; default: throw Exception( 'DispatchError: Unsupported "$value" of type "${value.runtimeType}"'); @@ -206,6 +215,8 @@ class $DispatchErrorCodec with _i1.Codec { return 1; case Unavailable: return 1; + case RootNotAllowed: + return 1; default: throw Exception( 'DispatchError: Unsupported "$value" of type "${value.runtimeType}"'); @@ -560,3 +571,23 @@ class Unavailable extends DispatchError { @override int get hashCode => runtimeType.hashCode; } + +class RootNotAllowed extends DispatchError { + const RootNotAllowed(); + + @override + Map toJson() => {'RootNotAllowed': null}; + + void encodeTo(_i1.Output output) { + _i1.U8Codec.codec.encodeTo( + 13, + output, + ); + } + + @override + bool operator ==(Object other) => other is RootNotAllowed; + + @override + int get hashCode => runtimeType.hashCode; +} diff --git a/packages/tfchain_client/lib/generated/dev/types/sp_runtime/token_error.dart b/packages/tfchain_client/lib/generated/dev/types/sp_runtime/token_error.dart index a7804a4e..1b882412 100644 --- a/packages/tfchain_client/lib/generated/dev/types/sp_runtime/token_error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/sp_runtime/token_error.dart @@ -12,7 +12,8 @@ enum TokenError { frozen('Frozen', 5), unsupported('Unsupported', 6), cannotCreateHold('CannotCreateHold', 7), - notExpendable('NotExpendable', 8); + notExpendable('NotExpendable', 8), + blocked('Blocked', 9); const TokenError( this.variantName, @@ -60,6 +61,8 @@ class $TokenErrorCodec with _i1.Codec { return TokenError.cannotCreateHold; case 8: return TokenError.notExpendable; + case 9: + return TokenError.blocked; default: throw Exception('TokenError: Invalid variant index: "$index"'); } diff --git a/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/call.dart b/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/call.dart index faf3591c..e91104e0 100644 --- a/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/call.dart +++ b/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/call.dart @@ -6,7 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; -/// Contains one variant per dispatchable that can be called by an extrinsic. +/// Contains a variant per dispatchable extrinsic that this pallet has. abstract class Call { const Call(); @@ -102,13 +102,7 @@ class $CallCodec with _i1.Codec { } } -/// Add a new validator. -/// -/// New validator's session keys should be set in Session pallet before -/// calling this. -/// -/// The origin can be configured using the `AddRemoveOrigin` type in the -/// host runtime. Can also be set to sudo/root. +/// See [`Pallet::add_validator`]. class AddValidator extends Call { const AddValidator({required this.validatorId}); @@ -157,10 +151,7 @@ class AddValidator extends Call { int get hashCode => validatorId.hashCode; } -/// Remove a validator. -/// -/// The origin can be configured using the `AddRemoveOrigin` type in the -/// host runtime. Can also be set to sudo/root. +/// See [`Pallet::remove_validator`]. class RemoveValidator extends Call { const RemoveValidator({required this.validatorId}); @@ -210,9 +201,7 @@ class RemoveValidator extends Call { int get hashCode => validatorId.hashCode; } -/// Add an approved validator again when it comes back online. -/// -/// For this call, the dispatch origin must be the validator itself. +/// See [`Pallet::add_validator_again`]. class AddValidatorAgain extends Call { const AddValidatorAgain({required this.validatorId}); diff --git a/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/error.dart b/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/error.dart index 0b633e04..8821dc3f 100644 --- a/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/error.dart +++ b/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/error.dart @@ -3,10 +3,7 @@ import 'dart:typed_data' as _i2; import 'package:polkadart/scale_codec.dart' as _i1; -/// -/// Custom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/) -/// of this pallet. -/// +/// The `Error` enum of this pallet. enum Error { /// Target (post-removal) validator count is below the minimum. tooLowValidatorCount('TooLowValidatorCount', 0), diff --git a/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/event.dart b/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/event.dart index 0d5b61af..c73b15bf 100644 --- a/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/event.dart +++ b/packages/tfchain_client/lib/generated/dev/types/substrate_validator_set/pallet/event.dart @@ -6,10 +6,7 @@ import 'package:quiver/collection.dart' as _i4; import '../../sp_core/crypto/account_id32.dart' as _i3; -/// -/// The [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted -/// by this pallet. -/// +/// The `Event` enum of this pallet abstract class Event { const Event(); diff --git a/packages/tfchain_client/lib/generated/dev/types/tfchain_runtime/origin_caller.dart b/packages/tfchain_client/lib/generated/dev/types/tfchain_runtime/origin_caller.dart index a64fb60e..b3561c46 100644 --- a/packages/tfchain_client/lib/generated/dev/types/tfchain_runtime/origin_caller.dart +++ b/packages/tfchain_client/lib/generated/dev/types/tfchain_runtime/origin_caller.dart @@ -193,7 +193,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 _i5.Void value0; @override diff --git a/packages/tfchain_client/lib/generated/dev/types/tuples_2.dart b/packages/tfchain_client/lib/generated/dev/types/tuples_2.dart index 9dbc9413..5257f525 100644 --- a/packages/tfchain_client/lib/generated/dev/types/tuples_2.dart +++ b/packages/tfchain_client/lib/generated/dev/types/tuples_2.dart @@ -1,8 +1,8 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:polkadart/scale_codec.dart' as _i1; -class Tuple8 { - const Tuple8( +class Tuple9 { + const Tuple9( this.value0, this.value1, this.value2, @@ -11,6 +11,7 @@ class Tuple8 { this.value5, this.value6, this.value7, + this.value8, ); final T0 value0; @@ -28,11 +29,13 @@ class Tuple8 { final T6 value6; final T7 value7; + + final T8 value8; } -class Tuple8Codec - with _i1.Codec> { - const Tuple8Codec( +class Tuple9Codec + with _i1.Codec> { + const Tuple9Codec( this.codec0, this.codec1, this.codec2, @@ -41,6 +44,7 @@ class Tuple8Codec this.codec5, this.codec6, this.codec7, + this.codec8, ); final _i1.Codec codec0; @@ -59,9 +63,11 @@ class Tuple8Codec final _i1.Codec codec7; + final _i1.Codec codec8; + @override void encodeTo( - Tuple8 tuple, + Tuple9 tuple, _i1.Output output, ) { codec0.encodeTo(tuple.value0, output); @@ -72,11 +78,12 @@ class Tuple8Codec codec5.encodeTo(tuple.value5, output); codec6.encodeTo(tuple.value6, output); codec7.encodeTo(tuple.value7, output); + codec8.encodeTo(tuple.value8, output); } @override - Tuple8 decode(_i1.Input input) { - return Tuple8( + Tuple9 decode(_i1.Input input) { + return Tuple9( codec0.decode(input), codec1.decode(input), codec2.decode(input), @@ -85,11 +92,12 @@ class Tuple8Codec codec5.decode(input), codec6.decode(input), codec7.decode(input), + codec8.decode(input), ); } @override - int sizeHint(Tuple8 tuple) { + int sizeHint(Tuple9 tuple) { int size = 0; size += codec0.sizeHint(tuple.value0); size += codec1.sizeHint(tuple.value1); @@ -99,6 +107,7 @@ class Tuple8Codec size += codec5.sizeHint(tuple.value5); size += codec6.sizeHint(tuple.value6); size += codec7.sizeHint(tuple.value7); + size += codec8.sizeHint(tuple.value8); return size; } } diff --git a/packages/tfchain_client/lib/src/client.dart b/packages/tfchain_client/lib/src/client.dart index 86e2070a..0698dd89 100644 --- a/packages/tfchain_client/lib/src/client.dart +++ b/packages/tfchain_client/lib/src/client.dart @@ -3,7 +3,7 @@ part of '../tfchain_client.dart'; class QueryClient { static Map connections = {}; final String url; - late Provider? provider; + late WsProvider? provider; late polkadot.Dev api; QueryTwins? _twins; QueryContracts? _contracts; @@ -76,24 +76,79 @@ class QueryClient { Future connect() async { _checkInputs(); + WsProvider? obtainedProvider; + polkadot.Dev? obtainedApi; if (connections.containsKey(url)) { - provider = connections[url]["provider"]; - api = connections[url]["api"]; - if (!provider!.isConnected()) { - try { - await api.connect(); - } catch (e) { - if (e.toString() != "Exception: Already connected") { + final connectionEntry = connections[url]; + obtainedProvider = connectionEntry?["provider"] as WsProvider?; + obtainedApi = connectionEntry?["api"] as polkadot.Dev?; + if (obtainedProvider == null || obtainedApi == null) { + connections.remove(url); + obtainedProvider = null; + obtainedApi = null; + } else { + if (!obtainedProvider.isConnected()) { + try { + await obtainedProvider.connect(); + } catch (e, stackTrace) { + print( + '[ERROR] Failed to connect existing provider from map for $url: $e\nStack: $stackTrace'); + connections.remove(url); + try { + await obtainedProvider.disconnect(); + } catch (_) {} + obtainedProvider = null; + obtainedApi = null; throw e; } } } - } else { - provider = Provider.fromUri(Uri.parse(url)); - api = polkadot.Dev(provider!); - final map = {"provider": provider, "api": api}; + } + + if (obtainedProvider == null) { + print('[INFO] Creating new provider for $url...'); + final uri = Uri.parse(url); + obtainedProvider = WsProvider(uri, autoConnect: false); + try { + await obtainedProvider.connect(); + print('[INFO] New provider for $url connected.'); + } catch (e, stackTrace) { + print( + '[ERROR] New provider connection failed for $url: $e\n$stackTrace'); + try { + await obtainedProvider.disconnect(); + } catch (_) {} + obtainedProvider = null; + throw e; + } + + obtainedApi = polkadot.Dev(obtainedProvider); + + final map = {"provider": obtainedProvider, "api": obtainedApi}; connections[url] = map; } + + try { + await obtainedProvider.isReady(); + print('[INFO] Provider for $url is fully ready.'); + } catch (e, stackTrace) { + print( + '[ERROR] Provider readiness check failed for $url: $e\n$stackTrace'); + if (connections.containsKey(url)) { + final failedConnection = connections.remove(url); + final providerToDispose = failedConnection?["provider"] as WsProvider?; + if (providerToDispose != null) { + try { + await providerToDispose.disconnect(); + } catch (_) {} + } + } + obtainedProvider = null; + obtainedApi = null; + throw e; + } + provider = obtainedProvider; + api = obtainedApi!; } Future disconnect() async { diff --git a/packages/tfchain_client/lib/src/contracts.dart b/packages/tfchain_client/lib/src/contracts.dart index fc4a4f56..7d292774 100644 --- a/packages/tfchain_client/lib/src/contracts.dart +++ b/packages/tfchain_client/lib/src/contracts.dart @@ -22,7 +22,7 @@ class QueryContracts { return res; } - Future> getActiveContracts({required int nodeId}) async { + Future> getActiveContracts({required int nodeId}) async { final res = await client.api.query.smartContractModule.activeNodeContracts(nodeId); return res; diff --git a/packages/tfchain_client/lib/src/farms.dart b/packages/tfchain_client/lib/src/farms.dart index 0155c134..e1a24f21 100644 --- a/packages/tfchain_client/lib/src/farms.dart +++ b/packages/tfchain_client/lib/src/farms.dart @@ -21,7 +21,7 @@ class Farms extends QueryFarms { final Client client; Future create( - {required String name, required List? publicIps}) async { + {required String name, required List publicIps}) async { final extrinsic = client.api.tx.tfgridModule .createFarm(name: name.codeUnits, publicIps: publicIps); await client.apply(extrinsic); diff --git a/packages/tfchain_client/lib/tfchain_client.dart b/packages/tfchain_client/lib/tfchain_client.dart index 8d1e3c47..ec27d1ef 100644 --- a/packages/tfchain_client/lib/tfchain_client.dart +++ b/packages/tfchain_client/lib/tfchain_client.dart @@ -8,10 +8,10 @@ import 'package:polkadart/polkadart.dart' AuthorApi, ExtrinsicPayload, Hasher, - Provider, SignatureType, SigningPayload, - StateApi; + StateApi, + WsProvider; import 'package:polkadart/scale_codec.dart'; import 'package:polkadart_keyring/polkadart_keyring.dart'; import 'package:signer/signer.dart' as Signer; diff --git a/packages/tfchain_client/pubspec.lock b/packages/tfchain_client/pubspec.lock index b834d64f..4dfaad88 100644 --- a/packages/tfchain_client/pubspec.lock +++ b/packages/tfchain_client/pubspec.lock @@ -34,10 +34,10 @@ packages: dependency: transitive description: name: args - sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.6.0" + version: "2.7.0" async: dependency: transitive description: @@ -66,10 +66,10 @@ packages: dependency: transitive description: name: bip39_mnemonic - sha256: "3ae6ed74b97a0b820e71d01b75ac4bc5b036a8bb427d5ee5827427d2872eefb0" + sha256: e36c1f1fecd938d433b8f7a1e74d5bc721e16816b59dbac5b31307f079d3b3bc url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "3.0.9" boolean_selector: dependency: transitive description: @@ -126,6 +126,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.11.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" crypto: dependency: transitive description: @@ -146,10 +154,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac" url: "https://pub.dev" source: hosted - version: "2.3.7" + version: "3.0.1" ed25519_edwards: dependency: transitive description: @@ -290,10 +298,10 @@ packages: dependency: transitive description: name: json_schema - sha256: b183ba828374365a89b81246c06a9a636935897d509cd846998bbc0d9bd0a2cf + sha256: fc8c3e280c7647ed8e94f2565ba107ef4aff94b096764b8460a7e1ae39f20382 url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.2.1" lints: dependency: "direct dev" description: @@ -394,34 +402,34 @@ packages: dependency: "direct main" description: name: polkadart - sha256: "46604b1c6fb4f35b564194e51c53a9a77a15291671db6cfbed9fb188831b8560" + sha256: b2369eeb33ee155dcdf2a7af18de8961037b9cc28640e200f1475cea497bc3ab url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.7.1" polkadart_cli: dependency: "direct main" description: name: polkadart_cli - sha256: ea16dc9eef662fed6c330f357b38402bc1fd2b862b4e47bf1f9d84c48fa3135b + sha256: e02782bfd77446c6705ef61d378d49e25df8a2826c575825d7abf2047ea6c07b url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.7.0" polkadart_keyring: dependency: "direct main" description: name: polkadart_keyring - sha256: bed5af744e801e88bf7d067ea477fc7eb0a5955801491a8b3e57b578d9de8bea + sha256: e99a93c845466dfb53e23bf650bd6ccd772d7cefe7c7ff2c93c6e86d387e5215 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.7.0" polkadart_scale_codec: dependency: transitive description: name: polkadart_scale_codec - sha256: a9b295ddbd8ace501066800ab521575095464f324cb4185be386bd78ee9316d0 + sha256: db0d61adc58d8b395e663558ba6b2aed2ab2291d343733c49c693de62a2498d2 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.5.0" pool: dependency: transitive description: @@ -474,10 +482,10 @@ packages: dependency: transitive description: name: secp256k1_ecdsa - sha256: "8d516e3f9ad716e721a4e961b890bb03bf3c68ba51bca256a617a055e3c7ef89" + sha256: "50bca61d6ad872829f6bd05c17a96441c1bcfe456ed5bf8cba710ceac86db5f1" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.6.1" shelf: dependency: transitive description: @@ -513,11 +521,9 @@ packages: signer: dependency: "direct main" description: - path: "packages/signer" - ref: development - resolved-ref: "5fb661e64da43a277caa0ad58a9551e176238222" - url: "https://github.com/threefoldtech/tfgrid-sdk-dart.git" - source: git + path: "../signer" + relative: true + source: path version: "0.1.0" source_map_stack_trace: dependency: transitive @@ -547,18 +553,18 @@ packages: dependency: transitive description: name: sr25519 - sha256: d10247ff98330efb658042357c8c7fc46074c3c160ea16d3dcdfedf8a9a87b60 + sha256: "122c930a933da6af018ec4a2ccdb853a7d0eb1a0891bfb03467e366b56f86f12" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.7.0" ss58: dependency: transitive description: name: ss58 - sha256: "74dce6fbfbac9dba5f87b8f104ed2b7253c6aeac39d508f088044cf4827d9cd7" + sha256: ad12bcdc909e73648aba52754b1eab81880bd2cbc4fc6cbaa02695affe49201d url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" stack_trace: dependency: transitive description: @@ -595,18 +601,18 @@ packages: dependency: "direct main" description: name: substrate_bip39 - sha256: "6680dc10eb4f165659374eec5c5aa75920e720b3c00b65490e1dfe3d5ea5a52d" + sha256: ba880015808079804f40a0fde8c5bff0315ec6792fe3a4281a704e408f1c6bdb url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.7.0" substrate_metadata: dependency: "direct main" description: name: substrate_metadata - sha256: "878bf0e818eed4543f0c9af303b8ffe201cb69bf56c32d717f1bdef88e691836" + sha256: "6f9e9e3e1078c0c143dd63824043370b9df582d34c431a759253ce2f9cbb7f13" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.5.0" term_glyph: dependency: transitive description: @@ -695,14 +701,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + web_socket_client: + dependency: transitive + description: + name: web_socket_client + sha256: "22264cb5143e9bb55c943d6b051d207fdd6470ffb77ee45778c9a7a0fda100bc" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "0.2.0" webkit_inspection_protocol: dependency: transitive description: diff --git a/packages/tfchain_client/pubspec.yaml b/packages/tfchain_client/pubspec.yaml index 85f2dd88..fe5ec2da 100644 --- a/packages/tfchain_client/pubspec.yaml +++ b/packages/tfchain_client/pubspec.yaml @@ -6,10 +6,10 @@ environment: sdk: ^3.4.0 dependencies: - polkadart: ^0.5.0 - polkadart_keyring: ^0.5.0 - substrate_bip39: ^0.5.0 - polkadart_cli: ^0.5.0 + polkadart: ^0.7.1 + polkadart_keyring: ^0.7.0 + substrate_bip39: ^0.7.0 + polkadart_cli: ^0.7.0 hex: ^0.2.0 bip39: ^1.0.6 moment_dart: ^3.2.1 @@ -19,7 +19,7 @@ dependencies: ref: development path: packages/signer hashlib: ^1.21.1 - substrate_metadata: ^1.3.0 + substrate_metadata: ^1.4.0 dev_dependencies: lints: ^5.1.1 diff --git a/packages/tfchain_client/test/contracts_test.dart b/packages/tfchain_client/test/contracts_test.dart index 32dc9a6a..82b46333 100644 --- a/packages/tfchain_client/test/contracts_test.dart +++ b/packages/tfchain_client/test/contracts_test.dart @@ -35,7 +35,7 @@ void main() { test('Test Get Active Contracts by wrong node Id', () async { try { - List contracts = + List contracts = await setupManager.client.contracts.getActiveContracts(nodeId: -21); expect(contracts, isNotEmpty); } catch (error) { diff --git a/packages/tfchain_client/test/globals.dart b/packages/tfchain_client/test/globals.dart new file mode 100644 index 00000000..61d20636 --- /dev/null +++ b/packages/tfchain_client/test/globals.dart @@ -0,0 +1,18 @@ +library globals; + +import 'setup_manager.dart'; + +SetupManager? _globalSetupManager; + +Future getSetupManager() async { + if (_globalSetupManager != null && SetupManager.isInitialized) { + print("_setupManager.isInitialized ${SetupManager.isInitialized}"); + return _globalSetupManager!; + } + + _globalSetupManager = SetupManager(); + _globalSetupManager!.setInitializationFlags(queryClient: true, client: true); + await _globalSetupManager!.setup(); + SetupManager.isInitialized = true; + return _globalSetupManager!; +} diff --git a/packages/tfchain_client/test/setup_manager.dart b/packages/tfchain_client/test/setup_manager.dart index 73edd04c..2e11da37 100644 --- a/packages/tfchain_client/test/setup_manager.dart +++ b/packages/tfchain_client/test/setup_manager.dart @@ -84,6 +84,7 @@ String generateGatewayIPv4FromIp(String ip) { class SetupManager { static final SetupManager _instance = SetupManager._internal(); + static bool isInitialized = false; factory SetupManager() { return _instance; @@ -120,6 +121,13 @@ class SetupManager { } Future setup() async { + // Return early if setup is already done + if (isInitialized) { + print("Setup is already complete. Skipping setup."); + return; + } + + print("Starting setup..."); _url = Platform.environment['URL'] ?? 'ws://0.0.0.0:9944'; _type = Platform.environment['KEYPAIR_TYPE'] ?? 'sr25519'; _relay = "relay.dev.grid.tf"; @@ -152,13 +160,15 @@ class SetupManager { documentLink: "https://library.threefold.me/info/legal/", documentHash: hashString.codeUnits); _twinId = await _client.twins.create(relay: _relay, pk: []); - print(_twinId); + print('_twinId $_twinId'); } if (_initializeQueryClient) { _queryClient = QueryClient(_url); await _queryClient.connect(); } + + isInitialized = true; } Future teardownAll() async {