From 7c7a90fe4bd995a574ac0709a31d1702edb3e734 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Tue, 20 Jun 2023 20:56:20 -0400 Subject: [PATCH 01/12] changed sensitive input to interactive or env vars --- scripts/cc-cli/src/commands/bond.ts | 13 +- scripts/cc-cli/src/commands/chill.ts | 12 +- .../cc-cli/src/commands/distributeRewards.ts | 9 +- scripts/cc-cli/src/commands/newSeed.ts | 12 +- scripts/cc-cli/src/commands/send.ts | 14 +- scripts/cc-cli/src/commands/setKeys.ts | 12 +- scripts/cc-cli/src/commands/showAddress.ts | 14 +- scripts/cc-cli/src/commands/unbond.ts | 9 +- scripts/cc-cli/src/commands/validate.ts | 14 +- .../cc-cli/src/commands/withdrawUnbonded.ts | 12 +- scripts/cc-cli/src/commands/wizard.ts | 55 +- scripts/cc-cli/src/utils/account.ts | 36 +- scripts/cc-cli/yarn.lock | 592 +++++++++--------- 13 files changed, 356 insertions(+), 448 deletions(-) diff --git a/scripts/cc-cli/src/commands/bond.ts b/scripts/cc-cli/src/commands/bond.ts index 01c3b469d6..42ff33e1fe 100644 --- a/scripts/cc-cli/src/commands/bond.ts +++ b/scripts/cc-cli/src/commands/bond.ts @@ -2,22 +2,17 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; import { checkAddress, - getSeedFromOptions, - initKeyringPair, + getStashSeedFromEnvOrPrompt, + initKeyringPair } from "../utils/account"; +import { Balance, getBalance, toMicrounits } from "../utils/balance"; import { bond, parseRewardDestination } from "../utils/bond"; import { promptContinue } from "../utils/promptContinue"; -import { Balance, getBalance, toMicrounits } from "../utils/balance"; export function makeBondCommand() { const cmd = new Command("bond"); cmd.description("Bond CTC from a Stash account"); cmd.option("-a, --amount [amount]", "Amount to bond"); - cmd.option("-s, --seed [seed phrase]", "Specify seed phrase to bond from"); - cmd.option( - "-f, --file [file-name]", - "Specify file with seed phrase to bond from" - ); cmd.option("-c, --controller [controller]", "Specify controller address"); cmd.option( "-r, --reward-destination [reward-destination]", @@ -43,7 +38,7 @@ async function bondAction(options: OptionValues) { process.exit(1); } - const stashSeed = getSeedFromOptions(options); + const stashSeed = await getStashSeedFromEnvOrPrompt(); // Check balance const stashKeyring = initKeyringPair(stashSeed); diff --git a/scripts/cc-cli/src/commands/chill.ts b/scripts/cc-cli/src/commands/chill.ts index 69815cd3f0..34e043ce5f 100644 --- a/scripts/cc-cli/src/commands/chill.ts +++ b/scripts/cc-cli/src/commands/chill.ts @@ -1,6 +1,6 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getSeedFromOptions } from "../utils/account"; +import { getControllerSeedFromEnvOrPrompt } from "../utils/account"; import { chill } from "../utils/validate"; export function makeChillCommand() { @@ -8,14 +8,6 @@ export function makeChillCommand() { cmd.description( "Signal intention to stop validating from a Controller account" ); - cmd.option( - "-s, --seed [seed phrase]", - "Specify seed phrase of controller account" - ); - cmd.option( - "-f, --file [file-name]", - "Specify file with seed phrase of controller account" - ); cmd.action(chillAction); return cmd; } @@ -23,7 +15,7 @@ export function makeChillCommand() { async function chillAction(options: OptionValues) { const { api } = await newApi(options.url); - const controllerSeed = getSeedFromOptions(options); + const controllerSeed = await getControllerSeedFromEnvOrPrompt(); console.log("Creating chill transaction..."); diff --git a/scripts/cc-cli/src/commands/distributeRewards.ts b/scripts/cc-cli/src/commands/distributeRewards.ts index d8fe948c75..9cf8a13122 100644 --- a/scripts/cc-cli/src/commands/distributeRewards.ts +++ b/scripts/cc-cli/src/commands/distributeRewards.ts @@ -1,15 +1,10 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getSeedFromOptions, initKeyringPair } from "../utils/account"; +import { getSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; export function makeDistributeRewardsCommand() { const cmd = new Command("distribute-rewards"); cmd.description("Distribute all pending rewards for all validators"); - cmd.option("-s, --seed [mnemonic]", "Specify mnemonic phrase to use"); - cmd.option( - "-f, --file [file-name]", - "Specify file with mnemonic phrase to use" - ); cmd.option( "-v, --validator-id [validator-id]", "Specify validator to distribute rewards for" @@ -22,7 +17,6 @@ export function makeDistributeRewardsCommand() { async function distributeRewardsAction(options: OptionValues) { const { api } = await newApi(options.url); - const signerSeed = getSeedFromOptions(options); if (!options.validatorId) { console.log("Must specify a validator to distribute rewards for"); @@ -34,6 +28,7 @@ async function distributeRewardsAction(options: OptionValues) { process.exit(1); } + const signerSeed = await getSeedFromEnvOrPrompt(process.env.CC_SEED, "Specify caller's seed phrase"); const distributeTx = api.tx.staking.payoutStakers( options.validatorId, options.era diff --git a/scripts/cc-cli/src/commands/newSeed.ts b/scripts/cc-cli/src/commands/newSeed.ts index 677a112cf5..2546e5ebbc 100644 --- a/scripts/cc-cli/src/commands/newSeed.ts +++ b/scripts/cc-cli/src/commands/newSeed.ts @@ -1,12 +1,10 @@ -import { Command, OptionValues } from "commander"; import { mnemonicGenerate } from "@polkadot/util-crypto"; -import { writeFileSync } from "fs"; +import { Command, OptionValues } from "commander"; export function makeNewSeedCommand() { const cmd = new Command("new"); cmd.description("Create new seed phrase"); cmd.option("-l, --length [word-length]", "Specify the amount of words"); - cmd.option("-s, --save [file-name]", "Save the new seed to a file"); cmd.action(newSeedAction); return cmd; } @@ -16,12 +14,6 @@ function newSeedAction(options: OptionValues) { const seedPhrase = options.length ? mnemonicGenerate(options.length) : mnemonicGenerate(); - if (options.save) { - console.log("Saving seed to file:", options.save); - // Write seed phrase to a file - writeFileSync(options.save, seedPhrase); - } else { - console.log("Seed phrase:", seedPhrase); - } + console.log("Seed phrase:", seedPhrase); process.exit(0); } diff --git a/scripts/cc-cli/src/commands/send.ts b/scripts/cc-cli/src/commands/send.ts index 3f89606dde..7c2c8b6e74 100644 --- a/scripts/cc-cli/src/commands/send.ts +++ b/scripts/cc-cli/src/commands/send.ts @@ -2,22 +2,14 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; import { checkAddress, - getSeedFromOptions, - initKeyringPair, + getStashSeedFromEnvOrPrompt, + initKeyringPair } from "../utils/account"; import { toMicrounits } from "../utils/balance"; export function makeSendCommand() { const cmd = new Command("send"); cmd.description("Send CTC from an account"); - cmd.option( - "-s, --seed [mnemonic]", - "Specify mnemonic phrase to use for sending CTC" - ); - cmd.option( - "-f, --file [file-name]", - "Specify file with mnemonic phrase to use for sending CTC" - ); cmd.option("-a, --amount [amount]", "Amount to send"); cmd.option("-t, --to [to]", "Specify recipient address"); cmd.action(sendAction); @@ -32,7 +24,7 @@ async function sendAction(options: OptionValues) { checkAddress(options.to, api); // Build account - const seed = getSeedFromOptions(options); + const seed = await getStashSeedFromEnvOrPrompt(); const stash = initKeyringPair(seed); // Send transaction diff --git a/scripts/cc-cli/src/commands/setKeys.ts b/scripts/cc-cli/src/commands/setKeys.ts index 0edea1282b..c508198783 100644 --- a/scripts/cc-cli/src/commands/setKeys.ts +++ b/scripts/cc-cli/src/commands/setKeys.ts @@ -1,18 +1,10 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getSeedFromOptions, initKeyringPair } from "../utils/account"; +import { getStashSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; export function makeSetKeysCommand() { const cmd = new Command("set-keys"); cmd.description("Set session keys for a Controller account"); - cmd.option( - "-s, --seed [mnemonic]", - "Specify mnemonic phrase to set keys from" - ); - cmd.option( - "-f, --file [file-name]", - "Specify file with mnemonic phrase to set keys from" - ); cmd.option("-k, --keys [keys]", "Specify keys to set"); cmd.option("-r, --rotate", "Rotate and set new keys"); @@ -24,7 +16,7 @@ async function setKeysAction(options: OptionValues) { const { api } = await newApi(options.url); // Build account - const seed = getSeedFromOptions(options); + const seed = await getStashSeedFromEnvOrPrompt(); const stash = initKeyringPair(seed); let keys; diff --git a/scripts/cc-cli/src/commands/showAddress.ts b/scripts/cc-cli/src/commands/showAddress.ts index cf9f0814a0..3768818f74 100644 --- a/scripts/cc-cli/src/commands/showAddress.ts +++ b/scripts/cc-cli/src/commands/showAddress.ts @@ -1,25 +1,17 @@ -import { Command, OptionValues } from "commander"; -import { getSeedFromOptions, initKeyringPair } from "../utils/account"; import { cryptoWaitReady } from "@polkadot/util-crypto"; +import { Command, OptionValues } from "commander"; +import { getSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; export function makeShowAddressCommand() { const cmd = new Command("show-address"); cmd.description("Show account address"); - cmd.option( - "-s, --seed [mnemonic]", - "Specify mnemonic phrase to use of account" - ); - cmd.option( - "-f, --file [file-name]", - "Specify file with mnemonic phrase of account" - ); cmd.action(showAddressAction); return cmd; } async function showAddressAction(options: OptionValues) { await cryptoWaitReady(); - const seed = getSeedFromOptions(options); + const seed = await getSeedFromEnvOrPrompt(process.env.CC_SEED, "Specify seed phrase"); const pair = initKeyringPair(seed); const address = pair.address; diff --git a/scripts/cc-cli/src/commands/unbond.ts b/scripts/cc-cli/src/commands/unbond.ts index 015655d831..5541186112 100644 --- a/scripts/cc-cli/src/commands/unbond.ts +++ b/scripts/cc-cli/src/commands/unbond.ts @@ -1,16 +1,11 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getSeedFromOptions, initKeyringPair } from "../utils/account"; +import { getStashSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; import { toMicrounits } from "../utils/balance"; export function makeUnbondCommand() { const cmd = new Command("unbond"); cmd.description("Schedule a portion of the stash to be unlocked"); - cmd.option("-s, --seed [mnemonic]", "Specify mnemonic phrase to use"); - cmd.option( - "-f, --file [file-name]", - "Specify file with mnemonic phrase to use" - ); cmd.option("-a, --amount [amount]", "Amount to send"); cmd.action(unbondAction); return cmd; @@ -23,7 +18,7 @@ async function unbondAction(options: OptionValues) { checkAmount(options); // Build account - const seed = getSeedFromOptions(options); + const seed = await getStashSeedFromEnvOrPrompt(); const stash = initKeyringPair(seed); // Unbond transaction diff --git a/scripts/cc-cli/src/commands/validate.ts b/scripts/cc-cli/src/commands/validate.ts index 847f3b5685..23cc902194 100644 --- a/scripts/cc-cli/src/commands/validate.ts +++ b/scripts/cc-cli/src/commands/validate.ts @@ -1,20 +1,12 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getSeedFromOptions } from "../utils/account"; -import { StakingPalletValidatorPrefs, validate } from "../utils/validate"; +import { getStashSeedFromEnvOrPrompt } from "../utils/account"; import { perbillFromPercent } from "../utils/perbill"; +import { StakingPalletValidatorPrefs, validate } from "../utils/validate"; export function makeValidateCommand() { const cmd = new Command("validate"); cmd.description("Signal intention to validate from a Controller account"); - cmd.option( - "-s, --seed [mnemonic]", - "Specify mnemonic phrase to use for new account" - ); - cmd.option( - "-f, --file [file-name]", - "Specify file with mnemonic phrase to use for new account" - ); cmd.option( "--commission [commission]", "Specify commission for validator in percent" @@ -30,7 +22,7 @@ export function makeValidateCommand() { async function validateAction(options: OptionValues) { const { api } = await newApi(options.url); - const stashSeed = getSeedFromOptions(options); + const stashSeed = await getStashSeedFromEnvOrPrompt(); const commission = options.commission ? perbillFromPercent(options.commission) diff --git a/scripts/cc-cli/src/commands/withdrawUnbonded.ts b/scripts/cc-cli/src/commands/withdrawUnbonded.ts index 0410438245..02da288a9d 100644 --- a/scripts/cc-cli/src/commands/withdrawUnbonded.ts +++ b/scripts/cc-cli/src/commands/withdrawUnbonded.ts @@ -1,18 +1,10 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getSeedFromOptions, initKeyringPair } from "../utils/account"; +import { getStashSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; export function makeWithdrawUnbondedCommand() { const cmd = new Command("withdraw-unbonded"); cmd.description("Withdraw unbonded funds from a stash account"); - cmd.option( - "-s, --seed [mnemonic]", - "Specify mnemonic phrase to withdraw from" - ); - cmd.option( - "-f, --file [file-name]", - "Specify file with mnemonic phrase to withdraw from" - ); cmd.option("-a, --amount [amount]", "Amount to withdraw"); cmd.action(withdrawUnbondedAction); return cmd; @@ -21,7 +13,7 @@ export function makeWithdrawUnbondedCommand() { async function withdrawUnbondedAction(options: OptionValues) { const { api } = await newApi(options.url); - const stashSeed = getSeedFromOptions(options); + const stashSeed = await getStashSeedFromEnvOrPrompt(); const stashAccount = initKeyringPair(stashSeed); const slashingSpans = await api.query.staking.slashingSpans( stashAccount.address diff --git a/scripts/cc-cli/src/commands/wizard.ts b/scripts/cc-cli/src/commands/wizard.ts index 98e476c48b..731a664589 100644 --- a/scripts/cc-cli/src/commands/wizard.ts +++ b/scripts/cc-cli/src/commands/wizard.ts @@ -1,40 +1,23 @@ import { Command, OptionValues } from "commander"; +import { BN } from "creditcoin-js"; import { newApi } from "../api"; -import { readFileSync } from "fs"; -import { initKeyringPair } from "../utils/account"; -import { promptContinue, promptContinueOrSkip } from "../utils/promptContinue"; -import { bond, parseRewardDestination } from "../utils/bond"; -import { StakingPalletValidatorPrefs } from "../utils/validate"; -import { perbillFromPercent, percentFromPerbill } from "../utils/perbill"; +import { getControllerSeedFromEnvOrPrompt, getStashSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; import { Balance, getBalance, printBalance, toMicrounits, } from "../utils/balance"; -import { BN } from "creditcoin-js"; +import { bond, parseRewardDestination } from "../utils/bond"; +import { perbillFromPercent, percentFromPerbill } from "../utils/perbill"; +import { promptContinue, promptContinueOrSkip } from "../utils/promptContinue"; +import { StakingPalletValidatorPrefs } from "../utils/validate"; export function makeWizardCommand() { const cmd = new Command("wizard"); cmd.description( "Run the validator setup wizard. Only requires funded stash and controller accounts." ); - cmd.option( - "-ss, --stash-seed [stash-seed]", - "Specify mnemonic phrase to use for stash account" - ); - cmd.option( - "-sf, --stash-file [stash-file]", - "Specify file with mnemonic phrase to use for stash account" - ); - cmd.option( - "-cs, --controller-seed [controller-seed]", - "Specify mnemonic phrase to use for controller account" - ); - cmd.option( - "-cf, --controller-file [controller-file]", - "Specify file with mnemonic phrase to use for controller account" - ); cmd.option( "-r, --reward-destination [reward-destination]", "Specify reward destination account to use for new account" @@ -52,12 +35,12 @@ export function makeWizardCommand() { const { api } = await newApi(options.url); // Generate stash keyring - const stashSeed = getStashSeedFromOptions(options); + const stashSeed = await getStashSeedFromEnvOrPrompt(); const stashKeyring = initKeyringPair(stashSeed); const stashAddress = stashKeyring.address; // Generate controller keyring - const controllerSeed = getControllerSeedFromOptions(options); + const controllerSeed = await getControllerSeedFromEnvOrPrompt(); const controllerKeyring = initKeyringPair(controllerSeed); const controllerAddress = controllerKeyring.address; @@ -164,28 +147,6 @@ export function makeWizardCommand() { return cmd; } -function getStashSeedFromOptions(options: OptionValues) { - if (options.stashSeed) { - return options.stashSeed; - } else if (options.stashFile) { - return readFileSync(options.stashFile).toString(); - } else { - console.log("Must specify either seed or file for the Stash account"); - process.exit(1); - } -} - -function getControllerSeedFromOptions(options: OptionValues) { - if (options.controllerSeed) { - return options.controllerSeed; - } else if (options.controllerFile) { - return readFileSync(options.controllerFile).toString(); - } else { - console.log("Must specify either seed or file for the Controller account"); - process.exit(1); - } -} - function checkControllerBalance( address: string, balance: Balance, diff --git a/scripts/cc-cli/src/utils/account.ts b/scripts/cc-cli/src/utils/account.ts index 0f1a86e522..3b98e34b9a 100644 --- a/scripts/cc-cli/src/utils/account.ts +++ b/scripts/cc-cli/src/utils/account.ts @@ -1,6 +1,6 @@ +import { mnemonicValidate } from "@polkadot/util-crypto"; import { ApiPromise, Keyring } from "creditcoin-js"; -import { OptionValues } from "commander"; -import { readFileSync } from "fs"; +import prompts from "prompts"; export function initKeyringPair(seed: string) { const keyring = new Keyring({ type: "sr25519" }); @@ -8,14 +8,32 @@ export function initKeyringPair(seed: string) { return pair; } -export function getSeedFromOptions(options: OptionValues) { - if (options.seed) { - return options.seed; - } else if (options.file) { - return readFileSync(options.file).toString(); - } else { - throw new Error("Must specify either mnemonic phrase or file as an option"); +export async function getStashSeedFromEnvOrPrompt() { + return await getSeedFromEnvOrPrompt( + process.env.CC_STASH_SEED, + "Specify a seed phrase for the Stash account" + ); +} +export async function getControllerSeedFromEnvOrPrompt() { + return await getSeedFromEnvOrPrompt( + process.env.CC_CONTROLLER_SEED, + "Specify a seed phrase for the Controller account" + ); +} + +export async function getSeedFromEnvOrPrompt(envVar?: string | undefined, promptStr?: string | null) { + if (envVar && mnemonicValidate(envVar)) { + return envVar; } + let seedPromptResult = await prompts([ + { + type: "invisible", + name: "seed", + message: promptStr ? promptStr : "Enter seed phrase", + validate: seed => mnemonicValidate(seed) + } + ]); + return seedPromptResult.seed; } export function checkAddress(address: string, api: ApiPromise) { diff --git a/scripts/cc-cli/yarn.lock b/scripts/cc-cli/yarn.lock index 1a12ae500d..e8d6a054c3 100644 --- a/scripts/cc-cli/yarn.lock +++ b/scripts/cc-cli/yarn.lock @@ -10,157 +10,157 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" - integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" + integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== dependencies: - "@babel/highlight" "^7.18.6" + "@babel/highlight" "^7.22.5" -"@babel/compat-data@^7.21.5": - version "7.21.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.7.tgz#61caffb60776e49a57ba61a88f02bedd8714f6bc" - integrity sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA== +"@babel/compat-data@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.5.tgz#b1f6c86a02d85d2dd3368a2b67c09add8cd0c255" + integrity sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.8.tgz#2a8c7f0f53d60100ba4c32470ba0281c92aa9aa4" - integrity sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.5.tgz#d67d9747ecf26ee7ecd3ebae1ee22225fe902a89" + integrity sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.5" - "@babel/helper-compilation-targets" "^7.21.5" - "@babel/helper-module-transforms" "^7.21.5" - "@babel/helpers" "^7.21.5" - "@babel/parser" "^7.21.8" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" + "@babel/code-frame" "^7.22.5" + "@babel/generator" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helpers" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.2" semver "^6.3.0" -"@babel/generator@^7.21.5", "@babel/generator@^7.7.2": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.5.tgz#c0c0e5449504c7b7de8236d99338c3e2a340745f" - integrity sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w== +"@babel/generator@^7.22.5", "@babel/generator@^7.7.2": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.5.tgz#1e7bf768688acfb05cf30b2369ef855e82d984f7" + integrity sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA== dependencies: - "@babel/types" "^7.21.5" + "@babel/types" "^7.22.5" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.5.tgz#631e6cc784c7b660417421349aac304c94115366" - integrity sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w== +"@babel/helper-compilation-targets@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz#fc7319fc54c5e2fa14b2909cf3c5fd3046813e02" + integrity sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw== dependencies: - "@babel/compat-data" "^7.21.5" - "@babel/helper-validator-option" "^7.21.0" + "@babel/compat-data" "^7.22.5" + "@babel/helper-validator-option" "^7.22.5" browserslist "^4.21.3" lru-cache "^5.1.1" semver "^6.3.0" -"@babel/helper-environment-visitor@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz#c769afefd41d171836f7cb63e295bedf689d48ba" - integrity sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ== - -"@babel/helper-function-name@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" - integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== - dependencies: - "@babel/template" "^7.20.7" - "@babel/types" "^7.21.0" - -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-imports@^7.21.4": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz#ac88b2f76093637489e718a90cec6cf8a9b029af" - integrity sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg== - dependencies: - "@babel/types" "^7.21.4" - -"@babel/helper-module-transforms@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.5.tgz#d937c82e9af68d31ab49039136a222b17ac0b420" - integrity sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw== - dependencies: - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-module-imports" "^7.21.4" - "@babel/helper-simple-access" "^7.21.5" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz#345f2377d05a720a4e5ecfa39cbf4474a4daed56" - integrity sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg== - -"@babel/helper-simple-access@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz#d697a7971a5c39eac32c7e63c0921c06c8a249ee" - integrity sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg== - dependencies: - "@babel/types" "^7.21.5" - -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-string-parser@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz#2b3eea65443c6bdc31c22d037c65f6d323b6b2bd" - integrity sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w== - -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/helper-validator-option@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" - integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== - -"@babel/helpers@^7.21.5": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.5.tgz#5bac66e084d7a4d2d9696bdf0175a93f7fb63c08" - integrity sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA== - dependencies: - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.5" - "@babel/types" "^7.21.5" - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" +"@babel/helper-environment-visitor@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" + integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== + +"@babel/helper-function-name@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" + integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== + dependencies: + "@babel/template" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-imports@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" + integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-transforms@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz#0f65daa0716961b6e96b164034e737f60a80d2ef" + integrity sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz#88cf11050edb95ed08d596f7a044462189127a08" + integrity sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" + integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== + +"@babel/helper-validator-option@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" + integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== + +"@babel/helpers@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.5.tgz#74bb4373eb390d1ceed74a15ef97767e63120820" + integrity sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q== + dependencies: + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/highlight@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" + integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== + dependencies: + "@babel/helper-validator-identifier" "^7.22.5" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.5", "@babel/parser@^7.21.8": - version "7.21.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.8.tgz#642af7d0333eab9c0ad70b14ac5e76dbde7bfdf8" - integrity sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.5.tgz#721fd042f3ce1896238cf1b341c77eb7dee7dbea" + integrity sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -198,11 +198,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.21.4.tgz#f264ed7bf40ffc9ec239edabc17a50c4f5b6fea2" - integrity sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" + integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" @@ -254,51 +254,51 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.21.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.21.4.tgz#2751948e9b7c6d771a8efa59340c15d4a2891ff8" - integrity sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" + integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.6": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.5.tgz#8492dddda9644ae3bda3b45eabe87382caee7200" - integrity sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" + integrity sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA== dependencies: regenerator-runtime "^0.13.11" -"@babel/template@^7.20.7", "@babel/template@^7.3.3": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" - integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - -"@babel/traverse@^7.21.5", "@babel/traverse@^7.7.2": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.5.tgz#ad22361d352a5154b498299d523cf72998a4b133" - integrity sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw== - dependencies: - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.5" - "@babel/helper-environment-visitor" "^7.21.5" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.5" - "@babel/types" "^7.21.5" +"@babel/template@^7.22.5", "@babel/template@^7.3.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" + integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== + dependencies: + "@babel/code-frame" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/types" "^7.22.5" + +"@babel/traverse@^7.22.5", "@babel/traverse@^7.7.2": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.5.tgz#44bd276690db6f4940fdb84e1cb4abd2f729ccd1" + integrity sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ== + dependencies: + "@babel/code-frame" "^7.22.5" + "@babel/generator" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/types" "^7.22.5" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.4", "@babel/types@^7.21.5", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.21.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.5.tgz#18dfbd47c39d3904d5db3d3dc2cc80bedb60e5b6" - integrity sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.5", "@babel/types@^7.3.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" + integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== dependencies: - "@babel/helper-string-parser" "^7.21.5" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -340,10 +340,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.41.0": - version "8.41.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.41.0.tgz#080321c3b68253522f7646b55b577dd99d2950b3" - integrity sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA== +"@eslint/js@8.43.0": + version "8.43.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.43.0.tgz#559ca3d9ddbd6bf907ad524320a0d14b85586af0" + integrity sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg== "@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": version "5.7.0" @@ -687,10 +687,10 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@humanwhocodes/config-array@^0.11.8": - version "0.11.8" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" - integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== +"@humanwhocodes/config-array@^0.11.10": + version "0.11.10" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" + integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -1331,19 +1331,19 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== -"@sinonjs/commons@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" - integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== +"@sinonjs/commons@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" + integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== dependencies: type-detect "4.0.8" "@sinonjs/fake-timers@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" - integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== dependencies: - "@sinonjs/commons" "^2.0.0" + "@sinonjs/commons" "^3.0.0" "@substrate/connect-extension-protocol@^1.0.1": version "1.0.1" @@ -1388,14 +1388,14 @@ integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== "@tsconfig/node16@^1.0.2": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" - integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@types/babel__core@^7.1.14": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.0.tgz#61bc5a4cae505ce98e1e36c5445e4bee060d8891" - integrity sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ== + version "7.20.1" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" + integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== dependencies: "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" @@ -1419,11 +1419,11 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.18.5" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.5.tgz#c107216842905afafd3b6e774f6f935da6f5db80" - integrity sha512-enCvTL8m/EHS/zIvJno9nE+ndYPh1/oNFzRYRmtUqJICG2VnCSBzMLW5VN2KCQU91f23tsNKR8v7VJJQMatl7Q== + version "7.20.1" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf" + integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg== dependencies: - "@babel/types" "^7.3.0" + "@babel/types" "^7.20.7" "@types/bn.js@^5.1.1": version "5.1.1" @@ -1459,35 +1459,35 @@ "@types/istanbul-lib-report" "*" "@types/jest@^29.0.0": - version "29.5.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.1.tgz#83c818aa9a87da27d6da85d3378e5a34d2f31a47" - integrity sha512-tEuVcHrpaixS36w7hpsfLBLpjtMRJUE09/MHXn923LOVojDwyC14cWcfc0rDs0VEfUyYmt/+iX1kxxp+gZMcaQ== + version "29.5.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.2.tgz#86b4afc86e3a8f3005b297ed8a72494f89e6395b" + integrity sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg== dependencies: expect "^29.0.0" pretty-format "^29.0.0" "@types/json-schema@^7.0.9": - version "7.0.11" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + version "7.0.12" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" + integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== "@types/node-fetch@^2.6.2": - version "2.6.3" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.3.tgz#175d977f5e24d93ad0f57602693c435c57ad7e80" - integrity sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w== + version "2.6.4" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" + integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== dependencies: "@types/node" "*" form-data "^3.0.0" "@types/node@*": - version "20.1.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.0.tgz#258805edc37c327cf706e64c6957f241ca4c4c20" - integrity sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A== + version "20.3.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe" + integrity sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg== "@types/prettier@^2.1.5": - version "2.7.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" - integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== + version "2.7.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" + integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== "@types/prompts@^2.4.4": version "2.4.4" @@ -1527,14 +1527,14 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.27.0": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.5.tgz#f156827610a3f8cefc56baeaa93cd4a5f32966b4" - integrity sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg== + version "5.60.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.60.0.tgz#2f4bea6a3718bed2ba52905358d0f45cd3620d31" + integrity sha512-78B+anHLF1TI8Jn/cD0Q00TBYdMgjdOn980JfAVa9yw5sop8nyTfVOQAv6LWywkOGLclDBtv5z3oxN4w7jxyNg== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.59.5" - "@typescript-eslint/type-utils" "5.59.5" - "@typescript-eslint/utils" "5.59.5" + "@typescript-eslint/scope-manager" "5.60.0" + "@typescript-eslint/type-utils" "5.60.0" + "@typescript-eslint/utils" "5.60.0" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -1543,71 +1543,71 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.27.0": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.5.tgz#63064f5eafbdbfb5f9dfbf5c4503cdf949852981" - integrity sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw== + version "5.60.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.60.0.tgz#08f4daf5fc6548784513524f4f2f359cebb4068a" + integrity sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ== dependencies: - "@typescript-eslint/scope-manager" "5.59.5" - "@typescript-eslint/types" "5.59.5" - "@typescript-eslint/typescript-estree" "5.59.5" + "@typescript-eslint/scope-manager" "5.60.0" + "@typescript-eslint/types" "5.60.0" + "@typescript-eslint/typescript-estree" "5.60.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz#33ffc7e8663f42cfaac873de65ebf65d2bce674d" - integrity sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A== +"@typescript-eslint/scope-manager@5.60.0": + version "5.60.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.60.0.tgz#ae511967b4bd84f1d5e179bb2c82857334941c1c" + integrity sha512-hakuzcxPwXi2ihf9WQu1BbRj1e/Pd8ZZwVTG9kfbxAMZstKz8/9OoexIwnmLzShtsdap5U/CoQGRCWlSuPbYxQ== dependencies: - "@typescript-eslint/types" "5.59.5" - "@typescript-eslint/visitor-keys" "5.59.5" + "@typescript-eslint/types" "5.60.0" + "@typescript-eslint/visitor-keys" "5.60.0" -"@typescript-eslint/type-utils@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.5.tgz#485b0e2c5b923460bc2ea6b338c595343f06fc9b" - integrity sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg== +"@typescript-eslint/type-utils@5.60.0": + version "5.60.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.60.0.tgz#69b09087eb12d7513d5b07747e7d47f5533aa228" + integrity sha512-X7NsRQddORMYRFH7FWo6sA9Y/zbJ8s1x1RIAtnlj6YprbToTiQnM6vxcMu7iYhdunmoC0rUWlca13D5DVHkK2g== dependencies: - "@typescript-eslint/typescript-estree" "5.59.5" - "@typescript-eslint/utils" "5.59.5" + "@typescript-eslint/typescript-estree" "5.60.0" + "@typescript-eslint/utils" "5.60.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.5.tgz#e63c5952532306d97c6ea432cee0981f6d2258c7" - integrity sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w== +"@typescript-eslint/types@5.60.0": + version "5.60.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.60.0.tgz#3179962b28b4790de70e2344465ec97582ce2558" + integrity sha512-ascOuoCpNZBccFVNJRSC6rPq4EmJ2NkuoKnd6LDNyAQmdDnziAtxbCGWCbefG1CNzmDvd05zO36AmB7H8RzKPA== -"@typescript-eslint/typescript-estree@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz#9b252ce55dd765e972a7a2f99233c439c5101e42" - integrity sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg== +"@typescript-eslint/typescript-estree@5.60.0": + version "5.60.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.0.tgz#4ddf1a81d32a850de66642d9b3ad1e3254fb1600" + integrity sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ== dependencies: - "@typescript-eslint/types" "5.59.5" - "@typescript-eslint/visitor-keys" "5.59.5" + "@typescript-eslint/types" "5.60.0" + "@typescript-eslint/visitor-keys" "5.60.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.5.tgz#15b3eb619bb223302e60413adb0accd29c32bcae" - integrity sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA== +"@typescript-eslint/utils@5.60.0": + version "5.60.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.60.0.tgz#4667c5aece82f9d4f24a667602f0f300864b554c" + integrity sha512-ba51uMqDtfLQ5+xHtwlO84vkdjrqNzOnqrnwbMHMRY8Tqeme8C2Q8Fc7LajfGR+e3/4LoYiWXUM6BpIIbHJ4hQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.59.5" - "@typescript-eslint/types" "5.59.5" - "@typescript-eslint/typescript-estree" "5.59.5" + "@typescript-eslint/scope-manager" "5.60.0" + "@typescript-eslint/types" "5.60.0" + "@typescript-eslint/typescript-estree" "5.60.0" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.59.5": - version "5.59.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz#ba5b8d6791a13cf9fea6716af1e7626434b29b9b" - integrity sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA== +"@typescript-eslint/visitor-keys@5.60.0": + version "5.60.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.0.tgz#b48b29da3f5f31dd1656281727004589d2722a66" + integrity sha512-wm9Uz71SbCyhUKgcaPRauBdTegUyY/ZWl8gLwD/i/ybJqscrrdVSFImpvUz16BLPChIeKBK5Fa9s6KDQjsjyWw== dependencies: - "@typescript-eslint/types" "5.59.5" + "@typescript-eslint/types" "5.60.0" eslint-visitor-keys "^3.3.0" acorn-jsx@^5.3.2: @@ -1621,9 +1621,9 @@ acorn-walk@^8.1.1: integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^8.4.1, acorn@^8.8.0: - version "8.8.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + version "8.9.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.9.0.tgz#78a16e3b2bcc198c10822786fa6679e245db5b59" + integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ== aes-js@3.0.0: version "3.0.0" @@ -1807,14 +1807,14 @@ brorand@^1.1.0: integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== browserslist@^4.21.3: - version "4.21.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" - integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== + version "4.21.9" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635" + integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg== dependencies: - caniuse-lite "^1.0.30001449" - electron-to-chromium "^1.4.284" - node-releases "^2.0.8" - update-browserslist-db "^1.0.10" + caniuse-lite "^1.0.30001503" + electron-to-chromium "^1.4.431" + node-releases "^2.0.12" + update-browserslist-db "^1.0.11" bs-logger@0.x: version "0.2.6" @@ -1857,10 +1857,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001449: - version "1.0.30001486" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001486.tgz#56a08885228edf62cbe1ac8980f2b5dae159997e" - integrity sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg== +caniuse-lite@^1.0.30001503: + version "1.0.30001505" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001505.tgz#10a343e49d31cbbfdae298ef73cb0a9f46670dc5" + integrity sha512-jaAOR5zVtxHfL0NjZyflVTtXm3D3J9P15zSJ7HmQF8dSKGA6tqzQq+0ZI3xkjyQj46I4/M0K2GbMpcAFOcbr3A== chalk@^2.0.0: version "2.4.2" @@ -1890,9 +1890,9 @@ ci-info@^3.2.0: integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== cjs-module-lexer@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" - integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== + version "1.2.3" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" + integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== cliui@^8.0.1: version "8.0.1" @@ -1971,7 +1971,7 @@ create-require@^1.1.0: "creditcoin-js@file:../../creditcoin-js/creditcoin-js-v0.9.5.tgz": version "0.9.5" - resolved "file:../../creditcoin-js/creditcoin-js-v0.9.5.tgz#db0b4ed75435b0886b4ecbebe34fe9eb8e6f6b1b" + resolved "file:../../creditcoin-js/creditcoin-js-v0.9.5.tgz#d02b724f653da1b3433e923a51f416e79c3fad8f" dependencies: "@polkadot/api" "9.14.2" ethers "^5.7.1" @@ -2069,10 +2069,10 @@ ed2curve@^0.3.0: dependencies: tweetnacl "1.x.x" -electron-to-chromium@^1.4.284: - version "1.4.391" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.391.tgz#197994210792e29e39baf3ce807df42f66e9b5f8" - integrity sha512-GqydVV1+kUWY5qlEzaw34/hyWTApuQrHiGrcGA2Kk/56nEK44i+YUW45VH43JuZT0Oo7uY8aVtpPhBBZXEWtSA== +electron-to-chromium@^1.4.431: + version "1.4.435" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.435.tgz#761c34300603b9f1234f0b6155870d3002435db6" + integrity sha512-B0CBWVFhvoQCW/XtjRzgrmqcgVWg6RXOEM/dK59+wFV93BFGR6AeNKc4OyhM+T3IhJaOOG8o/V+33Y2mwJWtzw== elliptic@6.5.4: version "6.5.4" @@ -2177,15 +2177,15 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== eslint@^8.41.0: - version "8.41.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.41.0.tgz#3062ca73363b4714b16dbc1e60f035e6134b6f1c" - integrity sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q== + version "8.43.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.43.0.tgz#3e8c6066a57097adfd9d390b8fc93075f257a094" + integrity sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.3" - "@eslint/js" "8.41.0" - "@humanwhocodes/config-array" "^0.11.8" + "@eslint/js" "8.43.0" + "@humanwhocodes/config-array" "^0.11.10" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" @@ -2644,9 +2644,9 @@ is-arrayish@^0.2.1: integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== is-core-module@^2.11.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" - integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== + version "2.12.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" + integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== dependencies: has "^1.0.3" @@ -3361,10 +3361,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.8: - version "2.0.10" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" - integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== +node-releases@^2.0.12: + version "2.0.12" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.12.tgz#35627cc224a23bfb06fb3380f2b3afaaa7eb1039" + integrity sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ== normalize-path@^3.0.0: version "3.0.0" @@ -3495,9 +3495,9 @@ picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pirates@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== pkg-dir@^4.2.0: version "4.2.0" @@ -3631,9 +3631,9 @@ scrypt-js@3.0.1: integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== semver@7.x, semver@^7.3.5, semver@^7.3.7: - version "7.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" - integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== + version "7.5.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.2.tgz#5b851e66d1be07c1cdaf37dfc856f543325a2beb" + integrity sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ== dependencies: lru-cache "^6.0.0" @@ -3829,9 +3829,9 @@ tslib@^1.8.1: integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tslib@^2.1.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + version "2.5.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" + integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== tsutils@^3.21.0: version "3.21.0" @@ -3889,7 +3889,7 @@ typescript@^5.1.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826" integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw== -update-browserslist-db@^1.0.10: +update-browserslist-db@^1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== From 9ef043761c1d82d9f409f41a9874e3991a960f71 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Tue, 20 Jun 2023 21:57:38 -0400 Subject: [PATCH 02/12] improved error handling in getSeedFromEnvOrPrompt --- scripts/cc-cli/src/commands/bond.ts | 2 +- .../cc-cli/src/commands/distributeRewards.ts | 6 +++-- scripts/cc-cli/src/commands/send.ts | 2 +- scripts/cc-cli/src/commands/showAddress.ts | 5 +++- scripts/cc-cli/src/commands/wizard.ts | 6 ++++- scripts/cc-cli/src/utils/account.ts | 27 ++++++++++++++----- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/scripts/cc-cli/src/commands/bond.ts b/scripts/cc-cli/src/commands/bond.ts index 42ff33e1fe..316d9fd8a4 100644 --- a/scripts/cc-cli/src/commands/bond.ts +++ b/scripts/cc-cli/src/commands/bond.ts @@ -3,7 +3,7 @@ import { newApi } from "../api"; import { checkAddress, getStashSeedFromEnvOrPrompt, - initKeyringPair + initKeyringPair, } from "../utils/account"; import { Balance, getBalance, toMicrounits } from "../utils/balance"; import { bond, parseRewardDestination } from "../utils/bond"; diff --git a/scripts/cc-cli/src/commands/distributeRewards.ts b/scripts/cc-cli/src/commands/distributeRewards.ts index 9cf8a13122..8660ed2b0d 100644 --- a/scripts/cc-cli/src/commands/distributeRewards.ts +++ b/scripts/cc-cli/src/commands/distributeRewards.ts @@ -17,7 +17,6 @@ export function makeDistributeRewardsCommand() { async function distributeRewardsAction(options: OptionValues) { const { api } = await newApi(options.url); - if (!options.validatorId) { console.log("Must specify a validator to distribute rewards for"); process.exit(1); @@ -28,7 +27,10 @@ async function distributeRewardsAction(options: OptionValues) { process.exit(1); } - const signerSeed = await getSeedFromEnvOrPrompt(process.env.CC_SEED, "Specify caller's seed phrase"); + const signerSeed = await getSeedFromEnvOrPrompt( + process.env.CC_SEED, + "Specify caller's seed phrase" + ); const distributeTx = api.tx.staking.payoutStakers( options.validatorId, options.era diff --git a/scripts/cc-cli/src/commands/send.ts b/scripts/cc-cli/src/commands/send.ts index 7c2c8b6e74..abaa5c71eb 100644 --- a/scripts/cc-cli/src/commands/send.ts +++ b/scripts/cc-cli/src/commands/send.ts @@ -3,7 +3,7 @@ import { newApi } from "../api"; import { checkAddress, getStashSeedFromEnvOrPrompt, - initKeyringPair + initKeyringPair, } from "../utils/account"; import { toMicrounits } from "../utils/balance"; diff --git a/scripts/cc-cli/src/commands/showAddress.ts b/scripts/cc-cli/src/commands/showAddress.ts index 3768818f74..a0d1afd8dd 100644 --- a/scripts/cc-cli/src/commands/showAddress.ts +++ b/scripts/cc-cli/src/commands/showAddress.ts @@ -11,7 +11,10 @@ export function makeShowAddressCommand() { async function showAddressAction(options: OptionValues) { await cryptoWaitReady(); - const seed = await getSeedFromEnvOrPrompt(process.env.CC_SEED, "Specify seed phrase"); + const seed = await getSeedFromEnvOrPrompt( + process.env.CC_SEED, + "Specify seed phrase" + ); const pair = initKeyringPair(seed); const address = pair.address; diff --git a/scripts/cc-cli/src/commands/wizard.ts b/scripts/cc-cli/src/commands/wizard.ts index 731a664589..da54fed0d7 100644 --- a/scripts/cc-cli/src/commands/wizard.ts +++ b/scripts/cc-cli/src/commands/wizard.ts @@ -1,7 +1,11 @@ import { Command, OptionValues } from "commander"; import { BN } from "creditcoin-js"; import { newApi } from "../api"; -import { getControllerSeedFromEnvOrPrompt, getStashSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { + getControllerSeedFromEnvOrPrompt, + getStashSeedFromEnvOrPrompt, + initKeyringPair, +} from "../utils/account"; import { Balance, getBalance, diff --git a/scripts/cc-cli/src/utils/account.ts b/scripts/cc-cli/src/utils/account.ts index 3b98e34b9a..c591e1cd72 100644 --- a/scripts/cc-cli/src/utils/account.ts +++ b/scripts/cc-cli/src/utils/account.ts @@ -21,19 +21,34 @@ export async function getControllerSeedFromEnvOrPrompt() { ); } -export async function getSeedFromEnvOrPrompt(envVar?: string | undefined, promptStr?: string | null) { - if (envVar && mnemonicValidate(envVar)) { - return envVar; +export async function getSeedFromEnvOrPrompt( + envVar?: string | undefined, + promptStr?: string | null +) { + if (envVar) { + if (mnemonicValidate(envVar)) { + return envVar; + } else { + console.log("Error: Seed phrase provided in environment variable is invalid."); + process.exit(1); + } } let seedPromptResult = await prompts([ { type: "invisible", name: "seed", message: promptStr ? promptStr : "Enter seed phrase", - validate: seed => mnemonicValidate(seed) - } + validate: (seed) => mnemonicValidate(seed), + }, ]); - return seedPromptResult.seed; + + // If SIGTERM is issued while prompting, it will log a bogus address anyways and exit without error. + // To avoid this, we check if prompt was successful, before returning. + if (seedPromptResult.seed) { + return seedPromptResult.seed; + } + console.log("Error: Could not retrieve seed phrase."); + process.exit(1); } export function checkAddress(address: string, api: ApiPromise) { From 457bb8c4627f63a15fd5f76ac433f4589276d0df Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Tue, 20 Jun 2023 22:00:00 -0400 Subject: [PATCH 03/12] yarn format --- scripts/cc-cli/src/utils/account.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cc-cli/src/utils/account.ts b/scripts/cc-cli/src/utils/account.ts index c591e1cd72..5e7c628360 100644 --- a/scripts/cc-cli/src/utils/account.ts +++ b/scripts/cc-cli/src/utils/account.ts @@ -29,7 +29,9 @@ export async function getSeedFromEnvOrPrompt( if (mnemonicValidate(envVar)) { return envVar; } else { - console.log("Error: Seed phrase provided in environment variable is invalid."); + console.log( + "Error: Seed phrase provided in environment variable is invalid." + ); process.exit(1); } } From 3d4b831504b141badd5d672e5e342531efbb17b5 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Tue, 20 Jun 2023 22:21:52 -0400 Subject: [PATCH 04/12] eslint --- scripts/cc-cli/src/commands/showAddress.ts | 4 ++-- scripts/cc-cli/src/utils/account.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cc-cli/src/commands/showAddress.ts b/scripts/cc-cli/src/commands/showAddress.ts index a0d1afd8dd..eb9b3e6461 100644 --- a/scripts/cc-cli/src/commands/showAddress.ts +++ b/scripts/cc-cli/src/commands/showAddress.ts @@ -1,5 +1,5 @@ import { cryptoWaitReady } from "@polkadot/util-crypto"; -import { Command, OptionValues } from "commander"; +import { Command } from "commander"; import { getSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; export function makeShowAddressCommand() { @@ -9,7 +9,7 @@ export function makeShowAddressCommand() { return cmd; } -async function showAddressAction(options: OptionValues) { +async function showAddressAction() { await cryptoWaitReady(); const seed = await getSeedFromEnvOrPrompt( process.env.CC_SEED, diff --git a/scripts/cc-cli/src/utils/account.ts b/scripts/cc-cli/src/utils/account.ts index 5e7c628360..feda3bf566 100644 --- a/scripts/cc-cli/src/utils/account.ts +++ b/scripts/cc-cli/src/utils/account.ts @@ -35,7 +35,7 @@ export async function getSeedFromEnvOrPrompt( process.exit(1); } } - let seedPromptResult = await prompts([ + const seedPromptResult = await prompts([ { type: "invisible", name: "seed", From e34a3964812daf30347c34bd3d9309ee18d8cae2 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Wed, 21 Jun 2023 09:53:28 -0400 Subject: [PATCH 05/12] changed prompt from invisible to password --- scripts/cc-cli/src/utils/account.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cc-cli/src/utils/account.ts b/scripts/cc-cli/src/utils/account.ts index feda3bf566..503030f834 100644 --- a/scripts/cc-cli/src/utils/account.ts +++ b/scripts/cc-cli/src/utils/account.ts @@ -37,7 +37,7 @@ export async function getSeedFromEnvOrPrompt( } const seedPromptResult = await prompts([ { - type: "invisible", + type: "password", name: "seed", message: promptStr ? promptStr : "Enter seed phrase", validate: (seed) => mnemonicValidate(seed), From a4b32d56c0e57ac46b96f7e27bd4d8aec09c19af Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Wed, 21 Jun 2023 11:22:08 -0400 Subject: [PATCH 06/12] centralized the regular seed --- scripts/cc-cli/src/commands/distributeRewards.ts | 10 +++++----- scripts/cc-cli/src/commands/send.ts | 4 ++-- scripts/cc-cli/src/commands/showAddress.ts | 7 ++----- scripts/cc-cli/src/utils/account.ts | 8 +++++++- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/scripts/cc-cli/src/commands/distributeRewards.ts b/scripts/cc-cli/src/commands/distributeRewards.ts index 8660ed2b0d..3fbc677daf 100644 --- a/scripts/cc-cli/src/commands/distributeRewards.ts +++ b/scripts/cc-cli/src/commands/distributeRewards.ts @@ -1,6 +1,9 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { + getCallerSeedFromEnvOrPrompt, + initKeyringPair, +} from "../utils/account"; export function makeDistributeRewardsCommand() { const cmd = new Command("distribute-rewards"); @@ -27,10 +30,7 @@ async function distributeRewardsAction(options: OptionValues) { process.exit(1); } - const signerSeed = await getSeedFromEnvOrPrompt( - process.env.CC_SEED, - "Specify caller's seed phrase" - ); + const signerSeed = await getCallerSeedFromEnvOrPrompt(); const distributeTx = api.tx.staking.payoutStakers( options.validatorId, options.era diff --git a/scripts/cc-cli/src/commands/send.ts b/scripts/cc-cli/src/commands/send.ts index abaa5c71eb..87b7fbd9fc 100644 --- a/scripts/cc-cli/src/commands/send.ts +++ b/scripts/cc-cli/src/commands/send.ts @@ -2,7 +2,7 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; import { checkAddress, - getStashSeedFromEnvOrPrompt, + getCallerSeedFromEnvOrPrompt, initKeyringPair, } from "../utils/account"; import { toMicrounits } from "../utils/balance"; @@ -24,7 +24,7 @@ async function sendAction(options: OptionValues) { checkAddress(options.to, api); // Build account - const seed = await getStashSeedFromEnvOrPrompt(); + const seed = await getCallerSeedFromEnvOrPrompt(); const stash = initKeyringPair(seed); // Send transaction diff --git a/scripts/cc-cli/src/commands/showAddress.ts b/scripts/cc-cli/src/commands/showAddress.ts index eb9b3e6461..e2484b2031 100644 --- a/scripts/cc-cli/src/commands/showAddress.ts +++ b/scripts/cc-cli/src/commands/showAddress.ts @@ -1,6 +1,6 @@ import { cryptoWaitReady } from "@polkadot/util-crypto"; import { Command } from "commander"; -import { getSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { getCallerSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; export function makeShowAddressCommand() { const cmd = new Command("show-address"); @@ -11,10 +11,7 @@ export function makeShowAddressCommand() { async function showAddressAction() { await cryptoWaitReady(); - const seed = await getSeedFromEnvOrPrompt( - process.env.CC_SEED, - "Specify seed phrase" - ); + const seed = await getCallerSeedFromEnvOrPrompt(); const pair = initKeyringPair(seed); const address = pair.address; diff --git a/scripts/cc-cli/src/utils/account.ts b/scripts/cc-cli/src/utils/account.ts index 503030f834..4e97b26da4 100644 --- a/scripts/cc-cli/src/utils/account.ts +++ b/scripts/cc-cli/src/utils/account.ts @@ -20,8 +20,14 @@ export async function getControllerSeedFromEnvOrPrompt() { "Specify a seed phrase for the Controller account" ); } +export async function getCallerSeedFromEnvOrPrompt() { + return await getSeedFromEnvOrPrompt( + process.env.CC_SEED, + "Specify caller's seed phrase" + ); +} -export async function getSeedFromEnvOrPrompt( +async function getSeedFromEnvOrPrompt( envVar?: string | undefined, promptStr?: string | null ) { From 2228b729b376dd61ec97efdb68fc5528af44ed84 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Wed, 21 Jun 2023 12:18:43 -0400 Subject: [PATCH 07/12] rectified stash vs bond key elicitation --- scripts/cc-cli/src/commands/distributeRewards.ts | 5 +++-- scripts/cc-cli/src/commands/send.ts | 4 ++-- scripts/cc-cli/src/commands/showAddress.ts | 4 ++-- scripts/cc-cli/src/commands/unbond.ts | 4 ++-- scripts/cc-cli/src/commands/validate.ts | 6 +++--- scripts/cc-cli/src/commands/withdrawUnbonded.ts | 6 +++--- scripts/cc-cli/src/utils/validate.ts | 10 +++++----- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/scripts/cc-cli/src/commands/distributeRewards.ts b/scripts/cc-cli/src/commands/distributeRewards.ts index 3fbc677daf..67645bd13c 100644 --- a/scripts/cc-cli/src/commands/distributeRewards.ts +++ b/scripts/cc-cli/src/commands/distributeRewards.ts @@ -30,13 +30,14 @@ async function distributeRewardsAction(options: OptionValues) { process.exit(1); } - const signerSeed = await getCallerSeedFromEnvOrPrompt(); + // Any account can call the distribute_rewards extrinsic + const callerSeed = await getCallerSeedFromEnvOrPrompt(); const distributeTx = api.tx.staking.payoutStakers( options.validatorId, options.era ); - const hash = await distributeTx.signAndSend(initKeyringPair(signerSeed)); + const hash = await distributeTx.signAndSend(initKeyringPair(callerSeed)); console.log("Payout stakers transaction sent with hash:", hash.toHex()); process.exit(0); diff --git a/scripts/cc-cli/src/commands/send.ts b/scripts/cc-cli/src/commands/send.ts index 87b7fbd9fc..0d2652caca 100644 --- a/scripts/cc-cli/src/commands/send.ts +++ b/scripts/cc-cli/src/commands/send.ts @@ -24,8 +24,8 @@ async function sendAction(options: OptionValues) { checkAddress(options.to, api); // Build account - const seed = await getCallerSeedFromEnvOrPrompt(); - const stash = initKeyringPair(seed); + const callerSeed = await getCallerSeedFromEnvOrPrompt(); + const stash = initKeyringPair(callerSeed); // Send transaction const tx = api.tx.balances.transfer( diff --git a/scripts/cc-cli/src/commands/showAddress.ts b/scripts/cc-cli/src/commands/showAddress.ts index e2484b2031..51ac645233 100644 --- a/scripts/cc-cli/src/commands/showAddress.ts +++ b/scripts/cc-cli/src/commands/showAddress.ts @@ -11,8 +11,8 @@ export function makeShowAddressCommand() { async function showAddressAction() { await cryptoWaitReady(); - const seed = await getCallerSeedFromEnvOrPrompt(); - const pair = initKeyringPair(seed); + const callerSeed = await getCallerSeedFromEnvOrPrompt(); + const pair = initKeyringPair(callerSeed); const address = pair.address; console.log("Account address:", address); diff --git a/scripts/cc-cli/src/commands/unbond.ts b/scripts/cc-cli/src/commands/unbond.ts index 5541186112..098c7f7ad8 100644 --- a/scripts/cc-cli/src/commands/unbond.ts +++ b/scripts/cc-cli/src/commands/unbond.ts @@ -18,8 +18,8 @@ async function unbondAction(options: OptionValues) { checkAmount(options); // Build account - const seed = await getStashSeedFromEnvOrPrompt(); - const stash = initKeyringPair(seed); + const stashSeed = await getStashSeedFromEnvOrPrompt(); + const stash = initKeyringPair(stashSeed); // Unbond transaction const tx = api.tx.staking.unbond(toMicrounits(options.amount).toString()); diff --git a/scripts/cc-cli/src/commands/validate.ts b/scripts/cc-cli/src/commands/validate.ts index 23cc902194..49bc4f1012 100644 --- a/scripts/cc-cli/src/commands/validate.ts +++ b/scripts/cc-cli/src/commands/validate.ts @@ -1,6 +1,6 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getStashSeedFromEnvOrPrompt } from "../utils/account"; +import { getControllerSeedFromEnvOrPrompt } from "../utils/account"; import { perbillFromPercent } from "../utils/perbill"; import { StakingPalletValidatorPrefs, validate } from "../utils/validate"; @@ -22,7 +22,7 @@ export function makeValidateCommand() { async function validateAction(options: OptionValues) { const { api } = await newApi(options.url); - const stashSeed = await getStashSeedFromEnvOrPrompt(); + const controllerSeed = await getControllerSeedFromEnvOrPrompt(); const commission = options.commission ? perbillFromPercent(options.commission) @@ -32,7 +32,7 @@ async function validateAction(options: OptionValues) { console.log("Creating validate transaction..."); - const validateTxHash = await validate(stashSeed, preferences, api); + const validateTxHash = await validate(controllerSeed, preferences, api); console.log("Validate transaction sent with hash:", validateTxHash.toHex()); process.exit(0); diff --git a/scripts/cc-cli/src/commands/withdrawUnbonded.ts b/scripts/cc-cli/src/commands/withdrawUnbonded.ts index 02da288a9d..16a3be6db9 100644 --- a/scripts/cc-cli/src/commands/withdrawUnbonded.ts +++ b/scripts/cc-cli/src/commands/withdrawUnbonded.ts @@ -1,6 +1,6 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getStashSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { getControllerSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; export function makeWithdrawUnbondedCommand() { const cmd = new Command("withdraw-unbonded"); @@ -13,8 +13,8 @@ export function makeWithdrawUnbondedCommand() { async function withdrawUnbondedAction(options: OptionValues) { const { api } = await newApi(options.url); - const stashSeed = await getStashSeedFromEnvOrPrompt(); - const stashAccount = initKeyringPair(stashSeed); + const controllerSeed = await getControllerSeedFromEnvOrPrompt(); + const stashAccount = initKeyringPair(controllerSeed); const slashingSpans = await api.query.staking.slashingSpans( stashAccount.address ); diff --git a/scripts/cc-cli/src/utils/validate.ts b/scripts/cc-cli/src/utils/validate.ts index 5c5e807edb..cc456c04fd 100644 --- a/scripts/cc-cli/src/utils/validate.ts +++ b/scripts/cc-cli/src/utils/validate.ts @@ -9,11 +9,11 @@ export interface StakingPalletValidatorPrefs { } export async function validate( - seed: string, + controllerSeed: string, prefs: StakingPalletValidatorPrefs, api: ApiPromise ) { - const stash = initKeyringPair(seed); + const controller = initKeyringPair(controllerSeed); console.log("Creating validate transaction with params:"); @@ -26,14 +26,14 @@ export async function validate( const validateTx = api.tx.staking.validate(preferences); - const hash = await validateTx.signAndSend(stash); + const hash = await validateTx.signAndSend(controller); console.log(`Validate transaction sent with hash: ${hash.toHex()}`); return hash; } -export async function chill(seed: string, api: ApiPromise) { - const account = initKeyringPair(seed); +export async function chill(controllerSeed: string, api: ApiPromise) { + const account = initKeyringPair(controllerSeed); const chillTx = api.tx.staking.chill(); From 7e3d6505c8f74aa79ff2ab9a8ef2d62fbb32539e Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Wed, 21 Jun 2023 12:22:24 -0400 Subject: [PATCH 08/12] set_keys actor rectification --- scripts/cc-cli/src/commands/setKeys.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cc-cli/src/commands/setKeys.ts b/scripts/cc-cli/src/commands/setKeys.ts index c508198783..26eb7e3329 100644 --- a/scripts/cc-cli/src/commands/setKeys.ts +++ b/scripts/cc-cli/src/commands/setKeys.ts @@ -1,6 +1,6 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getStashSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { getControllerSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; export function makeSetKeysCommand() { const cmd = new Command("set-keys"); @@ -16,8 +16,8 @@ async function setKeysAction(options: OptionValues) { const { api } = await newApi(options.url); // Build account - const seed = await getStashSeedFromEnvOrPrompt(); - const stash = initKeyringPair(seed); + const controllerSeed = await getControllerSeedFromEnvOrPrompt(); + const stash = initKeyringPair(controllerSeed); let keys; if (!options.keys && !options.rotate) { From 67b90d42acb8eed5eccd21a636d3b4b9bc795d23 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Wed, 21 Jun 2023 12:22:54 -0400 Subject: [PATCH 09/12] make pretty --- scripts/cc-cli/src/commands/setKeys.ts | 5 ++++- scripts/cc-cli/src/commands/showAddress.ts | 5 ++++- scripts/cc-cli/src/commands/withdrawUnbonded.ts | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/cc-cli/src/commands/setKeys.ts b/scripts/cc-cli/src/commands/setKeys.ts index 26eb7e3329..a3197f4fec 100644 --- a/scripts/cc-cli/src/commands/setKeys.ts +++ b/scripts/cc-cli/src/commands/setKeys.ts @@ -1,6 +1,9 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getControllerSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { + getControllerSeedFromEnvOrPrompt, + initKeyringPair, +} from "../utils/account"; export function makeSetKeysCommand() { const cmd = new Command("set-keys"); diff --git a/scripts/cc-cli/src/commands/showAddress.ts b/scripts/cc-cli/src/commands/showAddress.ts index 51ac645233..0dc3e5c9e0 100644 --- a/scripts/cc-cli/src/commands/showAddress.ts +++ b/scripts/cc-cli/src/commands/showAddress.ts @@ -1,6 +1,9 @@ import { cryptoWaitReady } from "@polkadot/util-crypto"; import { Command } from "commander"; -import { getCallerSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { + getCallerSeedFromEnvOrPrompt, + initKeyringPair, +} from "../utils/account"; export function makeShowAddressCommand() { const cmd = new Command("show-address"); diff --git a/scripts/cc-cli/src/commands/withdrawUnbonded.ts b/scripts/cc-cli/src/commands/withdrawUnbonded.ts index 16a3be6db9..a453808fbb 100644 --- a/scripts/cc-cli/src/commands/withdrawUnbonded.ts +++ b/scripts/cc-cli/src/commands/withdrawUnbonded.ts @@ -1,6 +1,9 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getControllerSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { + getControllerSeedFromEnvOrPrompt, + initKeyringPair, +} from "../utils/account"; export function makeWithdrawUnbondedCommand() { const cmd = new Command("withdraw-unbonded"); From 3e3d81f2db1b62a90d9312abe1cc2c6d8dd2bcd4 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Wed, 21 Jun 2023 14:51:40 -0400 Subject: [PATCH 10/12] unbound to controller seed --- scripts/cc-cli/src/commands/unbond.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/cc-cli/src/commands/unbond.ts b/scripts/cc-cli/src/commands/unbond.ts index 098c7f7ad8..f8a68fe2e8 100644 --- a/scripts/cc-cli/src/commands/unbond.ts +++ b/scripts/cc-cli/src/commands/unbond.ts @@ -1,6 +1,6 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getStashSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { getControllerSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; import { toMicrounits } from "../utils/balance"; export function makeUnbondCommand() { @@ -18,13 +18,13 @@ async function unbondAction(options: OptionValues) { checkAmount(options); // Build account - const stashSeed = await getStashSeedFromEnvOrPrompt(); - const stash = initKeyringPair(stashSeed); + const controllerSeed = await getControllerSeedFromEnvOrPrompt(); + const controller = initKeyringPair(controllerSeed); // Unbond transaction const tx = api.tx.staking.unbond(toMicrounits(options.amount).toString()); - const hash = await tx.signAndSend(stash); + const hash = await tx.signAndSend(controller); console.log("Unbond transaction hash: " + hash.toHex()); process.exit(0); From 634b68bab9373f8689b18659f4e8ac3e23097413 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Wed, 21 Jun 2023 14:55:25 -0400 Subject: [PATCH 11/12] appropriate names --- scripts/cc-cli/src/commands/send.ts | 4 ++-- scripts/cc-cli/src/commands/setKeys.ts | 4 ++-- scripts/cc-cli/src/commands/withdrawUnbonded.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/cc-cli/src/commands/send.ts b/scripts/cc-cli/src/commands/send.ts index 0d2652caca..9571e83b44 100644 --- a/scripts/cc-cli/src/commands/send.ts +++ b/scripts/cc-cli/src/commands/send.ts @@ -25,14 +25,14 @@ async function sendAction(options: OptionValues) { // Build account const callerSeed = await getCallerSeedFromEnvOrPrompt(); - const stash = initKeyringPair(callerSeed); + const caller = initKeyringPair(callerSeed); // Send transaction const tx = api.tx.balances.transfer( options.to, toMicrounits(options.amount).toString() ); - const hash = await tx.signAndSend(stash); + const hash = await tx.signAndSend(caller); console.log("Transfer transaction hash: " + hash.toHex()); process.exit(0); diff --git a/scripts/cc-cli/src/commands/setKeys.ts b/scripts/cc-cli/src/commands/setKeys.ts index a3197f4fec..edf1119fa3 100644 --- a/scripts/cc-cli/src/commands/setKeys.ts +++ b/scripts/cc-cli/src/commands/setKeys.ts @@ -20,7 +20,7 @@ async function setKeysAction(options: OptionValues) { // Build account const controllerSeed = await getControllerSeedFromEnvOrPrompt(); - const stash = initKeyringPair(controllerSeed); + const controller = initKeyringPair(controllerSeed); let keys; if (!options.keys && !options.rotate) { @@ -35,7 +35,7 @@ async function setKeysAction(options: OptionValues) { } const tx = api.tx.session.setKeys(keys, []); - const hash = await tx.signAndSend(stash); + const hash = await tx.signAndSend(controller); console.log("Set keys transaction hash: " + hash.toHex()); diff --git a/scripts/cc-cli/src/commands/withdrawUnbonded.ts b/scripts/cc-cli/src/commands/withdrawUnbonded.ts index a453808fbb..8778a38758 100644 --- a/scripts/cc-cli/src/commands/withdrawUnbonded.ts +++ b/scripts/cc-cli/src/commands/withdrawUnbonded.ts @@ -17,15 +17,15 @@ async function withdrawUnbondedAction(options: OptionValues) { const { api } = await newApi(options.url); const controllerSeed = await getControllerSeedFromEnvOrPrompt(); - const stashAccount = initKeyringPair(controllerSeed); + const controller = initKeyringPair(controllerSeed); const slashingSpans = await api.query.staking.slashingSpans( - stashAccount.address + controller.address ); const slashingSpansCount = slashingSpans.toHuman() ? slashingSpans.toHuman() : 0; const withdrawUnbondTx = api.tx.staking.withdrawUnbonded(slashingSpansCount); - const hash = await withdrawUnbondTx.signAndSend(stashAccount); + const hash = await withdrawUnbondTx.signAndSend(controller); console.log("Withdraw unbonded transaction sent with hash:", hash.toHex()); process.exit(0); From 5f730b45c1473c7bcaa4fc7433a144ebab0a0fc3 Mon Sep 17 00:00:00 2001 From: Jon Zlotnik Date: Wed, 21 Jun 2023 15:00:17 -0400 Subject: [PATCH 12/12] prettify --- scripts/cc-cli/src/commands/unbond.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/cc-cli/src/commands/unbond.ts b/scripts/cc-cli/src/commands/unbond.ts index f8a68fe2e8..f0df11a476 100644 --- a/scripts/cc-cli/src/commands/unbond.ts +++ b/scripts/cc-cli/src/commands/unbond.ts @@ -1,6 +1,9 @@ import { Command, OptionValues } from "commander"; import { newApi } from "../api"; -import { getControllerSeedFromEnvOrPrompt, initKeyringPair } from "../utils/account"; +import { + getControllerSeedFromEnvOrPrompt, + initKeyringPair, +} from "../utils/account"; import { toMicrounits } from "../utils/balance"; export function makeUnbondCommand() {