diff --git a/integration-tests/yarn.lock b/integration-tests/yarn.lock index 7526ace7cc..3ec8b11ad2 100644 --- a/integration-tests/yarn.lock +++ b/integration-tests/yarn.lock @@ -285,9 +285,9 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.6": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" - integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== + version "7.23.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" + integrity sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g== dependencies: regenerator-runtime "^0.14.0" @@ -1622,9 +1622,9 @@ "@babel/types" "^7.20.7" "@types/bn.js@^5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.2.tgz#162f5238c46f4bcbac07a98561724eca1fcf0c5e" + integrity sha512-dkpZu0szUtn9UXTmw+e0AJFd4D2XAxDnsCLdc05SfqpqzPEBft8eQr8uaFitfo/dUUOZERaLec2hHMG87A4Dxg== dependencies: "@types/node" "*" @@ -1668,17 +1668,17 @@ integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== "@types/node-fetch@^2.6.2": - version "2.6.5" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.5.tgz#972756a9a0fe354b2886bf3defe667ddb4f0d30a" - integrity sha512-OZsUlr2nxvkqUFLSaY2ZbA+P1q22q+KrlxWOn/38RX+u5kTkYL2mTujEpzUhGkS+K/QCYp9oagfXG39XOzyySg== + version "2.6.6" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.6.tgz#b72f3f4bc0c0afee1c0bc9cff68e041d01e3e779" + integrity sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw== dependencies: "@types/node" "*" form-data "^4.0.0" "@types/node@*": - version "20.6.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.1.tgz#8b589bba9b2af0128796461a0979764562687e6f" - integrity sha512-4LcJvuXQlv4lTHnxwyHQZ3uR9Zw2j7m1C9DfuwoTFQQP4Pmu04O6IfLYgMmHoOCt0nosItLLZAH+sOrRE0Bo8g== + version "20.7.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.7.0.tgz#c03de4572f114a940bc2ca909a33ddb2b925e470" + integrity sha512-zI22/pJW2wUZOVyguFaUL1HABdmSVxpXrzIqkjsHmyUjNhPoWM1CKfvVuXfetHhIok4RY573cqS0mZ1SJEnoTg== "@types/semver@^7.5.0": version "7.5.1" @@ -1691,9 +1691,9 @@ integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/websocket@^1.0.5": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.6.tgz#ec8dce5915741632ac3a4b1f951b6d4156e32d03" - integrity sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg== + version "1.0.7" + resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.7.tgz#94ef83be9414db30c147d400cee08d5d767deeb0" + integrity sha512-62Omr8U0PO+hgjLCpPnMsmjh2/FRwIGOktZHyYAUzooEJotwkXHMp7vCacdYi8haxBNOiw9bc2HIHI+b/MPNjA== dependencies: "@types/node" "*" @@ -2184,7 +2184,7 @@ create-require@^1.1.0: "creditcoin-js@file:../creditcoin-js/creditcoin-js-v0.10.4.tgz": version "0.10.4" - resolved "file:../creditcoin-js/creditcoin-js-v0.10.4.tgz#78d4c8e4b0b6562537bfd110f0017ea7c65d4db1" + resolved "file:../creditcoin-js/creditcoin-js-v0.10.4.tgz#cceccd3ad3dad8511d7cd244fe74873eba7e1bdf" dependencies: "@polkadot/api" "9.14.2" ethers "^5.7.1" @@ -4265,9 +4265,9 @@ ws@^8.5.0: integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== ws@^8.8.1: - version "8.14.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.1.tgz#4b9586b4f70f9e6534c7bb1d3dc0baa8b8cf01e0" - integrity sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A== + version "8.14.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" + integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== y18n@^5.0.5: version "5.0.8" diff --git a/scripts/cc-cli/src/commands/registerAddress.ts b/scripts/cc-cli/src/commands/registerAddress.ts index bb25cc1276..d55b320d30 100644 --- a/scripts/cc-cli/src/commands/registerAddress.ts +++ b/scripts/cc-cli/src/commands/registerAddress.ts @@ -6,6 +6,8 @@ import { Wallet } from "ethers"; import { signAccountId } from "creditcoin-js/lib/utils"; import { AddressRegistered } from "creditcoin-js/lib/extrinsics/register-address"; import { utils } from "ethers"; +import { getErrorMessage } from "../utils/error"; +import prompts from "prompts"; const blockchains = ["Ethereum", "Rinkeby", "Luniverse", "Bitcoin", "Other"]; @@ -14,16 +16,15 @@ export function makeRegisterAddressCmd() { "-b, --blockchain The blockchain that this external address belongs to", ).choices(blockchains); - const privateKeyOpt = new Option( - "-p, --private-key The private key for the Ethereum address that you want to register.", - ).env("ETH_PRIVATE_KEY"); - return new Command("register-address") .description( "Link a CreditCoin address to an address from another blockchain", ) - .addOption(privateKeyOpt) .addOption(blockchainOpt) + .option( + "--eth-mnemonic", + "Specify the ethereum address using a mnemonic rather than a private key", + ) .action(registerAddressAction); } @@ -35,9 +36,11 @@ async function registerAddressAction(options: OptionValues) { extrinsics: { registerAddress }, } = await newApi(options.url); - // Reads CC_SECRET env variable if it exists or propmpts the user to enter a mneumonic + // Reads CC_SECRET env variable if it exists or propmpts the user to enter a mnemonic const signer = await initCallerKeyring(options); - const wallet = new Wallet(options.privateKey); + + // Reads ETH_PRIVATE_KEY env variable if found or prompts the user to enter an ethereum mnemonic + const wallet = await initCallerEthWallet(options); // create the cryptographic proof of ownership const proof = signAccountId(api, wallet, signer.address); @@ -68,14 +71,6 @@ function validateOptsOrExit(options: OptionValues) { `ERROR: A blockchain must be specified (possible values: ${blockchains.toString()})`, ); } - - if (options.privateKey === undefined) { - fatalErr("ERROR: No external address specified"); - } - - if (!isValidPrivateKey(options.privateKey)) { - fatalErr(`ERROR: Invalid private key: ${options.privateKey as string}`); - } } export function fatalErr(s: string) { @@ -91,3 +86,90 @@ function errorMsg(s: string) { export function isValidPrivateKey(pk: string): boolean { return utils.isHexString(pk, 32); } + +export async function initCallerEthWallet( + options: OptionValues, +): Promise { + try { + return await initWalletFromEnvOrPrompt("ETH_PRIVATE_KEY", options); + } catch (e) { + console.error(getErrorMessage(e)); + process.exit(1); + } +} + +async function initWalletFromEnvOrPrompt( + envVar: string, + options: OptionValues, +): Promise { + const interactive = options.input; + const useMnemonic = options.ethMnemonic; + const inputName = useMnemonic ? "mnemonic" : "private key"; + const generateWallet = useMnemonic + ? newWalletFromMnemonic + : newWalletFromPrivateKey; + const validateInput = useMnemonic ? isMnemonicValid : isValidPrivateKey; + + if (!interactive && process.env[envVar] === undefined) { + throw new Error( + "Error: Must specify a private key using the environment variable ETH_PRIVATE_KEY or an interactive prompt", + ); + } + + if (process.env[envVar] !== undefined) { + const seed = process.env[envVar] as string; + + if (!validateInput(seed)) { + throw new Error(`Error: ${inputName} is invalid`); + } + + return generateWallet(seed); + } else if (interactive) { + const promptResult = await prompts([ + { + type: "password", + name: "seed", + message: `Specify the ${inputName} for the ethereum address`, + validate: validateInput, + }, + ]); + + const seed = promptResult.seed; + + if (!seed) { + throw new Error( + `The ${inputName} could not be retrieved from the prompt`, + ); + } + + return generateWallet(seed); + } + + throw new Error("The ethereum wallet could not be generated"); +} + +export function newWalletFromMnemonic(mnemonic: string): Wallet { + try { + return Wallet.fromMnemonic(mnemonic); + } catch (e) { + throw new Error( + `Error: Could not create wallet from mnemonic: ${getErrorMessage(e)}`, + ); + } +} + +export function newWalletFromPrivateKey(pk: string): Wallet { + try { + return new Wallet(pk); + } catch (e) { + throw new Error( + `Error: Could not create wallet from private key: ${getErrorMessage(e)}`, + ); + } +} + +// This wrapper function is needed to ensure comaptibility with the validate function in the prompt call +// see initWalletFromEnvOrPrompt for details +export function isMnemonicValid(mnemonic: string): boolean { + return utils.isValidMnemonic(mnemonic); +} diff --git a/scripts/cc-cli/src/test/integration-tests/collectCoins.test.ts b/scripts/cc-cli/src/test/integration-tests/collectCoins.test.ts index e5f42d954f..99dad90ef8 100644 --- a/scripts/cc-cli/src/test/integration-tests/collectCoins.test.ts +++ b/scripts/cc-cli/src/test/integration-tests/collectCoins.test.ts @@ -14,9 +14,9 @@ import { import { cryptoWaitReady } from "@polkadot/util-crypto"; import { deployCtcContract, CREDO_PER_CTC } from "creditcoin-js/lib/ctc-deploy"; import { - forElapsedBlocks, testData, tryRegisterAddress, + forElapsedBlocks, } from "creditcoin-js/lib/testUtils"; import { describeIf } from "../../utils/tests"; import { getBalance } from "../../utils/balance"; diff --git a/scripts/cc-cli/src/test/integration-tests/registerAddress.test.ts b/scripts/cc-cli/src/test/integration-tests/registerAddress.test.ts index 1bd0fee47d..f8b8fba3ee 100644 --- a/scripts/cc-cli/src/test/integration-tests/registerAddress.test.ts +++ b/scripts/cc-cli/src/test/integration-tests/registerAddress.test.ts @@ -12,6 +12,7 @@ import { } from "creditcoin-js"; import { cryptoWaitReady } from "@polkadot/util-crypto"; import { testData } from "creditcoin-js/lib/testUtils"; +import { utils } from "ethers"; describe("register-address", () => { let ccApi: CreditcoinApi; @@ -32,14 +33,9 @@ describe("register-address", () => { arg("CREDITCOIN_CREATE_WALLET"), ); + // this arg call returns a function sudo = arg("CREDITCOIN_CREATE_SIGNER")(keyring, "sudo"); - }); - - afterAll(async () => { - await ccApi.api.disconnect(); - }); - test("e2e", async () => { const { api } = ccApi; const fundTx = await fundFromSudo( @@ -48,26 +44,49 @@ describe("register-address", () => { arg("CREDITCOIN_API_URL"), ); await signSendAndWatch(fundTx, api, sudo); + }, 100_000); + + afterAll(async () => { + await ccApi.api.disconnect(); + }); - const url = arg("CREDITCOIN_API_URL") as string; - const result = execa.commandSync( - `node dist/index.js register-address --url ${url} --blockchain Ethereum`, - { - env: { - // eslint-disable-next-line @typescript-eslint/naming-convention - ETH_PRIVATE_KEY: ethWallet.privateKey, - CC_SECRET: caller.secret, + it.each([ + ["using ethereum private key", false], + ["Using an ethereum mnemonic", true], + ])( + "should be able to register address: %s", + (text, useMnemonic) => { + let ethPrivateKey: string; + + if (useMnemonic) { + ethPrivateKey = utils.entropyToMnemonic(utils.randomBytes(32)); + } else { + ethPrivateKey = ethWallet.privateKey; + } + + const url = arg("CREDITCOIN_API_URL") as string; + const result = execa.commandSync( + `node dist/index.js register-address --url ${url} --blockchain Ethereum ${ + useMnemonic ? "--eth-mnemonic" : "" + }`, + { + env: { + // eslint-disable-next-line @typescript-eslint/naming-convention + ETH_PRIVATE_KEY: ethPrivateKey, + CC_SECRET: caller.secret, + }, }, - }, - ); + ); - const stdout = result.stdout.split("\n"); + const stdout = result.stdout.split("\n"); - expect(result.failed).toBe(false); - expect(result.exitCode).toBe(0); - expect(result.stderr).toBe(""); - expect( - stdout[stdout.length - 1].includes("Address Registered Successfully"), - ).toBe(true); - }, 50_000); + expect(result.failed).toBe(false); + expect(result.exitCode).toBe(0); + expect(result.stderr).toBe(""); + expect( + stdout[stdout.length - 1].includes("Address Registered Successfully"), + ).toBe(true); + }, + 50_000, + ); }); diff --git a/scripts/cc-cli/src/test/unit-tests/register-address.test.ts b/scripts/cc-cli/src/test/unit-tests/register-address.test.ts index dfe35fcec2..a84e503b5c 100644 --- a/scripts/cc-cli/src/test/unit-tests/register-address.test.ts +++ b/scripts/cc-cli/src/test/unit-tests/register-address.test.ts @@ -1,4 +1,11 @@ -import { isValidPrivateKey } from "../../commands/registerAddress"; +import { Wallet } from "creditcoin-js"; +import { + isMnemonicValid, + isValidPrivateKey, + newWalletFromMnemonic, + newWalletFromPrivateKey, +} from "../../commands/registerAddress"; +import { utils } from "ethers"; describe(isValidPrivateKey, () => { test("should return true when called with valid private key", () => { @@ -45,3 +52,77 @@ describe(isValidPrivateKey, () => { ).toBe(false); }); }); + +describe(newWalletFromPrivateKey, () => { + test("should return new wallet with valid private key", () => { + const goodWallet = Wallet.createRandom(); + + const testWallet = newWalletFromPrivateKey(goodWallet.privateKey); + expect(testWallet).toBeTruthy(); + expect(testWallet.privateKey).toEqual(goodWallet.privateKey); + expect(testWallet).toBeInstanceOf(Wallet); + }); + + test("should throw error with invalid private key", () => { + const goodWallet = Wallet.createRandom(); + const badPk = goodWallet.privateKey.substring( + 0, + goodWallet.privateKey.length - 1, + ); + expect(() => { + newWalletFromPrivateKey(badPk); + }).toThrow("Error: Could not create wallet from private key:"); + }); + + test("should thow error when called with empty string", () => { + expect(() => { + newWalletFromPrivateKey(""); + }).toThrow("Error: Could not create wallet from private key:"); + }); +}); + +describe(newWalletFromMnemonic, () => { + test("should return new wallet with valid mnemonic", () => { + const mnemonic = utils.entropyToMnemonic(utils.randomBytes(32)); + const testWallet = newWalletFromMnemonic(mnemonic); + expect(testWallet).toBeTruthy(); + expect(testWallet).toBeInstanceOf(Wallet); + }); + + test("should throw error when called with bad mnemonic", () => { + // construct a bad mnemonic by taking a good one and dropping the last word + const mnemonic = utils.entropyToMnemonic(utils.randomBytes(32)).split(" "); + mnemonic.pop(); + const badMnemonic = mnemonic.join(" "); + expect(() => { + newWalletFromMnemonic(badMnemonic); + }).toThrow("Error: Could not create wallet from mnemonic:"); + }); + + test("should throw error when called with empty string", () => { + expect(() => { + newWalletFromMnemonic(""); + }).toThrow("Error: Could not create wallet from mnemonic:"); + }); +}); + +describe(isMnemonicValid, () => { + test("should return true when called with valid mnemonic", () => { + expect( + isMnemonicValid(utils.entropyToMnemonic(utils.randomBytes(32))), + ).toBe(true); + }); + + test("should return false when called with empty string", () => { + expect(isMnemonicValid("")).toBe(false); + }); + + test("should return false when called with odd length mnemonic", () => { + // construct a bad mnemonic by taking a good one and dropping the last word + const mnemonic = utils.entropyToMnemonic(utils.randomBytes(32)).split(" "); + mnemonic.pop(); + const badMnemonic = mnemonic.join(" "); + + expect(isMnemonicValid(badMnemonic)).toBe(false); + }); +}); diff --git a/scripts/cc-cli/yarn.lock b/scripts/cc-cli/yarn.lock index 9b608c256d..11d323e67e 100644 --- a/scripts/cc-cli/yarn.lock +++ b/scripts/cc-cli/yarn.lock @@ -390,9 +390,9 @@ source-map-support "^0.5.16" "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.6": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" - integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== + version "7.23.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" + integrity sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g== dependencies: regenerator-runtime "^0.14.0" @@ -1696,9 +1696,9 @@ "@babel/types" "^7.20.7" "@types/bn.js@^5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.2.tgz#162f5238c46f4bcbac07a98561724eca1fcf0c5e" + integrity sha512-dkpZu0szUtn9UXTmw+e0AJFd4D2XAxDnsCLdc05SfqpqzPEBft8eQr8uaFitfo/dUUOZERaLec2hHMG87A4Dxg== dependencies: "@types/node" "*" @@ -1742,17 +1742,17 @@ integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== "@types/node-fetch@^2.6.2": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + version "2.6.6" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.6.tgz#b72f3f4bc0c0afee1c0bc9cff68e041d01e3e779" + integrity sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.0" "@types/node@*": - version "20.6.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.0.tgz#9d7daa855d33d4efec8aea88cd66db1c2f0ebe16" - integrity sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg== + version "20.7.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.7.0.tgz#c03de4572f114a940bc2ca909a33ddb2b925e470" + integrity sha512-zI22/pJW2wUZOVyguFaUL1HABdmSVxpXrzIqkjsHmyUjNhPoWM1CKfvVuXfetHhIok4RY573cqS0mZ1SJEnoTg== "@types/prompts@^2.4.4": version "2.4.4" @@ -1773,9 +1773,9 @@ integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/websocket@^1.0.5": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.6.tgz#ec8dce5915741632ac3a4b1f951b6d4156e32d03" - integrity sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg== + version "1.0.7" + resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.7.tgz#94ef83be9414db30c147d400cee08d5d767deeb0" + integrity sha512-62Omr8U0PO+hgjLCpPnMsmjh2/FRwIGOktZHyYAUzooEJotwkXHMp7vCacdYi8haxBNOiw9bc2HIHI+b/MPNjA== dependencies: "@types/node" "*" @@ -2301,7 +2301,7 @@ create-require@^1.1.0: "creditcoin-js@file:../../creditcoin-js/creditcoin-js-v0.10.4.tgz": version "0.10.4" - resolved "file:../../creditcoin-js/creditcoin-js-v0.10.4.tgz#78d4c8e4b0b6562537bfd110f0017ea7c65d4db1" + resolved "file:../../creditcoin-js/creditcoin-js-v0.10.4.tgz#cceccd3ad3dad8511d7cd244fe74873eba7e1bdf" dependencies: "@polkadot/api" "9.14.2" ethers "^5.7.1" @@ -2808,10 +2808,10 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -4630,9 +4630,9 @@ ws@7.4.6: integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== ws@^8.8.1: - version "8.14.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.1.tgz#4b9586b4f70f9e6534c7bb1d3dc0baa8b8cf01e0" - integrity sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A== + version "8.14.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" + integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== y18n@^5.0.5: version "5.0.8" diff --git a/scripts/js/yarn.lock b/scripts/js/yarn.lock index deee0551e0..e0e898ac5b 100644 --- a/scripts/js/yarn.lock +++ b/scripts/js/yarn.lock @@ -285,9 +285,9 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.6": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" - integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== + version "7.23.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" + integrity sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g== dependencies: regenerator-runtime "^0.14.0" @@ -1471,9 +1471,9 @@ "@babel/types" "^7.20.7" "@types/bn.js@^5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.2.tgz#162f5238c46f4bcbac07a98561724eca1fcf0c5e" + integrity sha512-dkpZu0szUtn9UXTmw+e0AJFd4D2XAxDnsCLdc05SfqpqzPEBft8eQr8uaFitfo/dUUOZERaLec2hHMG87A4Dxg== dependencies: "@types/node" "*" @@ -1517,17 +1517,17 @@ integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== "@types/node-fetch@^2.6.2": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + version "2.6.6" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.6.tgz#b72f3f4bc0c0afee1c0bc9cff68e041d01e3e779" + integrity sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.0" "@types/node@*": - version "20.6.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.0.tgz#9d7daa855d33d4efec8aea88cd66db1c2f0ebe16" - integrity sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg== + version "20.7.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.7.0.tgz#c03de4572f114a940bc2ca909a33ddb2b925e470" + integrity sha512-zI22/pJW2wUZOVyguFaUL1HABdmSVxpXrzIqkjsHmyUjNhPoWM1CKfvVuXfetHhIok4RY573cqS0mZ1SJEnoTg== "@types/semver@^7.5.0": version "7.5.1" @@ -1540,9 +1540,9 @@ integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/websocket@^1.0.5": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.6.tgz#ec8dce5915741632ac3a4b1f951b6d4156e32d03" - integrity sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg== + version "1.0.7" + resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.7.tgz#94ef83be9414db30c147d400cee08d5d767deeb0" + integrity sha512-62Omr8U0PO+hgjLCpPnMsmjh2/FRwIGOktZHyYAUzooEJotwkXHMp7vCacdYi8haxBNOiw9bc2HIHI+b/MPNjA== dependencies: "@types/node" "*" @@ -2033,7 +2033,7 @@ create-require@^1.1.0: "creditcoin-js@file:../../creditcoin-js/creditcoin-js-v0.10.4.tgz": version "0.10.4" - resolved "file:../../creditcoin-js/creditcoin-js-v0.10.4.tgz#78d4c8e4b0b6562537bfd110f0017ea7c65d4db1" + resolved "file:../../creditcoin-js/creditcoin-js-v0.10.4.tgz#cceccd3ad3dad8511d7cd244fe74873eba7e1bdf" dependencies: "@polkadot/api" "9.14.2" ethers "^5.7.1" @@ -2507,15 +2507,6 @@ follow-redirects@^1.15.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -4123,9 +4114,9 @@ ws@^8.5.0: integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== ws@^8.8.1: - version "8.14.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.1.tgz#4b9586b4f70f9e6534c7bb1d3dc0baa8b8cf01e0" - integrity sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A== + version "8.14.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" + integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== y18n@^5.0.5: version "5.0.8"