difftreelog
chore fix code review requests
in: master
36 files changed
client/rpc/src/lib.rsdiffbeforeafterboth--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -248,8 +248,8 @@
) -> Result<Option<String>>;
/// Get whether an operator is approved by a given owner.
- #[method(name = "unique_isApprovedForAll")]
- fn is_approved_for_all(
+ #[method(name = "unique_allowanceForAll")]
+ fn allowance_for_all(
&self,
collection: CollectionId,
owner: CrossAccountId,
@@ -579,7 +579,7 @@
pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option<CollectionLimits>, unique_api);
pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option<String> => |o| o.map(|number| number.to_string()) , unique_api);
pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec<CrossAccountId>, unique_api);
- pass_method!(is_approved_for_all(collection: CollectionId, owner: CrossAccountId, operator: CrossAccountId) -> bool, unique_api);
+ pass_method!(allowance_for_all(collection: CollectionId, owner: CrossAccountId, operator: CrossAccountId) -> bool, unique_api);
}
impl<C, Block, BlockNumber, CrossAccountId, AccountId>
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -1535,7 +1535,7 @@
fn token_owner() -> Weight;
/// The price of setting approval for all
- fn set_approval_for_all() -> Weight;
+ fn set_allowance_for_all() -> Weight;
}
/// Weight info extension trait for refungible pallet.
@@ -1844,11 +1844,11 @@
/// Get extension for RFT collection.
fn refungible_extensions(&self) -> Option<&dyn RefungibleExtensions<T>>;
- /// An operator is allowed to transfer all tokens of the sender on their behalf.
+ /// The `operator` is allowed to transfer all tokens of the `owner` on their behalf.
/// * `owner` - Token owner
/// * `operator` - Operator
/// * `approve` - Should operator status be granted or revoked?
- fn set_approval_for_all(
+ fn set_allowance_for_all(
&self,
owner: T::CrossAccountId,
operator: T::CrossAccountId,
@@ -1856,7 +1856,7 @@
) -> DispatchResultWithPostInfo;
/// Tells whether the given `owner` approves the `operator`.
- fn is_approved_for_all(&self, owner: T::CrossAccountId, operator: T::CrossAccountId) -> bool;
+ fn allowance_for_all(&self, owner: T::CrossAccountId, operator: T::CrossAccountId) -> bool;
}
/// Extension for RFT collection.
pallets/fungible/src/common.rsdiffbeforeafterboth--- a/pallets/fungible/src/common.rs
+++ b/pallets/fungible/src/common.rs
@@ -108,7 +108,7 @@
Weight::zero()
}
- fn set_approval_for_all() -> Weight {
+ fn set_allowance_for_all() -> Weight {
Weight::zero()
}
}
@@ -429,7 +429,7 @@
<TotalSupply<T>>::try_get(self.id).ok()
}
- fn set_approval_for_all(
+ fn set_allowance_for_all(
&self,
_owner: T::CrossAccountId,
_operator: T::CrossAccountId,
@@ -438,7 +438,7 @@
fail!(<Error<T>>::SettingApprovalForAllNotAllowed)
}
- fn is_approved_for_all(&self, _owner: T::CrossAccountId, _operator: T::CrossAccountId) -> bool {
+ fn allowance_for_all(&self, _owner: T::CrossAccountId, _operator: T::CrossAccountId) -> bool {
false
}
}
pallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/benchmarking.rs
+++ b/pallets/nonfungible/src/benchmarking.rs
@@ -223,17 +223,17 @@
}: {collection.token_owner(item)}
- set_approval_for_all {
+ set_allowance_for_all {
bench_init!{
owner: sub; collection: collection(owner);
operator: cross_from_sub(owner); owner: cross_sub;
};
- }: {<Pallet<T>>::set_approval_for_all(&collection, &owner, &operator, true)}
+ }: {<Pallet<T>>::set_allowance_for_all(&collection, &owner, &operator, true)}
- is_approved_for_all {
+ allowance_for_all {
bench_init!{
owner: sub; collection: collection(owner);
operator: cross_from_sub(owner); owner: cross_sub;
};
- }: {<Pallet<T>>::is_approved_for_all(&collection, &owner, &operator)}
+ }: {<Pallet<T>>::allowance_for_all(&collection, &owner, &operator)}
}
pallets/nonfungible/src/common.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/common.rs
+++ b/pallets/nonfungible/src/common.rs
@@ -123,8 +123,8 @@
<SelfWeightOf<T>>::token_owner()
}
- fn set_approval_for_all() -> Weight {
- <SelfWeightOf<T>>::set_approval_for_all()
+ fn set_allowance_for_all() -> Weight {
+ <SelfWeightOf<T>>::set_allowance_for_all()
}
}
@@ -517,19 +517,19 @@
}
}
- fn set_approval_for_all(
+ fn set_allowance_for_all(
&self,
owner: T::CrossAccountId,
operator: T::CrossAccountId,
approve: bool,
) -> DispatchResultWithPostInfo {
with_weight(
- <Pallet<T>>::set_approval_for_all(self, &owner, &operator, approve),
- <CommonWeights<T>>::set_approval_for_all(),
+ <Pallet<T>>::set_allowance_for_all(self, &owner, &operator, approve),
+ <CommonWeights<T>>::set_allowance_for_all(),
)
}
- fn is_approved_for_all(&self, owner: T::CrossAccountId, operator: T::CrossAccountId) -> bool {
- <Pallet<T>>::is_approved_for_all(self, &owner, &operator)
+ fn allowance_for_all(&self, owner: T::CrossAccountId, operator: T::CrossAccountId) -> bool {
+ <Pallet<T>>::allowance_for_all(self, &owner, &operator)
}
}
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -472,8 +472,8 @@
/// @notice Sets or unsets the approval of a given operator.
/// The `operator` is allowed to transfer all tokens of the `caller` on their behalf.
/// @param operator Operator
- /// @param approved Is operator enabled or disabled
- #[weight(<SelfWeightOf<T>>::set_approval_for_all())]
+ /// @param approved Should operator status be granted or revoked?
+ #[weight(<SelfWeightOf<T>>::set_allowance_for_all())]
fn set_approval_for_all(
&mut self,
caller: caller,
@@ -483,7 +483,7 @@
let caller = T::CrossAccountId::from_eth(caller);
let operator = T::CrossAccountId::from_eth(operator);
- <Pallet<T>>::set_approval_for_all(self, &caller, &operator, approved)
+ <Pallet<T>>::set_allowance_for_all(self, &caller, &operator, approved)
.map_err(dispatch_to_evm::<T>)?;
Ok(())
}
@@ -494,13 +494,13 @@
Err("not implemented".into())
}
- /// @notice Tells whether an operator is approved by a given owner.
- #[weight(<SelfWeightOf<T>>::is_approved_for_all())]
+ /// @notice Tells whether the given `owner` approves the `operator`.
+ #[weight(<SelfWeightOf<T>>::allowance_for_all())]
fn is_approved_for_all(&self, owner: address, operator: address) -> Result<bool> {
let owner = T::CrossAccountId::from_eth(owner);
let operator = T::CrossAccountId::from_eth(operator);
- Ok(<Pallet<T>>::is_approved_for_all(self, &owner, &operator))
+ Ok(<Pallet<T>>::allowance_for_all(self, &owner, &operator))
}
/// @notice Returns collection helper contract address
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -274,7 +274,7 @@
/// Operator set by a wallet owner that could perform certain transactions on all tokens in the wallet.
#[pallet::storage]
- pub type WalletOperator<T: Config> = StorageNMap<
+ pub type CollectionAllowance<T: Config> = StorageNMap<
Key = (
Key<Twox64Concat, CollectionId>,
Key<Blake2_128Concat, T::CrossAccountId>,
@@ -450,7 +450,7 @@
<TokensBurnt<T>>::remove(id);
let _ = <Allowance<T>>::clear_prefix((id,), u32::MAX, None);
let _ = <AccountBalance<T>>::clear_prefix((id,), u32::MAX, None);
- let _ = <WalletOperator<T>>::clear_prefix((id,), u32::MAX, None);
+ let _ = <CollectionAllowance<T>>::clear_prefix((id,), u32::MAX, None);
Ok(())
}
@@ -1206,7 +1206,7 @@
if <Allowance<T>>::get((collection.id, token)).as_ref() == Some(spender) {
return Ok(());
}
- if <WalletOperator<T>>::get((collection.id, from, spender)) == Some(true) {
+ if <CollectionAllowance<T>>::get((collection.id, from, spender)) {
return Ok(());
}
ensure!(
@@ -1345,11 +1345,11 @@
/// Sets or unsets the approval of a given operator.
///
- /// An operator is allowed to transfer all token pieces of the sender on their behalf.
+ /// The `operator` is allowed to transfer all token pieces of the `owner` on their behalf.
/// - `owner`: Token owner
/// - `operator`: Operator
- /// - `approve`: Is operator enabled or disabled
- pub fn set_approval_for_all(
+ /// - `approve`: Should operator status be granted or revoked?
+ pub fn set_allowance_for_all(
collection: &NonfungibleHandle<T>,
owner: &T::CrossAccountId,
operator: &T::CrossAccountId,
@@ -1364,7 +1364,7 @@
// =========
- <WalletOperator<T>>::insert((collection.id, owner, operator), approve);
+ <CollectionAllowance<T>>::insert((collection.id, owner, operator), approve);
<PalletEvm<T>>::deposit_log(
ERC721Events::ApprovalForAll {
owner: *owner.as_eth(),
@@ -1382,12 +1382,12 @@
Ok(())
}
- /// Tells whether an operator is approved by a given owner.
- pub fn is_approved_for_all(
+ /// Tells whether the given `owner` approves the `operator`.
+ pub fn allowance_for_all(
collection: &NonfungibleHandle<T>,
owner: &T::CrossAccountId,
operator: &T::CrossAccountId,
) -> bool {
- <WalletOperator<T>>::get((collection.id, owner, operator)).unwrap_or(false)
+ <CollectionAllowance<T>>::get((collection.id, owner, operator))
}
}
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -1021,9 +1021,9 @@
}
/// @notice Sets or unsets the approval of a given operator.
- /// An operator is allowed to transfer all tokens of the sender on their behalf.
+ /// The `operator` is allowed to transfer all tokens of the `caller` on their behalf.
/// @param operator Operator
- /// @param approved Is operator enabled or disabled
+ /// @param approved Should operator status be granted or revoked?
/// @dev EVM selector for this function is: 0xa22cb465,
/// or in textual repr: setApprovalForAll(address,bool)
function setApprovalForAll(address operator, bool approved) public {
@@ -1043,7 +1043,7 @@
return 0x0000000000000000000000000000000000000000;
}
- /// @notice Tells whether an operator is approved by a given owner.
+ /// @notice Tells whether the given `owner` approves the `operator`.
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
function isApprovedForAll(address owner, address operator) public view returns (bool) {
pallets/nonfungible/src/weights.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/weights.rs
+++ b/pallets/nonfungible/src/weights.rs
@@ -48,8 +48,8 @@
fn set_token_properties(b: u32, ) -> Weight;
fn delete_token_properties(b: u32, ) -> Weight;
fn token_owner() -> Weight;
- fn set_approval_for_all() -> Weight;
- fn is_approved_for_all() -> Weight;
+ fn set_allowance_for_all() -> Weight;
+ fn allowance_for_all() -> Weight;
}
/// Weights for pallet_nonfungible using the Substrate node and recommended hardware.
@@ -199,12 +199,12 @@
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
// Storage: Nonfungible WalletOperator (r:0 w:1)
- fn set_approval_for_all() -> Weight {
+ fn set_allowance_for_all() -> Weight {
Weight::from_ref_time(16_231_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible WalletOperator (r:1 w:0)
- fn is_approved_for_all() -> Weight {
+ fn allowance_for_all() -> Weight {
Weight::from_ref_time(6_161_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
@@ -356,12 +356,12 @@
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
// Storage: Nonfungible WalletOperator (r:0 w:1)
- fn set_approval_for_all() -> Weight {
+ fn set_allowance_for_all() -> Weight {
Weight::from_ref_time(16_231_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Nonfungible WalletOperator (r:1 w:0)
- fn is_approved_for_all() -> Weight {
+ fn allowance_for_all() -> Weight {
Weight::from_ref_time(6_161_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
pallets/refungible/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/refungible/src/benchmarking.rs
+++ b/pallets/refungible/src/benchmarking.rs
@@ -291,17 +291,17 @@
let item = create_max_item(&collection, &sender, [(owner.clone(), 100)])?;
}: {<Pallet<T>>::token_owner(collection.id, item)}
- set_approval_for_all {
+ set_allowance_for_all {
bench_init!{
owner: sub; collection: collection(owner);
operator: cross_from_sub(owner); owner: cross_sub;
};
- }: {<Pallet<T>>::set_approval_for_all(&collection, &owner, &operator, true)}
+ }: {<Pallet<T>>::set_allowance_for_all(&collection, &owner, &operator, true)}
- is_approved_for_all {
+ allowance_for_all {
bench_init!{
owner: sub; collection: collection(owner);
operator: cross_from_sub(owner); owner: cross_sub;
};
- }: {<Pallet<T>>::is_approved_for_all(&collection, &owner, &operator)}
+ }: {<Pallet<T>>::allowance_for_all(&collection, &owner, &operator)}
}
pallets/refungible/src/common.rsdiffbeforeafterboth--- a/pallets/refungible/src/common.rs
+++ b/pallets/refungible/src/common.rs
@@ -153,8 +153,8 @@
<SelfWeightOf<T>>::token_owner()
}
- fn set_approval_for_all() -> Weight {
- <SelfWeightOf<T>>::set_approval_for_all()
+ fn set_allowance_for_all() -> Weight {
+ <SelfWeightOf<T>>::set_allowance_for_all()
}
}
@@ -521,20 +521,20 @@
<Pallet<T>>::total_pieces(self.id, token)
}
- fn set_approval_for_all(
+ fn set_allowance_for_all(
&self,
owner: T::CrossAccountId,
operator: T::CrossAccountId,
approve: bool,
) -> DispatchResultWithPostInfo {
with_weight(
- <Pallet<T>>::set_approval_for_all(self, &owner, &operator, approve),
- <CommonWeights<T>>::set_approval_for_all(),
+ <Pallet<T>>::set_allowance_for_all(self, &owner, &operator, approve),
+ <CommonWeights<T>>::set_allowance_for_all(),
)
}
- fn is_approved_for_all(&self, owner: T::CrossAccountId, operator: T::CrossAccountId) -> bool {
- <Pallet<T>>::is_approved_for_all(self, &owner, &operator)
+ fn allowance_for_all(&self, owner: T::CrossAccountId, operator: T::CrossAccountId) -> bool {
+ <Pallet<T>>::allowance_for_all(self, &owner, &operator)
}
}
pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -462,10 +462,10 @@
}
/// @notice Sets or unsets the approval of a given operator.
- /// An operator is allowed to transfer all tokens of the sender on their behalf.
+ /// The `operator` is allowed to transfer all token pieces of the `caller` on their behalf.
/// @param operator Operator
- /// @param approved Is operator enabled or disabled
- #[weight(<SelfWeightOf<T>>::set_approval_for_all())]
+ /// @param approved Should operator status be granted or revoked?
+ #[weight(<SelfWeightOf<T>>::set_allowance_for_all())]
fn set_approval_for_all(
&mut self,
caller: caller,
@@ -475,7 +475,7 @@
let caller = T::CrossAccountId::from_eth(caller);
let operator = T::CrossAccountId::from_eth(operator);
- <Pallet<T>>::set_approval_for_all(self, &caller, &operator, approved)
+ <Pallet<T>>::set_allowance_for_all(self, &caller, &operator, approved)
.map_err(dispatch_to_evm::<T>)?;
Ok(())
}
@@ -486,13 +486,13 @@
Err("not implemented".into())
}
- /// @notice Tells whether an operator is approved by a given owner.
- #[weight(<SelfWeightOf<T>>::is_approved_for_all())]
+ /// @notice Tells whether the given `owner` approves the `operator`.
+ #[weight(<SelfWeightOf<T>>::allowance_for_all())]
fn is_approved_for_all(&self, owner: address, operator: address) -> Result<bool> {
let owner = T::CrossAccountId::from_eth(owner);
let operator = T::CrossAccountId::from_eth(operator);
- Ok(<Pallet<T>>::is_approved_for_all(self, &owner, &operator))
+ Ok(<Pallet<T>>::allowance_for_all(self, &owner, &operator))
}
/// @notice Returns collection helper contract address
pallets/refungible/src/lib.rsdiffbeforeafterboth--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -275,14 +275,14 @@
/// Operator set by a wallet owner that could perform certain transactions on all tokens in the wallet.
#[pallet::storage]
- pub type WalletOperator<T: Config> = StorageNMap<
+ pub type CollectionAllowance<T: Config> = StorageNMap<
Key = (
Key<Twox64Concat, CollectionId>,
Key<Blake2_128Concat, T::CrossAccountId>,
Key<Blake2_128Concat, T::CrossAccountId>,
),
Value = bool,
- QueryKind = OptionQuery,
+ QueryKind = ValueQuery,
>;
#[pallet::hooks]
@@ -1174,8 +1174,8 @@
let allowance =
<Allowance<T>>::get((collection.id, token, from, &spender)).checked_sub(amount);
- // Allowance if any would be reduced if spender is also wallet operator
- if <WalletOperator<T>>::get((collection.id, from, spender)) == Some(true) {
+ // Allowance (if any) would be reduced if spender is also wallet operator
+ if <CollectionAllowance<T>>::get((collection.id, from, spender)) {
return Ok(allowance);
}
@@ -1408,11 +1408,11 @@
/// Sets or unsets the approval of a given operator.
///
- /// An operator is allowed to transfer all tokens of the sender on their behalf.
+ /// The `operator` is allowed to transfer all token pieces of the `owner` on their behalf.
/// - `owner`: Token owner
/// - `operator`: Operator
- /// - `approve`: Is operator enabled or disabled
- pub fn set_approval_for_all(
+ /// - `approve`: Should operator status be granted or revoked?
+ pub fn set_allowance_for_all(
collection: &RefungibleHandle<T>,
owner: &T::CrossAccountId,
operator: &T::CrossAccountId,
@@ -1427,7 +1427,7 @@
// =========
- <WalletOperator<T>>::insert((collection.id, owner, operator), approve);
+ <CollectionAllowance<T>>::insert((collection.id, owner, operator), approve);
<PalletEvm<T>>::deposit_log(
ERC721Events::ApprovalForAll {
owner: *owner.as_eth(),
@@ -1445,12 +1445,12 @@
Ok(())
}
- /// Tells whether an operator is approved by a given owner.
- pub fn is_approved_for_all(
+ /// Tells whether the given `owner` approves the `operator`.
+ pub fn allowance_for_all(
collection: &RefungibleHandle<T>,
owner: &T::CrossAccountId,
operator: &T::CrossAccountId,
) -> bool {
- <WalletOperator<T>>::get((collection.id, owner, operator)).unwrap_or(false)
+ <CollectionAllowance<T>>::get((collection.id, owner, operator))
}
}
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -1018,9 +1018,9 @@
}
/// @notice Sets or unsets the approval of a given operator.
- /// An operator is allowed to transfer all tokens of the sender on their behalf.
+ /// The `operator` is allowed to transfer all token pieces of the `caller` on their behalf.
/// @param operator Operator
- /// @param approved Is operator enabled or disabled
+ /// @param approved Should operator status be granted or revoked?
/// @dev EVM selector for this function is: 0xa22cb465,
/// or in textual repr: setApprovalForAll(address,bool)
function setApprovalForAll(address operator, bool approved) public {
@@ -1040,7 +1040,7 @@
return 0x0000000000000000000000000000000000000000;
}
- /// @notice Tells whether an operator is approved by a given owner.
+ /// @notice Tells whether the given `owner` approves the `operator`.
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
function isApprovedForAll(address owner, address operator) public view returns (bool) {
pallets/refungible/src/weights.rsdiffbeforeafterboth--- a/pallets/refungible/src/weights.rs
+++ b/pallets/refungible/src/weights.rs
@@ -55,8 +55,8 @@
fn delete_token_properties(b: u32, ) -> Weight;
fn repartition_item() -> Weight;
fn token_owner() -> Weight;
- fn set_approval_for_all() -> Weight;
- fn is_approved_for_all() -> Weight;
+ fn set_allowance_for_all() -> Weight;
+ fn allowance_for_all() -> Weight;
}
/// Weights for pallet_refungible using the Substrate node and recommended hardware.
@@ -263,12 +263,12 @@
.saturating_add(T::DbWeight::get().reads(2 as u64))
}
// Storage: Refungible WalletOperator (r:0 w:1)
- fn set_approval_for_all() -> Weight {
+ fn set_allowance_for_all() -> Weight {
Weight::from_ref_time(16_150_000 as u64)
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Refungible WalletOperator (r:1 w:0)
- fn is_approved_for_all() -> Weight {
+ fn allowance_for_all() -> Weight {
Weight::from_ref_time(5_901_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
@@ -477,12 +477,12 @@
.saturating_add(RocksDbWeight::get().reads(2 as u64))
}
// Storage: Refungible WalletOperator (r:0 w:1)
- fn set_approval_for_all() -> Weight {
+ fn set_allowance_for_all() -> Weight {
Weight::from_ref_time(16_150_000 as u64)
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Refungible WalletOperator (r:1 w:0)
- fn is_approved_for_all() -> Weight {
+ fn allowance_for_all() -> Weight {
Weight::from_ref_time(5_901_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
pallets/unique/src/eth/mod.rsdiffbeforeafterboth--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -36,7 +36,7 @@
use sp_std::vec;
use up_data_structs::{
CollectionDescription, CollectionMode, CollectionName, CollectionTokenPrefix,
- CreateCollectionData, CollectionId,
+ CreateCollectionData,
};
use crate::{weights::WeightInfo, Config, SelfWeightOf};
pallets/unique/src/lib.rsdiffbeforeafterboth--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -1129,15 +1129,15 @@
/// Sets or unsets the approval of a given operator.
///
- /// An operator is allowed to transfer all tokens of the sender on their behalf.
+ /// The `operator` is allowed to transfer all tokens of the `owner` on their behalf.
///
/// # Arguments
///
/// * `owner`: Token owner
/// * `operator`: Operator
- /// * `approve`: Is operator enabled or disabled
- #[weight = T::CommonWeightInfo::set_approval_for_all()]
- pub fn set_approval_for_all(
+ /// * `approve`: Should operator status be granted or revoked?
+ #[weight = T::CommonWeightInfo::set_allowance_for_all()]
+ pub fn set_allowance_for_all(
origin,
collection_id: CollectionId,
operator: T::CrossAccountId,
@@ -1145,7 +1145,7 @@
) -> DispatchResultWithPostInfo {
let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
dispatch_tx::<T, _>(collection_id, |d| {
- d.set_approval_for_all(sender, operator, approve)
+ d.set_allowance_for_all(sender, operator, approve)
})
}
}
primitives/rpc/src/lib.rsdiffbeforeafterboth--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -134,6 +134,6 @@
fn token_owners(collection: CollectionId, token: TokenId) -> Result<Vec<CrossAccountId>>;
/// Get whether an operator is approved by a given owner.
- fn is_approved_for_all(collection: CollectionId, owner: CrossAccountId, operator: CrossAccountId) -> Result<bool>;
+ fn allowance_for_all(collection: CollectionId, owner: CrossAccountId, operator: CrossAccountId) -> Result<bool>;
}
}
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -188,8 +188,8 @@
dispatch_unique_runtime!(collection.total_pieces(token_id))
}
- fn is_approved_for_all(collection: CollectionId, owner: CrossAccountId, operator: CrossAccountId) -> Result<bool, DispatchError> {
- dispatch_unique_runtime!(collection.is_approved_for_all(owner, operator))
+ fn allowance_for_all(collection: CollectionId, owner: CrossAccountId, operator: CrossAccountId) -> Result<bool, DispatchError> {
+ dispatch_unique_runtime!(collection.allowance_for_all(owner, operator))
}
}
runtime/common/weights.rsdiffbeforeafterboth--- a/runtime/common/weights.rs
+++ b/runtime/common/weights.rs
@@ -121,8 +121,8 @@
max_weight_of!(token_owner())
}
- fn set_approval_for_all() -> Weight {
- max_weight_of!(set_approval_for_all())
+ fn set_allowance_for_all() -> Weight {
+ max_weight_of!(set_allowance_for_all())
}
}
tests/src/approve.test.tsdiffbeforeafterboth--- a/tests/src/approve.test.ts
+++ b/tests/src/approve.test.ts
@@ -617,26 +617,31 @@
itSub('[nft] Enable and disable approval', async ({helper}) => {
const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- const checkBeforeApproval = await helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
+
+ const checkBeforeApproval = await helper.nft.allowanceForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
expect(checkBeforeApproval).to.be.false;
- await helper.nft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, true);
- const checkAfterApproval = await helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
+
+ await helper.nft.setAllowanceForAll(alice, collectionId, {Substrate: bob.address}, true);
+ const checkAfterApproval = await helper.nft.allowanceForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
expect(checkAfterApproval).to.be.true;
- await helper.nft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, false);
- const checkAfterDisapproval = await helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
+
+ await helper.nft.setAllowanceForAll(alice, collectionId, {Substrate: bob.address}, false);
+ const checkAfterDisapproval = await helper.nft.allowanceForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
expect(checkAfterDisapproval).to.be.false;
});
itSub.ifWithPallets('[rft] Enable and disable approval', [Pallets.ReFungible], async ({helper}) => {
const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const checkBeforeApproval = await helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
+
+ const checkBeforeApproval = await helper.rft.allowanceForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
expect(checkBeforeApproval).to.be.false;
- await helper.rft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, true);
- const checkAfterApproval = await helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
+
+ await helper.rft.setAllowanceForAll(alice, collectionId, {Substrate: bob.address}, true);
+ const checkAfterApproval = await helper.rft.allowanceForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
expect(checkAfterApproval).to.be.true;
- await helper.rft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, false);
- const checkAfterDisapproval = await helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
+
+ await helper.rft.setAllowanceForAll(alice, collectionId, {Substrate: bob.address}, false);
+ const checkAfterDisapproval = await helper.rft.allowanceForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});
expect(checkAfterDisapproval).to.be.false;
});
});
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -672,9 +672,9 @@
function approve(address approved, uint256 tokenId) external;
/// @notice Sets or unsets the approval of a given operator.
- /// An operator is allowed to transfer all tokens of the sender on their behalf.
+ /// The `operator` is allowed to transfer all tokens of the `caller` on their behalf.
/// @param operator Operator
- /// @param approved Is operator enabled or disabled
+ /// @param approved Should operator status be granted or revoked?
/// @dev EVM selector for this function is: 0xa22cb465,
/// or in textual repr: setApprovalForAll(address,bool)
function setApprovalForAll(address operator, bool approved) external;
@@ -684,7 +684,7 @@
/// or in textual repr: getApproved(uint256)
function getApproved(uint256 tokenId) external view returns (address);
- /// @notice Tells whether an operator is approved by a given owner.
+ /// @notice Tells whether the given `owner` approves the `operator`.
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
function isApprovedForAll(address owner, address operator) external view returns (bool);
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -669,9 +669,9 @@
function approve(address approved, uint256 tokenId) external;
/// @notice Sets or unsets the approval of a given operator.
- /// An operator is allowed to transfer all tokens of the sender on their behalf.
+ /// The `operator` is allowed to transfer all token pieces of the `caller` on their behalf.
/// @param operator Operator
- /// @param approved Is operator enabled or disabled
+ /// @param approved Should operator status be granted or revoked?
/// @dev EVM selector for this function is: 0xa22cb465,
/// or in textual repr: setApprovalForAll(address,bool)
function setApprovalForAll(address operator, bool approved) external;
@@ -681,7 +681,7 @@
/// or in textual repr: getApproved(uint256)
function getApproved(uint256 tokenId) external view returns (address);
- /// @notice Tells whether an operator is approved by a given owner.
+ /// @notice Tells whether the given `owner` approves the `operator`.
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
function isApprovedForAll(address owner, address operator) external view returns (bool);
tests/src/eth/nonFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -935,48 +935,54 @@
let donor: IKeyringPair;
let minter: IKeyringPair;
let alice: IKeyringPair;
- let bob: IKeyringPair;
before(async function() {
await usingEthPlaygrounds(async (helper, privateKey) => {
donor = await privateKey({filename: __filename});
- [minter, alice, bob] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);
+ [minter, alice] = await helper.arrange.createAccounts([100n, 100n], donor);
});
});
itEth('[negative] Cant perform burn without approval', async ({helper}) => {
const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
- const owner = bob;
+ const owner = await helper.eth.createAccountWithBalance(donor, 100n);
const spender = await helper.eth.createAccountWithBalance(donor, 100n);
- const token = await collection.mintToken(minter, {Substrate: owner.address});
+ const token = await collection.mintToken(minter, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
const contract = helper.ethNativeContract.collection(address, 'nft');
- {
- const ownerCross = helper.ethCrossAccount.fromKeyringPair(owner);
- await expect(contract.methods.burnFromCross(ownerCross, token.tokenId).send({from: spender})).to.be.rejected;
- }
+ const ownerCross = helper.ethCrossAccount.fromAddress(owner);
+ await expect(contract.methods.burnFromCross(ownerCross, token.tokenId).send({from: spender})).to.be.rejected;
+
+ await contract.methods.setApprovalForAll(spender, true).send({from: owner});
+ await contract.methods.setApprovalForAll(spender, false).send({from: owner});
+
+ await expect(contract.methods.burnFromCross(ownerCross, token.tokenId).send({from: spender})).to.be.rejected;
});
itEth('[negative] Cant perform transfer without approval', async ({helper}) => {
const collection = await helper.nft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});
- const owner = bob;
const receiver = alice;
+ const owner = await helper.eth.createAccountWithBalance(donor, 100n);
const spender = await helper.eth.createAccountWithBalance(donor, 100n);
- const token = await collection.mintToken(minter, {Substrate: owner.address});
+ const token = await collection.mintToken(minter, {Ethereum: owner});
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
const contract = helper.ethNativeContract.collection(address, 'nft');
- {
- const ownerCross = helper.ethCrossAccount.fromKeyringPair(owner);
- const recieverCross = helper.ethCrossAccount.fromKeyringPair(receiver);
- await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
- }
+ const ownerCross = helper.ethCrossAccount.fromAddress(owner);
+ const recieverCross = helper.ethCrossAccount.fromKeyringPair(receiver);
+
+ await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
+
+ await contract.methods.setApprovalForAll(spender, true).send({from: owner});
+ await contract.methods.setApprovalForAll(spender, false).send({from: owner});
+
+ await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
});
});
tests/src/eth/reFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -750,10 +750,14 @@
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
const contract = helper.ethNativeContract.collection(address, 'rft');
- {
- const ownerCross = helper.ethCrossAccount.fromAddress(owner);
- await expect(contract.methods.burnFromCross(ownerCross, token.tokenId).send({from: spender})).to.be.rejected;
- }
+ const ownerCross = helper.ethCrossAccount.fromAddress(owner);
+
+ await expect(contract.methods.burnFromCross(ownerCross, token.tokenId).send({from: spender})).to.be.rejected;
+
+ await contract.methods.setApprovalForAll(spender, true).send({from: owner});
+ await contract.methods.setApprovalForAll(spender, false).send({from: owner});
+
+ await expect(contract.methods.burnFromCross(ownerCross, token.tokenId).send({from: spender})).to.be.rejected;
});
itEth('[negative] Cant perform transfer without approval', async ({helper}) => {
@@ -768,10 +772,14 @@
const address = helper.ethAddress.fromCollectionId(collection.collectionId);
const contract = helper.ethNativeContract.collection(address, 'rft');
- {
- const ownerCross = helper.ethCrossAccount.fromAddress(owner);
- const recieverCross = helper.ethCrossAccount.fromKeyringPair(receiver);
- await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
- }
+ const ownerCross = helper.ethCrossAccount.fromAddress(owner);
+ const recieverCross = helper.ethCrossAccount.fromKeyringPair(receiver);
+
+ await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
+
+ await contract.methods.setApprovalForAll(spender, true).send({from: owner});
+ await contract.methods.setApprovalForAll(spender, false).send({from: owner});
+
+ await expect(contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender})).to.be.rejected;
});
});
tests/src/interfaces/augment-api-events.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-events.ts
+++ b/tests/src/interfaces/augment-api-events.ts
@@ -107,7 +107,7 @@
**/
Approved: AugmentedEvent<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;
/**
- * Amount pieces of token owned by `sender` was approved for `spender`.
+ * A `sender` approves operations on all owned tokens for `spender`.
**/
ApprovedForAll: AugmentedEvent<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, bool]>;
/**
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -406,6 +406,10 @@
**/
allowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
/**
+ * Operator set by a wallet owner that could perform certain transactions on all tokens in the wallet.
+ **/
+ collectionAllowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;
+ /**
* Used to enumerate tokens owned by account.
**/
owned: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]>;
@@ -441,10 +445,6 @@
* Total amount of minted tokens in a collection.
**/
tokensMinted: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
- /**
- * Operator set by a wallet owner that could perform certain transactions on all tokens in the wallet.
- **/
- walletOperator: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<Option<bool>>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;
/**
* Generic query
**/
@@ -625,6 +625,10 @@
**/
balance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<u128>, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]>;
/**
+ * Operator set by a wallet owner that could perform certain transactions on all tokens in the wallet.
+ **/
+ collectionAllowance: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;
+ /**
* Used to enumerate tokens owned by account.
**/
owned: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<bool>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]>;
@@ -648,10 +652,6 @@
* Total amount of pieces for token
**/
totalSupply: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
- /**
- * Operator set by a wallet owner that could perform certain transactions on all tokens in the wallet.
- **/
- walletOperator: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, arg3: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => Observable<Option<bool>>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry<ApiType, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]>;
/**
* Generic query
**/
tests/src/interfaces/augment-api-rpc.tsdiffbeforeafterboth1// Auto-generated via `yarn polkadot-types-from-chain`, do not edit2/* eslint-disable */34// import type lookup before we augment - in some environments5// this is required to allow for ambient/previous definitions6import '@polkadot/rpc-core/types/jsonrpc';78import type { PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsPartPartType, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default';9import type { AugmentedRpc } from '@polkadot/rpc-core/types';10import type { Metadata, StorageKey } from '@polkadot/types';11import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec';12import type { AnyNumber, Codec, ITuple } from '@polkadot/types-codec/types';13import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';14import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';15import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';16import type { BlockHash } from '@polkadot/types/interfaces/chain';17import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';18import type { AuthorityId } from '@polkadot/types/interfaces/consensus';19import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';20import type { BlockStats } from '@polkadot/types/interfaces/dev';21import type { CreatedBlock } from '@polkadot/types/interfaces/engine';22import type { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';23import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';24import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';25import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';26import type { StorageKind } from '@polkadot/types/interfaces/offchain';27import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';28import type { RpcMethods } from '@polkadot/types/interfaces/rpc';29import type { AccountId, AccountId32, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';30import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';31import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';32import type { IExtrinsic, Observable } from '@polkadot/types/types';3334export type __AugmentedRpc = AugmentedRpc<() => unknown>;3536declare module '@polkadot/rpc-core/types/jsonrpc' {37 interface RpcInterface {38 appPromotion: {39 /**40 * Returns the total amount of unstaked tokens41 **/42 pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;43 /**44 * Returns the total amount of unstaked tokens per block45 **/46 pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;47 /**48 * Returns the total amount of staked tokens49 **/50 totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;51 /**52 * Returns the total amount of staked tokens per block when staked53 **/54 totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;55 };56 author: {57 /**58 * Returns true if the keystore has private keys for the given public key and key type.59 **/60 hasKey: AugmentedRpc<(publicKey: Bytes | string | Uint8Array, keyType: Text | string) => Observable<bool>>;61 /**62 * Returns true if the keystore has private keys for the given session public keys.63 **/64 hasSessionKeys: AugmentedRpc<(sessionKeys: Bytes | string | Uint8Array) => Observable<bool>>;65 /**66 * Insert a key into the keystore.67 **/68 insertKey: AugmentedRpc<(keyType: Text | string, suri: Text | string, publicKey: Bytes | string | Uint8Array) => Observable<Bytes>>;69 /**70 * Returns all pending extrinsics, potentially grouped by sender71 **/72 pendingExtrinsics: AugmentedRpc<() => Observable<Vec<Extrinsic>>>;73 /**74 * Remove given extrinsic from the pool and temporarily ban it to prevent reimporting75 **/76 removeExtrinsic: AugmentedRpc<(bytesOrHash: Vec<ExtrinsicOrHash> | (ExtrinsicOrHash | { Hash: any } | { Extrinsic: any } | string | Uint8Array)[]) => Observable<Vec<Hash>>>;77 /**78 * Generate new session keys and returns the corresponding public keys79 **/80 rotateKeys: AugmentedRpc<() => Observable<Bytes>>;81 /**82 * Submit and subscribe to watch an extrinsic until unsubscribed83 **/84 submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ExtrinsicStatus>>;85 /**86 * Submit a fully formatted extrinsic for block inclusion87 **/88 submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Hash>>;89 };90 babe: {91 /**92 * Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore93 **/94 epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;95 };96 beefy: {97 /**98 * Returns hash of the latest BEEFY finalized block as seen by this client.99 **/100 getFinalizedHead: AugmentedRpc<() => Observable<H256>>;101 /**102 * Returns the block most recently finalized by BEEFY, alongside side its justification.103 **/104 subscribeJustifications: AugmentedRpc<() => Observable<BeefySignedCommitment>>;105 };106 chain: {107 /**108 * Get header and body of a relay chain block109 **/110 getBlock: AugmentedRpc<(hash?: BlockHash | string | Uint8Array) => Observable<SignedBlock>>;111 /**112 * Get the block hash for a specific block113 **/114 getBlockHash: AugmentedRpc<(blockNumber?: BlockNumber | AnyNumber | Uint8Array) => Observable<BlockHash>>;115 /**116 * Get hash of the last finalized block in the canon chain117 **/118 getFinalizedHead: AugmentedRpc<() => Observable<BlockHash>>;119 /**120 * Retrieves the header for a specific block121 **/122 getHeader: AugmentedRpc<(hash?: BlockHash | string | Uint8Array) => Observable<Header>>;123 /**124 * Retrieves the newest header via subscription125 **/126 subscribeAllHeads: AugmentedRpc<() => Observable<Header>>;127 /**128 * Retrieves the best finalized header via subscription129 **/130 subscribeFinalizedHeads: AugmentedRpc<() => Observable<Header>>;131 /**132 * Retrieves the best header via subscription133 **/134 subscribeNewHeads: AugmentedRpc<() => Observable<Header>>;135 };136 childstate: {137 /**138 * Returns the keys with prefix from a child storage, leave empty to get all the keys139 **/140 getKeys: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;141 /**142 * Returns the keys with prefix from a child storage with pagination support143 **/144 getKeysPaged: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, count: u32 | AnyNumber | Uint8Array, startKey?: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;145 /**146 * Returns a child storage entry at a specific block state147 **/148 getStorage: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<StorageData>>>;149 /**150 * Returns child storage entries for multiple keys at a specific block state151 **/152 getStorageEntries: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: Hash | string | Uint8Array) => Observable<Vec<Option<StorageData>>>>;153 /**154 * Returns the hash of a child storage entry at a block state155 **/156 getStorageHash: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<Hash>>>;157 /**158 * Returns the size of a child storage entry at a block state159 **/160 getStorageSize: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;161 };162 contracts: {163 /**164 * @deprecated Use the runtime interface `api.call.contractsApi.call` instead165 * Executes a call to a contract166 **/167 call: AugmentedRpc<(callRequest: ContractCallRequest | { origin?: any; dest?: any; value?: any; gasLimit?: any; storageDepositLimit?: any; inputData?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ContractExecResult>>;168 /**169 * @deprecated Use the runtime interface `api.call.contractsApi.getStorage` instead170 * Returns the value under a specified storage key in a contract171 **/172 getStorage: AugmentedRpc<(address: AccountId | string | Uint8Array, key: H256 | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<Bytes>>>;173 /**174 * @deprecated Use the runtime interface `api.call.contractsApi.instantiate` instead175 * Instantiate a new contract176 **/177 instantiate: AugmentedRpc<(request: InstantiateRequest | { origin?: any; value?: any; gasLimit?: any; storageDepositLimit?: any; code?: any; data?: any; salt?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ContractInstantiateResult>>;178 /**179 * @deprecated Not available in newer versions of the contracts interfaces180 * Returns the projected time a given contract will be able to sustain paying its rent181 **/182 rentProjection: AugmentedRpc<(address: AccountId | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<BlockNumber>>>;183 /**184 * @deprecated Use the runtime interface `api.call.contractsApi.uploadCode` instead185 * Upload new code without instantiating a contract from it186 **/187 uploadCode: AugmentedRpc<(uploadRequest: CodeUploadRequest | { origin?: any; code?: any; storageDepositLimit?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<CodeUploadResult>>;188 };189 dev: {190 /**191 * Reexecute the specified `block_hash` and gather statistics while doing so192 **/193 getBlockStats: AugmentedRpc<(at: Hash | string | Uint8Array) => Observable<Option<BlockStats>>>;194 };195 engine: {196 /**197 * Instructs the manual-seal authorship task to create a new block198 **/199 createBlock: AugmentedRpc<(createEmpty: bool | boolean | Uint8Array, finalize: bool | boolean | Uint8Array, parentHash?: BlockHash | string | Uint8Array) => Observable<CreatedBlock>>;200 /**201 * Instructs the manual-seal authorship task to finalize a block202 **/203 finalizeBlock: AugmentedRpc<(hash: BlockHash | string | Uint8Array, justification?: Justification) => Observable<bool>>;204 };205 eth: {206 /**207 * Returns accounts list.208 **/209 accounts: AugmentedRpc<() => Observable<Vec<H160>>>;210 /**211 * Returns the blockNumber212 **/213 blockNumber: AugmentedRpc<() => Observable<U256>>;214 /**215 * Call contract, returning the output data.216 **/217 call: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<Bytes>>;218 /**219 * Returns the chain ID used for transaction signing at the current best block. None is returned if not available.220 **/221 chainId: AugmentedRpc<() => Observable<U64>>;222 /**223 * Returns block author.224 **/225 coinbase: AugmentedRpc<() => Observable<H160>>;226 /**227 * Estimate gas needed for execution of given contract.228 **/229 estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;230 /**231 * Returns fee history for given block count & reward percentiles232 **/233 feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option<Vec<f64>> | null | Uint8Array | Vec<f64> | (f64)[]) => Observable<EthFeeHistory>>;234 /**235 * Returns current gas price.236 **/237 gasPrice: AugmentedRpc<() => Observable<U256>>;238 /**239 * Returns balance of the given account.240 **/241 getBalance: AugmentedRpc<(address: H160 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;242 /**243 * Returns block with given hash.244 **/245 getBlockByHash: AugmentedRpc<(hash: H256 | string | Uint8Array, full: bool | boolean | Uint8Array) => Observable<Option<EthRichBlock>>>;246 /**247 * Returns block with given number.248 **/249 getBlockByNumber: AugmentedRpc<(block: BlockNumber | AnyNumber | Uint8Array, full: bool | boolean | Uint8Array) => Observable<Option<EthRichBlock>>>;250 /**251 * Returns the number of transactions in a block with given hash.252 **/253 getBlockTransactionCountByHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<U256>>;254 /**255 * Returns the number of transactions in a block with given block number.256 **/257 getBlockTransactionCountByNumber: AugmentedRpc<(block: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;258 /**259 * Returns the code at given address at given time (block number).260 **/261 getCode: AugmentedRpc<(address: H160 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<Bytes>>;262 /**263 * Returns filter changes since last poll.264 **/265 getFilterChanges: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<EthFilterChanges>>;266 /**267 * Returns all logs matching given filter (in a range 'from' - 'to').268 **/269 getFilterLogs: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<Vec<EthLog>>>;270 /**271 * Returns logs matching given filter object.272 **/273 getLogs: AugmentedRpc<(filter: EthFilter | { fromBlock?: any; toBlock?: any; blockHash?: any; address?: any; topics?: any } | string | Uint8Array) => Observable<Vec<EthLog>>>;274 /**275 * Returns proof for account and storage.276 **/277 getProof: AugmentedRpc<(address: H160 | string | Uint8Array, storageKeys: Vec<H256> | (H256 | string | Uint8Array)[], number: BlockNumber | AnyNumber | Uint8Array) => Observable<EthAccount>>;278 /**279 * Returns content of the storage at given address.280 **/281 getStorageAt: AugmentedRpc<(address: H160 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<H256>>;282 /**283 * Returns transaction at given block hash and index.284 **/285 getTransactionByBlockHashAndIndex: AugmentedRpc<(hash: H256 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthTransaction>>;286 /**287 * Returns transaction by given block number and index.288 **/289 getTransactionByBlockNumberAndIndex: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthTransaction>>;290 /**291 * Get transaction by its hash.292 **/293 getTransactionByHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<EthTransaction>>;294 /**295 * Returns the number of transactions sent from given address at given time (block number).296 **/297 getTransactionCount: AugmentedRpc<(hash: H256 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;298 /**299 * Returns transaction receipt by transaction hash.300 **/301 getTransactionReceipt: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<EthReceipt>>;302 /**303 * Returns an uncles at given block and index.304 **/305 getUncleByBlockHashAndIndex: AugmentedRpc<(hash: H256 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthRichBlock>>;306 /**307 * Returns an uncles at given block and index.308 **/309 getUncleByBlockNumberAndIndex: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthRichBlock>>;310 /**311 * Returns the number of uncles in a block with given hash.312 **/313 getUncleCountByBlockHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<U256>>;314 /**315 * Returns the number of uncles in a block with given block number.316 **/317 getUncleCountByBlockNumber: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;318 /**319 * Returns the hash of the current block, the seedHash, and the boundary condition to be met.320 **/321 getWork: AugmentedRpc<() => Observable<EthWork>>;322 /**323 * Returns the number of hashes per second that the node is mining with.324 **/325 hashrate: AugmentedRpc<() => Observable<U256>>;326 /**327 * Returns max priority fee per gas328 **/329 maxPriorityFeePerGas: AugmentedRpc<() => Observable<U256>>;330 /**331 * Returns true if client is actively mining new blocks.332 **/333 mining: AugmentedRpc<() => Observable<bool>>;334 /**335 * Returns id of new block filter.336 **/337 newBlockFilter: AugmentedRpc<() => Observable<U256>>;338 /**339 * Returns id of new filter.340 **/341 newFilter: AugmentedRpc<(filter: EthFilter | { fromBlock?: any; toBlock?: any; blockHash?: any; address?: any; topics?: any } | string | Uint8Array) => Observable<U256>>;342 /**343 * Returns id of new block filter.344 **/345 newPendingTransactionFilter: AugmentedRpc<() => Observable<U256>>;346 /**347 * Returns protocol version encoded as a string (quotes are necessary).348 **/349 protocolVersion: AugmentedRpc<() => Observable<u64>>;350 /**351 * Sends signed transaction, returning its hash.352 **/353 sendRawTransaction: AugmentedRpc<(bytes: Bytes | string | Uint8Array) => Observable<H256>>;354 /**355 * Sends transaction; will block waiting for signer to return the transaction hash356 **/357 sendTransaction: AugmentedRpc<(tx: EthTransactionRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array) => Observable<H256>>;358 /**359 * Used for submitting mining hashrate.360 **/361 submitHashrate: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array, hash: H256 | string | Uint8Array) => Observable<bool>>;362 /**363 * Used for submitting a proof-of-work solution.364 **/365 submitWork: AugmentedRpc<(nonce: H64 | string | Uint8Array, headerHash: H256 | string | Uint8Array, mixDigest: H256 | string | Uint8Array) => Observable<bool>>;366 /**367 * Subscribe to Eth subscription.368 **/369 subscribe: AugmentedRpc<(kind: EthSubKind | 'newHeads' | 'logs' | 'newPendingTransactions' | 'syncing' | number | Uint8Array, params?: EthSubParams | { None: any } | { Logs: any } | string | Uint8Array) => Observable<Null>>;370 /**371 * Returns an object with data about the sync status or false.372 **/373 syncing: AugmentedRpc<() => Observable<EthSyncStatus>>;374 /**375 * Uninstalls filter.376 **/377 uninstallFilter: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<bool>>;378 };379 grandpa: {380 /**381 * Prove finality for the given block number, returning the Justification for the last block in the set.382 **/383 proveFinality: AugmentedRpc<(blockNumber: BlockNumber | AnyNumber | Uint8Array) => Observable<Option<EncodedFinalityProofs>>>;384 /**385 * Returns the state of the current best round state as well as the ongoing background rounds386 **/387 roundState: AugmentedRpc<() => Observable<ReportedRoundStates>>;388 /**389 * Subscribes to grandpa justifications390 **/391 subscribeJustifications: AugmentedRpc<() => Observable<JustificationNotification>>;392 };393 mmr: {394 /**395 * Generate MMR proof for the given leaf indices.396 **/397 generateBatchProof: AugmentedRpc<(leafIndices: Vec<u64> | (u64 | AnyNumber | Uint8Array)[], at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;398 /**399 * Generate MMR proof for given leaf index.400 **/401 generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafBatchProof>>;402 };403 net: {404 /**405 * Returns true if client is actively listening for network connections. Otherwise false.406 **/407 listening: AugmentedRpc<() => Observable<bool>>;408 /**409 * Returns number of peers connected to node.410 **/411 peerCount: AugmentedRpc<() => Observable<Text>>;412 /**413 * Returns protocol version.414 **/415 version: AugmentedRpc<() => Observable<Text>>;416 };417 offchain: {418 /**419 * Get offchain local storage under given key and prefix420 **/421 localStorageGet: AugmentedRpc<(kind: StorageKind | 'PERSISTENT' | 'LOCAL' | number | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;422 /**423 * Set offchain local storage under given key and prefix424 **/425 localStorageSet: AugmentedRpc<(kind: StorageKind | 'PERSISTENT' | 'LOCAL' | number | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => Observable<Null>>;426 };427 payment: {428 /**429 * Query the detailed fee of a given encoded extrinsic430 **/431 queryFeeDetails: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<FeeDetails>>;432 /**433 * Retrieves the fee information for an encoded extrinsic434 **/435 queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfo>>;436 };437 rmrk: {438 /**439 * Get tokens owned by an account in a collection440 **/441 accountTokens: AugmentedRpc<(accountId: AccountId32 | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;442 /**443 * Get base info444 **/445 base: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsBaseBaseInfo>>>;446 /**447 * Get all Base's parts448 **/449 baseParts: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsPartPartType>>>;450 /**451 * Get collection by id452 **/453 collectionById: AugmentedRpc<(id: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsCollectionCollectionInfo>>>;454 /**455 * Get collection properties456 **/457 collectionProperties: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, filterKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsPropertyPropertyInfo>>>;458 /**459 * Get the latest created collection id460 **/461 lastCollectionIdx: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<u32>>;462 /**463 * Get NFT by collection id and NFT id464 **/465 nftById: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsNftNftInfo>>>;466 /**467 * Get NFT children468 **/469 nftChildren: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsNftNftChild>>>;470 /**471 * Get NFT properties472 **/473 nftProperties: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, filterKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsPropertyPropertyInfo>>>;474 /**475 * Get NFT resource priorities476 **/477 nftResourcePriority: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u32>>>;478 /**479 * Get NFT resources480 **/481 nftResources: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsResourceResourceInfo>>>;482 /**483 * Get Base's theme names484 **/485 themeNames: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<Bytes>>>;486 /**487 * Get Theme's keys values488 **/489 themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsTheme>>>;490 };491 rpc: {492 /**493 * Retrieves the list of RPC methods that are exposed by the node494 **/495 methods: AugmentedRpc<() => Observable<RpcMethods>>;496 };497 state: {498 /**499 * Perform a call to a builtin on the chain500 **/501 call: AugmentedRpc<(method: Text | string, data: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Bytes>>;502 /**503 * Retrieves the keys with prefix of a specific child storage504 **/505 getChildKeys: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;506 /**507 * Returns proof of storage for child key entries at a specific block state.508 **/509 getChildReadProof: AugmentedRpc<(childStorageKey: PrefixedStorageKey | string | Uint8Array, keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: BlockHash | string | Uint8Array) => Observable<ReadProof>>;510 /**511 * Retrieves the child storage for a key512 **/513 getChildStorage: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<StorageData>>;514 /**515 * Retrieves the child storage hash516 **/517 getChildStorageHash: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Hash>>;518 /**519 * Retrieves the child storage size520 **/521 getChildStorageSize: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<u64>>;522 /**523 * @deprecated Use `api.rpc.state.getKeysPaged` to retrieve keys524 * Retrieves the keys with a certain prefix525 **/526 getKeys: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;527 /**528 * Returns the keys with prefix with pagination support.529 **/530 getKeysPaged: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, count: u32 | AnyNumber | Uint8Array, startKey?: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;531 /**532 * Returns the runtime metadata533 **/534 getMetadata: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<Metadata>>;535 /**536 * @deprecated Use `api.rpc.state.getKeysPaged` to retrieve keys537 * Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)538 **/539 getPairs: AugmentedRpc<(prefix: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<KeyValue>>>;540 /**541 * Returns proof of storage entries at a specific block state542 **/543 getReadProof: AugmentedRpc<(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: BlockHash | string | Uint8Array) => Observable<ReadProof>>;544 /**545 * Get the runtime version546 **/547 getRuntimeVersion: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<RuntimeVersion>>;548 /**549 * Retrieves the storage for a key550 **/551 getStorage: AugmentedRpc<<T = Codec>(key: StorageKey | string | Uint8Array | any, block?: Hash | Uint8Array | string) => Observable<T>>;552 /**553 * Retrieves the storage hash554 **/555 getStorageHash: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Hash>>;556 /**557 * Retrieves the storage size558 **/559 getStorageSize: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<u64>>;560 /**561 * Query historical storage entries (by key) starting from a start block562 **/563 queryStorage: AugmentedRpc<<T = Codec[]>(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], fromBlock?: Hash | Uint8Array | string, toBlock?: Hash | Uint8Array | string) => Observable<[Hash, T][]>>;564 /**565 * Query storage entries (by key) starting at block hash given as the second parameter566 **/567 queryStorageAt: AugmentedRpc<<T = Codec[]>(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: Hash | Uint8Array | string) => Observable<T>>;568 /**569 * Retrieves the runtime version via subscription570 **/571 subscribeRuntimeVersion: AugmentedRpc<() => Observable<RuntimeVersion>>;572 /**573 * Subscribes to storage changes for the provided keys574 **/575 subscribeStorage: AugmentedRpc<<T = Codec[]>(keys?: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[]) => Observable<T>>;576 /**577 * Provides a way to trace the re-execution of a single block578 **/579 traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option<Text> | null | Uint8Array | Text | string, storageKeys: Option<Text> | null | Uint8Array | Text | string, methods: Option<Text> | null | Uint8Array | Text | string) => Observable<TraceBlockResponse>>;580 /**581 * Check current migration state582 **/583 trieMigrationStatus: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<MigrationStatusResult>>;584 };585 syncstate: {586 /**587 * Returns the json-serialized chainspec running the node, with a sync state.588 **/589 genSyncSpec: AugmentedRpc<(raw: bool | boolean | Uint8Array) => Observable<Json>>;590 };591 system: {592 /**593 * Retrieves the next accountIndex as available on the node594 **/595 accountNextIndex: AugmentedRpc<(accountId: AccountId | string | Uint8Array) => Observable<Index>>;596 /**597 * Adds the supplied directives to the current log filter598 **/599 addLogFilter: AugmentedRpc<(directives: Text | string) => Observable<Null>>;600 /**601 * Adds a reserved peer602 **/603 addReservedPeer: AugmentedRpc<(peer: Text | string) => Observable<Text>>;604 /**605 * Retrieves the chain606 **/607 chain: AugmentedRpc<() => Observable<Text>>;608 /**609 * Retrieves the chain type610 **/611 chainType: AugmentedRpc<() => Observable<ChainType>>;612 /**613 * Dry run an extrinsic at a given block614 **/615 dryRun: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;616 /**617 * Return health status of the node618 **/619 health: AugmentedRpc<() => Observable<Health>>;620 /**621 * The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example622 **/623 localListenAddresses: AugmentedRpc<() => Observable<Vec<Text>>>;624 /**625 * Returns the base58-encoded PeerId of the node626 **/627 localPeerId: AugmentedRpc<() => Observable<Text>>;628 /**629 * Retrieves the node name630 **/631 name: AugmentedRpc<() => Observable<Text>>;632 /**633 * Returns current state of the network634 **/635 networkState: AugmentedRpc<() => Observable<NetworkState>>;636 /**637 * Returns the roles the node is running as638 **/639 nodeRoles: AugmentedRpc<() => Observable<Vec<NodeRole>>>;640 /**641 * Returns the currently connected peers642 **/643 peers: AugmentedRpc<() => Observable<Vec<PeerInfo>>>;644 /**645 * Get a custom set of properties as a JSON object, defined in the chain spec646 **/647 properties: AugmentedRpc<() => Observable<ChainProperties>>;648 /**649 * Remove a reserved peer650 **/651 removeReservedPeer: AugmentedRpc<(peerId: Text | string) => Observable<Text>>;652 /**653 * Returns the list of reserved peers654 **/655 reservedPeers: AugmentedRpc<() => Observable<Vec<Text>>>;656 /**657 * Resets the log filter to Substrate defaults658 **/659 resetLogFilter: AugmentedRpc<() => Observable<Null>>;660 /**661 * Returns the state of the syncing of the node662 **/663 syncState: AugmentedRpc<() => Observable<SyncState>>;664 /**665 * Retrieves the version of the node666 **/667 version: AugmentedRpc<() => Observable<Text>>;668 };669 unique: {670 /**671 * Get the amount of any user tokens owned by an account672 **/673 accountBalance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;674 /**675 * Get tokens owned by an account in a collection676 **/677 accountTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;678 /**679 * Get the list of admin accounts of a collection680 **/681 adminlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;682 /**683 * Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor684 **/685 allowance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, sender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, spender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;686 /**687 * Check if a user is allowed to operate within a collection688 **/689 allowed: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;690 /**691 * Get the list of accounts allowed to operate within a collection692 **/693 allowlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;694 /**695 * Get the amount of a specific token owned by an account696 **/697 balance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;698 /**699 * Get a collection by the specified ID700 **/701 collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRpcCollection>>>;702 /**703 * Get collection properties, optionally limited to the provided keys704 **/705 collectionProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;706 /**707 * Get chain stats about collections708 **/709 collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<UpDataStructsCollectionStats>>;710 /**711 * Get tokens contained within a collection712 **/713 collectionTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;714 /**715 * Get token constant metadata716 **/717 constMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;718 /**719 * Get effective collection limits720 **/721 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;722 /**723 * Tells whether an operator is approved by a given owner.724 **/725 isApprovedForAll: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, operator: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<bool>>>;726 /**727 * Get the last token ID created in a collection728 **/729 lastTokenId: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;730 /**731 * Get the number of blocks until sponsoring a transaction is available732 **/733 nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;734 /**735 * Get property permissions, optionally limited to the provided keys736 **/737 propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;738 /**739 * Get tokens nested directly into the token740 **/741 tokenChildren: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsTokenChild>>>;742 /**743 * Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT744 **/745 tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<UpDataStructsTokenData>>;746 /**747 * Check if the token exists748 **/749 tokenExists: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;750 /**751 * Get the token owner752 **/753 tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;754 /**755 * Returns 10 tokens owners in no particular order756 **/757 tokenOwners: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;758 /**759 * Get token properties, optionally limited to the provided keys760 **/761 tokenProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;762 /**763 * Get the topmost token owner in the hierarchy of a possibly nested token764 **/765 topmostTokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;766 /**767 * Get the total amount of pieces of an RFT768 **/769 totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u128>>>;770 /**771 * Get the amount of distinctive tokens present in a collection772 **/773 totalSupply: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;774 /**775 * Get token variable metadata776 **/777 variableMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;778 };779 web3: {780 /**781 * Returns current client version.782 **/783 clientVersion: AugmentedRpc<() => Observable<Text>>;784 /**785 * Returns sha3 of the given data786 **/787 sha3: AugmentedRpc<(data: Bytes | string | Uint8Array) => Observable<H256>>;788 };789 } // RpcInterface790} // declare module1// Auto-generated via `yarn polkadot-types-from-chain`, do not edit2/* eslint-disable */34// import type lookup before we augment - in some environments5// this is required to allow for ambient/previous definitions6import '@polkadot/rpc-core/types/jsonrpc';78import type { PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsPartPartType, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default';9import type { AugmentedRpc } from '@polkadot/rpc-core/types';10import type { Metadata, StorageKey } from '@polkadot/types';11import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec';12import type { AnyNumber, Codec, ITuple } from '@polkadot/types-codec/types';13import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';14import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';15import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';16import type { BlockHash } from '@polkadot/types/interfaces/chain';17import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';18import type { AuthorityId } from '@polkadot/types/interfaces/consensus';19import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';20import type { BlockStats } from '@polkadot/types/interfaces/dev';21import type { CreatedBlock } from '@polkadot/types/interfaces/engine';22import type { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';23import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';24import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';25import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';26import type { StorageKind } from '@polkadot/types/interfaces/offchain';27import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';28import type { RpcMethods } from '@polkadot/types/interfaces/rpc';29import type { AccountId, AccountId32, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';30import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';31import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';32import type { IExtrinsic, Observable } from '@polkadot/types/types';3334export type __AugmentedRpc = AugmentedRpc<() => unknown>;3536declare module '@polkadot/rpc-core/types/jsonrpc' {37 interface RpcInterface {38 appPromotion: {39 /**40 * Returns the total amount of unstaked tokens41 **/42 pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;43 /**44 * Returns the total amount of unstaked tokens per block45 **/46 pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;47 /**48 * Returns the total amount of staked tokens49 **/50 totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;51 /**52 * Returns the total amount of staked tokens per block when staked53 **/54 totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>>;55 };56 author: {57 /**58 * Returns true if the keystore has private keys for the given public key and key type.59 **/60 hasKey: AugmentedRpc<(publicKey: Bytes | string | Uint8Array, keyType: Text | string) => Observable<bool>>;61 /**62 * Returns true if the keystore has private keys for the given session public keys.63 **/64 hasSessionKeys: AugmentedRpc<(sessionKeys: Bytes | string | Uint8Array) => Observable<bool>>;65 /**66 * Insert a key into the keystore.67 **/68 insertKey: AugmentedRpc<(keyType: Text | string, suri: Text | string, publicKey: Bytes | string | Uint8Array) => Observable<Bytes>>;69 /**70 * Returns all pending extrinsics, potentially grouped by sender71 **/72 pendingExtrinsics: AugmentedRpc<() => Observable<Vec<Extrinsic>>>;73 /**74 * Remove given extrinsic from the pool and temporarily ban it to prevent reimporting75 **/76 removeExtrinsic: AugmentedRpc<(bytesOrHash: Vec<ExtrinsicOrHash> | (ExtrinsicOrHash | { Hash: any } | { Extrinsic: any } | string | Uint8Array)[]) => Observable<Vec<Hash>>>;77 /**78 * Generate new session keys and returns the corresponding public keys79 **/80 rotateKeys: AugmentedRpc<() => Observable<Bytes>>;81 /**82 * Submit and subscribe to watch an extrinsic until unsubscribed83 **/84 submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ExtrinsicStatus>>;85 /**86 * Submit a fully formatted extrinsic for block inclusion87 **/88 submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Hash>>;89 };90 babe: {91 /**92 * Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore93 **/94 epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;95 };96 beefy: {97 /**98 * Returns hash of the latest BEEFY finalized block as seen by this client.99 **/100 getFinalizedHead: AugmentedRpc<() => Observable<H256>>;101 /**102 * Returns the block most recently finalized by BEEFY, alongside side its justification.103 **/104 subscribeJustifications: AugmentedRpc<() => Observable<BeefySignedCommitment>>;105 };106 chain: {107 /**108 * Get header and body of a relay chain block109 **/110 getBlock: AugmentedRpc<(hash?: BlockHash | string | Uint8Array) => Observable<SignedBlock>>;111 /**112 * Get the block hash for a specific block113 **/114 getBlockHash: AugmentedRpc<(blockNumber?: BlockNumber | AnyNumber | Uint8Array) => Observable<BlockHash>>;115 /**116 * Get hash of the last finalized block in the canon chain117 **/118 getFinalizedHead: AugmentedRpc<() => Observable<BlockHash>>;119 /**120 * Retrieves the header for a specific block121 **/122 getHeader: AugmentedRpc<(hash?: BlockHash | string | Uint8Array) => Observable<Header>>;123 /**124 * Retrieves the newest header via subscription125 **/126 subscribeAllHeads: AugmentedRpc<() => Observable<Header>>;127 /**128 * Retrieves the best finalized header via subscription129 **/130 subscribeFinalizedHeads: AugmentedRpc<() => Observable<Header>>;131 /**132 * Retrieves the best header via subscription133 **/134 subscribeNewHeads: AugmentedRpc<() => Observable<Header>>;135 };136 childstate: {137 /**138 * Returns the keys with prefix from a child storage, leave empty to get all the keys139 **/140 getKeys: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;141 /**142 * Returns the keys with prefix from a child storage with pagination support143 **/144 getKeysPaged: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, count: u32 | AnyNumber | Uint8Array, startKey?: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;145 /**146 * Returns a child storage entry at a specific block state147 **/148 getStorage: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<StorageData>>>;149 /**150 * Returns child storage entries for multiple keys at a specific block state151 **/152 getStorageEntries: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: Hash | string | Uint8Array) => Observable<Vec<Option<StorageData>>>>;153 /**154 * Returns the hash of a child storage entry at a block state155 **/156 getStorageHash: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<Hash>>>;157 /**158 * Returns the size of a child storage entry at a block state159 **/160 getStorageSize: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;161 };162 contracts: {163 /**164 * @deprecated Use the runtime interface `api.call.contractsApi.call` instead165 * Executes a call to a contract166 **/167 call: AugmentedRpc<(callRequest: ContractCallRequest | { origin?: any; dest?: any; value?: any; gasLimit?: any; storageDepositLimit?: any; inputData?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ContractExecResult>>;168 /**169 * @deprecated Use the runtime interface `api.call.contractsApi.getStorage` instead170 * Returns the value under a specified storage key in a contract171 **/172 getStorage: AugmentedRpc<(address: AccountId | string | Uint8Array, key: H256 | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<Bytes>>>;173 /**174 * @deprecated Use the runtime interface `api.call.contractsApi.instantiate` instead175 * Instantiate a new contract176 **/177 instantiate: AugmentedRpc<(request: InstantiateRequest | { origin?: any; value?: any; gasLimit?: any; storageDepositLimit?: any; code?: any; data?: any; salt?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ContractInstantiateResult>>;178 /**179 * @deprecated Not available in newer versions of the contracts interfaces180 * Returns the projected time a given contract will be able to sustain paying its rent181 **/182 rentProjection: AugmentedRpc<(address: AccountId | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<BlockNumber>>>;183 /**184 * @deprecated Use the runtime interface `api.call.contractsApi.uploadCode` instead185 * Upload new code without instantiating a contract from it186 **/187 uploadCode: AugmentedRpc<(uploadRequest: CodeUploadRequest | { origin?: any; code?: any; storageDepositLimit?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<CodeUploadResult>>;188 };189 dev: {190 /**191 * Reexecute the specified `block_hash` and gather statistics while doing so192 **/193 getBlockStats: AugmentedRpc<(at: Hash | string | Uint8Array) => Observable<Option<BlockStats>>>;194 };195 engine: {196 /**197 * Instructs the manual-seal authorship task to create a new block198 **/199 createBlock: AugmentedRpc<(createEmpty: bool | boolean | Uint8Array, finalize: bool | boolean | Uint8Array, parentHash?: BlockHash | string | Uint8Array) => Observable<CreatedBlock>>;200 /**201 * Instructs the manual-seal authorship task to finalize a block202 **/203 finalizeBlock: AugmentedRpc<(hash: BlockHash | string | Uint8Array, justification?: Justification) => Observable<bool>>;204 };205 eth: {206 /**207 * Returns accounts list.208 **/209 accounts: AugmentedRpc<() => Observable<Vec<H160>>>;210 /**211 * Returns the blockNumber212 **/213 blockNumber: AugmentedRpc<() => Observable<U256>>;214 /**215 * Call contract, returning the output data.216 **/217 call: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<Bytes>>;218 /**219 * Returns the chain ID used for transaction signing at the current best block. None is returned if not available.220 **/221 chainId: AugmentedRpc<() => Observable<U64>>;222 /**223 * Returns block author.224 **/225 coinbase: AugmentedRpc<() => Observable<H160>>;226 /**227 * Estimate gas needed for execution of given contract.228 **/229 estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;230 /**231 * Returns fee history for given block count & reward percentiles232 **/233 feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option<Vec<f64>> | null | Uint8Array | Vec<f64> | (f64)[]) => Observable<EthFeeHistory>>;234 /**235 * Returns current gas price.236 **/237 gasPrice: AugmentedRpc<() => Observable<U256>>;238 /**239 * Returns balance of the given account.240 **/241 getBalance: AugmentedRpc<(address: H160 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;242 /**243 * Returns block with given hash.244 **/245 getBlockByHash: AugmentedRpc<(hash: H256 | string | Uint8Array, full: bool | boolean | Uint8Array) => Observable<Option<EthRichBlock>>>;246 /**247 * Returns block with given number.248 **/249 getBlockByNumber: AugmentedRpc<(block: BlockNumber | AnyNumber | Uint8Array, full: bool | boolean | Uint8Array) => Observable<Option<EthRichBlock>>>;250 /**251 * Returns the number of transactions in a block with given hash.252 **/253 getBlockTransactionCountByHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<U256>>;254 /**255 * Returns the number of transactions in a block with given block number.256 **/257 getBlockTransactionCountByNumber: AugmentedRpc<(block: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;258 /**259 * Returns the code at given address at given time (block number).260 **/261 getCode: AugmentedRpc<(address: H160 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<Bytes>>;262 /**263 * Returns filter changes since last poll.264 **/265 getFilterChanges: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<EthFilterChanges>>;266 /**267 * Returns all logs matching given filter (in a range 'from' - 'to').268 **/269 getFilterLogs: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<Vec<EthLog>>>;270 /**271 * Returns logs matching given filter object.272 **/273 getLogs: AugmentedRpc<(filter: EthFilter | { fromBlock?: any; toBlock?: any; blockHash?: any; address?: any; topics?: any } | string | Uint8Array) => Observable<Vec<EthLog>>>;274 /**275 * Returns proof for account and storage.276 **/277 getProof: AugmentedRpc<(address: H160 | string | Uint8Array, storageKeys: Vec<H256> | (H256 | string | Uint8Array)[], number: BlockNumber | AnyNumber | Uint8Array) => Observable<EthAccount>>;278 /**279 * Returns content of the storage at given address.280 **/281 getStorageAt: AugmentedRpc<(address: H160 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<H256>>;282 /**283 * Returns transaction at given block hash and index.284 **/285 getTransactionByBlockHashAndIndex: AugmentedRpc<(hash: H256 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthTransaction>>;286 /**287 * Returns transaction by given block number and index.288 **/289 getTransactionByBlockNumberAndIndex: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthTransaction>>;290 /**291 * Get transaction by its hash.292 **/293 getTransactionByHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<EthTransaction>>;294 /**295 * Returns the number of transactions sent from given address at given time (block number).296 **/297 getTransactionCount: AugmentedRpc<(hash: H256 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;298 /**299 * Returns transaction receipt by transaction hash.300 **/301 getTransactionReceipt: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<EthReceipt>>;302 /**303 * Returns an uncles at given block and index.304 **/305 getUncleByBlockHashAndIndex: AugmentedRpc<(hash: H256 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthRichBlock>>;306 /**307 * Returns an uncles at given block and index.308 **/309 getUncleByBlockNumberAndIndex: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthRichBlock>>;310 /**311 * Returns the number of uncles in a block with given hash.312 **/313 getUncleCountByBlockHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<U256>>;314 /**315 * Returns the number of uncles in a block with given block number.316 **/317 getUncleCountByBlockNumber: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;318 /**319 * Returns the hash of the current block, the seedHash, and the boundary condition to be met.320 **/321 getWork: AugmentedRpc<() => Observable<EthWork>>;322 /**323 * Returns the number of hashes per second that the node is mining with.324 **/325 hashrate: AugmentedRpc<() => Observable<U256>>;326 /**327 * Returns max priority fee per gas328 **/329 maxPriorityFeePerGas: AugmentedRpc<() => Observable<U256>>;330 /**331 * Returns true if client is actively mining new blocks.332 **/333 mining: AugmentedRpc<() => Observable<bool>>;334 /**335 * Returns id of new block filter.336 **/337 newBlockFilter: AugmentedRpc<() => Observable<U256>>;338 /**339 * Returns id of new filter.340 **/341 newFilter: AugmentedRpc<(filter: EthFilter | { fromBlock?: any; toBlock?: any; blockHash?: any; address?: any; topics?: any } | string | Uint8Array) => Observable<U256>>;342 /**343 * Returns id of new block filter.344 **/345 newPendingTransactionFilter: AugmentedRpc<() => Observable<U256>>;346 /**347 * Returns protocol version encoded as a string (quotes are necessary).348 **/349 protocolVersion: AugmentedRpc<() => Observable<u64>>;350 /**351 * Sends signed transaction, returning its hash.352 **/353 sendRawTransaction: AugmentedRpc<(bytes: Bytes | string | Uint8Array) => Observable<H256>>;354 /**355 * Sends transaction; will block waiting for signer to return the transaction hash356 **/357 sendTransaction: AugmentedRpc<(tx: EthTransactionRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array) => Observable<H256>>;358 /**359 * Used for submitting mining hashrate.360 **/361 submitHashrate: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array, hash: H256 | string | Uint8Array) => Observable<bool>>;362 /**363 * Used for submitting a proof-of-work solution.364 **/365 submitWork: AugmentedRpc<(nonce: H64 | string | Uint8Array, headerHash: H256 | string | Uint8Array, mixDigest: H256 | string | Uint8Array) => Observable<bool>>;366 /**367 * Subscribe to Eth subscription.368 **/369 subscribe: AugmentedRpc<(kind: EthSubKind | 'newHeads' | 'logs' | 'newPendingTransactions' | 'syncing' | number | Uint8Array, params?: EthSubParams | { None: any } | { Logs: any } | string | Uint8Array) => Observable<Null>>;370 /**371 * Returns an object with data about the sync status or false.372 **/373 syncing: AugmentedRpc<() => Observable<EthSyncStatus>>;374 /**375 * Uninstalls filter.376 **/377 uninstallFilter: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<bool>>;378 };379 grandpa: {380 /**381 * Prove finality for the given block number, returning the Justification for the last block in the set.382 **/383 proveFinality: AugmentedRpc<(blockNumber: BlockNumber | AnyNumber | Uint8Array) => Observable<Option<EncodedFinalityProofs>>>;384 /**385 * Returns the state of the current best round state as well as the ongoing background rounds386 **/387 roundState: AugmentedRpc<() => Observable<ReportedRoundStates>>;388 /**389 * Subscribes to grandpa justifications390 **/391 subscribeJustifications: AugmentedRpc<() => Observable<JustificationNotification>>;392 };393 mmr: {394 /**395 * Generate MMR proof for the given leaf indices.396 **/397 generateBatchProof: AugmentedRpc<(leafIndices: Vec<u64> | (u64 | AnyNumber | Uint8Array)[], at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;398 /**399 * Generate MMR proof for given leaf index.400 **/401 generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafBatchProof>>;402 };403 net: {404 /**405 * Returns true if client is actively listening for network connections. Otherwise false.406 **/407 listening: AugmentedRpc<() => Observable<bool>>;408 /**409 * Returns number of peers connected to node.410 **/411 peerCount: AugmentedRpc<() => Observable<Text>>;412 /**413 * Returns protocol version.414 **/415 version: AugmentedRpc<() => Observable<Text>>;416 };417 offchain: {418 /**419 * Get offchain local storage under given key and prefix420 **/421 localStorageGet: AugmentedRpc<(kind: StorageKind | 'PERSISTENT' | 'LOCAL' | number | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;422 /**423 * Set offchain local storage under given key and prefix424 **/425 localStorageSet: AugmentedRpc<(kind: StorageKind | 'PERSISTENT' | 'LOCAL' | number | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => Observable<Null>>;426 };427 payment: {428 /**429 * Query the detailed fee of a given encoded extrinsic430 **/431 queryFeeDetails: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<FeeDetails>>;432 /**433 * Retrieves the fee information for an encoded extrinsic434 **/435 queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfo>>;436 };437 rmrk: {438 /**439 * Get tokens owned by an account in a collection440 **/441 accountTokens: AugmentedRpc<(accountId: AccountId32 | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;442 /**443 * Get base info444 **/445 base: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsBaseBaseInfo>>>;446 /**447 * Get all Base's parts448 **/449 baseParts: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsPartPartType>>>;450 /**451 * Get collection by id452 **/453 collectionById: AugmentedRpc<(id: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsCollectionCollectionInfo>>>;454 /**455 * Get collection properties456 **/457 collectionProperties: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, filterKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsPropertyPropertyInfo>>>;458 /**459 * Get the latest created collection id460 **/461 lastCollectionIdx: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<u32>>;462 /**463 * Get NFT by collection id and NFT id464 **/465 nftById: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsNftNftInfo>>>;466 /**467 * Get NFT children468 **/469 nftChildren: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsNftNftChild>>>;470 /**471 * Get NFT properties472 **/473 nftProperties: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, filterKeys?: Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsPropertyPropertyInfo>>>;474 /**475 * Get NFT resource priorities476 **/477 nftResourcePriority: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u32>>>;478 /**479 * Get NFT resources480 **/481 nftResources: AugmentedRpc<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<RmrkTraitsResourceResourceInfo>>>;482 /**483 * Get Base's theme names484 **/485 themeNames: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<Bytes>>>;486 /**487 * Get Theme's keys values488 **/489 themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsTheme>>>;490 };491 rpc: {492 /**493 * Retrieves the list of RPC methods that are exposed by the node494 **/495 methods: AugmentedRpc<() => Observable<RpcMethods>>;496 };497 state: {498 /**499 * Perform a call to a builtin on the chain500 **/501 call: AugmentedRpc<(method: Text | string, data: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Bytes>>;502 /**503 * Retrieves the keys with prefix of a specific child storage504 **/505 getChildKeys: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;506 /**507 * Returns proof of storage for child key entries at a specific block state.508 **/509 getChildReadProof: AugmentedRpc<(childStorageKey: PrefixedStorageKey | string | Uint8Array, keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: BlockHash | string | Uint8Array) => Observable<ReadProof>>;510 /**511 * Retrieves the child storage for a key512 **/513 getChildStorage: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<StorageData>>;514 /**515 * Retrieves the child storage hash516 **/517 getChildStorageHash: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Hash>>;518 /**519 * Retrieves the child storage size520 **/521 getChildStorageSize: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<u64>>;522 /**523 * @deprecated Use `api.rpc.state.getKeysPaged` to retrieve keys524 * Retrieves the keys with a certain prefix525 **/526 getKeys: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;527 /**528 * Returns the keys with prefix with pagination support.529 **/530 getKeysPaged: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, count: u32 | AnyNumber | Uint8Array, startKey?: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;531 /**532 * Returns the runtime metadata533 **/534 getMetadata: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<Metadata>>;535 /**536 * @deprecated Use `api.rpc.state.getKeysPaged` to retrieve keys537 * Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)538 **/539 getPairs: AugmentedRpc<(prefix: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<KeyValue>>>;540 /**541 * Returns proof of storage entries at a specific block state542 **/543 getReadProof: AugmentedRpc<(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: BlockHash | string | Uint8Array) => Observable<ReadProof>>;544 /**545 * Get the runtime version546 **/547 getRuntimeVersion: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<RuntimeVersion>>;548 /**549 * Retrieves the storage for a key550 **/551 getStorage: AugmentedRpc<<T = Codec>(key: StorageKey | string | Uint8Array | any, block?: Hash | Uint8Array | string) => Observable<T>>;552 /**553 * Retrieves the storage hash554 **/555 getStorageHash: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Hash>>;556 /**557 * Retrieves the storage size558 **/559 getStorageSize: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<u64>>;560 /**561 * Query historical storage entries (by key) starting from a start block562 **/563 queryStorage: AugmentedRpc<<T = Codec[]>(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], fromBlock?: Hash | Uint8Array | string, toBlock?: Hash | Uint8Array | string) => Observable<[Hash, T][]>>;564 /**565 * Query storage entries (by key) starting at block hash given as the second parameter566 **/567 queryStorageAt: AugmentedRpc<<T = Codec[]>(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: Hash | Uint8Array | string) => Observable<T>>;568 /**569 * Retrieves the runtime version via subscription570 **/571 subscribeRuntimeVersion: AugmentedRpc<() => Observable<RuntimeVersion>>;572 /**573 * Subscribes to storage changes for the provided keys574 **/575 subscribeStorage: AugmentedRpc<<T = Codec[]>(keys?: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[]) => Observable<T>>;576 /**577 * Provides a way to trace the re-execution of a single block578 **/579 traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option<Text> | null | Uint8Array | Text | string, storageKeys: Option<Text> | null | Uint8Array | Text | string, methods: Option<Text> | null | Uint8Array | Text | string) => Observable<TraceBlockResponse>>;580 /**581 * Check current migration state582 **/583 trieMigrationStatus: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<MigrationStatusResult>>;584 };585 syncstate: {586 /**587 * Returns the json-serialized chainspec running the node, with a sync state.588 **/589 genSyncSpec: AugmentedRpc<(raw: bool | boolean | Uint8Array) => Observable<Json>>;590 };591 system: {592 /**593 * Retrieves the next accountIndex as available on the node594 **/595 accountNextIndex: AugmentedRpc<(accountId: AccountId | string | Uint8Array) => Observable<Index>>;596 /**597 * Adds the supplied directives to the current log filter598 **/599 addLogFilter: AugmentedRpc<(directives: Text | string) => Observable<Null>>;600 /**601 * Adds a reserved peer602 **/603 addReservedPeer: AugmentedRpc<(peer: Text | string) => Observable<Text>>;604 /**605 * Retrieves the chain606 **/607 chain: AugmentedRpc<() => Observable<Text>>;608 /**609 * Retrieves the chain type610 **/611 chainType: AugmentedRpc<() => Observable<ChainType>>;612 /**613 * Dry run an extrinsic at a given block614 **/615 dryRun: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;616 /**617 * Return health status of the node618 **/619 health: AugmentedRpc<() => Observable<Health>>;620 /**621 * The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example622 **/623 localListenAddresses: AugmentedRpc<() => Observable<Vec<Text>>>;624 /**625 * Returns the base58-encoded PeerId of the node626 **/627 localPeerId: AugmentedRpc<() => Observable<Text>>;628 /**629 * Retrieves the node name630 **/631 name: AugmentedRpc<() => Observable<Text>>;632 /**633 * Returns current state of the network634 **/635 networkState: AugmentedRpc<() => Observable<NetworkState>>;636 /**637 * Returns the roles the node is running as638 **/639 nodeRoles: AugmentedRpc<() => Observable<Vec<NodeRole>>>;640 /**641 * Returns the currently connected peers642 **/643 peers: AugmentedRpc<() => Observable<Vec<PeerInfo>>>;644 /**645 * Get a custom set of properties as a JSON object, defined in the chain spec646 **/647 properties: AugmentedRpc<() => Observable<ChainProperties>>;648 /**649 * Remove a reserved peer650 **/651 removeReservedPeer: AugmentedRpc<(peerId: Text | string) => Observable<Text>>;652 /**653 * Returns the list of reserved peers654 **/655 reservedPeers: AugmentedRpc<() => Observable<Vec<Text>>>;656 /**657 * Resets the log filter to Substrate defaults658 **/659 resetLogFilter: AugmentedRpc<() => Observable<Null>>;660 /**661 * Returns the state of the syncing of the node662 **/663 syncState: AugmentedRpc<() => Observable<SyncState>>;664 /**665 * Retrieves the version of the node666 **/667 version: AugmentedRpc<() => Observable<Text>>;668 };669 unique: {670 /**671 * Get the amount of any user tokens owned by an account672 **/673 accountBalance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;674 /**675 * Get tokens owned by an account in a collection676 **/677 accountTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;678 /**679 * Get the list of admin accounts of a collection680 **/681 adminlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;682 /**683 * Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor684 **/685 allowance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, sender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, spender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;686 /**687 * Tells whether the given `owner` approves the `operator`.688 **/689 allowanceForAll: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, operator: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<bool>>>;690 /**691 * Check if a user is allowed to operate within a collection692 **/693 allowed: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;694 /**695 * Get the list of accounts allowed to operate within a collection696 **/697 allowlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;698 /**699 * Get the amount of a specific token owned by an account700 **/701 balance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u128>>;702 /**703 * Get a collection by the specified ID704 **/705 collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsRpcCollection>>>;706 /**707 * Get collection properties, optionally limited to the provided keys708 **/709 collectionProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;710 /**711 * Get chain stats about collections712 **/713 collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<UpDataStructsCollectionStats>>;714 /**715 * Get tokens contained within a collection716 **/717 collectionTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<u32>>>;718 /**719 * Get token constant metadata720 **/721 constMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;722 /**723 * Get effective collection limits724 **/725 effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<UpDataStructsCollectionLimits>>>;726 /**727 * Get the last token ID created in a collection728 **/729 lastTokenId: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;730 /**731 * Get the number of blocks until sponsoring a transaction is available732 **/733 nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;734 /**735 * Get property permissions, optionally limited to the provided keys736 **/737 propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsPropertyKeyPermission>>>;738 /**739 * Get tokens nested directly into the token740 **/741 tokenChildren: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsTokenChild>>>;742 /**743 * Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT744 **/745 tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<UpDataStructsTokenData>>;746 /**747 * Check if the token exists748 **/749 tokenExists: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<bool>>;750 /**751 * Get the token owner752 **/753 tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;754 /**755 * Returns 10 tokens owners in no particular order756 **/757 tokenOwners: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Vec<PalletEvmAccountBasicCrossAccountIdRepr>>>;758 /**759 * Get token properties, optionally limited to the provided keys760 **/761 tokenProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Vec<UpDataStructsProperty>>>;762 /**763 * Get the topmost token owner in the hierarchy of a possibly nested token764 **/765 topmostTokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<PalletEvmAccountBasicCrossAccountIdRepr>>>;766 /**767 * Get the total amount of pieces of an RFT768 **/769 totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<u128>>>;770 /**771 * Get the amount of distinctive tokens present in a collection772 **/773 totalSupply: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<u32>>;774 /**775 * Get token variable metadata776 **/777 variableMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Bytes>>;778 };779 web3: {780 /**781 * Returns current client version.782 **/783 clientVersion: AugmentedRpc<() => Observable<Text>>;784 /**785 * Returns sha3 of the given data786 **/787 sha3: AugmentedRpc<(data: Bytes | string | Uint8Array) => Observable<H256>>;788 };789 } // RpcInterface790} // declare moduletests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -1547,15 +1547,15 @@
/**
* Sets or unsets the approval of a given operator.
*
- * An operator is allowed to transfer all tokens of the sender on their behalf.
+ * The `operator` is allowed to transfer all tokens of the `owner` on their behalf.
*
* # Arguments
*
* * `owner`: Token owner
* * `operator`: Operator
- * * `approve`: Is operator enabled or disabled
+ * * `approve`: Should operator status be granted or revoked?
**/
- setApprovalForAll: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, operator: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, bool]>;
+ setAllowanceForAll: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, operator: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletEvmAccountBasicCrossAccountIdRepr, bool]>;
/**
* Set specific limits of a collection. Empty, or None fields mean chain default.
*
tests/src/interfaces/default/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -2312,13 +2312,13 @@
readonly tokenId: u32;
readonly amount: u128;
} & Struct;
- readonly isSetApprovalForAll: boolean;
- readonly asSetApprovalForAll: {
+ readonly isSetAllowanceForAll: boolean;
+ readonly asSetAllowanceForAll: {
readonly collectionId: u32;
readonly operator: PalletEvmAccountBasicCrossAccountIdRepr;
readonly approve: bool;
} & Struct;
- readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition' | 'SetApprovalForAll';
+ readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition' | 'SetAllowanceForAll';
}
/** @name PalletUniqueError */
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -2305,7 +2305,7 @@
tokenId: 'u32',
amount: 'u128',
},
- set_approval_for_all: {
+ set_allowance_for_all: {
collectionId: 'u32',
operator: 'PalletEvmAccountBasicCrossAccountIdRepr',
approve: 'bool'
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -2541,13 +2541,13 @@
readonly tokenId: u32;
readonly amount: u128;
} & Struct;
- readonly isSetApprovalForAll: boolean;
- readonly asSetApprovalForAll: {
+ readonly isSetAllowanceForAll: boolean;
+ readonly asSetAllowanceForAll: {
readonly collectionId: u32;
readonly operator: PalletEvmAccountBasicCrossAccountIdRepr;
readonly approve: bool;
} & Struct;
- readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition' | 'SetApprovalForAll';
+ readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition' | 'SetAllowanceForAll';
}
/** @name UpDataStructsCollectionMode (240) */
tests/src/interfaces/unique/definitions.tsdiffbeforeafterboth--- a/tests/src/interfaces/unique/definitions.ts
+++ b/tests/src/interfaces/unique/definitions.ts
@@ -175,8 +175,8 @@
[collectionParam, tokenParam],
'Option<u128>',
),
- isApprovedForAll: fun(
- 'Tells whether an operator is approved by a given owner.',
+ allowanceForAll: fun(
+ 'Tells whether the given `owner` approves the `operator`.',
[collectionParam, crossAccountParam('owner'), crossAccountParam('operator')],
'Option<bool>',
),
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -1415,26 +1415,26 @@
}
/**
- * Tells whether an operator is approved by a given owner.
+ * Tells whether the given `owner` approves the `operator`.
* @param collectionId ID of collection
* @param owner owner address
- * @param operator operator addrees
+ * @param operator operator addrees
* @returns true if operator is enabled
*/
- async isApprovedForAll(collectionId: number, owner: ICrossAccountId, operator: ICrossAccountId): Promise<boolean> {
- return (await this.helper.callRpc('api.rpc.unique.isApprovedForAll', [collectionId, owner, operator])).toJSON();
+ async allowanceForAll(collectionId: number, owner: ICrossAccountId, operator: ICrossAccountId): Promise<boolean> {
+ return (await this.helper.callRpc('api.rpc.unique.allowanceForAll', [collectionId, owner, operator])).toJSON();
}
/** Sets or unsets the approval of a given operator.
- * An operator is allowed to transfer all tokens of the sender on their behalf.
- * @param operator Operator
- * @param approved Is operator enabled or disabled
+ * The `operator` is allowed to transfer all tokens of the `caller` on their behalf.
+ * @param operator Operator
+ * @param approved Should operator status be granted or revoked?
* @returns ```true``` if extrinsic success, otherwise ```false```
*/
- async setApprovalForAll(signer: TSigner, collectionId: number, operator: ICrossAccountId, approved: boolean): Promise<boolean> {
+ async setAllowanceForAll(signer: TSigner, collectionId: number, operator: ICrossAccountId, approved: boolean): Promise<boolean> {
const result = await this.helper.executeExtrinsic(
signer,
- 'api.tx.unique.setApprovalForAll', [collectionId, operator, approved],
+ 'api.tx.unique.setAllowanceForAll', [collectionId, operator, approved],
true,
);
return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'ApprovedForAll');