diff --git a/.github/workflows/npm_publish.yaml b/.github/workflows/npm_publish.yaml index 40801a40..aa185357 100644 --- a/.github/workflows/npm_publish.yaml +++ b/.github/workflows/npm_publish.yaml @@ -2,22 +2,28 @@ name: Publish to NPM on: push: tags: - - '*' + - "*" jobs: build: runs-on: [self-hosted, ci-runner] + environment: production release steps: - name: Checkout uses: actions/checkout@v3 - name: Setup Node uses: actions/setup-node@v3 with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org' + node-version: "18.x" + registry-url: "https://registry.npmjs.org" - name: Install dependencies and build - run: npm ci && npm run build + run: npm ci && npm run build && npm run replaceVars + env: + RUDDER_STACK_KEY: ${{ secrets.RUDDER_STACK_KEY }} + RUDDER_STACK_DATAPLANE_URL: ${{ secrets.RUDDER_STACK_DATAPLANE_URL }} - name: Publish package on NPM run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPMJS_NPM_MATTERLABS_AUTOMATION_TOKEN }} + RUDDER_STACK_KEY: ${{ secrets.RUDDER_STACK_KEY }} + RUDDER_STACK_DATAPLANE_URL: ${{ secrets.RUDDER_STACK_DATAPLANE_URL }} diff --git a/.gitignore b/.gitignore index 36077f28..ac32d116 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ typechain #Hardhat files cache artifacts + +bin +bin/ diff --git a/README.md b/README.md index 093b5abb..6b274ded 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,15 @@ You can install this program globally with `npm i -g zksync-cli` or run the comm ### Commands +- `zksync-cli help`: Provides detailed information about each command. + - `zksync-cli create {PROJECT_NAME}`: creates a new Hardhat project in the given project name. If not provided, creates the project in the current folder, although this requires the folder to be empty. -- `zksync-cli deposit`: deposits funds from L1 (Goerli testnet) to zkSync 2.0 testnet. It will ask to enter: recipient wallet, amount in ETH (eg 0.1) and the private key of the wallet you're sending the funds from. +- `zksync-cli deposit`: deposits funds from L1 (Goerli testnet) to zkSync 2.0 testnet. It will ask to enter: network, recipient wallet, amount in ETH (eg 0.1) and the private key of the wallet you're sending the funds from. + +- `zksync-cli withdraw`: withdraws funds from zkSync 2.0 to L1 (Goerli testnet). It will ask to enter: network, recipient wallet, amount in ETH (eg 0.1) and the private key of the wallet you're sending the funds from. -- `zksync-cli withdraw`: withdraws funds from zkSync 2.0 to L1 (Goerli testnet). It will ask to enter: recipient wallet, amount in ETH (eg 0.1) and the private key of the wallet you're sending the funds from. +- `zksync-cli confirm-withdrawal`: confirms withdrawal of funds from zkSync 2.0 to L1 (Goerli testnet). It will ask to enter: network, withdrawal transaction address and the private key of the wallet you sent the funds from. > Both deposit and withdraw might take a couple of minutes to complete. @@ -30,6 +34,12 @@ You can install this program globally with `npm i -g zksync-cli` or run the comm - `zksync-cli localnet help`: Display this message and quit. - `zksync-cli localnet wallets`: Display seeded wallet keys. +### Options (flags) + +- `--zeek`: zeek, the dev cat, will search for an inspirational quote and provide to you at the end of any command. +- `--l1-rpc-url`: override the default Goerli L1 rpc URL when `localnet` is selected as the network. +- `--l2-rpc-url`: override the default zkSync testnet rpc URL when `localnet` is selected as the network. + ## Developing new features ### Install and build @@ -48,6 +58,11 @@ git push --tags Proper tests will be included soon. For now, you can test new changes locally by installing this package globably with `npm i -g`. + +### Tracking + +zkSync-cli tracks its usage for the single purpose of providing data so it can be improved. Data is fully anonymized. If you want to disable the tracking, set the environment variable NO_TRACKING to true. + ## Official Links - [Website](https://zksync.io/) diff --git a/bin/create.d.ts b/bin/create.d.ts deleted file mode 100644 index 00cbc073..00000000 --- a/bin/create.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function (projectName: string): Promise; diff --git a/bin/create.js b/bin/create.js deleted file mode 100644 index 9865b61f..00000000 --- a/bin/create.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const { execSync } = require('child_process'); -const chalk_1 = __importDefault(require("chalk")); -/** - * Runs CLI commands - * @param {*} command String command to run - */ -const runCommand = (command) => { - try { - // runs given command and prints its output to console - execSync(`${command}`, { stdio: 'inherit' }); - } - catch (error) { - console.error('Failed to run command: ', error); - return false; - } - return true; -}; -function default_1(projectName) { - return __awaiter(this, void 0, void 0, function* () { - // clones repo inside the given project name folder - const cloneGitTemplate = `git clone https://github.com/matter-labs/zksync-hardhat-template ${projectName}`; - // changes dir and installs deps with Yarn - const installDeps = `cd ${projectName} && yarn`; - const cleanup = `cd ${projectName} && rm -f -r .git`; - console.log(chalk_1.default.magentaBright('Creating a zkSync - Hardhat project...')); - console.log(chalk_1.default.magentaBright(`Initialising project with name ${projectName}`)); - const cloned = runCommand(cloneGitTemplate); - if (!cloned) - process.exit(-1); - const cleaned = runCommand(cleanup); - if (!cleaned) - process.exit(-1); - console.log(chalk_1.default.magentaBright('Installing dependencies with yarn...')); - const depsInstalled = runCommand(installDeps); - if (!depsInstalled) - process.exit(-1); - console.log(chalk_1.default.magentaBright('Dependencies installed')); - console.log(`All ready! Run cd ${projectName} to enter your project folder. - -Contracts are stored in the /contracts folder. -Deployment scripts go in the /deploy folder. - -Run ${chalk_1.default.magentaBright('yarn hardhat compile')} to compile your contracts. -Run ${chalk_1.default.magentaBright('yarn hardhat deploy-zksync')} to deploy your contract (this command accepts a --script option). - -Run ${chalk_1.default.magentaBright('git init')} to initialise a new repository. - -Read the README file to learn more. - -`); - }); -} -exports.default = default_1; diff --git a/bin/deposit.d.ts b/bin/deposit.d.ts deleted file mode 100644 index 83a22b16..00000000 --- a/bin/deposit.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function (): Promise; diff --git a/bin/deposit.js b/bin/deposit.js deleted file mode 100644 index 81328ef0..00000000 --- a/bin/deposit.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const zksync_web3_1 = require("zksync-web3"); -const ethers = __importStar(require("ethers")); -const chalk_1 = __importDefault(require("chalk")); -const inquirer_1 = __importDefault(require("inquirer")); -function default_1() { - return __awaiter(this, void 0, void 0, function* () { - console.log(chalk_1.default.magentaBright("Deposit funds from Goerli to zkSync")); - const questions = [ - { - message: "Address to deposit funds to:", - name: "to", - type: "input", - }, - { - message: "Amount in ETH:", - name: "amount", - type: "input", - }, - { - message: "Private key of the sender:", - name: "key", - type: "password", - }, - ]; - const results = yield inquirer_1.default.prompt(questions); - console.log(chalk_1.default.magentaBright(`Depositing ${results.amount}ETH to ${results.to}`)); - // Initialize the wallet. - const L1Provider = ethers.getDefaultProvider("goerli"); - const zkSyncProvider = new zksync_web3_1.Provider("https://zksync2-testnet.zksync.dev"); - const wallet = new zksync_web3_1.Wallet(results.key, zkSyncProvider, L1Provider); - // Deposit funds to L2 - const depositHandle = yield wallet.deposit({ - to: results.to, - token: zksync_web3_1.utils.ETH_ADDRESS, - amount: ethers.utils.parseEther(results.amount), - }); - console.log(chalk_1.default.magentaBright(`Transaction submitted πŸ’ΈπŸ’ΈπŸ’Έ`)); - console.log(chalk_1.default.magentaBright(`https://goerli.etherscan.io/tx/${depositHandle.hash}`)); - console.log(chalk_1.default.magentaBright(`Your funds will be available in zkSync in a couple of minutes.`)); - console.log(chalk_1.default.magentaBright(`To check the latest transactions of this wallet on zkSync, visit: https://goerli.explorer.zksync.io/address/${results.to}`)); - // ends - process.exit(0); - }); -} -exports.default = default_1; diff --git a/bin/index.d.ts b/bin/index.d.ts deleted file mode 100644 index 237decae..00000000 --- a/bin/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env node -export {}; diff --git a/bin/index.js b/bin/index.js index 7cf7351d..d71abab2 100755 --- a/bin/index.js +++ b/bin/index.js @@ -1,5 +1,14 @@ #! /usr/bin/env node "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -13,29 +22,59 @@ const create_1 = __importDefault(require("./create")); const deposit_1 = __importDefault(require("./deposit")); const withdraw_1 = __importDefault(require("./withdraw")); const localnet_1 = __importDefault(require("./localnet")); -const availableOptions = ['create', 'deposit', 'withdraw', 'localnet']; +const help_1 = __importDefault(require("./help")); +const confirm_withdraw_1 = __importDefault(require("./confirm-withdraw")); +const zeek_1 = __importDefault(require("./zeek")); +const availableOptions = [ + "create", + "deposit", + "withdraw", + "localnet", + "confirm-withdraw", + "help", +]; // second argument should be the selected option const option = process.argv[2]; -if (!availableOptions.includes(option)) { - console.log(`Invalid operation. Available operations are: ${availableOptions}`); - process.exit(-1); -} -// Starts CLI -console.log(chalk_1.default.magentaBright(figlet_1.default.textSync(`zkSync ${option}`, { horizontalLayout: 'full' }))); -switch (option) { - case 'create': - // arg 3 is the project name - const projectName = process.argv[3] || '.'; - (0, create_1.default)(projectName); - break; - case 'deposit': - (0, deposit_1.default)(); - break; - case 'withdraw': - (0, withdraw_1.default)(); - break; - case 'localnet': - const subcommandName = process.argv[3] || undefined; - (0, localnet_1.default)(subcommandName); - break; -} +const main = () => __awaiter(void 0, void 0, void 0, function* () { + if (!availableOptions.includes(option)) { + console.log(`Invalid operation. Available operations are: ${availableOptions}`); + process.exit(-1); + } + // Starts CLI + console.log(chalk_1.default.magentaBright(figlet_1.default.textSync(`zkSync ${option}`, { horizontalLayout: "full" }))); + const zeekFlag = Boolean(process.argv.filter((arg) => arg === "--zeek")[0]); + const l1RpcUrl = String(process.argv + .filter((arg) => arg.startsWith("l1-rpc-url")) + .map((arg) => arg.split("=")[1])[0]); + const l2RpcUrl = String(process.argv + .filter((arg) => arg.startsWith("l2-rpc-url")) + .map((arg) => arg.split("=")[1])[0]); + switch (option) { + case "create": + // arg 3 is the project name + const projectName = process.argv[3] || "."; + yield (0, create_1.default)(projectName, zeekFlag); + break; + case "deposit": + yield (0, deposit_1.default)(zeekFlag, l1RpcUrl, l2RpcUrl); + break; + case "withdraw": + yield (0, withdraw_1.default)(zeekFlag, l1RpcUrl, l2RpcUrl); + break; + case "confirm-withdraw": + yield (0, confirm_withdraw_1.default)(zeekFlag, l1RpcUrl, l2RpcUrl); + break; + case 'localnet': + const subcommandName = process.argv[3] || undefined; + (0, localnet_1.default)(subcommandName); + break; + case "help": + (0, help_1.default)(); + break; + } + if (zeekFlag) { + yield (0, zeek_1.default)(); + } + process.exit(0); +}); +main(); diff --git a/bin/withdraw.d.ts b/bin/withdraw.d.ts deleted file mode 100644 index 83a22b16..00000000 --- a/bin/withdraw.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function (): Promise; diff --git a/bin/withdraw.js b/bin/withdraw.js deleted file mode 100644 index 74a41b4e..00000000 --- a/bin/withdraw.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const zksync_web3_1 = require("zksync-web3"); -const ethers = __importStar(require("ethers")); -const chalk_1 = __importDefault(require("chalk")); -const inquirer_1 = __importDefault(require("inquirer")); -function default_1() { - return __awaiter(this, void 0, void 0, function* () { - console.log(chalk_1.default.magentaBright('Withdraw funds from zkSync to Goerli')); - const questions = [ - { - message: 'Address to withdraw funds to:', - name: 'to', - type: 'input', - }, - { - message: 'Amount in ETH:', - name: 'amount', - type: 'input', - }, - { - message: 'Private key of the sender:', - name: 'key', - type: 'password', - }, - ]; - const results = yield inquirer_1.default.prompt(questions); - console.log(chalk_1.default.magentaBright(`Withdrawing ${results.amount}ETH to ${results.to}`)); - // // Initialize the wallet. - const L1Provider = ethers.getDefaultProvider('goerli'); - const zkSyncProvider = new zksync_web3_1.Provider('https://zksync2-testnet.zksync.dev'); - const wallet = new zksync_web3_1.Wallet(results.key, zkSyncProvider, L1Provider); - // Withdraw funds to L1 - const withdrawHandle = yield wallet.withdraw({ - to: results.to, - token: zksync_web3_1.utils.ETH_ADDRESS, - amount: ethers.utils.parseEther(results.amount), - }); - console.log(chalk_1.default.magentaBright(`Transaction submitted πŸ’ΈπŸ’ΈπŸ’Έ`)); - console.log(chalk_1.default.magentaBright(`https://goerli.explorer.zksync.io/tx/${withdrawHandle.hash}`)); - console.log(chalk_1.default.magentaBright(`Your funds will be available in L1 in a couple of minutes.`)); - console.log(chalk_1.default.magentaBright(`To check the latest transactions of this wallet on zkSync, visit: https://goerli.explorer.zksync.io/address/${results.to}`)); - // ends - process.exit(0); - }); -} -exports.default = default_1; diff --git a/package-lock.json b/package-lock.json index 3c8c330f..df40f1a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,21 @@ { "name": "zksync-cli", - "version": "0.1.4", + "version": "0.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "zksync-cli", - "version": "0.1.4", + "version": "0.2.3", "license": "MIT", "dependencies": { + "@rudderstack/rudder-sdk-node": "^2.0.2", + "axios": "^1.3.4", "chalk": "4.1.2", - "ethers": "^5.7.2", + "ethers": "5.7.2", "figlet": "^1.5.2", "inquirer": "^8.1.4", + "node-machine-id": "^1.1.12", "zksync-web3": "^0.14.3" }, "bin": { @@ -25,6 +28,25 @@ "typescript": "^4.8.4" } }, + "node_modules/@babel/runtime": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", + "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", + "dependencies": { + "regenerator-runtime": "^0.13.11" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -37,6 +59,16 @@ "node": ">=12" } }, + "node_modules/@dabh/diagnostics": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, "node_modules/@ethersproject/abi": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", @@ -708,19 +740,25 @@ "@ethersproject/strings": "^5.7.0" } }, + "node_modules/@ioredis/commands": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", + "optional": true + }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { @@ -733,6 +771,119 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.2.tgz", + "integrity": "sha512-9bfjwDxIDWmmOKusUcqdS4Rw+SETlp9Dy39Xui9BEGEk19dDwH0jhipwFzEff/pFg95NKymc6TOTbRKcWeRqyQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.2.tgz", + "integrity": "sha512-lwriRAHm1Yg4iDf23Oxm9n/t5Zpw1lVnxYU3HnJPTi2lJRkKTrps1KVgvL6m7WvmhYVt/FIsssWay+k45QHeuw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.2.tgz", + "integrity": "sha512-MOI9Dlfrpi2Cuc7i5dXdxPbFIgbDBGgKR5F2yWEa6FVEtSWncfVNKW5AKjImAQ6CZlBK9tympdsZJ2xThBiWWA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.2.tgz", + "integrity": "sha512-FU20Bo66/f7He9Fp9sP2zaJ1Q8L9uLPZQDub/WlUip78JlPeMbVL8546HbZfcW9LNciEXc8d+tThSJjSC+tmsg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.2.tgz", + "integrity": "sha512-gsWNDCklNy7Ajk0vBBf9jEx04RUxuDQfBse918Ww+Qb9HCPoGzS+XJTLe96iN3BVK7grnLiYghP/M4L8VsaHeA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.2.tgz", + "integrity": "sha512-O+6Gs8UeDbyFpbSh2CPEz/UOrrdWPTBYNblZK5CxxLisYt4kGX3Sc+czffFonyjiGSq3jWLwJS/CCJc7tBr4sQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rudderstack/rudder-sdk-node": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@rudderstack/rudder-sdk-node/-/rudder-sdk-node-2.0.3.tgz", + "integrity": "sha512-V7Ltj7BC29tBDt4ODhWvxYzfIvgx7qmvjopQ11A3BQXU4aIlqyKG/kP0u4Mij7FKPgdZVYHAl4+UqyKj7pml/g==", + "dependencies": { + "@segment/loosely-validate-event": "^2.0.0", + "axios": "0.26.0", + "axios-retry": "3.5.0", + "lodash.clonedeep": "^4.5.0", + "lodash.isstring": "^4.0.1", + "md5": "^2.3.0", + "ms": "^2.1.3", + "remove-trailing-slash": "^0.1.1", + "serialize-javascript": "6.0.1", + "uuid": "^8.3.2", + "winston": "^3.6.0" + }, + "engines": { + "node": ">=4" + }, + "optionalDependencies": { + "bull": "^4.10.2" + } + }, + "node_modules/@rudderstack/rudder-sdk-node/node_modules/axios": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.0.tgz", + "integrity": "sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==", + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, + "node_modules/@segment/loosely-validate-event": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz", + "integrity": "sha512-ZMCSfztDBqwotkl848ODgVcAmN4OItEWDCkshcKz0/W6gGSQayuuCtWV/MlodFivAZD793d6UgANd6wCXUfrIw==", + "dependencies": { + "component-type": "^1.2.1", + "join-component": "^1.1.0" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -752,24 +903,25 @@ "dev": true }, "node_modules/@tsconfig/node16": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, "node_modules/@types/inquirer": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-8.2.5.tgz", - "integrity": "sha512-QXlzybid60YtAwfgG3cpykptRYUx2KomzNutMlWsQC64J/WG/gQSl+P4w7A21sGN0VIxRVava4rgnT7FQmFCdg==", + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-3uT88kxg8lNzY8ay2ZjP44DKcRaTGztqeIvN2zHvhzIBH/uAPaL75aBtdNRKbA7xXoMbBt5kX0M00VKAnfOYlA==", "dev": true, "dependencies": { - "@types/through": "*" + "@types/through": "*", + "rxjs": "^7.2.0" } }, "node_modules/@types/node": { - "version": "18.13.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", - "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==", + "version": "18.16.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.19.tgz", + "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", "dev": true }, "node_modules/@types/through": { @@ -781,10 +933,15 @@ "@types/node": "*" } }, + "node_modules/@types/triple-beam": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", + "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==" + }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -849,6 +1006,35 @@ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, + "node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios-retry": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-3.5.0.tgz", + "integrity": "sha512-g48qNrLX30VU6ECWltpFCPegKK6dWzMDYv2o83W2zUL/Zh/SLXbT6ksGoKqYZHtghzqeeXhZBcSXJkO1fPbCcw==", + "dependencies": { + "@babel/runtime": "^7.15.4", + "is-retry-allowed": "^2.2.0" + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -916,6 +1102,25 @@ "ieee754": "^1.1.13" } }, + "node_modules/bull": { + "version": "4.10.4", + "resolved": "https://registry.npmjs.org/bull/-/bull-4.10.4.tgz", + "integrity": "sha512-o9m/7HjS/Or3vqRd59evBlWCXd9Lp+ALppKseoSKHaykK46SmRjAilX98PgmOz1yeVaurt8D5UtvEt4bUjM3eA==", + "optional": true, + "dependencies": { + "cron-parser": "^4.2.1", + "debuglog": "^1.0.0", + "get-port": "^5.1.1", + "ioredis": "^5.0.0", + "lodash": "^4.17.21", + "msgpackr": "^1.5.2", + "semver": "^7.3.2", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -936,6 +1141,14 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "engines": { + "node": "*" + } + }, "node_modules/cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -948,9 +1161,9 @@ } }, "node_modules/cli-spinners": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz", - "integrity": "sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.0.tgz", + "integrity": "sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g==", "engines": { "node": ">=6" }, @@ -974,6 +1187,24 @@ "node": ">=0.8" } }, + "node_modules/cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -990,12 +1221,112 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/color/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "dependencies": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/component-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-type/-/component-type-1.2.1.tgz", + "integrity": "sha512-Kgy+2+Uwr75vAi6ChWXgHuLvd+QLD7ssgpaRq2zCvt80ptvAfMc/hijcJxXkBa2wMlEZcJvC2H8Ubo+A9ATHIg==" + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "node_modules/cron-parser": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.8.1.tgz", + "integrity": "sha512-jbokKWGcyU4gl6jAfX97E1gDpY12DJ1cLJZmoDzaAln/shZ+S3KBFBuA2Q6WeUN4gJf/8klnV1EfvhA2lK5IRQ==", + "optional": true, + "dependencies": { + "luxon": "^3.2.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "engines": { + "node": "*" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + }, + "node_modules/debuglog": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "integrity": "sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", @@ -1007,6 +1338,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "optional": true, + "engines": { + "node": ">=0.10" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -1040,6 +1388,11 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "node_modules/enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1108,10 +1461,18 @@ "node": ">=4" } }, + "node_modules/fecha": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" + }, "node_modules/figlet": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.2.tgz", - "integrity": "sha512-WOn21V8AhyE1QqVfPIVxe3tupJacq1xGkPTB4iagT6o+P2cAgEOOwIxMftr4+ZCTI6d551ij9j61DFr0nsP2uQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.6.0.tgz", + "integrity": "sha512-31EQGhCEITv6+hi2ORRPyn3bulaV9Fl4xOdR169cBzH/n1UqcxsiSB/noo6SJdD7Kfb1Ljit+IgR1USvF/XbdA==", + "bin": { + "figlet": "bin/index.js" + }, "engines": { "node": ">= 0.4.0" } @@ -1130,6 +1491,55 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/get-port": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", + "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1217,6 +1627,40 @@ "node": ">=12.0.0" } }, + "node_modules/ioredis": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", + "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", + "optional": true, + "dependencies": { + "@ioredis/commands": "^1.1.1", + "cluster-key-slot": "^1.1.0", + "debug": "^4.3.4", + "denque": "^2.1.0", + "lodash.defaults": "^4.2.0", + "lodash.isarguments": "^3.1.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.1.0" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ioredis" + } + }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -1233,6 +1677,28 @@ "node": ">=8" } }, + "node_modules/is-retry-allowed": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz", + "integrity": "sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -1244,16 +1710,48 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/join-component": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/join-component/-/join-component-1.1.0.tgz", + "integrity": "sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ==" + }, "node_modules/js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" }, + "node_modules/kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + }, + "node_modules/lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", + "optional": true + }, + "node_modules/lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", + "optional": true + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -1269,12 +1767,75 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/logform": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.5.1.tgz", + "integrity": "sha512-9FyqAm9o9NKKfiAKfZoYo9bGXXuwMkxQiQttkT4YjjVtQVIQtK6LmVtlxmCaFswo6N4AfEkHqZTV0taDtPotNg==", + "dependencies": { + "@colors/colors": "1.5.0", + "@types/triple-beam": "^1.3.2", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/luxon": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz", + "integrity": "sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==", + "optional": true, + "engines": { + "node": ">=12" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -1293,11 +1854,70 @@ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/msgpackr": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.9.5.tgz", + "integrity": "sha512-/IJ3cFSN6Ci3eG2wLhbFEL6GT63yEaoN/R5My2QkV6zro+OJaVRLPlwvxY7EtHYSmDlQpk8stvOQTL2qJFkDRg==", + "optional": true, + "optionalDependencies": { + "msgpackr-extract": "^3.0.2" + } + }, + "node_modules/msgpackr-extract": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.2.tgz", + "integrity": "sha512-SdzXp4kD/Qf8agZ9+iTu6eql0m3kWm1A2y1hkpTeVNENutaB0BwHlSvAIaMxwntmRUAUjon2V4L8Z/njd0Ct8A==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "node-gyp-build-optional-packages": "5.0.7" + }, + "bin": { + "download-msgpackr-prebuilds": "bin/download-prebuilds.js" + }, + "optionalDependencies": { + "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.2", + "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.2", + "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.2", + "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.2", + "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.2", + "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.2" + } + }, "node_modules/mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "node_modules/node-gyp-build-optional-packages": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.7.tgz", + "integrity": "sha512-YlCCc6Wffkx0kHkmam79GKvDQ6x+QZkMjFGrIMxgFNILFvGSbCp2fCBC55pGTT9gVaz8Na5CLmxt/urtzRv36w==", + "optional": true, + "bin": { + "node-gyp-build-optional-packages": "bin.js", + "node-gyp-build-optional-packages-optional": "optional.js", + "node-gyp-build-optional-packages-test": "build-test.js" + } + }, + "node_modules/node-machine-id": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/node-machine-id/-/node-machine-id-1.1.12.tgz", + "integrity": "sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==" + }, + "node_modules/one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "dependencies": { + "fn.name": "1.x.x" + } + }, "node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", @@ -1342,10 +1962,23 @@ "node": ">=0.10.0" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -1355,6 +1988,37 @@ "node": ">= 6" } }, + "node_modules/redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", + "optional": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/redis-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", + "optional": true, + "dependencies": { + "redis-errors": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + }, + "node_modules/remove-trailing-slash": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/remove-trailing-slash/-/remove-trailing-slash-0.1.1.tgz", + "integrity": "sha512-o4S4Qh6L2jpnCy83ysZDau+VORNvnFw07CKSAymkd6ICNVEPisMyzlc00KlvvicsxKck94SEwhDnMNdICzO+tA==" + }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -1376,9 +2040,9 @@ } }, "node_modules/rxjs": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", - "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dependencies": { "tslib": "^2.1.0" } @@ -1402,6 +2066,14 @@ } ] }, + "node_modules/safe-stable-stringify": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", + "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "engines": { + "node": ">=10" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1412,11 +2084,56 @@ "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" }, + "node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "optional": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "engines": { + "node": "*" + } + }, + "node_modules/standard-as-callback": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", + "optional": true + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -1460,6 +2177,11 @@ "node": ">=8" } }, + "node_modules/text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -1476,6 +2198,11 @@ "node": ">=0.6.0" } }, + "node_modules/triple-beam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" + }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", @@ -1520,9 +2247,9 @@ } }, "node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", + "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" }, "node_modules/type-fest": { "version": "0.21.3", @@ -1553,6 +2280,14 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -1567,6 +2302,40 @@ "defaults": "^1.0.3" } }, + "node_modules/winston": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.9.0.tgz", + "integrity": "sha512-jW51iW/X95BCW6MMtZWr2jKQBP4hV5bIDq9QrIjfDk6Q9QuxvTKEAlpUNAzP+HYHFFCeENhph16s0zEunu4uuQ==", + "dependencies": { + "@colors/colors": "1.5.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.4.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.5.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/winston-transport": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", + "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", + "dependencies": { + "logform": "^2.3.2", + "readable-stream": "^3.6.0", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 6.4.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -1603,6 +2372,12 @@ } } }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "optional": true + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/package.json b/package.json index 02fa3d03..7bd81109 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,27 @@ { "name": "zksync-cli", - "version": "0.1.4", - "description": "CLI tool that simplifies the process of developing applications and interacting with zkSync 2.0.", + "version": "0.2.3", + "description": "CLI tool that simplifies the process of developing applications and interacting with the zkSync Era Network", "main": "bin/index.js", "bin": { "zksync-cli": "bin/index.js" }, "scripts": { "build": "tsc -p .", + "replaceVars": "node src/replace.js bin/analytics.js", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "MIT", "dependencies": { + "@rudderstack/rudder-sdk-node": "^2.0.2", + "axios": "^1.3.4", "chalk": "4.1.2", - "ethers": "^5.7.2", + "ethers": "5.7.2", "figlet": "^1.5.2", "inquirer": "^8.1.4", + "node-machine-id": "^1.1.12", "zksync-web3": "^0.14.3" }, "devDependencies": { diff --git a/src/analytics.ts b/src/analytics.ts new file mode 100644 index 00000000..77ace29a --- /dev/null +++ b/src/analytics.ts @@ -0,0 +1,30 @@ +import { machineId } from "node-machine-id"; +import RudderAnalytics from "@rudderstack/rudder-sdk-node"; + +let client: RudderAnalytics | undefined; +try { + client = new RudderAnalytics(process.env.RUDDER_STACK_KEY!, { + dataPlaneUrl: process.env.RUDDER_STACK_DATAPLANE_URL!, + }); +} catch (e) {} + +export const track = async (event: string, properties?: any) => { + return new Promise(async (resolve) => { + if (!client || process.env.NO_TRACKING) return; + + const raceFunction = setTimeout(() => { + resolve(); + }, 1000); + client!.track( + { + userId: await machineId(), + event, + properties, + }, + () => { + clearTimeout(raceFunction); + resolve(); + } + ); + }); +}; diff --git a/src/confirm-withdraw.ts b/src/confirm-withdraw.ts new file mode 100644 index 00000000..fd259baf --- /dev/null +++ b/src/confirm-withdraw.ts @@ -0,0 +1,104 @@ +import { Wallet, Provider } from "zksync-web3"; +import * as ethers from "ethers"; +import chalk from "chalk"; +import inquirer, { Answers, QuestionCollection } from "inquirer"; +import { track } from "./analytics"; + +export default async function ( + zeek?: boolean, + l1RpcUrl?: string, + l2RpcUrl?: string +) { + console.log( + chalk.magentaBright("Confirm withdrawal funds from zkSync to Layer 1") + ); + + const questions: QuestionCollection = [ + { + message: "Network:", + name: "network", + type: "list", + choices: ["testnet", "mainnet", "localnet"], + default: "testnet", + }, + { + message: "zkSync transaction hash:", + name: "transactionHash", + type: "input", + }, + { + message: "Private key of the sender:", + name: "key", + type: "password", + }, + ]; + + const results: Answers = await inquirer.prompt(questions); + + console.log( + chalk.magentaBright( + `Confirming withdrawal of ${results.transactionHash} from zkSync to L1 on ${results.network}` + ) + ); + + let ethProviderUrl; + let zksyncProviderUrl; + + switch (results.network) { + case "mainnet": + ethProviderUrl = "mainnet"; + zksyncProviderUrl = "https://mainnet.era.zksync.io"; + break; + case "testnet": + ethProviderUrl = "goerli"; + zksyncProviderUrl = "https://testnet.era.zksync.dev"; + break; + case "localnet": + ethProviderUrl = + l1RpcUrl == undefined ? "http://localhost:8545" : l1RpcUrl; + zksyncProviderUrl = + l2RpcUrl == undefined ? "http://localhost:3050" : l2RpcUrl; + break; + default: + throw `Unsupported network ${results.network}`; + } + + // Init the L1/L2 providers + let L1Provider; + // dynamically change provider class for local or testnet/mainnet + results.network == "localnet" + ? (L1Provider = new ethers.providers.JsonRpcProvider(ethProviderUrl)) + : (L1Provider = ethers.getDefaultProvider(ethProviderUrl)); + + const zkSyncProvider = new Provider(zksyncProviderUrl); + // Initialize the wallet. + const wallet = new Wallet(results.key, zkSyncProvider, L1Provider); + + // Get transaction details. + const l2Details = await zkSyncProvider.getTransactionDetails( + results.transactionHash + ); + if ( + l2Details.ethExecuteTxHash == undefined || + l2Details.ethExecuteTxHash == "" + ) { + console.log( + chalk.magentaBright( + `Transaction ${results.transactionHash} is still being processed, please try again when the ethExecuteTxHash has been computed` + ) + ); + console.log(chalk.magentaBright(`L2 Transaction Details: ${l2Details}`)); + return; + } + + try { + await wallet.finalizeWithdrawal(results.transactionHash); + console.log(chalk.magentaBright(`Withdrawal confirmed πŸ’ΈπŸ’ΈπŸ’Έ`)); + await track("confirm-withdraw", { zeek, network: results.network }); + } catch (error) { + console.log(chalk.magentaBright(`Confirmation of withdrawal unsuccessful`)); + await track("error", { error }); + } + + // ends +} diff --git a/src/create.ts b/src/create.ts index 11cb232e..991df54f 100644 --- a/src/create.ts +++ b/src/create.ts @@ -1,5 +1,8 @@ -const { execSync } = require('child_process'); -import chalk from 'chalk'; +const { execSync } = require("child_process"); +import chalk from "chalk"; +import { track } from "./analytics"; + +import inquirer, { Answers, QuestionCollection } from "inquirer"; /** * Runs CLI commands @@ -8,24 +11,52 @@ import chalk from 'chalk'; const runCommand = (command: string) => { try { // runs given command and prints its output to console - execSync(`${command}`, { stdio: 'inherit' }); + execSync(`${command}`, { stdio: "inherit" }); } catch (error) { - console.error('Failed to run command: ', error); + console.error("Failed to run command: ", error); return false; } return true; }; -export default async function (projectName: string) { +export default async function (projectName: string, zeek?: boolean) { + const questions: QuestionCollection = [ + { + message: "Project template:", + name: "template", + type: "list", + choices: ["Hardhat + Solidity", "Hardhat + Vyper"], + default: "Hardhat + Solidity", + }, + ]; + + const answers: Answers = await inquirer.prompt(questions); + + let repoUrl; + + switch (answers.template) { + case "Hardhat + Vyper": + repoUrl = `https://github.com/matter-labs/zksync-hardhat-vyper-template`; + break; + default: + repoUrl = `https://github.com/matter-labs/zksync-hardhat-template`; + break; + } + + await track("create", { zeek, template: answers.template }); + // clones repo inside the given project name folder - const cloneGitTemplate = `git clone https://github.com/matter-labs/zksync-hardhat-template ${projectName}`; + const cloneGitTemplate = `git clone ${repoUrl} ${projectName}`; // changes dir and installs deps with Yarn const installDeps = `cd ${projectName} && yarn`; + // removes .git folder so new repo can be initialised const cleanup = `cd ${projectName} && rm -f -r .git`; - console.log(chalk.magentaBright('Creating a zkSync - Hardhat project...')); + console.log( + chalk.magentaBright(`Creating a zkSync ${answers.template} project...`) + ); console.log( chalk.magentaBright(`Initialising project with name ${projectName}`) @@ -34,29 +65,32 @@ export default async function (projectName: string) { const cloned = runCommand(cloneGitTemplate); if (!cloned) process.exit(-1); + // runs cleanup const cleaned = runCommand(cleanup); if (!cleaned) process.exit(-1); - console.log(chalk.magentaBright('Installing dependencies with yarn...')); + console.log(chalk.magentaBright("Installing dependencies with yarn...")); const depsInstalled = runCommand(installDeps); if (!depsInstalled) process.exit(-1); - console.log(chalk.magentaBright('Dependencies installed')); + console.log(chalk.magentaBright("Dependencies installed")); - console.log(`All ready! Run cd ${projectName} to enter your project folder. + console.log(`All ready πŸŽ‰πŸŽ‰ + + Run cd ${projectName} to enter your project folder. -Contracts are stored in the /contracts folder. -Deployment scripts go in the /deploy folder. + Contracts are stored in the /contracts folder. + Deployment scripts go in the /deploy folder. -Run ${chalk.magentaBright('yarn hardhat compile')} to compile your contracts. -Run ${chalk.magentaBright( - 'yarn hardhat deploy-zksync' + Run ${chalk.magentaBright("yarn hardhat compile")} to compile your contracts. + Run ${chalk.magentaBright( + "yarn hardhat deploy-zksync" )} to deploy your contract (this command accepts a --script option). -Run ${chalk.magentaBright('git init')} to initialise a new repository. + Run ${chalk.magentaBright("git init")} to initialise a new repository. -Read the README file to learn more. + Read the ${chalk.magentaBright("README")} file to learn more. -`); + `); } diff --git a/src/deposit.ts b/src/deposit.ts index c5646837..7ed09692 100644 --- a/src/deposit.ts +++ b/src/deposit.ts @@ -3,11 +3,24 @@ import { PriorityOpResponse } from "zksync-web3/build/src/types"; import * as ethers from "ethers"; import chalk from "chalk"; import inquirer, { Answers, QuestionCollection } from "inquirer"; +import { track } from "./analytics"; -export default async function () { - console.log(chalk.magentaBright("Deposit funds from Goerli to zkSync")); +export default async function ( + zeek?: boolean, + l1RpcUrl?: string, + l2RpcUrl?: string +) { + console.log(chalk.magentaBright("Deposit funds from L1 to zkSync Era")); const questions: QuestionCollection = [ + { + message: "Network:", + name: "network", + type: "list", + choices: ["testnet", "mainnet", "localnet"], + default: "testnet", + }, + { message: "Address to deposit funds to:", name: "to", @@ -29,37 +42,78 @@ export default async function () { const results: Answers = await inquirer.prompt(questions); console.log( - chalk.magentaBright(`Depositing ${results.amount}ETH to ${results.to}`) + chalk.magentaBright( + `Depositing ${results.amount}ETH to ${results.to} on ${results.network}` + ) ); - // Initialize the wallet. - const L1Provider = ethers.getDefaultProvider("goerli"); + let ethProviderUrl; + let zksyncProviderUrl; + let etherScanUrl; + let zkSyncExplorerUrl; - const zkSyncProvider = new Provider("https://zksync2-testnet.zksync.dev"); - const wallet = new Wallet(results.key, zkSyncProvider, L1Provider); + switch (results.network) { + case "mainnet": + ethProviderUrl = "mainnet"; + zksyncProviderUrl = "https://mainnet.era.zksync.io"; + etherScanUrl = "https://etherscan.io/tx/"; + zkSyncExplorerUrl = "https://explorer.zksync.io/address/"; + break; + case "testnet": + ethProviderUrl = "goerli"; + zksyncProviderUrl = "https://testnet.era.zksync.dev"; + etherScanUrl = "https://goerli.etherscan.io/tx/"; + zkSyncExplorerUrl = "https://goerli.explorer.zksync.io/address/"; + break; + case "localnet": + ethProviderUrl = + l1RpcUrl == undefined ? "http://localhost:8545" : l1RpcUrl; + zksyncProviderUrl = + l2RpcUrl == undefined ? "http://localhost:3050" : l2RpcUrl; + etherScanUrl = "L1 transaction: "; + zkSyncExplorerUrl = "L2 address:"; + break; + default: + throw `Unsupported network ${results.network}`; + } - // Deposit funds to L2 - const depositHandle: PriorityOpResponse = await wallet.deposit({ - to: results.to, - token: utils.ETH_ADDRESS, - amount: ethers.utils.parseEther(results.amount), - }); + try { + // Init the L1/L2 providers + let L1Provider; + // dynamically change provider class for local or testnet/mainnet + results.network == "localnet" + ? (L1Provider = new ethers.providers.JsonRpcProvider(ethProviderUrl)) + : (L1Provider = ethers.getDefaultProvider(ethProviderUrl)); - console.log(chalk.magentaBright(`Transaction submitted πŸ’ΈπŸ’ΈπŸ’Έ`)); - console.log( - chalk.magentaBright(`https://goerli.etherscan.io/tx/${depositHandle.hash}`) - ); - console.log( - chalk.magentaBright( - `Your funds will be available in zkSync in a couple of minutes.` - ) - ); - console.log( - chalk.magentaBright( - `To check the latest transactions of this wallet on zkSync, visit: https://goerli.explorer.zksync.io/address/${results.to}` - ) - ); + const zkSyncProvider = new Provider(zksyncProviderUrl); + // Initialize the wallet. + const wallet = new Wallet(results.key, zkSyncProvider, L1Provider); + + // Deposit funds to L2 + const depositHandle: PriorityOpResponse = await wallet.deposit({ + to: results.to, + token: utils.ETH_ADDRESS, + amount: ethers.utils.parseEther(results.amount), + }); + + console.log(chalk.magentaBright(`Transaction submitted πŸ’ΈπŸ’ΈπŸ’Έ`)); + console.log(chalk.magentaBright(`${etherScanUrl}${depositHandle.hash}`)); + console.log( + chalk.magentaBright( + `Your funds will be available in zkSync in a couple of minutes.` + ) + ); + console.log( + chalk.magentaBright( + `To check the latest transactions of this wallet on zkSync, visit: ${zkSyncExplorerUrl}${results.to}` + ) + ); + await track("deposit", { zeek, network: results.network }); + } catch (error) { + console.error(`Error depositing funds πŸ€•`); + console.log(error); + await track("error", { error }); + } // ends - process.exit(0); } diff --git a/src/help.ts b/src/help.ts new file mode 100644 index 00000000..cfb10fed --- /dev/null +++ b/src/help.ts @@ -0,0 +1,35 @@ +import chalk from "chalk"; + +// @ts-ignore +import * as pkg from "../package.json"; + +export default async function () { + console.log(chalk.greenBright(`zksync-cli version ${pkg.version}`)); + console.log(chalk.bold("\nUsage:")); + console.log("zksync-cli [...args]\n"); + + console.log(chalk.bold(`Commands:\n`)); + console.log(chalk.greenBright(`create `)); + console.log( + `Creates a new Hardhat project in the provided folder. If no folder is specified, it will create the project in the current folder, provided it's empty.\n` + ); + console.log(chalk.greenBright(`deposit`)); + console.log( + `Deposits funds from L1 to zkSync Era. It will prompt for the network (localnet, testnet, mainnet), recipient wallet, amount in ETH (e.g., 0.1), and the private key of the wallet sending funds.\n` + ); + console.log(chalk.greenBright(`withdraw`)); + console.log( + `Withdraws funds from zkSync Era to L1. It will prompt for the network (localnet, testnet, mainnet), recipient wallet, amount in ETH (e.g., 0.1), and the private key of the wallet sending funds.\n` + ); + console.log(chalk.greenBright(`confirm-withdrawal`)); + console.log( + `Confirms the withdrawal of funds from zkSync to Layer 1. It will prompt for the network (localnet, testnet, mainnet), the transaction address of the withdrawal, and the private key of the wallet initiating the confirmation.\n` + ); + console.log(chalk.greenBright(`localnet`)); + console.log( + `Manages a local zkSync 2.0 and Ethereum L1 testnet. Run zksync-cli localnet test for a list of supported operations.` + ); + + // Exit the process + process.exit(0); +} diff --git a/src/index.ts b/src/index.ts index 36f23ad3..a72ccbcb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,51 +1,89 @@ #! /usr/bin/env node -import chalk from 'chalk'; +import chalk from "chalk"; // @ts-ignore // const figlet = require('figlet'); -import figlet from 'figlet'; +import figlet from "figlet"; // import method to create projects -import create from './create'; -import deposit from './deposit'; -import withdraw from './withdraw'; +import create from "./create"; +import deposit from "./deposit"; +import withdraw from "./withdraw"; import localnet from './localnet'; +import help from "./help"; +import confirmWithdraw from "./confirm-withdraw"; +import zeek from "./zeek"; -const availableOptions: string[] = ['create', 'deposit', 'withdraw', 'localnet']; +const availableOptions: string[] = [ + "create", + "deposit", + "withdraw", + "localnet", + "confirm-withdraw", + "help", +]; // second argument should be the selected option const option: string = process.argv[2]; -if (!availableOptions.includes(option)) { +const main = async () => { + if (!availableOptions.includes(option)) { + console.log( + `Invalid operation. Available operations are: ${availableOptions}` + ); + process.exit(-1); + } + + // Starts CLI + console.log( - `Invalid operation. Available operations are: ${availableOptions}` + chalk.magentaBright( + figlet.textSync(`zkSync ${option}`, { horizontalLayout: "full" }) + ) + ); + + const zeekFlag = Boolean(process.argv.filter((arg) => arg === "--zeek")[0]); + const l1RpcUrl = String( + process.argv + .filter((arg) => arg.startsWith("l1-rpc-url")) + .map((arg) => arg.split("=")[1])[0] + ); + const l2RpcUrl = String( + process.argv + .filter((arg) => arg.startsWith("l2-rpc-url")) + .map((arg) => arg.split("=")[1])[0] ); - process.exit(-1); -} - -// Starts CLI - -console.log( - chalk.magentaBright( - figlet.textSync(`zkSync ${option}`, { horizontalLayout: 'full' }) - ) -); - -switch (option) { - case 'create': - // arg 3 is the project name - const projectName = process.argv[3] || '.'; - create(projectName); - break; - case 'deposit': - deposit(); - break; - case 'withdraw': - withdraw(); - break; - case 'localnet': - const subcommandName = process.argv[3] || undefined; - localnet(subcommandName); - break; -} + + switch (option) { + case "create": + // arg 3 is the project name + const projectName = process.argv[3] || "."; + await create(projectName, zeekFlag); + break; + case "deposit": + await deposit(zeekFlag, l1RpcUrl, l2RpcUrl); + break; + case "withdraw": + await withdraw(zeekFlag, l1RpcUrl, l2RpcUrl); + break; + case "confirm-withdraw": + await confirmWithdraw(zeekFlag, l1RpcUrl, l2RpcUrl); + break; + case 'localnet': + const subcommandName = process.argv[3] || undefined; + localnet(subcommandName); + break; + case "help": + help(); + break; + } + + if (zeekFlag) { + await zeek(); + } + + process.exit(0); +}; + +main(); diff --git a/src/replace.js b/src/replace.js new file mode 100644 index 00000000..5bbbd9fe --- /dev/null +++ b/src/replace.js @@ -0,0 +1,62 @@ +const readline = require("readline"); +const fs = require("fs"); +const { EOL } = require("os"); + +let filename; + +if (process.argv.length === 3) { + filename = process.argv[2]; + console.log("Filename:", filename); + + if (!fs.existsSync(filename)) { + console.log("Error: file does not exists"); + process.exit(1); + } + + if ( + !process.env.RUDDER_STACK_KEY || + !process.env.RUDDER_STACK_DATAPLANE_URL + ) { + console.log("Error: Missing env variables"); + process.exit(1); + } + + // Create copy of file to use for attempted string replacement - Keep file permissions the same + // Fail if file already exists + fs.copyFileSync(filename, filename + "-new", fs.constants.COPYFILE_EXCL); + + const readInterface = readline.createInterface({ + input: fs.createReadStream(filename), + output: fs.createWriteStream(filename + "-new"), + terminal: false, + }); + + let counter = 0; + + readInterface.on("line", function (line) { + if (line) { + const regex = /.*process\.env\.([a-zA-Z0-9_]*).*/; + let envArray = line.match(regex); + if (envArray && envArray.length) { + let envValue = process.env[envArray[1]]; + if (envValue) { + line = line.replace(`process.env.${envArray[1]}`, `"${envValue}"`); + counter++; + } + } + this.output.write(`${line}${EOL}`); + } else { + this.output.write(EOL); + } + }); + + readInterface.on("close", function (event) { + // Rename updated version of file to original overwriting original + fs.renameSync(filename + "-new", filename); + console.log(`Succesfully updated ${filename}`); + console.log(`Replaced ${counter} variables`); + }); +} else { + console.log("Error: must receive single argument containing filename"); + console.log("Usage: 'replace-env '"); +} diff --git a/src/withdraw.ts b/src/withdraw.ts index cb56a0b8..09cd8fde 100644 --- a/src/withdraw.ts +++ b/src/withdraw.ts @@ -1,65 +1,113 @@ -import { Wallet, Provider, utils } from 'zksync-web3'; -import * as ethers from 'ethers'; -import chalk from 'chalk'; -import inquirer, { Answers, QuestionCollection } from 'inquirer'; +import { Wallet, Provider, utils } from "zksync-web3"; +import * as ethers from "ethers"; +import chalk from "chalk"; +import inquirer, { Answers, QuestionCollection } from "inquirer"; +import { track } from "./analytics"; -export default async function () { - console.log(chalk.magentaBright('Withdraw funds from zkSync to Goerli')); +export default async function ( + zeek?: boolean, + l1RpcUrl?: string, + l2RpcUrl?: string +) { + console.log(chalk.magentaBright("Withdraw funds from zkSync to Goerli")); const questions: QuestionCollection = [ { - message: 'Address to withdraw funds to:', - name: 'to', - type: 'input', + message: "Network:", + name: "network", + type: "list", + choices: ["testnet", "mainnet", "localnet"], + default: "testnet", + }, + { + message: "Address to withdraw funds to:", + name: "to", + type: "input", }, - { - message: 'Amount in ETH:', - name: 'amount', - type: 'input', + message: "Amount in ETH:", + name: "amount", + type: "input", }, { - message: 'Private key of the sender:', - name: 'key', - type: 'password', + message: "Private key of the sender:", + name: "key", + type: "password", }, ]; const results: Answers = await inquirer.prompt(questions); console.log( - chalk.magentaBright(`Withdrawing ${results.amount}ETH to ${results.to}`) + chalk.magentaBright( + `Withdrawing ${results.amount}ETH to ${results.to} on ${results.network}` + ) ); - // // Initialize the wallet. - const L1Provider = ethers.getDefaultProvider('goerli'); - const zkSyncProvider = new Provider('https://zksync2-testnet.zksync.dev'); - const wallet = new Wallet(results.key, zkSyncProvider, L1Provider); + let ethProviderUrl; + let zksyncProviderUrl; + let zkSyncExplorerUrl; - // Withdraw funds to L1 - const withdrawHandle = await wallet.withdraw({ - to: results.to, - token: utils.ETH_ADDRESS, - amount: ethers.utils.parseEther(results.amount), - }); + switch (results.network) { + case "mainnet": + ethProviderUrl = "mainnet"; + zksyncProviderUrl = "https://mainnet.era.zksync.io"; + zkSyncExplorerUrl = "https://explorer.zksync.io/"; + break; + case "testnet": + ethProviderUrl = "goerli"; + zksyncProviderUrl = "https://testnet.era.zksync.dev"; + zkSyncExplorerUrl = "https://goerli.explorer.zksync.io/"; + break; + case "localnet": + ethProviderUrl = + l1RpcUrl == undefined ? "http://localhost:8545" : l1RpcUrl; + zksyncProviderUrl = + l2RpcUrl == undefined ? "http://localhost:3050" : l2RpcUrl; + zkSyncExplorerUrl = "L2: "; + break; + default: + throw `Unsupported network ${results.network}`; + } - console.log(chalk.magentaBright(`Transaction submitted πŸ’ΈπŸ’ΈπŸ’Έ`)); - console.log( - chalk.magentaBright( - `https://goerli.explorer.zksync.io/tx/${withdrawHandle.hash}` - ) - ); - console.log( - chalk.magentaBright( - `Your funds will be available in L1 in a couple of minutes.` - ) - ); - console.log( - chalk.magentaBright( - `To check the latest transactions of this wallet on zkSync, visit: https://goerli.explorer.zksync.io/address/${results.to}` - ) - ); + try { + // Init the L1/L2 providers + let L1Provider; + // dynamically change provider class for local or testnet/mainnet + results.network == "localnet" + ? (L1Provider = new ethers.providers.JsonRpcProvider(ethProviderUrl)) + : (L1Provider = ethers.getDefaultProvider(ethProviderUrl)); + + const zkSyncProvider = new Provider(zksyncProviderUrl); + // Initialize the wallet. + const wallet = new Wallet(results.key, zkSyncProvider, L1Provider); + + // Withdraw funds to L1 + const withdrawHandle = await wallet.withdraw({ + to: results.to, + token: utils.ETH_ADDRESS, + amount: ethers.utils.parseEther(results.amount), + }); + + console.log(chalk.magentaBright(`Transaction submitted πŸ’ΈπŸ’ΈπŸ’Έ`)); + console.log( + chalk.magentaBright(`${zkSyncExplorerUrl}tx/${withdrawHandle.hash}`) + ); + console.log( + chalk.magentaBright( + `Your funds will be available in L1 in a couple of minutes.` + ) + ); + console.log( + chalk.magentaBright( + `To check the latest transactions of this wallet on zkSync, visit: ${zkSyncExplorerUrl}address/${results.to}` + ) + ); + + await track("withdraw", { zeek, network: results.network }); + } catch (error) { + await track("error", { error }); + } // ends - process.exit(0); } diff --git a/src/zeek.ts b/src/zeek.ts new file mode 100644 index 00000000..3c4c235a --- /dev/null +++ b/src/zeek.ts @@ -0,0 +1,54 @@ +import chalk from "chalk"; +import axios from 'axios'; + +export default async function () { + + const api_url ="https://zenquotes.io/api/random/"; + let quote = "" + try { + const response = await axios.get(api_url); + var data: any = response.data; + quote = data[0]["q"] + " - " + data[0]["a"]; + } catch(e) { + quote = "No inspirational quote for you now." + } + + console.log(chalk.white("\n\n\ + -β–ˆβ–ˆ-- --β–“β–“- \n\ + -β–ˆβ–“---β–“β–“β–ˆβ–ˆβ–“ -β–“β–ˆβ–ˆβ–“β–“--β–ˆβ–“ \n\ + β–“β–ˆ--β–“β–“β–“---β–“β–ˆβ–ˆ- β–“β–ˆβ–ˆβ–“---β–“β–“--β–ˆβ–ˆ \n\ + β–ˆβ–ˆ-β–ˆβ–ˆ-β–“β–ˆβ–“β–“---β–“β–ˆβ–“- -β–“β–ˆβ–“---β–“β–“β–ˆβ–“β–ˆβ–ˆ-β–“β–ˆ-\n\ + β–ˆβ–“β–“β–ˆ- -β–ˆβ–ˆβ–“---β–“β–ˆβ–ˆ- β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ -β–ˆβ–ˆβ–“---β–“β–ˆβ–ˆ- β–ˆβ–“-β–ˆβ–“\n\ +-β–ˆβ–“β–ˆβ–ˆ -β–ˆβ–ˆ----β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“---------β–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–“---β–“β–ˆβ–ˆ- β–“β–ˆ-β–ˆβ–ˆ\n\ +-β–ˆβ–“β–ˆβ–“ β–“β–ˆβ–“---------------------------------β–“-----β–ˆβ–ˆ- -β–ˆ-β–“β–ˆ\n\ +-β–ˆβ–“β–ˆβ–“ -β–“β–ˆβ–“---------------------------------------β–“β–ˆβ–ˆ- -β–ˆβ–“β–“β–ˆ\n\ + β–ˆβ–“β–ˆβ–“ β–“β–ˆβ–ˆβ–“--------------------------------------------β–“β–ˆβ–“ -β–ˆβ–“β–ˆβ–ˆ\n\ + β–ˆβ–“β–ˆβ–ˆ β–“β–ˆβ–“-------------------------------------------------β–“β–ˆβ–“ β–“β–ˆ-β–ˆβ–ˆ\n\ + β–ˆβ–ˆβ–“β–ˆ-β–ˆβ–ˆ-----------------------------------------------------β–“β–ˆ- β–ˆβ–ˆ-β–ˆβ–“\n\ + -β–ˆβ–“β–ˆβ–ˆβ–“-------------------------------------------------------β–“β–ˆβ–ˆβ–ˆβ–“β–“β–ˆ \n\ + β–ˆβ–ˆβ–ˆβ–“----------------------------------------------------------β–ˆβ–ˆβ–“β–ˆβ–“ \n\ + β–ˆβ–ˆβ–“---------β–“β–“β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“----------------β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“----------β–ˆβ–ˆβ–ˆ \n\ + β–ˆβ–“-------β–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–ˆβ–ˆβ–“β–“----------β–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–“β–“--------β–ˆβ–“ \n\ + β–ˆβ–ˆ------β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“--β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆ-------β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“-β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“------β–“β–ˆ \n\ +-β–ˆβ–“-----β–“β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“β–“ -β–ˆβ–ˆβ–ˆβ–“β–“β–ˆβ–“β–“β–“β–“β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“β–“ β–ˆβ–ˆβ–ˆβ–“β–“β–ˆβ–“------β–ˆβ–“ \n\ +β–“β–ˆ-----β–“β–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–“- β–“β–“ β–“β–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“β–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–“ β–“β–“--β–ˆβ–“β–“β–ˆβ–“-----β–“β–ˆ \n\ +β–ˆβ–ˆ-----β–ˆβ–ˆβ–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“ β–“β–ˆβ–“β–“β–ˆβ–ˆβ–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–“ -β–“- -β–ˆβ–ˆβ–“β–ˆβ–ˆ-----β–“β–ˆ-\n\ +β–ˆβ–ˆ-----β–ˆβ–ˆβ–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–“ β–“β–“- -β–“β–ˆβ–“β–“β–ˆβ–“-β–“β–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“- β–“β–“ β–“β–ˆβ–ˆβ–“β–ˆβ–ˆ------β–ˆ-\n\ +β–ˆβ–ˆ-----β–“β–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–“β–“β–“ -β–“- β–“β–ˆβ–ˆβ–“β–“β–ˆβ–“--β–ˆβ–“β–“β–ˆβ–ˆβ–“β–“β–“β–“β–“β–“ β–“β–“ β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆ-----β–“β–ˆ-\n\ +β–ˆβ–ˆ------β–“β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–“β–“- β–“β–“ β–“β–ˆβ–ˆβ–“β–“β–ˆβ–“---β–“β–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–“β–“β–“ β–“β–“ -β–ˆβ–ˆβ–ˆβ–“β–ˆβ–ˆβ–“-----β–“β–ˆ-\n\ +β–“β–ˆ-------β–“β–ˆβ–ˆβ–“β–ˆβ–ˆβ–ˆβ–ˆ β–“β–ˆ--β–“β–ˆβ–“β–“β–ˆβ–ˆβ–“-----β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆ- -β–“β–“ -β–ˆβ–ˆβ–“β–“β–ˆβ–ˆ-------β–ˆβ–ˆ \n\ + β–ˆβ–“--------β–“β–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–“- -β–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–“--------β–ˆβ–“ \n\ + β–“β–ˆ -------β–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“- -β–ˆβ–“β–“β–“β–“- -β–“β–ˆβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–“β–“--------- β–“β–ˆ \n\ + β–“β–ˆ β–“β–“ --β–ˆβ–ˆβ–ˆ-- β–ˆ β–“β–ˆ- \n\ + β–“β–ˆ- β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“- β–“β–ˆ \n\ + -β–ˆβ–“ -β–ˆβ–“ \n\ + -β–ˆβ–“ -β–ˆβ–“ \n\ + -β–“β–ˆ- β–“β–ˆβ–“ \n\ + -β–“β–ˆβ–“- -β–“β–ˆβ–“- \n\ + -β–“β–ˆβ–ˆβ–“-- --β–“β–ˆβ–ˆβ–“- \n\ + --β–“β–“β–ˆβ–“β–“β–“β–“β–“β–“--------β–“β–“β–“β–“β–“β–“β–ˆβ–“β–“-- \n\ +")) + + console.log(chalk.magentaBright(`zeek would like to tell you "${quote}"\n\n`)) + +}