From dbc36c4fd11ac90ea282cab102d0b0f85b0bc0c6 Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Sun, 19 May 2024 21:54:59 +0700 Subject: [PATCH 1/3] feat: add polkadot js --- .gitignore | 5 +- scripts/polkadot-js/getter/get_balance.ts | 39 ++ .../polkadot-js/getter/list_method_params.ts | 88 +++ .../polkadot-js/getter/list_rpc_methods.ts | 33 + scripts/polkadot-js/package.json | 13 + scripts/polkadot-js/src/ibc-transfer.ts | 109 ++++ scripts/polkadot-js/src/simple-connect.ts | 25 + scripts/polkadot-js/src/transfer.ts | 51 ++ scripts/polkadot-js/tsconfig.json | 13 + scripts/polkadot-js/utils/indexer.ts | 30 + scripts/polkadot-js/yarn.lock | 569 ++++++++++++++++++ .../relayer_hyperspace/config-chain-a.toml | 4 +- .../relayer_hyperspace/config-chain-b.toml | 6 +- scripts/relayer_hyperspace/create-clients.sh | 2 +- scripts/upgrade/setup-old-picad-node.sh | 1 - scripts/upgrade/setup-polkadot-node.sh | 4 +- 16 files changed, 982 insertions(+), 10 deletions(-) create mode 100644 scripts/polkadot-js/getter/get_balance.ts create mode 100644 scripts/polkadot-js/getter/list_method_params.ts create mode 100644 scripts/polkadot-js/getter/list_rpc_methods.ts create mode 100644 scripts/polkadot-js/package.json create mode 100644 scripts/polkadot-js/src/ibc-transfer.ts create mode 100644 scripts/polkadot-js/src/simple-connect.ts create mode 100644 scripts/polkadot-js/src/transfer.ts create mode 100644 scripts/polkadot-js/tsconfig.json create mode 100644 scripts/polkadot-js/utils/indexer.ts create mode 100644 scripts/polkadot-js/yarn.lock diff --git a/.gitignore b/.gitignore index 58aecea72..c9fa1c668 100644 --- a/.gitignore +++ b/.gitignore @@ -54,4 +54,7 @@ _build/ mytestnet/ screenlog.0 -.idea \ No newline at end of file +.idea + + +node_modules \ No newline at end of file diff --git a/scripts/polkadot-js/getter/get_balance.ts b/scripts/polkadot-js/getter/get_balance.ts new file mode 100644 index 000000000..38a04803a --- /dev/null +++ b/scripts/polkadot-js/getter/get_balance.ts @@ -0,0 +1,39 @@ +import { ApiPromise, WsProvider } from "@polkadot/api"; +import { getProvider, getWallets } from "../utils/indexer"; + +// Put the address of the account you want to fetch info for here + +async function fetchAccountInfo() { + // Initialise the provider to connect to the local node + + // Create the API instance + const api = await getProvider(); + + const wallets = getWallets(); + try { + // Fetch the account info + const accountInfo = await api.query.system.account(wallets.alice.address); + + console.log( + `Account ${wallets.alice.address} info:`, + accountInfo.toHuman() + ); + } catch (error) { + console.error("Error fetching account info:", error); + } + + try { + const bobAccountInfo = await api.query.system.account(wallets.bob.address); + console.log( + `Account ${wallets.bob.address} info:`, + bobAccountInfo.toHuman() + ); + } catch (error) { + console.error("Error fetching account info:", error); + } finally { + // Disconnect the provider when done + api.disconnect(); + } +} + +fetchAccountInfo(); diff --git a/scripts/polkadot-js/getter/list_method_params.ts b/scripts/polkadot-js/getter/list_method_params.ts new file mode 100644 index 000000000..68825a84d --- /dev/null +++ b/scripts/polkadot-js/getter/list_method_params.ts @@ -0,0 +1,88 @@ +import { ApiPromise } from "@polkadot/api"; +import { getProvider } from "../utils/indexer"; + +async function run() { + const api = await getProvider(); + await listTxMethods(api); +} +type MetadataV14 = { + magicNumber: string; + metadata: { + v14: { + lookup: { + types: [ + { + id: string; + type: { + path: string[]; + params: object[]; + def: object; + docs: string[]; + }; + } + ]; + }; + pallets: Array<{ + name: string; + calls?: Array<{ + name: string; + args: Array<{ + name: string; + type: string | number; // Depending on how types are represented, you might need to adjust this + }>; + }>; + }>; + extrinsic: object; + type: string; + }; + }; +}; + +async function listTxMethods(api: ApiPromise) { + console.log("\nTransaction Methods:"); + const metadata = await api.rpc.state.getMetadata(); + + const metadataV14 = metadata.toJSON() as { + magicNumber: string; + metadata: { + v14: { + lookup: { + types: [ + { + id: string; + type: { + path: string[]; + params: object[]; + def: object; + docs: string[]; + }; + } + ]; + }; + pallets: Array; + extrinsic: object; + type: string; + }; + }; + }; + + console.log("pallets: ", metadataV14.metadata.v14.pallets); + // Usage example, assuming you have metadataV14 of type MetadataV14 + const ibcModule = metadataV14.metadata.v14.pallets.find( + (pallet) => pallet.name === "Ibc" + ); + + if (ibcModule && ibcModule.calls) { + const transferMethod = ibcModule.calls.find( + (call: any) => call.name === "transfer" + ); + if (transferMethod) { + console.log(`Parameters for ibc.transfer:`); + transferMethod.args.forEach((arg: any) => { + console.log(`${arg.name}: ${arg.type}`); + }); + } + } +} + +run().catch(console.error); diff --git a/scripts/polkadot-js/getter/list_rpc_methods.ts b/scripts/polkadot-js/getter/list_rpc_methods.ts new file mode 100644 index 000000000..842d76d58 --- /dev/null +++ b/scripts/polkadot-js/getter/list_rpc_methods.ts @@ -0,0 +1,33 @@ +import { ApiPromise, WsProvider } from "@polkadot/api"; +import { getProvider, getWallets } from "../utils/indexer"; + +// Put the address of the account you want to fetch info for here + +async function run() { + // Initialise the provider to connect to the local node + + // Create the API instance + const api = await getProvider(); + + listTxMethods(api); +} + +run(); + +function listTxMethods(api: ApiPromise) { + console.log("\nTransaction Methods:"); + Object.keys(api.tx).forEach((module) => { + Object.keys(api.tx[module]).forEach((method) => { + console.log(`${module}.${method}`); + }); + }); +} + +function listQueryMethods(api: ApiPromise) { + console.log("\nQuery Methods:"); + Object.keys(api.query).forEach((module) => { + Object.keys(api.query[module]).forEach((method) => { + console.log(`${module}.${method}`); + }); + }); +} diff --git a/scripts/polkadot-js/package.json b/scripts/polkadot-js/package.json new file mode 100644 index 000000000..621fb04a5 --- /dev/null +++ b/scripts/polkadot-js/package.json @@ -0,0 +1,13 @@ +{ + "name": "polkadot-js", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "devDependencies": { + "typescript": "^5.4.5" + }, + "dependencies": { + "@polkadot/api": "^10.12.6", + "@polkadot/keyring": "^12.6.2" + } +} diff --git a/scripts/polkadot-js/src/ibc-transfer.ts b/scripts/polkadot-js/src/ibc-transfer.ts new file mode 100644 index 000000000..2f30f5e00 --- /dev/null +++ b/scripts/polkadot-js/src/ibc-transfer.ts @@ -0,0 +1,109 @@ +import { ApiPromise, WsProvider } from "@polkadot/api"; +import { Keyring } from "@polkadot/keyring"; +import BN from "bn.js"; +import { KeyringPair } from "@polkadot/keyring/types"; +import { getProvider, getWallets } from "../utils/indexer"; + +async function sendIbcFundsTx( + api: ApiPromise, + senderKeypair: KeyringPair, + channelID: string, + amount: { denom: string; amount: string; address: string }, + options: any +) { + { + // Ensure the API is connected + if (!api.isConnected) { + await api.connect(); + } + + // Calculate the timestamp for 5 minutes into the future + const fiveMinutes = 5 * 60 * 1000; // 5 minutes in milliseconds + const futureTimestamp = new Date().getTime() + fiveMinutes; // Current time + 5 minutes + + const substrateFutureTimestamp = api.createType("u64", futureTimestamp); + + // dont have to convert + const to = { Raw: amount.address }; + + const assetNum = 1; + const sourceChannel = 0; + const timeout = { + Offset: { + timestamp: api.createType("Option", substrateFutureTimestamp), // or provide a specific timestamp offset + }, + }; + + // Construct paramters + const params = { + to, + source_channel: sourceChannel, + timeout, + }; + + const assetId = new BN(assetNum); + const amountBN = new BN(amount.amount, 10); + const memo = null; + + // Make the call to ibc.transfer with the transferObj + const call = api.tx.ibc.transfer(params, assetId, amountBN, memo); + // Sign and send the transaction + return await new Promise((resolve, reject) => { + call + .signAndSend( + senderKeypair, + { nonce: -1 }, + ({ status, dispatchError }) => { + if (status.isInBlock || status.isFinalized) { + if (dispatchError) { + if (dispatchError.isModule) { + // For module errors, we have the section indexed, lookup + const decoded = api.registry.findMetaError( + dispatchError.asModule + ); + const { docs, name, section } = decoded; + reject(new Error(`${section}.${name}: ${docs.join(" ")}`)); + } else { + // Other, CannotLookup, BadOrigin, no extra info + reject(new Error(dispatchError.toString())); + } + } else { + resolve(status.asFinalized.toString()); + } + } + } + ) + .catch(reject); + }); + } +} +// Example usage +async function main() { + const api = await getProvider(); + const wallets = getWallets(); + const senderKeypair = wallets.alice; + + const channelID = "0"; + const amount = { + denom: "1", + amount: "1000000000000000", + address: "pica1hj5fveer5cjtn4wd6wstzugjfdxzl0xpas3hgy", + }; + + const options = {}; + + try { + const hash = await sendIbcFundsTx( + api, + senderKeypair, + channelID, + amount, + options + ); + console.log("Transaction hash:", hash); + } catch (error) { + console.error("Error sending IBC funds:", error); + } +} + +main().catch(console.error); diff --git a/scripts/polkadot-js/src/simple-connect.ts b/scripts/polkadot-js/src/simple-connect.ts new file mode 100644 index 000000000..8f4bad209 --- /dev/null +++ b/scripts/polkadot-js/src/simple-connect.ts @@ -0,0 +1,25 @@ +// Required imports +import { ApiPromise, WsProvider } from "@polkadot/api"; + +async function main() { + // Initialise the provider to connect to the local node + const provider = new WsProvider("ws://127.0.0.1:9944"); + + // Create the API and wait until ready + const api = await ApiPromise.create({ provider }); + + // Retrieve the chain & node information via rpc calls + const [chain, nodeName, nodeVersion] = await Promise.all([ + api.rpc.system.chain(), + api.rpc.system.name(), + api.rpc.system.version(), + ]); + + console.log( + `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}` + ); +} + +main() + .catch(console.error) + .finally(() => process.exit()); diff --git a/scripts/polkadot-js/src/transfer.ts b/scripts/polkadot-js/src/transfer.ts new file mode 100644 index 000000000..52e2b7210 --- /dev/null +++ b/scripts/polkadot-js/src/transfer.ts @@ -0,0 +1,51 @@ +import { ApiPromise } from "@polkadot/api"; +import { Keyring } from "@polkadot/keyring"; +import { getProvider, getWallets } from "../utils/indexer"; + +// The amount to transfer +const amount = 1000; // Adjust the amount as needed + +async function transferFunds() { + const api = await getProvider(); + + console.log("hello"); + const wallets = getWallets(); + + console.log("Alice address: ", wallets.alice.address); + console.log("Bob address: ", wallets.bob.address); + + // Fetch the next nonce for the Alice's account + const { nonce } = (await api.query.system.account( + wallets.alice.address + )) as any; + + // Construct the transaction + const transfer = api.tx.balances.transfer(wallets.bob.address, amount); + + console.log( + `Transferring ${amount} from ${wallets.alice.address} to ${wallets.bob.address}` + ); + console.log(`Nonce: ${nonce}`); + + // Sign and send the transaction, and subscribe to its status updates + const unsub = await transfer.signAndSend( + wallets.alice, + ({ status, events }) => { + if (status.isInBlock) { + console.log(`Transaction included at blockHash ${status.asInBlock}`); + } else if (status.isFinalized) { + console.log(`Transaction finalized at blockHash ${status.asFinalized}`); + events.forEach(({ event: { data, method, section }, phase }) => { + console.log(`\t' ${phase}: ${section}.${method} ${data}`); + }); + + // Once finalized, we can unsubscribe from further updates + unsub(); + // Disconnect from the provider + api.disconnect(); + } + } + ); +} + +transferFunds(); diff --git a/scripts/polkadot-js/tsconfig.json b/scripts/polkadot-js/tsconfig.json new file mode 100644 index 000000000..b0678e34f --- /dev/null +++ b/scripts/polkadot-js/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "outDir": "./dist" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "**/*.spec.ts"] +} diff --git a/scripts/polkadot-js/utils/indexer.ts b/scripts/polkadot-js/utils/indexer.ts new file mode 100644 index 000000000..2d74fe12f --- /dev/null +++ b/scripts/polkadot-js/utils/indexer.ts @@ -0,0 +1,30 @@ +import { ApiPromise, WsProvider } from "@polkadot/api"; +import { Keyring } from "@polkadot/keyring"; +import { KeyringPair } from "@polkadot/keyring/types"; + +export type TestWallets = { + alice: KeyringPair; + bob: KeyringPair; +}; + +export const getProvider = async (): Promise => { + // Initialise the provider to connect to the local node + const wsEndpoint = "ws://127.0.0.1:9988"; + const provider = new WsProvider(wsEndpoint); + + console.log(`connection to provider at ${wsEndpoint}`); + + // Create the API and wait until ready + const api = await ApiPromise.create({ provider }); + + return api; +}; + +export const getWallets = (): TestWallets => { + // Add Alice to our keyring with a well-known development mnemonic + const keyring = new Keyring({ type: "sr25519" }); + const alice = keyring.addFromUri("//Alice"); + const bob = keyring.addFromUri("//Bob"); + + return { alice, bob }; +}; diff --git a/scripts/polkadot-js/yarn.lock b/scripts/polkadot-js/yarn.lock new file mode 100644 index 000000000..3153ee0e0 --- /dev/null +++ b/scripts/polkadot-js/yarn.lock @@ -0,0 +1,569 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@noble/curves@^1.3.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" + integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== + dependencies: + "@noble/hashes" "1.4.0" + +"@noble/hashes@1.4.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.3.3": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + +"@polkadot-api/client@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0": + version "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/client/-/client-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz#5d6b863f63f5c6ecd4183fcf0c5c84dd349f7627" + integrity sha512-0fqK6pUKcGHSG2pBvY+gfSS+1mMdjd/qRygAcKI5d05tKsnZLRnmhb9laDguKmGEIB0Bz9vQqNK3gIN/cfvVwg== + dependencies: + "@polkadot-api/metadata-builders" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@polkadot-api/substrate-bindings" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@polkadot-api/substrate-client" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@polkadot-api/utils" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + +"@polkadot-api/json-rpc-provider-proxy@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0": + version "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/json-rpc-provider-proxy/-/json-rpc-provider-proxy-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz#cc28fb801db6a47824261a709ab924ec6951eb96" + integrity sha512-0hZ8vtjcsyCX8AyqP2sqUHa1TFFfxGWmlXJkit0Nqp9b32MwZqn5eaUAiV2rNuEpoglKOdKnkGtUF8t5MoodKw== + +"@polkadot-api/json-rpc-provider@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0": + version "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/json-rpc-provider/-/json-rpc-provider-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz#2f71bfb192d28dd4c400ef8b1c5f934c676950f3" + integrity sha512-EaUS9Fc3wsiUr6ZS43PQqaRScW7kM6DYbuM/ou0aYjm8N9MBqgDbGm2oL6RE1vAVmOfEuHcXZuZkhzWtyvQUtA== + +"@polkadot-api/metadata-builders@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0": + version "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/metadata-builders/-/metadata-builders-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz#085db2a3c7b100626b2fae3be35a32a24ea7714f" + integrity sha512-BD7rruxChL1VXt0icC2gD45OtT9ofJlql0qIllHSRYgama1CR2Owt+ApInQxB+lWqM+xNOznZRpj8CXNDvKIMg== + dependencies: + "@polkadot-api/substrate-bindings" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@polkadot-api/utils" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + +"@polkadot-api/substrate-bindings@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0": + version "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/substrate-bindings/-/substrate-bindings-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz#f836a554a9ead6fb6356079c725cd53f87238932" + integrity sha512-N4vdrZopbsw8k57uG58ofO7nLXM4Ai7835XqakN27MkjXMp5H830A1KJE0L9sGQR7ukOCDEIHHcwXVrzmJ/PBg== + dependencies: + "@noble/hashes" "^1.3.1" + "@polkadot-api/utils" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@scure/base" "^1.1.1" + scale-ts "^1.6.0" + +"@polkadot-api/substrate-client@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0": + version "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/substrate-client/-/substrate-client-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz#55ae463f4143495e328465dd16b03e71663ef4c4" + integrity sha512-lcdvd2ssUmB1CPzF8s2dnNOqbrDa+nxaaGbuts+Vo8yjgSKwds2Lo7Oq+imZN4VKW7t9+uaVcKFLMF7PdH0RWw== + +"@polkadot-api/utils@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0": + version "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/utils/-/utils-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz#759698dcf948745ea37cc5ab6abd49a00f1b0c31" + integrity sha512-0CYaCjfLQJTCRCiYvZ81OncHXEKPzAexCMoVloR+v2nl/O2JRya/361MtPkeNLC6XBoaEgLAG9pWQpH3WePzsw== + +"@polkadot/api-augment@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-10.12.6.tgz#1e4d551e55509267dfe963d2d3af215140d7249f" + integrity sha512-CZHaFAd6zexk3JCm1mY5doE1E634xNpKaTGpbs61Ch285d5EqBY25GdzGNiMprNl4VyRFT4N7dXKfwEdsM6Z9w== + dependencies: + "@polkadot/api-base" "10.12.6" + "@polkadot/rpc-augment" "10.12.6" + "@polkadot/types" "10.12.6" + "@polkadot/types-augment" "10.12.6" + "@polkadot/types-codec" "10.12.6" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/api-base@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-10.12.6.tgz#5aabee701d0e18e76b9f20c116f26a85041a3087" + integrity sha512-6EzMettffiadB5j0X2nValtrEZJ2dKZMArfWHbSCV1QRSPOaMO3Phf/idqtF8HgBHD3FCHJ+JsZEns6xpkpteg== + dependencies: + "@polkadot/rpc-core" "10.12.6" + "@polkadot/types" "10.12.6" + "@polkadot/util" "^12.6.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api-derive@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-10.12.6.tgz#37b9fc7d026481eb6db76cdfb4683c70ee024eaa" + integrity sha512-stjciYU9caSvPrcPo40zwPu15O7Q9OK9ldMFyyQkDdUT4cCE0LHuCmTNwcm4XhQq3XXJn+e7WNdhBfquwvkuhw== + dependencies: + "@polkadot/api" "10.12.6" + "@polkadot/api-augment" "10.12.6" + "@polkadot/api-base" "10.12.6" + "@polkadot/rpc-core" "10.12.6" + "@polkadot/types" "10.12.6" + "@polkadot/types-codec" "10.12.6" + "@polkadot/util" "^12.6.2" + "@polkadot/util-crypto" "^12.6.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api@10.12.6", "@polkadot/api@^10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-10.12.6.tgz#d182acc4898350e920ad9a3b01d8ecbcf5359d49" + integrity sha512-qWF7qFLZtpSILuPeZcvz0oCBXe89XndDjzgCnflvEVIUkQvxtFM8mDXpzI4bz8klrLYHlyFbP7HJl/xLi+XTew== + dependencies: + "@polkadot/api-augment" "10.12.6" + "@polkadot/api-base" "10.12.6" + "@polkadot/api-derive" "10.12.6" + "@polkadot/keyring" "^12.6.2" + "@polkadot/rpc-augment" "10.12.6" + "@polkadot/rpc-core" "10.12.6" + "@polkadot/rpc-provider" "10.12.6" + "@polkadot/types" "10.12.6" + "@polkadot/types-augment" "10.12.6" + "@polkadot/types-codec" "10.12.6" + "@polkadot/types-create" "10.12.6" + "@polkadot/types-known" "10.12.6" + "@polkadot/util" "^12.6.2" + "@polkadot/util-crypto" "^12.6.2" + eventemitter3 "^5.0.1" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/keyring@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-12.6.2.tgz#6067e6294fee23728b008ac116e7e9db05cecb9b" + integrity sha512-O3Q7GVmRYm8q7HuB3S0+Yf/q/EB2egKRRU3fv9b3B7V+A52tKzA+vIwEmNVaD1g5FKW9oB97rmpggs0zaKFqHw== + dependencies: + "@polkadot/util" "12.6.2" + "@polkadot/util-crypto" "12.6.2" + tslib "^2.6.2" + +"@polkadot/networks@12.6.2", "@polkadot/networks@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-12.6.2.tgz#791779fee1d86cc5b6cd371858eea9b7c3f8720d" + integrity sha512-1oWtZm1IvPWqvMrldVH6NI2gBoCndl5GEwx7lAuQWGr7eNL+6Bdc5K3Z9T0MzFvDGoi2/CBqjX9dRKo39pDC/w== + dependencies: + "@polkadot/util" "12.6.2" + "@substrate/ss58-registry" "^1.44.0" + tslib "^2.6.2" + +"@polkadot/rpc-augment@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-10.12.6.tgz#1815e48c59109d0c8d9703035e9c7f376413201e" + integrity sha512-MMZgdZtVygHqgsmCdKhfaN9ywf6im72xJzc9H8fkqyoJ+cGVy36uI3e8YwEM9vV6g/nallFmz4mU46u8/TjGlw== + dependencies: + "@polkadot/rpc-core" "10.12.6" + "@polkadot/types" "10.12.6" + "@polkadot/types-codec" "10.12.6" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/rpc-core@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-10.12.6.tgz#5b855d7ee4a6571e3273687a08a85101f0980bfd" + integrity sha512-aBXhkryv2NMNg+cWajn/G0DF13inXIW+6iZV9cGc6lfsYT9Di/sasO0EIx7UUZW3ILYQ6Gh9jRgNLkwSNlAV9Q== + dependencies: + "@polkadot/rpc-augment" "10.12.6" + "@polkadot/rpc-provider" "10.12.6" + "@polkadot/types" "10.12.6" + "@polkadot/util" "^12.6.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/rpc-provider@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-10.12.6.tgz#6b2e454b7c70ddd87e0bac175f8b26b16bc67ad5" + integrity sha512-xLmzb2rMQXEWQlrIDY3E3IXo1jcV9+Vy3A8zMw/s/UIrwXZ3I0TefP8+mXcqEjLkkz7zwldDQvHfdmtnxdE14g== + dependencies: + "@polkadot/keyring" "^12.6.2" + "@polkadot/types" "10.12.6" + "@polkadot/types-support" "10.12.6" + "@polkadot/util" "^12.6.2" + "@polkadot/util-crypto" "^12.6.2" + "@polkadot/x-fetch" "^12.6.2" + "@polkadot/x-global" "^12.6.2" + "@polkadot/x-ws" "^12.6.2" + eventemitter3 "^5.0.1" + mock-socket "^9.3.1" + nock "^13.5.0" + tslib "^2.6.2" + optionalDependencies: + "@substrate/connect" "0.8.8" + +"@polkadot/types-augment@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-10.12.6.tgz#065f185040d793a170cfef5a9171b280f02731e7" + integrity sha512-eUNanLs0w7SQLlsjFs7kTPfOTclfjllJxghwRqWZFHWjUbVcGcPwr8ITv/mfx1WTCqUqLMe6K8CPJ7BSggAWBA== + dependencies: + "@polkadot/types" "10.12.6" + "@polkadot/types-codec" "10.12.6" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types-codec@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-10.12.6.tgz#5518b66f7620b2f35d7b2a66f900ab0fea68aa89" + integrity sha512-yCzKdj/mLhjSG3mR1XhQdzzpAy0Exv9UuEhGQHPpdjkF0CCfVgsFoOAF3ScsSzwacJxGgxPWvlk849DfTrBYGA== + dependencies: + "@polkadot/util" "^12.6.2" + "@polkadot/x-bigint" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types-create@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-10.12.6.tgz#ea5113f39e63c27cba9e9a84f7490233fa6f6a01" + integrity sha512-byuPy7IUFjzoxG3qrP4kEScfR92KFOAkaJksNT4kDZILPCeZSPPN7cLqdejypwDBqJthTJM0LqKK4g+eHGKdvw== + dependencies: + "@polkadot/types-codec" "10.12.6" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types-known@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-10.12.6.tgz#fe7966224167ac0e2995558ef3867885baf9d642" + integrity sha512-E/LWfOAPUW7YKAiioY7Ax/s+G4cuNQop3U/TPPM7sxXOv9hSia2hgFjtiU4NyTRVwf1O07YASXtYSecdSgcCuQ== + dependencies: + "@polkadot/networks" "^12.6.2" + "@polkadot/types" "10.12.6" + "@polkadot/types-codec" "10.12.6" + "@polkadot/types-create" "10.12.6" + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types-support@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-10.12.6.tgz#e2e4a18f88d7744c3b8b6e638f4081ea00cff23e" + integrity sha512-SMq/hUZJLCZXq26pNDaxgXNJqAJD8YhVXWXulCg0YvbIoVwEkFE66TEkUbtoRLKcsZXbPdxJ3JfSoa9r6Ewhnw== + dependencies: + "@polkadot/util" "^12.6.2" + tslib "^2.6.2" + +"@polkadot/types@10.12.6": + version "10.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-10.12.6.tgz#548843577d4ed04258eda39041402c789de679cf" + integrity sha512-ByjvZkKJclHSWEETk1m9HPYn/IdIyjWONOdy7Ih+/Nd0wVIahvXDYbV4CXe25xO0RhfFJzkGIZP+LFHL5F63Uw== + dependencies: + "@polkadot/keyring" "^12.6.2" + "@polkadot/types-augment" "10.12.6" + "@polkadot/types-codec" "10.12.6" + "@polkadot/types-create" "10.12.6" + "@polkadot/util" "^12.6.2" + "@polkadot/util-crypto" "^12.6.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/util-crypto@12.6.2", "@polkadot/util-crypto@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-12.6.2.tgz#d2d51010e8e8ca88951b7d864add797dad18bbfc" + integrity sha512-FEWI/dJ7wDMNN1WOzZAjQoIcCP/3vz3wvAp5QQm+lOrzOLj0iDmaIGIcBkz8HVm3ErfSe/uKP0KS4jgV/ib+Mg== + dependencies: + "@noble/curves" "^1.3.0" + "@noble/hashes" "^1.3.3" + "@polkadot/networks" "12.6.2" + "@polkadot/util" "12.6.2" + "@polkadot/wasm-crypto" "^7.3.2" + "@polkadot/wasm-util" "^7.3.2" + "@polkadot/x-bigint" "12.6.2" + "@polkadot/x-randomvalues" "12.6.2" + "@scure/base" "^1.1.5" + tslib "^2.6.2" + +"@polkadot/util@12.6.2", "@polkadot/util@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-12.6.2.tgz#9396eff491221e1f0fd28feac55fc16ecd61a8dc" + integrity sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw== + dependencies: + "@polkadot/x-bigint" "12.6.2" + "@polkadot/x-global" "12.6.2" + "@polkadot/x-textdecoder" "12.6.2" + "@polkadot/x-textencoder" "12.6.2" + "@types/bn.js" "^5.1.5" + bn.js "^5.2.1" + tslib "^2.6.2" + +"@polkadot/wasm-bridge@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-7.3.2.tgz#e1b01906b19e06cbca3d94f10f5666f2ae0baadc" + integrity sha512-AJEXChcf/nKXd5Q/YLEV5dXQMle3UNT7jcXYmIffZAo/KI394a+/24PaISyQjoNC0fkzS1Q8T5pnGGHmXiVz2g== + dependencies: + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto-asmjs@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.3.2.tgz#c6d41bc4b48b5359d57a24ca3066d239f2d70a34" + integrity sha512-QP5eiUqUFur/2UoF2KKKYJcesc71fXhQFLT3D4ZjG28Mfk2ZPI0QNRUfpcxVQmIUpV5USHg4geCBNuCYsMm20Q== + dependencies: + tslib "^2.6.2" + +"@polkadot/wasm-crypto-init@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.3.2.tgz#7e1fe79ba978fb0a4a0f74a92d976299d38bc4b8" + integrity sha512-FPq73zGmvZtnuJaFV44brze3Lkrki3b4PebxCy9Fplw8nTmisKo9Xxtfew08r0njyYh+uiJRAxPCXadkC9sc8g== + dependencies: + "@polkadot/wasm-bridge" "7.3.2" + "@polkadot/wasm-crypto-asmjs" "7.3.2" + "@polkadot/wasm-crypto-wasm" "7.3.2" + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto-wasm@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.3.2.tgz#44e08ed5cf6499ce4a3aa7247071a5d01f6a74f4" + integrity sha512-15wd0EMv9IXs5Abp1ZKpKKAVyZPhATIAHfKsyoWCEFDLSOA0/K0QGOxzrAlsrdUkiKZOq7uzSIgIDgW8okx2Mw== + dependencies: + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto@^7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-7.3.2.tgz#61bbcd9e591500705c8c591e6aff7654bdc8afc9" + integrity sha512-+neIDLSJ6jjVXsjyZ5oLSv16oIpwp+PxFqTUaZdZDoA2EyFRQB8pP7+qLsMNk+WJuhuJ4qXil/7XiOnZYZ+wxw== + dependencies: + "@polkadot/wasm-bridge" "7.3.2" + "@polkadot/wasm-crypto-asmjs" "7.3.2" + "@polkadot/wasm-crypto-init" "7.3.2" + "@polkadot/wasm-crypto-wasm" "7.3.2" + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-util@7.3.2", "@polkadot/wasm-util@^7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-7.3.2.tgz#4fe6370d2b029679b41a5c02cd7ebf42f9b28de1" + integrity sha512-bmD+Dxo1lTZyZNxbyPE380wd82QsX+43mgCm40boyKrRppXEyQmWT98v/Poc7chLuskYb6X8IQ6lvvK2bGR4Tg== + dependencies: + tslib "^2.6.2" + +"@polkadot/x-bigint@12.6.2", "@polkadot/x-bigint@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-12.6.2.tgz#59b7a615f205ae65e1ac67194aefde94d3344580" + integrity sha512-HSIk60uFPX4GOFZSnIF7VYJz7WZA7tpFJsne7SzxOooRwMTWEtw3fUpFy5cYYOeLh17/kHH1Y7SVcuxzVLc74Q== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + +"@polkadot/x-fetch@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-12.6.2.tgz#b1bca028db90263bafbad2636c18d838d842d439" + integrity sha512-8wM/Z9JJPWN1pzSpU7XxTI1ldj/AfC8hKioBlUahZ8gUiJaOF7K9XEFCrCDLis/A1BoOu7Ne6WMx/vsJJIbDWw== + dependencies: + "@polkadot/x-global" "12.6.2" + node-fetch "^3.3.2" + tslib "^2.6.2" + +"@polkadot/x-global@12.6.2", "@polkadot/x-global@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-12.6.2.tgz#31d4de1c3d4c44e4be3219555a6d91091decc4ec" + integrity sha512-a8d6m+PW98jmsYDtAWp88qS4dl8DyqUBsd0S+WgyfSMtpEXu6v9nXDgPZgwF5xdDvXhm+P0ZfVkVTnIGrScb5g== + dependencies: + tslib "^2.6.2" + +"@polkadot/x-randomvalues@12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-12.6.2.tgz#13fe3619368b8bf5cb73781554859b5ff9d900a2" + integrity sha512-Vr8uG7rH2IcNJwtyf5ebdODMcr0XjoCpUbI91Zv6AlKVYOGKZlKLYJHIwpTaKKB+7KPWyQrk4Mlym/rS7v9feg== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + +"@polkadot/x-textdecoder@12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz#b86da0f8e8178f1ca31a7158257e92aea90b10e4" + integrity sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + +"@polkadot/x-textencoder@12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz#81d23bd904a2c36137a395c865c5fefa21abfb44" + integrity sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + +"@polkadot/x-ws@^12.6.2": + version "12.6.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-12.6.2.tgz#b99094d8e53a03be1de903d13ba59adaaabc767a" + integrity sha512-cGZWo7K5eRRQCRl2LrcyCYsrc3lRbTlixZh3AzgU8uX4wASVGRlNWi/Hf4TtHNe1ExCDmxabJzdIsABIfrr7xw== + dependencies: + "@polkadot/x-global" "12.6.2" + tslib "^2.6.2" + ws "^8.15.1" + +"@scure/base@^1.1.1", "@scure/base@^1.1.5": + version "1.1.6" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.6.tgz#8ce5d304b436e4c84f896e0550c83e4d88cb917d" + integrity sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g== + +"@substrate/connect-extension-protocol@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.0.0.tgz#badaa6e6b5f7c7d56987d778f4944ddb83cd9ea7" + integrity sha512-nKu8pDrE3LNCEgJjZe1iGXzaD6OSIDD4Xzz/yo4KO9mQ6LBvf49BVrt4qxBFGL6++NneLiWUZGoh+VSd4PyVIg== + +"@substrate/connect-known-chains@^1.1.1": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@substrate/connect-known-chains/-/connect-known-chains-1.1.4.tgz#1b0b4b19c7bd0c1b3ed6f567a22e9fb9c42b8e64" + integrity sha512-iT+BdKqvKl/uBLd8BAJysFM1BaMZXRkaXBP2B7V7ob/EyNs5h0EMhTVbO6MJxV/IEOg5OKsyl6FUqQK7pKnqyw== + +"@substrate/connect@0.8.8": + version "0.8.8" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.8.8.tgz#80879f2241e2bd4f24a9aa25d7997fd91a5e68e3" + integrity sha512-zwaxuNEVI9bGt0rT8PEJiXOyebLIo6QN1SyiAHRPBOl6g3Sy0KKdSN8Jmyn++oXhVRD8aIe75/V8ZkS81T+BPQ== + dependencies: + "@substrate/connect-extension-protocol" "^2.0.0" + "@substrate/connect-known-chains" "^1.1.1" + "@substrate/light-client-extension-helpers" "^0.0.4" + smoldot "2.0.22" + +"@substrate/light-client-extension-helpers@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@substrate/light-client-extension-helpers/-/light-client-extension-helpers-0.0.4.tgz#a5958d5c1aac7df69f55bd90991aa935500f8124" + integrity sha512-vfKcigzL0SpiK+u9sX6dq2lQSDtuFLOxIJx2CKPouPEHIs8C+fpsufn52r19GQn+qDhU8POMPHOVoqLktj8UEA== + dependencies: + "@polkadot-api/client" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@polkadot-api/json-rpc-provider" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@polkadot-api/json-rpc-provider-proxy" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@polkadot-api/substrate-client" "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + "@substrate/connect-extension-protocol" "^2.0.0" + "@substrate/connect-known-chains" "^1.1.1" + rxjs "^7.8.1" + +"@substrate/ss58-registry@^1.44.0": + version "1.47.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.47.0.tgz#99b11fd3c16657f5eae483b3df7c545ca756d1fc" + integrity sha512-6kuIJedRcisUJS2pgksEH2jZf3hfSIVzqtFzs/AyjTW3ETbMg5q1Bb7VWa0WYaT6dTrEXp/6UoXM5B9pSIUmcw== + +"@types/bn.js@^5.1.5": + version "5.1.5" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" + integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "20.12.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.7.tgz#04080362fa3dd6c5822061aa3124f5c152cff384" + integrity sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg== + dependencies: + undici-types "~5.26.4" + +bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +data-uri-to-buffer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" + integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== + +debug@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== + +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + +mock-socket@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/mock-socket/-/mock-socket-9.3.1.tgz#24fb00c2f573c84812aa4a24181bb025de80cc8e" + integrity sha512-qxBgB7Qa2sEQgHFjj0dSigq7fX4k6Saisd5Nelwp2q8mlbAFh5dHV9JTTlF8viYJLSSWgMCZFUom8PJcMNBoJw== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nock@^13.5.0: + version "13.5.4" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.5.4.tgz#8918f0addc70a63736170fef7106a9721e0dc479" + integrity sha512-yAyTfdeNJGGBFxWdzSKCBYxs5FxLbCg5X5Q4ets974hcQzG1+qCxvIyOo4j2Ry6MUlhWVMX4OoYDefAIIwupjw== + dependencies: + debug "^4.1.0" + json-stringify-safe "^5.0.1" + propagate "^2.0.0" + +node-domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== + +node-fetch@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" + integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== + dependencies: + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" + +propagate@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" + integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== + +rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + +scale-ts@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/scale-ts/-/scale-ts-1.6.0.tgz#e9641093c5a9e50f964ddb1607139034e3e932e9" + integrity sha512-Ja5VCjNZR8TGKhUumy9clVVxcDpM+YFjAnkMuwQy68Hixio3VRRvWdE3g8T/yC+HXA0ZDQl2TGyUmtmbcVl40Q== + +smoldot@2.0.22: + version "2.0.22" + resolved "https://registry.yarnpkg.com/smoldot/-/smoldot-2.0.22.tgz#1e924d2011a31c57416e79a2b97a460f462a31c7" + integrity sha512-B50vRgTY6v3baYH6uCgL15tfaag5tcS2o/P5q1OiXcKGv1axZDfz2dzzMuIkVpyMR2ug11F6EAtQlmYBQd292g== + dependencies: + ws "^8.8.1" + +tslib@^2.1.0, tslib@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + +typescript@^5.4.5: + version "5.4.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" + integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +web-streams-polyfill@^3.0.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" + integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== + +ws@^8.15.1, ws@^8.8.1: + version "8.16.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" + integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== diff --git a/scripts/relayer_hyperspace/config-chain-a.toml b/scripts/relayer_hyperspace/config-chain-a.toml index 90887e8f1..7ae746d59 100644 --- a/scripts/relayer_hyperspace/config-chain-a.toml +++ b/scripts/relayer_hyperspace/config-chain-a.toml @@ -1,6 +1,6 @@ type = "parachain" name = "picasso_dev" -para_id = 2000 +para_id = 2001 parachain_rpc_url = "ws://127.0.0.1:9988" relay_chain_rpc_url = "ws://127.0.0.1:9944" client_id = "08-wasm-0" @@ -8,6 +8,6 @@ connection_id = "connection-0" commitment_prefix = "0x6962632f" private_key = "//Alice" ss58_version = 49 -channel_whitelist = [["channel-0", "transfer"], ["channel-0", "transfer"]] +channel_whitelist = [["channel-0", "transfer"], ["channel-0", "transfer"], ["channel-0", "transfer"]] finality_protocol = "Grandpa" key_type = "sr25519" diff --git a/scripts/relayer_hyperspace/config-chain-b.toml b/scripts/relayer_hyperspace/config-chain-b.toml index 68ca875f7..5fb4d827a 100644 --- a/scripts/relayer_hyperspace/config-chain-b.toml +++ b/scripts/relayer_hyperspace/config-chain-b.toml @@ -4,7 +4,7 @@ rpc_url = "http://127.0.0.1:26657/" grpc_url = "http://127.0.0.1:9090/" websocket_url = "ws://127.0.0.1:26657/websocket" chain_id = "centauri-dev" -client_id = "07-tendermint-1" +client_id = "07-tendermint-2" connection_id = "connection-0" account_prefix = "pica" fee_denom = "ppica" @@ -12,8 +12,8 @@ fee_amount = "9223372036854776" gas_limit = 9223372036854775806 store_prefix = "ibc" max_tx_size = 20000000 -wasm_code_id = "9d5056f2b551213094a03b788db80274445175bae78c8fede38bf25a2ddc84bc" -channel_whitelist = [["channel-0", "transfer"], ["channel-0", "transfer"]] +wasm_checksum = "3e743bf804a60e5fd1dfab6c61bba0f2e76cda260edc66d6b7b10691fb5096c1" +channel_whitelist = [["channel-0", "transfer"], ["channel-0", "transfer"], ["channel-0", "transfer"]] mnemonic = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry" skip_optional_client_updates = false max_packets_to_process = 50 diff --git a/scripts/relayer_hyperspace/create-clients.sh b/scripts/relayer_hyperspace/create-clients.sh index 451db1141..30cfc4a39 100755 --- a/scripts/relayer_hyperspace/create-clients.sh +++ b/scripts/relayer_hyperspace/create-clients.sh @@ -1,2 +1,2 @@ -RUST_LOG=hyperspace_cosmos=trace,hyperspace=trace,info /home/kien6034/notional/composable-ibc/target/release/hyperspace create-clients --config-a scripts/relayer_hyperspace/config-chain-a.toml --config-b scripts/relayer_hyperspace/config-chain-b.toml --config-core scripts/relayer_hyperspace/config-core.toml --delay-period 10 +RUST_LOG=hyperspace_cosmos=trace,hyperspace=trace,info /home/kien6034/notional/composable-ibc/target/release/hyperspace create-clients --config-a scripts/relayer_hyperspace/config-chain-a.toml --config-b scripts/relayer_hyperspace/config-chain-b.toml --config-core scripts/relayer_hyperspace/config-core.toml --delay-period 10 \ No newline at end of file diff --git a/scripts/upgrade/setup-old-picad-node.sh b/scripts/upgrade/setup-old-picad-node.sh index 60238677b..3d43d0f66 100755 --- a/scripts/upgrade/setup-old-picad-node.sh +++ b/scripts/upgrade/setup-old-picad-node.sh @@ -8,7 +8,6 @@ BINARY=_build/old/picad HOME=mytestnet ROOT=$(pwd) DENOM=ppica -CHAIN_ID=centaurid ADDITIONAL_PRE_SCRIPTS="./scripts/upgrade/old-node-scripts.sh" diff --git a/scripts/upgrade/setup-polkadot-node.sh b/scripts/upgrade/setup-polkadot-node.sh index 5e6829d7b..b47d6e2b3 100755 --- a/scripts/upgrade/setup-polkadot-node.sh +++ b/scripts/upgrade/setup-polkadot-node.sh @@ -1,3 +1,3 @@ export PARA_HOST=127.0.0.1 -cd /home/kien6034/notional/composable-ibc-old/scripts/zombienet # TODO: remove hardfix -process-compose up -f process-compose.yml -t=false & sleep 100 \ No newline at end of file +cd /home/kien6034/notional/composable-ibc-old/scripts/zombienet +process-compose up -f process-compose.yml & sleep 100 \ No newline at end of file From 3ee9ce5d32b1eecf3f24dd3489275f7374c25281 Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Mon, 20 May 2024 00:00:38 +0700 Subject: [PATCH 2/3] feat: add polkadot js to test --- Makefile | 14 ++++++------ scripts/upgrade/setup-nix-polkadot.sh | 32 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 7 deletions(-) create mode 100755 scripts/upgrade/setup-nix-polkadot.sh diff --git a/Makefile b/Makefile index 1c387f5dd..ea146c8ce 100644 --- a/Makefile +++ b/Makefile @@ -167,10 +167,16 @@ test-upgrade: clean-testing-data clean-testing-data: @echo "Killing binary and removing previous data" + echo "stopping picachain..." -@pkill picad 2>/dev/null - -@pkill rly 2>/dev/null -@rm -rf ./mytestnet + echo "stopping parachain..." + -@killall parachain-node + -@killall polkadot + + netstat -ltup | grep LISTEN + .PHONY: ictest-start-cosmos ictest-start-polkadot ictest-ibc ictest-push-wasm ictest-all include contrib/make/release.mk @@ -181,12 +187,6 @@ test-upgrade: clean-testing-data ./scripts/tweak-test-upgrade.sh -clean-testing-data: - @echo "Killing binary and removing previous data" - -@pkill centaurid 2>/dev/null - -@pkill picad 2>/dev/null - -@rm -rf ./screenlog.0 - -@rm -rf ./mytestnet ## Scripts for testing sdk 50 init-deps: diff --git a/scripts/upgrade/setup-nix-polkadot.sh b/scripts/upgrade/setup-nix-polkadot.sh new file mode 100755 index 000000000..df3fe6856 --- /dev/null +++ b/scripts/upgrade/setup-nix-polkadot.sh @@ -0,0 +1,32 @@ +ROOT=$(pwd) + +cd $ROOT/_build/composable + +# Set the maximum number of attempts +max_attempts=30 + +# Initialize the attempt counter +attempt=1 + +while [ $attempt -le $max_attempts ]; do + echo "Attempt $attempt of $max_attempts" + nix run .#zombienet-rococo-local-picasso-dev + + # Check if the command was successful + if [ $? -eq 0 ]; then + echo "Command executed successfully." + break + else + echo "Command failed, retrying..." + echo "attemp: $attempt" + ((attempt++)) + fi + + # Optional: sleep for a few seconds before retrying + sleep 2 +done + +# Check if all attempts failed +if [ $attempt -gt $max_attempts ]; then + echo "All attempts failed." +fi \ No newline at end of file From 626bf0b151227573f52953da5205ebd9a4d7ebf2 Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Mon, 20 May 2024 02:28:16 +0700 Subject: [PATCH 3/3] fix: register subspace ibc transfer --- Makefile | 4 ++-- app/keepers/keepers.go | 2 +- app/upgrades/v7_0_1/upgrade.go | 5 ++++- scripts/relayer_hyperspace/config-chain-b.toml | 4 ++-- scripts/upgrade/upgrade.sh | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index ea146c8ce..e5ec23302 100644 --- a/Makefile +++ b/Makefile @@ -200,9 +200,9 @@ localnet-pica: bash ./scripts/run-node.sh picad bash ./scripts/50/store-wasm-code.sh -localnet-picasso: +localnet-parachain: @echo "Starting localnet" - bash ./scripts/relayer_hyperspace/run-picasso.sh + bash ./scripts/upgrade/setup-polkadot-node.sh relayer-create-clients: @echo "Starting relayer" diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 1a4c7dd0c..4d5c1a9bb 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -566,7 +566,7 @@ func (appKeepers *AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legac keyTable := ibcclienttypes.ParamKeyTable() keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) + paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable()) paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable()) paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable()) diff --git a/app/upgrades/v7_0_1/upgrade.go b/app/upgrades/v7_0_1/upgrade.go index e608bab7b..7d86057d7 100644 --- a/app/upgrades/v7_0_1/upgrade.go +++ b/app/upgrades/v7_0_1/upgrade.go @@ -2,9 +2,10 @@ package v7_0_1 import ( "context" - upgradetypes "cosmossdk.io/x/upgrade/types" "encoding/hex" "fmt" + + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -53,6 +54,8 @@ func CreateUpgradeHandler( listCheckSum = append(listCheckSum, checksumStr) } + // Register SendEnabled for legacy subspace + checksum := types.Checksums{Checksums: listCheckSum} bz, err := codec.Marshal(&checksum) if err != nil { diff --git a/scripts/relayer_hyperspace/config-chain-b.toml b/scripts/relayer_hyperspace/config-chain-b.toml index 5fb4d827a..532aa4864 100644 --- a/scripts/relayer_hyperspace/config-chain-b.toml +++ b/scripts/relayer_hyperspace/config-chain-b.toml @@ -4,7 +4,7 @@ rpc_url = "http://127.0.0.1:26657/" grpc_url = "http://127.0.0.1:9090/" websocket_url = "ws://127.0.0.1:26657/websocket" chain_id = "centauri-dev" -client_id = "07-tendermint-2" +client_id = "07-tendermint-0" connection_id = "connection-0" account_prefix = "pica" fee_denom = "ppica" @@ -12,7 +12,7 @@ fee_amount = "9223372036854776" gas_limit = 9223372036854775806 store_prefix = "ibc" max_tx_size = 20000000 -wasm_checksum = "3e743bf804a60e5fd1dfab6c61bba0f2e76cda260edc66d6b7b10691fb5096c1" +wasm_code_id = "9d5056f2b551213094a03b788db80274445175bae78c8fede38bf25a2ddc84bc" channel_whitelist = [["channel-0", "transfer"], ["channel-0", "transfer"], ["channel-0", "transfer"]] mnemonic = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry" skip_optional_client_updates = false diff --git a/scripts/upgrade/upgrade.sh b/scripts/upgrade/upgrade.sh index eaff8c9fc..8be5bd57f 100755 --- a/scripts/upgrade/upgrade.sh +++ b/scripts/upgrade/upgrade.sh @@ -7,8 +7,8 @@ ROOT=$(pwd) DENOM=ppica CHAIN_ID=centauri-dev SOFTWARE_UPGRADE_NAME="v7_0_1" -ADDITIONAL_PRE_SCRIPTS="./scripts/upgrade/v_6_4_8/pre-script.sh" -ADDITIONAL_AFTER_SCRIPTS="./scripts/upgrade/v_6_4_8/post-script.sh" +ADDITIONAL_PRE_SCRIPTS="./scripts/upgrade/v_6_6_0/pre-script.sh" +ADDITIONAL_AFTER_SCRIPTS="./scripts/upgrade/v_6_6_0/post-script.sh" KEY="mykey" KEY1="mykey1"