From 5cabb73eda6326f99fee17f611b0b6c486ae4187 Mon Sep 17 00:00:00 2001 From: Aramik Date: Wed, 30 Oct 2024 17:11:04 -0700 Subject: [PATCH 1/3] adding ethereum h160 style account support --- Cargo.lock | 3 + Cargo.toml | 1 + common/primitives/Cargo.toml | 5 +- common/primitives/src/lib.rs | 3 + common/primitives/src/node.rs | 3 +- common/primitives/src/signatures.rs | 249 +++++++++ e2e/.mocharc.json | 2 +- e2e/package-lock.json | 704 ++++++++++++------------ e2e/passkey/passkeyProxy.ecdsa.test.ts | 197 +++++++ e2e/scaffolding/P256.ts | 3 +- e2e/scaffolding/extrinsicHelpers.ts | 33 +- e2e/scaffolding/funding.ts | 46 +- e2e/scaffolding/globalHooks.ts | 6 +- e2e/scaffolding/helpers.ts | 27 +- e2e/scaffolding/rootHooks.ts | 2 +- pallets/frequency-tx-payment/src/lib.rs | 11 +- pallets/passkey/src/lib.rs | 27 +- runtime/frequency/Cargo.toml | 4 + runtime/frequency/src/eth.rs | 48 ++ runtime/frequency/src/lib.rs | 10 +- scripts/init.sh | 4 +- 21 files changed, 982 insertions(+), 406 deletions(-) create mode 100644 common/primitives/src/signatures.rs create mode 100644 e2e/passkey/passkeyProxy.ecdsa.test.ts create mode 100644 runtime/frequency/src/eth.rs diff --git a/Cargo.lock b/Cargo.lock index 4113e25cda..d86bee87a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1514,6 +1514,8 @@ dependencies = [ "frame-support", "frame-system", "impl-serde", + "libsecp256k1", + "log", "numtoa", "parity-scale-codec", "scale-info", @@ -3743,6 +3745,7 @@ dependencies = [ "sp-block-builder", "sp-consensus-aura", "sp-core", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-genesis-builder", "sp-inherents", "sp-io", diff --git a/Cargo.toml b/Cargo.toml index b30bc1cd0d..8b7bf3a803 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ thiserror = "1.0.40" apache-avro = { version = "0.14.0", default-features = false } rand = "0.8.5" parking_lot = "0.12.1" +libsecp256k1 = { version = "0.7", default-features = false } # substrate wasm parity-scale-codec = { version = "3.6.12", default-features = false } diff --git a/common/primitives/Cargo.toml b/common/primitives/Cargo.toml index 94b4cdef51..ce363befaf 100644 --- a/common/primitives/Cargo.toml +++ b/common/primitives/Cargo.toml @@ -30,11 +30,14 @@ sp-std = { workspace = true } numtoa = { workspace = true } sp-externalities = { workspace = true } sp-runtime-interface = { workspace = true } +libsecp256k1 = { workspace = true, features = ["hmac"] } +log = "0.4.22" [features] default = ['std'] runtime-benchmarks = [] std = [ + 'libsecp256k1/std', 'parity-scale-codec/std', 'frame-support/std', 'frame-system/std', @@ -47,4 +50,4 @@ std = [ 'sp-externalities/std', 'sp-runtime-interface/std' ] -test = [] \ No newline at end of file +test = [] diff --git a/common/primitives/src/lib.rs b/common/primitives/src/lib.rs index e232c2e9cc..86739bc265 100644 --- a/common/primitives/src/lib.rs +++ b/common/primitives/src/lib.rs @@ -41,3 +41,6 @@ pub mod offchain; #[cfg(feature = "runtime-benchmarks")] /// Benchmarking helper trait pub mod benchmarks; + +/// Signatures +pub mod signatures; diff --git a/common/primitives/src/node.rs b/common/primitives/src/node.rs index f137246997..0813b00b16 100644 --- a/common/primitives/src/node.rs +++ b/common/primitives/src/node.rs @@ -6,6 +6,7 @@ pub use sp_runtime::{ }; use sp_std::{boxed::Box, vec::Vec}; +use crate::signatures::UnifiedSignature; use frame_support::dispatch::DispatchResultWithPostInfo; /// Some way of identifying an account on the chain. We intentionally make it equivalent @@ -31,7 +32,7 @@ pub type BlockNumber = u32; pub type Header = generic::Header; /// Alias to 512-bit hash when used in the context of a transaction signature on the chain. -pub type Signature = MultiSignature; +pub type Signature = UnifiedSignature; /// Index of a transaction in the chain. pub type Index = u32; diff --git a/common/primitives/src/signatures.rs b/common/primitives/src/signatures.rs new file mode 100644 index 0000000000..edd2251619 --- /dev/null +++ b/common/primitives/src/signatures.rs @@ -0,0 +1,249 @@ +#![cfg_attr(not(feature = "std"), no_std)] +#[cfg(feature = "serde")] +use frame_support::{Deserialize, Serialize}; +use frame_support::{ + __private::{codec, RuntimeDebug}, + pallet_prelude::{Decode, Encode, MaxEncodedLen, TypeInfo}, +}; +use sp_core::{ + crypto, + crypto::{AccountId32, FromEntropy}, + ecdsa, ed25519, + hexdisplay::HexDisplay, + sr25519, ByteArray, H256, +}; +use sp_runtime::{ + traits, + traits::{Lazy, Verify}, + MultiSignature, +}; + +/// Signature verify that can work with any known signature types. +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[derive(Eq, PartialEq, Clone, Encode, Decode, MaxEncodedLen, RuntimeDebug, TypeInfo)] +pub enum UnifiedSignature { + /// An Ed25519 signature. + Ed25519(ed25519::Signature), + /// An Sr25519 signature. + Sr25519(sr25519::Signature), + /// An ECDSA/SECP256k1 signature. + Ecdsa(ecdsa::Signature), +} + +impl From for UnifiedSignature { + fn from(x: ed25519::Signature) -> Self { + Self::Ed25519(x) + } +} + +impl TryFrom for ed25519::Signature { + type Error = (); + fn try_from(m: UnifiedSignature) -> Result { + if let UnifiedSignature::Ed25519(x) = m { + Ok(x) + } else { + Err(()) + } + } +} + +impl From for UnifiedSignature { + fn from(x: sr25519::Signature) -> Self { + Self::Sr25519(x) + } +} + +impl TryFrom for sr25519::Signature { + type Error = (); + fn try_from(m: UnifiedSignature) -> Result { + if let UnifiedSignature::Sr25519(x) = m { + Ok(x) + } else { + Err(()) + } + } +} + +impl From for UnifiedSignature { + fn from(x: ecdsa::Signature) -> Self { + Self::Ecdsa(x) + } +} + +impl TryFrom for ecdsa::Signature { + type Error = (); + fn try_from(m: UnifiedSignature) -> Result { + if let UnifiedSignature::Ecdsa(x) = m { + Ok(x) + } else { + Err(()) + } + } +} + +impl Verify for UnifiedSignature { + type Signer = UnifiedSigner; + fn verify>(&self, mut msg: L, signer: &AccountId32) -> bool { + match (self, signer) { + (Self::Ed25519(ref sig), who) => match ed25519::Public::from_slice(who.as_ref()) { + Ok(signer) => sig.verify(msg, &signer), + Err(()) => false, + }, + (Self::Sr25519(ref sig), who) => match sr25519::Public::from_slice(who.as_ref()) { + Ok(signer) => sig.verify(msg, &signer), + Err(()) => false, + }, + (Self::Ecdsa(ref sig), who) => { + log::info!(target:"ETHEREUM", "inside ecdsa signature verifier"); + let m = sp_io::hashing::blake2_256(msg.get()); + match sp_io::crypto::secp256k1_ecdsa_recover(sig.as_ref(), &m) { + Ok(pubkey) => { + let mut hashed = sp_io::hashing::keccak_256(pubkey.as_ref()); + hashed[..12].fill(0); + log::info!(target:"ETHEREUM", "eth hashed={:?} who={:?}", + HexDisplay::from(&hashed),HexDisplay::from(>::as_ref(who)), + ); + &hashed == >::as_ref(who) + }, + _ => false, + } + }, + } + } +} + +/// Public key for any known crypto algorithm. +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub enum UnifiedSigner { + /// An Ed25519 identity. + Ed25519(ed25519::Public), + /// An Sr25519 identity. + Sr25519(sr25519::Public), + /// An SECP256k1/ECDSA identity (12 bytes of zeros + 20 bytes of ethereum address). + Ecdsa(ecdsa::Public), +} + +impl FromEntropy for UnifiedSigner { + fn from_entropy(input: &mut impl codec::Input) -> Result { + Ok(match input.read_byte()? % 3 { + 0 => Self::Ed25519(FromEntropy::from_entropy(input)?), + 1 => Self::Sr25519(FromEntropy::from_entropy(input)?), + 2.. => Self::Ecdsa(FromEntropy::from_entropy(input)?), + }) + } +} + +/// NOTE: This implementations is required by `SimpleAddressDeterminer`, +/// we convert the hash into some AccountId, it's fine to use any scheme. +impl> crypto::UncheckedFrom for UnifiedSigner { + fn unchecked_from(x: T) -> Self { + ed25519::Public::unchecked_from(x.into()).into() + } +} + +impl AsRef<[u8]> for UnifiedSigner { + fn as_ref(&self) -> &[u8] { + match *self { + Self::Ed25519(ref who) => who.as_ref(), + Self::Sr25519(ref who) => who.as_ref(), + Self::Ecdsa(ref who) => who.as_ref(), + } + } +} + +impl traits::IdentifyAccount for UnifiedSigner { + type AccountId = AccountId32; + fn into_account(self) -> AccountId32 { + match self { + Self::Ed25519(who) => <[u8; 32]>::from(who).into(), + Self::Sr25519(who) => <[u8; 32]>::from(who).into(), + Self::Ecdsa(who) => { + log::info!(target:"ETHEREUM", "inside ecdsa into_account"); + let decompressed = libsecp256k1::PublicKey::parse_slice( + who.as_ref(), + Some(libsecp256k1::PublicKeyFormat::Compressed), + ) + .expect("Wrong compressed public key provided") + .serialize(); + let mut m = [0u8; 64]; + m.copy_from_slice(&decompressed[1..65]); + let mut hashed = sp_io::hashing::keccak_256(m.as_ref()); + hashed[..12].fill(0); + hashed.into() + }, + } + } +} + +impl From for UnifiedSigner { + fn from(x: ed25519::Public) -> Self { + Self::Ed25519(x) + } +} + +impl TryFrom for ed25519::Public { + type Error = (); + fn try_from(m: UnifiedSigner) -> Result { + if let UnifiedSigner::Ed25519(x) = m { + Ok(x) + } else { + Err(()) + } + } +} + +impl From for UnifiedSigner { + fn from(x: sr25519::Public) -> Self { + Self::Sr25519(x) + } +} + +impl TryFrom for sr25519::Public { + type Error = (); + fn try_from(m: UnifiedSigner) -> Result { + if let UnifiedSigner::Sr25519(x) = m { + Ok(x) + } else { + Err(()) + } + } +} + +impl From for UnifiedSigner { + fn from(x: ecdsa::Public) -> Self { + Self::Ecdsa(x) + } +} + +impl TryFrom for ecdsa::Public { + type Error = (); + fn try_from(m: UnifiedSigner) -> Result { + if let UnifiedSigner::Ecdsa(x) = m { + Ok(x) + } else { + Err(()) + } + } +} + +#[cfg(feature = "std")] +impl std::fmt::Display for UnifiedSigner { + fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { + match *self { + Self::Ed25519(ref who) => write!(fmt, "ed25519: {}", who), + Self::Sr25519(ref who) => write!(fmt, "sr25519: {}", who), + Self::Ecdsa(ref who) => write!(fmt, "ecdsa: {}", who), + } + } +} + +impl Into for MultiSignature { + fn into(self: MultiSignature) -> UnifiedSignature { + match self { + MultiSignature::Ed25519(who) => UnifiedSignature::Ed25519(who), + MultiSignature::Sr25519(who) => UnifiedSignature::Sr25519(who), + MultiSignature::Ecdsa(who) => UnifiedSignature::Ecdsa(who), + } + } +} diff --git a/e2e/.mocharc.json b/e2e/.mocharc.json index 1beef2d557..705e9226c5 100644 --- a/e2e/.mocharc.json +++ b/e2e/.mocharc.json @@ -4,6 +4,6 @@ "parallel": true, "require": ["scaffolding/globalHooks.ts", "scaffolding/rootHooks.ts", "scaffolding/extrinsicHelpers.ts"], "import": "tsx/esm", - "spec": ["./{,!(node_modules|load-tests)/**}/*.test.ts"], + "spec": ["./passkey/*.test.ts"], "timeout": 20000 } diff --git a/e2e/package-lock.json b/e2e/package-lock.json index ca03fd65f4..1d53f21a36 100644 --- a/e2e/package-lock.json +++ b/e2e/package-lock.json @@ -13,12 +13,12 @@ "@frequency-chain/api-augment": "file:../js/api-augment/dist/frequency-chain-api-augment-0.0.0.tgz", "@helia/unixfs": "^4.0.0", "@noble/curves": "^1.6.0", - "@polkadot-api/merkleize-metadata": "^1.1.9", - "@polkadot/api": "14.2.1", - "@polkadot/types": "14.2.1", - "@polkadot/util": "13.2.2", - "helia": "^5.1.0", - "multiformats": "^13.3.1", + "@polkadot-api/merkleize-metadata": "^1.1.7", + "@polkadot/api": "14.1.1", + "@polkadot/types": "14.1.1", + "@polkadot/util": "13.2.1", + "helia": "^5.0.1", + "multiformats": "^13.3.0", "rxjs": "^7.8.1", "workerpool": "^9.2.0" }, @@ -29,12 +29,13 @@ "eslint": "^9.13.0", "eslint-plugin-mocha": "^10.5.0", "globals": "^15.11.0", - "mocha": "^10.8.1", + "mocha": "^10.7.3", + "node-datachannel": "^0.12.0", "prettier": "^3.3.3", "sinon": "^19.0.2", - "tsx": "^4.19.2", + "tsx": "^4.19.1", "typescript": "^5.6.3", - "typescript-eslint": "^8.12.2" + "typescript-eslint": "^8.10.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -2196,11 +2197,12 @@ "node_modules/@frequency-chain/api-augment": { "version": "0.0.0", "resolved": "file:../js/api-augment/dist/frequency-chain-api-augment-0.0.0.tgz", - "integrity": "sha512-pvf6V+LO0zFtPbqDEXrOxeWEu1+NvKhFEcZdYIiIZcUM9MXtyt8KC1Zf8uzBrmuG2sxBeuMCTQ3ODkviCi+JKg==", + "integrity": "sha512-3edQkfsbTqCIYuAPcjnuELLqUQkPu+UzFanTB98zAhyRCBNeaqN4gkYxBR7B+WKwmWy/TyXPHYfBOeo9+Gl6SQ==", + "license": "Apache-2.0", "dependencies": { - "@polkadot/api": "^14.2.1", - "@polkadot/rpc-provider": "^14.2.1", - "@polkadot/types": "^14.2.1", + "@polkadot/api": "^14.1.1", + "@polkadot/rpc-provider": "^14.1.1", + "@polkadot/types": "^14.1.1", "globals": "^15.11.0" } }, @@ -2220,12 +2222,12 @@ } }, "node_modules/@helia/bitswap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@helia/bitswap/-/bitswap-2.0.1.tgz", - "integrity": "sha512-9bwjwdgW3LfraDfIlfJ4g1WrO96IKW3hjrc63jXxlKHU8JPwMdd5a//XoNIQfQ5vx6DV0w+w2AM1aHHt+nHBGA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@helia/bitswap/-/bitswap-2.0.0.tgz", + "integrity": "sha512-PsZtD7w6HOimuxkmQQMC90K4Ao4moX+4WmzYSoID+pnq6jM1XbLjnDIMc/WsT59Ey6excPiKDZ8xp5n4zI5jLA==", "dependencies": { "@helia/interface": "^5.0.0", - "@helia/utils": "^1.0.1", + "@helia/utils": "^1.0.0", "@libp2p/interface": "^2.0.0", "@libp2p/logger": "^5.0.0", "@libp2p/peer-collections": "^6.0.0", @@ -2256,13 +2258,13 @@ "integrity": "sha512-KSFCXtBlNoG0hzwNa0RmhHtrdhzexp+S+UY2s0rWTBJyfdEIgn6i6Zl9otVqrcFYbYrneBT7hbmHQ8gE0C3umA==" }, "node_modules/@helia/block-brokers": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@helia/block-brokers/-/block-brokers-4.0.1.tgz", - "integrity": "sha512-djYp4bmC15SBP1/ra9SrOAATr432hDcA2hnHWewkz1l84hCi+gSol7AcdAfW233pZ2ivZcI2Jc1Nyf7Vg6uFeg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@helia/block-brokers/-/block-brokers-4.0.0.tgz", + "integrity": "sha512-vABeVaVS2SE4Lk9QbV2K6FiMNgqDuVJh8GVDAYBeVcWWUjGnLKmIezqKqM47txbY9Vq90Jvt55cNkQIdjZw+jA==", "dependencies": { - "@helia/bitswap": "^2.0.1", + "@helia/bitswap": "^2.0.0", "@helia/interface": "^5.0.0", - "@helia/utils": "^1.0.1", + "@helia/utils": "^1.0.0", "@libp2p/interface": "^2.0.0", "@libp2p/utils": "^6.0.0", "@multiformats/multiaddr": "^12.2.1", @@ -2280,9 +2282,9 @@ "integrity": "sha512-KSFCXtBlNoG0hzwNa0RmhHtrdhzexp+S+UY2s0rWTBJyfdEIgn6i6Zl9otVqrcFYbYrneBT7hbmHQ8gE0C3umA==" }, "node_modules/@helia/delegated-routing-v1-http-api-client": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@helia/delegated-routing-v1-http-api-client/-/delegated-routing-v1-http-api-client-4.1.1.tgz", - "integrity": "sha512-Pf5pZkZGEBhARFXoLRzVVSZ8E8yU0Q0F3DOadhxPQjaSNyahetwiTsV8TvJltfrs2Afy2+gbA2+Rycl7apSXdQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@helia/delegated-routing-v1-http-api-client/-/delegated-routing-v1-http-api-client-4.1.0.tgz", + "integrity": "sha512-zeh1Hn3GZ8+QNcfdGL+iTLJC0avfFagp7rM0HydHp14c//Z+Zf5i+M6Yd5OLD764pPGD3ja/IVoP6idugiczNg==", "dependencies": { "@libp2p/interface": "^2.0.1", "@libp2p/logger": "^5.0.1", @@ -2320,11 +2322,11 @@ "integrity": "sha512-KSFCXtBlNoG0hzwNa0RmhHtrdhzexp+S+UY2s0rWTBJyfdEIgn6i6Zl9otVqrcFYbYrneBT7hbmHQ8gE0C3umA==" }, "node_modules/@helia/routers": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@helia/routers/-/routers-2.1.0.tgz", - "integrity": "sha512-JOvM+EfVd9c999gSz4tHLJWpwexU1kc82ujwoFRaRvKxT5pD77t9h0gwnfnsGbe9Br6iUPFXquNC+g0p8Xll3g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@helia/routers/-/routers-2.0.0.tgz", + "integrity": "sha512-p9FlVMlX4JoeTDdXWo7UvHZTrhhJfHj0v7PIQXkwAhnjcl1HesHw4oDUSLJhWwQPsHxhJ82ttuWPUVjgRVGbfQ==", "dependencies": { - "@helia/delegated-routing-v1-http-api-client": "^4.1.0", + "@helia/delegated-routing-v1-http-api-client": "^4.0.0", "@helia/interface": "^5.0.0", "@libp2p/interface": "^2.0.0", "@libp2p/peer-id": "^5.0.0", @@ -2363,18 +2365,20 @@ } }, "node_modules/@helia/utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@helia/utils/-/utils-1.0.1.tgz", - "integrity": "sha512-S1qLDiHNdBxQxtgonqPQHl8Rn7gs4HEQSrVF+ok//T/ZQPItNGnhKudV8qWhoOdpzCDaObx2ryqip+K9FK8VCQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@helia/utils/-/utils-1.0.0.tgz", + "integrity": "sha512-26dxUS5cjhIvyqnY/VkR8/pAGGX2AOpIy1Afrb2Y/t6eFfDanQSw/X++oH+6VNhqbIi/KYF7VChn+TcclAEp7w==", "dependencies": { "@helia/interface": "^5.0.0", "@ipld/dag-cbor": "^9.2.0", "@ipld/dag-json": "^10.2.0", "@ipld/dag-pb": "^4.1.0", + "@libp2p/crypto": "^5.0.0", "@libp2p/interface": "^2.0.0", "@libp2p/logger": "^5.0.0", "@libp2p/utils": "^6.0.0", "@multiformats/dns": "^1.0.1", + "@types/murmurhash3js-revisited": "^3.0.3", "any-signal": "^4.1.1", "blockstore-core": "^5.0.0", "cborg": "^4.0.9", @@ -2387,8 +2391,10 @@ "it-merge": "^3.0.3", "mortice": "^3.0.4", "multiformats": "^13.1.0", + "murmurhash3js-revisited": "^3.0.0", "p-defer": "^4.0.1", "progress-events": "^1.0.0", + "uint8arraylist": "^2.4.8", "uint8arrays": "^5.0.2" } }, @@ -2657,37 +2663,37 @@ } }, "node_modules/@libp2p/circuit-relay-v2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@libp2p/circuit-relay-v2/-/circuit-relay-v2-3.1.0.tgz", - "integrity": "sha512-g9AdFhT93P8Uc7sOKeAdULDKF+Tf/aGwnECWZMRo3GFIsvpbd06VdmnjqGmF9xSdll0NWPe8EwhI098rMRd7OQ==", - "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", - "@libp2p/peer-collections": "^6.0.10", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-record": "^8.0.10", - "@libp2p/utils": "^6.1.3", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@libp2p/circuit-relay-v2/-/circuit-relay-v2-2.1.5.tgz", + "integrity": "sha512-7uJicxChosVPcj7r9xmeI2Z318sgOk2VclagPWjTFCZSMdSHPtou8G4i0CJEoWAI+Afpxuz0h8aPb90MpVbWCA==", + "dependencies": { + "@libp2p/crypto": "^5.0.5", + "@libp2p/interface": "^2.1.3", + "@libp2p/interface-internal": "^2.0.8", + "@libp2p/peer-collections": "^6.0.8", + "@libp2p/peer-id": "^5.0.5", + "@libp2p/peer-record": "^8.0.8", + "@libp2p/utils": "^6.1.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.3.0", "any-signal": "^4.1.1", "it-protobuf-stream": "^1.1.3", "it-stream-types": "^2.0.1", "multiformats": "^13.1.0", - "nanoid": "^5.0.7", "progress-events": "^1.0.0", "protons-runtime": "^5.4.0", + "race-signal": "^1.0.2", "retimeable-signal": "^0.0.0", "uint8arraylist": "^2.4.8", "uint8arrays": "^5.1.0" } }, "node_modules/@libp2p/crypto": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.6.tgz", - "integrity": "sha512-5mD/riNxUuSOerk3aPXUUMN96lwZsrU33lp97ySfffloh2WhLZcjVJszibBgIP7DP5nqmSOWY9++rqrBuYHvnQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.5.tgz", + "integrity": "sha512-bs3PpSQS59I/YD2RnwcPv88pF/vB6GH2rw4jqb/0xm60LfRuSm0tNoCrJMuyG2pFz89WuKM+0BpnEWQi4alwCg==", "dependencies": { - "@libp2p/interface": "^2.2.0", + "@libp2p/interface": "^2.1.3", "@noble/curves": "^1.4.0", "@noble/hashes": "^1.4.0", "asn1js": "^3.0.5", @@ -2736,9 +2742,9 @@ } }, "node_modules/@libp2p/interface": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.2.0.tgz", - "integrity": "sha512-Pn3P5ixDggBjDyuULT0GvwdgD3JA426OqZ0e521mI7ysS+/M9Z9fp4Qcy8JrkJ45bLmIi9cgrNrefuU/Zu+bAQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.1.3.tgz", + "integrity": "sha512-t1i2LWcnTGJEr7fDMslA8wYwBzJP81QKBlrBHoGhXxqqpRQa9035roCh/Akuw5RUgjKE47/ezjuzo90aWsJB8g==", "dependencies": { "@multiformats/multiaddr": "^12.2.3", "it-pushable": "^3.2.3", @@ -2749,12 +2755,12 @@ } }, "node_modules/@libp2p/interface-internal": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.0.10.tgz", - "integrity": "sha512-LRnn6w5rtvMQlEukihDI5NhSZXZj7ITFT1Hbo3Dn3HGo1oxZe7oWh7ERc5LwZw835QHGzFKZYerBFKdqxoWsFQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.0.8.tgz", + "integrity": "sha512-yWAVuygiy2XhZK2UsOfy3iA30Bi78VeJDac6cAD/FQzu3rmGy2LNYtHuz1Vze9/OL4I6cseMNTGkozTeDg8nMg==", "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-collections": "^6.0.10", + "@libp2p/interface": "^2.1.3", + "@libp2p/peer-collections": "^6.0.8", "@multiformats/multiaddr": "^12.2.3", "progress-events": "^1.0.0", "uint8arraylist": "^2.4.8" @@ -2814,11 +2820,11 @@ } }, "node_modules/@libp2p/logger": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.3.tgz", - "integrity": "sha512-NUVWEWGbXlBDgDE5ntdm51+ZICmaKYI8mor6KrlPeB1WXDyIFxRWIBw6uzt+HgprQJWzLTojeUEGv6OPsj95Dg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.1.tgz", + "integrity": "sha512-+pwFFZekKQHKdSrGURKZjfAJ86soc1e4HsI0r7dJN+kHICzKFzC+x5hM5GsWCorNj3y++xshWlF/n03zyxoyJQ==", "dependencies": { - "@libp2p/interface": "^2.2.0", + "@libp2p/interface": "^2.1.3", "@multiformats/multiaddr": "^12.2.3", "interface-datastore": "^8.3.0", "multiformats": "^13.1.0", @@ -2872,36 +2878,36 @@ } }, "node_modules/@libp2p/peer-collections": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.10.tgz", - "integrity": "sha512-KQQiBZ2Y3+wvxjfIWbUCL0suCRVn5ylLuQ2r+OGXLA7LtgRw1RLQnUHHFVoY+CE9pvfIfamwTFlkZhWtvi271w==", + "version": "6.0.8", + "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.8.tgz", + "integrity": "sha512-/xaSvb45lydLibt7sb+Im1ohIGiMfOlz5wcxelEgxmvUd0QmvirZXM3eAavQ+xrxmvJSPEQDmWSP+851ohRlKQ==", "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "@libp2p/interface": "^2.1.3", + "@libp2p/peer-id": "^5.0.5", + "@libp2p/utils": "^6.1.1", "multiformats": "^13.2.2" } }, "node_modules/@libp2p/peer-id": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.7.tgz", - "integrity": "sha512-ecF0Mu4Nxy8IHUMBYVNIEihjUlx52DM+X3CIfBItvGqvnhrUSkJJjkska2dJX3yf2J8wufzCT3jCg4NZWmndYg==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.5.tgz", + "integrity": "sha512-+9aX4II0hjMgKcFX/TMWUHRu2wOXOkfV5jO2N5m/R91K+Kp4Tt4n1ceXHjrbwwz3k2IWl0xJOMYjrf9dhOZWAw==", "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", + "@libp2p/crypto": "^5.0.5", + "@libp2p/interface": "^2.1.3", "multiformats": "^13.1.0", "uint8arrays": "^5.1.0" } }, "node_modules/@libp2p/peer-record": { - "version": "8.0.10", - "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-8.0.10.tgz", - "integrity": "sha512-k5A5YFhx7xGgFjiFWp0j8Cbw5kUYLJoBY9I3YTIHrieusLUUkMtUkYeuWeagNL1JYcXr06gguoIaYBRNCMQAow==", - "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "version": "8.0.8", + "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-8.0.8.tgz", + "integrity": "sha512-wYqVN13ZaC/cVdFaTR3+Plzv4lf/BNVSzZK11cSSo3MqinOWqFs38plw9OC1Mfne2x9HYHLGwhj2zE802itD0A==", + "dependencies": { + "@libp2p/crypto": "^5.0.5", + "@libp2p/interface": "^2.1.3", + "@libp2p/peer-id": "^5.0.5", + "@libp2p/utils": "^6.1.1", "@multiformats/multiaddr": "^12.2.3", "multiformats": "^13.2.2", "protons-runtime": "^5.4.0", @@ -3003,14 +3009,14 @@ } }, "node_modules/@libp2p/utils": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.1.3.tgz", - "integrity": "sha512-n1D6phOXGkqE3tuvmZwm5gaHKcGanlKwCWEBlrZqx9SSCyd5U5C58BcyQ8YH5/nb4kYMI7HyjomfQAVs2S2R9Q==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.1.1.tgz", + "integrity": "sha512-lpqNyyTx7ygIfXyU4eqDONW7c4oc8Gf1xjDahlOWcggqNhLWsC3/8zTmziKlY3PjTvzY0W37nDRPO1KiM1Sduw==", "dependencies": { "@chainsafe/is-ip": "^2.0.2", - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/logger": "^5.1.3", + "@libp2p/crypto": "^5.0.5", + "@libp2p/interface": "^2.1.3", + "@libp2p/logger": "^5.1.1", "@multiformats/multiaddr": "^12.2.3", "@sindresorhus/fnv1a": "^3.1.0", "@types/murmurhash3js-revisited": "^3.0.3", @@ -3424,33 +3430,33 @@ "optional": true }, "node_modules/@polkadot-api/merkleize-metadata": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@polkadot-api/merkleize-metadata/-/merkleize-metadata-1.1.9.tgz", - "integrity": "sha512-TwFhbnHcnad/O5S8NnT9OcCX0CRAyJL9PilwV/sd8cEdS9LWNwlBxjTqUWWKhRrtlsSeuvi2ldYC+dgUYUaIOA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@polkadot-api/merkleize-metadata/-/merkleize-metadata-1.1.7.tgz", + "integrity": "sha512-t8El8ZfkH5gSxC60U+ZHWBDzBlWsIsRZwSaVATjW1G22aXuA9N5tRBU6/g+uA/zDc34NNSFwFzXMH065/fceSw==", "dependencies": { - "@polkadot-api/metadata-builders": "0.9.1", - "@polkadot-api/substrate-bindings": "0.9.3", + "@polkadot-api/metadata-builders": "0.8.2", + "@polkadot-api/substrate-bindings": "0.9.2", "@polkadot-api/utils": "0.1.2" } }, "node_modules/@polkadot-api/merkleize-metadata/node_modules/@polkadot-api/metadata-builders": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.9.1.tgz", - "integrity": "sha512-yZPm9KKn7QydbjMQMzhKHekDuQSdSZXYdCyqGt74HSNz9DdJSdpFNwHv0p+vmp+9QDlVsKK7nbUTjYxLZT4vCA==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.8.2.tgz", + "integrity": "sha512-+lasR2B0YXPlUJ7QNfO78MYCiXg/ANWWae7Qp53b9kEif5pe0pjxY/9KzdSu8FBA72s/FelQLn7lN/lhMC9zVg==", "dependencies": { - "@polkadot-api/substrate-bindings": "0.9.3", + "@polkadot-api/substrate-bindings": "0.9.2", "@polkadot-api/utils": "0.1.2" } }, "node_modules/@polkadot-api/merkleize-metadata/node_modules/@polkadot-api/substrate-bindings": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.9.3.tgz", - "integrity": "sha512-ygaZo8+xssTdb6lj9mA8RTlanDfyd0iMex3aBFC1IzOSm08XUWdRpuSLRuerFCimLzKuz/oBOTKdqBFGb7ybUQ==", + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.9.2.tgz", + "integrity": "sha512-OzWVPoky/Da50V9jFOywRRs3+RZgl2WxiHG/NDi0ug/upEkH0W1bwepG0hMMhneYhoKm+JgUDhLrM67ZbFTStA==", "dependencies": { "@noble/hashes": "^1.4.0", "@polkadot-api/utils": "0.1.2", "@scure/base": "^1.1.7", - "scale-ts": "^1.6.1" + "scale-ts": "^1.6.0" } }, "node_modules/@polkadot-api/merkleize-metadata/node_modules/@polkadot-api/utils": { @@ -3512,24 +3518,24 @@ "optional": true }, "node_modules/@polkadot/api": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-14.2.1.tgz", - "integrity": "sha512-vYYOvCbGzKWq2auv7e3r71lp0N9hLi4Wfvdb+PjDlUWy4CBydDPgNRL7eC/pJyY4/8zs5dAWVmmu5SQsdpM93g==", - "dependencies": { - "@polkadot/api-augment": "14.2.1", - "@polkadot/api-base": "14.2.1", - "@polkadot/api-derive": "14.2.1", - "@polkadot/keyring": "^13.2.2", - "@polkadot/rpc-augment": "14.2.1", - "@polkadot/rpc-core": "14.2.1", - "@polkadot/rpc-provider": "14.2.1", - "@polkadot/types": "14.2.1", - "@polkadot/types-augment": "14.2.1", - "@polkadot/types-codec": "14.2.1", - "@polkadot/types-create": "14.2.1", - "@polkadot/types-known": "14.2.1", - "@polkadot/util": "^13.2.2", - "@polkadot/util-crypto": "^13.2.2", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-14.1.1.tgz", + "integrity": "sha512-3uSJUdaohKtAvj9fjqyOkYs0PthWBdWtkko2TcYGRxj9BikbZMmx+agdkty8VrOxvn3pPoTRKe/jMt2Txn2MaA==", + "dependencies": { + "@polkadot/api-augment": "14.1.1", + "@polkadot/api-base": "14.1.1", + "@polkadot/api-derive": "14.1.1", + "@polkadot/keyring": "^13.2.1", + "@polkadot/rpc-augment": "14.1.1", + "@polkadot/rpc-core": "14.1.1", + "@polkadot/rpc-provider": "14.1.1", + "@polkadot/types": "14.1.1", + "@polkadot/types-augment": "14.1.1", + "@polkadot/types-codec": "14.1.1", + "@polkadot/types-create": "14.1.1", + "@polkadot/types-known": "14.1.1", + "@polkadot/util": "^13.2.1", + "@polkadot/util-crypto": "^13.2.1", "eventemitter3": "^5.0.1", "rxjs": "^7.8.1", "tslib": "^2.8.0" @@ -3539,16 +3545,16 @@ } }, "node_modules/@polkadot/api-augment": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-14.2.1.tgz", - "integrity": "sha512-Vi1iuGliJe3rrH2wyfZq/FIYncUqX6ue15Zx0gpj20kRW9hNEU3ywr3NRrr3UXGZRozJZ/C4s0FNneNYvu/KCQ==", - "dependencies": { - "@polkadot/api-base": "14.2.1", - "@polkadot/rpc-augment": "14.2.1", - "@polkadot/types": "14.2.1", - "@polkadot/types-augment": "14.2.1", - "@polkadot/types-codec": "14.2.1", - "@polkadot/util": "^13.2.2", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-14.1.1.tgz", + "integrity": "sha512-n6aexVgdlHfh3d12qFYpooxzS9yjKq/oxLNXKvhpV3CMg36Hlq4ULDdtI6L3sB8I3nwdBEWaXyBvbpKvPZGUxQ==", + "dependencies": { + "@polkadot/api-base": "14.1.1", + "@polkadot/rpc-augment": "14.1.1", + "@polkadot/types": "14.1.1", + "@polkadot/types-augment": "14.1.1", + "@polkadot/types-codec": "14.1.1", + "@polkadot/util": "^13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3556,13 +3562,13 @@ } }, "node_modules/@polkadot/api-base": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-14.2.1.tgz", - "integrity": "sha512-HofQlndP8OeO91iU+Ueg7DWo7fmzD5TJs/WHBS2XwSZfZ6rzYnfBxpFM8A51oY+HxXHc5EgvjdhqY2aO2OjZ2w==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-14.1.1.tgz", + "integrity": "sha512-gMj0uIlAv6RkRMzmhl61KU1/Pcadrarxn0lBdDTcVua3KEWLuncI+VbiN3cEd/aW6QUTgcDFpppm8nfwD9eVzQ==", "dependencies": { - "@polkadot/rpc-core": "14.2.1", - "@polkadot/types": "14.2.1", - "@polkadot/util": "^13.2.2", + "@polkadot/rpc-core": "14.1.1", + "@polkadot/types": "14.1.1", + "@polkadot/util": "^13.2.1", "rxjs": "^7.8.1", "tslib": "^2.8.0" }, @@ -3571,18 +3577,18 @@ } }, "node_modules/@polkadot/api-derive": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-14.2.1.tgz", - "integrity": "sha512-2JqFcu+qRHpeveu3f/LTxhWw0MNt4M+aNeyttyo5kRRSAL/pmU75E43b4tXq7UZmlmKZZtga8b0dFHoiMTuuwA==", - "dependencies": { - "@polkadot/api": "14.2.1", - "@polkadot/api-augment": "14.2.1", - "@polkadot/api-base": "14.2.1", - "@polkadot/rpc-core": "14.2.1", - "@polkadot/types": "14.2.1", - "@polkadot/types-codec": "14.2.1", - "@polkadot/util": "^13.2.2", - "@polkadot/util-crypto": "^13.2.2", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-14.1.1.tgz", + "integrity": "sha512-ZElYAr/euw2fR7RmGkgJgF88IK9iz3rqgesmdLtgQ2a85MEiR4UrVvhNKSjMr9PSn7EUM1mUixZhGp3jvuqrsA==", + "dependencies": { + "@polkadot/api": "14.1.1", + "@polkadot/api-augment": "14.1.1", + "@polkadot/api-base": "14.1.1", + "@polkadot/rpc-core": "14.1.1", + "@polkadot/types": "14.1.1", + "@polkadot/types-codec": "14.1.1", + "@polkadot/util": "^13.2.1", + "@polkadot/util-crypto": "^13.2.1", "rxjs": "^7.8.1", "tslib": "^2.8.0" }, @@ -3591,28 +3597,28 @@ } }, "node_modules/@polkadot/keyring": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-13.2.2.tgz", - "integrity": "sha512-h4bPU92CALAAC+QOp6+zttuhI5H0GKOUzj1qwnmoPVoWxh21FoekLAXO1YJlsKxciTDdK5OhjdNPOIqcF0GCXA==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-13.2.1.tgz", + "integrity": "sha512-tnNLHaOuwoVC3n2tUQe0iSI4Jyxzqm7CPnf/sWMAAFImaVnC7PhiZFvqs2QGpha4ks9Lv722Vkjh7iIKUpEsUA==", "dependencies": { - "@polkadot/util": "13.2.2", - "@polkadot/util-crypto": "13.2.2", + "@polkadot/util": "13.2.1", + "@polkadot/util-crypto": "13.2.1", "tslib": "^2.8.0" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "13.2.2", - "@polkadot/util-crypto": "13.2.2" + "@polkadot/util": "13.2.1", + "@polkadot/util-crypto": "13.2.1" } }, "node_modules/@polkadot/networks": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-13.2.2.tgz", - "integrity": "sha512-di3dLB9BcLQ9ARcDe/nizl7jZZnQbQlxB8kXtAXqTIVFtshtKT+zYcji6dTX7xX9/O9tZB7qnrvuIuI0MkwJ5A==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-13.2.1.tgz", + "integrity": "sha512-T04RTY+w8X+JB0MNAIrSFr3WX/eIUrCyYTsuf6jpg89efubpWYvfchiLTDcQrA2KfdqTBl3bQ1wgKqmWMMKNzg==", "dependencies": { - "@polkadot/util": "13.2.2", + "@polkadot/util": "13.2.1", "@substrate/ss58-registry": "^1.51.0", "tslib": "^2.8.0" }, @@ -3621,14 +3627,14 @@ } }, "node_modules/@polkadot/rpc-augment": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-14.2.1.tgz", - "integrity": "sha512-ouRRq7suXiPBECImMf+pM7U/k4541uJxuYreFhnplE+egaikKieY720hKiRxesLALr6fjgBr3DRsUsk8yP3YtA==", - "dependencies": { - "@polkadot/rpc-core": "14.2.1", - "@polkadot/types": "14.2.1", - "@polkadot/types-codec": "14.2.1", - "@polkadot/util": "^13.2.2", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-14.1.1.tgz", + "integrity": "sha512-jeDYDepe6IOzgUFD+vLEuLrWGqw/dJIcxb8uf/YpnsvzA8kbPZx3BcIhboIpI8HpdKdn6f5mflSTVgDUpUPmNg==", + "dependencies": { + "@polkadot/rpc-core": "14.1.1", + "@polkadot/types": "14.1.1", + "@polkadot/types-codec": "14.1.1", + "@polkadot/util": "^13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3636,14 +3642,14 @@ } }, "node_modules/@polkadot/rpc-core": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-14.2.1.tgz", - "integrity": "sha512-jGOoRKdY6XbMY4Z7N9lKI3YmLfZWjT+DcXo+kRfSr3YgORDUXNwHy9v5doJCkPoY3OIIDmhlK5OaIEXeEjvrcQ==", - "dependencies": { - "@polkadot/rpc-augment": "14.2.1", - "@polkadot/rpc-provider": "14.2.1", - "@polkadot/types": "14.2.1", - "@polkadot/util": "^13.2.2", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-14.1.1.tgz", + "integrity": "sha512-rfV1ArJcAZQ3lzAM9P+yIaXN720yJysNGy14FxupLsFsvzowEnEPs4khS2HgnX6j1RqkElw6va/ZVhOsLPhy9w==", + "dependencies": { + "@polkadot/rpc-augment": "14.1.1", + "@polkadot/rpc-provider": "14.1.1", + "@polkadot/types": "14.1.1", + "@polkadot/util": "^13.2.1", "rxjs": "^7.8.1", "tslib": "^2.8.0" }, @@ -3652,18 +3658,18 @@ } }, "node_modules/@polkadot/rpc-provider": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-14.2.1.tgz", - "integrity": "sha512-5ty21djvymqgxIpqKya9ekLHbiIRISIq9pl/GyVUSj2y3ditmXHF1UElmKfMCvi0b6nmOJlkxJIb7ZDyfjkBag==", - "dependencies": { - "@polkadot/keyring": "^13.2.2", - "@polkadot/types": "14.2.1", - "@polkadot/types-support": "14.2.1", - "@polkadot/util": "^13.2.2", - "@polkadot/util-crypto": "^13.2.2", - "@polkadot/x-fetch": "^13.2.2", - "@polkadot/x-global": "^13.2.2", - "@polkadot/x-ws": "^13.2.2", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-14.1.1.tgz", + "integrity": "sha512-BY0H1CC7M360uHXU2IfFdgFmcdjmIz6NxPmXRhrT3QGFmJSHuFevjTbIFlPG7YBK5ivochLrcISelRr7HKXYOg==", + "dependencies": { + "@polkadot/keyring": "^13.2.1", + "@polkadot/types": "14.1.1", + "@polkadot/types-support": "14.1.1", + "@polkadot/util": "^13.2.1", + "@polkadot/util-crypto": "^13.2.1", + "@polkadot/x-fetch": "^13.2.1", + "@polkadot/x-global": "^13.2.1", + "@polkadot/x-ws": "^13.2.1", "eventemitter3": "^5.0.1", "mock-socket": "^9.3.1", "nock": "^13.5.5", @@ -3677,16 +3683,16 @@ } }, "node_modules/@polkadot/types": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-14.2.1.tgz", - "integrity": "sha512-C4mf3257vefKDCF5dPtw3WPztE/cTgHjI/fmimwxjGakX3u1mni19wqvBXKg69tuzJ31YMagqMkD2YFZ/zGSPg==", - "dependencies": { - "@polkadot/keyring": "^13.2.2", - "@polkadot/types-augment": "14.2.1", - "@polkadot/types-codec": "14.2.1", - "@polkadot/types-create": "14.2.1", - "@polkadot/util": "^13.2.2", - "@polkadot/util-crypto": "^13.2.2", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-14.1.1.tgz", + "integrity": "sha512-bT1wxu2wZsKR8Ih1PHu4SqptOF+MQbh21e+NJVZkIsrjQz1DvKkdcW4G/s0i0vX/QIjnXTJFC84vMzr5cxJm8Q==", + "dependencies": { + "@polkadot/keyring": "^13.2.1", + "@polkadot/types-augment": "14.1.1", + "@polkadot/types-codec": "14.1.1", + "@polkadot/types-create": "14.1.1", + "@polkadot/util": "^13.2.1", + "@polkadot/util-crypto": "^13.2.1", "rxjs": "^7.8.1", "tslib": "^2.8.0" }, @@ -3695,13 +3701,13 @@ } }, "node_modules/@polkadot/types-augment": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-14.2.1.tgz", - "integrity": "sha512-dAsiRRPr7ClX/zz7YqpIr4dB5fOR8UzXnxz8d4Tyrcxpf9CAivIIJ8Mxl5M/71CTF/LSlCbSvsmvBG0mAX7HLg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-14.1.1.tgz", + "integrity": "sha512-A73JCwmg5ZuYVHw1k7Lxx4MjjRwQd6Yw/VaRIPqjk3iyG5r9RyFJgsJ7xRafDlKFG0AJ5c6ixvlaHOnBrEAzpQ==", "dependencies": { - "@polkadot/types": "14.2.1", - "@polkadot/types-codec": "14.2.1", - "@polkadot/util": "^13.2.2", + "@polkadot/types": "14.1.1", + "@polkadot/types-codec": "14.1.1", + "@polkadot/util": "^13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3709,12 +3715,12 @@ } }, "node_modules/@polkadot/types-codec": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-14.2.1.tgz", - "integrity": "sha512-NKI9hiW2tE3AcEKL1eGd6fyNa2QbOvlH+mEq1vTyT3/fm65mrtIqOuZASWa3kXMQmOHCs2/mMGh7p1Kj8glalQ==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-14.1.1.tgz", + "integrity": "sha512-O6UyTjEAeZMf/uthF3NjCy4tiAeWjj4tfTEWTx2Z65fNTTbXx1Mq5YBBOWsvzBXGBFK35C8buYa4l8cgQS9MoA==", "dependencies": { - "@polkadot/util": "^13.2.2", - "@polkadot/x-bigint": "^13.2.2", + "@polkadot/util": "^13.2.1", + "@polkadot/x-bigint": "^13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3722,12 +3728,12 @@ } }, "node_modules/@polkadot/types-create": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-14.2.1.tgz", - "integrity": "sha512-AhcyVR6eoc+br76QbqQ3LVwFuOrdZH/A9hlpMPI8MvIW46wZ5bPcDoqKLZugeH6wOKKVzbqw8z9tZ1KWgUSdVg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-14.1.1.tgz", + "integrity": "sha512-t4gr5NKU8zZetnDvoRnlioEZlkYybBSql+Ep3mQUiJosF5w/SCN6EKV0GPqs0fB1ovqhDQSnwe2xoRjHsiHObA==", "dependencies": { - "@polkadot/types-codec": "14.2.1", - "@polkadot/util": "^13.2.2", + "@polkadot/types-codec": "14.1.1", + "@polkadot/util": "^13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3735,15 +3741,15 @@ } }, "node_modules/@polkadot/types-known": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-14.2.1.tgz", - "integrity": "sha512-Lp8km3+0NKBR3x9covI84Mz3dXFAmIkohzJhcGjpjwcOKH0W4GSQBTDcsYfTH+UAY1mF7hvgXCtvGwbyLm2kOQ==", - "dependencies": { - "@polkadot/networks": "^13.2.2", - "@polkadot/types": "14.2.1", - "@polkadot/types-codec": "14.2.1", - "@polkadot/types-create": "14.2.1", - "@polkadot/util": "^13.2.2", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-14.1.1.tgz", + "integrity": "sha512-TvyqTsm1Wxw+tjN8UsB04+vZv5znZE5ETGunHLHnvv4WF/lkz4WpkRc/9iqduM5O/iOZh8mEb7n/uyz8LL4brA==", + "dependencies": { + "@polkadot/networks": "^13.2.1", + "@polkadot/types": "14.1.1", + "@polkadot/types-codec": "14.1.1", + "@polkadot/types-create": "14.1.1", + "@polkadot/util": "^13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3751,11 +3757,11 @@ } }, "node_modules/@polkadot/types-support": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-14.2.1.tgz", - "integrity": "sha512-pAaAGDEBUnDiC15AjVc1aULk+vfCma2OlVzU6usOLee1OKkwDuk74Bnyo9jshKVYuTjujLrmp3zmzmuU1NjbeQ==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-14.1.1.tgz", + "integrity": "sha512-DJgJ/2n3eWFlgH1K/U7G4NSbgdsx4Lb1fK4yVlZ9t81lJWWiAeb/FodHJb8jlQ6Jezx5S71fRripXfg+FdyCDA==", "dependencies": { - "@polkadot/util": "^13.2.2", + "@polkadot/util": "^13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3763,14 +3769,14 @@ } }, "node_modules/@polkadot/util": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-13.2.2.tgz", - "integrity": "sha512-zhsGtR0J2a0ODesJNbCYqEXOL2rhPrmv1F6OB2JMdho7iOrkONck3PZaoT/Y0JF7IlHjGV8K6yrw7k9KUtFrEA==", - "dependencies": { - "@polkadot/x-bigint": "13.2.2", - "@polkadot/x-global": "13.2.2", - "@polkadot/x-textdecoder": "13.2.2", - "@polkadot/x-textencoder": "13.2.2", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-13.2.1.tgz", + "integrity": "sha512-+zCyQQeW4llWD5yhvPAawekRpdAU3LZPLD0j3v8nJjsG9cAyiYGZjsVxDFPpD0yixS1Hl70937bPR46761NG9g==", + "dependencies": { + "@polkadot/x-bigint": "13.2.1", + "@polkadot/x-global": "13.2.1", + "@polkadot/x-textdecoder": "13.2.1", + "@polkadot/x-textencoder": "13.2.1", "@types/bn.js": "^5.1.6", "bn.js": "^5.2.1", "tslib": "^2.8.0" @@ -3780,18 +3786,18 @@ } }, "node_modules/@polkadot/util-crypto": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-13.2.2.tgz", - "integrity": "sha512-C4vl07XC43vE6egd9LmSe0uOc7hAvBq6CIoILk5ZB95ABNBQSHOrS1pHugW4rJgVUiZgv8sdl+twmgisuSsSfg==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-13.2.1.tgz", + "integrity": "sha512-IalVWtRfsLEkF0fQvEfbnYwrQWUw2AHSYgJINhrZvdoC+Vy6oetvO0ZAhbfUp1c/HOaql0gex4WVrfw7gcBKjQ==", "dependencies": { "@noble/curves": "^1.3.0", "@noble/hashes": "^1.3.3", - "@polkadot/networks": "13.2.2", - "@polkadot/util": "13.2.2", + "@polkadot/networks": "13.2.1", + "@polkadot/util": "13.2.1", "@polkadot/wasm-crypto": "^7.4.1", "@polkadot/wasm-util": "^7.4.1", - "@polkadot/x-bigint": "13.2.2", - "@polkadot/x-randomvalues": "13.2.2", + "@polkadot/x-bigint": "13.2.1", + "@polkadot/x-randomvalues": "13.2.1", "@scure/base": "^1.1.7", "tslib": "^2.8.0" }, @@ -3799,7 +3805,7 @@ "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "13.2.2" + "@polkadot/util": "13.2.1" } }, "node_modules/@polkadot/wasm-bridge": { @@ -3901,11 +3907,11 @@ } }, "node_modules/@polkadot/x-bigint": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-13.2.2.tgz", - "integrity": "sha512-9ENDfG2wYqABWhQYYrbjJK0aPBvCqVPiFhBiKgIg6OTSJKJToa4Di9R8NxelF8eJTtz7DIvgf6gZY/jnKfbtWw==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-13.2.1.tgz", + "integrity": "sha512-NYfH0fKfZFkjE5wOiLmfj+oJFyzSHLJrJt5DmzWwvbhw3dT4Qz2UgBL0i/Ei6REkpOGCXX2DmNbbZBr6sn4f1Q==", "dependencies": { - "@polkadot/x-global": "13.2.2", + "@polkadot/x-global": "13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3913,11 +3919,11 @@ } }, "node_modules/@polkadot/x-fetch": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-13.2.2.tgz", - "integrity": "sha512-aDhd2kdx3JWvZSU4Ge966C0111CH8pCsDX7+9IsMGaZhjLF1NEo2xDjs+EwfUbSvNk68A4UVeJsXjG+IVor/ug==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-13.2.1.tgz", + "integrity": "sha512-y/JgDRyH4JZN0QzI4V3Hf7Bah2FOOTw7sbmlo/o/3Tt0zjLnCbSvu7Lf1+fKBDksQWpElUBg3nVJrw4HAIiaRQ==", "dependencies": { - "@polkadot/x-global": "13.2.2", + "@polkadot/x-global": "13.2.1", "node-fetch": "^3.3.2", "tslib": "^2.8.0" }, @@ -3926,9 +3932,9 @@ } }, "node_modules/@polkadot/x-global": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-13.2.2.tgz", - "integrity": "sha512-a+iKD7JXxDRtYVo0bp1+HHlaem6MkUHU2yE0cx2e97p9x+IKyNEY58D0L5P66kszLvhFw+t3Jq+qHIj0+2YxkQ==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-13.2.1.tgz", + "integrity": "sha512-Q9PZY+Xw9ffBYcJjwMCQfGgFi5QNv4GJ1ZqIuJMQBAcM21fn8vuFMfGC24R1pAAJAaBMPkQ9xh8R2cpu9SIjRg==", "dependencies": { "tslib": "^2.8.0" }, @@ -3937,27 +3943,27 @@ } }, "node_modules/@polkadot/x-randomvalues": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-13.2.2.tgz", - "integrity": "sha512-1UNImkS5PAaGHeIl2DlMjgt2iN7nlclzwrYhmxd0e9Z11RQqavGqi1a02HGREgnUu+wJ7eHmPMVe6K96+cL+aQ==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-13.2.1.tgz", + "integrity": "sha512-LZBlsmz6r+AKHpqTGAjWecn5aNYGnfgLxxu0JZJo1aOQdVrXy7sDl1M5x1U+ZFeShVeSAU54rrWCcHB+zsGHSA==", "dependencies": { - "@polkadot/x-global": "13.2.2", + "@polkadot/x-global": "13.2.1", "tslib": "^2.8.0" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "13.2.2", + "@polkadot/util": "13.2.1", "@polkadot/wasm-util": "*" } }, "node_modules/@polkadot/x-textdecoder": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-13.2.2.tgz", - "integrity": "sha512-elpIrgdq22yyvt4fzxwb2IRJEpswPVwizzauRipVy3uUmI/lC2f7D7u9jrC554Xy8UrrAPExX1sWJCxZA8DZ/g==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-13.2.1.tgz", + "integrity": "sha512-cyKv5T48goBEMsb1lnKrXPpAPXkpWwAa+Ob0w2eEzsjBPzWEeIPMKFuE4VpPRoZ/Sn6v3hwz98WS8ueCO5MXyQ==", "dependencies": { - "@polkadot/x-global": "13.2.2", + "@polkadot/x-global": "13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3965,11 +3971,11 @@ } }, "node_modules/@polkadot/x-textencoder": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-13.2.2.tgz", - "integrity": "sha512-nxlNvK5h0KPCaAE/cx92e8JCPAlmFGbuXC9l03C1Ei1wAnOcWuJWRIk2qOkCEYkpT+G0jITPN4dgk634+pBQSw==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-13.2.1.tgz", + "integrity": "sha512-tugNLn/9UbA1n64mMWliWI1j5kAnnNIHgJ8khbMKyrHS5K+m8BP/avUrlg3u5ukM1RB1cCoJB9uWcT4Sovf65Q==", "dependencies": { - "@polkadot/x-global": "13.2.2", + "@polkadot/x-global": "13.2.1", "tslib": "^2.8.0" }, "engines": { @@ -3977,11 +3983,11 @@ } }, "node_modules/@polkadot/x-ws": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-13.2.2.tgz", - "integrity": "sha512-WEygcHPB55cKLiNoejJ0Lq3Z1fb4hUO3FmYTXdpHgk0xIOfYDrr7rTlI2cZ4Nb32MofeehN/ZStmEW5Edib6TQ==", + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-13.2.1.tgz", + "integrity": "sha512-bLw4AL1UlzhveOPj5p3PPbDlrq+B7QbuNQ7F4UBVtEkaZZKJzhviE0mYGrObaguv1ib2tIIrYc7FNqmH6KpRzQ==", "dependencies": { - "@polkadot/x-global": "13.2.2", + "@polkadot/x-global": "13.2.1", "tslib": "^2.8.0", "ws": "^8.18.0" }, @@ -5393,16 +5399,16 @@ "peer": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.12.2.tgz", - "integrity": "sha512-gQxbxM8mcxBwaEmWdtLCIGLfixBMHhQjBqR8sVWNTPpcj45WlYL2IObS/DNMLH1DBP0n8qz+aiiLTGfopPEebw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.10.0.tgz", + "integrity": "sha512-phuB3hoP7FFKbRXxjl+DRlQDuJqhpOnm5MmtROXyWi3uS/Xg2ZXqiQfcG2BJHiN4QKyzdOJi3NEn/qTnjUlkmQ==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.12.2", - "@typescript-eslint/type-utils": "8.12.2", - "@typescript-eslint/utils": "8.12.2", - "@typescript-eslint/visitor-keys": "8.12.2", + "@typescript-eslint/scope-manager": "8.10.0", + "@typescript-eslint/type-utils": "8.10.0", + "@typescript-eslint/utils": "8.10.0", + "@typescript-eslint/visitor-keys": "8.10.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -5426,15 +5432,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.12.2.tgz", - "integrity": "sha512-MrvlXNfGPLH3Z+r7Tk+Z5moZAc0dzdVjTgUgwsdGweH7lydysQsnSww3nAmsq8blFuRD5VRlAr9YdEFw3e6PBw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.10.0.tgz", + "integrity": "sha512-E24l90SxuJhytWJ0pTQydFT46Nk0Z+bsLKo/L8rtQSL93rQ6byd1V/QbDpHUTdLPOMsBCcYXZweADNCfOCmOAg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.12.2", - "@typescript-eslint/types": "8.12.2", - "@typescript-eslint/typescript-estree": "8.12.2", - "@typescript-eslint/visitor-keys": "8.12.2", + "@typescript-eslint/scope-manager": "8.10.0", + "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/typescript-estree": "8.10.0", + "@typescript-eslint/visitor-keys": "8.10.0", "debug": "^4.3.4" }, "engines": { @@ -5454,13 +5460,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.12.2.tgz", - "integrity": "sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.10.0.tgz", + "integrity": "sha512-AgCaEjhfql9MDKjMUxWvH7HjLeBqMCBfIaBbzzIcBbQPZE7CPh1m6FF+L75NUMJFMLYhCywJXIDEMa3//1A0dw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.12.2", - "@typescript-eslint/visitor-keys": "8.12.2" + "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/visitor-keys": "8.10.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5471,13 +5477,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.12.2.tgz", - "integrity": "sha512-bwuU4TAogPI+1q/IJSKuD4shBLc/d2vGcRT588q+jzayQyjVK2X6v/fbR4InY2U2sgf8MEvVCqEWUzYzgBNcGQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.10.0.tgz", + "integrity": "sha512-PCpUOpyQSpxBn230yIcK+LeCQaXuxrgCm2Zk1S+PTIRJsEfU6nJ0TtwyH8pIwPK/vJoA+7TZtzyAJSGBz+s/dg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.12.2", - "@typescript-eslint/utils": "8.12.2", + "@typescript-eslint/typescript-estree": "8.10.0", + "@typescript-eslint/utils": "8.10.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -5495,9 +5501,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.12.2.tgz", - "integrity": "sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.10.0.tgz", + "integrity": "sha512-k/E48uzsfJCRRbGLapdZgrX52csmWJ2rcowwPvOZ8lwPUv3xW6CcFeJAXgx4uJm+Ge4+a4tFOkdYvSpxhRhg1w==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5508,13 +5514,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.12.2.tgz", - "integrity": "sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.10.0.tgz", + "integrity": "sha512-3OE0nlcOHaMvQ8Xu5gAfME3/tWVDpb/HxtpUZ1WeOAksZ/h/gwrBzCklaGzwZT97/lBbbxJ16dMA98JMEngW4w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.12.2", - "@typescript-eslint/visitor-keys": "8.12.2", + "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/visitor-keys": "8.10.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -5551,15 +5557,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.12.2.tgz", - "integrity": "sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.10.0.tgz", + "integrity": "sha512-Oq4uZ7JFr9d1ZunE/QKy5egcDRXT/FrS2z/nlxzPua2VHFtmMvFNDvpq1m/hq0ra+T52aUezfcjGRIB7vNJF9w==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.12.2", - "@typescript-eslint/types": "8.12.2", - "@typescript-eslint/typescript-estree": "8.12.2" + "@typescript-eslint/scope-manager": "8.10.0", + "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/typescript-estree": "8.10.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5573,12 +5579,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.12.2.tgz", - "integrity": "sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.10.0.tgz", + "integrity": "sha512-k8nekgqwr7FadWk548Lfph6V3r9OVqjzAIVskE7orMZR23cGJjAOVazsZSJW+ElyjfTM4wx/1g88Mi70DDtG9A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/types": "8.10.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -7589,20 +7595,20 @@ } }, "node_modules/helia": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/helia/-/helia-5.1.0.tgz", - "integrity": "sha512-FqL+vtBpB3FQVmc0vTAtfneL6oAcWSkJCG+NVgTPeQ88jm+hLZXXqjUGVgI8aF8Wc3533gEBF2c8Y8+QN6K90Q==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/helia/-/helia-5.0.1.tgz", + "integrity": "sha512-C2SUzeEwhQeur13mQpPnklsrZemKEwS/n/3ApcG5ORYJmTni2Fjt2cRs+RzcrOdQf7pdtqBK6RWQR7GobV7OlA==", "dependencies": { "@chainsafe/libp2p-noise": "^16.0.0", "@chainsafe/libp2p-yamux": "^7.0.0", - "@helia/block-brokers": "^4.0.1", - "@helia/delegated-routing-v1-http-api-client": "^4.1.0", + "@helia/block-brokers": "^4.0.0", + "@helia/delegated-routing-v1-http-api-client": "^4.0.0", "@helia/interface": "^5.0.0", - "@helia/routers": "^2.1.0", - "@helia/utils": "^1.0.1", + "@helia/routers": "^2.0.0", + "@helia/utils": "^1.0.0", "@libp2p/autonat": "^2.0.0", "@libp2p/bootstrap": "^11.0.0", - "@libp2p/circuit-relay-v2": "^3.0.0", + "@libp2p/circuit-relay-v2": "^2.0.0", "@libp2p/crypto": "^5.0.0", "@libp2p/dcutr": "^2.0.0", "@libp2p/identify": "^3.0.0", @@ -9604,10 +9610,9 @@ "license": "MIT" }, "node_modules/mocha": { - "version": "10.8.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.1.tgz", - "integrity": "sha512-WxSpEWgF03HfgNKBuysfK40DUaOSVX5zxgLDoieMGO+zyE69iq2eQ1vBypvIJ5mOPKpuVAqWiTbt4Orj7L6wVw==", + "version": "10.7.3", "dev": true, + "license": "MIT", "dependencies": { "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", @@ -9774,9 +9779,9 @@ } }, "node_modules/multiformats": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.1.tgz", - "integrity": "sha512-QxowxTNwJ3r5RMctoGA5p13w5RbRT2QDkoM+yFlqfLiioBp78nhDjnRLvmSBI9+KAqN4VdgOVWM9c0CHd86m3g==" + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.0.tgz", + "integrity": "sha512-CBiqvsufgmpo01VT5ze94O+uc+Pbf6f/sThlvWss0sBZmAOu6GQn5usrYV2sf2mr17FWYc0rO8c/CNe2T90QAA==" }, "node_modules/murmurhash3js-revisited": { "version": "3.0.0", @@ -9785,23 +9790,6 @@ "node": ">=8.0.0" } }, - "node_modules/nanoid": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.8.tgz", - "integrity": "sha512-TcJPw+9RV9dibz1hHUzlLVy8N4X9TnwirAjrU08Juo6BNKggzVfP2ZJ/3ZUSq15Xl5i85i+Z89XBO90pB2PghQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^18 || >=20" - } - }, "node_modules/napi-build-utils": { "version": "1.0.2", "license": "MIT" @@ -9894,6 +9882,20 @@ "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", "peer": true }, + "node_modules/node-datachannel": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/node-datachannel/-/node-datachannel-0.12.0.tgz", + "integrity": "sha512-pZ9FsVZpHdUKqyWynuCc9IBLkZPJMpDzpNk4YNPCizbIXHYifpYeWqSF35REHGIWi9JMCf11QzapsyQGo/Y4Ig==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-domexception": "^2.0.1", + "prebuild-install": "^7.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/node-dir": { "version": "0.1.17", "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", @@ -11193,9 +11195,9 @@ "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" }, "node_modules/scale-ts": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/scale-ts/-/scale-ts-1.6.1.tgz", - "integrity": "sha512-PBMc2AWc6wSEqJYBDPcyCLUj9/tMKnLX70jLOSndMtcUoLQucP/DM0vnQo1wJAYjTrQiq8iG9rD0q6wFzgjH7g==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/scale-ts/-/scale-ts-1.6.0.tgz", + "integrity": "sha512-Ja5VCjNZR8TGKhUumy9clVVxcDpM+YFjAnkMuwQy68Hixio3VRRvWdE3g8T/yC+HXA0ZDQl2TGyUmtmbcVl40Q==" }, "node_modules/scheduler": { "version": "0.24.0-canary-efb381bbf-20230505", @@ -12004,9 +12006,9 @@ "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==" }, "node_modules/tsx": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz", - "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.1.tgz", + "integrity": "sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==", "dev": true, "dependencies": { "esbuild": "~0.23.0", @@ -12091,14 +12093,14 @@ } }, "node_modules/typescript-eslint": { - "version": "8.12.2", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.12.2.tgz", - "integrity": "sha512-UbuVUWSrHVR03q9CWx+JDHeO6B/Hr9p4U5lRH++5tq/EbFq1faYZe50ZSBePptgfIKLEti0aPQ3hFgnPVcd8ZQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.10.0.tgz", + "integrity": "sha512-YIu230PeN7z9zpu/EtqCIuRVHPs4iSlqW6TEvjbyDAE3MZsSl2RXBo+5ag+lbABCG8sFM1WVKEXhlQ8Ml8A3Fw==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.12.2", - "@typescript-eslint/parser": "8.12.2", - "@typescript-eslint/utils": "8.12.2" + "@typescript-eslint/eslint-plugin": "8.10.0", + "@typescript-eslint/parser": "8.10.0", + "@typescript-eslint/utils": "8.10.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/e2e/passkey/passkeyProxy.ecdsa.test.ts b/e2e/passkey/passkeyProxy.ecdsa.test.ts new file mode 100644 index 0000000000..ec70ddaf1b --- /dev/null +++ b/e2e/passkey/passkeyProxy.ecdsa.test.ts @@ -0,0 +1,197 @@ +import '@frequency-chain/api-augment'; +import assert from 'assert'; +import { + createAndFundKeypair, + DOLLARS, + getBlockNumber, + getConvertedEthereumAccount, + getNextEpochBlock, + getNonce +} from '../scaffolding/helpers'; +import { KeyringPair } from '@polkadot/keyring/types'; +import {Extrinsic, ExtrinsicHelper} from '../scaffolding/extrinsicHelpers'; +import { getFundingSource } from '../scaffolding/funding'; +import {hexToU8a, u8aToHex, u8aWrapBytes} from '@polkadot/util'; +import { createPassKeyAndSignAccount, createPassKeyCall, createPasskeyPayload } from '../scaffolding/P256'; +import {encodeAddress, ethereumEncode} from "@polkadot/util-crypto"; +import {secp256k1Expand} from "@polkadot/util-crypto/secp256k1/expand"; +import {HexString} from "@polkadot/util/types"; +import {SignerResult} from "@polkadot/types/types"; +const fundingSource = getFundingSource('passkey-proxy'); + +describe('Passkey Pallet Tests for ECDSA keys', function () { + describe('proxy basic tests for ECDSA keys', function () { + let fundedKeys: KeyringPair; + let receiverKeys: KeyringPair; + let fundedKeysSr25519: KeyringPair; + let fundedKeysEth: KeyringPair; + + before(async function () { + fundedKeys = await createAndFundKeypair(fundingSource, 300_000_000n, "test_fund", undefined, 'ecdsa'); + receiverKeys = await createAndFundKeypair(fundingSource, undefined, "test_receive", undefined, 'ecdsa'); + fundedKeysSr25519 = await createAndFundKeypair(fundingSource, 300_000_000n); + // fundedKeysEth = await createAndFundKeypair(fundingSource, 300_000_000n, "test_eth", undefined, 'ethereum'); + console.log(`fundedKeys ${JSON.stringify(fundedKeys.toJson())} ${encodeAddress(fundedKeys.address)}`); + console.log(`receiverKeys ${JSON.stringify(receiverKeys.toJson())} ${encodeAddress(receiverKeys.address)} ${u8aToHex(receiverKeys.addressRaw)}`); + // console.log(`fundedKeysEth ${JSON.stringify(fundedKeysEth.toJson())}`); + }); + + // it('should fail due to unsupported call', async function () { + // const accountPKey = fundedKeys.publicKey; + // const nonce = await getNonce(fundedKeys); + // + // const remarksCalls = ExtrinsicHelper.api.tx.system.remark('passkey-test'); + // const { passKeyPrivateKey, passKeyPublicKey, passkeySignature } = createPassKeyAndSignAccount(accountPKey); + // const accountSignature = fundedKeys.sign(u8aWrapBytes(passKeyPublicKey)); + // const passkeyCall = await createPassKeyCall(accountPKey, nonce, accountSignature, remarksCalls); + // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); + // + // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload); + // assert.rejects(passkeyProxy.fundAndSendUnsigned(fundingSource)); + // }); + // + // it('should fail to transfer balance due to bad account ownership proof', async function () { + // const accountPKey = fundedKeys.publicKey; + // const nonce = await getNonce(fundedKeys); + // const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(receiverKeys.publicKey, 0n); + // const { passKeyPrivateKey, passKeyPublicKey, passkeySignature } = createPassKeyAndSignAccount(accountPKey); + // const accountSignature = fundedKeys.sign('badPasskeyPublicKey'); + // const passkeyCall = await createPassKeyCall(accountPKey, nonce, accountSignature, transferCalls); + // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); + // + // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload); + // assert.rejects(passkeyProxy.fundAndSendUnsigned(fundingSource)); + // }); + // + // it('should fail to transfer balance due to bad passkey signature', async function () { + // const accountPKey = fundedKeys.publicKey; + // const nonce = await getNonce(fundedKeys); + // const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(receiverKeys.publicKey, 0n); + // const { passKeyPrivateKey, passKeyPublicKey, passkeySignature } = createPassKeyAndSignAccount(accountPKey); + // const accountSignature = fundedKeys.sign(u8aWrapBytes(passKeyPublicKey)); + // const passkeyCall = await createPassKeyCall(accountPKey, nonce, accountSignature, transferCalls); + // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, true); + // + // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload); + // assert.rejects(passkeyProxy.fundAndSendUnsigned(fundingSource)); + // }); + + // it('should transfer via passkeys', async function () { + // const receiverBalance1 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); + // const balanceBefore = receiverBalance1.data.free.toBigInt(); + // console.log(`before ${balanceBefore}`); + // + // const accountPKey = fundedKeys.addressRaw; + // console.log(`public key size ${accountPKey.length}`) + // const nonce = await getNonce(fundedKeys); + // const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive({ + // Id: receiverKeys.address + // }, 100_000_000n); + // const { passKeyPrivateKey, passKeyPublicKey } = createPassKeyAndSignAccount(accountPKey); + // const accountSignature = fundedKeys.sign(u8aWrapBytes(passKeyPublicKey)); + // const passkeyCall = await createPassKeyCall(accountPKey, nonce, accountSignature, transferCalls); + // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); + // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload); + // assert.doesNotReject(passkeyProxy.fundAndSendUnsigned(fundingSource)); + // await ExtrinsicHelper.waitForFinalization((await getBlockNumber()) + 2); + // const receiverBalance = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); + // const nonceAfter = (await ExtrinsicHelper.getAccountInfo(fundedKeys.address)).nonce.toNumber(); + // assert.equal(nonce + 1, nonceAfter); + // console.log(`after ${receiverBalance}`); + // assert(receiverBalance.data.free.toBigInt() - balanceBefore > 0n); + // }); + + // it ('it should send from secp256k1 to secp256k1', async function () { + // const receiverBalance1 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); + // const balanceBefore = receiverBalance1.data.free.toBigInt(); + // console.log(`before ${balanceBefore}`); + // + // const extrinsic = new Extrinsic( + // () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(receiverKeys.address, 100_000_000n), + // fundedKeys, + // ExtrinsicHelper.api.events.balances.Transfer + // ); + // const {target} = await extrinsic.signAndSend(); + // assert.notEqual(target, undefined, 'should have returned Transfer event'); + // + // const receiverBalance2 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); + // const balanceBefore2 = receiverBalance2.data.free.toBigInt(); + // console.log(`after ${balanceBefore2}`); + // }) + + it ('it should send from sr25519 accountId32 to secp256k1 accountId20', async function () { + const etheAddress = ethereumEncode(receiverKeys.publicKey); + console.log(`eth receiver address ${etheAddress}`); + let ethAddress20 = Array.from(hexToU8a(etheAddress)); + console.log(`ss ${ethAddress20}`); + + const extrinsic = new Extrinsic( + () => ExtrinsicHelper.api.tx.balances.transferKeepAlive({ + Address20: ethAddress20 + }, 50_000_000n), + fundedKeysSr25519, + ExtrinsicHelper.api.events.balances.Transfer + ); + const {target} = await extrinsic.signAndSend(); + assert.notEqual(target, undefined, 'should have returned Transfer event'); + + // transfer back + const extrinsic2 = ExtrinsicHelper.apiPromise.tx.balances.transferKeepAlive(fundedKeysSr25519.address, 1_000_000n); + let convertedAddress = getConvertedEthereumAccount(etheAddress); + const rawPayload = await ExtrinsicHelper.getRawPayloadForSigning(extrinsic2, convertedAddress); + console.log(`signer payload => ${JSON.stringify(rawPayload)}`); + + await extrinsic2.signAndSend(convertedAddress, {signer: { + signRaw: async (payload): Promise => { + console.log(`inside payload => ${JSON.stringify(payload)}`); + const sig = receiverKeys.sign(payload.data); + const prefixedSignature = new Uint8Array(sig.length + 1); + prefixedSignature[0]=2; + prefixedSignature.set(sig, 1); + const hex = u8aToHex(prefixedSignature); + console.log(`signature => ${hex}`); + return { + signature: hex, + } as SignerResult; + }, + }}, (status) => { + console.log(status.toHuman()); + }); + + + + // const extrinsic2 = new Extrinsic( + // () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(fundedKeysSr25519.address, 500_000n), + // receiverKeys, + // ExtrinsicHelper.api.events.balances.Transfer + // ); + // const {target2} = await extrinsic2.signAndSend(); + // assert.notEqual(target2, undefined, 'should have returned Transfer event'); + + }) + + + // it ('it should send from secp256k1 accountId20 to sr25519', async function () { + // const etheAddress = ethereumEncode(fundedKeysEth.publicKey); + // console.log(`eth sender address ${etheAddress}`); + // let convertedAddress = getConvertedEthereumAccount(etheAddress); + // console.log(`convertedAddress ${convertedAddress}`); + // // const receiverBalance1 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); + // // const balanceBefore = receiverBalance1.data.free.toBigInt(); + // // console.log(`before ${balanceBefore}`); + // + // const extrinsic = ExtrinsicHelper.api.tx.balances.transferKeepAlive(fundedKeysSr25519.address, 1_000_000n); + // const rawPayload = await ExtrinsicHelper.getRawPayloadForSigning(extrinsic, convertedAddress); + // console.log(`signer payload => ${JSON.stringify(rawPayload)}`); + // + // // TODO check whatever + // // const {target} = await extrinsic.signAndSend(); + // // assert.notEqual(target, undefined, 'should have returned Transfer event'); + // + // // const receiverBalance2 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); + // // const balanceBefore2 = receiverBalance2.data.free.toBigInt(); + // // console.log(`after ${balanceBefore2}`); + // }) + }); +}); + diff --git a/e2e/scaffolding/P256.ts b/e2e/scaffolding/P256.ts index 7c97794f93..942f52ef13 100644 --- a/e2e/scaffolding/P256.ts +++ b/e2e/scaffolding/P256.ts @@ -20,11 +20,12 @@ export async function createPassKeyCall( call: SubmittableExtrinsic<'rxjs', ISubmittableResult> ) { const ext_call_type = ExtrinsicHelper.api.registry.createType('Call', call); + console.log(`sig length ${accountSignature.length}`) const passkeyCall = { accountId: accountPKey, accountNonce: nonce, accountOwnershipProof: { - Sr25519: accountSignature, + Ecdsa: accountSignature, }, call: ext_call_type, }; diff --git a/e2e/scaffolding/extrinsicHelpers.ts b/e2e/scaffolding/extrinsicHelpers.ts index 0d467d7780..f774ab3b42 100644 --- a/e2e/scaffolding/extrinsicHelpers.ts +++ b/e2e/scaffolding/extrinsicHelpers.ts @@ -4,7 +4,7 @@ import { ApiTypes, AugmentedEvent, SubmittableExtrinsic, SignerOptions } from '@ import { KeyringPair } from '@polkadot/keyring/types'; import { Compact, u128, u16, u32, u64, Vec, Option, Bool } from '@polkadot/types'; import { FrameSystemAccountInfo, PalletPasskeyPasskeyPayload, SpRuntimeDispatchError } from '@polkadot/types/lookup'; -import { AnyJson, AnyNumber, AnyTuple, Codec, IEvent, ISubmittableResult } from '@polkadot/types/types'; +import {AnyJson, AnyNumber, AnyTuple, Codec, IEvent, ISubmittableResult, SignerPayloadRaw} from '@polkadot/types/types'; import { firstValueFrom, filter, map, pipe, tap } from 'rxjs'; import { getBlockNumber, getExistentialDeposit, getFinalizedBlockNumber, log, Sr25519Signature } from './helpers'; import autoNonce, { AutoNonce } from './autoNonce'; @@ -267,6 +267,7 @@ export class Extrinsic, + signerAddress: string, + ): Promise { + const dummyError = 'Stop here'; + + let signRaw: SignerPayloadRaw; + try { + await tx.signAsync(signerAddress, { + signer: { + signRaw: (raw) => { + signRaw = raw; + // Interrupt the signing process to get the raw payload, as encoded by polkadot-js + throw new Error(dummyError); + }, + // signPayload: (payload) => { + // console.log(payload); + // }, + } + }); + } catch (e: any) { + if (e?.message !== dummyError) { + throw e; + } + } + + return signRaw; + } } diff --git a/e2e/scaffolding/funding.ts b/e2e/scaffolding/funding.ts index 3667155007..e44d96fabc 100644 --- a/e2e/scaffolding/funding.ts +++ b/e2e/scaffolding/funding.ts @@ -9,30 +9,30 @@ const keyring = new Keyring({ type: 'sr25519' }); // New ones should be added to support additional parallel testing // tldr: Each test file should have a separate funding source listed below export const fundingSources = [ - 'capacity-replenishment', - 'capacity-rpcs', - 'capacity-staking', - 'capacity-transactions', - 'capacity-transactions-batch', - 'capacity-transactions-fail', - 'capacity-unstaking', - 'check-metadata-hash', - 'frequency-misc', - 'handles', - 'load-signature-registry', - 'messages-add-ipfs', - 'misc-util-batch', - 'msa-create-msa', - 'msa-key-management', + // 'capacity-replenishment', + // 'capacity-rpcs', + // 'capacity-staking', + // 'capacity-transactions', + // 'capacity-transactions-batch', + // 'capacity-transactions-fail', + // 'capacity-unstaking', + // 'check-metadata-hash', + // 'frequency-misc', + // 'handles', + // 'load-signature-registry', + // 'messages-add-ipfs', + // 'misc-util-batch', + // 'msa-create-msa', + // 'msa-key-management', 'passkey-proxy', - 'proxy-pallet', - 'scenarios-grant-delegation', - 'schemas-create', - 'stateful-storage-handle-itemized', - 'stateful-storage-handle-paginated', - 'stateful-storage-handle-sig-req', - 'sudo-transactions', - 'time-release', + // 'proxy-pallet', + // 'scenarios-grant-delegation', + // 'schemas-create', + // 'stateful-storage-handle-itemized', + // 'stateful-storage-handle-paginated', + // 'stateful-storage-handle-sig-req', + // 'sudo-transactions', + // 'time-release', ] as const; // Get the correct key for this Funding Source diff --git a/e2e/scaffolding/globalHooks.ts b/e2e/scaffolding/globalHooks.ts index 33314d4c7f..d8a18e88ed 100644 --- a/e2e/scaffolding/globalHooks.ts +++ b/e2e/scaffolding/globalHooks.ts @@ -35,9 +35,9 @@ async function devSudoActions() { } function drainAllSources() { - const keys = fundingSources.map((source) => getFundingSource(source)); - const root = getRootFundingSource().keys; - return drainKeys(keys, root.address); + // const keys = fundingSources.map((source) => getFundingSource(source)); + // const root = getRootFundingSource().keys; + // return drainKeys(keys, root.address); } export async function mochaGlobalSetup() { diff --git a/e2e/scaffolding/helpers.ts b/e2e/scaffolding/helpers.ts index fa5c3156db..fe8d663ab8 100644 --- a/e2e/scaffolding/helpers.ts +++ b/e2e/scaffolding/helpers.ts @@ -3,8 +3,8 @@ import { KeyringPair } from '@polkadot/keyring/types'; import { u16, u32, u64, Option, Bytes } from '@polkadot/types'; import type { FrameSystemAccountInfo, PalletCapacityCapacityDetails } from '@polkadot/types/lookup'; import { Codec } from '@polkadot/types/types'; -import { u8aToHex, u8aWrapBytes } from '@polkadot/util'; -import { mnemonicGenerate } from '@polkadot/util-crypto'; +import {hexToU8a, u8aToHex, u8aWrapBytes} from '@polkadot/util'; +import {encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; import { verbose, getGraphChangeSchema, @@ -37,6 +37,7 @@ import assert from 'assert'; import { AVRO_GRAPH_CHANGE } from '../schemas/fixtures/avroGraphChangeSchemaType'; import { PARQUET_BROADCAST } from '../schemas/fixtures/parquetBroadcastSchemaType'; import { AVRO_CHAT_MESSAGE } from '../stateful-pallet-storage/fixtures/itemizedSchemaType'; +import type { KeypairType } from "@polkadot/util-crypto/types"; export interface Account { uri: string; @@ -236,12 +237,12 @@ export function drainFundedKeys(dest: string) { return drainKeys([...createdKeys.values()], dest); } -export function createKeys(name: string = 'first pair'): KeyringPair { +export function createKeys(name: string = 'first pair', keyType: KeypairType = 'sr25519'): KeyringPair { const mnemonic = mnemonicGenerate(); // create & add the pair to the keyring with the type and some additional // metadata specified - const keyring = new Keyring({ type: 'sr25519' }); - const keypair = keyring.addFromUri(mnemonic, { name }, 'sr25519'); + const keyring = new Keyring({ type: keyType }); + const keypair = keyring.addFromUri(mnemonic, { name }, keyType); createdKeys.set(keypair.address, keypair); return keypair; @@ -283,16 +284,26 @@ export async function createAndFundKeypair( source: KeyringPair, amount?: bigint, keyName?: string, - nonce?: number + nonce?: number, + keyType: KeypairType = 'sr25519', ): Promise { - const keypair = createKeys(keyName); - + const keypair = createKeys(keyName, keyType); await fundKeypair(source, keypair, amount || (await getExistentialDeposit()), nonce); log('Funded', `Name: ${keyName || 'None provided'}`, `Address: ${keypair.address}`); return keypair; } +export function getConvertedEthereumAccount( + accountId20Hex: string +) : string { + const addressBytes = hexToU8a(accountId20Hex); + const result = new Uint8Array(32); + result.fill(0, 0, 12); + result.set(addressBytes, 12); + return encodeAddress(result); +} + export async function createAndFundKeypairs( source: KeyringPair, keyNames: string[], diff --git a/e2e/scaffolding/rootHooks.ts b/e2e/scaffolding/rootHooks.ts index f01495e371..9d0314b79a 100644 --- a/e2e/scaffolding/rootHooks.ts +++ b/e2e/scaffolding/rootHooks.ts @@ -27,7 +27,7 @@ export const mochaHooks = { // Any key created using helpers `createKeys` is kept in the module // then any value remaining is drained here at the end const rootAddress = getRootFundingSource().keys.address; - await drainFundedKeys(rootAddress); + // await drainFundedKeys(rootAddress); console.log('ENDING ROOT hook shutdown', testSuite); } catch (e) { console.error('Failed to run afterAll root hook: ', testSuite, e); diff --git a/pallets/frequency-tx-payment/src/lib.rs b/pallets/frequency-tx-payment/src/lib.rs index 0f802279da..6ee330e88e 100644 --- a/pallets/frequency-tx-payment/src/lib.rs +++ b/pallets/frequency-tx-payment/src/lib.rs @@ -23,6 +23,7 @@ use frame_system::pallet_prelude::*; use pallet_transaction_payment::{FeeDetails, InclusionFee, OnChargeTransaction}; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; +use sp_core::hexdisplay::HexDisplay; use sp_runtime::{ traits::{DispatchInfoOf, Dispatchable, PostDispatchInfoOf, SignedExtension, Zero}, transaction_validity::{TransactionValidity, TransactionValidityError}, @@ -420,12 +421,15 @@ where if fee.is_zero() { return Ok((fee, InitialPayment::Free)) } - + log::info!(target: "ETHEREUM", "fee is {:?} top: {:?} info={:?} call={:?}", fee, tip, info, HexDisplay::from(&call.encode())); as OnChargeTransaction>::withdraw_fee( who, call, info, fee, tip, ) .map(|i| (fee, InitialPayment::Token(i))) - .map_err(|_| -> TransactionValidityError { InvalidTransaction::Payment.into() }) + .map_err(|e| -> TransactionValidityError { + log::error!(target: "ETHEREUM", "withdraw_token_fee {:?}", e); + TransactionValidityError::Invalid(InvalidTransaction::Payment) + }) } } @@ -477,8 +481,9 @@ where info: &DispatchInfoOf, len: usize, ) -> TransactionValidity { + log::info!(target: "ETHEREUM", "trx validate 0x{:?}", HexDisplay::from(&who.encode())); let (fee, _) = self.withdraw_fee(who, call, info, len)?; - + log::info!(target: "ETHEREUM", "trx after validate {:?}", who); let priority = pallet_transaction_payment::ChargeTransactionPayment::::get_priority( info, len, diff --git a/pallets/passkey/src/lib.rs b/pallets/passkey/src/lib.rs index ee4a4a6796..8178afacde 100644 --- a/pallets/passkey/src/lib.rs +++ b/pallets/passkey/src/lib.rs @@ -16,7 +16,7 @@ rustdoc::invalid_codeblock_attributes, missing_docs )] -use common_runtime::{extensions::check_nonce::CheckNonce, signature::check_signature}; +use common_runtime::extensions::check_nonce::CheckNonce; use frame_support::{ dispatch::{DispatchInfo, GetDispatchInfo, PostDispatchInfo}, pallet_prelude::*, @@ -28,7 +28,7 @@ use sp_runtime::{ generic::Era, traits::{Convert, Dispatchable, SignedExtension, Zero}, transaction_validity::{TransactionValidity, TransactionValidityError}, - AccountId32, MultiSignature, + AccountId32, }; use sp_std::{vec, vec::Vec}; @@ -50,9 +50,11 @@ mod tests; pub mod weights; pub use weights::*; +use common_primitives::{signatures::UnifiedSignature, utils::wrap_binary_data}; #[cfg(feature = "runtime-benchmarks")] use frame_support::traits::tokens::fungible::Mutate; use frame_system::CheckWeight; +use sp_runtime::traits::Verify; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; @@ -274,7 +276,7 @@ impl PasskeySignatureCheck { let signature = self.0.passkey_call.account_ownership_proof.clone(); let signer = &self.0.passkey_call.account_id; - Self::check_account_signature(signer, &signed_data.inner().to_vec(), &signature) + Self::check_account_signature(signer, &signed_data.inner().to_vec(), &signature.into()) .map_err(|_e| TransactionValidityError::Invalid(InvalidTransaction::BadSigner))?; // checking the passkey signature to ensure access to the passkey @@ -311,16 +313,31 @@ impl PasskeySignatureCheck { fn check_account_signature( signer: &T::AccountId, signed_data: &Vec, - signature: &MultiSignature, + signature: &UnifiedSignature, ) -> DispatchResult { let key = T::ConvertIntoAccountId32::convert((*signer).clone()); - if !check_signature(signature, key, signed_data.clone()) { + if !Self::check_signature(signature, key, signed_data.clone()) { return Err(Error::::InvalidAccountSignature.into()); } Ok(()) } + + fn check_signature( + signature: &UnifiedSignature, + signer: AccountId32, + payload: Vec, + ) -> bool { + let verify_signature = |payload: &[u8]| signature.verify(payload, &signer.clone().into()); + + if verify_signature(&payload) { + return true; + } + + let wrapped_payload = wrap_binary_data(payload); + verify_signature(&wrapped_payload) + } } /// Passkey related tx payment diff --git a/runtime/frequency/Cargo.toml b/runtime/frequency/Cargo.toml index 6f1149e4c9..54a60d209a 100644 --- a/runtime/frequency/Cargo.toml +++ b/runtime/frequency/Cargo.toml @@ -99,6 +99,7 @@ cumulus-primitives-timestamp = { workspace = true } cumulus-primitives-aura = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } +sp-debug-derive = { package = "sp-debug-derive", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } [features] default = ["std"] @@ -173,6 +174,9 @@ std = [ "substrate-wasm-builder", "frame-metadata-hash-extension/std", ] +force-debug=[ + "sp-debug-derive/force-debug", +] runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", diff --git a/runtime/frequency/src/eth.rs b/runtime/frequency/src/eth.rs new file mode 100644 index 0000000000..774f39b3e0 --- /dev/null +++ b/runtime/frequency/src/eth.rs @@ -0,0 +1,48 @@ +use parity_scale_codec::Codec; +use scale_info::StaticTypeInfo; +use sp_core::hexdisplay::HexDisplay; +use sp_runtime::{ + traits::{LookupError, StaticLookup}, + MultiAddress, +}; +use sp_std::{fmt::Debug, marker::PhantomData}; + +/// A lookup implementation returning the `AccountId` from a `MultiAddress`. +pub struct EthCompatibleAccountIdLookup( + PhantomData<(AccountId, AccountIndex)>, +); +impl StaticLookup for EthCompatibleAccountIdLookup +where + AccountId: Codec + Clone + PartialEq + Debug, + AccountIndex: Codec + Clone + PartialEq + Debug, + MultiAddress: Codec + StaticTypeInfo, +{ + type Source = MultiAddress; + type Target = AccountId; + fn lookup(x: Self::Source) -> Result { + match x { + MultiAddress::Id(i) => Ok(i), + MultiAddress::Address20(acc20) => { + log::info!(target: "ETHEREUM", "lookup 0x{:?}", HexDisplay::from(&acc20)); + let mut buffer = [0u8; 32]; + buffer[12..].copy_from_slice(&acc20); + let decoded = Self::Target::decode(&mut &buffer[..]).map_err(|_| LookupError)?; + Ok(decoded) + }, + _ => Err(LookupError), + } + } + fn unlookup(x: Self::Target) -> Self::Source { + let encoded = x.encode(); + match encoded[..12].eq(&[0u8; 12]) { + true => { + log::info!(target: "ETHEREUM", "unlookup before 0x{:?}", HexDisplay::from(&encoded)); + let mut address20 = [0u8; 20]; + address20[..].copy_from_slice(&encoded[12..]); + log::info!(target: "ETHEREUM", "unlookup after 0x{:?}", HexDisplay::from(&address20)); + MultiAddress::Address20(address20) + }, + false => MultiAddress::Id(x), + } + } +} diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index 521ae49d8f..052d160db7 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -19,14 +19,12 @@ pub fn wasm_binary_unwrap() -> &'static [u8] { #[cfg(any(not(feature = "frequency-no-relay"), feature = "frequency-lint-check"))] use cumulus_pallet_parachain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider}; +use cumulus_primitives_core::BlockT; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{ - AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, - IdentityLookup, - }, + traits::{AccountIdConversion, BlakeTwo256, ConvertInto, IdentityLookup}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, DispatchError, }; @@ -361,6 +359,8 @@ impl OnRuntimeUpgrade for MigratePalletsCu } } +pub mod eth; + /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know /// the specifics of the runtime. They can then be made to be agnostic over specific formats /// of data like extrinsics, allowing for them to continue syncing the network through upgrades @@ -466,7 +466,7 @@ impl frame_system::Config for Runtime { /// The aggregated dispatch type that is available for extrinsics. type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; + type Lookup = eth::EthCompatibleAccountIdLookup; /// The index type for storing how many extrinsics an account has signed. type Nonce = Index; /// The block type. diff --git a/scripts/init.sh b/scripts/init.sh index 520518f05a..808c0fbdd4 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -106,7 +106,7 @@ start-paseo-collator-bob) start-frequency-instant) printf "\nBuilding Frequency without relay. Running with instant sealing ...\n" - cargo build --features frequency-no-relay + cargo build --features frequency-no-relay,force-debug parachain_dir=$base_dir/parachain/${para_id} mkdir -p $parachain_dir; @@ -121,7 +121,7 @@ start-frequency-instant) --state-pruning archive \ -lbasic-authorship=debug \ -ltxpool=debug \ - -lruntime=debug \ + -lruntime=trace \ --sealing=instant \ --wasm-execution=compiled \ --no-telemetry \ From 39a4661b0c581e2f23cc1f4c39878d277cc70e3a Mon Sep 17 00:00:00 2001 From: Aramik Date: Thu, 31 Oct 2024 17:43:53 -0700 Subject: [PATCH 2/3] fix the issues with passkey --- common/primitives/src/signatures.rs | 4 +- e2e/package-lock.json | 915 ++++++++++++++----------- e2e/passkey/passkeyProxy.ecdsa.test.ts | 217 ++---- e2e/scaffolding/P256.ts | 8 +- e2e/scaffolding/autoNonce.ts | 11 +- e2e/scaffolding/ethereum.ts | 55 ++ e2e/scaffolding/extrinsicHelpers.ts | 46 +- e2e/scaffolding/helpers.ts | 13 +- runtime/frequency/src/eth.rs | 24 +- 9 files changed, 678 insertions(+), 615 deletions(-) create mode 100644 e2e/scaffolding/ethereum.ts diff --git a/common/primitives/src/signatures.rs b/common/primitives/src/signatures.rs index edd2251619..4891a72f67 100644 --- a/common/primitives/src/signatures.rs +++ b/common/primitives/src/signatures.rs @@ -94,8 +94,8 @@ impl Verify for UnifiedSignature { Err(()) => false, }, (Self::Ecdsa(ref sig), who) => { - log::info!(target:"ETHEREUM", "inside ecdsa signature verifier"); - let m = sp_io::hashing::blake2_256(msg.get()); + log::info!(target:"ETHEREUM", "inside ecdsa signature verifier 0x{:?}",HexDisplay::from(&msg.get())); + let m = sp_io::hashing::keccak_256(msg.get()); match sp_io::crypto::secp256k1_ecdsa_recover(sig.as_ref(), &m) { Ok(pubkey) => { let mut hashed = sp_io::hashing::keccak_256(pubkey.as_ref()); diff --git a/e2e/package-lock.json b/e2e/package-lock.json index 1d53f21a36..5810f52849 100644 --- a/e2e/package-lock.json +++ b/e2e/package-lock.json @@ -13,12 +13,12 @@ "@frequency-chain/api-augment": "file:../js/api-augment/dist/frequency-chain-api-augment-0.0.0.tgz", "@helia/unixfs": "^4.0.0", "@noble/curves": "^1.6.0", - "@polkadot-api/merkleize-metadata": "^1.1.7", - "@polkadot/api": "14.1.1", - "@polkadot/types": "14.1.1", - "@polkadot/util": "13.2.1", - "helia": "^5.0.1", - "multiformats": "^13.3.0", + "@polkadot-api/merkleize-metadata": "^1.1.9", + "@polkadot/api": "14.2.1", + "@polkadot/types": "14.2.1", + "@polkadot/util": "13.2.2", + "helia": "^5.1.0", + "multiformats": "^13.3.1", "rxjs": "^7.8.1", "workerpool": "^9.2.0" }, @@ -29,13 +29,12 @@ "eslint": "^9.13.0", "eslint-plugin-mocha": "^10.5.0", "globals": "^15.11.0", - "mocha": "^10.7.3", - "node-datachannel": "^0.12.0", + "mocha": "^10.8.1", "prettier": "^3.3.3", "sinon": "^19.0.2", - "tsx": "^4.19.1", + "tsx": "^4.19.2", "typescript": "^5.6.3", - "typescript-eslint": "^8.10.0" + "typescript-eslint": "^8.12.2" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -2197,12 +2196,12 @@ "node_modules/@frequency-chain/api-augment": { "version": "0.0.0", "resolved": "file:../js/api-augment/dist/frequency-chain-api-augment-0.0.0.tgz", - "integrity": "sha512-3edQkfsbTqCIYuAPcjnuELLqUQkPu+UzFanTB98zAhyRCBNeaqN4gkYxBR7B+WKwmWy/TyXPHYfBOeo9+Gl6SQ==", + "integrity": "sha512-V3OFTurKfbpyylkT+HO23RlXzw6vqtBHW/CCwDaGA+nULV+yCb2y7Q9Umjue2ebHslFeZWY+24/VIBn5lCKXoA==", "license": "Apache-2.0", "dependencies": { - "@polkadot/api": "^14.1.1", - "@polkadot/rpc-provider": "^14.1.1", - "@polkadot/types": "^14.1.1", + "@polkadot/api": "^14.2.1", + "@polkadot/rpc-provider": "^14.2.1", + "@polkadot/types": "^14.2.1", "globals": "^15.11.0" } }, @@ -2222,12 +2221,12 @@ } }, "node_modules/@helia/bitswap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@helia/bitswap/-/bitswap-2.0.0.tgz", - "integrity": "sha512-PsZtD7w6HOimuxkmQQMC90K4Ao4moX+4WmzYSoID+pnq6jM1XbLjnDIMc/WsT59Ey6excPiKDZ8xp5n4zI5jLA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@helia/bitswap/-/bitswap-2.0.1.tgz", + "integrity": "sha512-9bwjwdgW3LfraDfIlfJ4g1WrO96IKW3hjrc63jXxlKHU8JPwMdd5a//XoNIQfQ5vx6DV0w+w2AM1aHHt+nHBGA==", "dependencies": { "@helia/interface": "^5.0.0", - "@helia/utils": "^1.0.0", + "@helia/utils": "^1.0.1", "@libp2p/interface": "^2.0.0", "@libp2p/logger": "^5.0.0", "@libp2p/peer-collections": "^6.0.0", @@ -2258,13 +2257,13 @@ "integrity": "sha512-KSFCXtBlNoG0hzwNa0RmhHtrdhzexp+S+UY2s0rWTBJyfdEIgn6i6Zl9otVqrcFYbYrneBT7hbmHQ8gE0C3umA==" }, "node_modules/@helia/block-brokers": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@helia/block-brokers/-/block-brokers-4.0.0.tgz", - "integrity": "sha512-vABeVaVS2SE4Lk9QbV2K6FiMNgqDuVJh8GVDAYBeVcWWUjGnLKmIezqKqM47txbY9Vq90Jvt55cNkQIdjZw+jA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@helia/block-brokers/-/block-brokers-4.0.1.tgz", + "integrity": "sha512-djYp4bmC15SBP1/ra9SrOAATr432hDcA2hnHWewkz1l84hCi+gSol7AcdAfW233pZ2ivZcI2Jc1Nyf7Vg6uFeg==", "dependencies": { - "@helia/bitswap": "^2.0.0", + "@helia/bitswap": "^2.0.1", "@helia/interface": "^5.0.0", - "@helia/utils": "^1.0.0", + "@helia/utils": "^1.0.1", "@libp2p/interface": "^2.0.0", "@libp2p/utils": "^6.0.0", "@multiformats/multiaddr": "^12.2.1", @@ -2282,9 +2281,9 @@ "integrity": "sha512-KSFCXtBlNoG0hzwNa0RmhHtrdhzexp+S+UY2s0rWTBJyfdEIgn6i6Zl9otVqrcFYbYrneBT7hbmHQ8gE0C3umA==" }, "node_modules/@helia/delegated-routing-v1-http-api-client": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@helia/delegated-routing-v1-http-api-client/-/delegated-routing-v1-http-api-client-4.1.0.tgz", - "integrity": "sha512-zeh1Hn3GZ8+QNcfdGL+iTLJC0avfFagp7rM0HydHp14c//Z+Zf5i+M6Yd5OLD764pPGD3ja/IVoP6idugiczNg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@helia/delegated-routing-v1-http-api-client/-/delegated-routing-v1-http-api-client-4.1.1.tgz", + "integrity": "sha512-Pf5pZkZGEBhARFXoLRzVVSZ8E8yU0Q0F3DOadhxPQjaSNyahetwiTsV8TvJltfrs2Afy2+gbA2+Rycl7apSXdQ==", "dependencies": { "@libp2p/interface": "^2.0.1", "@libp2p/logger": "^5.0.1", @@ -2322,11 +2321,11 @@ "integrity": "sha512-KSFCXtBlNoG0hzwNa0RmhHtrdhzexp+S+UY2s0rWTBJyfdEIgn6i6Zl9otVqrcFYbYrneBT7hbmHQ8gE0C3umA==" }, "node_modules/@helia/routers": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@helia/routers/-/routers-2.0.0.tgz", - "integrity": "sha512-p9FlVMlX4JoeTDdXWo7UvHZTrhhJfHj0v7PIQXkwAhnjcl1HesHw4oDUSLJhWwQPsHxhJ82ttuWPUVjgRVGbfQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@helia/routers/-/routers-2.1.0.tgz", + "integrity": "sha512-JOvM+EfVd9c999gSz4tHLJWpwexU1kc82ujwoFRaRvKxT5pD77t9h0gwnfnsGbe9Br6iUPFXquNC+g0p8Xll3g==", "dependencies": { - "@helia/delegated-routing-v1-http-api-client": "^4.0.0", + "@helia/delegated-routing-v1-http-api-client": "^4.1.0", "@helia/interface": "^5.0.0", "@libp2p/interface": "^2.0.0", "@libp2p/peer-id": "^5.0.0", @@ -2365,20 +2364,18 @@ } }, "node_modules/@helia/utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@helia/utils/-/utils-1.0.0.tgz", - "integrity": "sha512-26dxUS5cjhIvyqnY/VkR8/pAGGX2AOpIy1Afrb2Y/t6eFfDanQSw/X++oH+6VNhqbIi/KYF7VChn+TcclAEp7w==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@helia/utils/-/utils-1.0.1.tgz", + "integrity": "sha512-S1qLDiHNdBxQxtgonqPQHl8Rn7gs4HEQSrVF+ok//T/ZQPItNGnhKudV8qWhoOdpzCDaObx2ryqip+K9FK8VCQ==", "dependencies": { "@helia/interface": "^5.0.0", "@ipld/dag-cbor": "^9.2.0", "@ipld/dag-json": "^10.2.0", "@ipld/dag-pb": "^4.1.0", - "@libp2p/crypto": "^5.0.0", "@libp2p/interface": "^2.0.0", "@libp2p/logger": "^5.0.0", "@libp2p/utils": "^6.0.0", "@multiformats/dns": "^1.0.1", - "@types/murmurhash3js-revisited": "^3.0.3", "any-signal": "^4.1.1", "blockstore-core": "^5.0.0", "cborg": "^4.0.9", @@ -2391,10 +2388,8 @@ "it-merge": "^3.0.3", "mortice": "^3.0.4", "multiformats": "^13.1.0", - "murmurhash3js-revisited": "^3.0.0", "p-defer": "^4.0.1", "progress-events": "^1.0.0", - "uint8arraylist": "^2.4.8", "uint8arrays": "^5.0.2" } }, @@ -2663,37 +2658,37 @@ } }, "node_modules/@libp2p/circuit-relay-v2": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@libp2p/circuit-relay-v2/-/circuit-relay-v2-2.1.5.tgz", - "integrity": "sha512-7uJicxChosVPcj7r9xmeI2Z318sgOk2VclagPWjTFCZSMdSHPtou8G4i0CJEoWAI+Afpxuz0h8aPb90MpVbWCA==", - "dependencies": { - "@libp2p/crypto": "^5.0.5", - "@libp2p/interface": "^2.1.3", - "@libp2p/interface-internal": "^2.0.8", - "@libp2p/peer-collections": "^6.0.8", - "@libp2p/peer-id": "^5.0.5", - "@libp2p/peer-record": "^8.0.8", - "@libp2p/utils": "^6.1.1", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/circuit-relay-v2/-/circuit-relay-v2-3.1.0.tgz", + "integrity": "sha512-g9AdFhT93P8Uc7sOKeAdULDKF+Tf/aGwnECWZMRo3GFIsvpbd06VdmnjqGmF9xSdll0NWPe8EwhI098rMRd7OQ==", + "dependencies": { + "@libp2p/crypto": "^5.0.6", + "@libp2p/interface": "^2.2.0", + "@libp2p/interface-internal": "^2.0.10", + "@libp2p/peer-collections": "^6.0.10", + "@libp2p/peer-id": "^5.0.7", + "@libp2p/peer-record": "^8.0.10", + "@libp2p/utils": "^6.1.3", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.3.0", "any-signal": "^4.1.1", "it-protobuf-stream": "^1.1.3", "it-stream-types": "^2.0.1", "multiformats": "^13.1.0", + "nanoid": "^5.0.7", "progress-events": "^1.0.0", "protons-runtime": "^5.4.0", - "race-signal": "^1.0.2", "retimeable-signal": "^0.0.0", "uint8arraylist": "^2.4.8", "uint8arrays": "^5.1.0" } }, "node_modules/@libp2p/crypto": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.5.tgz", - "integrity": "sha512-bs3PpSQS59I/YD2RnwcPv88pF/vB6GH2rw4jqb/0xm60LfRuSm0tNoCrJMuyG2pFz89WuKM+0BpnEWQi4alwCg==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-5.0.6.tgz", + "integrity": "sha512-5mD/riNxUuSOerk3aPXUUMN96lwZsrU33lp97ySfffloh2WhLZcjVJszibBgIP7DP5nqmSOWY9++rqrBuYHvnQ==", "dependencies": { - "@libp2p/interface": "^2.1.3", + "@libp2p/interface": "^2.2.0", "@noble/curves": "^1.4.0", "@noble/hashes": "^1.4.0", "asn1js": "^3.0.5", @@ -2742,9 +2737,9 @@ } }, "node_modules/@libp2p/interface": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.1.3.tgz", - "integrity": "sha512-t1i2LWcnTGJEr7fDMslA8wYwBzJP81QKBlrBHoGhXxqqpRQa9035roCh/Akuw5RUgjKE47/ezjuzo90aWsJB8g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-2.2.0.tgz", + "integrity": "sha512-Pn3P5ixDggBjDyuULT0GvwdgD3JA426OqZ0e521mI7ysS+/M9Z9fp4Qcy8JrkJ45bLmIi9cgrNrefuU/Zu+bAQ==", "dependencies": { "@multiformats/multiaddr": "^12.2.3", "it-pushable": "^3.2.3", @@ -2755,12 +2750,12 @@ } }, "node_modules/@libp2p/interface-internal": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.0.8.tgz", - "integrity": "sha512-yWAVuygiy2XhZK2UsOfy3iA30Bi78VeJDac6cAD/FQzu3rmGy2LNYtHuz1Vze9/OL4I6cseMNTGkozTeDg8nMg==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-2.0.10.tgz", + "integrity": "sha512-LRnn6w5rtvMQlEukihDI5NhSZXZj7ITFT1Hbo3Dn3HGo1oxZe7oWh7ERc5LwZw835QHGzFKZYerBFKdqxoWsFQ==", "dependencies": { - "@libp2p/interface": "^2.1.3", - "@libp2p/peer-collections": "^6.0.8", + "@libp2p/interface": "^2.2.0", + "@libp2p/peer-collections": "^6.0.10", "@multiformats/multiaddr": "^12.2.3", "progress-events": "^1.0.0", "uint8arraylist": "^2.4.8" @@ -2820,11 +2815,11 @@ } }, "node_modules/@libp2p/logger": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.1.tgz", - "integrity": "sha512-+pwFFZekKQHKdSrGURKZjfAJ86soc1e4HsI0r7dJN+kHICzKFzC+x5hM5GsWCorNj3y++xshWlF/n03zyxoyJQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-5.1.3.tgz", + "integrity": "sha512-NUVWEWGbXlBDgDE5ntdm51+ZICmaKYI8mor6KrlPeB1WXDyIFxRWIBw6uzt+HgprQJWzLTojeUEGv6OPsj95Dg==", "dependencies": { - "@libp2p/interface": "^2.1.3", + "@libp2p/interface": "^2.2.0", "@multiformats/multiaddr": "^12.2.3", "interface-datastore": "^8.3.0", "multiformats": "^13.1.0", @@ -2878,36 +2873,36 @@ } }, "node_modules/@libp2p/peer-collections": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.8.tgz", - "integrity": "sha512-/xaSvb45lydLibt7sb+Im1ohIGiMfOlz5wcxelEgxmvUd0QmvirZXM3eAavQ+xrxmvJSPEQDmWSP+851ohRlKQ==", + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-6.0.10.tgz", + "integrity": "sha512-KQQiBZ2Y3+wvxjfIWbUCL0suCRVn5ylLuQ2r+OGXLA7LtgRw1RLQnUHHFVoY+CE9pvfIfamwTFlkZhWtvi271w==", "dependencies": { - "@libp2p/interface": "^2.1.3", - "@libp2p/peer-id": "^5.0.5", - "@libp2p/utils": "^6.1.1", + "@libp2p/interface": "^2.2.0", + "@libp2p/peer-id": "^5.0.7", + "@libp2p/utils": "^6.1.3", "multiformats": "^13.2.2" } }, "node_modules/@libp2p/peer-id": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.5.tgz", - "integrity": "sha512-+9aX4II0hjMgKcFX/TMWUHRu2wOXOkfV5jO2N5m/R91K+Kp4Tt4n1ceXHjrbwwz3k2IWl0xJOMYjrf9dhOZWAw==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-5.0.7.tgz", + "integrity": "sha512-ecF0Mu4Nxy8IHUMBYVNIEihjUlx52DM+X3CIfBItvGqvnhrUSkJJjkska2dJX3yf2J8wufzCT3jCg4NZWmndYg==", "dependencies": { - "@libp2p/crypto": "^5.0.5", - "@libp2p/interface": "^2.1.3", + "@libp2p/crypto": "^5.0.6", + "@libp2p/interface": "^2.2.0", "multiformats": "^13.1.0", "uint8arrays": "^5.1.0" } }, "node_modules/@libp2p/peer-record": { - "version": "8.0.8", - "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-8.0.8.tgz", - "integrity": "sha512-wYqVN13ZaC/cVdFaTR3+Plzv4lf/BNVSzZK11cSSo3MqinOWqFs38plw9OC1Mfne2x9HYHLGwhj2zE802itD0A==", - "dependencies": { - "@libp2p/crypto": "^5.0.5", - "@libp2p/interface": "^2.1.3", - "@libp2p/peer-id": "^5.0.5", - "@libp2p/utils": "^6.1.1", + "version": "8.0.10", + "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-8.0.10.tgz", + "integrity": "sha512-k5A5YFhx7xGgFjiFWp0j8Cbw5kUYLJoBY9I3YTIHrieusLUUkMtUkYeuWeagNL1JYcXr06gguoIaYBRNCMQAow==", + "dependencies": { + "@libp2p/crypto": "^5.0.6", + "@libp2p/interface": "^2.2.0", + "@libp2p/peer-id": "^5.0.7", + "@libp2p/utils": "^6.1.3", "@multiformats/multiaddr": "^12.2.3", "multiformats": "^13.2.2", "protons-runtime": "^5.4.0", @@ -3009,14 +3004,14 @@ } }, "node_modules/@libp2p/utils": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.1.1.tgz", - "integrity": "sha512-lpqNyyTx7ygIfXyU4eqDONW7c4oc8Gf1xjDahlOWcggqNhLWsC3/8zTmziKlY3PjTvzY0W37nDRPO1KiM1Sduw==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-6.1.3.tgz", + "integrity": "sha512-n1D6phOXGkqE3tuvmZwm5gaHKcGanlKwCWEBlrZqx9SSCyd5U5C58BcyQ8YH5/nb4kYMI7HyjomfQAVs2S2R9Q==", "dependencies": { "@chainsafe/is-ip": "^2.0.2", - "@libp2p/crypto": "^5.0.5", - "@libp2p/interface": "^2.1.3", - "@libp2p/logger": "^5.1.1", + "@libp2p/crypto": "^5.0.6", + "@libp2p/interface": "^2.2.0", + "@libp2p/logger": "^5.1.3", "@multiformats/multiaddr": "^12.2.3", "@sindresorhus/fnv1a": "^3.1.0", "@types/murmurhash3js-revisited": "^3.0.3", @@ -3430,48 +3425,22 @@ "optional": true }, "node_modules/@polkadot-api/merkleize-metadata": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@polkadot-api/merkleize-metadata/-/merkleize-metadata-1.1.7.tgz", - "integrity": "sha512-t8El8ZfkH5gSxC60U+ZHWBDzBlWsIsRZwSaVATjW1G22aXuA9N5tRBU6/g+uA/zDc34NNSFwFzXMH065/fceSw==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@polkadot-api/merkleize-metadata/-/merkleize-metadata-1.1.9.tgz", + "integrity": "sha512-TwFhbnHcnad/O5S8NnT9OcCX0CRAyJL9PilwV/sd8cEdS9LWNwlBxjTqUWWKhRrtlsSeuvi2ldYC+dgUYUaIOA==", "dependencies": { - "@polkadot-api/metadata-builders": "0.8.2", - "@polkadot-api/substrate-bindings": "0.9.2", + "@polkadot-api/metadata-builders": "0.9.1", + "@polkadot-api/substrate-bindings": "0.9.3", "@polkadot-api/utils": "0.1.2" } }, - "node_modules/@polkadot-api/merkleize-metadata/node_modules/@polkadot-api/metadata-builders": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.8.2.tgz", - "integrity": "sha512-+lasR2B0YXPlUJ7QNfO78MYCiXg/ANWWae7Qp53b9kEif5pe0pjxY/9KzdSu8FBA72s/FelQLn7lN/lhMC9zVg==", - "dependencies": { - "@polkadot-api/substrate-bindings": "0.9.2", - "@polkadot-api/utils": "0.1.2" - } - }, - "node_modules/@polkadot-api/merkleize-metadata/node_modules/@polkadot-api/substrate-bindings": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.9.2.tgz", - "integrity": "sha512-OzWVPoky/Da50V9jFOywRRs3+RZgl2WxiHG/NDi0ug/upEkH0W1bwepG0hMMhneYhoKm+JgUDhLrM67ZbFTStA==", - "dependencies": { - "@noble/hashes": "^1.4.0", - "@polkadot-api/utils": "0.1.2", - "@scure/base": "^1.1.7", - "scale-ts": "^1.6.0" - } - }, - "node_modules/@polkadot-api/merkleize-metadata/node_modules/@polkadot-api/utils": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@polkadot-api/utils/-/utils-0.1.2.tgz", - "integrity": "sha512-yhs5k2a8N1SBJcz7EthZoazzLQUkZxbf+0271Xzu42C5AEM9K9uFLbsB+ojzHEM72O5X8lPtSwGKNmS7WQyDyg==" - }, "node_modules/@polkadot-api/metadata-builders": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.3.2.tgz", - "integrity": "sha512-TKpfoT6vTb+513KDzMBTfCb/ORdgRnsS3TDFpOhAhZ08ikvK+hjHMt5plPiAX/OWkm1Wc9I3+K6W0hX5Ab7MVg==", - "optional": true, + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.9.1.tgz", + "integrity": "sha512-yZPm9KKn7QydbjMQMzhKHekDuQSdSZXYdCyqGt74HSNz9DdJSdpFNwHv0p+vmp+9QDlVsKK7nbUTjYxLZT4vCA==", "dependencies": { - "@polkadot-api/substrate-bindings": "0.6.0", - "@polkadot-api/utils": "0.1.0" + "@polkadot-api/substrate-bindings": "0.9.3", + "@polkadot-api/utils": "0.1.2" } }, "node_modules/@polkadot-api/observable-client": { @@ -3489,7 +3458,17 @@ "rxjs": ">=7.8.0" } }, - "node_modules/@polkadot-api/substrate-bindings": { + "node_modules/@polkadot-api/observable-client/node_modules/@polkadot-api/metadata-builders": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.3.2.tgz", + "integrity": "sha512-TKpfoT6vTb+513KDzMBTfCb/ORdgRnsS3TDFpOhAhZ08ikvK+hjHMt5plPiAX/OWkm1Wc9I3+K6W0hX5Ab7MVg==", + "optional": true, + "dependencies": { + "@polkadot-api/substrate-bindings": "0.6.0", + "@polkadot-api/utils": "0.1.0" + } + }, + "node_modules/@polkadot-api/observable-client/node_modules/@polkadot-api/substrate-bindings": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.6.0.tgz", "integrity": "sha512-lGuhE74NA1/PqdN7fKFdE5C1gNYX357j1tWzdlPXI0kQ7h3kN0zfxNOpPUN7dIrPcOFZ6C0tRRVrBylXkI6xPw==", @@ -3501,6 +3480,23 @@ "scale-ts": "^1.6.0" } }, + "node_modules/@polkadot-api/observable-client/node_modules/@polkadot-api/utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/utils/-/utils-0.1.0.tgz", + "integrity": "sha512-MXzWZeuGxKizPx2Xf/47wx9sr/uxKw39bVJUptTJdsaQn/TGq+z310mHzf1RCGvC1diHM8f593KrnDgc9oNbJA==", + "optional": true + }, + "node_modules/@polkadot-api/substrate-bindings": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.9.3.tgz", + "integrity": "sha512-ygaZo8+xssTdb6lj9mA8RTlanDfyd0iMex3aBFC1IzOSm08XUWdRpuSLRuerFCimLzKuz/oBOTKdqBFGb7ybUQ==", + "dependencies": { + "@noble/hashes": "^1.4.0", + "@polkadot-api/utils": "0.1.2", + "@scure/base": "^1.1.7", + "scale-ts": "^1.6.1" + } + }, "node_modules/@polkadot-api/substrate-client": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-client/-/substrate-client-0.1.4.tgz", @@ -3511,31 +3507,36 @@ "@polkadot-api/utils": "0.1.0" } }, - "node_modules/@polkadot-api/utils": { + "node_modules/@polkadot-api/substrate-client/node_modules/@polkadot-api/utils": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@polkadot-api/utils/-/utils-0.1.0.tgz", "integrity": "sha512-MXzWZeuGxKizPx2Xf/47wx9sr/uxKw39bVJUptTJdsaQn/TGq+z310mHzf1RCGvC1diHM8f593KrnDgc9oNbJA==", "optional": true }, + "node_modules/@polkadot-api/utils": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@polkadot-api/utils/-/utils-0.1.2.tgz", + "integrity": "sha512-yhs5k2a8N1SBJcz7EthZoazzLQUkZxbf+0271Xzu42C5AEM9K9uFLbsB+ojzHEM72O5X8lPtSwGKNmS7WQyDyg==" + }, "node_modules/@polkadot/api": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-14.1.1.tgz", - "integrity": "sha512-3uSJUdaohKtAvj9fjqyOkYs0PthWBdWtkko2TcYGRxj9BikbZMmx+agdkty8VrOxvn3pPoTRKe/jMt2Txn2MaA==", - "dependencies": { - "@polkadot/api-augment": "14.1.1", - "@polkadot/api-base": "14.1.1", - "@polkadot/api-derive": "14.1.1", - "@polkadot/keyring": "^13.2.1", - "@polkadot/rpc-augment": "14.1.1", - "@polkadot/rpc-core": "14.1.1", - "@polkadot/rpc-provider": "14.1.1", - "@polkadot/types": "14.1.1", - "@polkadot/types-augment": "14.1.1", - "@polkadot/types-codec": "14.1.1", - "@polkadot/types-create": "14.1.1", - "@polkadot/types-known": "14.1.1", - "@polkadot/util": "^13.2.1", - "@polkadot/util-crypto": "^13.2.1", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-14.2.1.tgz", + "integrity": "sha512-vYYOvCbGzKWq2auv7e3r71lp0N9hLi4Wfvdb+PjDlUWy4CBydDPgNRL7eC/pJyY4/8zs5dAWVmmu5SQsdpM93g==", + "dependencies": { + "@polkadot/api-augment": "14.2.1", + "@polkadot/api-base": "14.2.1", + "@polkadot/api-derive": "14.2.1", + "@polkadot/keyring": "^13.2.2", + "@polkadot/rpc-augment": "14.2.1", + "@polkadot/rpc-core": "14.2.1", + "@polkadot/rpc-provider": "14.2.1", + "@polkadot/types": "14.2.1", + "@polkadot/types-augment": "14.2.1", + "@polkadot/types-codec": "14.2.1", + "@polkadot/types-create": "14.2.1", + "@polkadot/types-known": "14.2.1", + "@polkadot/util": "^13.2.2", + "@polkadot/util-crypto": "^13.2.2", "eventemitter3": "^5.0.1", "rxjs": "^7.8.1", "tslib": "^2.8.0" @@ -3545,16 +3546,16 @@ } }, "node_modules/@polkadot/api-augment": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-14.1.1.tgz", - "integrity": "sha512-n6aexVgdlHfh3d12qFYpooxzS9yjKq/oxLNXKvhpV3CMg36Hlq4ULDdtI6L3sB8I3nwdBEWaXyBvbpKvPZGUxQ==", - "dependencies": { - "@polkadot/api-base": "14.1.1", - "@polkadot/rpc-augment": "14.1.1", - "@polkadot/types": "14.1.1", - "@polkadot/types-augment": "14.1.1", - "@polkadot/types-codec": "14.1.1", - "@polkadot/util": "^13.2.1", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-14.2.1.tgz", + "integrity": "sha512-Vi1iuGliJe3rrH2wyfZq/FIYncUqX6ue15Zx0gpj20kRW9hNEU3ywr3NRrr3UXGZRozJZ/C4s0FNneNYvu/KCQ==", + "dependencies": { + "@polkadot/api-base": "14.2.1", + "@polkadot/rpc-augment": "14.2.1", + "@polkadot/types": "14.2.1", + "@polkadot/types-augment": "14.2.1", + "@polkadot/types-codec": "14.2.1", + "@polkadot/util": "^13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3562,13 +3563,13 @@ } }, "node_modules/@polkadot/api-base": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-14.1.1.tgz", - "integrity": "sha512-gMj0uIlAv6RkRMzmhl61KU1/Pcadrarxn0lBdDTcVua3KEWLuncI+VbiN3cEd/aW6QUTgcDFpppm8nfwD9eVzQ==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-14.2.1.tgz", + "integrity": "sha512-HofQlndP8OeO91iU+Ueg7DWo7fmzD5TJs/WHBS2XwSZfZ6rzYnfBxpFM8A51oY+HxXHc5EgvjdhqY2aO2OjZ2w==", "dependencies": { - "@polkadot/rpc-core": "14.1.1", - "@polkadot/types": "14.1.1", - "@polkadot/util": "^13.2.1", + "@polkadot/rpc-core": "14.2.1", + "@polkadot/types": "14.2.1", + "@polkadot/util": "^13.2.2", "rxjs": "^7.8.1", "tslib": "^2.8.0" }, @@ -3577,18 +3578,18 @@ } }, "node_modules/@polkadot/api-derive": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-14.1.1.tgz", - "integrity": "sha512-ZElYAr/euw2fR7RmGkgJgF88IK9iz3rqgesmdLtgQ2a85MEiR4UrVvhNKSjMr9PSn7EUM1mUixZhGp3jvuqrsA==", - "dependencies": { - "@polkadot/api": "14.1.1", - "@polkadot/api-augment": "14.1.1", - "@polkadot/api-base": "14.1.1", - "@polkadot/rpc-core": "14.1.1", - "@polkadot/types": "14.1.1", - "@polkadot/types-codec": "14.1.1", - "@polkadot/util": "^13.2.1", - "@polkadot/util-crypto": "^13.2.1", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-14.2.1.tgz", + "integrity": "sha512-2JqFcu+qRHpeveu3f/LTxhWw0MNt4M+aNeyttyo5kRRSAL/pmU75E43b4tXq7UZmlmKZZtga8b0dFHoiMTuuwA==", + "dependencies": { + "@polkadot/api": "14.2.1", + "@polkadot/api-augment": "14.2.1", + "@polkadot/api-base": "14.2.1", + "@polkadot/rpc-core": "14.2.1", + "@polkadot/types": "14.2.1", + "@polkadot/types-codec": "14.2.1", + "@polkadot/util": "^13.2.2", + "@polkadot/util-crypto": "^13.2.2", "rxjs": "^7.8.1", "tslib": "^2.8.0" }, @@ -3596,29 +3597,66 @@ "node": ">=18" } }, + "node_modules/@polkadot/api/node_modules/@polkadot/rpc-provider": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-14.2.1.tgz", + "integrity": "sha512-5ty21djvymqgxIpqKya9ekLHbiIRISIq9pl/GyVUSj2y3ditmXHF1UElmKfMCvi0b6nmOJlkxJIb7ZDyfjkBag==", + "dependencies": { + "@polkadot/keyring": "^13.2.2", + "@polkadot/types": "14.2.1", + "@polkadot/types-support": "14.2.1", + "@polkadot/util": "^13.2.2", + "@polkadot/util-crypto": "^13.2.2", + "@polkadot/x-fetch": "^13.2.2", + "@polkadot/x-global": "^13.2.2", + "@polkadot/x-ws": "^13.2.2", + "eventemitter3": "^5.0.1", + "mock-socket": "^9.3.1", + "nock": "^13.5.5", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@substrate/connect": "0.8.11" + } + }, + "node_modules/@polkadot/api/node_modules/@polkadot/types-support": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-14.2.1.tgz", + "integrity": "sha512-pAaAGDEBUnDiC15AjVc1aULk+vfCma2OlVzU6usOLee1OKkwDuk74Bnyo9jshKVYuTjujLrmp3zmzmuU1NjbeQ==", + "dependencies": { + "@polkadot/util": "^13.2.2", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@polkadot/keyring": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-13.2.1.tgz", - "integrity": "sha512-tnNLHaOuwoVC3n2tUQe0iSI4Jyxzqm7CPnf/sWMAAFImaVnC7PhiZFvqs2QGpha4ks9Lv722Vkjh7iIKUpEsUA==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-13.2.2.tgz", + "integrity": "sha512-h4bPU92CALAAC+QOp6+zttuhI5H0GKOUzj1qwnmoPVoWxh21FoekLAXO1YJlsKxciTDdK5OhjdNPOIqcF0GCXA==", "dependencies": { - "@polkadot/util": "13.2.1", - "@polkadot/util-crypto": "13.2.1", + "@polkadot/util": "13.2.2", + "@polkadot/util-crypto": "13.2.2", "tslib": "^2.8.0" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "13.2.1", - "@polkadot/util-crypto": "13.2.1" + "@polkadot/util": "13.2.2", + "@polkadot/util-crypto": "13.2.2" } }, "node_modules/@polkadot/networks": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-13.2.1.tgz", - "integrity": "sha512-T04RTY+w8X+JB0MNAIrSFr3WX/eIUrCyYTsuf6jpg89efubpWYvfchiLTDcQrA2KfdqTBl3bQ1wgKqmWMMKNzg==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-13.2.2.tgz", + "integrity": "sha512-di3dLB9BcLQ9ARcDe/nizl7jZZnQbQlxB8kXtAXqTIVFtshtKT+zYcji6dTX7xX9/O9tZB7qnrvuIuI0MkwJ5A==", "dependencies": { - "@polkadot/util": "13.2.1", + "@polkadot/util": "13.2.2", "@substrate/ss58-registry": "^1.51.0", "tslib": "^2.8.0" }, @@ -3627,14 +3665,14 @@ } }, "node_modules/@polkadot/rpc-augment": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-14.1.1.tgz", - "integrity": "sha512-jeDYDepe6IOzgUFD+vLEuLrWGqw/dJIcxb8uf/YpnsvzA8kbPZx3BcIhboIpI8HpdKdn6f5mflSTVgDUpUPmNg==", - "dependencies": { - "@polkadot/rpc-core": "14.1.1", - "@polkadot/types": "14.1.1", - "@polkadot/types-codec": "14.1.1", - "@polkadot/util": "^13.2.1", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-14.2.1.tgz", + "integrity": "sha512-ouRRq7suXiPBECImMf+pM7U/k4541uJxuYreFhnplE+egaikKieY720hKiRxesLALr6fjgBr3DRsUsk8yP3YtA==", + "dependencies": { + "@polkadot/rpc-core": "14.2.1", + "@polkadot/types": "14.2.1", + "@polkadot/types-codec": "14.2.1", + "@polkadot/util": "^13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3642,14 +3680,14 @@ } }, "node_modules/@polkadot/rpc-core": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-14.1.1.tgz", - "integrity": "sha512-rfV1ArJcAZQ3lzAM9P+yIaXN720yJysNGy14FxupLsFsvzowEnEPs4khS2HgnX6j1RqkElw6va/ZVhOsLPhy9w==", - "dependencies": { - "@polkadot/rpc-augment": "14.1.1", - "@polkadot/rpc-provider": "14.1.1", - "@polkadot/types": "14.1.1", - "@polkadot/util": "^13.2.1", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-14.2.1.tgz", + "integrity": "sha512-jGOoRKdY6XbMY4Z7N9lKI3YmLfZWjT+DcXo+kRfSr3YgORDUXNwHy9v5doJCkPoY3OIIDmhlK5OaIEXeEjvrcQ==", + "dependencies": { + "@polkadot/rpc-augment": "14.2.1", + "@polkadot/rpc-provider": "14.2.1", + "@polkadot/types": "14.2.1", + "@polkadot/util": "^13.2.2", "rxjs": "^7.8.1", "tslib": "^2.8.0" }, @@ -3657,19 +3695,56 @@ "node": ">=18" } }, + "node_modules/@polkadot/rpc-core/node_modules/@polkadot/rpc-provider": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-14.2.1.tgz", + "integrity": "sha512-5ty21djvymqgxIpqKya9ekLHbiIRISIq9pl/GyVUSj2y3ditmXHF1UElmKfMCvi0b6nmOJlkxJIb7ZDyfjkBag==", + "dependencies": { + "@polkadot/keyring": "^13.2.2", + "@polkadot/types": "14.2.1", + "@polkadot/types-support": "14.2.1", + "@polkadot/util": "^13.2.2", + "@polkadot/util-crypto": "^13.2.2", + "@polkadot/x-fetch": "^13.2.2", + "@polkadot/x-global": "^13.2.2", + "@polkadot/x-ws": "^13.2.2", + "eventemitter3": "^5.0.1", + "mock-socket": "^9.3.1", + "nock": "^13.5.5", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@substrate/connect": "0.8.11" + } + }, + "node_modules/@polkadot/rpc-core/node_modules/@polkadot/types-support": { + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-14.2.1.tgz", + "integrity": "sha512-pAaAGDEBUnDiC15AjVc1aULk+vfCma2OlVzU6usOLee1OKkwDuk74Bnyo9jshKVYuTjujLrmp3zmzmuU1NjbeQ==", + "dependencies": { + "@polkadot/util": "^13.2.2", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@polkadot/rpc-provider": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-14.1.1.tgz", - "integrity": "sha512-BY0H1CC7M360uHXU2IfFdgFmcdjmIz6NxPmXRhrT3QGFmJSHuFevjTbIFlPG7YBK5ivochLrcISelRr7HKXYOg==", - "dependencies": { - "@polkadot/keyring": "^13.2.1", - "@polkadot/types": "14.1.1", - "@polkadot/types-support": "14.1.1", - "@polkadot/util": "^13.2.1", - "@polkadot/util-crypto": "^13.2.1", - "@polkadot/x-fetch": "^13.2.1", - "@polkadot/x-global": "^13.2.1", - "@polkadot/x-ws": "^13.2.1", + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-14.2.2.tgz", + "integrity": "sha512-Vx7mrN3NyE5fzvw+cm0BjtH6MRdrc9PeqFiJbbpvvPfK4Vi416RMNgYFw9f611bfQTYjr8oO9CTQI8s7knqN3A==", + "dependencies": { + "@polkadot/keyring": "^13.2.2", + "@polkadot/types": "14.2.2", + "@polkadot/types-support": "14.2.2", + "@polkadot/util": "^13.2.2", + "@polkadot/util-crypto": "^13.2.2", + "@polkadot/x-fetch": "^13.2.2", + "@polkadot/x-global": "^13.2.2", + "@polkadot/x-ws": "^13.2.2", "eventemitter3": "^5.0.1", "mock-socket": "^9.3.1", "nock": "^13.5.5", @@ -3682,17 +3757,75 @@ "@substrate/connect": "0.8.11" } }, + "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/types": { + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-14.2.2.tgz", + "integrity": "sha512-iu1UEYdr2BfZr/URizopupvIt4Kmr35As1b2pPmxCqMjyIMdAklRgz6s+Z08GH8RGcA0CPHaA8YJRBiwfb/8dg==", + "dependencies": { + "@polkadot/keyring": "^13.2.2", + "@polkadot/types-augment": "14.2.2", + "@polkadot/types-codec": "14.2.2", + "@polkadot/types-create": "14.2.2", + "@polkadot/util": "^13.2.2", + "@polkadot/util-crypto": "^13.2.2", + "rxjs": "^7.8.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/types-augment": { + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-14.2.2.tgz", + "integrity": "sha512-FFHgP4TAhJ6XL25FFjT1S2Ai2wfnoGL2VMhYS8TS5XFxH3+1c0DeA4DgPmewJtbDxKwl232UUKzrpJ8jUpCAJg==", + "dependencies": { + "@polkadot/types": "14.2.2", + "@polkadot/types-codec": "14.2.2", + "@polkadot/util": "^13.2.2", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/types-codec": { + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-14.2.2.tgz", + "integrity": "sha512-ri1U50VQx2FvBK8iJr5kwA8lIg1zlv7OI0x7th35kHtfRr9icPOp2x1jNsOamfObs7OekTsl7+5Uq33Tl0JR+g==", + "dependencies": { + "@polkadot/util": "^13.2.2", + "@polkadot/x-bigint": "^13.2.2", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/types-create": { + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-14.2.2.tgz", + "integrity": "sha512-WN1o/zVhVHHjutaivrpd33bc9EllpDFYVtRMZPOeL7GUy4MjpQGcmT0Vce0lARIKKla8RACQWLIEmkbX3UYxrw==", + "dependencies": { + "@polkadot/types-codec": "14.2.2", + "@polkadot/util": "^13.2.2", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@polkadot/types": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-14.1.1.tgz", - "integrity": "sha512-bT1wxu2wZsKR8Ih1PHu4SqptOF+MQbh21e+NJVZkIsrjQz1DvKkdcW4G/s0i0vX/QIjnXTJFC84vMzr5cxJm8Q==", - "dependencies": { - "@polkadot/keyring": "^13.2.1", - "@polkadot/types-augment": "14.1.1", - "@polkadot/types-codec": "14.1.1", - "@polkadot/types-create": "14.1.1", - "@polkadot/util": "^13.2.1", - "@polkadot/util-crypto": "^13.2.1", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-14.2.1.tgz", + "integrity": "sha512-C4mf3257vefKDCF5dPtw3WPztE/cTgHjI/fmimwxjGakX3u1mni19wqvBXKg69tuzJ31YMagqMkD2YFZ/zGSPg==", + "dependencies": { + "@polkadot/keyring": "^13.2.2", + "@polkadot/types-augment": "14.2.1", + "@polkadot/types-codec": "14.2.1", + "@polkadot/types-create": "14.2.1", + "@polkadot/util": "^13.2.2", + "@polkadot/util-crypto": "^13.2.2", "rxjs": "^7.8.1", "tslib": "^2.8.0" }, @@ -3701,13 +3834,13 @@ } }, "node_modules/@polkadot/types-augment": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-14.1.1.tgz", - "integrity": "sha512-A73JCwmg5ZuYVHw1k7Lxx4MjjRwQd6Yw/VaRIPqjk3iyG5r9RyFJgsJ7xRafDlKFG0AJ5c6ixvlaHOnBrEAzpQ==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-14.2.1.tgz", + "integrity": "sha512-dAsiRRPr7ClX/zz7YqpIr4dB5fOR8UzXnxz8d4Tyrcxpf9CAivIIJ8Mxl5M/71CTF/LSlCbSvsmvBG0mAX7HLg==", "dependencies": { - "@polkadot/types": "14.1.1", - "@polkadot/types-codec": "14.1.1", - "@polkadot/util": "^13.2.1", + "@polkadot/types": "14.2.1", + "@polkadot/types-codec": "14.2.1", + "@polkadot/util": "^13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3715,12 +3848,12 @@ } }, "node_modules/@polkadot/types-codec": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-14.1.1.tgz", - "integrity": "sha512-O6UyTjEAeZMf/uthF3NjCy4tiAeWjj4tfTEWTx2Z65fNTTbXx1Mq5YBBOWsvzBXGBFK35C8buYa4l8cgQS9MoA==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-14.2.1.tgz", + "integrity": "sha512-NKI9hiW2tE3AcEKL1eGd6fyNa2QbOvlH+mEq1vTyT3/fm65mrtIqOuZASWa3kXMQmOHCs2/mMGh7p1Kj8glalQ==", "dependencies": { - "@polkadot/util": "^13.2.1", - "@polkadot/x-bigint": "^13.2.1", + "@polkadot/util": "^13.2.2", + "@polkadot/x-bigint": "^13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3728,12 +3861,12 @@ } }, "node_modules/@polkadot/types-create": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-14.1.1.tgz", - "integrity": "sha512-t4gr5NKU8zZetnDvoRnlioEZlkYybBSql+Ep3mQUiJosF5w/SCN6EKV0GPqs0fB1ovqhDQSnwe2xoRjHsiHObA==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-14.2.1.tgz", + "integrity": "sha512-AhcyVR6eoc+br76QbqQ3LVwFuOrdZH/A9hlpMPI8MvIW46wZ5bPcDoqKLZugeH6wOKKVzbqw8z9tZ1KWgUSdVg==", "dependencies": { - "@polkadot/types-codec": "14.1.1", - "@polkadot/util": "^13.2.1", + "@polkadot/types-codec": "14.2.1", + "@polkadot/util": "^13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3741,15 +3874,15 @@ } }, "node_modules/@polkadot/types-known": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-14.1.1.tgz", - "integrity": "sha512-TvyqTsm1Wxw+tjN8UsB04+vZv5znZE5ETGunHLHnvv4WF/lkz4WpkRc/9iqduM5O/iOZh8mEb7n/uyz8LL4brA==", - "dependencies": { - "@polkadot/networks": "^13.2.1", - "@polkadot/types": "14.1.1", - "@polkadot/types-codec": "14.1.1", - "@polkadot/types-create": "14.1.1", - "@polkadot/util": "^13.2.1", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-14.2.1.tgz", + "integrity": "sha512-Lp8km3+0NKBR3x9covI84Mz3dXFAmIkohzJhcGjpjwcOKH0W4GSQBTDcsYfTH+UAY1mF7hvgXCtvGwbyLm2kOQ==", + "dependencies": { + "@polkadot/networks": "^13.2.2", + "@polkadot/types": "14.2.1", + "@polkadot/types-codec": "14.2.1", + "@polkadot/types-create": "14.2.1", + "@polkadot/util": "^13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3757,11 +3890,11 @@ } }, "node_modules/@polkadot/types-support": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-14.1.1.tgz", - "integrity": "sha512-DJgJ/2n3eWFlgH1K/U7G4NSbgdsx4Lb1fK4yVlZ9t81lJWWiAeb/FodHJb8jlQ6Jezx5S71fRripXfg+FdyCDA==", + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-14.2.2.tgz", + "integrity": "sha512-K0k8tzmB0qsNQ7kRQSWqKTv0W/HNzs5P3vc9VwAzzjJeJFzrLjafSrE+WftYm8Vqvc4XgAQ94vwMJNhZ40TuHQ==", "dependencies": { - "@polkadot/util": "^13.2.1", + "@polkadot/util": "^13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3769,14 +3902,14 @@ } }, "node_modules/@polkadot/util": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-13.2.1.tgz", - "integrity": "sha512-+zCyQQeW4llWD5yhvPAawekRpdAU3LZPLD0j3v8nJjsG9cAyiYGZjsVxDFPpD0yixS1Hl70937bPR46761NG9g==", - "dependencies": { - "@polkadot/x-bigint": "13.2.1", - "@polkadot/x-global": "13.2.1", - "@polkadot/x-textdecoder": "13.2.1", - "@polkadot/x-textencoder": "13.2.1", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-13.2.2.tgz", + "integrity": "sha512-zhsGtR0J2a0ODesJNbCYqEXOL2rhPrmv1F6OB2JMdho7iOrkONck3PZaoT/Y0JF7IlHjGV8K6yrw7k9KUtFrEA==", + "dependencies": { + "@polkadot/x-bigint": "13.2.2", + "@polkadot/x-global": "13.2.2", + "@polkadot/x-textdecoder": "13.2.2", + "@polkadot/x-textencoder": "13.2.2", "@types/bn.js": "^5.1.6", "bn.js": "^5.2.1", "tslib": "^2.8.0" @@ -3786,18 +3919,18 @@ } }, "node_modules/@polkadot/util-crypto": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-13.2.1.tgz", - "integrity": "sha512-IalVWtRfsLEkF0fQvEfbnYwrQWUw2AHSYgJINhrZvdoC+Vy6oetvO0ZAhbfUp1c/HOaql0gex4WVrfw7gcBKjQ==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-13.2.2.tgz", + "integrity": "sha512-C4vl07XC43vE6egd9LmSe0uOc7hAvBq6CIoILk5ZB95ABNBQSHOrS1pHugW4rJgVUiZgv8sdl+twmgisuSsSfg==", "dependencies": { "@noble/curves": "^1.3.0", "@noble/hashes": "^1.3.3", - "@polkadot/networks": "13.2.1", - "@polkadot/util": "13.2.1", + "@polkadot/networks": "13.2.2", + "@polkadot/util": "13.2.2", "@polkadot/wasm-crypto": "^7.4.1", "@polkadot/wasm-util": "^7.4.1", - "@polkadot/x-bigint": "13.2.1", - "@polkadot/x-randomvalues": "13.2.1", + "@polkadot/x-bigint": "13.2.2", + "@polkadot/x-randomvalues": "13.2.2", "@scure/base": "^1.1.7", "tslib": "^2.8.0" }, @@ -3805,7 +3938,7 @@ "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "13.2.1" + "@polkadot/util": "13.2.2" } }, "node_modules/@polkadot/wasm-bridge": { @@ -3907,11 +4040,11 @@ } }, "node_modules/@polkadot/x-bigint": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-13.2.1.tgz", - "integrity": "sha512-NYfH0fKfZFkjE5wOiLmfj+oJFyzSHLJrJt5DmzWwvbhw3dT4Qz2UgBL0i/Ei6REkpOGCXX2DmNbbZBr6sn4f1Q==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-13.2.2.tgz", + "integrity": "sha512-9ENDfG2wYqABWhQYYrbjJK0aPBvCqVPiFhBiKgIg6OTSJKJToa4Di9R8NxelF8eJTtz7DIvgf6gZY/jnKfbtWw==", "dependencies": { - "@polkadot/x-global": "13.2.1", + "@polkadot/x-global": "13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3919,11 +4052,11 @@ } }, "node_modules/@polkadot/x-fetch": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-13.2.1.tgz", - "integrity": "sha512-y/JgDRyH4JZN0QzI4V3Hf7Bah2FOOTw7sbmlo/o/3Tt0zjLnCbSvu7Lf1+fKBDksQWpElUBg3nVJrw4HAIiaRQ==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-13.2.2.tgz", + "integrity": "sha512-aDhd2kdx3JWvZSU4Ge966C0111CH8pCsDX7+9IsMGaZhjLF1NEo2xDjs+EwfUbSvNk68A4UVeJsXjG+IVor/ug==", "dependencies": { - "@polkadot/x-global": "13.2.1", + "@polkadot/x-global": "13.2.2", "node-fetch": "^3.3.2", "tslib": "^2.8.0" }, @@ -3932,9 +4065,9 @@ } }, "node_modules/@polkadot/x-global": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-13.2.1.tgz", - "integrity": "sha512-Q9PZY+Xw9ffBYcJjwMCQfGgFi5QNv4GJ1ZqIuJMQBAcM21fn8vuFMfGC24R1pAAJAaBMPkQ9xh8R2cpu9SIjRg==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-13.2.2.tgz", + "integrity": "sha512-a+iKD7JXxDRtYVo0bp1+HHlaem6MkUHU2yE0cx2e97p9x+IKyNEY58D0L5P66kszLvhFw+t3Jq+qHIj0+2YxkQ==", "dependencies": { "tslib": "^2.8.0" }, @@ -3943,27 +4076,27 @@ } }, "node_modules/@polkadot/x-randomvalues": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-13.2.1.tgz", - "integrity": "sha512-LZBlsmz6r+AKHpqTGAjWecn5aNYGnfgLxxu0JZJo1aOQdVrXy7sDl1M5x1U+ZFeShVeSAU54rrWCcHB+zsGHSA==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-13.2.2.tgz", + "integrity": "sha512-1UNImkS5PAaGHeIl2DlMjgt2iN7nlclzwrYhmxd0e9Z11RQqavGqi1a02HGREgnUu+wJ7eHmPMVe6K96+cL+aQ==", "dependencies": { - "@polkadot/x-global": "13.2.1", + "@polkadot/x-global": "13.2.2", "tslib": "^2.8.0" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "13.2.1", + "@polkadot/util": "13.2.2", "@polkadot/wasm-util": "*" } }, "node_modules/@polkadot/x-textdecoder": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-13.2.1.tgz", - "integrity": "sha512-cyKv5T48goBEMsb1lnKrXPpAPXkpWwAa+Ob0w2eEzsjBPzWEeIPMKFuE4VpPRoZ/Sn6v3hwz98WS8ueCO5MXyQ==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-13.2.2.tgz", + "integrity": "sha512-elpIrgdq22yyvt4fzxwb2IRJEpswPVwizzauRipVy3uUmI/lC2f7D7u9jrC554Xy8UrrAPExX1sWJCxZA8DZ/g==", "dependencies": { - "@polkadot/x-global": "13.2.1", + "@polkadot/x-global": "13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3971,11 +4104,11 @@ } }, "node_modules/@polkadot/x-textencoder": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-13.2.1.tgz", - "integrity": "sha512-tugNLn/9UbA1n64mMWliWI1j5kAnnNIHgJ8khbMKyrHS5K+m8BP/avUrlg3u5ukM1RB1cCoJB9uWcT4Sovf65Q==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-13.2.2.tgz", + "integrity": "sha512-nxlNvK5h0KPCaAE/cx92e8JCPAlmFGbuXC9l03C1Ei1wAnOcWuJWRIk2qOkCEYkpT+G0jITPN4dgk634+pBQSw==", "dependencies": { - "@polkadot/x-global": "13.2.1", + "@polkadot/x-global": "13.2.2", "tslib": "^2.8.0" }, "engines": { @@ -3983,11 +4116,11 @@ } }, "node_modules/@polkadot/x-ws": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-13.2.1.tgz", - "integrity": "sha512-bLw4AL1UlzhveOPj5p3PPbDlrq+B7QbuNQ7F4UBVtEkaZZKJzhviE0mYGrObaguv1ib2tIIrYc7FNqmH6KpRzQ==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-13.2.2.tgz", + "integrity": "sha512-WEygcHPB55cKLiNoejJ0Lq3Z1fb4hUO3FmYTXdpHgk0xIOfYDrr7rTlI2cZ4Nb32MofeehN/ZStmEW5Edib6TQ==", "dependencies": { - "@polkadot/x-global": "13.2.1", + "@polkadot/x-global": "13.2.2", "tslib": "^2.8.0", "ws": "^8.18.0" }, @@ -5120,9 +5253,9 @@ } }, "node_modules/@scure/base": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.8.tgz", - "integrity": "sha512-6CyAclxj3Nb0XT7GHK6K4zK6k2xJm6E4Ft0Ohjt4WgegiFUHEtFb2CGzmPmGBwoIhrLsqNLYfLr04Y1GePrzZg==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", "funding": { "url": "https://paulmillr.com/funding/" } @@ -5221,15 +5354,15 @@ } }, "node_modules/@substrate/connect-extension-protocol": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.1.0.tgz", - "integrity": "sha512-Wz5Cbn6S6P4vWfHyrsnPW7g15IAViMaXCk+jYkq4nNEMmzPtTKIEbtxrdDMBKrouOFtYKKp0znx5mh9KTCNqlA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.2.0.tgz", + "integrity": "sha512-8b5bN/jo6qD4vcnoWr3T+Nn2u1XLRkJTsEt8b9iGvPPZ1cFcPCVQVpn3lP3U3WqbuSLiVkh0CjX5TW+aCUAi3g==", "optional": true }, "node_modules/@substrate/connect-known-chains": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@substrate/connect-known-chains/-/connect-known-chains-1.4.0.tgz", - "integrity": "sha512-p/mxn1GobtxJ+7xbIkUH4+/njH1neRHHKTcSGHNOC78Cf6Ch1Xzp082+nMjOBDLQLmraK5PF74AKV3WXHGuALw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@substrate/connect-known-chains/-/connect-known-chains-1.6.0.tgz", + "integrity": "sha512-ImPIaaQjSs07qI+gfP6sV/HnupexqgPnyicsPax3Pc6mqDp2HUNMDVdaoWjR84yPbgN8+un/P4KOEb5g4wqHSg==", "optional": true }, "node_modules/@substrate/light-client-extension-helpers": { @@ -5399,16 +5532,16 @@ "peer": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.10.0.tgz", - "integrity": "sha512-phuB3hoP7FFKbRXxjl+DRlQDuJqhpOnm5MmtROXyWi3uS/Xg2ZXqiQfcG2BJHiN4QKyzdOJi3NEn/qTnjUlkmQ==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.12.2.tgz", + "integrity": "sha512-gQxbxM8mcxBwaEmWdtLCIGLfixBMHhQjBqR8sVWNTPpcj45WlYL2IObS/DNMLH1DBP0n8qz+aiiLTGfopPEebw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.10.0", - "@typescript-eslint/type-utils": "8.10.0", - "@typescript-eslint/utils": "8.10.0", - "@typescript-eslint/visitor-keys": "8.10.0", + "@typescript-eslint/scope-manager": "8.12.2", + "@typescript-eslint/type-utils": "8.12.2", + "@typescript-eslint/utils": "8.12.2", + "@typescript-eslint/visitor-keys": "8.12.2", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -5432,15 +5565,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.10.0.tgz", - "integrity": "sha512-E24l90SxuJhytWJ0pTQydFT46Nk0Z+bsLKo/L8rtQSL93rQ6byd1V/QbDpHUTdLPOMsBCcYXZweADNCfOCmOAg==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.12.2.tgz", + "integrity": "sha512-MrvlXNfGPLH3Z+r7Tk+Z5moZAc0dzdVjTgUgwsdGweH7lydysQsnSww3nAmsq8blFuRD5VRlAr9YdEFw3e6PBw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.10.0", - "@typescript-eslint/types": "8.10.0", - "@typescript-eslint/typescript-estree": "8.10.0", - "@typescript-eslint/visitor-keys": "8.10.0", + "@typescript-eslint/scope-manager": "8.12.2", + "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/typescript-estree": "8.12.2", + "@typescript-eslint/visitor-keys": "8.12.2", "debug": "^4.3.4" }, "engines": { @@ -5460,13 +5593,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.10.0.tgz", - "integrity": "sha512-AgCaEjhfql9MDKjMUxWvH7HjLeBqMCBfIaBbzzIcBbQPZE7CPh1m6FF+L75NUMJFMLYhCywJXIDEMa3//1A0dw==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.12.2.tgz", + "integrity": "sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.10.0", - "@typescript-eslint/visitor-keys": "8.10.0" + "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/visitor-keys": "8.12.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5477,13 +5610,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.10.0.tgz", - "integrity": "sha512-PCpUOpyQSpxBn230yIcK+LeCQaXuxrgCm2Zk1S+PTIRJsEfU6nJ0TtwyH8pIwPK/vJoA+7TZtzyAJSGBz+s/dg==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.12.2.tgz", + "integrity": "sha512-bwuU4TAogPI+1q/IJSKuD4shBLc/d2vGcRT588q+jzayQyjVK2X6v/fbR4InY2U2sgf8MEvVCqEWUzYzgBNcGQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.10.0", - "@typescript-eslint/utils": "8.10.0", + "@typescript-eslint/typescript-estree": "8.12.2", + "@typescript-eslint/utils": "8.12.2", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -5501,9 +5634,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.10.0.tgz", - "integrity": "sha512-k/E48uzsfJCRRbGLapdZgrX52csmWJ2rcowwPvOZ8lwPUv3xW6CcFeJAXgx4uJm+Ge4+a4tFOkdYvSpxhRhg1w==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.12.2.tgz", + "integrity": "sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5514,13 +5647,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.10.0.tgz", - "integrity": "sha512-3OE0nlcOHaMvQ8Xu5gAfME3/tWVDpb/HxtpUZ1WeOAksZ/h/gwrBzCklaGzwZT97/lBbbxJ16dMA98JMEngW4w==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.12.2.tgz", + "integrity": "sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.10.0", - "@typescript-eslint/visitor-keys": "8.10.0", + "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/visitor-keys": "8.12.2", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -5557,15 +5690,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.10.0.tgz", - "integrity": "sha512-Oq4uZ7JFr9d1ZunE/QKy5egcDRXT/FrS2z/nlxzPua2VHFtmMvFNDvpq1m/hq0ra+T52aUezfcjGRIB7vNJF9w==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.12.2.tgz", + "integrity": "sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.10.0", - "@typescript-eslint/types": "8.10.0", - "@typescript-eslint/typescript-estree": "8.10.0" + "@typescript-eslint/scope-manager": "8.12.2", + "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/typescript-estree": "8.12.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5579,12 +5712,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.10.0.tgz", - "integrity": "sha512-k8nekgqwr7FadWk548Lfph6V3r9OVqjzAIVskE7orMZR23cGJjAOVazsZSJW+ElyjfTM4wx/1g88Mi70DDtG9A==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.12.2.tgz", + "integrity": "sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/types": "8.12.2", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -7595,20 +7728,20 @@ } }, "node_modules/helia": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/helia/-/helia-5.0.1.tgz", - "integrity": "sha512-C2SUzeEwhQeur13mQpPnklsrZemKEwS/n/3ApcG5ORYJmTni2Fjt2cRs+RzcrOdQf7pdtqBK6RWQR7GobV7OlA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/helia/-/helia-5.1.0.tgz", + "integrity": "sha512-FqL+vtBpB3FQVmc0vTAtfneL6oAcWSkJCG+NVgTPeQ88jm+hLZXXqjUGVgI8aF8Wc3533gEBF2c8Y8+QN6K90Q==", "dependencies": { "@chainsafe/libp2p-noise": "^16.0.0", "@chainsafe/libp2p-yamux": "^7.0.0", - "@helia/block-brokers": "^4.0.0", - "@helia/delegated-routing-v1-http-api-client": "^4.0.0", + "@helia/block-brokers": "^4.0.1", + "@helia/delegated-routing-v1-http-api-client": "^4.1.0", "@helia/interface": "^5.0.0", - "@helia/routers": "^2.0.0", - "@helia/utils": "^1.0.0", + "@helia/routers": "^2.1.0", + "@helia/utils": "^1.0.1", "@libp2p/autonat": "^2.0.0", "@libp2p/bootstrap": "^11.0.0", - "@libp2p/circuit-relay-v2": "^2.0.0", + "@libp2p/circuit-relay-v2": "^3.0.0", "@libp2p/crypto": "^5.0.0", "@libp2p/dcutr": "^2.0.0", "@libp2p/identify": "^3.0.0", @@ -9610,9 +9743,10 @@ "license": "MIT" }, "node_modules/mocha": { - "version": "10.7.3", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, - "license": "MIT", "dependencies": { "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", @@ -9779,9 +9913,9 @@ } }, "node_modules/multiformats": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.0.tgz", - "integrity": "sha512-CBiqvsufgmpo01VT5ze94O+uc+Pbf6f/sThlvWss0sBZmAOu6GQn5usrYV2sf2mr17FWYc0rO8c/CNe2T90QAA==" + "version": "13.3.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.3.1.tgz", + "integrity": "sha512-QxowxTNwJ3r5RMctoGA5p13w5RbRT2QDkoM+yFlqfLiioBp78nhDjnRLvmSBI9+KAqN4VdgOVWM9c0CHd86m3g==" }, "node_modules/murmurhash3js-revisited": { "version": "3.0.0", @@ -9790,6 +9924,23 @@ "node": ">=8.0.0" } }, + "node_modules/nanoid": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.8.tgz", + "integrity": "sha512-TcJPw+9RV9dibz1hHUzlLVy8N4X9TnwirAjrU08Juo6BNKggzVfP2ZJ/3ZUSq15Xl5i85i+Z89XBO90pB2PghQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, "node_modules/napi-build-utils": { "version": "1.0.2", "license": "MIT" @@ -9882,20 +10033,6 @@ "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", "peer": true }, - "node_modules/node-datachannel": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/node-datachannel/-/node-datachannel-0.12.0.tgz", - "integrity": "sha512-pZ9FsVZpHdUKqyWynuCc9IBLkZPJMpDzpNk4YNPCizbIXHYifpYeWqSF35REHGIWi9JMCf11QzapsyQGo/Y4Ig==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "node-domexception": "^2.0.1", - "prebuild-install": "^7.0.1" - }, - "engines": { - "node": ">=16.0.0" - } - }, "node_modules/node-dir": { "version": "0.1.17", "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", @@ -11195,9 +11332,9 @@ "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" }, "node_modules/scale-ts": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/scale-ts/-/scale-ts-1.6.0.tgz", - "integrity": "sha512-Ja5VCjNZR8TGKhUumy9clVVxcDpM+YFjAnkMuwQy68Hixio3VRRvWdE3g8T/yC+HXA0ZDQl2TGyUmtmbcVl40Q==" + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/scale-ts/-/scale-ts-1.6.1.tgz", + "integrity": "sha512-PBMc2AWc6wSEqJYBDPcyCLUj9/tMKnLX70jLOSndMtcUoLQucP/DM0vnQo1wJAYjTrQiq8iG9rD0q6wFzgjH7g==" }, "node_modules/scheduler": { "version": "0.24.0-canary-efb381bbf-20230505", @@ -11989,9 +12126,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.0.tgz", + "integrity": "sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==", "dev": true, "engines": { "node": ">=16" @@ -12006,9 +12143,9 @@ "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==" }, "node_modules/tsx": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.1.tgz", - "integrity": "sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz", + "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==", "dev": true, "dependencies": { "esbuild": "~0.23.0", @@ -12093,14 +12230,14 @@ } }, "node_modules/typescript-eslint": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.10.0.tgz", - "integrity": "sha512-YIu230PeN7z9zpu/EtqCIuRVHPs4iSlqW6TEvjbyDAE3MZsSl2RXBo+5ag+lbABCG8sFM1WVKEXhlQ8Ml8A3Fw==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.12.2.tgz", + "integrity": "sha512-UbuVUWSrHVR03q9CWx+JDHeO6B/Hr9p4U5lRH++5tq/EbFq1faYZe50ZSBePptgfIKLEti0aPQ3hFgnPVcd8ZQ==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.10.0", - "@typescript-eslint/parser": "8.10.0", - "@typescript-eslint/utils": "8.10.0" + "@typescript-eslint/eslint-plugin": "8.12.2", + "@typescript-eslint/parser": "8.12.2", + "@typescript-eslint/utils": "8.12.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/e2e/passkey/passkeyProxy.ecdsa.test.ts b/e2e/passkey/passkeyProxy.ecdsa.test.ts index ec70ddaf1b..e592d6008b 100644 --- a/e2e/passkey/passkeyProxy.ecdsa.test.ts +++ b/e2e/passkey/passkeyProxy.ecdsa.test.ts @@ -2,196 +2,91 @@ import '@frequency-chain/api-augment'; import assert from 'assert'; import { createAndFundKeypair, - DOLLARS, getBlockNumber, - getConvertedEthereumAccount, - getNextEpochBlock, getNonce } from '../scaffolding/helpers'; import { KeyringPair } from '@polkadot/keyring/types'; import {Extrinsic, ExtrinsicHelper} from '../scaffolding/extrinsicHelpers'; import { getFundingSource } from '../scaffolding/funding'; -import {hexToU8a, u8aToHex, u8aWrapBytes} from '@polkadot/util'; +import { u8aToHex, u8aWrapBytes} from '@polkadot/util'; import { createPassKeyAndSignAccount, createPassKeyCall, createPasskeyPayload } from '../scaffolding/P256'; -import {encodeAddress, ethereumEncode} from "@polkadot/util-crypto"; -import {secp256k1Expand} from "@polkadot/util-crypto/secp256k1/expand"; -import {HexString} from "@polkadot/util/types"; -import {SignerResult} from "@polkadot/types/types"; +import {getConvertedEthereumPublicKey, getEthereumStyleSigner, getUnifiedAddress} from "../scaffolding/ethereum"; +import {MultiSignature} from "@polkadot/types/interfaces"; const fundingSource = getFundingSource('passkey-proxy'); describe('Passkey Pallet Tests for ECDSA keys', function () { describe('proxy basic tests for ECDSA keys', function () { - let fundedKeys: KeyringPair; - let receiverKeys: KeyringPair; let fundedKeysSr25519: KeyringPair; - let fundedKeysEth: KeyringPair; + let fundedEthereumKeys: KeyringPair; + let receiverEthereumKeys: KeyringPair; before(async function () { - fundedKeys = await createAndFundKeypair(fundingSource, 300_000_000n, "test_fund", undefined, 'ecdsa'); - receiverKeys = await createAndFundKeypair(fundingSource, undefined, "test_receive", undefined, 'ecdsa'); fundedKeysSr25519 = await createAndFundKeypair(fundingSource, 300_000_000n); - // fundedKeysEth = await createAndFundKeypair(fundingSource, 300_000_000n, "test_eth", undefined, 'ethereum'); - console.log(`fundedKeys ${JSON.stringify(fundedKeys.toJson())} ${encodeAddress(fundedKeys.address)}`); - console.log(`receiverKeys ${JSON.stringify(receiverKeys.toJson())} ${encodeAddress(receiverKeys.address)} ${u8aToHex(receiverKeys.addressRaw)}`); - // console.log(`fundedKeysEth ${JSON.stringify(fundedKeysEth.toJson())}`); + fundedEthereumKeys = await createAndFundKeypair(fundingSource, 300_000_000n, undefined, undefined, 'ethereum'); + receiverEthereumKeys = await createAndFundKeypair(fundingSource, undefined, undefined, undefined, 'ethereum'); + console.log(`ethereumKeys ${JSON.stringify(fundedEthereumKeys.toJson())} ${u8aToHex(fundedEthereumKeys.publicKey)} ${u8aToHex(fundedEthereumKeys.addressRaw)} ${getUnifiedAddress(fundedEthereumKeys)}`); + console.log(`receiverEthereumKeys ${JSON.stringify(receiverEthereumKeys.toJson())} ${u8aToHex(receiverEthereumKeys.publicKey)} ${u8aToHex(receiverEthereumKeys.addressRaw)} ${getUnifiedAddress(receiverEthereumKeys)}`); }); - // it('should fail due to unsupported call', async function () { - // const accountPKey = fundedKeys.publicKey; - // const nonce = await getNonce(fundedKeys); - // - // const remarksCalls = ExtrinsicHelper.api.tx.system.remark('passkey-test'); - // const { passKeyPrivateKey, passKeyPublicKey, passkeySignature } = createPassKeyAndSignAccount(accountPKey); - // const accountSignature = fundedKeys.sign(u8aWrapBytes(passKeyPublicKey)); - // const passkeyCall = await createPassKeyCall(accountPKey, nonce, accountSignature, remarksCalls); - // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); - // - // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload); - // assert.rejects(passkeyProxy.fundAndSendUnsigned(fundingSource)); - // }); - // - // it('should fail to transfer balance due to bad account ownership proof', async function () { - // const accountPKey = fundedKeys.publicKey; - // const nonce = await getNonce(fundedKeys); - // const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(receiverKeys.publicKey, 0n); - // const { passKeyPrivateKey, passKeyPublicKey, passkeySignature } = createPassKeyAndSignAccount(accountPKey); - // const accountSignature = fundedKeys.sign('badPasskeyPublicKey'); - // const passkeyCall = await createPassKeyCall(accountPKey, nonce, accountSignature, transferCalls); - // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); - // - // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload); - // assert.rejects(passkeyProxy.fundAndSendUnsigned(fundingSource)); - // }); - // - // it('should fail to transfer balance due to bad passkey signature', async function () { - // const accountPKey = fundedKeys.publicKey; - // const nonce = await getNonce(fundedKeys); - // const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(receiverKeys.publicKey, 0n); - // const { passKeyPrivateKey, passKeyPublicKey, passkeySignature } = createPassKeyAndSignAccount(accountPKey); - // const accountSignature = fundedKeys.sign(u8aWrapBytes(passKeyPublicKey)); - // const passkeyCall = await createPassKeyCall(accountPKey, nonce, accountSignature, transferCalls); - // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, true); - // - // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload); - // assert.rejects(passkeyProxy.fundAndSendUnsigned(fundingSource)); - // }); - - // it('should transfer via passkeys', async function () { - // const receiverBalance1 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); - // const balanceBefore = receiverBalance1.data.free.toBigInt(); - // console.log(`before ${balanceBefore}`); - // - // const accountPKey = fundedKeys.addressRaw; - // console.log(`public key size ${accountPKey.length}`) - // const nonce = await getNonce(fundedKeys); - // const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive({ - // Id: receiverKeys.address - // }, 100_000_000n); - // const { passKeyPrivateKey, passKeyPublicKey } = createPassKeyAndSignAccount(accountPKey); - // const accountSignature = fundedKeys.sign(u8aWrapBytes(passKeyPublicKey)); - // const passkeyCall = await createPassKeyCall(accountPKey, nonce, accountSignature, transferCalls); - // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); - // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeys, passkeyPayload); - // assert.doesNotReject(passkeyProxy.fundAndSendUnsigned(fundingSource)); - // await ExtrinsicHelper.waitForFinalization((await getBlockNumber()) + 2); - // const receiverBalance = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); - // const nonceAfter = (await ExtrinsicHelper.getAccountInfo(fundedKeys.address)).nonce.toNumber(); - // assert.equal(nonce + 1, nonceAfter); - // console.log(`after ${receiverBalance}`); - // assert(receiverBalance.data.free.toBigInt() - balanceBefore > 0n); - // }); - - // it ('it should send from secp256k1 to secp256k1', async function () { - // const receiverBalance1 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); - // const balanceBefore = receiverBalance1.data.free.toBigInt(); - // console.log(`before ${balanceBefore}`); - // - // const extrinsic = new Extrinsic( - // () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(receiverKeys.address, 100_000_000n), - // fundedKeys, - // ExtrinsicHelper.api.events.balances.Transfer - // ); - // const {target} = await extrinsic.signAndSend(); - // assert.notEqual(target, undefined, 'should have returned Transfer event'); - // - // const receiverBalance2 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); - // const balanceBefore2 = receiverBalance2.data.free.toBigInt(); - // console.log(`after ${balanceBefore2}`); - // }) - - it ('it should send from sr25519 accountId32 to secp256k1 accountId20', async function () { - const etheAddress = ethereumEncode(receiverKeys.publicKey); - console.log(`eth receiver address ${etheAddress}`); - let ethAddress20 = Array.from(hexToU8a(etheAddress)); - console.log(`ss ${ethAddress20}`); - + it ('should transfer from sr25519 to ethereum style key', async function () { const extrinsic = new Extrinsic( - () => ExtrinsicHelper.api.tx.balances.transferKeepAlive({ - Address20: ethAddress20 - }, 50_000_000n), + () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 33_000_000n), fundedKeysSr25519, ExtrinsicHelper.api.events.balances.Transfer ); const {target} = await extrinsic.signAndSend(); assert.notEqual(target, undefined, 'should have returned Transfer event'); + }) - // transfer back - const extrinsic2 = ExtrinsicHelper.apiPromise.tx.balances.transferKeepAlive(fundedKeysSr25519.address, 1_000_000n); - let convertedAddress = getConvertedEthereumAccount(etheAddress); - const rawPayload = await ExtrinsicHelper.getRawPayloadForSigning(extrinsic2, convertedAddress); - console.log(`signer payload => ${JSON.stringify(rawPayload)}`); - - await extrinsic2.signAndSend(convertedAddress, {signer: { - signRaw: async (payload): Promise => { - console.log(`inside payload => ${JSON.stringify(payload)}`); - const sig = receiverKeys.sign(payload.data); - const prefixedSignature = new Uint8Array(sig.length + 1); - prefixedSignature[0]=2; - prefixedSignature.set(sig, 1); - const hex = u8aToHex(prefixedSignature); - console.log(`signature => ${hex}`); - return { - signature: hex, - } as SignerResult; - }, - }}, (status) => { + it ('should transfer from ethereum style key to sr25519', async function () { + const unifiedAddress = getUnifiedAddress(fundedEthereumKeys); + const extrinsic = ExtrinsicHelper.apiPromise.tx.balances.transferKeepAlive(getUnifiedAddress(fundedKeysSr25519), 44_000_000n); + await extrinsic.signAndSend(unifiedAddress, { signer: getEthereumStyleSigner(fundedEthereumKeys) }, (status) => { console.log(status.toHuman()); }); - - - - // const extrinsic2 = new Extrinsic( - // () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(fundedKeysSr25519.address, 500_000n), - // receiverKeys, - // ExtrinsicHelper.api.events.balances.Transfer - // ); - // const {target2} = await extrinsic2.signAndSend(); - // assert.notEqual(target2, undefined, 'should have returned Transfer event'); - }) + it('should transfer via passkeys with root sr25519 key into an ethereum style account', async function () { + const initialReceiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); + const accountPKey = fundedKeysSr25519.publicKey; + const nonce = await getNonce(fundedKeysSr25519); + const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 55_000_000n); + const { passKeyPrivateKey, passKeyPublicKey } = createPassKeyAndSignAccount(accountPKey); + const accountSignature = fundedKeysSr25519.sign(u8aWrapBytes(passKeyPublicKey)); + const passkeyCall = await createPassKeyCall(accountPKey, nonce, { Sr25519: accountSignature} as MultiSignature, transferCalls); + const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); + const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeysSr25519, passkeyPayload); + assert.doesNotReject(passkeyProxy.fundAndSendUnsigned(fundingSource)); + await ExtrinsicHelper.waitForFinalization((await getBlockNumber()) + 2); + const receiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); + // adding some delay before fetching the nonce to ensure it is updated + await new Promise((resolve) => setTimeout(resolve, 1000)); + const nonceAfter = (await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(fundedKeysSr25519))).nonce.toNumber(); + assert.equal(nonce + 1, nonceAfter); + assert(receiverBalance.data.free.toBigInt() - initialReceiverBalance.data.free.toBigInt() > 0n); + }); - // it ('it should send from secp256k1 accountId20 to sr25519', async function () { - // const etheAddress = ethereumEncode(fundedKeysEth.publicKey); - // console.log(`eth sender address ${etheAddress}`); - // let convertedAddress = getConvertedEthereumAccount(etheAddress); - // console.log(`convertedAddress ${convertedAddress}`); - // // const receiverBalance1 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); - // // const balanceBefore = receiverBalance1.data.free.toBigInt(); - // // console.log(`before ${balanceBefore}`); - // - // const extrinsic = ExtrinsicHelper.api.tx.balances.transferKeepAlive(fundedKeysSr25519.address, 1_000_000n); - // const rawPayload = await ExtrinsicHelper.getRawPayloadForSigning(extrinsic, convertedAddress); - // console.log(`signer payload => ${JSON.stringify(rawPayload)}`); - // - // // TODO check whatever - // // const {target} = await extrinsic.signAndSend(); - // // assert.notEqual(target, undefined, 'should have returned Transfer event'); - // - // // const receiverBalance2 = await ExtrinsicHelper.getAccountInfo(receiverKeys.address); - // // const balanceBefore2 = receiverBalance2.data.free.toBigInt(); - // // console.log(`after ${balanceBefore2}`); - // }) + it ('should transfer via passkeys with root ethereum style key into another one', async function () { + const initialReceiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); + const accountPKey = getConvertedEthereumPublicKey(fundedEthereumKeys); + console.log(`accountPKey ${u8aToHex(accountPKey)}`); + const nonce = await getNonce(fundedEthereumKeys); + const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 66_000_000n); + const { passKeyPrivateKey, passKeyPublicKey } = createPassKeyAndSignAccount(accountPKey); + const accountSignature = fundedEthereumKeys.sign(u8aWrapBytes(passKeyPublicKey)); + console.log(`accountSignature ${u8aToHex(accountSignature)}`); + const passkeyCall = await createPassKeyCall(accountPKey, nonce, { Ecdsa: accountSignature} as MultiSignature, transferCalls); + const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); + const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundingSource, passkeyPayload); + assert.doesNotReject(passkeyProxy.sendUnsigned()); + await ExtrinsicHelper.waitForFinalization((await getBlockNumber()) + 2); + const receiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); + // adding some delay before fetching the nonce to ensure it is updated + await new Promise((resolve) => setTimeout(resolve, 1000)); + const nonceAfter = (await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(fundedEthereumKeys))).nonce.toNumber(); + assert.equal(nonce + 1, nonceAfter); + assert(receiverBalance.data.free.toBigInt() - initialReceiverBalance.data.free.toBigInt() > 0n); + }) }); }); diff --git a/e2e/scaffolding/P256.ts b/e2e/scaffolding/P256.ts index 942f52ef13..69d6a7f259 100644 --- a/e2e/scaffolding/P256.ts +++ b/e2e/scaffolding/P256.ts @@ -5,6 +5,7 @@ import { ISubmittableResult } from '@polkadot/types/types'; import { u8aWrapBytes } from '@polkadot/util'; import { ExtrinsicHelper } from './extrinsicHelpers'; import { sha256 } from '@noble/hashes/sha256'; +import {MultiSignature} from "@polkadot/types/interfaces"; export function createPassKeyAndSignAccount(accountPKey: Uint8Array) { const passKeyPrivateKey = secp256r1.utils.randomPrivateKey(); @@ -16,17 +17,14 @@ export function createPassKeyAndSignAccount(accountPKey: Uint8Array) { export async function createPassKeyCall( accountPKey: Uint8Array, nonce: number, - accountSignature: Uint8Array, + accountSignature: MultiSignature, call: SubmittableExtrinsic<'rxjs', ISubmittableResult> ) { const ext_call_type = ExtrinsicHelper.api.registry.createType('Call', call); - console.log(`sig length ${accountSignature.length}`) const passkeyCall = { accountId: accountPKey, accountNonce: nonce, - accountOwnershipProof: { - Ecdsa: accountSignature, - }, + accountOwnershipProof: accountSignature, call: ext_call_type, }; diff --git a/e2e/scaffolding/autoNonce.ts b/e2e/scaffolding/autoNonce.ts index 562a7988f5..e158effcec 100644 --- a/e2e/scaffolding/autoNonce.ts +++ b/e2e/scaffolding/autoNonce.ts @@ -7,26 +7,27 @@ import type { KeyringPair } from '@polkadot/keyring/types'; import { ExtrinsicHelper } from './extrinsicHelpers'; +import {getUnifiedAddress} from "./ethereum"; export type AutoNonce = number | 'auto' | 'current'; const nonceCache = new Map(); const getNonce = async (keys: KeyringPair) => { - return (await ExtrinsicHelper.getAccountInfo(keys.address)).nonce.toNumber(); + return (await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(keys))).nonce.toNumber(); }; const reset = (keys: KeyringPair) => { - nonceCache.delete(keys.address); + nonceCache.delete(getUnifiedAddress(keys)); }; const current = async (keys: KeyringPair): Promise => { - return nonceCache.get(keys.address) || (await getNonce(keys)); + return nonceCache.get(getUnifiedAddress(keys)) || (await getNonce(keys)); }; const increment = async (keys: KeyringPair) => { const nonce = await current(keys); - nonceCache.set(keys.address, nonce + 1); + nonceCache.set(getUnifiedAddress(keys), nonce + 1); return nonce; }; @@ -46,7 +47,7 @@ const auto = (keys: KeyringPair, inputNonce: AutoNonce = 'auto'): Promise => { + const sig = ethereumPair.sign(payload.data); + const prefixedSignature = new Uint8Array(sig.length + 1); + prefixedSignature[0]=2; + prefixedSignature.set(sig, 1); + const hex = u8aToHex(prefixedSignature); + return { + signature: hex, + } as SignerResult; + }, + } +} + +export function getAccountId20MultiAddress(pair: KeyringPair): MultiAddress { + const etheAddress = ethereumEncode(pair.publicKey); + let ethAddress20 = Array.from(hexToU8a(etheAddress)); + return { + Address20: ethAddress20 + } as MultiAddress; +} + +export function getConvertedEthereumPublicKey(pair: KeyringPair): Uint8Array { + const publicKeyBytes = hexToU8a(ethereumEncode(pair.publicKey)); + const result = new Uint8Array(32); + result.fill(0, 0, 12); + result.set(publicKeyBytes, 12); + return result; +} + +function getConvertedEthereumAccount( + accountId20Hex: string +) : string { + const addressBytes = hexToU8a(accountId20Hex); + const result = new Uint8Array(32); + result.fill(0, 0, 12); + result.set(addressBytes, 12); + return encodeAddress(result); +} diff --git a/e2e/scaffolding/extrinsicHelpers.ts b/e2e/scaffolding/extrinsicHelpers.ts index f774ab3b42..406c7b85ef 100644 --- a/e2e/scaffolding/extrinsicHelpers.ts +++ b/e2e/scaffolding/extrinsicHelpers.ts @@ -24,6 +24,7 @@ import { u8aToHex } from '@polkadot/util/u8a/toHex'; import { u8aWrapBytes } from '@polkadot/util'; import type { AccountId32, Call, H256 } from '@polkadot/types/interfaces/runtime'; import { hasRelayChain } from './env'; +import {getUnifiedAddress} from "./ethereum"; export interface ReleaseSchedule { start: number; @@ -275,6 +276,19 @@ export class Extrinsic( targetEvent?: AugmentedEvent ) { @@ -348,7 +362,7 @@ export class ExtrinsicHelper { /** Balance Extrinsics */ public static transferFunds(source: KeyringPair, dest: KeyringPair, amount: Compact | AnyNumber) { return new Extrinsic( - () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(dest.address, amount), + () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(dest), amount), source, ExtrinsicHelper.api.events.balances.Transfer ); @@ -920,34 +934,4 @@ export class ExtrinsicHelper { ExtrinsicHelper.api.events.passkey.TransactionExecutionSuccess ); } - - // eslint-disable-next-line consistent-return, class-methods-use-this - public static async getRawPayloadForSigning( - tx: SubmittableExtrinsic<'promise', ISubmittableResult>, - signerAddress: string, - ): Promise { - const dummyError = 'Stop here'; - - let signRaw: SignerPayloadRaw; - try { - await tx.signAsync(signerAddress, { - signer: { - signRaw: (raw) => { - signRaw = raw; - // Interrupt the signing process to get the raw payload, as encoded by polkadot-js - throw new Error(dummyError); - }, - // signPayload: (payload) => { - // console.log(payload); - // }, - } - }); - } catch (e: any) { - if (e?.message !== dummyError) { - throw e; - } - } - - return signRaw; - } } diff --git a/e2e/scaffolding/helpers.ts b/e2e/scaffolding/helpers.ts index fe8d663ab8..ca08d69639 100644 --- a/e2e/scaffolding/helpers.ts +++ b/e2e/scaffolding/helpers.ts @@ -38,6 +38,7 @@ import { AVRO_GRAPH_CHANGE } from '../schemas/fixtures/avroGraphChangeSchemaType import { PARQUET_BROADCAST } from '../schemas/fixtures/parquetBroadcastSchemaType'; import { AVRO_CHAT_MESSAGE } from '../stateful-pallet-storage/fixtures/itemizedSchemaType'; import type { KeypairType } from "@polkadot/util-crypto/types"; +import { getUnifiedAddress } from "./ethereum"; export interface Account { uri: string; @@ -294,16 +295,6 @@ export async function createAndFundKeypair( return keypair; } -export function getConvertedEthereumAccount( - accountId20Hex: string -) : string { - const addressBytes = hexToU8a(accountId20Hex); - const result = new Uint8Array(32); - result.fill(0, 0, 12); - result.set(addressBytes, 12); - return encodeAddress(result); -} - export async function createAndFundKeypairs( source: KeyringPair, keyNames: string[], @@ -597,7 +588,7 @@ export async function getCapacity(providerId: u64): Promise { - const nonce = await ExtrinsicHelper.apiPromise.call.accountNonceApi.accountNonce(keys.address); + const nonce = await ExtrinsicHelper.apiPromise.call.accountNonceApi.accountNonce(getUnifiedAddress(keys)); return nonce.toNumber(); } diff --git a/runtime/frequency/src/eth.rs b/runtime/frequency/src/eth.rs index 774f39b3e0..b0ee185160 100644 --- a/runtime/frequency/src/eth.rs +++ b/runtime/frequency/src/eth.rs @@ -33,16 +33,18 @@ where } } fn unlookup(x: Self::Target) -> Self::Source { - let encoded = x.encode(); - match encoded[..12].eq(&[0u8; 12]) { - true => { - log::info!(target: "ETHEREUM", "unlookup before 0x{:?}", HexDisplay::from(&encoded)); - let mut address20 = [0u8; 20]; - address20[..].copy_from_slice(&encoded[12..]); - log::info!(target: "ETHEREUM", "unlookup after 0x{:?}", HexDisplay::from(&address20)); - MultiAddress::Address20(address20) - }, - false => MultiAddress::Id(x), - } + MultiAddress::Id(x) + // This should probably leave commented out since we are always dealing with 32 byte accounts + // let encoded = x.encode(); + // match encoded[..12].eq(&[0u8; 12]) { + // true => { + // log::info!(target: "ETHEREUM", "unlookup before 0x{:?}", HexDisplay::from(&encoded)); + // let mut address20 = [0u8; 20]; + // address20[..].copy_from_slice(&encoded[12..]); + // log::info!(target: "ETHEREUM", "unlookup after 0x{:?}", HexDisplay::from(&address20)); + // MultiAddress::Address20(address20) + // }, + // false => MultiAddress::Id(x), + // } } } From a0a867f7425dcc73127f4096606056c7a78e5c51 Mon Sep 17 00:00:00 2001 From: Aramik Date: Thu, 7 Nov 2024 16:30:45 -0800 Subject: [PATCH 3/3] added support for metamask signing --- common/primitives/src/signatures.rs | 10 +- e2e/passkey/passkeyProxy.ecdsa.test.ts | 146 ++++++++++++++----------- e2e/scaffolding/ethereum.ts | 49 ++++++++- 3 files changed, 140 insertions(+), 65 deletions(-) diff --git a/common/primitives/src/signatures.rs b/common/primitives/src/signatures.rs index 4891a72f67..996121f13a 100644 --- a/common/primitives/src/signatures.rs +++ b/common/primitives/src/signatures.rs @@ -12,6 +12,7 @@ use sp_core::{ hexdisplay::HexDisplay, sr25519, ByteArray, H256, }; +use scale_info::prelude::format; use sp_runtime::{ traits, traits::{Lazy, Verify}, @@ -95,7 +96,8 @@ impl Verify for UnifiedSignature { }, (Self::Ecdsa(ref sig), who) => { log::info!(target:"ETHEREUM", "inside ecdsa signature verifier 0x{:?}",HexDisplay::from(&msg.get())); - let m = sp_io::hashing::keccak_256(msg.get()); + let m = eth_message(&format!("0x{:?}", HexDisplay::from(&msg.get()))); + log::info!(target:"ETHEREUM", "prefixed hashed 0x{:?}",HexDisplay::from(&m)); match sp_io::crypto::secp256k1_ecdsa_recover(sig.as_ref(), &m) { Ok(pubkey) => { let mut hashed = sp_io::hashing::keccak_256(pubkey.as_ref()); @@ -111,7 +113,11 @@ impl Verify for UnifiedSignature { } } } - +fn eth_message(message: &str) -> [u8; 32] { + let prefixed = format!("{}{}{}", "\x19Ethereum Signed Message:\n", message.len(), message); + log::info!(target:"ETHEREUM", "prefixed {:?}",prefixed); + sp_io::hashing::keccak_256(prefixed.as_bytes()) +} /// Public key for any known crypto algorithm. #[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/e2e/passkey/passkeyProxy.ecdsa.test.ts b/e2e/passkey/passkeyProxy.ecdsa.test.ts index e592d6008b..01493f8e3e 100644 --- a/e2e/passkey/passkeyProxy.ecdsa.test.ts +++ b/e2e/passkey/passkeyProxy.ecdsa.test.ts @@ -1,92 +1,114 @@ import '@frequency-chain/api-augment'; import assert from 'assert'; import { - createAndFundKeypair, + createAndFundKeypair, fundKeypair, getBlockNumber, getNonce } from '../scaffolding/helpers'; import { KeyringPair } from '@polkadot/keyring/types'; import {Extrinsic, ExtrinsicHelper} from '../scaffolding/extrinsicHelpers'; import { getFundingSource } from '../scaffolding/funding'; -import { u8aToHex, u8aWrapBytes} from '@polkadot/util'; +import {hexToU8a, u8aToHex, u8aWrapBytes} from '@polkadot/util'; import { createPassKeyAndSignAccount, createPassKeyCall, createPasskeyPayload } from '../scaffolding/P256'; -import {getConvertedEthereumPublicKey, getEthereumStyleSigner, getUnifiedAddress} from "../scaffolding/ethereum"; -import {MultiSignature} from "@polkadot/types/interfaces"; +import { + getConvertedEthereumPublicKey, + getEthereumStyleSigner, getEthereumStyleSignerTest, + getKeyringPairFromSecp256k1PrivateKey, + getUnifiedAddress +} from "../scaffolding/ethereum"; +import {Keyring} from "@polkadot/api"; const fundingSource = getFundingSource('passkey-proxy'); describe('Passkey Pallet Tests for ECDSA keys', function () { describe('proxy basic tests for ECDSA keys', function () { let fundedKeysSr25519: KeyringPair; let fundedEthereumKeys: KeyringPair; + let ethereumKeysFromPrivateKey: KeyringPair; let receiverEthereumKeys: KeyringPair; before(async function () { - fundedKeysSr25519 = await createAndFundKeypair(fundingSource, 300_000_000n); - fundedEthereumKeys = await createAndFundKeypair(fundingSource, 300_000_000n, undefined, undefined, 'ethereum'); - receiverEthereumKeys = await createAndFundKeypair(fundingSource, undefined, undefined, undefined, 'ethereum'); - console.log(`ethereumKeys ${JSON.stringify(fundedEthereumKeys.toJson())} ${u8aToHex(fundedEthereumKeys.publicKey)} ${u8aToHex(fundedEthereumKeys.addressRaw)} ${getUnifiedAddress(fundedEthereumKeys)}`); - console.log(`receiverEthereumKeys ${JSON.stringify(receiverEthereumKeys.toJson())} ${u8aToHex(receiverEthereumKeys.publicKey)} ${u8aToHex(receiverEthereumKeys.addressRaw)} ${getUnifiedAddress(receiverEthereumKeys)}`); + // fundedKeysSr25519 = await createAndFundKeypair(fundingSource, 300_000_000n); + const keyring = new Keyring({ type: 'sr25519'}); + fundedKeysSr25519 = keyring.addFromUri('//Eve'); + + // fundedEthereumKeys = await createAndFundKeypair(fundingSource, 300_000_000n, undefined, undefined, 'ethereum'); + ethereumKeysFromPrivateKey = getKeyringPairFromSecp256k1PrivateKey(hexToU8a('0x4fa1fa06b8ad980d739473280ab1c362c425fa5883dd661a5d90e57e6d2969ce')); + // receiverEthereumKeys = await createAndFundKeypair(fundingSource, undefined, undefined, undefined, 'ethereum'); + // console.log(`fundedEthereumKeys ${JSON.stringify(fundedEthereumKeys.toJson())} ${u8aToHex(fundedEthereumKeys.publicKey)} ${u8aToHex(fundedEthereumKeys.addressRaw)} ${getUnifiedAddress(fundedEthereumKeys)}`); + // console.log(`receiverEthereumKeys ${JSON.stringify(receiverEthereumKeys.toJson())} ${u8aToHex(receiverEthereumKeys.publicKey)} ${u8aToHex(receiverEthereumKeys.addressRaw)} ${getUnifiedAddress(receiverEthereumKeys)}`); }); - it ('should transfer from sr25519 to ethereum style key', async function () { - const extrinsic = new Extrinsic( - () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 33_000_000n), - fundedKeysSr25519, - ExtrinsicHelper.api.events.balances.Transfer - ); - const {target} = await extrinsic.signAndSend(); - assert.notEqual(target, undefined, 'should have returned Transfer event'); - }) + // it ('should transfer from sr25519 to ethereum style key', async function () { + // const extrinsic = new Extrinsic( + // () => ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 33_000_000n), + // fundedKeysSr25519, + // ExtrinsicHelper.api.events.balances.Transfer + // ); + // const {target} = await extrinsic.signAndSend(); + // assert.notEqual(target, undefined, 'should have returned Transfer event'); + // }) - it ('should transfer from ethereum style key to sr25519', async function () { - const unifiedAddress = getUnifiedAddress(fundedEthereumKeys); - const extrinsic = ExtrinsicHelper.apiPromise.tx.balances.transferKeepAlive(getUnifiedAddress(fundedKeysSr25519), 44_000_000n); - await extrinsic.signAndSend(unifiedAddress, { signer: getEthereumStyleSigner(fundedEthereumKeys) }, (status) => { + it ('should transfer from metamask injected signature to sr25519', async function () { + const unifiedAddress = getUnifiedAddress(ethereumKeysFromPrivateKey); + const extrinsic = ExtrinsicHelper.apiPromise.tx.balances.transferKeepAlive(getUnifiedAddress(fundedKeysSr25519), 33_000_000n); + await extrinsic.signAndSend(unifiedAddress, { signer: getEthereumStyleSignerTest( + "0x0a0300e659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4e0229de0715000000008300000001000000c7b499ff539de473280e53ab077e100f7152a76f4d24025e9b56bebf74024ffd7cc514216c7605c9965a8740d74c4e8fd70066603ba54edc03a55a1e546e3bde00", + "0x0c8dcadc5671485638b43a0f953ecd0e0eb6fa16213a6b605a7290e1df8b49db365c3f7c82eb9d0b857e97ad4307b0f423cae19cfd9a4b602ba8f06335cad3cc1c" + ) }, (status) => { console.log(status.toHuman()); }); }) - it('should transfer via passkeys with root sr25519 key into an ethereum style account', async function () { - const initialReceiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); - const accountPKey = fundedKeysSr25519.publicKey; - const nonce = await getNonce(fundedKeysSr25519); - const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 55_000_000n); - const { passKeyPrivateKey, passKeyPublicKey } = createPassKeyAndSignAccount(accountPKey); - const accountSignature = fundedKeysSr25519.sign(u8aWrapBytes(passKeyPublicKey)); - const passkeyCall = await createPassKeyCall(accountPKey, nonce, { Sr25519: accountSignature} as MultiSignature, transferCalls); - const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); - const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeysSr25519, passkeyPayload); - assert.doesNotReject(passkeyProxy.fundAndSendUnsigned(fundingSource)); - await ExtrinsicHelper.waitForFinalization((await getBlockNumber()) + 2); - const receiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); - // adding some delay before fetching the nonce to ensure it is updated - await new Promise((resolve) => setTimeout(resolve, 1000)); - const nonceAfter = (await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(fundedKeysSr25519))).nonce.toNumber(); - assert.equal(nonce + 1, nonceAfter); - assert(receiverBalance.data.free.toBigInt() - initialReceiverBalance.data.free.toBigInt() > 0n); - }); + // it ('should transfer from an ethereum key created from private key to sr25519', async function () { + // const unifiedAddress = getUnifiedAddress(ethereumKeysFromPrivateKey); + // await fundKeypair(fundedKeysSr25519, ethereumKeysFromPrivateKey, 100_000_000n); + // const extrinsic = ExtrinsicHelper.apiPromise.tx.balances.transferKeepAlive(getUnifiedAddress(fundedKeysSr25519), 44_000_000n); + // await extrinsic.signAndSend(unifiedAddress, { signer: getEthereumStyleSigner(ethereumKeysFromPrivateKey) }, (status) => { + // console.log(status.toHuman()); + // }); + // }) - it ('should transfer via passkeys with root ethereum style key into another one', async function () { - const initialReceiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); - const accountPKey = getConvertedEthereumPublicKey(fundedEthereumKeys); - console.log(`accountPKey ${u8aToHex(accountPKey)}`); - const nonce = await getNonce(fundedEthereumKeys); - const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 66_000_000n); - const { passKeyPrivateKey, passKeyPublicKey } = createPassKeyAndSignAccount(accountPKey); - const accountSignature = fundedEthereumKeys.sign(u8aWrapBytes(passKeyPublicKey)); - console.log(`accountSignature ${u8aToHex(accountSignature)}`); - const passkeyCall = await createPassKeyCall(accountPKey, nonce, { Ecdsa: accountSignature} as MultiSignature, transferCalls); - const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); - const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundingSource, passkeyPayload); - assert.doesNotReject(passkeyProxy.sendUnsigned()); - await ExtrinsicHelper.waitForFinalization((await getBlockNumber()) + 2); - const receiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); - // adding some delay before fetching the nonce to ensure it is updated - await new Promise((resolve) => setTimeout(resolve, 1000)); - const nonceAfter = (await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(fundedEthereumKeys))).nonce.toNumber(); - assert.equal(nonce + 1, nonceAfter); - assert(receiverBalance.data.free.toBigInt() - initialReceiverBalance.data.free.toBigInt() > 0n); - }) + // it('should transfer via passkeys with root sr25519 key into an ethereum style account', async function () { + // const initialReceiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); + // const accountPKey = fundedKeysSr25519.publicKey; + // const nonce = await getNonce(fundedKeysSr25519); + // const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 55_000_000n); + // const { passKeyPrivateKey, passKeyPublicKey } = createPassKeyAndSignAccount(accountPKey); + // const accountSignature = fundedKeysSr25519.sign(u8aWrapBytes(passKeyPublicKey)); + // const passkeyCall = await createPassKeyCall(accountPKey, nonce, { Sr25519: accountSignature} as MultiSignature, transferCalls); + // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); + // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundedKeysSr25519, passkeyPayload); + // assert.doesNotReject(passkeyProxy.fundAndSendUnsigned(fundingSource)); + // await ExtrinsicHelper.waitForFinalization((await getBlockNumber()) + 2); + // const receiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); + // // adding some delay before fetching the nonce to ensure it is updated + // await new Promise((resolve) => setTimeout(resolve, 1000)); + // const nonceAfter = (await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(fundedKeysSr25519))).nonce.toNumber(); + // assert.equal(nonce + 1, nonceAfter); + // assert(receiverBalance.data.free.toBigInt() - initialReceiverBalance.data.free.toBigInt() > 0n); + // }); + // + // it ('should transfer via passkeys with root ethereum style key into another one', async function () { + // const initialReceiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); + // const accountPKey = getConvertedEthereumPublicKey(fundedEthereumKeys); + // console.log(`accountPKey ${u8aToHex(accountPKey)}`); + // const nonce = await getNonce(fundedEthereumKeys); + // const transferCalls = ExtrinsicHelper.api.tx.balances.transferKeepAlive(getUnifiedAddress(receiverEthereumKeys), 66_000_000n); + // const { passKeyPrivateKey, passKeyPublicKey } = createPassKeyAndSignAccount(accountPKey); + // const accountSignature = fundedEthereumKeys.sign(u8aWrapBytes(passKeyPublicKey)); + // console.log(`accountSignature ${u8aToHex(accountSignature)}`); + // const passkeyCall = await createPassKeyCall(accountPKey, nonce, { Ecdsa: accountSignature} as MultiSignature, transferCalls); + // const passkeyPayload = await createPasskeyPayload(passKeyPrivateKey, passKeyPublicKey, passkeyCall, false); + // const passkeyProxy = ExtrinsicHelper.executePassKeyProxy(fundingSource, passkeyPayload); + // assert.doesNotReject(passkeyProxy.sendUnsigned()); + // await ExtrinsicHelper.waitForFinalization((await getBlockNumber()) + 2); + // const receiverBalance = await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(receiverEthereumKeys)); + // // adding some delay before fetching the nonce to ensure it is updated + // await new Promise((resolve) => setTimeout(resolve, 1000)); + // const nonceAfter = (await ExtrinsicHelper.getAccountInfo(getUnifiedAddress(fundedEthereumKeys))).nonce.toNumber(); + // assert.equal(nonce + 1, nonceAfter); + // assert(receiverBalance.data.free.toBigInt() - initialReceiverBalance.data.free.toBigInt() > 0n); + // }) }); }); diff --git a/e2e/scaffolding/ethereum.ts b/e2e/scaffolding/ethereum.ts index 191c7fe2ed..1084338326 100644 --- a/e2e/scaffolding/ethereum.ts +++ b/e2e/scaffolding/ethereum.ts @@ -4,6 +4,11 @@ import {hexToU8a, u8aToHex} from "@polkadot/util"; import {MultiAddress} from "@polkadot/types/interfaces"; import type {Signer} from "@polkadot/types/types"; import {SignerResult} from "@polkadot/types/types"; +import { secp256k1 } from '@noble/curves/secp256k1'; +import {Keyring} from "@polkadot/api"; +import {Keypair} from "@polkadot/util-crypto/types"; +import {keccak256} from "@polkadot/wasm-crypto"; +import assert from "assert"; export function getUnifiedAddress(pair: KeyringPair) : string { if (['ecdsa','ethereum'].includes(pair.type)) { @@ -16,7 +21,8 @@ export function getUnifiedAddress(pair: KeyringPair) : string { export function getEthereumStyleSigner(ethereumPair: KeyringPair) : Signer { return { signRaw: async (payload): Promise => { - const sig = ethereumPair.sign(payload.data); + console.log(`raw_payload: ${payload.data}`); + const sig = ethereumPair.sign(wrapCustomEthereumTags(payload.data)); const prefixedSignature = new Uint8Array(sig.length + 1); prefixedSignature[0]=2; prefixedSignature.set(sig, 1); @@ -28,6 +34,33 @@ export function getEthereumStyleSigner(ethereumPair: KeyringPair) : Signer { } } +export function getEthereumStyleSignerTest(expectedPayloadHex: string, injectedSignatureHex: string) : Signer { + return { + signRaw: async (payload): Promise => { + console.log(`raw_payload: ${payload.data}`); + assert.equal(payload.data, expectedPayloadHex); + const sig = hexToU8a(injectedSignatureHex); + const prefixedSignature = new Uint8Array(sig.length + 1); + prefixedSignature[0]=2; + prefixedSignature.set(sig, 1); + const hex = u8aToHex(prefixedSignature); + return { + signature: hex, + } as SignerResult; + }, + } +} + +function wrapCustomEthereumTags(hexPayload: string) : Uint8Array { + // wrapping in frequency tags to show this is a Frequency related payload + const frequencyWrapped = `${hexPayload.toLowerCase()}` + // prefixing with the EIP-191 for personal_sign messages (this gets wrapped automatically in metamask) + const wrapped = `\x19Ethereum Signed Message:\n${frequencyWrapped.length}${frequencyWrapped}` + console.log(`wrapped ${wrapped}`); + const buffer = Buffer.from(wrapped, "utf-8"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.length); +} + export function getAccountId20MultiAddress(pair: KeyringPair): MultiAddress { const etheAddress = ethereumEncode(pair.publicKey); let ethAddress20 = Array.from(hexToU8a(etheAddress)); @@ -53,3 +86,17 @@ function getConvertedEthereumAccount( result.set(addressBytes, 12); return encodeAddress(result); } + +/** + * + * @param secretKey of secp256k1 keypair exported from any wallet (should be 32 bytes) + */ +export function getKeyringPairFromSecp256k1PrivateKey(secretKey: Uint8Array): KeyringPair { + const publicKey = secp256k1.getPublicKey(secretKey, true); + const keypair: Keypair = { + secretKey, + publicKey + }; + const keyring = new Keyring({ type: 'ethereum' }); + return keyring.addFromPair(keypair, undefined, 'ethereum' ) +}