├── .editorconfig ├── .eslintignore ├── .eslintrc.cjs ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── codeql.yml │ ├── dependency-review.yml │ ├── pr-lint.yml │ ├── publish.yml │ └── test.yml ├── .gitignore ├── .husky └── commit-msg ├── .markdownlint.json ├── .mocharc.json ├── .prettierrc.json ├── .shellcheckrc ├── .vim └── coc-settings.json ├── .vscode └── launch.json ├── .yarn ├── plugins │ └── @yarnpkg │ │ ├── plugin-interactive-tools.cjs │ │ ├── plugin-typescript.cjs │ │ ├── plugin-version.cjs │ │ └── plugin-workspace-tools.cjs ├── releases │ └── yarn-3.6.4.cjs └── sdks │ ├── eslint │ ├── bin │ │ └── eslint.js │ ├── lib │ │ └── api.js │ └── package.json │ ├── integrations.yml │ └── typescript │ ├── bin │ ├── tsc │ └── tsserver │ ├── lib │ ├── tsc.js │ ├── tsserver.js │ ├── tsserverlibrary.js │ └── typescript.js │ └── package.json ├── .yarnrc.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── NOTICE ├── README.md ├── bin ├── dev ├── dev.cmd ├── run └── run.cmd ├── commitlint.config.js ├── docker-compose.yaml ├── docs ├── accounts.md ├── assets │ └── cover.png ├── autocomplete.md ├── config.md ├── contracts.md ├── help.md ├── new.md └── rewards.md ├── package.json ├── scripts ├── _shared.sh ├── docker-entrypoint.sh ├── faucet.sh ├── local-1.json ├── start-local-node.sh └── update-chain-registry.sh ├── src ├── commands │ ├── accounts │ │ ├── balances │ │ │ ├── get.ts │ │ │ └── send.ts │ │ ├── export.ts │ │ ├── get.ts │ │ ├── list.ts │ │ ├── new.ts │ │ └── remove.ts │ ├── config │ │ ├── chains │ │ │ ├── import.ts │ │ │ ├── list.ts │ │ │ └── use.ts │ │ ├── deployments.ts │ │ ├── get.ts │ │ ├── init.ts │ │ ├── set.ts │ │ └── show.ts │ ├── contracts │ │ ├── build.ts │ │ ├── execute.ts │ │ ├── instantiate.ts │ │ ├── metadata.ts │ │ ├── migrate.ts │ │ ├── new.ts │ │ ├── premium.ts │ │ ├── query │ │ │ ├── balance.ts │ │ │ └── smart.ts │ │ └── store.ts │ ├── help.ts │ ├── new.ts │ └── rewards │ │ ├── query.ts │ │ └── withdraw.ts ├── domain │ ├── Accounts.ts │ ├── Cargo.ts │ ├── ChainRegistry.ts │ ├── Config.ts │ ├── Contracts.ts │ ├── Deployments.ts │ ├── DeploymentsByChain.ts │ ├── DockerOptimizer.ts │ ├── Ledger.ts │ ├── NewProject.ts │ ├── SchemaValidation.ts │ ├── index.ts │ └── keystore │ │ ├── backend.ts │ │ ├── file.ts │ │ ├── index.ts │ │ ├── os.ts │ │ └── test.ts ├── exceptions │ ├── AlreadyExistsError.ts │ ├── BaseError.ts │ ├── ConsoleError.ts │ ├── ErrorCodes.ts │ ├── ExecuteError.ts │ ├── InstantiateError.ts │ ├── InvalidAccountError.ts │ ├── InvalidFormatError.ts │ ├── InvalidPasswordError.ts │ ├── InvalidValueError.ts │ ├── MigrateError.ts │ ├── NotFoundError.ts │ ├── OnlyOneArgSourceError.ts │ ├── QueryError.ts │ └── index.ts ├── hooks │ └── postrun │ │ └── versionCheck.ts ├── index.ts ├── lib │ ├── base.ts │ └── json.js ├── parameters │ ├── arguments │ │ ├── account.ts │ │ ├── amount.ts │ │ ├── chain.ts │ │ ├── contract.ts │ │ ├── index.ts │ │ └── stdinInput.ts │ └── flags │ │ ├── account.ts │ │ ├── amount.ts │ │ ├── chain.ts │ │ ├── config.ts │ │ ├── contracts.ts │ │ ├── index.ts │ │ ├── keyring.ts │ │ ├── msgArgs.ts │ │ ├── noConfirm.ts │ │ ├── template.ts │ │ └── transaction.ts ├── plugins │ └── help │ │ ├── command.ts │ │ ├── help.ts │ │ └── root.ts ├── repositories │ ├── chain-registry │ │ ├── archway-1.json │ │ └── constantine-3.json │ └── chain.schema.json ├── services │ ├── ArchwayClientBuilder.ts │ ├── BuiltInChains.ts │ ├── ContractTemplates.ts │ ├── Prompts.ts │ └── index.ts ├── types │ ├── Account.ts │ ├── Cargo.ts │ ├── Coin.ts │ ├── ConfigData.ts │ ├── Contract.ts │ ├── ContractTemplate.ts │ ├── Deployment.ts │ ├── chain.ts │ ├── declarations.ts │ ├── index.ts │ └── json.ts ├── ui │ ├── Prompt.ts │ ├── Spinner.ts │ └── index.ts └── utils │ ├── accounts.ts │ ├── coin.ts │ ├── filesystem.ts │ ├── formatters.ts │ ├── index.ts │ ├── paths.ts │ ├── style.ts │ └── transactions.ts ├── test ├── commands │ ├── accounts │ │ ├── balances.test.ts │ │ ├── export.test.ts │ │ ├── get.test.ts │ │ ├── list.test.ts │ │ ├── new.test.ts │ │ └── remove.test.ts │ ├── config │ │ ├── chains.test.ts │ │ ├── deployments.test.ts │ │ ├── init.test.ts │ │ └── show.test.ts │ ├── contracts │ │ ├── build.test.ts │ │ ├── execute.test.ts │ │ ├── instantiate.test.ts │ │ ├── metadata.test.ts │ │ ├── migrate.test.ts │ │ ├── new.test.ts │ │ ├── premium.test.ts │ │ ├── query │ │ │ ├── balance.test.ts │ │ │ └── smart.test.ts │ │ └── store.test.ts │ ├── new.test.ts │ └── rewards │ │ ├── query.test.ts │ │ └── withdraw.test.ts ├── dummies │ ├── accounts.ts │ ├── chainRegistry.ts │ ├── configFile.ts │ ├── contracts.ts │ ├── deployments.ts │ ├── index.ts │ └── transactions.ts ├── fixtures │ ├── migrate │ │ └── artifacts │ │ │ ├── checksums.txt │ │ │ ├── checksums_intermediate.txt │ │ │ └── foo.wasm │ └── optimized │ │ └── artifacts │ │ ├── checksums.txt │ │ ├── checksums_intermediate.txt │ │ └── foo.wasm ├── helpers │ ├── expect.ts │ ├── index.ts │ └── init.js ├── integration │ ├── accounts.sh │ ├── all.sh │ ├── config.sh │ ├── contractsAndRewards.sh │ └── utils.sh ├── stubs │ ├── accounts.ts │ ├── archwayClient.ts │ ├── cargo.ts │ ├── chainRegistry.ts │ ├── config.ts │ ├── contracts.ts │ ├── deployments.ts │ ├── filesystem.ts │ ├── index.ts │ ├── optimizer.ts │ ├── signingArchwayClient.ts │ └── stargateClient.ts └── tsconfig.json ├── tsconfig.eslint.json ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | build/ 4 | coverage/ 5 | custom_types/ 6 | dist/ 7 | docs/ 8 | examples/ 9 | generated/ 10 | proto/ 11 | scripts/ 12 | tmp/ 13 | 14 | *.d.ts 15 | 16 | .eslintrc* 17 | jest.config*.[jt]s 18 | commitlint.config.js 19 | typedoc.cjs 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /.yarn/** linguist-vendored 2 | /.yarn/releases/* binary 3 | /.yarn/plugins/**/* binary 4 | /.pnp.* binary linguist-generated 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: 'npm' 4 | directory: '/' 5 | schedule: 6 | interval: 'weekly' 7 | day: 'saturday' 8 | versioning-strategy: 'increase' 9 | labels: 10 | - 'dependencies' 11 | open-pull-requests-limit: 5 12 | pull-request-branch-name: 13 | separator: '-' 14 | commit-message: 15 | # cause a release for non-dev-deps 16 | prefix: fix(deps) 17 | # no release for dev-deps 18 | prefix-development: chore(dev-deps) 19 | ignore: 20 | - dependency-name: '@salesforce/dev-scripts' 21 | - dependency-name: '*' 22 | update-types: ['version-update:semver-major'] 23 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: CodeQL 13 | 14 | on: 15 | # Trigger the workflow on push for all branches or pull request to main 16 | push: 17 | branches: ["**"] 18 | pull_request: 19 | # The branches below must be a subset of the branches above 20 | branches: [main, release/**] 21 | schedule: 22 | # “At 12:00 on Wednesdays” 23 | - cron: "0 12 * * 3" 24 | 25 | concurrency: 26 | group: ${{github.workflow}}-${{github.ref}} 27 | cancel-in-progress: true 28 | 29 | jobs: 30 | analyze: 31 | name: Analyze 32 | runs-on: ubuntu-latest 33 | permissions: 34 | actions: read 35 | contents: read 36 | security-events: write 37 | 38 | strategy: 39 | fail-fast: false 40 | matrix: 41 | language: ["javascript"] 42 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 43 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support 44 | 45 | steps: 46 | - name: Checkout repository 47 | uses: actions/checkout@v3 48 | 49 | # Initializes the CodeQL tools for scanning. 50 | - name: Initialize CodeQL 51 | uses: github/codeql-action/init@v2 52 | with: 53 | languages: ${{ matrix.language }} 54 | # If you wish to specify custom queries, you can do so here or in a config file. 55 | # By default, queries listed here will override any specified in a config file. 56 | # Prefix the list here with "+" to use these queries and those in the config file. 57 | 58 | # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 59 | queries: security-extended 60 | 61 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 62 | # If this step fails, then you should remove it and run the build manually (see below) 63 | - name: Autobuild 64 | uses: github/codeql-action/autobuild@v2 65 | 66 | # ℹ️ Command-line programs to run using the OS shell. 67 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun 68 | 69 | # If the Autobuild fails above, remove it and uncomment the following three lines. 70 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. 71 | 72 | # Install dependencies and build 73 | - uses: actions/setup-node@v3 74 | with: 75 | node-version: 18 76 | cache: yarn 77 | - run: yarn install --immutable 78 | - run: yarn build 79 | 80 | - name: Perform CodeQL Analysis 81 | uses: github/codeql-action/analyze@v2 82 | -------------------------------------------------------------------------------- /.github/workflows/dependency-review.yml: -------------------------------------------------------------------------------- 1 | # Dependency Review Action 2 | # 3 | # This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. 4 | # 5 | # Source repository: https://github.com/actions/dependency-review-action 6 | # Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement 7 | name: Dependency Review 8 | on: [pull_request] 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | dependency-review: 15 | name: Dependency Review 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout Repository 19 | uses: actions/checkout@v3 20 | - name: Dependency Review 21 | uses: actions/dependency-review-action@v3 22 | -------------------------------------------------------------------------------- /.github/workflows/pr-lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint Pull Request 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - reopened 8 | - edited 9 | - synchronize 10 | 11 | permissions: 12 | contents: read 13 | pull-requests: read 14 | 15 | jobs: 16 | main: 17 | name: Validate title 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: amannn/action-semantic-pull-request@v5 21 | id: lint_pr_title 22 | with: 23 | # should be kept in sync with commitlint.config.js 24 | scopes: | 25 | deps 26 | core 27 | new 28 | accounts 29 | config 30 | contracts 31 | rewards 32 | plugins 33 | ui 34 | env: 35 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 36 | 37 | - uses: marocchino/sticky-pull-request-comment@v2 38 | # When the previous steps fails, the workflow would stop. By adding this 39 | # condition you can continue the execution with the populated error message. 40 | if: always() && (steps.lint_pr_title.outputs.error_message != null) 41 | with: 42 | header: pr-title-lint-error 43 | message: | 44 | Hey there and thank you for opening this pull request! 👋🏼 45 | 46 | We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. 47 | 48 | Details: 49 | 50 | ``` 51 | ${{ steps.lint_pr_title.outputs.error_message }} 52 | ``` 53 | 54 | # Delete a previous comment when the issue has been resolved 55 | - if: ${{ steps.lint_pr_title.outputs.error_message == null }} 56 | uses: marocchino/sticky-pull-request-comment@v2 57 | with: 58 | header: pr-title-lint-error 59 | delete: true 60 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish package to npmjs 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | - uses: actions/setup-node@v3 13 | with: 14 | node-version: 18 15 | registry-url: "https://registry.npmjs.org" 16 | - run: yarn install --immutable 17 | - run: yarn config set -H npmAuthToken "${{ secrets.NPM_TOKEN }}" 18 | env: 19 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 20 | - run: yarn npm publish --tag ${{ github.event.release.prerelease == true && 'pre' || 'latest' }} --access public 21 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | branches: ["**"] 6 | pull_request: 7 | # The branches below must be a subset of the branches above 8 | branches: [main, release/**] 9 | 10 | concurrency: 11 | group: ${{github.workflow}}-${{github.ref}} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | unit-test-and-lint: 16 | name: Unit Test and Lint 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v3 20 | - uses: actions/setup-node@v3 21 | with: 22 | node-version: 18 23 | cache: yarn 24 | - run: yarn install --immutable 25 | - run: yarn build 26 | - run: yarn test 27 | env: 28 | ARCHWAY_SKIP_VERSION_CHECK: 1 29 | 30 | integration-test: 31 | name: Integration Test 32 | runs-on: ubuntu-latest 33 | steps: 34 | - name: Checkout code 35 | uses: actions/checkout@v3 36 | - name: Set up Node.js 37 | uses: actions/setup-node@v3 38 | with: 39 | node-version: 18 40 | cache: yarn 41 | - name: Set up cargo cache 42 | uses: actions/cache@v3 43 | continue-on-error: false 44 | with: 45 | path: | 46 | ~/.cargo/bin/ 47 | ~/.cargo/registry/index/ 48 | ~/.cargo/registry/cache/ 49 | ~/.cargo/git/db/ 50 | key: ${{ runner.os }}-cargo 51 | restore-keys: ${{ runner.os }}-cargo 52 | - name: Install jq 53 | run: sudo apt update && sudo apt install -y jq 54 | - name: Install cargo-generate 55 | run: which cargo-generate || cargo install cargo-generate 56 | - run: yarn install --immutable 57 | - run: yarn build 58 | - name: Bootstrap local node 59 | run: scripts/start-local-node.sh 60 | - run: yarn test:integration 61 | env: 62 | ARCHWAY_SKIP_VERSION_CHECK: 1 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Output 2 | build/ 3 | dist/ 4 | 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | tmp/ 22 | 23 | # Directory for instrumented libs generated by jscoverage/JSCover 24 | lib-cov 25 | 26 | # Code coverage 27 | coverage 28 | *.lcov 29 | .nyc_output/ 30 | 31 | # Dependency directories and NPM package files 32 | node_modules/ 33 | package-lock.json 34 | 35 | # Runtime data 36 | pids/ 37 | *.pid 38 | *.seed 39 | 40 | # TypeScript cache 41 | *.tsbuildinfo 42 | 43 | # Optional npm cache directory 44 | .npm 45 | 46 | # Optional eslint cache 47 | .eslintcache 48 | 49 | # SARIF log files (https://github.com/Microsoft/sarif-js-sdk) 50 | *.sarif 51 | 52 | # Optional REPL history 53 | .node_repl_history 54 | 55 | # Output of 'npm pack' 56 | *.tgz 57 | 58 | # Yarn Integrity file 59 | .yarn-integrity 60 | 61 | # Yarn 2 62 | # https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored 63 | .pnp.* 64 | .yarn/* 65 | !.yarn/patches 66 | !.yarn/plugins 67 | !.yarn/releases 68 | !.yarn/sdks 69 | !.yarn/versions 70 | 71 | # oclif manifest 72 | oclif.manifest.json 73 | 74 | # IDE-specific 75 | .history/ 76 | .vscode/ 77 | .idea/ 78 | 79 | # others 80 | .DS_Store 81 | 82 | # env files 83 | *.env 84 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | yarn commitlint --edit "${1}" 5 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "MD024": false 4 | } 5 | -------------------------------------------------------------------------------- /.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/mocharc", 3 | "require": [ 4 | "test/helpers/init.js", 5 | "ts-node/register", 6 | "tsconfig-paths/register" 7 | ], 8 | "watch-files": [ 9 | "./src/**/*.ts", 10 | "./tests/**/*.test.ts" 11 | ], 12 | "forbid-only": true, 13 | "recursive": true, 14 | "reporter": "spec", 15 | "timeout": 60000 16 | } 17 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "editorconfig": true, 4 | "endOfLine": "auto", 5 | "printWidth": 140, 6 | "semi": true, 7 | "singleQuote": true, 8 | "tabWidth": 2, 9 | "trailingComma": "es5", 10 | "useTabs": false, 11 | "vueIndentScriptAndStyle": true 12 | } 13 | -------------------------------------------------------------------------------- /.shellcheckrc: -------------------------------------------------------------------------------- 1 | external-sources=true 2 | -------------------------------------------------------------------------------- /.vim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.packageManager": "yarn", 3 | "eslint.nodePath": ".yarn/sdks", 4 | "workspace.workspaceFolderCheckCwd": false, 5 | "tsserver.tsdk": ".yarn/sdks/typescript/lib" 6 | } 7 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "node", 6 | "request": "launch", 7 | "name": "Launch Dev Runtime", 8 | "skipFiles": [ 9 | "/**" 10 | ], 11 | "program": "${workspaceFolder}/bin/dev", 12 | "args": [ 13 | "accounts", 14 | "list", 15 | ], 16 | "cwd": "${workspaceFolder}", 17 | "console": "integratedTerminal", 18 | "internalConsoleOptions": "openOnSessionStart", 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /.yarn/sdks/eslint/bin/eslint.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.cjs"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = createRequire(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require eslint/bin/eslint.js 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real eslint/bin/eslint.js your application uses 20 | module.exports = absRequire(`eslint/bin/eslint.js`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/eslint/lib/api.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.cjs"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = createRequire(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require eslint 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real eslint your application uses 20 | module.exports = absRequire(`eslint`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/eslint/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint", 3 | "version": "7.32.0-sdk", 4 | "main": "./lib/api.js", 5 | "type": "commonjs" 6 | } 7 | -------------------------------------------------------------------------------- /.yarn/sdks/integrations.yml: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by @yarnpkg/sdks. 2 | # Manual changes might be lost! 3 | 4 | integrations: 5 | - vscode 6 | - vim 7 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/bin/tsc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.cjs"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = createRequire(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/bin/tsc 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/bin/tsc your application uses 20 | module.exports = absRequire(`typescript/bin/tsc`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/bin/tsserver: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.cjs"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = createRequire(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/bin/tsserver 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/bin/tsserver your application uses 20 | module.exports = absRequire(`typescript/bin/tsserver`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/tsc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.cjs"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = createRequire(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/lib/tsc.js 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/lib/tsc.js your application uses 20 | module.exports = absRequire(`typescript/lib/tsc.js`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/typescript.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.cjs"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = createRequire(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/lib/typescript.js 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/lib/typescript.js your application uses 20 | module.exports = absRequire(`typescript/lib/typescript.js`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript", 3 | "version": "5.2.2-sdk", 4 | "main": "./lib/typescript.js", 5 | "type": "commonjs" 6 | } 7 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | enableTelemetry: false 2 | 3 | nodeLinker: node-modules 4 | 5 | plugins: 6 | - path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs 7 | spec: "@yarnpkg/plugin-typescript" 8 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 9 | spec: "@yarnpkg/plugin-interactive-tools" 10 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs 11 | spec: "@yarnpkg/plugin-workspace-tools" 12 | - path: .yarn/plugins/@yarnpkg/plugin-version.cjs 13 | spec: "@yarnpkg/plugin-version" 14 | 15 | preferInteractive: true 16 | 17 | yarnPath: .yarn/releases/yarn-3.6.4.cjs 18 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Archway Network 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /bin/dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const oclif = require('@oclif/core'); 4 | 5 | const path = require('path'); 6 | const project = path.join(__dirname, '..', 'tsconfig.json'); 7 | 8 | const tsConfig = require('../tsconfig.json'); 9 | const tsConfigPaths = require('tsconfig-paths'); 10 | 11 | tsConfigPaths.register({ 12 | baseUrl: './', 13 | paths: tsConfig.compilerOptions.paths, 14 | }); 15 | 16 | // In dev mode -> use ts-node and dev plugins 17 | process.env.NODE_ENV = 'development'; 18 | 19 | require('ts-node').register({ project }); 20 | 21 | // In dev mode, always show stack traces 22 | oclif.settings.debug = true; 23 | 24 | process.on('SIGINT', () => { 25 | process.exit(1); 26 | }); 27 | 28 | // Start the CLI 29 | oclif.run().then(oclif.flush).catch(oclif.Errors.handle); 30 | -------------------------------------------------------------------------------- /bin/dev.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | node "%~dp0\dev" %* -------------------------------------------------------------------------------- /bin/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const oclif = require('@oclif/core'); 4 | 5 | process.on('SIGINT', () => { 6 | process.exit(1); 7 | }); 8 | 9 | oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle')); 10 | -------------------------------------------------------------------------------- /bin/run.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | node "%~dp0\run" %* 4 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | rules: { 4 | 'scope-enum': [2, 'always', [ 5 | // This list should be kept in sync with the 6 | // PR Lint workflow at .github/workflows/pr-lint.yml 7 | 'deps', 8 | 'core', 9 | 'new', 10 | 'accounts', 11 | 'config', 12 | 'contracts', 13 | 'rewards', 14 | 'plugins', 15 | 'ui' 16 | ]], 17 | 'scope-case': [2, 'always', 'kebab-case'], 18 | }, 19 | }; 20 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | node: 3 | image: archwaynetwork/archwayd:v6.0.2 4 | command: start --x-crisis-skip-assert-invariants 5 | entrypoint: /docker-entrypoint.sh 6 | ports: 7 | - 1317:1317 # API 8 | - 9090:9090 # gRPC 9 | - 9091:9091 # gRPC-web 10 | - 26656:26656 # p2p 11 | - 26657:26657 # RPC 12 | volumes: 13 | - ./scripts/docker-entrypoint.sh:/docker-entrypoint.sh:ro 14 | - ./scripts/contracts:/contracts:ro 15 | - data:/root/.archway 16 | healthcheck: 17 | test: 18 | curl --retry 5 --retry-delay 1 --retry-all-errors -sf 'http://localhost:26657/status' | 19 | jq -e '.result.sync_info | (.latest_block_height > 0 and .catching_up == false)' 20 | interval: 5s 21 | timeout: 30s 22 | retries: 10 23 | start_period: 30s 24 | 25 | volumes: 26 | data: 27 | -------------------------------------------------------------------------------- /docs/assets/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/archway-network/cli/54be58b64945b487480968a63cc3d1db6f3d795a/docs/assets/cover.png -------------------------------------------------------------------------------- /docs/autocomplete.md: -------------------------------------------------------------------------------- 1 | `archway autocomplete` 2 | ====================== 3 | 4 | display autocomplete installation instructions 5 | 6 | * [`archway autocomplete [SHELL]`](#archway-autocomplete-shell) 7 | 8 | ## `archway autocomplete [SHELL]` 9 | 10 | display autocomplete installation instructions 11 | 12 | ``` 13 | Usage: 14 | $ archway autocomplete [SHELL] [-r] 15 | 16 | Arguments: 17 | SHELL (zsh|bash|powershell) Shell type 18 | 19 | Flags: 20 | -r, --refresh-cache Refresh cache (ignores displaying instructions) 21 | 22 | Description: 23 | display autocomplete installation instructions 24 | 25 | Examples: 26 | $ archway autocomplete 27 | 28 | $ archway autocomplete bash 29 | 30 | $ archway autocomplete zsh 31 | 32 | $ archway autocomplete powershell 33 | 34 | $ archway autocomplete --refresh-cache 35 | ``` 36 | 37 | _See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v2.3.10/src/commands/autocomplete/index.ts)_ 38 | -------------------------------------------------------------------------------- /docs/help.md: -------------------------------------------------------------------------------- 1 | `archway help` 2 | ============== 3 | 4 | Display help for archway. 5 | 6 | * [`archway help [COMMANDS]`](#archway-help-commands) 7 | 8 | ## `archway help [COMMANDS]` 9 | 10 | Display help for archway. 11 | 12 | ``` 13 | Usage: 14 | $ archway help [COMMANDS] [--json] [--log-level debug|error|info|warn] 15 | 16 | Arguments: 17 | COMMANDS Command to show help for. 18 | 19 | GLOBAL Flags: 20 | --json Format output as json. 21 | --log-level=