Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f00feb043a | ||
|
|
8848896976 | ||
|
|
62c26c71b3 | ||
|
|
f41d91615c | ||
|
|
89862b5299 | ||
|
|
c3cbb71c21 | ||
|
|
4406c91877 | ||
|
|
5ed2d699f2 | ||
|
|
9fbcda8181 | ||
|
|
7ed042a252 | ||
|
|
f3f662cc2f | ||
|
|
67f2a7f478 | ||
|
|
bd8e33dacd | ||
|
|
dc00592939 |
@@ -1 +0,0 @@
|
||||
node_modules
|
||||
+6
-11
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"root": true,
|
||||
"ignorePatterns": ["**/*"],
|
||||
"plugins": ["@nx", "eslint-plugin-unicorn", "jsx-a11y", "jest"],
|
||||
"plugins": ["@nrwl/nx", "eslint-plugin-unicorn", "jsx-a11y", "jest"],
|
||||
"settings": {
|
||||
"jsx-a11y": {
|
||||
"components": {
|
||||
@@ -18,7 +18,7 @@
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"extends": ["plugin:jsx-a11y/strict"],
|
||||
"rules": {
|
||||
"@nx/enforce-module-boundaries": [
|
||||
"@nrwl/nx/enforce-module-boundaries": [
|
||||
"error",
|
||||
{
|
||||
"enforceBuildableLibDependency": true,
|
||||
@@ -56,7 +56,7 @@
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"extends": ["plugin:@nx/typescript"],
|
||||
"extends": ["plugin:@nrwl/nx/typescript"],
|
||||
"rules": {
|
||||
"@typescript-eslint/ban-ts-comment": [
|
||||
"error",
|
||||
@@ -80,19 +80,14 @@
|
||||
},
|
||||
{
|
||||
"files": ["*.spec.ts", "*.spec.tsx"],
|
||||
"extends": ["plugin:@nx/typescript", "plugin:jest/recommended"],
|
||||
"extends": ["plugin:@nrwl/nx/typescript", "plugin:jest/recommended"],
|
||||
"rules": {
|
||||
"jest/consistent-test-it": [
|
||||
"error",
|
||||
{
|
||||
"fn": "it"
|
||||
}
|
||||
]
|
||||
"jest/consistent-test-it": ["error", { "fn": "it" }]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"extends": ["plugin:@nx/javascript"],
|
||||
"extends": ["plugin:@nrwl/nx/javascript"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
name: Feature Epic
|
||||
about: A template to capture and scope user requirements, high level process, and basic mockups for an upcoming feature as part of the initial core spec review process.
|
||||
title: 'FEATURE EPIC: '
|
||||
labels: feature-epic
|
||||
---
|
||||
|
||||
## Core Feature
|
||||
|
||||
<Name>
|
||||
|
||||
## Tasks
|
||||
|
||||
- [ ] Define high level requirements
|
||||
- [ ] Create basic mockups
|
||||
- [ ] Update "API Requirements" in core spec
|
||||
- [ ] Update "User-Interface Spec" in relevant front end repo
|
||||
- [ ] Create detailed user stories using normal template
|
||||
|
||||
## High Level Requirements
|
||||
|
||||
## Basic Mockups
|
||||
|
||||
## Link to API Requirements in Core spec
|
||||
|
||||
## Link to User Interface Specs
|
||||
|
||||
## Linked User Stories
|
||||
@@ -1,6 +1,6 @@
|
||||
# Related issues 🔗
|
||||
|
||||
Issue: #[Issue number here]
|
||||
Closes #[Issue number here]
|
||||
|
||||
# Description ℹ️
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ on:
|
||||
jobs:
|
||||
after-release:
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 45
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -30,20 +30,18 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Wait for publish to complete
|
||||
uses: lewagon/wait-on-check-action@v1.3.1
|
||||
with:
|
||||
ref: ${{ github.event.release.tag_name }}
|
||||
check-name: '(CD) publish dist / trading'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
wait-interval: 10
|
||||
|
||||
- name: resolve ipfs hashes for release
|
||||
run: |
|
||||
echo "Name: ${{ github.event.release.name }}"
|
||||
echo "Description: ${{ github.event.release.body }}"
|
||||
echo "Tag: ${{ github.event.release.tag_name }}"
|
||||
docker run --rm vegaprotocol/trading:mainnet cat /ipfs-hash > ipfs-hash
|
||||
commit="$(git rev-list -n 1 ${{ github.event.release.tag_name }})"
|
||||
echo "Commit: $commit"
|
||||
until docker pull vegaprotocol/trading:$commit; do
|
||||
echo "Image not pushed yet, waiting 60 seconds"
|
||||
sleep 60
|
||||
done
|
||||
docker run --rm vegaprotocol/trading:$commit cat /ipfs-hash > ipfs-hash
|
||||
curl -L https://dist.ipfs.tech/kubo/v0.20.0/kubo_v0.20.0_linux-amd64.tar.gz -o kubo.tgz
|
||||
tar -xzf kubo.tgz
|
||||
export PATH="$PATH:$PWD/kubo"
|
||||
|
||||
@@ -6,7 +6,7 @@ name: 'Add Issues To Project Board'
|
||||
types:
|
||||
- opened
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PROJECT_MANAGE_ACTION }}
|
||||
GH_TOKEN: ${{ secrets.GH_NEW_CARD_TO_PROJECT }}
|
||||
PROJECT_ID: ${{ secrets.FRONT_END_PROJECT_ID }}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
USER: ${{ github.actor }}
|
||||
|
||||
@@ -5,7 +5,10 @@ on:
|
||||
branches:
|
||||
- release/*
|
||||
- develop
|
||||
pull_request:
|
||||
- main
|
||||
# uncomment pull_request and comment pull_request_target to test CI changes against feature branch not target branch (develop)
|
||||
# pull_request:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- ready_for_review
|
||||
@@ -46,7 +49,7 @@ jobs:
|
||||
|
||||
lint-pr-title:
|
||||
needs: node-modules
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
|
||||
name: Verify PR title
|
||||
uses: ./.github/workflows/lint-pr.yml
|
||||
secrets: inherit
|
||||
@@ -81,22 +84,6 @@ jobs:
|
||||
with:
|
||||
main-branch-name: develop
|
||||
|
||||
# See affected apps
|
||||
- name: See affected apps
|
||||
run: |
|
||||
branch_slug="$(echo '${{ github.head_ref || github.ref_name }}' | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | cut -c 1-50 )"
|
||||
python3 tools/ci/check-affected.py --github-ref="${{ github.ref }}" --branch-slug="$branch_slug" --event-name="${{ github.event_name }}"
|
||||
|
||||
- name: Verify script result
|
||||
run: |
|
||||
echo "Check outputs from script"
|
||||
echo "projects: ${{ env.PROJECTS }}"
|
||||
echo "projects-e2e: ${{ env.PROJECTS_E2E }}"
|
||||
echo "preview_governance: ${{ env.PREVIEW_GOVERNANCE }}"
|
||||
echo "preview_trading: ${{ env.PREVIEW_TRADING }}"
|
||||
echo "preview_explorer: ${{ env.PREVIEW_EXPLORER }}"
|
||||
echo "preview_tools: ${{ env.PREVIEW_TOOLS }}"
|
||||
|
||||
- name: Check formatting
|
||||
run: yarn nx format:check
|
||||
|
||||
@@ -112,6 +99,100 @@ jobs:
|
||||
- name: Build affected
|
||||
run: yarn nx affected:build || (yarn install && yarn nx affected:build)
|
||||
|
||||
# See affected apps
|
||||
- name: See affected apps
|
||||
run: |
|
||||
affected="$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects)"
|
||||
branch_slug="$(echo '${{ github.head_ref || github.ref_name }}' | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | cut -c 1-50 )"
|
||||
|
||||
echo ">>>> debug"
|
||||
echo "NX_BASE: ${{ env.NX_BASE }}"
|
||||
echo "NX_HEAD: ${{ env.NX_HEAD }}"
|
||||
echo "Affected: ${affected}"
|
||||
echo "Branch slug: ${branch_slug}"
|
||||
echo ">>>> eof debug"
|
||||
|
||||
projects_array=()
|
||||
|
||||
preview_governance="not deployed"
|
||||
preview_trading="not deployed"
|
||||
preview_explorer="not deployed"
|
||||
preview_tools="not deployed"
|
||||
|
||||
# parse if affected is any of three main applications, if none - use all of them
|
||||
if echo "$affected" | grep -q governance; then
|
||||
echo "Governance is affected"
|
||||
projects_array+=("governance")
|
||||
preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug")
|
||||
fi
|
||||
if echo "$affected" | grep -q trading; then
|
||||
echo "Trading is affected"
|
||||
projects_array+=("trading")
|
||||
preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug")
|
||||
fi
|
||||
if echo "$affected" | grep -q explorer; then
|
||||
echo "Explorer is affected"
|
||||
projects_array+=("explorer")
|
||||
preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug")
|
||||
fi
|
||||
if [[ ${#projects_array[@]} -eq 0 ]]; then
|
||||
projects_array=("governance" "trading" "explorer")
|
||||
preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug")
|
||||
preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug")
|
||||
preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug")
|
||||
fi
|
||||
|
||||
# applications parsed before this loop are applicable for running e2e-tests
|
||||
projects_e2e_array=()
|
||||
for project in "${projects_array[@]}"; do
|
||||
projects_e2e_array+=("${project}-e2e")
|
||||
done
|
||||
# all applications below this loop are not applicable for running e2e-test
|
||||
|
||||
# check if pull request event to deploy tools
|
||||
if [[ "${{ github.event_name }}" = "pull_request" ]]; then
|
||||
if echo "$affected" | grep -q multisig-signer; then
|
||||
echo "Tools are affected"
|
||||
echo "Deploying tools on preview"
|
||||
preview_tools=$(printf "https://%s.%s.vega.rocks" "tools" "$branch_slug")
|
||||
|
||||
projects_array+=("multisig-signer")
|
||||
fi
|
||||
# those apps deploy only from develop to mainnet
|
||||
elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then
|
||||
if echo "$affected" | grep -q multisig-signer; then
|
||||
echo "Tools are affected"
|
||||
echo "Deploying tools on s3"
|
||||
|
||||
projects_array+=("multisig-signer")
|
||||
fi
|
||||
if echo "$affected" | grep -q static; then
|
||||
echo "static is affected"
|
||||
echo "Deploying static on s3"
|
||||
|
||||
projects_array+=("static")
|
||||
fi
|
||||
if echo "$affected" | grep -q ui-toolkit; then
|
||||
echo "ui-toolkit is affected"
|
||||
echo "Deploying ui-toolkit on s3"
|
||||
|
||||
projects_array+=("ui-toolkit")
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Projects: ${projects_array[@]}"
|
||||
echo "Projects E2E: ${projects_e2e_array[@]}"
|
||||
projects_json=$(jq -M --compact-output --null-input '$ARGS.positional' --args -- "${projects_array[@]}")
|
||||
projects_e2e_json=$(jq -M --compact-output --null-input '$ARGS.positional' --args -- "${projects_e2e_array[@]}")
|
||||
|
||||
echo PROJECTS_E2E=$projects_e2e_json >> $GITHUB_ENV
|
||||
echo PROJECTS=$projects_json >> $GITHUB_ENV
|
||||
|
||||
echo PREVIEW_GOVERNANCE=$preview_governance >> $GITHUB_ENV
|
||||
echo PREVIEW_TRADING=$preview_trading >> $GITHUB_ENV
|
||||
echo PREVIEW_EXPLORER=$preview_explorer >> $GITHUB_ENV
|
||||
echo PREVIEW_TOOLS=$preview_tools >> $GITHUB_ENV
|
||||
|
||||
outputs:
|
||||
projects: ${{ env.PROJECTS }}
|
||||
projects-e2e: ${{ env.PROJECTS_E2E }}
|
||||
@@ -120,15 +201,6 @@ jobs:
|
||||
preview_explorer: ${{ env.PREVIEW_EXPLORER }}
|
||||
preview_tools: ${{ env.PREVIEW_TOOLS }}
|
||||
|
||||
console-e2e:
|
||||
needs: lint-test-build
|
||||
name: '(CI) console python'
|
||||
uses: ./.github/workflows/console-test-run.yml
|
||||
secrets: inherit
|
||||
if: ${{ contains(fromJSON(needs.lint-test-build.outputs.projects), 'trading') && github.event_name == 'pull_request' }}
|
||||
with:
|
||||
github-sha: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
cypress:
|
||||
needs: lint-test-build
|
||||
name: '(CI) cypress'
|
||||
@@ -137,12 +209,12 @@ jobs:
|
||||
secrets: inherit
|
||||
with:
|
||||
projects: ${{ needs.lint-test-build.outputs.projects-e2e }}
|
||||
tags: '@smoke'
|
||||
tags: '@smoke @regression'
|
||||
|
||||
publish-dist:
|
||||
needs: lint-test-build
|
||||
name: '(CD) publish dist'
|
||||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'vegaprotocol/frontend-monorepo') || github.event_name == 'push' }}
|
||||
# if: ${{ needs.lint-test-build.outputs.projects != '[]' }}
|
||||
uses: ./.github/workflows/publish-dist.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
@@ -153,7 +225,7 @@ jobs:
|
||||
needs:
|
||||
- publish-dist
|
||||
- lint-test-build
|
||||
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'vegaprotocol/frontend-monorepo' }}
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
|
||||
timeout-minutes: 60
|
||||
name: '(CD) comment preview links'
|
||||
steps:
|
||||
@@ -169,26 +241,26 @@ jobs:
|
||||
# https://stackoverflow.com/questions/3183444/check-for-valid-link-url
|
||||
regex='(https?|ftp|file)://[-[:alnum:]\+&@#/%?=~_|!:,.;]*[-[:alnum:]\+&@#/%=~_|]'
|
||||
if [[ "${{ needs.lint-test-build.outputs.preview_governance }}" =~ $regex ]]; then
|
||||
until curl --insecure --location --fail "${{ needs.lint-test-build.outputs.preview_governance }}"; do
|
||||
echo "waiting for governance preview: ${{ needs.lint-test-build.outputs.preview_governance }}"
|
||||
until curl -L --fail "${{ needs.lint-test-build.outputs.preview_governance }}"; do
|
||||
echo "waiting for governance preview"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
if [[ "${{ needs.lint-test-build.outputs.preview_explorer }}" =~ $regex ]]; then
|
||||
until curl --insecure --location --fail "${{ needs.lint-test-build.outputs.preview_explorer }}"; do
|
||||
echo "waiting for explorer preview: ${{ needs.lint-test-build.outputs.preview_explorer }}"
|
||||
until curl -L --fail "${{ needs.lint-test-build.outputs.preview_explorer }}"; do
|
||||
echo "waiting for explorer preview"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
if [[ "${{ needs.lint-test-build.outputs.preview_trading }}" =~ $regex ]]; then
|
||||
until curl --insecure --location --fail "${{ needs.lint-test-build.outputs.preview_trading }}"; do
|
||||
echo "waiting for trading preview: ${{ needs.lint-test-build.outputs.preview_trading }}"
|
||||
until curl -L --fail "${{ needs.lint-test-build.outputs.preview_trading }}"; do
|
||||
echo "waiting for trading preview"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
if [[ "${{ needs.lint-test-build.outputs.preview_tools }}" =~ $regex ]]; then
|
||||
until curl --insecure --location --fail "${{ needs.lint-test-build.outputs.preview_tools }}"; do
|
||||
echo "waiting for tools preview: ${{ needs.lint-test-build.outputs.preview_tools }}"
|
||||
until curl -L --fail "${{ needs.lint-test-build.outputs.preview_tools }}"; do
|
||||
echo "waiting for tools preview"
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
@@ -199,7 +271,7 @@ jobs:
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
Previews
|
||||
Previews:
|
||||
* governance: ${{ needs.lint-test-build.outputs.preview_governance }}
|
||||
* explorer: ${{ needs.lint-test-build.outputs.preview_explorer }}
|
||||
* trading: ${{ needs.lint-test-build.outputs.preview_trading }}
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
name: (CI) Console tests
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
github-sha:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
run-tests:
|
||||
name: run-tests
|
||||
runs-on: 8-cores
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
#----------------------------------------------
|
||||
# check-out frontend-monorepo
|
||||
#----------------------------------------------
|
||||
- name: Checkout console test repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ inputs.github-sha }}
|
||||
#----------------------------------------------
|
||||
# cache node modules
|
||||
#----------------------------------------------
|
||||
- name: Cache node modules
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
|
||||
# comment out "restore-keys" if you need to rebuild yarn from 0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cache-node-modules-
|
||||
#----------------------------------------------
|
||||
# setup node
|
||||
#----------------------------------------------
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
|
||||
cache: yarn
|
||||
#----------------------------------------------
|
||||
# install deps if cache missing
|
||||
#----------------------------------------------
|
||||
- name: yarn install
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: yarn install --pure-lockfile
|
||||
#----------------------------------------------
|
||||
# build trading
|
||||
#----------------------------------------------
|
||||
- name: Build affected spec
|
||||
run: |
|
||||
yarn env-cmd -f ./apps/trading/.env.stagnet1 yarn nx export trading
|
||||
#----------------------------------------------
|
||||
# run trading server
|
||||
#----------------------------------------------
|
||||
- name: Run trading server
|
||||
run: |
|
||||
docker run -d -p 80:4200 -v $PWD/docker/nginx.conf:/etc/nginx/conf.d/default.conf -v $PWD/dist/apps/trading/exported:/usr/share/nginx/html nginx:1.23-alpine@sha256:6318314189b40e73145a48060bff4783a116c34cc7241532d0d94198fb2c9629
|
||||
sleep 5
|
||||
docker ps
|
||||
#----------------------------------------------
|
||||
# check if container persists between runs
|
||||
#----------------------------------------------
|
||||
- name: Check server
|
||||
run: |
|
||||
docker ps
|
||||
#----------------------------------------------
|
||||
# check-out tests repo
|
||||
#----------------------------------------------
|
||||
- name: Checkout console test repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: vegaprotocol/console-test
|
||||
path: './console-test'
|
||||
#----------------------------------------------
|
||||
# set-up python
|
||||
#----------------------------------------------
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10.11'
|
||||
#----------------------------------------------
|
||||
# ----- install & configure poetry -----
|
||||
#----------------------------------------------
|
||||
- name: Install Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
virtualenvs-path: console-test/.venv
|
||||
#----------------------------------------------
|
||||
# load cached venv if cache exists
|
||||
#----------------------------------------------
|
||||
- name: Load cached venv
|
||||
id: cached-poetry-dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: console-test/.venv
|
||||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||
#----------------------------------------------
|
||||
# install dependencies if cache does not exist
|
||||
#----------------------------------------------
|
||||
- name: Install dependencies
|
||||
working-directory: ./console-test
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||
run: poetry install --no-interaction --no-root
|
||||
#----------------------------------------------
|
||||
# install vega binaries
|
||||
#----------------------------------------------
|
||||
- name: Install vega binaries
|
||||
working-directory: ./console-test
|
||||
run: poetry run python -m vega_sim.tools.load_binaries --force
|
||||
#----------------------------------------------
|
||||
# install playwright
|
||||
#----------------------------------------------
|
||||
- name: install playwright
|
||||
run: poetry run playwright install
|
||||
working-directory: ./console-test
|
||||
#----------------------------------------------
|
||||
# run tests
|
||||
#----------------------------------------------
|
||||
- name: Run tests
|
||||
working-directory: ./console-test
|
||||
run: poetry run pytest -v -s --numprocesses auto --dist loadfile --durations=20
|
||||
- name: Check files
|
||||
run: |
|
||||
ls -al .
|
||||
ls -al console-test
|
||||
#----------------------------------------------
|
||||
# upload traces
|
||||
#----------------------------------------------
|
||||
- name: Upload Playwright Trace
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-trace
|
||||
path: ./traces/
|
||||
retention-days: 15
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
project: ${{ fromJSON(inputs.projects) }}
|
||||
name: ${{ matrix.project }}
|
||||
runs-on: self-hosted-runner
|
||||
timeout-minutes: 120
|
||||
timeout-minutes: 100
|
||||
steps:
|
||||
# Checks if skip cache was requested
|
||||
- name: Set skip-nx-cache flag
|
||||
|
||||
@@ -22,45 +22,6 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
- name: Init variables
|
||||
run: |
|
||||
echo IS_PR=false >> $GITHUB_ENV
|
||||
echo IS_MAINNET_RELEASE=false >> $GITHUB_ENV
|
||||
echo IS_TESTNET_RELEASE=false >> $GITHUB_ENV
|
||||
echo IS_IPFS_RELEASE=false >> $GITHUB_ENV
|
||||
echo IS_S3_RELEASE=false >> $GITHUB_ENV
|
||||
echo IS_DEV_IMAGE=false >> $GITHUB_ENV
|
||||
|
||||
- name: Is dev image
|
||||
if: ${{ contains(github.ref, 'develop') && github.event_name == 'push' && matrix.app == 'trading' }}
|
||||
run: |
|
||||
echo IS_DEV_IMAGE=true >> $GITHUB_ENV
|
||||
|
||||
- name: Is PR
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: |
|
||||
echo IS_PR=true >> $GITHUB_ENV
|
||||
|
||||
- name: Is mainnet release
|
||||
if: ${{ contains(github.ref, 'release/mainnet') && !contains(github.ref, 'mirror') }}
|
||||
run: |
|
||||
echo IS_MAINNET_RELEASE=true >> $GITHUB_ENV
|
||||
|
||||
- name: Is testnet release
|
||||
if: ${{ contains(github.ref, 'release/testnet') }}
|
||||
run: |
|
||||
echo IS_TESTNET_RELEASE=true >> $GITHUB_ENV
|
||||
|
||||
- name: Is IPFS Release
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && ( env.IS_MAINNET_RELEASE == 'true' || env.IS_TESTNET_RELEASE == 'true' ) }}
|
||||
run: |
|
||||
echo IS_IPFS_RELEASE=true >> $GITHUB_ENV
|
||||
|
||||
- name: Is S3 Release
|
||||
if: ${{ env.IS_IPFS_RELEASE == 'false' && github.event_name == 'push' }}
|
||||
run: |
|
||||
echo IS_S3_RELEASE=true >> $GITHUB_ENV
|
||||
|
||||
- name: Set up QEMU
|
||||
id: quemu
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -72,7 +33,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to the Container registry (ghcr)
|
||||
if: ${{ env.IS_PR == 'true' }}
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
@@ -81,8 +42,9 @@ jobs:
|
||||
|
||||
- name: Log in to the Container registry (docker hub)
|
||||
uses: docker/login-action@v2
|
||||
if: ${{ env.IS_IPFS_RELEASE == 'true' || env.IS_DEV_IMAGE == 'true' }}
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && ( endsWith(github.ref, 'main') || endsWith(github.ref, 'release/testnet') ) }}
|
||||
with:
|
||||
# registry: registry.hub.docker.com
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
@@ -103,33 +65,67 @@ jobs:
|
||||
- name: Define dist variables
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: |
|
||||
python3 tools/ci/define-dist-variables.py --github-ref="${{ github.ref }}" --app="${{ matrix.app }}"
|
||||
envName=''
|
||||
domain="vega.rocks"
|
||||
bucketName=''
|
||||
|
||||
- name: Verify script result
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: |
|
||||
echo "BUCKET_NAME=${{ env.BUCKET_NAME }}"
|
||||
echo "ENV_NAME=${{ env.ENV_NAME }}"
|
||||
if [[ "${{ github.ref }}" =~ .*release/.* ]]; then
|
||||
envName="$(echo ${{ github.ref }} | rev | cut -d '/' -f 1 | rev)"
|
||||
elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then
|
||||
envName="stagnet1"
|
||||
if [[ "${{ matrix.app }}" = "multisig-signer" ]]; then
|
||||
envName="mainnet"
|
||||
bucketName="tools.vega.xyz"
|
||||
fi
|
||||
if [[ "${{ matrix.app }}" = "static" ]]; then
|
||||
envName="mainnet"
|
||||
bucketName="static.vega.xyz"
|
||||
fi
|
||||
if [[ "${{ matrix.app }}" = "ui-toolkit" ]]; then
|
||||
envName="mainnet"
|
||||
bucketName="ui.vega.rocks"
|
||||
fi
|
||||
elif [[ "${{ github.ref }}" =~ .*main$ ]]; then
|
||||
envName="mainnet"
|
||||
fi
|
||||
|
||||
if [[ "${envName}" = "mainnet" ]]; then
|
||||
domain="vega.xyz"
|
||||
if [[ -z "${bucketName}" ]]; then
|
||||
bucketName="${{ matrix.app }}.${domain}"
|
||||
fi
|
||||
elif [[ "${envName}" = "testnet" ]]; then
|
||||
domain="fairground.wtf"
|
||||
if [[ -z "${bucketName}" ]]; then
|
||||
bucketName="${{ matrix.app }}.${domain}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "${bucketName}" ]]; then
|
||||
bucketName="${{ matrix.app }}.${envName}.${domain}"
|
||||
fi
|
||||
|
||||
echo "bucket name: ${bucketName}"
|
||||
echo "env name: ${envName}"
|
||||
|
||||
echo BUCKET_NAME=${bucketName} >> $GITHUB_ENV
|
||||
echo ENV_NAME=${envName} >> $GITHUB_ENV
|
||||
|
||||
- name: Build local dist
|
||||
run: |
|
||||
envCmd=""
|
||||
flags=""
|
||||
if [[ ! -z "${{ env.ENV_NAME }}" ]]; then
|
||||
envCmd="yarn env-cmd -f ./apps/${{ matrix.app }}/.env.${{ env.ENV_NAME }}"
|
||||
flags="--env=${{ env.ENV_NAME }}"
|
||||
fi
|
||||
|
||||
if [ "${{ matrix.app }}" = "trading" ]; then
|
||||
$envCmd yarn nx export trading || (yarn install && $envCmd yarn nx export trading)
|
||||
yarn nx export trading $flags || (yarn install && yarn nx export trading $flags)
|
||||
DIST_LOCATION=dist/apps/trading/exported
|
||||
elif [ "${{ matrix.app }}" = "ui-toolkit" ]; then
|
||||
NODE_ENV=production yarn nx run ui-toolkit:build-storybook
|
||||
DIST_LOCATION=dist/storybook/ui-toolkit
|
||||
elif [ "${{ matrix.app }}" = "static" ]; then
|
||||
yarn nx build static || (yarn install && yarn nx build static)
|
||||
else
|
||||
$envCmd yarn nx build ${{ matrix.app }} || (yarn install && $envCmd yarn nx build ${{ matrix.app }})
|
||||
fi
|
||||
if [[ -z "$DIST_LOCATION" ]]; then
|
||||
yarn nx build ${{ matrix.app }} $flags || (yarn install && yarn nx build ${{ matrix.app }} $flags)
|
||||
DIST_LOCATION=dist/apps/${{ matrix.app }}
|
||||
fi
|
||||
mv $DIST_LOCATION dist-result
|
||||
@@ -149,7 +145,7 @@ jobs:
|
||||
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local
|
||||
|
||||
- name: Image digest
|
||||
if: ${{ env.IS_PR == 'true' }}
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
||||
- name: Sanity check docker image
|
||||
@@ -164,7 +160,7 @@ jobs:
|
||||
uses: docker/build-push-action@v3
|
||||
continue-on-error: true
|
||||
id: ghcr-push
|
||||
if: ${{ env.IS_PR == 'true' }}
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
|
||||
with:
|
||||
context: .
|
||||
file: docker/node-outside-docker.Dockerfile
|
||||
@@ -179,7 +175,7 @@ jobs:
|
||||
uses: docker/build-push-action@v3
|
||||
continue-on-error: true
|
||||
id: dockerhub-push
|
||||
if: ${{ env.IS_IPFS_RELEASE == 'true' || env.IS_DEV_IMAGE == 'true' }}
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && ( endsWith(github.ref, 'main') || endsWith(github.ref, 'release/testnet') ) }}
|
||||
with:
|
||||
context: .
|
||||
file: docker/node-outside-docker.Dockerfile
|
||||
@@ -189,7 +185,7 @@ jobs:
|
||||
ENV_NAME=${{ env.ENV_NAME }}
|
||||
tags: |
|
||||
vegaprotocol/${{ matrix.app }}:${{ github.sha }}
|
||||
vegaprotocol/${{ matrix.app }}:${{ env.IS_MAINNET_RELEASE == 'true' && 'mainnet' || env.IS_TESTNET_RELEASE == 'true' && 'testnet' || env.IS_DEV_IMAGE == 'true' && 'develop' || '' }}
|
||||
vegaprotocol/${{ matrix.app }}:${{ endsWith(github.ref, 'main') && 'mainnet' || endsWith(github.ref, 'release/testnet') && 'testnet' || '' }}
|
||||
|
||||
- name: Publish dist as docker image (ghcr - retry)
|
||||
uses: docker/build-push-action@v3
|
||||
@@ -216,13 +212,13 @@ jobs:
|
||||
ENV_NAME=${{ env.ENV_NAME }}
|
||||
tags: |
|
||||
vegaprotocol/${{ matrix.app }}:${{ github.sha }}
|
||||
vegaprotocol/${{ matrix.app }}:${{ env.IS_MAINNET_RELEASE == 'true' && 'mainnet' || env.IS_TESTNET_RELEASE == 'true' && 'testnet' || '' }}
|
||||
vegaprotocol/${{ matrix.app }}:${{ endsWith(github.ref, 'main') && 'mainnet' || endsWith(github.ref, 'release/testnet') && 'testnet' || '' }}
|
||||
|
||||
# bucket creation in github.com/vegaprotocol/terraform//frontend
|
||||
- name: Publish dist to s3
|
||||
uses: jakejarvis/s3-sync-action@master
|
||||
# s3 releases are not happening for trading on mainnet - it's IPFS
|
||||
if: ${{ env.IS_S3_RELEASE == 'true' }}
|
||||
if: ${{ github.event_name == 'push' && ( matrix.app != 'trading' || (matrix.app == 'trading' && !( endsWith(github.ref, 'main') || endsWith(github.ref, 'release/testnet') ) ) ) }}
|
||||
with:
|
||||
args: --acl private --follow-symlinks --delete
|
||||
env:
|
||||
@@ -233,11 +229,11 @@ jobs:
|
||||
SOURCE_DIR: 'dist-result'
|
||||
|
||||
- name: Install aws CLI
|
||||
if: ${{ env.IS_S3_RELEASE == 'true' }}
|
||||
if: ${{ github.event_name == 'push' && ( matrix.app != 'trading' || (matrix.app == 'trading' && !( endsWith(github.ref, 'main') || endsWith(github.ref, 'release/testnet') ) ) ) }}
|
||||
uses: unfor19/install-aws-cli-action@master
|
||||
|
||||
- name: Perform cache invalidation
|
||||
if: ${{ env.IS_S3_RELEASE == 'true' }}
|
||||
if: ${{ github.event_name == 'push' && ( matrix.app != 'trading' || (matrix.app == 'trading' && !( endsWith(github.ref, 'main') || endsWith(github.ref, 'release/testnet') ) ) ) }}
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
@@ -250,16 +246,16 @@ jobs:
|
||||
|
||||
- name: Add preview label
|
||||
uses: actions-ecosystem/action-add-labels@v1
|
||||
if: ${{ env.IS_PR == 'true' }}
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
|
||||
with:
|
||||
labels: ${{ matrix.app }}-preview
|
||||
number: ${{ github.event.number }}
|
||||
|
||||
- name: Trigger fleek deployment
|
||||
# release to ipfs happens only on mainnet (represented by main branch) for trading
|
||||
if: ${{ env.IS_IPFS_RELEASE == 'true' }}
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && ( endsWith(github.ref, 'main') || endsWith(github.ref, 'release/testnet') ) }}
|
||||
run: |
|
||||
if [[ "${{ env.IS_MAINNET_RELEASE }}" = "true" ]]; then
|
||||
if echo ${{ github.ref }} | grep -q main; then
|
||||
# display info about app
|
||||
curl --fail -H "Authorization: ${{ secrets.FLEEK_API_KEY }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
@@ -272,7 +268,7 @@ jobs:
|
||||
-d '{"query": "mutation{triggerDeploy(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id status}}"}' \
|
||||
https://api.fleek.co/graphql
|
||||
|
||||
elif [[ "${{ env.IS_TESTNET_RELEASE }}" = "true" ]]; then
|
||||
elif echo ${{ github.ref }} | grep -q release/testnet; then
|
||||
# display info about app
|
||||
curl --fail -H "Authorization: ${{ secrets.FLEEK_API_KEY }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
@@ -287,7 +283,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Check out ipfs-redirect
|
||||
if: ${{ env.IS_IPFS_RELEASE == 'true' }}
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && ( endsWith(github.ref, 'main') || endsWith(github.ref, 'testnet') ) }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'vegaprotocol/ipfs-redirect'
|
||||
@@ -296,7 +292,7 @@ jobs:
|
||||
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: Update interstitial page to point to the new console
|
||||
if: ${{ env.IS_IPFS_RELEASE == 'true' }}
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && ( endsWith(github.ref, 'main') || endsWith(github.ref, 'testnet') ) }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||
run: |
|
||||
@@ -318,11 +314,11 @@ jobs:
|
||||
git config --global user.name "vega-ci-bot"
|
||||
|
||||
# update CID files
|
||||
if [[ "${{ env.IS_MAINNET_RELEASE }}" = "true" ]]; then
|
||||
if echo ${{ github.ref }} | grep -q main; then
|
||||
echo $new_hash > cidv0-mainnet.txt
|
||||
echo $new_cid > cidv1-mainnet.txt
|
||||
git add cidv0-mainnet.txt cidv1-mainnet.txt
|
||||
elif [[ "${{ env.IS_TESTNET_RELEASE }}" = "true" ]]; then
|
||||
elif echo ${{ github.ref }} | grep -q release/testnet; then
|
||||
echo $new_hash > cidv0-fairground.txt
|
||||
echo $new_cid > cidv1-fairground.txt
|
||||
git add cidv0-fairground.txt cidv1-fairground.txt
|
||||
|
||||
@@ -15,7 +15,6 @@ on:
|
||||
- types
|
||||
- utils
|
||||
- i18n
|
||||
- wallet
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
module.exports = {
|
||||
stories: [],
|
||||
addons: [
|
||||
'@storybook/addon-actions',
|
||||
'@storybook/addon-viewport',
|
||||
{
|
||||
name: '@storybook/addon-docs',
|
||||
options: {
|
||||
configureJSX: true,
|
||||
babelOptions: {},
|
||||
sourceLoaderOptions: null,
|
||||
transcludeMarkdown: true,
|
||||
},
|
||||
},
|
||||
'@storybook/addon-controls',
|
||||
'@storybook/addon-backgrounds',
|
||||
'@storybook/addon-toolbars',
|
||||
'@storybook/addon-measure',
|
||||
'@storybook/addon-outline',
|
||||
'@storybook/addon-a11y',
|
||||
],
|
||||
// uncomment the property below if you want to apply some webpack config globally
|
||||
// webpackFinal: async (config, { configType }) => {
|
||||
// // Make whatever fine-grained changes you need that should apply to all storybook configs
|
||||
|
||||
// // Return the altered config
|
||||
// return config;
|
||||
// },
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"exclude": [
|
||||
"../**/*.spec.js",
|
||||
"../**/*.test.js",
|
||||
"../**/*.spec.ts",
|
||||
"../**/*.test.ts",
|
||||
"../**/*.spec.tsx",
|
||||
"../**/*.test.tsx",
|
||||
"../**/*.spec.jsx",
|
||||
"../**/*.test.jsx"
|
||||
],
|
||||
"include": ["../**/*"]
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "explorer-e2e",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/explorer-e2e/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"e2e": {
|
||||
"executor": "@nx/cypress:cypress",
|
||||
"executor": "@nrwl/cypress:cypress",
|
||||
"options": {
|
||||
"cypressConfig": "apps/explorer-e2e/cypress.config.js",
|
||||
"devServerTarget": "explorer:serve"
|
||||
@@ -17,14 +16,14 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/explorer-e2e/**/*.{js,ts}"]
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
"options": {
|
||||
"command": "yarn tsc --project ./apps/explorer-e2e/"
|
||||
|
||||
@@ -31,7 +31,7 @@ context('Asset page', { tags: '@regression' }, () => {
|
||||
});
|
||||
});
|
||||
|
||||
it.skip('should open details page when clicked on "View details"', () => {
|
||||
it('should open details page when clicked on "View details"', () => {
|
||||
cy.getAssets().then((assets) => {
|
||||
assets.forEach((asset) => {
|
||||
cy.get(`[row-id="${asset.id}"] [col-id="actions"] button`)
|
||||
|
||||
@@ -169,6 +169,7 @@ context.skip('Parties page', { tags: '@regression' }, function () {
|
||||
const jsonFields = '.hljs';
|
||||
const sideMenuBackground = '.absolute';
|
||||
|
||||
// Engage dark mode if not allready set
|
||||
cy.get(sideMenuBackground)
|
||||
.should('have.css', 'background-color')
|
||||
.then((background_color) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@nx/react/babel",
|
||||
"@nrwl/react/babel",
|
||||
{
|
||||
"runtime": "automatic"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# App configuration variables
|
||||
NX_TENDERMINT_URL=https://tm.be.devnet1.vega.xyz/
|
||||
NX_TENDERMINT_URL=https://tm.be.devnet1.vega.xyz/tm
|
||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.devnet1.vega.xyz/websocket
|
||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/devnet1/vegawallet-devnet1.toml
|
||||
NX_VEGA_ENV=DEVNET
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# App configuration variables
|
||||
NX_TENDERMINT_URL=https://be.mainnet-mirror.vega.rocks
|
||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.mainnet-mirror.vega.rocks/websocket
|
||||
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/mainnet-mirror/vegawallet-mainnet-mirror.toml
|
||||
NX_VEGA_URL=https://api.mainnet-mirror.vega.rocks/graphql
|
||||
NX_VEGA_ENV=MAINNET-MIRROR
|
||||
NX_BLOCK_EXPLORER=https://be.mainnet-mirror.vega.rocks/rest
|
||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||
NX_VEGA_GOVERNANCE_URL=https://governance.mainnet-mirror.vega.rocks
|
||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/mainnet/announcements.json
|
||||
NX_VEGA_EXPLORER_URL=https://explorer.mainnet-mirror.vega.rocks/
|
||||
NX_VEGA_CONSOLE_URL=https://console.mainnet-mirror.vega.rocks
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*", "__generated__"],
|
||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
|
||||
@@ -32,7 +32,6 @@ yarn nx serve explorer
|
||||
Example configurations are provided here:
|
||||
|
||||
- [Mainnet](./.env.mainnet)
|
||||
- [Mainnet-mirror](./.env.mainnet-mirror)
|
||||
- [Devnet](./.env.devnet)
|
||||
- [Capsule](./.env.capsule)
|
||||
- [Testnet](./.env.testnet)
|
||||
@@ -40,7 +39,7 @@ Example configurations are provided here:
|
||||
For convenience, you can boot the app injecting one of the configurations above by running:
|
||||
|
||||
```bash
|
||||
yarn env-cmd -f .\apps\explorer\.env.{env} yarn nx run explorer:serve # e.g. stagnet1
|
||||
yarn nx run explorer:serve --env={env} # e.g. stagnet1
|
||||
```
|
||||
|
||||
There are a few different configuration options offered for this app:
|
||||
|
||||
@@ -4,8 +4,8 @@ export default {
|
||||
displayName: 'explorer',
|
||||
preset: '../../jest.preset.js',
|
||||
transform: {
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': 'babel-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||
coverageDirectory: '../../coverage/apps/explorer',
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "explorer",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/explorer/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/webpack:webpack",
|
||||
"executor": "./tools/executors/webpack:build",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"defaultConfiguration": "production",
|
||||
"options": {
|
||||
@@ -39,7 +38,7 @@
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/webpack:dev-server",
|
||||
"executor": "./tools/executors/webpack:serve",
|
||||
"options": {
|
||||
"port": 3000,
|
||||
"buildTarget": "explorer:build:development",
|
||||
@@ -53,36 +52,30 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/explorer/**/*.{ts,tsx,js,jsx}"]
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/apps/explorer"],
|
||||
"executor": "@nrwl/jest:jest",
|
||||
"outputs": ["coverage/apps/explorer"],
|
||||
"options": {
|
||||
"jestConfig": "apps/explorer/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"generate-types": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"npx openapi-typescript https://raw.githubusercontent.com/vegaprotocol/documentation/spec-update-v0.72.0-preview.2/specs/v0.72.0-preview.2/blockexplorer.openapi.json --output apps/explorer/src/types/explorer.d.ts --immutable-types"
|
||||
"npx openapi-typescript https://raw.githubusercontent.com/vegaprotocol/documentation/main/specs/v0.71.4/blockexplorer.openapi.json --output apps/explorer/src/types/explorer.d.ts --immutable-types"
|
||||
]
|
||||
}
|
||||
},
|
||||
"build-netlify": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"cp apps/explorer/netlify.toml netlify.toml",
|
||||
@@ -91,7 +84,7 @@
|
||||
}
|
||||
},
|
||||
"build-spec": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
"options": {
|
||||
"command": "yarn tsc --project ./apps/explorer/tsconfig.spec.json"
|
||||
|
||||
+12
-34
@@ -6,32 +6,10 @@ import {
|
||||
SPECIAL_CASE_NETWORK_ID,
|
||||
} from '../../../../links/party-link/party-link';
|
||||
import SizeInAsset from '../../../../size-in-asset/size-in-asset';
|
||||
import { AccountTypeMapping } from '@vegaprotocol/types';
|
||||
import { AccountType } from '@vegaprotocol/types';
|
||||
import { headerClasses, wrapperClasses } from '../transfer-details';
|
||||
import type { components } from '../../../../../../types/explorer';
|
||||
|
||||
type Transfer = components['schemas']['commandsv1Transfer'];
|
||||
type AccountTypes = components['schemas']['vegaAccountType'];
|
||||
|
||||
const AccountType: Record<AccountTypes, string> = {
|
||||
ACCOUNT_TYPE_UNSPECIFIED: 'Unspecified',
|
||||
ACCOUNT_TYPE_INSURANCE: 'Insurance',
|
||||
ACCOUNT_TYPE_SETTLEMENT: 'Settlement',
|
||||
ACCOUNT_TYPE_MARGIN: 'Margin',
|
||||
ACCOUNT_TYPE_GENERAL: 'General',
|
||||
ACCOUNT_TYPE_FEES_INFRASTRUCTURE: 'Infrastructure',
|
||||
ACCOUNT_TYPE_FEES_LIQUIDITY: 'Liquidity',
|
||||
ACCOUNT_TYPE_FEES_MAKER: 'Maker',
|
||||
ACCOUNT_TYPE_BOND: 'Bond',
|
||||
ACCOUNT_TYPE_EXTERNAL: 'External',
|
||||
ACCOUNT_TYPE_GLOBAL_INSURANCE: 'Global Insurance',
|
||||
ACCOUNT_TYPE_GLOBAL_REWARD: 'Global Reward',
|
||||
ACCOUNT_TYPE_PENDING_TRANSFERS: 'Pending Transfers',
|
||||
ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES: 'Maker Paid Fees',
|
||||
ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES: 'Maker Received Fees',
|
||||
ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES: 'LP Received Fees',
|
||||
ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS: 'Market Proposers',
|
||||
ACCOUNT_TYPE_HOLDING: 'Holding',
|
||||
};
|
||||
import type { Transfer } from '../transfer-details';
|
||||
|
||||
interface TransferParticipantsProps {
|
||||
transfer: Transfer;
|
||||
@@ -52,22 +30,22 @@ export function TransferParticipants({
|
||||
}: TransferParticipantsProps) {
|
||||
// This mapping is required as the global account types require a type to be set, while
|
||||
// the underlying protobufs allow for every field to be undefined.
|
||||
const fromAcct: AccountTypes =
|
||||
const fromAcct =
|
||||
transfer.fromAccountType &&
|
||||
transfer.fromAccountType !== 'ACCOUNT_TYPE_UNSPECIFIED'
|
||||
? transfer.fromAccountType
|
||||
: 'ACCOUNT_TYPE_GENERAL';
|
||||
const fromAccountTypeLabel: string = transfer.fromAccountType
|
||||
? AccountType[fromAcct]
|
||||
? AccountType[transfer.fromAccountType]
|
||||
: AccountType.ACCOUNT_TYPE_GENERAL;
|
||||
const fromAccountTypeLabel = transfer.fromAccountType
|
||||
? AccountTypeMapping[fromAcct]
|
||||
: 'Unknown';
|
||||
|
||||
const toAcct: AccountTypes =
|
||||
const toAcct =
|
||||
transfer.toAccountType &&
|
||||
transfer.toAccountType !== 'ACCOUNT_TYPE_UNSPECIFIED'
|
||||
? transfer.toAccountType
|
||||
: 'ACCOUNT_TYPE_GENERAL';
|
||||
? AccountType[transfer.toAccountType]
|
||||
: AccountType.ACCOUNT_TYPE_GENERAL;
|
||||
const toAccountTypeLabel = transfer.fromAccountType
|
||||
? AccountType[toAcct]
|
||||
? AccountTypeMapping[toAcct]
|
||||
: 'Unknown';
|
||||
|
||||
return (
|
||||
|
||||
@@ -27,9 +27,9 @@ export function TransferRepeat({ recurring }: TransferRepeatProps) {
|
||||
<div className={wrapperClasses}>
|
||||
<h2 className={headerClasses}>{t('Active epochs')}</h2>
|
||||
<div className="relative block rounded-lg py-6 text-center p-6">
|
||||
<div>
|
||||
<p>
|
||||
<EpochOverview id={recurring.startEpoch} />
|
||||
</div>
|
||||
</p>
|
||||
<p className="leading-10 my-2">
|
||||
<IconForEpoch
|
||||
start={recurring.startEpoch}
|
||||
@@ -37,13 +37,13 @@ export function TransferRepeat({ recurring }: TransferRepeatProps) {
|
||||
current={data?.epoch.id}
|
||||
/>
|
||||
</p>
|
||||
<div>
|
||||
<p>
|
||||
{recurring.endEpoch ? (
|
||||
<EpochOverview id={recurring.endEpoch} />
|
||||
) : (
|
||||
<span>{t('Forever')}</span>
|
||||
)}
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ import { DispatchMetricLabels } from '@vegaprotocol/types';
|
||||
export type Metric = components['schemas']['vegaDispatchMetric'];
|
||||
export type Strategy = components['schemas']['vegaDispatchStrategy'];
|
||||
|
||||
const metricLabels: Record<Metric, string> = {
|
||||
const metricLabels = {
|
||||
DISPATCH_METRIC_UNSPECIFIED: 'Unknown metric',
|
||||
...DispatchMetricLabels,
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import { TransferRepeat } from './blocks/transfer-repeat';
|
||||
import { TransferRewards } from './blocks/transfer-rewards';
|
||||
import { TransferParticipants } from './blocks/transfer-participants';
|
||||
|
||||
export type Recurring = components['schemas']['commandsv1RecurringTransfer'];
|
||||
export type Recurring = components['schemas']['v1RecurringTransfer'];
|
||||
export type Metric = components['schemas']['vegaDispatchMetric'];
|
||||
|
||||
export const wrapperClasses =
|
||||
|
||||
@@ -16,7 +16,7 @@ interface StringMap {
|
||||
const displayString: StringMap = {
|
||||
OrderSubmission: 'Order Submission',
|
||||
'Submit Order': 'Order',
|
||||
OrderCancellation: 'Cancel order',
|
||||
OrderCancellation: 'Order Cancellation',
|
||||
OrderAmendment: 'Order Amendment',
|
||||
VoteSubmission: 'Vote Submission',
|
||||
WithdrawSubmission: 'Withdraw Submission',
|
||||
@@ -44,27 +44,8 @@ const displayString: StringMap = {
|
||||
ValidatorHeartbeat: 'Heartbeat',
|
||||
'Validator Heartbeat': 'Heartbeat',
|
||||
'Batch Market Instructions': 'Batch',
|
||||
'Stop Orders Submission': 'Stop',
|
||||
StopOrdersSubmission: 'Stop',
|
||||
StopOrdersCancellation: 'Cancel stop',
|
||||
'Stop Orders Cancellation': 'Cancel stop',
|
||||
};
|
||||
|
||||
export function getLabelForOrderType(
|
||||
orderType: string,
|
||||
command: components['schemas']['v1InputData']
|
||||
): string {
|
||||
if (command.orderSubmission) {
|
||||
if (command.orderSubmission.peggedOrder) {
|
||||
return 'Peg';
|
||||
}
|
||||
if (command.orderSubmission.icebergOpts) {
|
||||
return 'Iceberg';
|
||||
}
|
||||
}
|
||||
return 'Order';
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a proposal, will return a specific label
|
||||
* @param chainEvent
|
||||
@@ -136,8 +117,6 @@ export function getLabelForChainEvent(
|
||||
return t('Signer threshold');
|
||||
}
|
||||
return t('Multisig update');
|
||||
} else if (chainEvent.contractCall) {
|
||||
return t('Contract call');
|
||||
}
|
||||
return t('Chain Event');
|
||||
}
|
||||
|
||||
+72
-398
@@ -3,7 +3,7 @@
|
||||
* Do not make direct changes to the file.
|
||||
*/
|
||||
|
||||
/** OneOf type helpers */
|
||||
/** Type helpers */
|
||||
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
|
||||
type XOR<T, U> = T | U extends object
|
||||
? (Without<T, U> & U) | (Without<U, T> & T)
|
||||
@@ -41,8 +41,6 @@ export interface paths {
|
||||
};
|
||||
}
|
||||
|
||||
export type webhooks = Record<string, never>;
|
||||
|
||||
export interface components {
|
||||
schemas: {
|
||||
/**
|
||||
@@ -103,17 +101,6 @@ export interface components {
|
||||
| 'TIME_IN_FORCE_FOK'
|
||||
| 'TIME_IN_FORCE_GFA'
|
||||
| 'TIME_IN_FORCE_GFN';
|
||||
/**
|
||||
* @description - EXPIRY_STRATEGY_UNSPECIFIED: Never valid
|
||||
* - EXPIRY_STRATEGY_CANCELS: Stop order should be cancelled if the expiry time is reached.
|
||||
* - EXPIRY_STRATEGY_SUBMIT: Order should be submitted if the expiry time is reached.
|
||||
* @default EXPIRY_STRATEGY_UNSPECIFIED
|
||||
* @enum {string}
|
||||
*/
|
||||
readonly StopOrderExpiryStrategy:
|
||||
| 'EXPIRY_STRATEGY_UNSPECIFIED'
|
||||
| 'EXPIRY_STRATEGY_CANCELS'
|
||||
| 'EXPIRY_STRATEGY_SUBMIT';
|
||||
/**
|
||||
* @default METHOD_UNSPECIFIED
|
||||
* @enum {string}
|
||||
@@ -156,36 +143,6 @@ export interface components {
|
||||
/** Type of transaction */
|
||||
readonly type?: string;
|
||||
};
|
||||
/** Request for cancelling a recurring transfer */
|
||||
readonly commandsv1CancelTransfer: {
|
||||
/** @description Transfer ID of the transfer to cancel. */
|
||||
readonly transferId?: string;
|
||||
};
|
||||
/** Specific details for a one off transfer */
|
||||
readonly commandsv1OneOffTransfer: {
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Timestamp in Unix nanoseconds for when the transfer should be delivered into the receiver's account.
|
||||
*/
|
||||
readonly deliverOn?: string;
|
||||
};
|
||||
/** Specific details for a recurring transfer */
|
||||
readonly commandsv1RecurringTransfer: {
|
||||
/** @description Optional parameter defining how a transfer is dispatched. */
|
||||
readonly dispatchStrategy?: components['schemas']['vegaDispatchStrategy'];
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Last epoch at which this transfer shall be paid.
|
||||
*/
|
||||
readonly endEpoch?: string;
|
||||
/** @description Factor needs to be > 0. */
|
||||
readonly factor?: string;
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description First epoch from which this transfer shall be paid.
|
||||
*/
|
||||
readonly startEpoch?: string;
|
||||
};
|
||||
/** Transfer initiated by a party */
|
||||
readonly commandsv1Transfer: {
|
||||
/** @description Amount to be taken from the source account. This field is an unsigned integer scaled to the asset's decimal places. */
|
||||
@@ -197,8 +154,8 @@ export interface components {
|
||||
* should be taken.
|
||||
*/
|
||||
readonly fromAccountType?: components['schemas']['vegaAccountType'];
|
||||
readonly oneOff?: components['schemas']['commandsv1OneOffTransfer'];
|
||||
readonly recurring?: components['schemas']['commandsv1RecurringTransfer'];
|
||||
readonly oneOff?: components['schemas']['v1OneOffTransfer'];
|
||||
readonly recurring?: components['schemas']['v1RecurringTransfer'];
|
||||
/** @description Reference to be attached to the transfer. */
|
||||
readonly reference?: string;
|
||||
/** @description Public key of the destination account. */
|
||||
@@ -214,19 +171,8 @@ export interface components {
|
||||
};
|
||||
readonly protobufAny: {
|
||||
readonly '@type'?: string;
|
||||
[key: string]: unknown;
|
||||
[key: string]: unknown | undefined;
|
||||
};
|
||||
/**
|
||||
* @description `NullValue` is a singleton enumeration to represent the null value for the
|
||||
* `Value` type union.
|
||||
*
|
||||
* The JSON representation for `NullValue` is JSON `null`.
|
||||
*
|
||||
* - NULL_VALUE: Null value.
|
||||
* @default NULL_VALUE
|
||||
* @enum {string}
|
||||
*/
|
||||
readonly protobufNullValue: 'NULL_VALUE';
|
||||
/** Used to announce a node as a new pending validator */
|
||||
readonly v1AnnounceNode: {
|
||||
/** @description AvatarURL of the validator. */
|
||||
@@ -279,19 +225,18 @@ export interface components {
|
||||
readonly amendments?: readonly components['schemas']['v1OrderAmendment'][];
|
||||
/** @description List of order cancellations to be processed sequentially. */
|
||||
readonly cancellations?: readonly components['schemas']['v1OrderCancellation'][];
|
||||
/** @description List of stop order cancellations to be processed sequentially. */
|
||||
readonly stopOrdersCancellation?: readonly components['schemas']['v1StopOrdersCancellation'][];
|
||||
/** @description List of stop order submissions to be processed sequentially. */
|
||||
readonly stopOrdersSubmission?: readonly components['schemas']['v1StopOrdersSubmission'][];
|
||||
/** @description List of order submissions to be processed sequentially. */
|
||||
readonly submissions?: readonly components['schemas']['v1OrderSubmission'][];
|
||||
};
|
||||
/** Request for cancelling a recurring transfer */
|
||||
readonly v1CancelTransfer: {
|
||||
/** @description Transfer ID of the transfer to cancel. */
|
||||
readonly transferId?: string;
|
||||
};
|
||||
/** Event forwarded to the Vega network to provide information on events happening on other networks */
|
||||
readonly v1ChainEvent: {
|
||||
/** @description Built-in asset event. */
|
||||
readonly builtin?: components['schemas']['vegaBuiltinAssetEvent'];
|
||||
/** Arbitrary contract call */
|
||||
readonly contractCall?: components['schemas']['vegaEthContractCallEvent'];
|
||||
/** @description Ethereum ERC20 event. */
|
||||
readonly erc20?: components['schemas']['vegaERC20Event'];
|
||||
/** @description Ethereum ERC20 multisig event. */
|
||||
@@ -356,19 +301,6 @@ export interface components {
|
||||
/** Transaction corresponding to the hash */
|
||||
readonly transaction?: components['schemas']['blockexplorerapiv1Transaction'];
|
||||
};
|
||||
/** Iceberg order options */
|
||||
readonly v1IcebergOpts: {
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Minimum allowed remaining size of the order before it is replenished back to its peak size.
|
||||
*/
|
||||
readonly minimumVisibleSize?: string;
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Size of the order that is made visible and can be traded with during the execution of a single order.
|
||||
*/
|
||||
readonly peakSize?: string;
|
||||
};
|
||||
readonly v1InfoResponse: {
|
||||
/** Commit hash from which the data node was built */
|
||||
readonly commitHash?: string;
|
||||
@@ -393,7 +325,7 @@ export interface components {
|
||||
*/
|
||||
readonly blockHeight?: string;
|
||||
/** @description Command to request cancelling a recurring transfer. */
|
||||
readonly cancelTransfer?: components['schemas']['commandsv1CancelTransfer'];
|
||||
readonly cancelTransfer?: components['schemas']['v1CancelTransfer'];
|
||||
/**
|
||||
* @description Command used by a validator to submit an event forwarded to the Vega network to provide information
|
||||
* on events happening on other networks, to be used by a foreign chain
|
||||
@@ -449,10 +381,6 @@ export interface components {
|
||||
readonly protocolUpgradeProposal?: components['schemas']['v1ProtocolUpgradeProposal'];
|
||||
/** @description Command used by a validator to submit a floating point value. */
|
||||
readonly stateVariableProposal?: components['schemas']['v1StateVariableProposal'];
|
||||
/** @description Command to cancel stop orders. */
|
||||
readonly stopOrdersCancellation?: components['schemas']['v1StopOrdersCancellation'];
|
||||
/** @description Command to submit a pair of stop orders. */
|
||||
readonly stopOrdersSubmission?: components['schemas']['v1StopOrdersSubmission'];
|
||||
/** @description Command to submit a transfer. */
|
||||
readonly transfer?: components['schemas']['commandsv1Transfer'];
|
||||
/** @description Command to remove tokens delegated to a validator. */
|
||||
@@ -520,9 +448,9 @@ export interface components {
|
||||
readonly commitmentAmount?: string;
|
||||
/** @description Nominated liquidity fee factor, which is an input to the calculation of taker fees on the market, as per setting fees and rewarding liquidity providers. */
|
||||
readonly fee?: string;
|
||||
/** @description Market ID for the order. */
|
||||
/** @description Market ID for the order, required field. */
|
||||
readonly marketId?: string;
|
||||
/** @description Reference to be added to every order created out of this liquidity provision submission. */
|
||||
/** @description Reference to be added to every order created out of this liquidityProvisionSubmission. */
|
||||
readonly reference?: string;
|
||||
/** @description Set of liquidity sell orders to meet the liquidity provision obligation. */
|
||||
readonly sells?: readonly components['schemas']['vegaLiquidityOrder'][];
|
||||
@@ -602,6 +530,15 @@ export interface components {
|
||||
| 'TYPE_STAKE_TOTAL_SUPPLY'
|
||||
| 'TYPE_SIGNER_THRESHOLD_SET'
|
||||
| 'TYPE_GOVERNANCE_VALIDATE_ASSET';
|
||||
/** Specific details for a one off transfer */
|
||||
readonly v1OneOffTransfer: {
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Unix timestamp in nanoseconds. Time at which the
|
||||
* transfer should be delivered into the To account.
|
||||
*/
|
||||
readonly deliverOn?: string;
|
||||
};
|
||||
/** Command to submit new Oracle data from third party providers */
|
||||
readonly v1OracleDataSubmission: {
|
||||
/**
|
||||
@@ -659,12 +596,10 @@ export interface components {
|
||||
readonly v1OrderSubmission: {
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Timestamp in Unix nanoseconds for when the order will expire,
|
||||
* @description Timestamp for when the order will expire, in nanoseconds,
|
||||
* required field only for `Order.TimeInForce`.TIME_IN_FORCE_GTT`.
|
||||
*/
|
||||
readonly expiresAt?: string;
|
||||
/** @description Parameters used to specify an iceberg order. */
|
||||
readonly icebergOpts?: components['schemas']['v1IcebergOpts'];
|
||||
/** @description Market ID for the order, required field. */
|
||||
readonly marketId?: string;
|
||||
/** @description Used to specify the details for a pegged order. */
|
||||
@@ -764,6 +699,23 @@ export interface components {
|
||||
readonly v1PubKey: {
|
||||
readonly key?: string;
|
||||
};
|
||||
/** Specific details for a recurring transfer */
|
||||
readonly v1RecurringTransfer: {
|
||||
/** @description Optional parameter defining how a transfer is dispatched. */
|
||||
readonly dispatchStrategy?: components['schemas']['vegaDispatchStrategy'];
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Last epoch at which this transfer shall be paid.
|
||||
*/
|
||||
readonly endEpoch?: string;
|
||||
/** @description Factor needs to be > 0. */
|
||||
readonly factor?: string;
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description First epoch from which this transfer shall be paid.
|
||||
*/
|
||||
readonly startEpoch?: string;
|
||||
};
|
||||
/**
|
||||
* @description Signature to authenticate a transaction and to be verified by the Vega
|
||||
* network.
|
||||
@@ -780,7 +732,7 @@ export interface components {
|
||||
readonly version?: number;
|
||||
};
|
||||
readonly v1Signer: {
|
||||
/** @description In case of an open oracle - Ethereum address will be submitted. */
|
||||
/** In case of an open oracle - Ethereum address will be submitted */
|
||||
readonly ethAddress?: components['schemas']['v1ETHAddress'];
|
||||
/**
|
||||
* @description List of authorized public keys that signed the data for this
|
||||
@@ -794,55 +746,6 @@ export interface components {
|
||||
/** @description State value proposal details. */
|
||||
readonly proposal?: components['schemas']['vegaStateValueProposal'];
|
||||
};
|
||||
/** Price and expiry configuration for a stop order */
|
||||
readonly v1StopOrderSetup: {
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Optional expiry timestamp.
|
||||
*/
|
||||
readonly expiresAt?: string;
|
||||
/** @description Strategy to adopt if the expiry time is reached. */
|
||||
readonly expiryStrategy?: components['schemas']['StopOrderExpiryStrategy'];
|
||||
/** @description Order to be submitted once the trigger is breached. */
|
||||
readonly orderSubmission?: components['schemas']['v1OrderSubmission'];
|
||||
/** @description Fixed price at which the order will be submitted. */
|
||||
readonly price?: string;
|
||||
/** @description Trailing percentage at which the order will be submitted. */
|
||||
readonly trailingPercentOffset?: string;
|
||||
};
|
||||
/**
|
||||
* Cancel a stop order.
|
||||
* The following combinations are available:
|
||||
* Empty object will cancel all stop orders for the party
|
||||
* Market ID alone will cancel all stop orders in a market
|
||||
* Market ID and order ID will cancel a specific stop order in a market
|
||||
* If the stop order is part of an OCO, both stop orders will be cancelled
|
||||
*/
|
||||
readonly v1StopOrdersCancellation: {
|
||||
/** @description Optional market ID. */
|
||||
readonly marketId?: string;
|
||||
/** @description Optional order ID. */
|
||||
readonly stopOrderId?: string;
|
||||
};
|
||||
/**
|
||||
* Stop order submission submits stops orders.
|
||||
* It is possible to make a single stop order submission by
|
||||
* specifying a single direction,
|
||||
* or an OCO (One Cancels the Other) stop order submission
|
||||
* by specifying a configuration for both directions
|
||||
*/
|
||||
readonly v1StopOrdersSubmission: {
|
||||
/**
|
||||
* @description Stop order that will be triggered
|
||||
* if the price falls below a given trigger price.
|
||||
*/
|
||||
readonly fallsBelow?: components['schemas']['v1StopOrderSetup'];
|
||||
/**
|
||||
* @description Stop order that will be triggered
|
||||
* if the price rises above a given trigger price.
|
||||
*/
|
||||
readonly risesAbove?: components['schemas']['v1StopOrderSetup'];
|
||||
};
|
||||
readonly v1UndelegateSubmission: {
|
||||
/**
|
||||
* @description Optional, if not specified = ALL.
|
||||
@@ -919,7 +822,6 @@ export interface components {
|
||||
* - ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES: Per asset reward account for fees received by makers
|
||||
* - ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES: Per asset reward account for fees received by liquidity providers
|
||||
* - ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS: Per asset reward account for market proposers when the market goes above some trading threshold
|
||||
* - ACCOUNT_TYPE_HOLDING: Per asset account for holding in-flight unfilled orders' funds
|
||||
* @default ACCOUNT_TYPE_UNSPECIFIED
|
||||
* @enum {string}
|
||||
*/
|
||||
@@ -940,8 +842,7 @@ export interface components {
|
||||
| 'ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES'
|
||||
| 'ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES'
|
||||
| 'ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES'
|
||||
| 'ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS'
|
||||
| 'ACCOUNT_TYPE_HOLDING';
|
||||
| 'ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS';
|
||||
/** Vega representation of an external asset */
|
||||
readonly vegaAssetDetails: {
|
||||
/** @description Vega built-in asset. */
|
||||
@@ -997,14 +898,6 @@ export interface components {
|
||||
/** @description Vega network internal asset ID. */
|
||||
readonly vegaAssetId?: string;
|
||||
};
|
||||
readonly vegaCancelTransfer: {
|
||||
/** Configuration for cancellation of a governance-initiated transfer */
|
||||
readonly changes?: components['schemas']['vegaCancelTransferConfiguration'];
|
||||
};
|
||||
readonly vegaCancelTransferConfiguration: {
|
||||
/** @description ID of the governance transfer proposal. */
|
||||
readonly transferId?: string;
|
||||
};
|
||||
/**
|
||||
* @description DataSourceDefinition represents the top level object that deals with data sources.
|
||||
* DataSourceDefinition can be external or internal, with whatever number of data sources are defined
|
||||
@@ -1019,7 +912,6 @@ export interface components {
|
||||
* It contains one of any of the defined `SourceType` variants.
|
||||
*/
|
||||
readonly vegaDataSourceDefinitionExternal: {
|
||||
readonly ethCall?: components['schemas']['vegaEthCallSpec'];
|
||||
readonly oracle?: components['schemas']['vegaDataSourceSpecConfiguration'];
|
||||
};
|
||||
/**
|
||||
@@ -1255,64 +1147,6 @@ export interface components {
|
||||
/** @description Address into which the bridge will release the funds. */
|
||||
readonly receiverAddress?: string;
|
||||
};
|
||||
/** @description Specifies a data source that derives its content from calling a read method on an Ethereum contract. */
|
||||
readonly vegaEthCallSpec: {
|
||||
/** @description The ABI of that contract. */
|
||||
readonly abi?: readonly Record<string, never>[];
|
||||
/** @description Ethereum address of the contract to call. */
|
||||
readonly address?: string;
|
||||
/**
|
||||
* @description List of arguments to pass to method call.
|
||||
* Protobuf 'Value' wraps an arbitrary JSON type that is mapped to an Ethereum type according to the ABI.
|
||||
*/
|
||||
readonly args?: readonly Record<string, never>[];
|
||||
/** @description Name of the method on the contract to call. */
|
||||
readonly method?: string;
|
||||
/** @description Conditions for determining when to call the contract method. */
|
||||
readonly trigger?: components['schemas']['vegaEthCallTrigger'];
|
||||
};
|
||||
/** @description Determines when the contract method should be called. */
|
||||
readonly vegaEthCallTrigger: {
|
||||
readonly timeTrigger?: components['schemas']['vegaEthTimeTrigger'];
|
||||
};
|
||||
/** Result of calling an arbitrary Ethereum contract method */
|
||||
readonly vegaEthContractCallEvent: {
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Ethereum block height.
|
||||
*/
|
||||
readonly blockHeight?: string;
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Ethereum block time in Unix seconds.
|
||||
*/
|
||||
readonly blockTime?: string;
|
||||
/**
|
||||
* Format: byte
|
||||
* @description Result of contract call, packed according to the ABI stored in the associated data source spec.
|
||||
*/
|
||||
readonly result?: string;
|
||||
/** @description ID of the data source spec that triggered this contract call. */
|
||||
readonly specId?: string;
|
||||
};
|
||||
/** @description Trigger for an Ethereum call based on the Ethereum block timestamp. Can be one-off or repeating. */
|
||||
readonly vegaEthTimeTrigger: {
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Repeat the call every n seconds after the inital call. If no time for initial call was specified, begin repeating immediately.
|
||||
*/
|
||||
readonly every?: string;
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Trigger when the Ethereum time is greater or equal to this time, in Unix seconds.
|
||||
*/
|
||||
readonly initial?: string;
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description If repeating, stop once Ethereum time is greater than this time, in Unix seconds. If not set, then repeat indefinitely.
|
||||
*/
|
||||
readonly until?: string;
|
||||
};
|
||||
/** Future product configuration */
|
||||
readonly vegaFutureProduct: {
|
||||
/** @description Binding between the data source spec and the settlement data. */
|
||||
@@ -1326,14 +1160,6 @@ export interface components {
|
||||
/** @description Asset ID for the product's settlement asset. */
|
||||
readonly settlementAsset?: string;
|
||||
};
|
||||
/**
|
||||
* @default GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED
|
||||
* @enum {string}
|
||||
*/
|
||||
readonly vegaGovernanceTransferType:
|
||||
| 'GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED'
|
||||
| 'GOVERNANCE_TRANSFER_TYPE_ALL_OR_NOTHING'
|
||||
| 'GOVERNANCE_TRANSFER_TYPE_BEST_EFFORT';
|
||||
/** Instrument configuration */
|
||||
readonly vegaInstrumentConfiguration: {
|
||||
/** @description Instrument code, human-readable shortcode used to describe the instrument. */
|
||||
@@ -1342,8 +1168,6 @@ export interface components {
|
||||
readonly future?: components['schemas']['vegaFutureProduct'];
|
||||
/** @description Instrument name. */
|
||||
readonly name?: string;
|
||||
/** @description Spot. */
|
||||
readonly spot?: components['schemas']['vegaSpotProduct'];
|
||||
};
|
||||
readonly vegaKeyValueBundle: {
|
||||
readonly key?: string;
|
||||
@@ -1434,14 +1258,14 @@ export interface components {
|
||||
/** @description Configuration of the new market. */
|
||||
readonly changes?: components['schemas']['vegaNewMarketConfiguration'];
|
||||
};
|
||||
/** Configuration for a new futures market on Vega */
|
||||
/** Configuration for a new market on Vega */
|
||||
readonly vegaNewMarketConfiguration: {
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Decimal places used for the new futures market, sets the smallest price increment on the book.
|
||||
* @description Decimal places used for the new market, sets the smallest price increment on the book.
|
||||
*/
|
||||
readonly decimalPlaces?: string;
|
||||
/** @description New futures market instrument configuration. */
|
||||
/** @description New market instrument configuration. */
|
||||
readonly instrument?: components['schemas']['vegaInstrumentConfiguration'];
|
||||
/** @description Linear slippage factor is used to cap the slippage component of maintenance margin - it is applied to the slippage volume. */
|
||||
readonly linearSlippageFactor?: string;
|
||||
@@ -1454,11 +1278,11 @@ export interface components {
|
||||
* price levels over which automated liquidity provision orders will be deployed.
|
||||
*/
|
||||
readonly lpPriceRange?: string;
|
||||
/** @description Optional new futures market metadata, tags. */
|
||||
/** @description Optional new market metadata, tags. */
|
||||
readonly metadata?: readonly string[];
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Decimal places for order sizes, sets what size the smallest order / position on the futures market can be.
|
||||
* @description Decimal places for order sizes, sets what size the smallest order / position on the market can be.
|
||||
*/
|
||||
readonly positionDecimalPlaces?: string;
|
||||
/** @description Price monitoring parameters. */
|
||||
@@ -1467,80 +1291,6 @@ export interface components {
|
||||
readonly quadraticSlippageFactor?: string;
|
||||
/** @description Simple risk model parameters, valid only if MODEL_SIMPLE is selected. */
|
||||
readonly simple?: components['schemas']['vegaSimpleModelParams'];
|
||||
/** @description Successor configuration. If this proposal is meant to succeed a given market, then this should be set. */
|
||||
readonly successor?: components['schemas']['vegaSuccessorConfiguration'];
|
||||
};
|
||||
/** New spot market on Vega */
|
||||
readonly vegaNewSpotMarket: {
|
||||
/** @description Configuration of the new spot market. */
|
||||
readonly changes?: components['schemas']['vegaNewSpotMarketConfiguration'];
|
||||
};
|
||||
/** Configuration for a new spot market on Vega */
|
||||
readonly vegaNewSpotMarketConfiguration: {
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Decimal places used for the new spot market, sets the smallest price increment on the book.
|
||||
*/
|
||||
readonly decimalPlaces?: string;
|
||||
/** @description New spot market instrument configuration. */
|
||||
readonly instrument?: components['schemas']['vegaInstrumentConfiguration'];
|
||||
/** @description Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected. */
|
||||
readonly logNormal?: components['schemas']['vegaLogNormalRiskModel'];
|
||||
/** @description Optional new spot market metadata, tags. */
|
||||
readonly metadata?: readonly string[];
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Decimal places for order sizes, sets what size the smallest order / position on the spot market can be.
|
||||
*/
|
||||
readonly positionDecimalPlaces?: string;
|
||||
/** @description Price monitoring parameters. */
|
||||
readonly priceMonitoringParameters?: components['schemas']['vegaPriceMonitoringParameters'];
|
||||
/** @description Simple risk model parameters, valid only if MODEL_SIMPLE is selected. */
|
||||
readonly simple?: components['schemas']['vegaSimpleModelParams'];
|
||||
/** @description Specifies parameters related to target stake calculation. */
|
||||
readonly targetStakeParameters?: components['schemas']['vegaTargetStakeParameters'];
|
||||
};
|
||||
/** New governance transfer */
|
||||
readonly vegaNewTransfer: {
|
||||
/** @description Configuration for a new transfer. */
|
||||
readonly changes?: components['schemas']['vegaNewTransferConfiguration'];
|
||||
};
|
||||
readonly vegaNewTransferConfiguration: {
|
||||
/** Maximum amount to transfer */
|
||||
readonly amount?: string;
|
||||
/** ID of asset to transfer */
|
||||
readonly asset?: string;
|
||||
/**
|
||||
* Specifies the account to transfer to, depending on the account type:
|
||||
* Network treasury: leave empty
|
||||
* Party: party's public key
|
||||
* Market insurance pool: market ID
|
||||
*/
|
||||
readonly destination?: string;
|
||||
/** Specifies the account type to transfer to: reward pool, party, network insurance pool, market insurance pool */
|
||||
readonly destinationType?: components['schemas']['vegaAccountType'];
|
||||
/** Maximum fraction of the source account's balance to transfer as a decimal - i.e. 0.1 = 10% of the balance */
|
||||
readonly fractionOfBalance?: string;
|
||||
readonly oneOff?: components['schemas']['vegaOneOffTransfer'];
|
||||
readonly recurring?: components['schemas']['vegaRecurringTransfer'];
|
||||
/** If network treasury, field is empty, otherwise uses the market ID */
|
||||
readonly source?: string;
|
||||
/** Source account type, such as network treasury, market insurance pool */
|
||||
readonly sourceType?: components['schemas']['vegaAccountType'];
|
||||
/**
|
||||
* "All or nothing" or "best effort":
|
||||
* All or nothing: Transfers the specified amount or does not transfer anything
|
||||
* Best effort: Transfers the specified amount or the max allowable amount if this is less than the specified amount
|
||||
*/
|
||||
readonly transferType?: components['schemas']['vegaGovernanceTransferType'];
|
||||
};
|
||||
/** Specific details for a one off transfer */
|
||||
readonly vegaOneOffTransfer: {
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Timestamp in Unix nanoseconds for when the transfer should be delivered into the receiver's account.
|
||||
*/
|
||||
readonly deliverOn?: string;
|
||||
};
|
||||
/**
|
||||
* Type values for an order
|
||||
@@ -1619,8 +1369,6 @@ export interface components {
|
||||
};
|
||||
/** Terms for a governance proposal on Vega */
|
||||
readonly vegaProposalTerms: {
|
||||
/** @description Cancel a governance transfer. */
|
||||
readonly cancelTransfer?: components['schemas']['vegaCancelTransfer'];
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Timestamp as Unix time in seconds when voting closes for this proposal,
|
||||
@@ -1640,39 +1388,20 @@ export interface components {
|
||||
* and can be used to gauge community sentiment.
|
||||
*/
|
||||
readonly newFreeform?: components['schemas']['vegaNewFreeform'];
|
||||
/** @description Proposal change for creating new futures market on Vega. */
|
||||
/** @description Proposal change for creating new market on Vega. */
|
||||
readonly newMarket?: components['schemas']['vegaNewMarket'];
|
||||
/** @description Proposal change for creating new spot market on Vega. */
|
||||
readonly newSpotMarket?: components['schemas']['vegaNewSpotMarket'];
|
||||
/** @description Proposal change for a governance transfer. */
|
||||
readonly newTransfer?: components['schemas']['vegaNewTransfer'];
|
||||
/** @description Proposal change for updating an asset. */
|
||||
readonly updateAsset?: components['schemas']['vegaUpdateAsset'];
|
||||
/** @description Proposal change for modifying an existing futures market on Vega. */
|
||||
/** @description Proposal change for modifying an existing market on Vega. */
|
||||
readonly updateMarket?: components['schemas']['vegaUpdateMarket'];
|
||||
/** @description Proposal change for updating Vega network parameters. */
|
||||
readonly updateNetworkParameter?: components['schemas']['vegaUpdateNetworkParameter'];
|
||||
/** @description Proposal change for modifying an existing spot market on Vega. */
|
||||
readonly updateSpotMarket?: components['schemas']['vegaUpdateSpotMarket'];
|
||||
/**
|
||||
* Format: int64
|
||||
* @description Validation timestamp as Unix time in seconds.
|
||||
*/
|
||||
readonly validationTimestamp?: string;
|
||||
};
|
||||
/** Specific details for a recurring transfer */
|
||||
readonly vegaRecurringTransfer: {
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description Last epoch at which this transfer shall be paid.
|
||||
*/
|
||||
readonly endEpoch?: string;
|
||||
/**
|
||||
* Format: uint64
|
||||
* @description First epoch from which this transfer shall be paid.
|
||||
*/
|
||||
readonly startEpoch?: string;
|
||||
};
|
||||
readonly vegaScalarValue: {
|
||||
readonly value?: string;
|
||||
};
|
||||
@@ -1713,15 +1442,6 @@ export interface components {
|
||||
*/
|
||||
readonly probabilityOfTrading?: number;
|
||||
};
|
||||
/** Spot product configuration */
|
||||
readonly vegaSpotProduct: {
|
||||
/** @description Base asset ID. */
|
||||
readonly baseAsset?: string;
|
||||
/** @description Product name. */
|
||||
readonly name?: string;
|
||||
/** @description Quote asset ID. */
|
||||
readonly quoteAsset?: string;
|
||||
};
|
||||
readonly vegaStakeDeposited: {
|
||||
/** @description Amount deposited as an unsigned base 10 integer scaled to the asset's decimal places. */
|
||||
readonly amount?: string;
|
||||
@@ -1787,13 +1507,6 @@ export interface components {
|
||||
readonly scalarVal?: components['schemas']['vegaScalarValue'];
|
||||
readonly vectorVal?: components['schemas']['vegaVectorValue'];
|
||||
};
|
||||
/** @description Configuration required to turn a new market proposal in to a successor market proposal. */
|
||||
readonly vegaSuccessorConfiguration: {
|
||||
/** @description A decimal value between or equal to 0 and 1, specifying the fraction of the insurance pool balance that is carried over from the parent market to the successor. */
|
||||
readonly insurancePoolFraction?: string;
|
||||
/** @description ID of the market that the successor should take over from. */
|
||||
readonly parentMarketId?: string;
|
||||
};
|
||||
/** TargetStakeParameters contains parameters used in target stake calculation */
|
||||
readonly vegaTargetStakeParameters: {
|
||||
/**
|
||||
@@ -1834,14 +1547,14 @@ export interface components {
|
||||
};
|
||||
/** Update an existing market on Vega */
|
||||
readonly vegaUpdateMarket: {
|
||||
/** @description Updated configuration of the futures market. */
|
||||
/** @description Updated configuration of the market. */
|
||||
readonly changes?: components['schemas']['vegaUpdateMarketConfiguration'];
|
||||
/** @description Market ID the update is for. */
|
||||
readonly marketId?: string;
|
||||
};
|
||||
/** Configuration to update a futures market on Vega */
|
||||
/** Configuration to update a market on Vega */
|
||||
readonly vegaUpdateMarketConfiguration: {
|
||||
/** @description Updated futures market instrument configuration. */
|
||||
/** @description Updated market instrument configuration. */
|
||||
readonly instrument?: components['schemas']['vegaUpdateInstrumentConfiguration'];
|
||||
/** @description Linear slippage factor is used to cap the slippage component of maintenance margin - it is applied to the slippage volume. */
|
||||
readonly linearSlippageFactor?: string;
|
||||
@@ -1854,7 +1567,7 @@ export interface components {
|
||||
* price levels over which automated liquidity provision orders will be deployed.
|
||||
*/
|
||||
readonly lpPriceRange?: string;
|
||||
/** @description Optional futures market metadata, tags. */
|
||||
/** @description Optional market metadata, tags. */
|
||||
readonly metadata?: readonly string[];
|
||||
/** @description Price monitoring parameters. */
|
||||
readonly priceMonitoringParameters?: components['schemas']['vegaPriceMonitoringParameters'];
|
||||
@@ -1868,26 +1581,6 @@ export interface components {
|
||||
/** @description The network parameter to update. */
|
||||
readonly changes?: components['schemas']['vegaNetworkParameter'];
|
||||
};
|
||||
/** Update an existing spot market on Vega */
|
||||
readonly vegaUpdateSpotMarket: {
|
||||
/** @description Updated configuration of the spot market. */
|
||||
readonly changes?: components['schemas']['vegaUpdateSpotMarketConfiguration'];
|
||||
/** @description Market ID the update is for. */
|
||||
readonly marketId?: string;
|
||||
};
|
||||
/** Configuration to update a spot market on Vega */
|
||||
readonly vegaUpdateSpotMarketConfiguration: {
|
||||
/** @description Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected. */
|
||||
readonly logNormal?: components['schemas']['vegaLogNormalRiskModel'];
|
||||
/** @description Optional spot market metadata, tags. */
|
||||
readonly metadata?: readonly string[];
|
||||
/** @description Price monitoring parameters. */
|
||||
readonly priceMonitoringParameters?: components['schemas']['vegaPriceMonitoringParameters'];
|
||||
/** @description Simple risk model parameters, valid only if MODEL_SIMPLE is selected. */
|
||||
readonly simple?: components['schemas']['vegaSimpleModelParams'];
|
||||
/** @description Specifies parameters related to target stake calculation. */
|
||||
readonly targetStakeParameters?: components['schemas']['vegaTargetStakeParameters'];
|
||||
};
|
||||
readonly vegaVectorValue: {
|
||||
readonly value?: readonly string[];
|
||||
};
|
||||
@@ -1916,12 +1609,12 @@ export interface components {
|
||||
export type external = Record<string, never>;
|
||||
|
||||
export interface operations {
|
||||
/**
|
||||
* Info
|
||||
* @description Get information about the block explorer.
|
||||
* Response contains a semver formatted version of the data node and the commit hash, from which the block explorer was built
|
||||
*/
|
||||
BlockExplorer_Info: {
|
||||
/**
|
||||
* Info
|
||||
* @description Get information about the block explorer.
|
||||
* Response contains a semver formatted version of the data node and the commit hash, from which the block explorer was built
|
||||
*/
|
||||
responses: {
|
||||
/** @description A successful response. */
|
||||
200: {
|
||||
@@ -1937,38 +1630,19 @@ export interface operations {
|
||||
};
|
||||
};
|
||||
};
|
||||
/**
|
||||
* List transactions
|
||||
* @description List transactions from the Vega blockchain
|
||||
*/
|
||||
BlockExplorer_ListTransactions: {
|
||||
parameters: {
|
||||
query?: {
|
||||
/**
|
||||
* @description Number of transactions to be returned from the blockchain.
|
||||
* This is deprecated, use first and last instead.
|
||||
*/
|
||||
/**
|
||||
* List transactions
|
||||
* @description List transactions from the Vega blockchain
|
||||
*/
|
||||
parameters?: {
|
||||
/** @description Number of transactions to be returned from the blockchain. */
|
||||
/** @description Optional cursor to paginate the request. */
|
||||
/** @description Optional cursor to paginate the request. */
|
||||
readonly query?: {
|
||||
limit?: number;
|
||||
/** @description Optional cursor to paginate the request. */
|
||||
before?: string;
|
||||
/** @description Optional cursor to paginate the request. */
|
||||
after?: string;
|
||||
/** @description Transaction command types filter, for listing transactions with specified command types. */
|
||||
cmdTypes?: readonly string[];
|
||||
/** @description Transaction command types exclusion filter, for listing all the transactions except the ones with specified command types. */
|
||||
excludeCmdTypes?: readonly string[];
|
||||
/** @description Party IDs filter, can be sender or receiver. */
|
||||
parties?: readonly string[];
|
||||
/**
|
||||
* @description Number of transactions to be returned from the blockchain. Use in conjunction with the `after` cursor to paginate forwards.
|
||||
* On its own, this will return the first `first` transactions.
|
||||
*/
|
||||
first?: number;
|
||||
/**
|
||||
* @description Number of transactions to be returned from the blockchain. Use in conjunction with the `before` cursor to paginate backwards.
|
||||
* On its own, this will return the last `last` transactions.
|
||||
*/
|
||||
last?: number;
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
@@ -1986,14 +1660,14 @@ export interface operations {
|
||||
};
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Get transaction
|
||||
* @description Get a transaction from the Vega blockchain
|
||||
*/
|
||||
BlockExplorer_GetTransaction: {
|
||||
/**
|
||||
* Get transaction
|
||||
* @description Get a transaction from the Vega blockchain
|
||||
*/
|
||||
parameters: {
|
||||
path: {
|
||||
/** @description Hash of the transaction */
|
||||
/** @description Hash of the transaction */
|
||||
readonly path: {
|
||||
hash: string;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { join } = require('path');
|
||||
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
|
||||
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
|
||||
const theme = require('../../libs/tailwindcss-config/src/theme');
|
||||
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"types": ["node"]
|
||||
},
|
||||
"files": [
|
||||
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nx/react/typings/image.d.ts"
|
||||
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"**/*.spec.ts",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"jest.config.ts"
|
||||
],
|
||||
"files": [
|
||||
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nx/react/typings/image.d.ts"
|
||||
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const { composePlugins, withNx } = require('@nx/webpack');
|
||||
const { withReact } = require('@nx/react');
|
||||
const SentryPlugin = require('@sentry/webpack-plugin');
|
||||
|
||||
module.exports = composePlugins(withNx(), withReact(), (config) => {
|
||||
module.exports = (config, context) => {
|
||||
const additionalPlugins = process.env.SENTRY_AUTH_TOKEN
|
||||
? [
|
||||
new SentryPlugin({
|
||||
@@ -15,6 +13,5 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
|
||||
return {
|
||||
...config,
|
||||
plugins: [...additionalPlugins, ...config.plugins],
|
||||
ignoreWarnings: [/Failed to parse source map/],
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "governance-e2e",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/governance-e2e/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"e2e": {
|
||||
"executor": "@nx/cypress:cypress",
|
||||
"executor": "@nrwl/cypress:cypress",
|
||||
"options": {
|
||||
"cypressConfig": "apps/governance-e2e/cypress.config.js",
|
||||
"devServerTarget": "governance:serve"
|
||||
@@ -17,14 +16,14 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/governance-e2e/**/*.{js,ts}"]
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
"options": {
|
||||
"command": "yarn tsc --project ./apps/governance-e2e/"
|
||||
|
||||
@@ -295,7 +295,7 @@ context(
|
||||
|
||||
// Will fail if run after 'Able to submit update market proposal and vote for proposal'
|
||||
// 3002-PROP-022
|
||||
it.skip('Unable to submit update market proposal without equity-like share in the market', function () {
|
||||
it('Unable to submit update market proposal without equity-like share in the market', function () {
|
||||
switchVegaWalletPubKey();
|
||||
stakingPageAssociateTokens('1');
|
||||
goToMakeNewProposal(governanceProposalType.UPDATE_MARKET);
|
||||
|
||||
@@ -116,6 +116,7 @@ context(
|
||||
cy.getByTestId(amountInput).click().type('120');
|
||||
cy.getByTestId(submitWithdrawalButton).click();
|
||||
});
|
||||
// assert withdrawal request
|
||||
cy.getByTestId(toast)
|
||||
.first(txTimeout)
|
||||
.should('contain.text', 'Funds unlocked')
|
||||
|
||||
@@ -14,9 +14,6 @@ const proposalDocsLink = 'proposal-docs-link';
|
||||
const proposalDocumentationLink = 'proposal-documentation-link';
|
||||
const connectToVegaWalletButton = 'connect-to-vega-wallet-btn';
|
||||
const governanceDocsUrl = 'https://vega.xyz/governance';
|
||||
const networkUpgradeProposalListItem = 'protocol-upgrade-proposals-list-item';
|
||||
const closedProposals = 'closed-proposals';
|
||||
const closedProposalToggle = 'closed-proposals-toggle-networkUpgrades';
|
||||
|
||||
context(
|
||||
'Governance Page - verify elements on page',
|
||||
@@ -130,7 +127,7 @@ context(
|
||||
mockNetworkUpgradeProposal();
|
||||
cy.visit('/');
|
||||
cy.getByTestId('home-proposal-list').within(() => {
|
||||
cy.getByTestId(networkUpgradeProposalListItem).should('exist');
|
||||
cy.getByTestId('protocol-upgrade-proposals-list-item').should('exist');
|
||||
cy.getByTestId('protocol-upgrade-proposal-title').should(
|
||||
'have.text',
|
||||
'Vega release v1'
|
||||
@@ -144,7 +141,11 @@ context(
|
||||
cy.getByTestId('open-proposals').within(() => {
|
||||
cy.get('li')
|
||||
.eq(0)
|
||||
.should('have.attr', 'data-testid', networkUpgradeProposalListItem)
|
||||
.should(
|
||||
'have.attr',
|
||||
'data-testid',
|
||||
'protocol-upgrade-proposals-list-item'
|
||||
)
|
||||
.within(() => {
|
||||
cy.get('h2').should('have.text', 'Vega release v1');
|
||||
cy.getByTestId('protocol-upgrade-proposal-type').should(
|
||||
@@ -165,19 +166,19 @@ context(
|
||||
);
|
||||
});
|
||||
});
|
||||
cy.getByTestId(closedProposals).within(() => {
|
||||
cy.getByTestId(networkUpgradeProposalListItem).should('not.exist');
|
||||
});
|
||||
cy.getByTestId(closedProposalToggle).click();
|
||||
cy.getByTestId(closedProposals).within(() => {
|
||||
cy.getByTestId(networkUpgradeProposalListItem).should('have.length', 1);
|
||||
cy.get('[data-testid="closed-proposals-toggle-networkUpgrades"]').click();
|
||||
cy.getByTestId('closed-proposals').within(() => {
|
||||
cy.getByTestId('protocol-upgrade-proposals-list-item').should(
|
||||
'have.length',
|
||||
1
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should see details of network upgrade proposal', function () {
|
||||
mockNetworkUpgradeProposal();
|
||||
navigateTo(navigation.proposals);
|
||||
cy.getByTestId(networkUpgradeProposalListItem)
|
||||
cy.getByTestId('protocol-upgrade-proposals-list-item')
|
||||
.first()
|
||||
.find('[data-testid="view-proposal-btn"]')
|
||||
.click();
|
||||
@@ -214,18 +215,5 @@ context(
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('filtering proposal should not display any network upgrade proposals', function () {
|
||||
const proposalId =
|
||||
'd848fc7881f13d366df5f61ab139d5fcfa72bf838151bb51b54381870e357931';
|
||||
|
||||
mockNetworkUpgradeProposal();
|
||||
navigateTo(navigation.proposals);
|
||||
cy.get('[data-testid="proposal-filter-toggle"]').click();
|
||||
cy.get('[data-testid="filter-input"]').type(proposalId);
|
||||
cy.getByTestId(closedProposals).should('have.length', 1);
|
||||
cy.getByTestId(networkUpgradeProposalListItem).should('not.exist');
|
||||
cy.getByTestId(closedProposalToggle).should('not.exist');
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -340,7 +340,7 @@ context(
|
||||
.contains(name)
|
||||
.parent()
|
||||
.siblings()
|
||||
.should((elementAmount) => {
|
||||
.then((elementAmount) => {
|
||||
const displayedAmount = parseFloat(elementAmount.text());
|
||||
expect(displayedAmount).be.gte(expectedAmount);
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@nx/react/babel",
|
||||
"@nrwl/react/babel",
|
||||
{
|
||||
"runtime": "automatic"
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# App configuration variables
|
||||
NX_VEGA_ENV=MAINNET-MIRROR
|
||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/mainnet-mirror/vegawallet-mainnet-mirror.toml
|
||||
NX_VEGA_URL=https://api.mainnet-mirror.vega.rocks/graphql
|
||||
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz","MAINNET-MIRROR":"https://governance.mainnet-mirror.vega.rocks","STAGNET1":"https://trading.stagnet1.vega.rocks"}'
|
||||
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
||||
NX_VEGA_EXPLORER_URL=https://explorer.mainnet-mirror.vega.rocks
|
||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
||||
NX_DELEGATIONS_PAGINATION=50
|
||||
NX_TRANCHES_SERVICE_URL=https://tranches-mainnet-mirror-k8s.ops.vega.xyz
|
||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/mainnet/announcements.json
|
||||
NX_VEGA_REST_URL=https://api.mainnet-mirror.vega.rocks/api/v2/
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*", "__generated__"],
|
||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
|
||||
@@ -25,14 +25,13 @@ yarn nx serve governance
|
||||
Example configurations are provided here:
|
||||
|
||||
- [Mainnet](./.env.mainnet)
|
||||
- [Mainnet-mirror](./.env.mainnet-mirror)
|
||||
- [Devnet](./.env.devnet)
|
||||
- [Testnet](./.env.testnet)
|
||||
|
||||
For convenience, you can boot the app injecting one of the configurations above by running:
|
||||
|
||||
```bash
|
||||
yarn env-cmd -f .\apps\governance\.env.{env} yarn nx run governance:serve # e.g. stagnet1
|
||||
yarn nx run governance:serve --env={env} # e.g. stagnet1
|
||||
```
|
||||
|
||||
There are a few different configuration options offered for this app:
|
||||
|
||||
@@ -3,8 +3,8 @@ export default {
|
||||
displayName: 'governance',
|
||||
preset: '../../jest.preset.js',
|
||||
transform: {
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': 'babel-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||
coverageDirectory: '../../coverage/apps/governance',
|
||||
@@ -16,5 +16,6 @@ export default {
|
||||
'**/*.{ts,tsx}',
|
||||
'!**/node_modules/**',
|
||||
'!**/__generated__/**',
|
||||
'!**/__generated___/**',
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "governance",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/governance/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/webpack:webpack",
|
||||
"executor": "./tools/executors/webpack:build",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"defaultConfiguration": "production",
|
||||
"options": {
|
||||
@@ -42,7 +41,7 @@
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/webpack:dev-server",
|
||||
"executor": "./tools/executors/webpack:serve",
|
||||
"options": {
|
||||
"port": 4210,
|
||||
"buildTarget": "governance:build:development",
|
||||
@@ -56,28 +55,22 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/governance/**/*.{ts,tsx,js,jsx}"]
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/apps/governance"],
|
||||
"executor": "@nrwl/jest:jest",
|
||||
"outputs": ["coverage/apps/governance"],
|
||||
"options": {
|
||||
"jestConfig": "apps/governance/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"build-netlify": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"cp apps/governance/netlify.toml netlify.toml",
|
||||
@@ -86,7 +79,7 @@
|
||||
}
|
||||
},
|
||||
"build-spec": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
"options": {
|
||||
"command": "yarn tsc --project ./apps/governance/tsconfig.spec.json"
|
||||
|
||||
@@ -13,6 +13,12 @@ export const VegaWalletDialogs = () => {
|
||||
<>
|
||||
<VegaConnectDialog
|
||||
connectors={Connectors}
|
||||
onChangeOpen={(open) =>
|
||||
appDispatch({
|
||||
type: AppStateActionType.SET_VEGA_WALLET_OVERLAY,
|
||||
isOpen: open,
|
||||
})
|
||||
}
|
||||
riskMessage={<RiskMessage />}
|
||||
/>
|
||||
|
||||
|
||||
@@ -2,18 +2,15 @@ import {
|
||||
RestConnector,
|
||||
JsonRpcConnector,
|
||||
ViewConnector,
|
||||
InjectedConnector,
|
||||
} from '@vegaprotocol/wallet';
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
export const rest = new RestConnector();
|
||||
export const jsonRpc = new JsonRpcConnector();
|
||||
export const injected = new InjectedConnector();
|
||||
export const view = new ViewConnector(urlParams.get('address'));
|
||||
|
||||
export const Connectors = {
|
||||
injected,
|
||||
rest,
|
||||
jsonRpc,
|
||||
view,
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
import * as Types from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
const defaultOptions = {} as const;
|
||||
export type ProposalAssetQueryVariables = Types.Exact<{
|
||||
assetId: Types.Scalars['ID'];
|
||||
}>;
|
||||
|
||||
export type ProposalAssetQuery = {
|
||||
__typename?: 'Query';
|
||||
asset?: {
|
||||
__typename?: 'Asset';
|
||||
status: Types.AssetStatus;
|
||||
source:
|
||||
| { __typename?: 'BuiltinAsset' }
|
||||
| { __typename?: 'ERC20'; contractAddress: string };
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type AssetListBundleQueryVariables = Types.Exact<{
|
||||
assetId: Types.Scalars['ID'];
|
||||
}>;
|
||||
|
||||
export type AssetListBundleQuery = {
|
||||
__typename?: 'Query';
|
||||
erc20ListAssetBundle?: {
|
||||
__typename?: 'Erc20ListAssetBundle';
|
||||
assetSource: string;
|
||||
vegaAssetId: string;
|
||||
nonce: string;
|
||||
signatures: string;
|
||||
} | null;
|
||||
};
|
||||
|
||||
export const ProposalAssetDocument = gql`
|
||||
query ProposalAsset($assetId: ID!) {
|
||||
asset(id: $assetId) {
|
||||
status
|
||||
source {
|
||||
... on ERC20 {
|
||||
contractAddress
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useProposalAssetQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useProposalAssetQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useProposalAssetQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useProposalAssetQuery({
|
||||
* variables: {
|
||||
* assetId: // value for 'assetId'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useProposalAssetQuery(
|
||||
baseOptions: Apollo.QueryHookOptions<
|
||||
ProposalAssetQuery,
|
||||
ProposalAssetQueryVariables
|
||||
>
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useQuery<ProposalAssetQuery, ProposalAssetQueryVariables>(
|
||||
ProposalAssetDocument,
|
||||
options
|
||||
);
|
||||
}
|
||||
export function useProposalAssetLazyQuery(
|
||||
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||
ProposalAssetQuery,
|
||||
ProposalAssetQueryVariables
|
||||
>
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useLazyQuery<ProposalAssetQuery, ProposalAssetQueryVariables>(
|
||||
ProposalAssetDocument,
|
||||
options
|
||||
);
|
||||
}
|
||||
export type ProposalAssetQueryHookResult = ReturnType<
|
||||
typeof useProposalAssetQuery
|
||||
>;
|
||||
export type ProposalAssetLazyQueryHookResult = ReturnType<
|
||||
typeof useProposalAssetLazyQuery
|
||||
>;
|
||||
export type ProposalAssetQueryResult = Apollo.QueryResult<
|
||||
ProposalAssetQuery,
|
||||
ProposalAssetQueryVariables
|
||||
>;
|
||||
export const AssetListBundleDocument = gql`
|
||||
query AssetListBundle($assetId: ID!) {
|
||||
erc20ListAssetBundle(assetId: $assetId) {
|
||||
assetSource
|
||||
vegaAssetId
|
||||
nonce
|
||||
signatures
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useAssetListBundleQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useAssetListBundleQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useAssetListBundleQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useAssetListBundleQuery({
|
||||
* variables: {
|
||||
* assetId: // value for 'assetId'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useAssetListBundleQuery(
|
||||
baseOptions: Apollo.QueryHookOptions<
|
||||
AssetListBundleQuery,
|
||||
AssetListBundleQueryVariables
|
||||
>
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useQuery<AssetListBundleQuery, AssetListBundleQueryVariables>(
|
||||
AssetListBundleDocument,
|
||||
options
|
||||
);
|
||||
}
|
||||
export function useAssetListBundleLazyQuery(
|
||||
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||
AssetListBundleQuery,
|
||||
AssetListBundleQueryVariables
|
||||
>
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useLazyQuery<
|
||||
AssetListBundleQuery,
|
||||
AssetListBundleQueryVariables
|
||||
>(AssetListBundleDocument, options);
|
||||
}
|
||||
export type AssetListBundleQueryHookResult = ReturnType<
|
||||
typeof useAssetListBundleQuery
|
||||
>;
|
||||
export type AssetListBundleLazyQueryHookResult = ReturnType<
|
||||
typeof useAssetListBundleLazyQuery
|
||||
>;
|
||||
export type AssetListBundleQueryResult = Apollo.QueryResult<
|
||||
AssetListBundleQuery,
|
||||
AssetListBundleQueryVariables
|
||||
>;
|
||||
@@ -5,11 +5,13 @@ import { MockedProvider } from '@apollo/client/testing';
|
||||
import type {
|
||||
AssetListBundleQuery,
|
||||
ProposalAssetQuery,
|
||||
} from './__generated__/Asset';
|
||||
import { AssetListBundleDocument } from './__generated__/Asset';
|
||||
import { ProposalAssetDocument } from './__generated__/Asset';
|
||||
} from './__generated___/Asset';
|
||||
import { AssetListBundleDocument } from './__generated___/Asset';
|
||||
import { ProposalAssetDocument } from './__generated___/Asset';
|
||||
import * as Schema from '@vegaprotocol/types';
|
||||
import type { useWeb3React } from '@web3-react/core';
|
||||
import BigNumber from 'bignumber.js';
|
||||
import type { AppState } from '../../../../contexts/app-state/app-state-context';
|
||||
|
||||
const mockUseEthTx = {
|
||||
perform: jest.fn(),
|
||||
@@ -45,6 +47,23 @@ jest.mock('@web3-react/core', () => {
|
||||
};
|
||||
});
|
||||
|
||||
const mockAppState: AppState = {
|
||||
totalAssociated: new BigNumber('50063005'),
|
||||
decimals: 18,
|
||||
totalSupply: new BigNumber(65000000),
|
||||
vegaWalletOverlay: false,
|
||||
vegaWalletManageOverlay: false,
|
||||
transactionOverlay: false,
|
||||
bannerMessage: '',
|
||||
disconnectNotice: false,
|
||||
};
|
||||
|
||||
jest.mock('../../../contexts/app-state/app-state-context', () => ({
|
||||
useAppState: () => ({
|
||||
appState: mockAppState,
|
||||
}),
|
||||
}));
|
||||
|
||||
const ASSET_ID = 'foo';
|
||||
|
||||
const DEFAULT__ASSET: ProposalAssetQuery = {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
useAssetListBundleQuery,
|
||||
useProposalAssetQuery,
|
||||
} from './__generated__/Asset';
|
||||
} from './__generated___/Asset';
|
||||
import { EthWalletContainer } from '../../../../components/eth-wallet-container';
|
||||
|
||||
const useListAsset = (assetId: string) => {
|
||||
|
||||
@@ -91,46 +91,46 @@ query Proposal($proposalId: ID!) {
|
||||
}
|
||||
}
|
||||
}
|
||||
# dataSourceSpecForTradingTermination {
|
||||
# sourceType {
|
||||
# ... on DataSourceDefinitionInternal {
|
||||
# sourceType {
|
||||
# ... on DataSourceSpecConfigurationTime {
|
||||
# conditions {
|
||||
# operator
|
||||
# value
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# ... on DataSourceDefinitionExternal {
|
||||
# sourceType {
|
||||
# ... on DataSourceSpecConfiguration {
|
||||
# signers {
|
||||
# signer {
|
||||
# ... on PubKey {
|
||||
# key
|
||||
# }
|
||||
# ... on ETHAddress {
|
||||
# address
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# filters {
|
||||
# key {
|
||||
# name
|
||||
# type
|
||||
# }
|
||||
# conditions {
|
||||
# operator
|
||||
# value
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
dataSourceSpecForTradingTermination {
|
||||
sourceType {
|
||||
... on DataSourceDefinitionInternal {
|
||||
sourceType {
|
||||
... on DataSourceSpecConfigurationTime {
|
||||
conditions {
|
||||
operator
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on DataSourceDefinitionExternal {
|
||||
sourceType {
|
||||
... on DataSourceSpecConfiguration {
|
||||
signers {
|
||||
signer {
|
||||
... on PubKey {
|
||||
key
|
||||
}
|
||||
... on ETHAddress {
|
||||
address
|
||||
}
|
||||
}
|
||||
}
|
||||
filters {
|
||||
key {
|
||||
name
|
||||
type
|
||||
}
|
||||
conditions {
|
||||
operator
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dataSourceSpecBinding {
|
||||
settlementDataProperty
|
||||
tradingTerminationProperty
|
||||
@@ -203,46 +203,46 @@ query Proposal($proposalId: ID!) {
|
||||
}
|
||||
}
|
||||
}
|
||||
# dataSourceSpecForTradingTermination {
|
||||
# sourceType {
|
||||
# ... on DataSourceDefinitionInternal {
|
||||
# sourceType {
|
||||
# ... on DataSourceSpecConfigurationTime {
|
||||
# conditions {
|
||||
# operator
|
||||
# value
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# ... on DataSourceDefinitionExternal {
|
||||
# sourceType {
|
||||
# ... on DataSourceSpecConfiguration {
|
||||
# signers {
|
||||
# signer {
|
||||
# ... on PubKey {
|
||||
# key
|
||||
# }
|
||||
# ... on ETHAddress {
|
||||
# address
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# filters {
|
||||
# key {
|
||||
# name
|
||||
# type
|
||||
# }
|
||||
# conditions {
|
||||
# operator
|
||||
# value
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
dataSourceSpecForTradingTermination {
|
||||
sourceType {
|
||||
... on DataSourceDefinitionInternal {
|
||||
sourceType {
|
||||
... on DataSourceSpecConfigurationTime {
|
||||
conditions {
|
||||
operator
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on DataSourceDefinitionExternal {
|
||||
sourceType {
|
||||
... on DataSourceSpecConfiguration {
|
||||
signers {
|
||||
signer {
|
||||
... on PubKey {
|
||||
key
|
||||
}
|
||||
... on ETHAddress {
|
||||
address
|
||||
}
|
||||
}
|
||||
}
|
||||
filters {
|
||||
key {
|
||||
name
|
||||
type
|
||||
}
|
||||
conditions {
|
||||
operator
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dataSourceSpecBinding {
|
||||
settlementDataProperty
|
||||
tradingTerminationProperty
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -6,7 +6,7 @@ jest.mock('../../../../../components/connect-to-vega', () => ({
|
||||
ConnectToVega: () => <div data-testid="connect-to-vega" />,
|
||||
}));
|
||||
|
||||
jest.mock('../../../../../components/eth-connect-prompt', () => ({
|
||||
jest.mock('../../../../components/eth-connect-prompt', () => ({
|
||||
EthConnectPrompt: () => <div data-testid="eth-connect-prompt" />,
|
||||
}));
|
||||
|
||||
|
||||
@@ -8,10 +8,9 @@ import { TxState } from '../../../hooks/transaction-reducer';
|
||||
import { useTransaction } from '../../../hooks/use-transaction';
|
||||
import { BigNumber } from '../../../lib/bignumber';
|
||||
import { AssociateInfo } from './associate-info';
|
||||
import { toBigNum } from '@vegaprotocol/utils';
|
||||
import { removeDecimal, toBigNum } from '@vegaprotocol/utils';
|
||||
import type { EthereumConfig } from '@vegaprotocol/web3';
|
||||
import { useBalances } from '../../../lib/balances/balances-store';
|
||||
import { MaxUint256 } from '@ethersproject/constants';
|
||||
|
||||
export const WalletAssociate = ({
|
||||
perform,
|
||||
@@ -43,7 +42,7 @@ export const WalletAssociate = ({
|
||||
} = useTransaction(() => {
|
||||
return token.approve(
|
||||
ethereumConfig.staking_bridge_contract.address,
|
||||
MaxUint256.toString()
|
||||
removeDecimal('1000000', decimals).toString()
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import * as Types from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
const defaultOptions = {} as const;
|
||||
export type NodeDataQueryVariables = Types.Exact<{ [key: string]: never }>;
|
||||
|
||||
export type NodeDataQuery = {
|
||||
__typename?: 'Query';
|
||||
nodeData?: { __typename?: 'NodeData'; stakedTotal: string } | null;
|
||||
};
|
||||
|
||||
export const NodeDataDocument = gql`
|
||||
query NodeData {
|
||||
nodeData {
|
||||
stakedTotal
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useNodeDataQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useNodeDataQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useNodeDataQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useNodeDataQuery({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useNodeDataQuery(
|
||||
baseOptions?: Apollo.QueryHookOptions<NodeDataQuery, NodeDataQueryVariables>
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useQuery<NodeDataQuery, NodeDataQueryVariables>(
|
||||
NodeDataDocument,
|
||||
options
|
||||
);
|
||||
}
|
||||
export function useNodeDataLazyQuery(
|
||||
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||
NodeDataQuery,
|
||||
NodeDataQueryVariables
|
||||
>
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useLazyQuery<NodeDataQuery, NodeDataQueryVariables>(
|
||||
NodeDataDocument,
|
||||
options
|
||||
);
|
||||
}
|
||||
export type NodeDataQueryHookResult = ReturnType<typeof useNodeDataQuery>;
|
||||
export type NodeDataLazyQueryHookResult = ReturnType<
|
||||
typeof useNodeDataLazyQuery
|
||||
>;
|
||||
export type NodeDataQueryResult = Apollo.QueryResult<
|
||||
NodeDataQuery,
|
||||
NodeDataQueryVariables
|
||||
>;
|
||||
@@ -11,7 +11,7 @@ import type { RouteChildProps } from '..';
|
||||
import Routes from '../routes';
|
||||
import { TokenDetails } from './token-details';
|
||||
import { Button } from '@vegaprotocol/ui-toolkit';
|
||||
import { useNodeDataQuery } from './__generated__/NodeData';
|
||||
import { useNodeDataQuery } from './__generated___/NodeData';
|
||||
|
||||
const Home = ({ name }: RouteChildProps) => {
|
||||
useDocumentTitle(name);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { join } = require('path');
|
||||
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
|
||||
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
|
||||
const theme = require('../../libs/tailwindcss-config/src/theme');
|
||||
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"types": ["node"]
|
||||
},
|
||||
"files": [
|
||||
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nx/react/typings/image.d.ts"
|
||||
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"**/*.spec.ts",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"jest.config.ts"
|
||||
],
|
||||
"files": [
|
||||
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nx/react/typings/image.d.ts"
|
||||
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const { composePlugins, withNx } = require('@nx/webpack');
|
||||
const { withReact } = require('@nx/react');
|
||||
const SentryPlugin = require('@sentry/webpack-plugin');
|
||||
|
||||
module.exports = composePlugins(withNx(), withReact(), (config, context) => {
|
||||
module.exports = (config, context) => {
|
||||
const additionalPlugins = process.env.SENTRY_AUTH_TOKEN
|
||||
? [
|
||||
new SentryPlugin({
|
||||
@@ -14,6 +12,5 @@ module.exports = composePlugins(withNx(), withReact(), (config, context) => {
|
||||
return {
|
||||
...config,
|
||||
plugins: [...additionalPlugins, ...config.plugins],
|
||||
ignoreWarnings: [/Failed to parse source map/],
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@nx/react/babel",
|
||||
"@nrwl/react/babel",
|
||||
{
|
||||
"runtime": "automatic"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*", "__generated__"],
|
||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
|
||||
@@ -3,8 +3,8 @@ export default {
|
||||
displayName: 'liquidity-provision-dashboard',
|
||||
preset: '../../jest.preset.js',
|
||||
transform: {
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||
coverageDirectory: '../../coverage/apps/liquidity-provision-dashboard',
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "liquidity-provision-dashboard",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/liquidity-provision-dashboard/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/webpack:webpack",
|
||||
"executor": "@nrwl/web:webpack",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"defaultConfiguration": "production",
|
||||
"options": {
|
||||
@@ -22,7 +21,7 @@
|
||||
],
|
||||
"styles": ["apps/liquidity-provision-dashboard/src/styles.scss"],
|
||||
"scripts": [],
|
||||
"webpackConfig": "@nx/react/plugins/webpack"
|
||||
"webpackConfig": "@nrwl/react/plugins/webpack"
|
||||
},
|
||||
"configurations": {
|
||||
"development": {
|
||||
@@ -48,7 +47,7 @@
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/webpack:dev-server",
|
||||
"executor": "./tools/executors/webpack:serve",
|
||||
"options": {
|
||||
"buildTarget": "liquidity-provision-dashboard:build",
|
||||
"hmr": true,
|
||||
@@ -65,7 +64,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
@@ -74,23 +73,15 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": [
|
||||
"{workspaceRoot}/coverage/apps/liquidity-provision-dashboard"
|
||||
],
|
||||
"executor": "@nrwl/jest:jest",
|
||||
"outputs": ["coverage/apps/liquidity-provision-dashboard"],
|
||||
"options": {
|
||||
"jestConfig": "apps/liquidity-provision-dashboard/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"build-netlify": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"cp apps/liquidity-provision-dashboard/netlify.toml netlify.toml",
|
||||
@@ -99,7 +90,7 @@
|
||||
}
|
||||
},
|
||||
"build-spec": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
"options": {
|
||||
"command": "yarn tsc --project ./apps/liquidity-provision-dashboard/tsconfig.spec.json"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { join } = require('path');
|
||||
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
|
||||
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
|
||||
const theme = require('../../libs/tailwindcss-config/src/theme-lite');
|
||||
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
|
||||
const vegaCustomClassesLite = require('../../libs/tailwindcss-config/src/vega-custom-classes-lite');
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"types": ["node"]
|
||||
},
|
||||
"files": [
|
||||
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nx/react/typings/image.d.ts"
|
||||
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"jest.config.ts",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"**/*.d.ts"
|
||||
],
|
||||
"files": [
|
||||
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nx/react/typings/image.d.ts"
|
||||
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@nx/react/babel",
|
||||
"@nrwl/react/babel",
|
||||
{
|
||||
"runtime": "automatic"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*", "__generated__"],
|
||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
|
||||
@@ -26,7 +26,7 @@ Example configurations are provided here:
|
||||
For convenience, you can boot the app injecting one of the configurations above by running:
|
||||
|
||||
```bash
|
||||
yarn env-cmd -f .\apps\multisig-signer\.env.{env} yarn nx run multisig-signer:serve # e.g. stagnet1
|
||||
yarn nx run multisig-signer:serve --env={env} # e.g. stagnet1
|
||||
```
|
||||
|
||||
There are a few different configuration options offered for this app:
|
||||
|
||||
@@ -3,8 +3,8 @@ export default {
|
||||
displayName: 'multisig-signer',
|
||||
preset: '../../jest.preset.js',
|
||||
transform: {
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': 'babel-jest',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||
coverageDirectory: '../../coverage/apps/multisig-signer',
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "multisig-signer",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/multisig-signer/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/webpack:webpack",
|
||||
"executor": "./tools/executors/webpack:build",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"defaultConfiguration": "production",
|
||||
"options": {
|
||||
@@ -39,7 +38,7 @@
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/webpack:dev-server",
|
||||
"executor": "./tools/executors/webpack:serve",
|
||||
"options": {
|
||||
"port": 3000,
|
||||
"buildTarget": "multisig-signer:build:development",
|
||||
@@ -53,28 +52,22 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/multisig-signer/**/*.{ts,tsx,js,jsx}"]
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/apps/multisig-signer"],
|
||||
"executor": "@nrwl/jest:jest",
|
||||
"outputs": ["coverage/apps/multisig-signer"],
|
||||
"options": {
|
||||
"jestConfig": "apps/multisig-signer/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"build-netlify": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"cp apps/multisig-signer/netlify.toml netlify.toml",
|
||||
@@ -83,7 +76,7 @@
|
||||
}
|
||||
},
|
||||
"build-spec": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
"options": {
|
||||
"command": "yarn tsc --project ./apps/multisig-signer/tsconfig.spec.json"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { join } = require('path');
|
||||
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
|
||||
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
|
||||
const theme = require('../../libs/tailwindcss-config/src/theme');
|
||||
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"types": ["node"]
|
||||
},
|
||||
"files": [
|
||||
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nx/react/typings/image.d.ts"
|
||||
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"**/*.spec.ts",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"jest.config.ts"
|
||||
],
|
||||
"files": [
|
||||
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nx/react/typings/image.d.ts"
|
||||
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const { composePlugins, withNx } = require('@nx/webpack');
|
||||
const { withReact } = require('@nx/react');
|
||||
const SentryPlugin = require('@sentry/webpack-plugin');
|
||||
|
||||
module.exports = composePlugins(withNx(), withReact(), (config, context) => {
|
||||
module.exports = (config, context) => {
|
||||
const additionalPlugins = process.env.SENTRY_AUTH_TOKEN
|
||||
? [
|
||||
new SentryPlugin({
|
||||
@@ -16,4 +14,4 @@ module.exports = composePlugins(withNx(), withReact(), (config, context) => {
|
||||
...config,
|
||||
plugins: [...additionalPlugins, ...config.plugins],
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"presets": ["@nx/js/babel"]
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
{
|
||||
"name": "static",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"sourceRoot": "apps/static/src",
|
||||
"tags": [],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/webpack:webpack",
|
||||
"executor": "./tools/executors/webpack:build",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"defaultConfiguration": "production",
|
||||
"options": {
|
||||
@@ -37,7 +36,7 @@
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/webpack:dev-server",
|
||||
"executor": "./tools/executors/webpack:serve",
|
||||
"options": {
|
||||
"buildTarget": "static:build"
|
||||
},
|
||||
@@ -48,7 +47,7 @@
|
||||
}
|
||||
},
|
||||
"build-netlify": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"cp apps/static/netlify.toml netlify.toml",
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "trading-e2e",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/trading-e2e/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"e2e": {
|
||||
"executor": "@nx/cypress:cypress",
|
||||
"executor": "@nrwl/cypress:cypress",
|
||||
"options": {
|
||||
"cypressConfig": "apps/trading-e2e/cypress.config.js",
|
||||
"devServerTarget": "trading:serve"
|
||||
@@ -20,14 +19,14 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/trading-e2e/**/*.{js,ts}"]
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
"options": {
|
||||
"command": "yarn tsc --project ./apps/trading-e2e/"
|
||||
|
||||
@@ -92,10 +92,7 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
|
||||
|
||||
cy.highlight('deposit verification');
|
||||
|
||||
cy.get('[col-id="asset.symbol"]', txTimeout).should(
|
||||
'contain.text',
|
||||
btcSymbol
|
||||
);
|
||||
cy.getByTestId('asset', txTimeout).should('contain.text', btcSymbol);
|
||||
cy.getByTestId(depositsTab).click();
|
||||
cy.get('.ag-cell-value', txTimeout).should('contain.text', btcSymbol);
|
||||
cy.get('[col-id="status"]').should('not.have.text', 'Open', txTimeout);
|
||||
@@ -147,6 +144,7 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
|
||||
// 1002-WITH-022
|
||||
// 1002-WITH-023
|
||||
// 0003-WTXN-011
|
||||
|
||||
cy.getByTestId('Withdrawals').click();
|
||||
cy.getByTestId('withdraw-dialog-button').click();
|
||||
selectAsset(0);
|
||||
@@ -157,9 +155,18 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
|
||||
'contain.text',
|
||||
'Funds unlocked'
|
||||
);
|
||||
// cy.getByTestId(toastCloseBtn).click();
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
cy.getByTestId('tab-withdrawals').within(() => {
|
||||
cy.get('.ag-center-cols-container')
|
||||
.children()
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.get('[col-id="status"]').should('contain.text', 'Pending');
|
||||
});
|
||||
});
|
||||
|
||||
cy.highlight('withdrawals verification');
|
||||
cy.getByTestId('toast-complete-withdrawal').last().click();
|
||||
cy.getByTestId('toast-complete-withdrawal').click();
|
||||
|
||||
cy.getByTestId(toastContent, txTimeout).should(
|
||||
'contain.text',
|
||||
@@ -216,12 +223,9 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC,
|
||||
};
|
||||
const rawPrice = removeDecimal(order.price, market.decimalPlaces);
|
||||
cy.getByTestId(toastCloseBtn, txTimeout).click();
|
||||
|
||||
cy.getByTestId('Collateral').click();
|
||||
cy.get('[col-id="asset.symbol"]', txTimeout).should(
|
||||
'contain.text',
|
||||
usdcSymbol
|
||||
);
|
||||
cy.getByTestId('asset', txTimeout).should('contain.text', usdcSymbol);
|
||||
|
||||
createOrder(order);
|
||||
|
||||
@@ -281,9 +285,7 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
it('can edit order', function () {
|
||||
const market = this.market;
|
||||
cy.visit(`/#/markets/${market.id}`);
|
||||
cy.getByTestId(toastCloseBtn, txTimeout).click();
|
||||
cy.getByTestId(openOrdersTab).click();
|
||||
cy.getByTestId('edit', txTimeout).should('be.visible');
|
||||
cy.getByTestId('edit').first().should('be.visible').click();
|
||||
cy.getByTestId('dialog-title').should('contain.text', 'Edit order');
|
||||
cy.get('#limitPrice').focus().clear().type(newPrice);
|
||||
@@ -311,7 +313,6 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
it('can cancel order', function () {
|
||||
const market = this.market;
|
||||
cy.visit(`/#/markets/${market.id}`);
|
||||
cy.getByTestId(toastCloseBtn, txTimeout).click();
|
||||
cy.getByTestId(openOrdersTab).click();
|
||||
cy.getByTestId('cancel').first().click();
|
||||
cy.getByTestId(toastContent).should(
|
||||
@@ -348,7 +349,7 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
|
||||
cy.visit('/#/portfolio');
|
||||
cy.get('main[data-testid="/portfolio"]').should('exist');
|
||||
cy.getByTestId(toastCloseBtn, txTimeout).click();
|
||||
|
||||
cy.getByTestId('Withdrawals').click();
|
||||
cy.getByTestId('withdraw-dialog-button').click();
|
||||
connectEthereumWallet('Unknown');
|
||||
@@ -359,6 +360,14 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
'contain.text',
|
||||
'Funds unlocked'
|
||||
);
|
||||
cy.getByTestId('tab-withdrawals').within(() => {
|
||||
cy.get('.ag-center-cols-container')
|
||||
.children()
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.get('[col-id="status"]').should('contain.text', 'Pending');
|
||||
});
|
||||
});
|
||||
|
||||
cy.highlight('withdrawals verification');
|
||||
cy.getByTestId('toast-complete-withdrawal').click();
|
||||
@@ -435,7 +444,6 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
// 1001-DEPO-007
|
||||
cy.visit('/#/portfolio');
|
||||
cy.get('main[data-testid="/portfolio"]').should('exist');
|
||||
cy.getByTestId(toastCloseBtn, txTimeout).click();
|
||||
cy.getByTestId(depositsTab).click();
|
||||
cy.getByTestId('deposit-button').click();
|
||||
connectEthereumWallet('Unknown');
|
||||
@@ -456,8 +464,8 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
// 1002-WITH-007
|
||||
|
||||
cy.visit('/#/portfolio');
|
||||
cy.get('main[data-testid="/portfolio"]', txTimeout).should('exist');
|
||||
cy.getByTestId(toastCloseBtn, txTimeout).click();
|
||||
cy.get('main[data-testid="/portfolio"]').should('exist');
|
||||
|
||||
cy.getByTestId(depositsTab).click();
|
||||
cy.getByTestId('deposit-button').click();
|
||||
connectEthereumWallet('Unknown');
|
||||
@@ -479,10 +487,7 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
|
||||
cy.highlight('deposit verification');
|
||||
|
||||
cy.get('[col-id="asset.symbol"]', txTimeout).should(
|
||||
'contain.text',
|
||||
vegaSymbol
|
||||
);
|
||||
cy.getByTestId('asset', txTimeout).should('contain.text', vegaSymbol);
|
||||
cy.getByTestId(depositsTab).click();
|
||||
cy.get('.ag-cell-value', txTimeout).should('contain.text', vegaSymbol);
|
||||
cy.get('[col-id="status"]').should('not.have.text', 'Open', txTimeout);
|
||||
@@ -515,16 +520,6 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
|
||||
cy.getByTestId(toastCloseBtn).click();
|
||||
cy.getByTestId(completeWithdrawalBtn).first().should('be.visible').click();
|
||||
cy.getByTestId(toastContent, txTimeout).should('contain.text', 'Delayed');
|
||||
cy.getByTestId('tab-withdrawals').within(() => {
|
||||
cy.get('.ag-center-cols-container')
|
||||
.children()
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.get('[col-id="status"]').contains(
|
||||
/Delayed \(ready in (\d{1,2}:\d{2}:\d{2}:\d{2})\)/
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ describe('markets all table', { tags: '@smoke' }, () => {
|
||||
cy.get(dropdownContent)
|
||||
.find(dropdownContentItem)
|
||||
.eq(2)
|
||||
.should('have.text', 'View settlement asset details');
|
||||
.should('have.text', 'View asset');
|
||||
cy.getByTestId('market-actions-content').click();
|
||||
});
|
||||
|
||||
@@ -201,7 +201,7 @@ describe('no all markets', { tags: '@smoke', testIsolation: true }, () => {
|
||||
cy.visit('/#/markets/all');
|
||||
});
|
||||
|
||||
it.skip('can see no markets message', () => {
|
||||
it('can see no markets message', () => {
|
||||
// 6001-MARK-048
|
||||
cy.getByTestId('tab-all-markets').should('contain.text', 'No markets');
|
||||
});
|
||||
|
||||
@@ -126,8 +126,7 @@ describe(
|
||||
{ name: 'Moving average', infoText: 'Moving average: 174.08302' },
|
||||
{
|
||||
name: 'Price monitoring bounds',
|
||||
infoText:
|
||||
'Price Monitoring Bounds: Min 162.56291Max 182.96869Reference 172.47489',
|
||||
infoText: 'Price Monitoring Bounds: Min -Max -Reference -',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -151,7 +150,7 @@ describe(
|
||||
{ name: 'Force index', infoText: 'Force index: 987.48858' },
|
||||
{ name: 'MACD', infoText: 'MACD: S -0.06420D 0.00359MACD -0.06062' },
|
||||
{ name: 'RSI', infoText: 'RSI: 47.08648' },
|
||||
{ name: 'Volume', infoText: 'Volume: 55,000' },
|
||||
{ name: 'Volume', infoText: 'Volume: 55,000.00000' },
|
||||
];
|
||||
cy.get(indicatorInfo).eq(1).realHover();
|
||||
cy.get('.close-button-module_closeButton__2ifkl').click({ force: true });
|
||||
|
||||
@@ -16,7 +16,7 @@ const orderStatus = 'status';
|
||||
const orderRemaining = 'remaining';
|
||||
const orderPrice = 'price';
|
||||
const orderTimeInForce = 'timeInForce';
|
||||
const orderUpdatedAt = 'updatedAt';
|
||||
const orderCreatedAt = 'createdAt';
|
||||
const cancelOrderBtn = 'cancel';
|
||||
const cancelAllOrdersBtn = 'cancelAll';
|
||||
const editOrderBtn = 'edit';
|
||||
@@ -46,10 +46,6 @@ describe('orders list', { tags: '@smoke', testIsolation: true }, () => {
|
||||
cy.wrap($symbol).invoke('text').should('not.be.empty');
|
||||
});
|
||||
|
||||
cy.get(`[col-id='${orderRemaining}']`).each(($remaining) => {
|
||||
cy.wrap($remaining).invoke('text').should('not.be.empty');
|
||||
});
|
||||
|
||||
cy.get(`[col-id='${orderSize}']`).each(($size) => {
|
||||
cy.wrap($size).invoke('text').should('not.be.empty');
|
||||
});
|
||||
@@ -62,6 +58,10 @@ describe('orders list', { tags: '@smoke', testIsolation: true }, () => {
|
||||
cy.wrap($status).invoke('text').should('not.be.empty');
|
||||
});
|
||||
|
||||
cy.get(`[col-id='${orderRemaining}']`).each(($remaining) => {
|
||||
cy.wrap($remaining).invoke('text').should('not.be.empty');
|
||||
});
|
||||
|
||||
cy.get(`[col-id='${orderPrice}']`).each(($price) => {
|
||||
cy.wrap($price).invoke('text').should('not.be.empty');
|
||||
});
|
||||
@@ -70,7 +70,7 @@ describe('orders list', { tags: '@smoke', testIsolation: true }, () => {
|
||||
cy.wrap($timeInForce).invoke('text').should('not.be.empty');
|
||||
});
|
||||
|
||||
cy.get(`[col-id='${orderUpdatedAt}']`).each(($dateTime) => {
|
||||
cy.get(`[col-id='${orderCreatedAt}']`).each(($dateTime) => {
|
||||
cy.wrap($dateTime).invoke('text').should('not.be.empty');
|
||||
});
|
||||
});
|
||||
@@ -96,8 +96,7 @@ describe('orders list', { tags: '@smoke', testIsolation: true }, () => {
|
||||
'have.text',
|
||||
'Partially Filled'
|
||||
);
|
||||
cy.get(`[col-id='${orderRemaining}']`).should('have.text', '7');
|
||||
cy.get(`[col-id='${orderSize}']`).should('have.text', '-10');
|
||||
cy.get(`[col-id='${orderRemaining}']`).should('have.text', '7/10');
|
||||
cy.getByTestId(cancelOrderBtn).should('not.exist');
|
||||
cy.getByTestId(editOrderBtn).should('not.exist');
|
||||
});
|
||||
@@ -215,7 +214,7 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
|
||||
cy.getByTestId(`order-status-${orderId}`)
|
||||
.parentsUntil(`.ag-row`)
|
||||
.siblings(`[col-id=${orderRemaining}]`)
|
||||
.should('have.text', '4');
|
||||
.should('have.text', '4/5');
|
||||
});
|
||||
|
||||
it('must see a filled order', () => {
|
||||
@@ -263,7 +262,7 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find(`[col-id="${orderSize}"]`)
|
||||
.find('[col-id="size"]')
|
||||
.should('have.text', '-15');
|
||||
});
|
||||
|
||||
@@ -277,7 +276,7 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find(`[col-id="${orderSize}"]`)
|
||||
.find('[col-id="size"]')
|
||||
.should('have.text', '+5');
|
||||
});
|
||||
|
||||
@@ -360,7 +359,7 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find(`[col-id='${orderTimeInForce}']`)
|
||||
.should('have.text', 'GTC');
|
||||
.should('have.text', "Good 'til Cancelled (GTC)");
|
||||
});
|
||||
|
||||
it('for Active order when is part of a liquidity or peg shape, must not see an option to amend the individual order ', () => {
|
||||
|
||||
@@ -267,22 +267,22 @@ describe('positions', { tags: '@regression', testIsolation: true }, () => {
|
||||
cy.get('.ag-center-cols-container').within(() => {
|
||||
assertPNLColor(
|
||||
'[col-id="realisedPNL"]',
|
||||
'text-market-green-600',
|
||||
'text-market-red'
|
||||
'text-vega-green',
|
||||
'text-vega-pink'
|
||||
);
|
||||
});
|
||||
cy.get('.ag-center-cols-container').within(() => {
|
||||
assertPNLColor(
|
||||
'[col-id="unrealisedPNL"]',
|
||||
'text-market-green-600',
|
||||
'text-market-red'
|
||||
'text-vega-green',
|
||||
'text-vega-pink'
|
||||
);
|
||||
});
|
||||
cy.get('.ag-center-cols-container').within(() => {
|
||||
assertPNLColor(
|
||||
'[col-id="openVolume"]',
|
||||
'text-market-green-600',
|
||||
'text-market-red'
|
||||
'text-vega-green',
|
||||
'text-vega-pink'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -73,7 +73,7 @@ describe('trades', { tags: '@smoke' }, () => {
|
||||
|
||||
it('copy price to deal ticket form', () => {
|
||||
// 6005-THIS-007
|
||||
cy.get(colIdPrice).last().should('be.visible').click();
|
||||
cy.get(colIdPrice).last().click();
|
||||
cy.getByTestId('order-price').should('have.value', '171.16898');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,4 +14,4 @@ NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/annou
|
||||
NX_VEGA_INCIDENT_URL=https://blog.vega.xyz/tagged/vega-incident-reports
|
||||
NX_VEGA_CONSOLE_URL=https://console.vega.xyz
|
||||
# TAG name of the current app version - TODO: bump to the latest upon release
|
||||
NX_APP_VERSION=v0.20.23-core-0.71.6
|
||||
NX_APP_VERSION=v0.20.19-core-0.71.6
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||
NX_SENTRY_DSN=https://2ffce43721964aafa78277c50654ece4@o286262.ingest.sentry.io/6300613
|
||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/mainnet-mirror/vegawallet-mainnet-mirror.toml
|
||||
NX_VEGA_ENV=MAINNET-MIRROR
|
||||
NX_VEGA_EXPLORER_URL=https://explorer.mainnet-mirror.vega.rocks
|
||||
NX_VEGA_NETWORKS={\"MAINNET\":\"https://console.vega.xyz\",\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"https://trading.stagnet1.vega.rocks\",\"MAINNET-MIRROR\":\"https://trading.mainnet-mirror.vega.rocks\"}
|
||||
NX_VEGA_TOKEN_URL=https://governance.mainnet-mirror.vega.rocks
|
||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
||||
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
|
||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/mainnet/announcements.json
|
||||
NX_VEGA_INCIDENT_URL=https://blog.vega.xyz/tagged/vega-incident-reports
|
||||
NX_VEGA_CONSOLE_URL=https://console.mainnet-mirror.vega.rocks
|
||||
# TAG name of the current app version - TODO: bump to the latest upon release
|
||||
NX_APP_VERSION=v0.20.19-core-0.71.6
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"extends": [
|
||||
"plugin:@nx/react-typescript",
|
||||
"plugin:@nrwl/nx/react-typescript",
|
||||
"../../.eslintrc.json",
|
||||
"next",
|
||||
"next/core-web-vitals"
|
||||
|
||||
@@ -11,7 +11,7 @@ cp .env.[environment] .env.local
|
||||
Starting the app:
|
||||
|
||||
```bash
|
||||
yarn nx serve trading
|
||||
yarn nx serve explorer
|
||||
```
|
||||
|
||||
### Configuration
|
||||
@@ -19,14 +19,13 @@ yarn nx serve trading
|
||||
Example configurations are provided here:
|
||||
|
||||
- [Mainnet](./.env.mainnet)
|
||||
- [Mainnet-mirror](./.env.mainnet-mirror)
|
||||
- [Devnet](./.env.devnet)
|
||||
- [Testnet](./.env.testnet)
|
||||
|
||||
For convenience, you can boot the app injecting one of the configurations above by running:
|
||||
|
||||
```bash
|
||||
yarn env-cmd -f .\apps\trading\.env.{env} yarn nx run trading:serve # e.g. stagnet1
|
||||
yarn nx run token:serve --env={env} # e.g. stagnet1
|
||||
```
|
||||
|
||||
There are a few different configuration options offered for this app:
|
||||
|
||||
@@ -160,9 +160,8 @@ const DataRow = ({
|
||||
const PriceChange = ({ candles }: { candles: string[] }) => {
|
||||
const priceChange = candles ? priceChangePercentage(candles) : undefined;
|
||||
const priceChangeClasses = classNames('text-xs', {
|
||||
'text-market-red': priceChange && priceChange < 0,
|
||||
'text-market-green-600 dark:text-market-green':
|
||||
priceChange && priceChange > 0,
|
||||
'text-vega-pink': priceChange && priceChange < 0,
|
||||
'text-vega-green': priceChange && priceChange > 0,
|
||||
});
|
||||
let prefix = '';
|
||||
if (priceChange && priceChange > 0) {
|
||||
|
||||
@@ -9,7 +9,10 @@ import { t } from '@vegaprotocol/i18n';
|
||||
import { OracleBanner } from '@vegaprotocol/markets';
|
||||
import type { Market } from '@vegaprotocol/markets';
|
||||
import { Filter } from '@vegaprotocol/orders';
|
||||
import { useScreenDimensions } from '@vegaprotocol/react-helpers';
|
||||
import {
|
||||
usePaneLayout,
|
||||
useScreenDimensions,
|
||||
} from '@vegaprotocol/react-helpers';
|
||||
import {
|
||||
Tab,
|
||||
LocalStoragePersistTabs as Tabs,
|
||||
@@ -22,7 +25,6 @@ import { HeaderTitle } from '../../components/header';
|
||||
import {
|
||||
ResizableGrid,
|
||||
ResizableGridPanel,
|
||||
usePaneLayout,
|
||||
} from '../../components/resizable-grid';
|
||||
import { TradingViews } from './trade-views';
|
||||
import { MarketSelector } from './market-selector';
|
||||
@@ -316,7 +318,7 @@ export const TradeGrid = ({ market, pinnedAsset }: TradeGridProps) => {
|
||||
<div className="border-b border-default min-w-0">
|
||||
<HeaderStats market={market} />
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<div className="col-span-2 bg-vega-green">
|
||||
<OracleBanner marketId={market?.id || ''} />
|
||||
</div>
|
||||
{sidebarOpen && (
|
||||
|
||||
@@ -18,7 +18,7 @@ import type {
|
||||
MarketMaybeWithData,
|
||||
} from '@vegaprotocol/markets';
|
||||
import {
|
||||
MarketActionsDropdown,
|
||||
MarketTableActions,
|
||||
closedMarketsWithDataProvider,
|
||||
} from '@vegaprotocol/markets';
|
||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||
@@ -291,7 +291,7 @@ const ClosedMarketsDataGrid = ({
|
||||
cellRenderer: ({ data }: VegaICellRendererParams<Row>) => {
|
||||
if (!data) return null;
|
||||
return (
|
||||
<MarketActionsDropdown
|
||||
<MarketTableActions
|
||||
marketId={data.id}
|
||||
assetId={data.settlementAsset.id}
|
||||
/>
|
||||
|
||||
@@ -24,10 +24,7 @@ import { PriceChart } from 'pennant';
|
||||
import 'pennant/dist/style.css';
|
||||
import type { Account } from '@vegaprotocol/accounts';
|
||||
import { accountsDataProvider } from '@vegaprotocol/accounts';
|
||||
import {
|
||||
useLocalStorageSnapshot,
|
||||
useThemeSwitcher,
|
||||
} from '@vegaprotocol/react-helpers';
|
||||
import { useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||
import type { Market } from '@vegaprotocol/markets';
|
||||
|
||||
@@ -71,7 +68,7 @@ export const AccountHistoryContainer = () => {
|
||||
const { data: assets } = useAssetsDataProvider();
|
||||
|
||||
if (!pubKey) {
|
||||
return <Splash>{t('Connect wallet')}</Splash>;
|
||||
return <Splash>Connect wallet</Splash>;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -117,15 +114,7 @@ const AccountHistoryManager = ({
|
||||
.sort((a, b) => a.name.localeCompare(b.name)),
|
||||
[assetData, assetIds]
|
||||
);
|
||||
const [assetId, setAssetId] = useLocalStorageSnapshot(
|
||||
'account-history-active-asset-id'
|
||||
);
|
||||
|
||||
const asset = useMemo(
|
||||
() => assets.find((a) => a.id === assetId) || assets[0],
|
||||
[assetId, assets]
|
||||
);
|
||||
|
||||
const [asset, setAsset] = useState<AssetFieldsFragment>(assets[0]);
|
||||
const [range, setRange] = useState<typeof DateRange[keyof typeof DateRange]>(
|
||||
DateRange.RANGE_1M
|
||||
);
|
||||
@@ -157,10 +146,10 @@ const AccountHistoryManager = ({
|
||||
m.tradableInstrument.instrument.product.settlementAsset.id;
|
||||
const newAsset = assets.find((item) => item.id === newAssetId);
|
||||
if ((!asset || (assets && newAssetId !== asset.id)) && newAsset) {
|
||||
setAssetId(newAsset.id);
|
||||
setAsset(newAsset);
|
||||
}
|
||||
},
|
||||
[asset, assets, setAssetId]
|
||||
[asset, assets]
|
||||
);
|
||||
|
||||
const variables = useMemo(
|
||||
@@ -222,14 +211,14 @@ const AccountHistoryManager = ({
|
||||
>
|
||||
<DropdownMenuContent>
|
||||
{assets.map((a) => (
|
||||
<DropdownMenuItem key={a.id} onClick={() => setAssetId(a.id)}>
|
||||
<DropdownMenuItem key={a.id} onClick={() => setAsset(a)}>
|
||||
{a.symbol}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
);
|
||||
}, [asset, assets, setAssetId]);
|
||||
}, [assets, asset]);
|
||||
const marketsMenu = useMemo(() => {
|
||||
return accountType === Schema.AccountType.ACCOUNT_TYPE_MARGIN &&
|
||||
markets?.length ? (
|
||||
|
||||
@@ -4,6 +4,7 @@ import { LayoutPriority } from 'allotment';
|
||||
import { titlefy } from '@vegaprotocol/utils';
|
||||
import { t } from '@vegaprotocol/i18n';
|
||||
import { useIncompleteWithdrawals } from '@vegaprotocol/withdraws';
|
||||
import { usePaneLayout } from '@vegaprotocol/react-helpers';
|
||||
import { Tab, LocalStoragePersistTabs as Tabs } from '@vegaprotocol/ui-toolkit';
|
||||
import { usePageTitleStore } from '../../stores';
|
||||
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
||||
@@ -19,7 +20,6 @@ import { AccountHistoryContainer } from './account-history-container';
|
||||
import {
|
||||
ResizableGrid,
|
||||
ResizableGridPanel,
|
||||
usePaneLayout,
|
||||
} from '../../components/resizable-grid';
|
||||
|
||||
const WithdrawalsIndicator = () => {
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
export * from './resizable-grid';
|
||||
export * from './use-pane-layout';
|
||||
|
||||
@@ -3,8 +3,8 @@ export default {
|
||||
displayName: 'trading',
|
||||
preset: '../../jest.preset.js',
|
||||
transform: {
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
|
||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
|
||||
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||
coverageDirectory: '../../coverage/apps/trading',
|
||||
|
||||
@@ -2,12 +2,10 @@ import {
|
||||
RestConnector,
|
||||
JsonRpcConnector,
|
||||
ViewConnector,
|
||||
InjectedConnector,
|
||||
} from '@vegaprotocol/wallet';
|
||||
|
||||
export const rest = new RestConnector();
|
||||
export const jsonRpc = new JsonRpcConnector();
|
||||
export const injected = new InjectedConnector();
|
||||
|
||||
let view: ViewConnector;
|
||||
if (typeof window !== 'undefined') {
|
||||
@@ -18,7 +16,6 @@ if (typeof window !== 'undefined') {
|
||||
}
|
||||
|
||||
export const Connectors = {
|
||||
injected,
|
||||
rest,
|
||||
jsonRpc,
|
||||
view,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const withNx = require('@nx/next/plugins/with-nx');
|
||||
const withNx = require('@nrwl/next/plugins/with-nx');
|
||||
const { withSentryConfig } = require('@sentry/nextjs');
|
||||
|
||||
const SENTRY_AUTH_TOKEN = process.env.SENTRY_AUTH_TOKEN;
|
||||
@@ -11,7 +11,7 @@ const sentryWebpackOptions = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
|
||||
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
||||
**/
|
||||
const nextConfig = {
|
||||
nx: {
|
||||
|
||||
@@ -29,57 +29,51 @@ html.dark {
|
||||
|
||||
/* PENNANT */
|
||||
|
||||
html [data-theme='dark'],
|
||||
html [data-theme='light'] {
|
||||
html [data-theme='dark'] {
|
||||
--pennant-color-danger: theme('colors.vega.pink.DEFAULT');
|
||||
|
||||
/* candles */
|
||||
--pennant-color-buy-fill: theme('colors.vega.green.650');
|
||||
--pennant-color-buy-stroke: theme('colors.vega.green.500');
|
||||
/* sell candles only use stroke as the candle is solid (without border) */
|
||||
--pennant-color-sell-stroke: theme('colors.market.red.500');
|
||||
--pennant-color-sell-stroke: theme('colors.vega.pink.500');
|
||||
|
||||
/* studies */
|
||||
--pennant-color-eldar-ray-bear-power: theme('colors.market.red.500');
|
||||
--pennant-color-eldar-ray-bull-power: theme('colors.market.green.600');
|
||||
--pennant-color-eldar-ray-bear-power: theme('colors.vega.pink.500');
|
||||
--pennant-color-eldar-ray-bull-power: theme('colors.vega.green.650');
|
||||
|
||||
--pennant-color-macd-divergence-buy: theme('colors.market.green.600');
|
||||
--pennant-color-macd-divergence-sell: theme('colors.market.red.500');
|
||||
--pennant-color-macd-divergence-buy: theme('colors.vega.green.650');
|
||||
--pennant-color-macd-divergence-sell: theme('colors.vega.pink.500');
|
||||
--pennant-color-macd-signal: theme('colors.vega.blue.500');
|
||||
--pennant-color-macd-macd: theme('colors.vega.yellow.500');
|
||||
|
||||
--pennant-color-volume-sell: theme('colors.market.red.500');
|
||||
--pennant-color-volume-buy: theme('colors.vega.green.650');
|
||||
--pennant-color-volume-sell: theme('colors.vega.pink.500');
|
||||
|
||||
/* depth chart */
|
||||
--pennant-color-depth-buy-fill: theme('colors.vega.green.650');
|
||||
--pennant-color-depth-buy-stroke: theme('colors.vega.green.500');
|
||||
--pennant-color-depth-sell-fill: theme('colors.vega.pink.650');
|
||||
--pennant-color-depth-sell-stroke: theme('colors.vega.pink.500');
|
||||
}
|
||||
|
||||
html [data-theme='light'] {
|
||||
/* candles */
|
||||
--pennant-color-buy-fill: theme(colors.market.green.500);
|
||||
--pennant-color-buy-stroke: theme(colors.market.green.600);
|
||||
--pennant-color-danger: theme('colors.vega.pink.500');
|
||||
|
||||
/* sell uses stroke for fill and stroke */
|
||||
--pennant-color-sell-stroke: theme(colors.market.red.500);
|
||||
/* candles */
|
||||
--pennant-color-buy-fill: theme('colors.vega.green.400');
|
||||
--pennant-color-buy-stroke: theme('colors.vega.green.550');
|
||||
/* sell candles only use stroke as the candle is solid (without border) */
|
||||
--pennant-color-sell-stroke: theme('colors.vega.pink.400');
|
||||
|
||||
--pennant-color-volume-buy: theme('colors.vega.green.400');
|
||||
--pennant-color-volume-sell: theme('colors.vega.pink.400');
|
||||
|
||||
/* depth chart */
|
||||
--pennant-color-depth-buy-fill: theme(colors.market.green.500);
|
||||
--pennant-color-depth-buy-stroke: theme(colors.market.green.600);
|
||||
--pennant-color-depth-sell-fill: theme(colors.market.red.500);
|
||||
--pennant-color-depth-sell-stroke: theme(colors.market.red.600);
|
||||
|
||||
--pennant-color-volume-buy: theme(colors.market.green.400);
|
||||
--pennant-color-volume-sell: theme(colors.market.red.400);
|
||||
}
|
||||
|
||||
html [data-theme='dark'] {
|
||||
/* candles */
|
||||
--pennant-color-buy-fill: theme(colors.market.green.600);
|
||||
--pennant-color-buy-stroke: theme(colors.market.green.500);
|
||||
|
||||
/* sell uses stroke for fill and stroke */
|
||||
--pennant-color-sell-stroke: theme(colors.market.red.500);
|
||||
|
||||
/* depth chart */
|
||||
--pennant-color-depth-buy-fill: theme(colors.market.green.600);
|
||||
--pennant-color-depth-buy-stroke: theme(colors.market.green.500);
|
||||
--pennant-color-depth-sell-fill: theme(colors.market.red.600);
|
||||
--pennant-color-depth-sell-stroke: theme(colors.market.red.500);
|
||||
|
||||
--pennant-color-volume-buy: theme(colors.market.green.600);
|
||||
--pennant-color-volume-sell: theme(colors.market.red.600);
|
||||
--pennant-color-depth-buy-fill: theme('colors.vega.green.400');
|
||||
--pennant-color-depth-buy-stroke: theme('colors.vega.green.550');
|
||||
--pennant-color-depth-sell-fill: theme('colors.vega.pink.400');
|
||||
--pennant-color-depth-sell-stroke: theme('colors.vega.pink.550');
|
||||
}
|
||||
|
||||
/* AG GRID - Do not edit without updating other global stylesheets for each app */
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "trading",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/trading",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/next:build",
|
||||
"executor": "./tools/executors/next:build",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"defaultConfiguration": "production",
|
||||
"options": {
|
||||
"root": "apps/trading",
|
||||
"outputPath": "dist/apps/trading"
|
||||
},
|
||||
"configurations": {
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/next:server",
|
||||
"executor": "./tools/executors/next:serve",
|
||||
"options": {
|
||||
"buildTarget": "trading:build",
|
||||
"dev": true
|
||||
@@ -32,34 +32,28 @@
|
||||
}
|
||||
},
|
||||
"export": {
|
||||
"executor": "@nx/next:export",
|
||||
"executor": "./tools/executors/next:export",
|
||||
"options": {
|
||||
"buildTarget": "trading:build:production"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/apps/trading"],
|
||||
"executor": "@nrwl/jest:jest",
|
||||
"outputs": ["coverage/apps/trading"],
|
||||
"options": {
|
||||
"jestConfig": "apps/trading/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"ci": true,
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/linter:eslint",
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/trading/**/*.{ts,tsx,js,jsx}"]
|
||||
}
|
||||
},
|
||||
"build-netlify": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"options": {
|
||||
"commands": [
|
||||
"cp apps/trading/netlify.toml netlify.toml",
|
||||
@@ -68,7 +62,7 @@
|
||||
}
|
||||
},
|
||||
"build-spec": {
|
||||
"executor": "nx:run-commands",
|
||||
"executor": "@nrwl/workspace:run-commands",
|
||||
"outputs": [],
|
||||
"options": {
|
||||
"command": "yarn tsc --project ./apps/trading/tsconfig.spec.json"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { join } = require('path');
|
||||
const { createGlobPatternsForDependencies } = require('@nx/next/tailwind');
|
||||
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
|
||||
const theme = require('../../libs/tailwindcss-config/src/theme');
|
||||
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user