From 7e8581d4e71b3c471253d2f31b50ff327499a10a Mon Sep 17 00:00:00 2001 From: liu9293 Date: Mon, 12 Dec 2022 17:58:47 +0800 Subject: [PATCH] wip git3 --- package.json | 12 +- src/git/git-remote-helper.ts | 9 +- src/git/git.ts | 2 +- src/git3/actions.js | 44 + src/git3/git.config.example | 18 + src/git3/index.js | 174 ++++ src/git3/readme.md | 10 + src/index.ts | 11 +- src/storage/MockStorage.ts | 74 -- src/storage/storage.ts | 2 +- src/test/git/COMMIT_EDITMSG | 1 + src/test/git/HEAD | 1 + src/test/git/config | 7 + src/test/git/description | 1 + src/test/git/hooks/applypatch-msg.sample | 15 + src/test/git/hooks/commit-msg.sample | 24 + src/test/git/hooks/fsmonitor-watchman.sample | 174 ++++ src/test/git/hooks/post-update.sample | 8 + src/test/git/hooks/pre-applypatch.sample | 14 + src/test/git/hooks/pre-commit.sample | 49 + src/test/git/hooks/pre-merge-commit.sample | 13 + src/test/git/hooks/pre-push.sample | 53 + src/test/git/hooks/pre-rebase.sample | 169 ++++ src/test/git/hooks/pre-receive.sample | 24 + src/test/git/hooks/prepare-commit-msg.sample | 42 + src/test/git/hooks/push-to-checkout.sample | 78 ++ src/test/git/hooks/update.sample | 128 +++ src/test/git/index | Bin 0 -> 145 bytes src/test/git/info/exclude | 6 + .../84/bf6a34d1210c6a9ec02226aef60ac30447ce26 | Bin 0 -> 40 bytes .../e9/21562c5ef74ef51cf432996c0b1363d5372777 | Bin 0 -> 119 bytes .../fb/4e08c058eef38643bd3ea01221d2fc746d4503 | Bin 0 -> 55 bytes src/test/git/refs/heads/main | 1 + src/wallet/generateWallet.ts | 0 src/wallet/importWallet.ts | 0 src/wallet/index.ts | 23 + src/wallet/uploader.js | 606 ++++++++++++ tsconfig.json | 2 +- yarn.lock | 929 +++++++++++++++++- 39 files changed, 2637 insertions(+), 87 deletions(-) create mode 100644 src/git3/actions.js create mode 100644 src/git3/git.config.example create mode 100644 src/git3/index.js create mode 100644 src/git3/readme.md delete mode 100644 src/storage/MockStorage.ts create mode 100644 src/test/git/COMMIT_EDITMSG create mode 100644 src/test/git/HEAD create mode 100644 src/test/git/config create mode 100644 src/test/git/description create mode 100755 src/test/git/hooks/applypatch-msg.sample create mode 100755 src/test/git/hooks/commit-msg.sample create mode 100755 src/test/git/hooks/fsmonitor-watchman.sample create mode 100755 src/test/git/hooks/post-update.sample create mode 100755 src/test/git/hooks/pre-applypatch.sample create mode 100755 src/test/git/hooks/pre-commit.sample create mode 100755 src/test/git/hooks/pre-merge-commit.sample create mode 100755 src/test/git/hooks/pre-push.sample create mode 100755 src/test/git/hooks/pre-rebase.sample create mode 100755 src/test/git/hooks/pre-receive.sample create mode 100755 src/test/git/hooks/prepare-commit-msg.sample create mode 100755 src/test/git/hooks/push-to-checkout.sample create mode 100755 src/test/git/hooks/update.sample create mode 100644 src/test/git/index create mode 100644 src/test/git/info/exclude create mode 100644 src/test/git/objects/84/bf6a34d1210c6a9ec02226aef60ac30447ce26 create mode 100644 src/test/git/objects/e9/21562c5ef74ef51cf432996c0b1363d5372777 create mode 100644 src/test/git/objects/fb/4e08c058eef38643bd3ea01221d2fc746d4503 create mode 100644 src/test/git/refs/heads/main create mode 100644 src/wallet/generateWallet.ts create mode 100644 src/wallet/importWallet.ts create mode 100644 src/wallet/index.ts create mode 100644 src/wallet/uploader.js diff --git a/package.json b/package.json index 09fcf71..5959512 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "git-remote-git3", "version": "1.0.0", "main": "dist/index.js", + "type": "module", "types": "dist/index.d.ts", "files": [ "dist/" @@ -19,8 +20,17 @@ "license": "MIT", "dependencies": { "buffer-split": "^1.0.0", + "bip39": "^3.0.4", + "colors-cli": "^1.0.28", + "commander": "^9.4.1", "debug": "^4.3.4", - "rxjs": "^6.6.3", + "eth-ens-namehash": "^2.0.8", + "ethers": "^5.7.2", + "git-config-path": "^2.0.0", + "inquirer": "^9.1.4", + "js-sha3": "^0.8.0", + "parse-git-config": "^3.0.0", + "rxjs": "^7.6.0", "rxjs-async-map": "^0.2.0", "rxjs-stream": "^3.2.1", "superpathjoin": "^2.0.1" diff --git a/src/git/git-remote-helper.ts b/src/git/git-remote-helper.ts index 9629e96..2b7a7eb 100644 --- a/src/git/git-remote-helper.ts +++ b/src/git/git-remote-helper.ts @@ -276,6 +276,7 @@ const GitRemoteHelper = async ({ throw new Error('Unknown command #Py9QTP') } ), + // @ts-ignore asyncMap(async command => { if (command.command === GitCommands.capabilities) { log( @@ -335,9 +336,9 @@ const GitRemoteHelper = async ({ tap(x => { logOutput('Sending response #31EyIs', JSON.stringify(x)) }) - ) - - rxToStream(output).pipe(stdout) -} + ); + // @ts-ignore + rxToStream(output).pipe(stdout); +}; export default GitRemoteHelper \ No newline at end of file diff --git a/src/git/git.ts b/src/git/git.ts index 735dc0c..7c35e28 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -169,7 +169,7 @@ class Git { let data = GitUtils.encodeObject(sha) let path = this.objectPath(sha) log("writing...", path, sha) - let status = await this.storage.upload(path, data) + let status = await this.storage.upload(path, data, this.remoteName, this.remoteUrl) log("status", status) } diff --git a/src/git3/actions.js b/src/git3/actions.js new file mode 100644 index 0000000..80f619b --- /dev/null +++ b/src/git3/actions.js @@ -0,0 +1,44 @@ +export const generateActions = [ + { + type: 'list', + name: 'keyType', + message: 'Select key type', + choices: [ + 'mnemonic', + 'private key', + ], + }, + { + type: 'input', + name: 'name', + message: "give an account name", + default() { + return 'default' + }, + } +] + +export const importActions = [ + { + type: 'list', + name: 'keyType', + message: 'Select key type', + choices: [ + 'mnemonic', + 'private key', + ] + }, + { + type: 'input', + name: 'key', + message: "type or paste your key or mnemonic" + }, + { + type: 'input', + name: 'name', + message: "give an account name", + default() { + return 'default' + }, + } +] \ No newline at end of file diff --git a/src/git3/git.config.example b/src/git3/git.config.example new file mode 100644 index 0000000..65d321a --- /dev/null +++ b/src/git3/git.config.example @@ -0,0 +1,18 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[remote "origin"] + url = git@github.com:cyhhao/git-remote-git3.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master +[pull] + rebase = true +[remote "g3"] + url = git3://git3 + fetch = +refs/heads/*:refs/remotes/g3/* diff --git a/src/git3/index.js b/src/git3/index.js new file mode 100644 index 0000000..e425f3f --- /dev/null +++ b/src/git3/index.js @@ -0,0 +1,174 @@ +import { mkdirSync, readdirSync, readFileSync, writeFileSync, rmSync, createWriteStream } from 'fs' +import { ethers } from 'ethers' +import { Command, Option } from 'commander' +import inquirer from 'inquirer' +import bip39 from 'bip39' +import parse from 'parse-git-config' +import { importActions, generateActions } from './actions.js' +const program = new Command() + +program + .name('git3') + .description('git3 mangement tool') + .version('0.1.0') + +program.command('generate') + .alias('gen') + .alias('new') + .description('generate a cryto wallet to use git3') + .action(() => { + inquirer.prompt(generateActions).then(answers => { + const { keyType, name } = answers + const walletType = keyType === 'private key' ? 'privateKey' : 'mnemonic' + + const keyPath = process.env.HOME + "/.git3/keys" + mkdirSync(keyPath, { recursive: true }) + + if (readdirSync(keyPath).includes(name)) { + console.error(`wallet ${name} already exists`) + return + } + + const mnemonic = bip39.generateMnemonic() + const wallet = keyType === 'private key' + ? ethers.Wallet.createRandom() + : ethers.Wallet.fromMnemonic(mnemonic) + + const content = `${walletType}\n${keyType === 'private key' ? wallet.privateKey : mnemonic}\n` + writeFileSync(`${keyPath}/${name}`, content) + return + }) + }) + +program.command('list', { isDefault: true }) + .alias('ls') + .description('list all wallets in user folder ~/.git3/keys') + .action(() => { + const keyPath = process.env.HOME + "/.git3/keys" + mkdirSync(keyPath, { recursive: true }) + const wallets = readdirSync(keyPath) + + if (wallets.length === 0) { + console.log('No wallet found, you can generate one with `git3 generate`') + } + + wallets.forEach(file => { + const content = readFileSync(`${keyPath}/${file}`).toString() + console.log(`[${file}]`) + console.log(` ${content.split('\n')[0]} - ${content.split('\n')[1]}`) + console.log('\n') + }) + }) + +program.command('import') + .description('import a wallet from a private key or mnemonic') + .action(() => { + inquirer.prompt(importActions).then(answers => { + const { keyType, key, name } = answers + const walletType = keyType === 'private key' ? 'privateKey' : 'mnemonic' + const keyPath = process.env.HOME + "/.git3/keys" + mkdirSync(keyPath, { recursive: true }) + + if (readdirSync(keyPath).includes(name)) { + console.error(`wallet ${name} already exists`) + return + } + + const content = `${walletType}\n${key}\n` + writeFileSync(`${keyPath}/${name}`, content) + return + }) +}) + +program.command('delete') + .description('delete a wallet') + .action(() => { + const keyPath = process.env.HOME + "/.git3/keys" + mkdirSync(keyPath, { recursive: true }) + const wallets = readdirSync(keyPath) + + if (wallets.length === 0) { + console.error('No wallet found, you can generate one with `git3 generate`') + return + } + + inquirer.prompt([ + { + type: 'list', + name: 'wallet', + message: 'Select wallet to delete', + choices: wallets + } + ]).then(answers => { + const { wallet } = answers + rmSync(`${keyPath}/${wallet}`) + }) + }) + +program.command('info') + .argument('[wallet]', 'wallet you want to get info', 'default') + .description('get info of a wallet') + .action(wallet => { + + const keyPath = process.env.HOME + "/.git3/keys" + mkdirSync(keyPath, { recursive: true }) + + const content = readFileSync(`${keyPath}/${wallet}`).toString() + const [walletType, key] = content.split('\n') + const provider = new ethers.providers.JsonRpcProvider('https://galileo.web3q.io:8545'); + + let etherWallet = walletType === 'privateKey' + ? new ethers.Wallet(key) + : ethers.Wallet.fromMnemonic(key) + + etherWallet = etherWallet.connect(provider) + const address = etherWallet.address + + etherWallet.getBalance() + .then(balance => { + console.log(`[wallet] ${wallet}`) + console.log(` address: ${address}`) + console.log(` balance: ${ethers.utils.formatUnits(balance)} eth`) + }) + .catch(err => { + console.error(err) + return + }) + }) + +program.command('set-wallet') + .alias('set') + .argument('', 'git3 remote') + .argument('[wallet]', 'wallet you want to bind', 'default') + .description('bind git3 remotes with a wallet') + .action((git3, wallet) => { + const currentConfig = parse.sync() + + const existingRemote = currentConfig[`remote "${git3}"`] + if (existingRemote) { + const newConfig = { + ...currentConfig, + [`remote "${git3}"`]: { + ...existingRemote, + wallet + } + } + + // console.log(newConfig) + // const writer = createWriteStream('config', 'w') + let newConfigText = '' + Object.keys(newConfig).forEach(key => { + newConfigText += `[${key}]\n` + Object.keys(newConfig[key]).forEach(subKey => { + newConfigText += `\t${subKey} = ${newConfig[key][subKey]}\n` + }) + }) + + writeFileSync(parse.resolve(), newConfigText) + } else { + console.error(`remote ${git3} not found`) + console.error('you can add a remote with `git remote add ') + } + }) + +program.parse() diff --git a/src/git3/readme.md b/src/git3/readme.md new file mode 100644 index 0000000..1e908e6 --- /dev/null +++ b/src/git3/readme.md @@ -0,0 +1,10 @@ +## git3 cli + +> git3 cli is used to manage private keys / mnemonic for interact with git3 protocal. + +* `git3 generate | gen | new` - Generate new key +* `git3 list | ls` - List all wallets +* `git3 import` - import wallet +* `git3 delete` - delete wallet +* `git3 info ` - Get ethereum/w3q balance/address for git3 account +* `git3 set ` - Set a wallet with a git3 remote \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 5e600cf..c25570b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,10 +5,14 @@ import Git from './git/git' import { log } from './git/log' import { MockStorage } from './storage/MockStorage' +<<<<<<< HEAD let git: Git +======= +let git: Git; +>>>>>>> 35ca1be (wip git3) GitRemoteHelper({ env: process.env, stdin: process.stdin, @@ -70,7 +74,6 @@ GitRemoteHelper({ }, }, }).catch((error: any) => { - console.error("wtf") - console.error(error) - -}) \ No newline at end of file + console.error("wtf"); + console.error(error); +}); diff --git a/src/storage/MockStorage.ts b/src/storage/MockStorage.ts deleted file mode 100644 index e663037..0000000 --- a/src/storage/MockStorage.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { promises as fs } from 'fs' -import pathUtil from 'path' -import { Ref, Status, Storage } from "./storage" -import { superpathjoin as join } from 'superpathjoin' -const mockPath = process.env.HOME + "/.git3/mock" -fs.mkdir(mockPath, { recursive: true }) -const log = console.error -log("mock path", mockPath) - -export class MockStorage implements Storage { - repoURI: string - - constructor(repoURI: string) { - this.repoURI = repoURI - } - - async listRefs(): Promise { - let stPath = join(mockPath, "refs.json") - try { - let refsJson = await fs.readFile(stPath) - let dict = JSON.parse(refsJson.toString()) - let list = [] - for (let key in dict) { - list.push({ ref: key, sha: dict[key] }) - } - return list - } - - catch (e) { - return [] - } - - } - async setRef(path: string, sha: string): Promise { - let dict - let stPath = join(mockPath, "refs.json") - try { - let refsJson = await fs.readFile(stPath) - dict = JSON.parse(refsJson.toString()) - } - catch (e) { - dict = {} - await fs.mkdir(pathUtil.dirname(stPath), { recursive: true }) - } - - dict[path] = sha - await fs.writeFile(stPath, JSON.stringify(dict)) - return Status.SUCCEED - } - async removeRef(path: string): Promise { - let stPath = join(mockPath, "refs.json") - let refsJson = await fs.readFile(stPath) - let dict = JSON.parse(refsJson.toString()) - delete dict[path] - await fs.writeFile(stPath, JSON.stringify(dict)) - return Status.SUCCEED - } - - async remove(path: string): Promise { - throw new Error("Method not implemented.") - } - async download(path: string): Promise<[Status, Buffer]> { - let buffer = await fs.readFile(join(mockPath, path)) - return [Status.SUCCEED, buffer] - } - - - async upload(path: string, file: Buffer): Promise { - let stPath = join(mockPath, path) - await fs.mkdir(pathUtil.dirname(stPath), { recursive: true }) - await fs.writeFile(stPath, file) - return Status.SUCCEED - } -} diff --git a/src/storage/storage.ts b/src/storage/storage.ts index 35d0f8f..2f9e8ed 100644 --- a/src/storage/storage.ts +++ b/src/storage/storage.ts @@ -15,7 +15,7 @@ export interface Storage { repoURI: string download(path: string): Promise<[Status, Buffer]> - upload(path: string, file: Buffer): Promise + upload(path: string, file: Buffer, remoteName: string, remoteUrl: string): Promise remove(path: string): Promise listRefs(): Promise setRef(path: string, sha: string): Promise diff --git a/src/test/git/COMMIT_EDITMSG b/src/test/git/COMMIT_EDITMSG new file mode 100644 index 0000000..b1b7161 --- /dev/null +++ b/src/test/git/COMMIT_EDITMSG @@ -0,0 +1 @@ +init diff --git a/src/test/git/HEAD b/src/test/git/HEAD new file mode 100644 index 0000000..b870d82 --- /dev/null +++ b/src/test/git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/main diff --git a/src/test/git/config b/src/test/git/config new file mode 100644 index 0000000..6c9406b --- /dev/null +++ b/src/test/git/config @@ -0,0 +1,7 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true diff --git a/src/test/git/description b/src/test/git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/src/test/git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/src/test/git/hooks/applypatch-msg.sample b/src/test/git/hooks/applypatch-msg.sample new file mode 100755 index 0000000..a5d7b84 --- /dev/null +++ b/src/test/git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/src/test/git/hooks/commit-msg.sample b/src/test/git/hooks/commit-msg.sample new file mode 100755 index 0000000..b58d118 --- /dev/null +++ b/src/test/git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/src/test/git/hooks/fsmonitor-watchman.sample b/src/test/git/hooks/fsmonitor-watchman.sample new file mode 100755 index 0000000..23e856f --- /dev/null +++ b/src/test/git/hooks/fsmonitor-watchman.sample @@ -0,0 +1,174 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + my $last_update_line = ""; + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + $last_update_line = qq[\n"since": $last_update_token,]; + } + my $query = <<" END"; + ["query", "$git_work_tree", {$last_update_line + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/src/test/git/hooks/post-update.sample b/src/test/git/hooks/post-update.sample new file mode 100755 index 0000000..ec17ec1 --- /dev/null +++ b/src/test/git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/src/test/git/hooks/pre-applypatch.sample b/src/test/git/hooks/pre-applypatch.sample new file mode 100755 index 0000000..4142082 --- /dev/null +++ b/src/test/git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/src/test/git/hooks/pre-commit.sample b/src/test/git/hooks/pre-commit.sample new file mode 100755 index 0000000..e144712 --- /dev/null +++ b/src/test/git/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/src/test/git/hooks/pre-merge-commit.sample b/src/test/git/hooks/pre-merge-commit.sample new file mode 100755 index 0000000..399eab1 --- /dev/null +++ b/src/test/git/hooks/pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/src/test/git/hooks/pre-push.sample b/src/test/git/hooks/pre-push.sample new file mode 100755 index 0000000..4ce688d --- /dev/null +++ b/src/test/git/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/src/test/git/hooks/pre-rebase.sample b/src/test/git/hooks/pre-rebase.sample new file mode 100755 index 0000000..6cbef5c --- /dev/null +++ b/src/test/git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/src/test/git/hooks/pre-receive.sample b/src/test/git/hooks/pre-receive.sample new file mode 100755 index 0000000..a1fd29e --- /dev/null +++ b/src/test/git/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/src/test/git/hooks/prepare-commit-msg.sample b/src/test/git/hooks/prepare-commit-msg.sample new file mode 100755 index 0000000..10fa14c --- /dev/null +++ b/src/test/git/hooks/prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/src/test/git/hooks/push-to-checkout.sample b/src/test/git/hooks/push-to-checkout.sample new file mode 100755 index 0000000..af5a0c0 --- /dev/null +++ b/src/test/git/hooks/push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/src/test/git/index b/src/test/git/index new file mode 100644 index 0000000000000000000000000000000000000000..5d0ba33315e21dd288c5bd0e9f1876286f7d4cd1 GIT binary patch literal 145 zcmZ?q402{*U|<4b#^h6Hxe*1A8hDJ_PA0qx>N z4rZvEWegczV6G;3YqnxIp(fIWYF?}_)}c}9l;=3$-OfnSz&hcT+K(Ume#@iZLHh** Zk=GHf7!cL8b0+*}rrM{8`U0E~Fh-%6J9_{C literal 0 HcmV?d00001 diff --git a/src/test/git/objects/fb/4e08c058eef38643bd3ea01221d2fc746d4503 b/src/test/git/objects/fb/4e08c058eef38643bd3ea01221d2fc746d4503 new file mode 100644 index 0000000000000000000000000000000000000000..2b4c165b9e57d3b56aeb10f6cfbd597f8d5665f5 GIT binary patch literal 55 zcmV-70LcG%0V^p=O;s?qU@$Z=Ff%bx$jnPgtFxS Nv$&sA0{~W+5G7rp7Ki`< literal 0 HcmV?d00001 diff --git a/src/test/git/refs/heads/main b/src/test/git/refs/heads/main new file mode 100644 index 0000000..e35a5cd --- /dev/null +++ b/src/test/git/refs/heads/main @@ -0,0 +1 @@ +e921562c5ef74ef51cf432996c0b1363d5372777 diff --git a/src/wallet/generateWallet.ts b/src/wallet/generateWallet.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/wallet/importWallet.ts b/src/wallet/importWallet.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/wallet/index.ts b/src/wallet/index.ts new file mode 100644 index 0000000..f31a4a8 --- /dev/null +++ b/src/wallet/index.ts @@ -0,0 +1,23 @@ +// program stomach view picnic because depth ready sight appear spin cream prefer +// selfAddress = 0xd1a98cD2382B8DA25280B380C0b9D85A63aD2818 +// contractAddress = '0x2A9B264471b19bAB5faD04807328F0dd4FD5549c' +import { ethers } from "ethers" +import uploader from './uploader.js' + +const mnemonic = 'program stomach view picnic because depth ready sight appear spin cream prefer' +const wallet = ethers.Wallet.fromMnemonic(mnemonic) +const contractAddress = '0x2A9B264471b19bAB5faD04807328F0dd4FD5549c' + +async function run () { + const addr = await wallet.getAddress() + console.log(addr) + + try { + const res = await uploader.deploy('/Users/kai/Code/git-remote-git3/src/wallet/git', contractAddress, wallet.privateKey) + console.log(res) + } catch (error) { + console.log(error) + } +} + +run() \ No newline at end of file diff --git a/src/wallet/uploader.js b/src/wallet/uploader.js new file mode 100644 index 0000000..56be066 --- /dev/null +++ b/src/wallet/uploader.js @@ -0,0 +1,606 @@ +const fs = require('fs'); +const { ethers, ContractFactory } = require("ethers"); +const { normalize } = require('eth-ens-namehash'); +const sha3 = require('js-sha3').keccak_256; +const { from, mergeMap } = require('rxjs'); + +const color = require('colors-cli/safe') +const error = color.red.bold; +const notice = color.blue; + +const nsAbi = [ + "function pointerOf(bytes memory name) public view returns (address)", + "function resolver(bytes32 node) public view returns (address)", +]; + +const resolverAbi = [ + "function webHandler(bytes32 node) external view returns (address)", + "function text(bytes32 node, string calldata key) external view returns (string memory)" +]; + +const fileAbi = [ + "function write(bytes memory filename, bytes memory data) public payable", + "function writeChunk(bytes memory name, uint256 chunkId, bytes memory data) public payable", + "function files(bytes memory filename) public view returns (bytes memory)", + "function setDefault(bytes memory _defaultFile) public", + "function refund() public", + "function remove(bytes memory name) external returns (uint256)", + "function countChunks(bytes memory name) external view returns (uint256)", + "function getChunkHash(bytes memory name, uint256 chunkId) public view returns (bytes32)" +]; + +const factoryAbi = [ + "event FlatDirectoryCreated(address)", + "function create() public returns (address)" +]; +const flatDirectoryAbi = [ + "constructor(uint8 slotLimit)", + "function changeOwner(address newOwner) public" +]; + +const SHORT_NAME_GALILEO = "w3q-g"; +const SHORT_NAME_ETHEREUM = "eth"; +const SHORT_NAME_GOERLI = "gor"; +const SHORT_NAME_SEPOLIA = "sep"; +const SHORT_NAME_OPTIMISTIC = "oeth"; +const SHORT_NAME_ARBITRUM = "arb1"; +const SHORT_NAME_OPTIMISTIC_GOERLI = "ogor"; +const SHORT_NAME_ARBITRUM_GOERLI = "arb-goerli"; +const SHORT_NAME_EVMOS = "evmos"; +const SHORT_NAME_EVMOS_TEST = "evmos-testnet"; +const SHORT_NAME_ARBITRUM_NOVE = "arb-nova"; +const SHORT_NAME_BINANCE = "bnb"; +const SHORT_NAME_BINANCE_TEST = "bnbt"; +const SHORT_NAME_AVALANCHE = "avax"; +const SHORT_NAME_AVALANCHE_TEST = "fuji"; +const SHORT_NAME_FANTOM = "ftm"; +const SHORT_NAME_FANTOM_TEST = "tftm"; +const SHORT_NAME_HARMONY = "hmy-s0"; +const SHORT_NAME_HARMONY_TEST = "hmy-b-s0"; +const SHORT_NAME_POLYGON = "matic"; +const SHORT_NAME_POLYGON_MUMBAI = "maticmum"; +const SHORT_NAME_POLYGON_ZKEVM_TEST = "zkevmtest"; +const SHORT_NAME_QUARKCHAIN = "qkc-s0"; +const SHORT_NAME_QUARKCHAIN_DEVNET = "qkc-d-s0"; + +const GALILEO_CHAIN_ID = 3334; +const ETHEREUM_CHAIN_ID = 1; +const GOERLI_CHAIN_ID = 5; +const SEPOLIA_CHAIN_ID = 11155111; +const OPTIMISTIC_CHAIN_ID = 10; +const ARBITRUM_CHAIN_ID = 42161; +const OPTIMISTIC_GOERLI_CHAIN_ID = 420; +const ARBITRUM_GOERLI_CHAIN_ID = 421613; +const EVMOS_CHAIN_ID = 9001; +const EVMOS_TEST_CHAIN_ID = 9000; +const ARBITRUM_NOVE_CHAIN_ID = 42170; +const BINANCE_CHAIN_ID = 56; +const BINANCE_TEST_CHAIN_ID = 97; +const AVALANCHE_CHAIN_ID = 43114; +const AVALANCHE_TEST_CHAIN_ID = 43113; +const FANTOM_CHAIN_ID = 250; +const FANTOM_TEST_CHAIN_ID = 4002; +const HARMONY_CHAIN_ID = 1666600000; +const HARMONY_TEST_CHAIN_ID = 1666700000; +const POLYGON_CHAIN_ID = 137; +const POLYGON_MUMBAI_CHAIN_ID = 80001; +const POLYGON_ZKEVM_TEST_CHAIN_ID = 1402; +const QUARKCHAIN_CHAIN_ID = 100001; +const QUARKCHAIN_DEVNET_CHAIN_ID = 110001; + +const NETWORK_MAPING = { + [SHORT_NAME_GALILEO]: GALILEO_CHAIN_ID, + [SHORT_NAME_ETHEREUM]: ETHEREUM_CHAIN_ID, + [SHORT_NAME_GOERLI]: GOERLI_CHAIN_ID, + [SHORT_NAME_SEPOLIA]: SEPOLIA_CHAIN_ID, + [SHORT_NAME_OPTIMISTIC]: OPTIMISTIC_CHAIN_ID, + [SHORT_NAME_ARBITRUM]: ARBITRUM_CHAIN_ID, + [SHORT_NAME_OPTIMISTIC_GOERLI]: OPTIMISTIC_GOERLI_CHAIN_ID, + [SHORT_NAME_ARBITRUM_GOERLI]: ARBITRUM_GOERLI_CHAIN_ID, + [SHORT_NAME_EVMOS]: EVMOS_CHAIN_ID, + [SHORT_NAME_EVMOS_TEST]: EVMOS_TEST_CHAIN_ID, + [SHORT_NAME_ARBITRUM_NOVE]: ARBITRUM_NOVE_CHAIN_ID, + [SHORT_NAME_BINANCE]: BINANCE_CHAIN_ID, + [SHORT_NAME_BINANCE_TEST]: BINANCE_TEST_CHAIN_ID, + [SHORT_NAME_AVALANCHE]: AVALANCHE_CHAIN_ID, + [SHORT_NAME_AVALANCHE_TEST]: AVALANCHE_TEST_CHAIN_ID, + [SHORT_NAME_FANTOM]: FANTOM_CHAIN_ID, + [SHORT_NAME_FANTOM_TEST]: FANTOM_TEST_CHAIN_ID, + [SHORT_NAME_HARMONY]: HARMONY_CHAIN_ID, + [SHORT_NAME_HARMONY_TEST]: HARMONY_TEST_CHAIN_ID, + [SHORT_NAME_POLYGON]: POLYGON_CHAIN_ID, + [SHORT_NAME_POLYGON_MUMBAI]: POLYGON_MUMBAI_CHAIN_ID, + [SHORT_NAME_POLYGON_ZKEVM_TEST]: POLYGON_ZKEVM_TEST_CHAIN_ID, + [SHORT_NAME_QUARKCHAIN]: QUARKCHAIN_CHAIN_ID, + [SHORT_NAME_QUARKCHAIN_DEVNET]: QUARKCHAIN_DEVNET_CHAIN_ID, +} + +const PROVIDER_URLS = { + [GALILEO_CHAIN_ID]: 'https://galileo.web3q.io:8545', + [GOERLI_CHAIN_ID]: 'https://rpc.ankr.com/eth_goerli', + [SEPOLIA_CHAIN_ID]: 'https://rpc.sepolia.org', + [OPTIMISTIC_CHAIN_ID]: 'https://mainnet.optimism.io', + [ARBITRUM_CHAIN_ID]: 'https://arb1.arbitrum.io/rpc', + [OPTIMISTIC_GOERLI_CHAIN_ID]: 'https://goerli.optimism.io', + [ARBITRUM_GOERLI_CHAIN_ID]: 'https://goerli-rollup.arbitrum.io/rpc', + [EVMOS_CHAIN_ID]: 'https://evmos-evm.publicnode.com', + [EVMOS_TEST_CHAIN_ID]: 'https://eth.bd.evmos.dev:8545', + [ARBITRUM_NOVE_CHAIN_ID]: 'https://nova.arbitrum.io/rpc', + [BINANCE_CHAIN_ID]: 'https://bsc-dataseed2.binance.org', + [BINANCE_TEST_CHAIN_ID]: 'https://data-seed-prebsc-1-s1.binance.org:8545', + [AVALANCHE_CHAIN_ID]: 'https://api.avax.network/ext/bc/C/rpc', + [AVALANCHE_TEST_CHAIN_ID]: 'https://avalanchetestapi.terminet.io/ext/bc/C/rpc', + [FANTOM_CHAIN_ID]: 'https://rpcapi.fantom.network', + [FANTOM_TEST_CHAIN_ID]: 'https://rpc.testnet.fantom.network', + [HARMONY_CHAIN_ID]: 'https://a.api.s0.t.hmny.io', + [HARMONY_TEST_CHAIN_ID]: 'https://api.s0.b.hmny.io', + [POLYGON_CHAIN_ID]: 'https://polygon-rpc.com', + [POLYGON_MUMBAI_CHAIN_ID]: 'https://matic-mumbai.chainstacklabs.com', + [POLYGON_ZKEVM_TEST_CHAIN_ID]: 'https://rpc.public.zkevm-test.net', + [QUARKCHAIN_CHAIN_ID]: 'https://mainnet-s0-ethapi.quarkchain.io', + [QUARKCHAIN_DEVNET_CHAIN_ID]: 'https://devnet-s0-ethapi.quarkchain.io', +} +const NS_ADDRESS = { + [GALILEO_CHAIN_ID]: '0xD379B91ac6a93AF106802EB076d16A54E3519CED', + [ETHEREUM_CHAIN_ID]: '0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e', + [GOERLI_CHAIN_ID]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', +} +const FACTORY_ADDRESS = { + [GALILEO_CHAIN_ID]: '0x1CA0e8be165360296a23907BB482c6640D3aC6ad', +} + +const REMOVE_FAIL = -1; +const REMOVE_NORMAL = 0; +const REMOVE_SUCCESS = 1; + +const SHORT_NAME_DEFAULT = SHORT_NAME_GALILEO; + +let nonce; + +const getNonce = () => { + return nonce++; +} + +// **** utils **** +function namehash(inputName) { + let node = '' + for (let i = 0; i < 32; i++) { + node += '00' + } + + if (inputName) { + const labels = inputName.split('.'); + for (let i = labels.length - 1; i >= 0; i--) { + let normalisedLabel = normalize(labels[i]) + let labelSha = sha3(normalisedLabel) + node = sha3(Buffer.from(node + labelSha, 'hex')) + } + } + + return '0x' + node +} + +function get3770NameAndAddress(domain) { + const domains = domain.split(":"); + if (domains.length > 1) { + return {shortName: domains[0], address: domains[1]}; + } else if(domain.endsWith(".eth")) { + return {shortName: SHORT_NAME_ETHEREUM, address: domain}; + } + return {shortName: SHORT_NAME_DEFAULT, address: domain}; +} + +function getNetWorkIdByShortName(shortName) { + let chainId = NETWORK_MAPING[shortName]; + if (chainId) { + return chainId; + } + return 0; +} + +// return address or eip3770 address +async function getWebHandler(domain, RPC) { + // get web handler address, domain is address, xxx.ens, xxx.w3q + const {shortName, address} = get3770NameAndAddress(domain); + const chainId = getNetWorkIdByShortName(shortName); + let providerUrl = RPC ?? PROVIDER_URLS[chainId]; + if (!providerUrl) { + console.error(error(`ERROR: The network need RPC, please try again after setting RPC!`)); + return; + } + + // address + const ethAddrReg = /^0x[0-9a-fA-F]{40}$/; + if (ethAddrReg.test(address)) { + return {providerUrl, chainId, address}; + } + + // .w3q or .eth domain + let nameServiceContract = NS_ADDRESS[chainId]; + if(!nameServiceContract) { + console.log(error(`Not Support Name Service: ${domain}`)); + return; + } + let webHandler; + const provider = new ethers.providers.JsonRpcProvider(providerUrl); + try { + const nameHash = namehash(address); + const wnsContract = new ethers.Contract(nameServiceContract, nsAbi, provider); + const resolver = await wnsContract.resolver(nameHash); + const resolverContract = new ethers.Contract(resolver, resolverAbi, provider); + if (chainId === GALILEO_CHAIN_ID) { + webHandler = await resolverContract.webHandler(nameHash); + } else { + webHandler = await resolverContract.text(nameHash, "web3"); + } + } catch (e){} + // address + if (ethAddrReg.test(webHandler)) { + return {providerUrl, chainId, address: webHandler}; + } + const shortAdd = get3770NameAndAddress(webHandler); + const newChainId = getNetWorkIdByShortName(shortAdd.shortName); + providerUrl = chainId === newChainId ? providerUrl : PROVIDER_URLS[newChainId]; + return { + providerUrl: providerUrl, + chainId: newChainId, + address: shortAdd.address + }; +} + +const getTxReceipt = async (fileContract, transactionHash) => { + const provider = fileContract.provider; + let txReceipt; + while (!txReceipt) { + txReceipt = await isTransactionMined(provider, transactionHash); + await sleep(5000); + } + return txReceipt; +} + +const isTransactionMined = async (provider, transactionHash) => { + const txReceipt = await provider.getTransactionReceipt(transactionHash); + if (txReceipt && txReceipt.blockNumber) { + return txReceipt; + } +} + +const sleep = (ms) => { + return new Promise((resolve) => { + setTimeout(resolve, ms); + }); +} + +const bufferChunk = (buffer, chunkSize) => { + let i = 0; + let result = []; + const len = buffer.length; + const chunkLength = Math.ceil(len / chunkSize); + while (i < len) { + result.push(buffer.slice(i, i += chunkLength)); + } + + return result; +} + +const recursiveFiles = (path, basePath) => { + let filePools = []; + const fileStat = fs.statSync(path); + if (fileStat.isFile()) { + filePools.push({path: path, name: path, size: fileStat.size}); + return filePools; + } + + const files = fs.readdirSync(path); + for (let file of files) { + const fileStat = fs.statSync(`${path}/${file}`); + if (fileStat.isDirectory()) { + const pools = recursiveFiles(`${path}/${file}`, `${basePath}${file}/`); + filePools = filePools.concat(pools); + } else { + filePools.push({path: `${path}/${file}`, name: `${basePath}${file}`, size: fileStat.size}); + } + } + return filePools; +}; + +const uploadFile = async (chainId = GALILEO_CHAIN_ID, fileContract, fileInfo) => { + const {path, name, size} = fileInfo; + const filePath = path; + const fileName = name; + let fileSize = size; + + const hexName = '0x' + Buffer.from(fileName, 'utf8').toString('hex'); + const content = fs.readFileSync(filePath); + let chunks = []; + if (chainId === GALILEO_CHAIN_ID) { + // Data need to be sliced if file > 475K + if (fileSize > 475 * 1024) { + const chunkSize = Math.ceil(fileSize / (475 * 1024)); + chunks = bufferChunk(content, chunkSize); + fileSize = fileSize / chunkSize; + } else { + chunks.push(content); + } + } else { + // Data need to be sliced if file > 24K + if (fileSize > 24 * 1024) { + const chunkSize = Math.ceil(fileSize / (24 * 1024)); + chunks = bufferChunk(content, chunkSize); + fileSize = fileSize / chunkSize; + } else { + chunks.push(content); + } + } + + const clearState = await clearOldFile(fileContract, fileName, hexName, chunks.length); + if (clearState === REMOVE_FAIL) { + return {upload: 0, fileName: fileName}; + } + + let cost = 0; + if ((chainId === GALILEO_CHAIN_ID) && (fileSize > 24 * 1024 - 326)) { + // eth storage need stake + cost = Math.floor((fileSize + 326) / 1024 / 24); + } + + let uploadCount = 0; + const failFile = []; + for (const index in chunks) { + const chunk = chunks[index]; + const hexData = '0x' + chunk.toString('hex'); + + if (clearState === REMOVE_NORMAL) { + // check is change + const localHash = '0x' + sha3(chunk); + let hash; + try { + hash = await fileContract.getChunkHash(hexName, index); + } catch (e) { + await sleep(3000); + hash = await fileContract.getChunkHash(hexName, index); + } + if (localHash === hash) { + console.log(`File ${fileName} chunkId: ${index}: The data is not changed.`); + continue; + } + } + + let estimatedGas; + try { + estimatedGas = await fileContract.estimateGas.writeChunk(hexName, index, hexData, { + value: ethers.utils.parseEther(cost.toString()) + }); + } catch (e) { + await sleep(3000); + estimatedGas = await fileContract.estimateGas.writeChunk(hexName, index, hexData, { + value: ethers.utils.parseEther(cost.toString()) + }); + } + + // upload file + const option = { + nonce: getNonce(), + gasLimit: estimatedGas.mul(6).div(5).toString(), + value: ethers.utils.parseEther(cost.toString()) + }; + let tx; + try { + tx = await fileContract.writeChunk(hexName, index, hexData, option); + } catch (e) { + await sleep(5000); + tx = await fileContract.writeChunk(hexName, index, hexData, option); + } + console.log(`${fileName}, chunkId: ${index}`); + console.log(`Transaction Id: ${tx.hash}`); + + // get result + let txReceipt; + try { + txReceipt = await getTxReceipt(fileContract, tx.hash); + } catch (e) {} + if (txReceipt && txReceipt.status) { + console.log(`File ${fileName} chunkId: ${index} uploaded!`); + uploadCount++; + } else { + failFile.push(index); + break; + } + } + + return { + upload: 1, + fileName: fileName, + cost: cost, + fileSize: fileSize / 1024, + uploadCount: uploadCount, + failFile: failFile + }; +}; + +const clearOldFile = async (fileContract, fileName, hexName, chunkLength) => { + let oldChunkLength; + try { + oldChunkLength = await fileContract.countChunks(hexName); + } catch (e) { + await sleep(3000); + oldChunkLength = await fileContract.countChunks(hexName); + } + + if (oldChunkLength > chunkLength) { + // remove + const option = {nonce: getNonce()}; + let tx; + try { + tx = await fileContract.remove(hexName, option); + } catch (e) { + await sleep(3000); + tx = await fileContract.remove(hexName, option); + } + console.log(`Remove Transaction Id: ${tx.hash}`); + const receipt = await getTxReceipt(fileContract, tx.hash); + if (receipt.status) { + console.log(`Remove file: ${fileName}`); + return REMOVE_SUCCESS; + } else { + return REMOVE_FAIL; + } + } + return REMOVE_NORMAL; +} +// **** utils **** + +// **** function **** +const deploy = async (path, domain, key, RPC) => { + const {providerUrl, chainId, address} = await getWebHandler(domain, RPC); + if (providerUrl && parseInt(address) > 0) { + const provider = new ethers.providers.JsonRpcProvider(providerUrl); + const wallet = new ethers.Wallet(key, provider); + + const fileContract = new ethers.Contract(address, fileAbi, wallet); + nonce = await wallet.getTransactionCount("pending"); + + let failPool = []; + let totalCost = 0, totalFileCount = 0, totalFileSize = 0; + // get file and remove old chunk + console.log("Stark upload File......."); + from(recursiveFiles(path, '')) + .pipe(mergeMap(info => uploadFile(chainId, fileContract, info), 15)) + // .returnValue() + .subscribe( + (info) => { + if (info.upload === 1) { + if (info.failFile && info.failFile.length > 0) { + for (const index of info.failFile) { + failPool.push(info.fileName + " Chunk:" + index); + } + } + totalFileCount += info.uploadCount; + totalCost += info.uploadCount * info.cost; + totalFileSize += info.uploadCount * info.fileSize; + } else { + failPool.push(info.fileName); + } + }, + (error) => { + throw error + }, + () => { + if (failPool.length > 0) { + console.log(); + for (const file of failPool) { + console.log(error(`ERROR: ${file} uploaded failed.`)); + } + } + console.log(); + console.log(notice(`Total Cost: ${totalCost} W3Q`)); + console.log(notice(`Total File Count: ${totalFileCount}`)); + console.log(notice(`Total File Size: ${totalFileSize} KB`)); + }); + } else { + console.log(error(`ERROR: ${domain} domain doesn't exist`)); + } +}; + +const createDirectory = async (key, chainId, RPC) => { + chainId = chainId ?? GALILEO_CHAIN_ID; + + if (FACTORY_ADDRESS[chainId]) { + // Galileo + const provider = new ethers.providers.JsonRpcProvider(PROVIDER_URLS[chainId]); + const wallet = new ethers.Wallet(key, provider); + + const factoryAddress = FACTORY_ADDRESS[chainId]; + const factoryContract = new ethers.Contract(factoryAddress, factoryAbi, wallet); + const tx = await factoryContract.create(); + console.log(`Transaction: ${tx.hash}`); + let txReceipt; + while (!txReceipt) { + txReceipt = await isTransactionMined(provider, tx.hash); + await sleep(5000); + } + if (txReceipt.status) { + let iface = new ethers.utils.Interface(factoryAbi); + let log = iface.parseLog(txReceipt.logs[0]); + console.log(`FlatDirectory Address: ${log.args[0]}`); + } else { + console.error(`ERROR: transaction failed!`); + } + } else { + // other network + const providerUrl = RPC ?? PROVIDER_URLS[chainId]; + if (!providerUrl) { + console.error(error(`ERROR: The network need RPC, please try again after setting RPC!`)); + return; + } + + const contractByteCode = '0x60c06040819052600060a08190526200001b916003916200008e565b503480156200002957600080fd5b5060405162001f4e38038062001f4e8339810160408190526200004c9162000134565b60f81b7fff000000000000000000000000000000000000000000000000000000000000001660805260028054336001600160a01b03199091161790556200019d565b8280546200009c9062000160565b90600052602060002090601f016020900481019282620000c057600085556200010b565b82601f10620000db57805160ff19168380011785556200010b565b828001600101855582156200010b579182015b828111156200010b578251825591602001919060010190620000ee565b50620001199291506200011d565b5090565b5b808211156200011957600081556001016200011e565b6000602082840312156200014757600080fd5b815160ff811681146200015957600080fd5b9392505050565b600181811c908216806200017557607f821691505b602082108114156200019757634e487b7160e01b600052602260045260246000fd5b50919050565b60805160f81c611d8b620001c3600039600081816104040152610b650152611d8b6000f3fe6080604052600436106200012e5760003560e01c806358edef4c11620000af578063a6f9dae1116200006d578063a6f9dae114620004fc578063caf128361462000521578063d84eb56c146200055c578063dd473fae1462000581578063f916c5b0146200059f576200012e565b806358edef4c146200043a578063590e1ae3146200045f5780635ba1d9e514620004775780638bf4515c146200049c5780638da5cb5b14620004c1576200012e565b80631c993ad511620000fd5780631c993ad5146200036c5780632b68b9c6146200039157806342216bed14620003a9578063492c7b2a14620003dd5780634eed7cf114620003f4576200012e565b8063038cd79f14620002b35780630936286114620002cc5780631a7237e014620002fc5780631c5ee10c1462000331575b3480156200013b57600080fd5b50600036606080826200015f575050604080516020810190915260008152620002a8565b8383600081811062000175576200017562001af2565b9050013560f81c60f81b6001600160f81b031916602f60f81b14620001c157505060408051808201909152600e81526d0d2dcc6dee4e4cac6e840e0c2e8d60931b6020820152620002a8565b8383620001d060018262001a3e565b818110620001e257620001e262001af2565b9050013560f81c60f81b6001600160f81b031916602f60f81b1415620002495762000240620002158460018188620019d4565b60036040516020016200022b9392919062001893565b604051602081830303815290604052620005c4565b5090506200029b565b620002976200025c8460018188620019d4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250620005c492505050565b5090505b620002a681620005e3565b505b915050805190602001f35b620002ca620002c436600462001735565b62000624565b005b348015620002d957600080fd5b50620002e462000676565b604051620002f3919062001970565b60405180910390f35b3480156200030957600080fd5b50620003216200031b366004620017a5565b6200070c565b604051620002f392919062001985565b3480156200033e57600080fd5b506200035662000350366004620016f4565b6200072f565b60408051928352602083019190915201620002f3565b3480156200037957600080fd5b50620002ca6200038b366004620016f4565b62000744565b3480156200039e57600080fd5b50620002ca6200078a565b348015620003b657600080fd5b50620003ce620003c8366004620017a5565b620007c5565b604051908152602001620002f3565b620002ca620003ee366004620017ee565b620007e7565b3480156200040157600080fd5b507f000000000000000000000000000000000000000000000000000000000000000060ff1615155b6040519015158152602001620002f3565b3480156200044757600080fd5b50620003ce62000459366004620016f4565b62000830565b3480156200046c57600080fd5b50620002ca62000874565b3480156200048457600080fd5b506200042962000496366004620017a5565b620008de565b348015620004a957600080fd5b5062000321620004bb366004620016f4565b620005c4565b348015620004ce57600080fd5b50600254620004e3906001600160a01b031681565b6040516001600160a01b039091168152602001620002f3565b3480156200050957600080fd5b50620002ca6200051b366004620016c9565b62000928565b3480156200052e57600080fd5b506200054662000540366004620017a5565b62000977565b60408051928352901515602083015201620002f3565b3480156200056957600080fd5b50620003ce6200057b366004620017a5565b6200098d565b3480156200058e57600080fd5b50651b585b9d585b60d21b620003ce565b348015620005ac57600080fd5b50620003ce620005be366004620016f4565b620009d0565b60606000620005da8380519060200120620009e4565b91509150915091565b600081516040620005f5919062001a00565b9050601f196200060782602062001a00565b6200061490601f62001a00565b1690506020808303528060208303f35b6002546001600160a01b031633146200065a5760405162461bcd60e51b81526004016200065190620019ab565b60405180910390fd5b620006718380519060200120600084843462000b55565b505050565b60038054620006859062001a87565b80601f0160208091040260200160405190810160405280929190818152602001828054620006b39062001a87565b8015620007045780601f10620006d85761010080835404028352916020019162000704565b820191906000526020600020905b815481529060010190602001808311620006e657829003601f168201915b505050505081565b606060006200072384805190602001208462000c3f565b915091505b9250929050565b600080620005da838051906020012062000cb8565b6002546001600160a01b03163314620007715760405162461bcd60e51b81526004016200065190620019ab565b8051620007869060039060208401906200153b565b5050565b6002546001600160a01b03163314620007b75760405162461bcd60e51b81526004016200065190620019ab565b6002546001600160a01b0316ff5b600080620007d484846200070c565b5080516020909101209150505b92915050565b6002546001600160a01b03163314620008145760405162461bcd60e51b81526004016200065190620019ab565b6200082a84805190602001208484843462000b55565b50505050565b6002546000906001600160a01b03163314620008605760405162461bcd60e51b81526004016200065190620019ab565b620007e18280519060200120600062000d0f565b6002546001600160a01b03163314620008a15760405162461bcd60e51b81526004016200065190620019ab565b6002546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015620008db573d6000803e3d6000fd5b50565b6002546000906001600160a01b031633146200090e5760405162461bcd60e51b81526004016200065190620019ab565b6200092183805190602001208362000dd7565b9392505050565b6002546001600160a01b03163314620009555760405162461bcd60e51b81526004016200065190620019ab565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000806200072384805190602001208462000ec7565b6002546000906001600160a01b03163314620009bd5760405162461bcd60e51b81526004016200065190620019ab565b6200092183805190602001208362000d0f565b6000620007e1828051906020012062000f1f565b60606000806000620009f68562000cb8565b91509150806000141562000a3f5760005b6040519080825280601f01601f19166020018201604052801562000a32576020820181803683370190505b5095600095509350505050565b60008267ffffffffffffffff81111562000a5d5762000a5d62001b08565b6040519080825280601f01601f19166020018201604052801562000a88576020820181803683370190505b5090506020810160005b8381101562000b46576000888152602081815260408083208484529091528120549062000abf8262000f5e565b1562000b015762000ad08260e01c90565b60008b8152600160209081526040808320878452909152902090915062000af990838662000f73565b505062000b20565b8162000b0d8162001027565b50915062000b1c818662001099565b5050505b62000b2c818562001a00565b93505050808062000b3d9062001abe565b91505062000a92565b50909660019650945050505050565b62000b618585620010f8565b60ff7f00000000000000000000000000000000000000000000000000000000000000001682111562000bc85762000baa62000b9e84848462001210565b6001600160a01b031690565b60008681526020818152604080832088845290915290205562000c38565b60008581526001602090815260408083208784528252918290208251601f860183900483028101830190935284835262000c1f9290918690869081908401838280828437600092019190915250620012cc92505050565b6000868152602081815260408083208884529091529020555b5050505050565b6000828152602081815260408083208484529091528120546060919062000c668162000f5e565b1562000ca0576000858152600160209081526040808320878452909152812062000c91908362001371565b93506001925062000728915050565b8062000cac816200140d565b93509350505062000728565b6000806000805b60008062000cce878462000ec7565b915091508062000ce057505062000d05565b62000cec828562001a00565b93508262000cfa8162001abe565b935050505062000cbf565b9094909350915050565b60005b6000838152602081815260408083208584529091529020548062000d37575062000dd1565b62000d428162000f5e565b62000da3576000819050806001600160a01b0316632b68b9c66040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000d8857600080fd5b505af115801562000d9d573d6000803e3d6000fd5b50505050505b6000848152602081815260408083208684529091528120558262000dc78162001abe565b9350505062000d12565b50919050565b6000828152602081815260408083208484529091528120548062000e00576000915050620007e1565b60008481526020819052604081208162000e1c86600162001a00565b8152602001908152602001600020541462000e3c576000915050620007e1565b62000e478162000f5e565b62000ea8576000819050806001600160a01b0316632b68b9c66040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000e8d57600080fd5b505af115801562000ea2573d6000803e3d6000fd5b50505050505b5050600091825260208281526040808420928452919052812055600190565b60008281526020818152604080832084845290915281205481908062000ef557600080925092505062000728565b62000f008162000f5e565b1562000f1357600062000c918260e01c90565b8062000cac8162001027565b6000805b6000838152602081815260408083208484529091529020548062000f485750620007e1565b8162000f548162001abe565b9250505062000f23565b60008062000f6c8360e01c90565b1192915050565b600080600062000f8385620014b4565b808652909350905083601c8411156200101957601c81016000805b6020600162000faf601c8a62001a3e565b62000fbc90602062001a00565b62000fc8919062001a3e565b62000fd4919062001a1b565b8110156200101557600081815260208b8152604090912054808552925062000ffe90849062001a00565b9250806200100c8162001abe565b91505062000f9e565b5050505b600192505050935093915050565b6000806001600160a01b0383166200104457506000928392509050565b600080604051806101600160405280610126815260200162001c306101269139519050843b91508082101562001081575060009485945092505050565b6200108d818362001a3e565b95600195509350505050565b600080600080620010aa8662001027565b9150915080620010c35760008093509350505062000728565b6000604051806101600160405280610126815260200162001c306101269139519050828187893c509095600195509350505050565b6000828152602081815260408083208484529091529020548062001194578115806200114d57506000838152602081905260408120816200113b60018662001a3e565b81526020019081526020016000205414155b620011945760405162461bcd60e51b81526020600482015260166024820152751b5d5cdd081c995c1b1858d9481bdc88185c1c195b9960521b604482015260640162000651565b6200119f8162000f5e565b6200067157806001600160a01b038116156200082a57806001600160a01b0316632b68b9c66040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620011f157600080fd5b505af115801562001206573d6000803e3d6000fd5b5050505050505050565b600080604051806101600160405280610126815260200162001c3061012691398585604051602001620012469392919062001946565b60408051601f1981840301815291905290506000620012686043602062001a00565b308382015290506200127d608c602062001a00565b9050308183015250600083826040516200129790620015ca565b620012a3919062001970565b6040518091039082f0905080158015620012c1573d6000803e3d6000fd5b509695505050505050565b805160208083015160e083901b911c1790601c8111156200136a576000603c8401815b6020600162001300601c8762001a3e565b6200130d90602062001a00565b62001319919062001a3e565b62001325919062001a1b565b8110156200136657815192506200133e82602062001a00565b60008281526020899052604090208490559150806200135d8162001abe565b915050620012ef565b5050505b5092915050565b606060006200138083620014cf565b92509050601c8111156200136a57603c82016000805b60206001620013a7601c8762001a3e565b620013b490602062001a00565b620013c0919062001a3e565b620013cc919062001a1b565b8110156200136657600081815260208881526040909120548085529250620013f690849062001a00565b925080620014048162001abe565b91505062001396565b606060008060006200141f8562001027565b91509150806200143157600062000a07565b60008267ffffffffffffffff8111156200144f576200144f62001b08565b6040519080825280601f01601f1916602001820160405280156200147a576020820181803683370190505b5090506000604051806101600160405280610126815260200162001c306101269139519050838160208401893c5095600195509350505050565b600080620014c28360e01c90565b9360209390931b92915050565b60006060620014de8360e01c90565b9150602083901b92508167ffffffffffffffff81111562001503576200150362001b08565b6040519080825280601f01601f1916602001820160405280156200152e576020820181803683370190505b5060208101939093525091565b828054620015499062001a87565b90600052602060002090601f0160209004810192826200156d5760008555620015b8565b82601f106200158857805160ff1916838001178555620015b8565b82800160010185558215620015b8579182015b82811115620015b85782518255916020019190600101906200159b565b50620015c6929150620015d8565b5090565b6101118062001b1f83390190565b5b80821115620015c65760008155600101620015d9565b60008083601f8401126200160257600080fd5b50813567ffffffffffffffff8111156200161b57600080fd5b6020830191508360208285010111156200072857600080fd5b600082601f8301126200164657600080fd5b813567ffffffffffffffff8082111562001664576200166462001b08565b604051601f8301601f19908116603f011681019082821181831017156200168f576200168f62001b08565b81604052838152866020858801011115620016a957600080fd5b836020870160208301376000602085830101528094505050505092915050565b600060208284031215620016dc57600080fd5b81356001600160a01b03811681146200092157600080fd5b6000602082840312156200170757600080fd5b813567ffffffffffffffff8111156200171f57600080fd5b6200172d8482850162001634565b949350505050565b6000806000604084860312156200174b57600080fd5b833567ffffffffffffffff808211156200176457600080fd5b620017728783880162001634565b945060208601359150808211156200178957600080fd5b506200179886828701620015ef565b9497909650939450505050565b60008060408385031215620017b957600080fd5b823567ffffffffffffffff811115620017d157600080fd5b620017df8582860162001634565b95602094909401359450505050565b600080600080606085870312156200180557600080fd5b843567ffffffffffffffff808211156200181e57600080fd5b6200182c8883890162001634565b95506020870135945060408701359150808211156200184a57600080fd5b506200185987828801620015ef565b95989497509550505050565b600081518084526200187f81602086016020860162001a58565b601f01601f19169290920160200192915050565b828482376000838201600080825280855482600182811c915080831680620018bc57607f831692505b6020808410821415620018dd57634e487b7160e01b87526022600452602487fd5b818015620018f45760018114620019065762001934565b60ff1986168952848901965062001934565b60008c815260209020885b868110156200192c5781548b82015290850190830162001911565b505084890196505b50949c9b505050505050505050505050565b600084516200195a81846020890162001a58565b8201838582376000930192835250909392505050565b60208152600062000921602083018462001865565b6040815260006200199a604083018562001865565b905082151560208301529392505050565b6020808252600f908201526e36bab9ba10333937b69037bbb732b960891b604082015260600190565b60008085851115620019e557600080fd5b83861115620019f357600080fd5b5050820193919092039150565b6000821982111562001a165762001a1662001adc565b500190565b60008262001a3957634e487b7160e01b600052601260045260246000fd5b500490565b60008282101562001a535762001a5362001adc565b500390565b60005b8381101562001a7557818101518382015260200162001a5b565b838111156200082a5750506000910152565b600181811c9082168062001a9c57607f821691505b6020821081141562000dd157634e487b7160e01b600052602260045260246000fd5b600060001982141562001ad55762001ad562001adc565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe60806040526040516101113803806101118339810160408190526100229161002b565b80518060208301f35b6000602080838503121561003e57600080fd5b82516001600160401b038082111561005557600080fd5b818501915085601f83011261006957600080fd5b81518181111561007b5761007b6100fa565b604051601f8201601f19908116603f011681019083821181831017156100a3576100a36100fa565b8160405282815288868487010111156100bb57600080fd5b600093505b828410156100dd57848401860151818501870152928501926100c0565b828411156100ee5760008684830101525b98975050505050505050565b634e487b7160e01b600052604160045260246000fdfe6080604052348015600f57600080fd5b506004361060325760003560e01c80632b68b9c61460375780638da5cb5b14603f575b600080fd5b603d6081565b005b60657f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161460ed5760405162461bcd60e51b815260206004820152600e60248201526d3737ba10333937b69037bbb732b960911b604482015260640160405180910390fd5b33fffea2646970667358221220fc66c9afb7cb2f6209ae28167cf26c6c06f86a82cbe3c56de99027979389a1be64736f6c63430008070033a2646970667358221220c3dd469a4d26a637917f856673fb5070f5c4085a99c67991f38b1a48dc3b7b8a64736f6c63430008070033'; + const provider = new ethers.providers.JsonRpcProvider(providerUrl); + const wallet = new ethers.Wallet(key, provider); + const factory = new ContractFactory(flatDirectoryAbi, contractByteCode, wallet); + const contract = await factory.deploy(0); + await contract.deployed(); + if (contract) { + console.log(`FlatDirectory Address: ${contract.address}`); + const tx = await contract.changeOwner(wallet.address); + await tx.wait(); + console.log(`Change Owner: ${contract.address}`); + } else { + console.error(`ERROR: transaction failed!`); + } + } +}; + +const refund = async (domain, key, RPC) => { + const {providerUrl, address} = await getWebHandler(domain, RPC); + if (providerUrl && parseInt(address) > 0) { + const provider = new ethers.providers.JsonRpcProvider(providerUrl); + const wallet = new ethers.Wallet(key, provider); + const fileContract = new ethers.Contract(address, fileAbi, wallet); + const tx = await fileContract.refund(); + console.log(`Transaction: ${tx.hash}`); + let txReceipt; + while (!txReceipt) { + txReceipt = await isTransactionMined(provider, tx.hash); + await sleep(5000); + } + if (txReceipt.status) { + console.log(`Refund succeeds`); + } else { + console.error(`ERROR: transaction failed!`); + } + } else { + console.log(error(`ERROR: ${domain} domain doesn't exist`)); + } +}; + +const setDefault = async (domain, filename, key, RPC) => { + const {providerUrl, address} = await getWebHandler(domain, RPC); + if (providerUrl && parseInt(address) > 0) { + const provider = new ethers.providers.JsonRpcProvider(providerUrl); + const wallet = new ethers.Wallet(key, provider); + + const fileContract = new ethers.Contract(address, fileAbi, wallet); + const defaultFile = '0x' + Buffer.from(filename, 'utf8').toString('hex'); + const tx = await fileContract.setDefault(defaultFile); + console.log(`Transaction: ${tx.hash}`); + let txReceipt; + while (!txReceipt) { + txReceipt = await isTransactionMined(provider, tx.hash); + await sleep(5000); + } + if (txReceipt.status) { + console.log(`Set succeeds`); + } else { + console.error(`ERROR: transaction failed!`); + } + } else { + console.log(error(`ERROR: ${domain} domain doesn't exist`)); + } +}; +// **** function **** + +module.exports.deploy = deploy; +module.exports.create = createDirectory; +module.exports.refund = refund; +module.exports.setDefault = setDefault; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 6861d7a..150709a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "es5", "es6" ], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ + "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ "declaration": true, /* Generates corresponding '.d.ts' file. */ diff --git a/yarn.lock b/yarn.lock index f9020ff..23aeef6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,6 +9,348 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" + integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/contracts@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" + integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" + integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" + integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" + integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + +"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/providers@5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" + integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + bech32 "1.1.4" + ws "7.4.6" + +"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" + integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + hash.js "1.1.7" + +"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" + integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/units@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" + integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/wallet@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" + integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/json-wallets" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" + integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" @@ -71,6 +413,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.13.tgz#dff34f226ec1ac0432ae3b136ec5552bd3b9c0fe" integrity sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w== +"@types/node@11.11.6": + version "11.11.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" + integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== + "@types/node@^18.11.10": version "18.11.11" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.11.tgz#1d455ac0211549a8409d3cdb371cd55cc971e8dc" @@ -86,11 +433,77 @@ acorn@^8.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + +ansi-escapes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-6.0.0.tgz#68c580e87a489f6df3d761028bb93093fde6bd8a" + integrity sha512-IG23inYII3dWlU2EyiAiGj6Bwal5GzsgPMwjYGvc1HPE2dgbj4ZB5ToWBKSquKw74nB3TIuOwaI6/jSULzfgrw== + dependencies: + type-fest "^3.0.0" + +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + +bip39@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" + integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + +bl@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-5.1.0.tgz#183715f678c7188ecef9fe475d90209400624273" + integrity sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ== + dependencies: + buffer "^6.0.3" + inherits "^2.0.4" + readable-stream "^3.4.0" + +bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + buffer-indexof@~0.0.0: version "0.0.2" resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-0.0.2.tgz#ed0f36b7ae166a66a7cd174c0467ae8dedf008f5" @@ -103,6 +516,87 @@ buffer-split@^1.0.0: dependencies: buffer-indexof "~0.0.0" +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +chalk@^5.0.0, chalk@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3" + integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +cli-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea" + integrity sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg== + dependencies: + restore-cursor "^4.0.0" + +cli-spinners@^2.6.1: + version "2.7.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" + integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== + +cli-width@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.0.0.tgz#a5622f6a3b0a9e3e711a25f099bf2399f608caf6" + integrity sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw== + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== + +colors-cli@^1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/colors-cli/-/colors-cli-1.0.28.tgz#edce4c6f86acaeb58910887be87ab801b833d220" + integrity sha512-2XE8s1mB3Jr5rvirk/fFzhWY2m9S2dpZ0mWz3Yl/mzMM8hDVBawL0Rsal5hR1gJP4lgqhQfFfEmaGZpUZgEKrA== + +commander@^9.4.1: + version "9.4.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" + integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw== + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -115,21 +609,348 @@ debug@^4.3.4: dependencies: ms "2.1.2" +defaults@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== + dependencies: + clone "^1.0.2" + diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + +elliptic@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +escape-string-regexp@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" + integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== + +eth-ens-namehash@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" + integrity sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw== + dependencies: + idna-uts46-hx "^2.3.1" + js-sha3 "^0.5.7" + +ethers@^5.7.2: + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + dependencies: + "@ethersproject/abi" "5.7.0" + "@ethersproject/abstract-provider" "5.7.0" + "@ethersproject/abstract-signer" "5.7.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/base64" "5.7.0" + "@ethersproject/basex" "5.7.0" + "@ethersproject/bignumber" "5.7.0" + "@ethersproject/bytes" "5.7.0" + "@ethersproject/constants" "5.7.0" + "@ethersproject/contracts" "5.7.0" + "@ethersproject/hash" "5.7.0" + "@ethersproject/hdnode" "5.7.0" + "@ethersproject/json-wallets" "5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/logger" "5.7.0" + "@ethersproject/networks" "5.7.1" + "@ethersproject/pbkdf2" "5.7.0" + "@ethersproject/properties" "5.7.0" + "@ethersproject/providers" "5.7.2" + "@ethersproject/random" "5.7.0" + "@ethersproject/rlp" "5.7.0" + "@ethersproject/sha2" "5.7.0" + "@ethersproject/signing-key" "5.7.0" + "@ethersproject/solidity" "5.7.0" + "@ethersproject/strings" "5.7.0" + "@ethersproject/transactions" "5.7.0" + "@ethersproject/units" "5.7.0" + "@ethersproject/wallet" "5.7.0" + "@ethersproject/web" "5.7.1" + "@ethersproject/wordlists" "5.7.0" + +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +figures@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-5.0.0.tgz#126cd055052dea699f8a54e8c9450e6ecfc44d5f" + integrity sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg== + dependencies: + escape-string-regexp "^5.0.0" + is-unicode-supported "^1.2.0" + +git-config-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/git-config-path/-/git-config-path-2.0.0.tgz#62633d61af63af4405a5024efd325762f58a181b" + integrity sha512-qc8h1KIQbJpp+241id3GuAtkdyJ+IK+LIVtkiFTRKRrmddDzs3SI9CvP1QYmWBFvm1I/PWRwj//of8bgAc0ltA== + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +idna-uts46-hx@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" + integrity sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA== + dependencies: + punycode "2.1.0" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@^1.3.5: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + +inquirer@^9.1.4: + version "9.1.4" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-9.1.4.tgz#482da8803670a64bd942bc5166a9547a19d41474" + integrity sha512-9hiJxE5gkK/cM2d1mTEnuurGTAoHebbkX0BYl3h7iEg7FYfuNIom+nDfBCSWtvSnoSrWCeBxqqBZu26xdlJlXA== + dependencies: + ansi-escapes "^6.0.0" + chalk "^5.1.2" + cli-cursor "^4.0.0" + cli-width "^4.0.0" + external-editor "^3.0.3" + figures "^5.0.0" + lodash "^4.17.21" + mute-stream "0.0.8" + ora "^6.1.2" + run-async "^2.4.0" + rxjs "^7.5.7" + string-width "^5.1.2" + strip-ansi "^7.0.1" + through "^2.3.6" + wrap-ansi "^8.0.1" + +is-interactive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-2.0.0.tgz#40c57614593826da1100ade6059778d597f16e90" + integrity sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ== + +is-unicode-supported@^1.1.0, is-unicode-supported@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz#d824984b616c292a2e198207d4a609983842f714" + integrity sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ== + +js-sha3@0.8.0, js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-sha3@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" + integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-5.1.0.tgz#a20e3b9a5f53fac6aeb8e2bb22c07cf2c8f16d93" + integrity sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA== + dependencies: + chalk "^5.0.0" + is-unicode-supported "^1.1.0" + make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +ora@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/ora/-/ora-6.1.2.tgz#7b3c1356b42fd90fb1dad043d5dbe649388a0bf5" + integrity sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw== + dependencies: + bl "^5.0.0" + chalk "^5.0.0" + cli-cursor "^4.0.0" + cli-spinners "^2.6.1" + is-interactive "^2.0.0" + is-unicode-supported "^1.1.0" + log-symbols "^5.1.0" + strip-ansi "^7.0.1" + wcwidth "^1.0.1" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +parse-git-config@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-3.0.0.tgz#4a2de08c7b74a2555efa5ae94d40cd44302a6132" + integrity sha512-wXoQGL1D+2COYWCD35/xbiKma1Z15xvZL8cI25wvxzled58V51SJM04Urt/uznS900iQor7QO04SgdfT/XlbuA== + dependencies: + git-config-path "^2.0.0" + ini "^1.3.5" + +pbkdf2@^3.0.9: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +punycode@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + integrity sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA== + +randombytes@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +restore-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-4.0.0.tgz#519560a4318975096def6e609d44100edaa4ccb9" + integrity sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +run-async@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + rxjs-async-map@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/rxjs-async-map/-/rxjs-async-map-0.2.0.tgz#5af3d069e85983602afb8f2091bc67bcc4306ac6" @@ -142,18 +963,88 @@ rxjs-stream@^3.2.1: resolved "https://registry.yarnpkg.com/rxjs-stream/-/rxjs-stream-3.3.0.tgz#5fbc21fbd809ba6d27807d293518e1742154d51a" integrity sha512-Btxm8WUsvvAaQHS/iCcoYqQtezEzz5M4hTb0d1H6Oc+h0Xx/evpy0hWeo+YPQd2GhpmJkDaIoXbAyVh4hA4cRA== -rxjs@^6.3.3, rxjs@^6.6.3: +rxjs@^6.3.3: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" +rxjs@^7.5.7, rxjs@^7.6.0: + version "7.6.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.6.0.tgz#361da5362b6ddaa691a2de0b4f2d32028f1eb5a2" + integrity sha512-DDa7d8TFNUalGC9VqXvQ1euWNN7sc63TrUCuM9J998+ViviahMIjKSOU7rfcgFOF+FCD71BhDRv4hrFz+ImDLQ== + dependencies: + tslib "^2.1.0" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scrypt-js@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +strip-ansi@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" + integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw== + dependencies: + ansi-regex "^6.0.1" + superpathjoin@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/superpathjoin/-/superpathjoin-2.0.1.tgz#57fdbad89a88a12f27635230d7fb0e66313bc233" integrity sha512-SvRdCHwKZEzjlM//VMBZYWmeu23NRtw5O29aBWDxEt4nD5GaWuRf9kmJuxmL8LfYMv+W+b/XhtU+7zFiaF6WAQ== +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + ts-node@^10.9.1: version "10.9.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" @@ -178,16 +1069,52 @@ tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@^2.1.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" + integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== + +type-fest@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-3.3.0.tgz#3378c9664eecfd1eb4f0522b13cb0630bc1ec044" + integrity sha512-gezeeOIZyQLGW5uuCeEnXF1aXmtt2afKspXz3YqoOcZ3l/YMJq1pujvgT+cz/Nw1O/7q/kSav5fihJHsC/AOUg== + typescript@^4.9.3: version "4.9.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== + dependencies: + defaults "^1.0.3" + +wrap-ansi@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.0.1.tgz#2101e861777fec527d0ea90c57c6b03aac56a5b3" + integrity sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + +ws@7.4.6: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"