Compare commits

...
Author SHA1 Message Date
Artur Siaznik 25e42582da chore: nx upgrade for trading-e2e 2023-04-18 14:00:08 +02:00
Bartłomiej Głownia 721009bec8 chore: upgrade nx, remove custom executors, amend trading app .env files 2023-04-18 13:03:24 +02:00
Bartłomiej Głownia 31859cb779 chore(trading): maintain always up to date active orders list (#3430) 2023-04-18 12:49:42 +02:00
dexturr 20507ecdd1 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-18 06:08:58 +00:00
dexturr 13ba661ea0 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-18 00:16:31 +00:00
dexturr 03f5b9fc7b chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-17 18:07:00 +00:00
dexturr b9fed65615 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-17 12:10:37 +00:00
Mikołaj Młodzikowski d671e51edf fix(ci): adjust timeouts 2023-04-17 12:45:30 +02:00
Mikołaj Młodzikowski 4f3295d3fc feat(ci): rebuild yarn on failed build 2023-04-17 11:24:53 +02:00
dexturr 7be7bab1ca chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-17 06:09:49 +00:00
dexturr 61380f06b9 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-17 00:14:49 +00:00
dexturr c113856d63 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-16 18:07:16 +00:00
dexturr 90884beee8 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-16 12:07:18 +00:00
dexturr d9d2e428f4 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-16 06:09:55 +00:00
dexturr ba8d54b761 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-16 00:15:24 +00:00
dexturr dce4edb943 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-15 18:06:56 +00:00
dexturr b468a0fd84 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-15 12:07:02 +00:00
dexturr c98fbe7453 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-15 06:06:58 +00:00
dexturr d20928ec06 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-15 00:15:18 +00:00
dexturr 289559fe4f chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-14 18:09:58 +00:00
Mikołaj Młodzikowski 071fd6128c feat: fix releasing dist 2023-04-14 15:45:14 +02:00
Mikołaj Młodzikowski 554d07a31b feat(ci): fix regressions detected after merging to develop (#3442) 2023-04-14 15:00:20 +02:00
dexturr 48b62380b0 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-14 12:10:09 +00:00
Mikołaj Młodzikowski a9f4604bad feat(governance,trading,explorer): pipelines improvements (#3422) 2023-04-14 11:47:41 +02:00
Sam Keen 54f2519a62 feat(governance): toggles design review tweaks (#3431) 2023-04-14 09:22:22 +01:00
dexturr 260e7bf9cf chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-14 06:09:41 +00:00
dexturr 83db796cdb chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-14 00:14:08 +00:00
m.ray 2f6800212e fix(trading): fix order toast intent on amendments (#3433) 2023-04-13 13:20:28 -07:00
dexturr 77e16ad1b7 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-13 18:09:10 +00:00
dexturr dcce983842 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-13 12:10:33 +00:00
Maciek 53ce9bfaa2 chore(assets): make query for asset list lighter (#3425) 2023-04-13 11:42:09 +00:00
Edd 6ae34d296f fix(explorer): tweak footer to show more detail on smaller screens (#3418) 2023-04-13 10:49:42 +01:00
Joe Tsang ee2aafb99c fix(governance): failing nightly tests (#3351) 2023-04-13 10:46:01 +01:00
dexturr e8fdb63323 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-13 06:09:41 +00:00
dexturr 3df9270b57 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-13 00:13:51 +00:00
dexturr ab26667265 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-12 18:08:22 +00:00
m.ray 9fc6b255c8 fix(orders): update order toast intent and title (#3424) 2023-04-12 15:19:15 +00:00
dexturr 91f61d8bb5 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-12 12:09:32 +00:00
Bartłomiej Głowniaandm.ray bbfda65bcc feat(withdraws): improve ux surrounding withdraw balances thresholds and delays (#3402)
Co-authored-by: m.ray <16125548+MadalinaRaicu@users.noreply.github.com>
2023-04-12 11:21:24 +02:00
Mikołaj Młodzikowski 45f2e926c3 feat(governance,trading,explorer): split steps by logic (#3387) 2023-04-12 09:38:26 +02:00
dexturr ccadbc2cb6 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-12 06:08:40 +00:00
dexturr 7128acb7b8 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-12 00:14:18 +00:00
dexturr 357bdaa4f3 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-11 18:07:51 +00:00
144 changed files with 2861 additions and 3072 deletions
+85 -5
View File
@@ -4,14 +4,54 @@ on:
push:
branches:
- release/*
- develop
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- reopened
- edited
- synchronize
jobs:
node-modules:
runs-on: ubuntu-22.04
name: 'Cache yarn modules'
steps:
- name: Checkout
uses: actions/checkout@v3
- 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 "resotre-keys" if you need to rebuild yarn from 0
restore-keys: |
${{ runner.os }}-cache-node-modules-
- name: Setup node
uses: actions/setup-node@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
node-version-file: '.nvmrc'
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
cache: yarn
- name: yarn install
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --pure-lockfile
lint-pr-title:
needs: node-modules
if: ${{ github.event_name == 'pull_request' }}
name: Verify PR title
uses: ./.github/workflows/lint-pr.yml
secrets: inherit
lint-test-build:
timeout-minutes: 20
needs: node-modules
runs-on: ubuntu-22.04
name: '(CI) lint + unit test + build'
steps:
@@ -27,8 +67,11 @@ jobs:
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
cache: yarn
- name: Install root dependencies
run: yarn install --frozen-lockfile
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
@@ -48,7 +91,7 @@ jobs:
run: yarn nx affected:test
- name: Build affected
run: yarn nx affected:build
run: yarn nx affected:build || (yarn install && yarn nx affected:build)
# See affected apps
- name: See affected apps
@@ -95,6 +138,43 @@ jobs:
with:
projects: ${{ needs.lint-test-build.outputs.projects }}
dist-check:
runs-on: ubuntu-latest
needs: publish-dist
if: ${{ github.event_name == 'pull_request' }}
name: '(CD) comment preview links'
steps:
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Previews
- name: Inject slug/short variables
if: ${{ steps.fc.outputs.comment-id == 0 }}
uses: rlespinasse/github-slug-action@v4
with:
prefix: CI_
- name: Create comment
if: ${{ steps.fc.outputs.comment-id == 0 }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Previews
- explorer https://explorer.${{ env.CI_GITHUB_REF_NAME }}.vega.rocks
- trading https://trading.${{ env.CI_GITHUB_REF_NAME }}.vega.rocks
- governance https://governance.${{ env.CI_GITHUB_REF_NAME }}.vega.rocks
cypress-check:
name: '(CI) cypress - check'
runs-on: ubuntu-latest
needs: cypress
steps:
- run: echo Done!
# Report single result at the end, to avoid mess with required checks in PR
cypress-result:
if: ${{ always() }}
@@ -2,15 +2,11 @@
name: Verify PR title
on:
pull_request:
types:
- opened
- ready_for_review
- reopened
- edited
- synchronize
workflow_call:
jobs:
lint_pr:
timeout-minutes: 10
runs-on: ubuntu-22.04
steps:
- name: Checkout
@@ -23,8 +19,11 @@ jobs:
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
cache: yarn
- name: Install root dependencies
run: yarn install --frozen-lockfile
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
- name: Check PR title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./commitlint.config-ci.js
+92 -29
View File
@@ -15,6 +15,7 @@ jobs:
app: ${{ fromJSON(inputs.projects) }}
name: ${{ matrix.app }}
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -36,66 +37,131 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# https://docs.github.com/en/actions/learn-github-actions/contexts
- name: Check node version
id: tags
run: |
nodeVersion=$(cat .nvmrc | head -n 1)
echo ::set-output name=nodeVersion::${nodeVersion}
- 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
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
# https://docs.github.com/en/actions/learn-github-actions/contexts
- name: Define variables
run: |
envName=''
dockerfile="dist.Dockerfile"
if [[ "${{ github.event_name }}" = "push" ]]; then
envName="$(echo ${{ github.ref }} | rev | cut -d '/' -f 1 | rev)"
bucketName="${{ github.event.repository.name }}-$envName"
echo ::set-output name=bucketName::${bucketName}
echo ::set-output name=envName::${envName}
domain="vega.rocks"
if [[ "${{ github.ref }}" =~ .*release/.* ]]; then
envName="$(echo ${{ github.ref }} | rev | cut -d '/' -f 1 | rev)"
if [[ "${{ github.ref }}" =~ .*mainnet.* ]]; then
domain="vega.community"
if [[ "${{ matrix.app }}" = "trading" ]]; then
dockerfile="ipfs.Dockerfile"
fi
fi
elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then
envName="stagnet3"
fi
bucketName="${{ matrix.app }}.${envName}.${domain}"
echo BUCKET_NAME=${bucketName} >> $GITHUB_ENV
fi
nodeVersion=$(cat .nvmrc | head -n 1)
echo ENV_NAME=${envName} >> $GITHUB_ENV
echo NODE_VERSION=${nodeVersion} >> $GITHUB_ENV
echo DOCKERFILE=docker/${dockerfile} >> $GITHUB_ENV
- name: Build local dist
if: ${{ env.DOCKERFILE != 'docker/ipfs.Dockerfile' }}
run: |
flags=""
if [[ ! -z "${{ env.ENV_NAME }}" ]]; then
if [[ "${{ env.ENV_NAME }}" != "ops-vega" ]]; then
flags="--env=${{ env.ENV_NAME }}"
fi
fi
if [ "${{ matrix.app }}" = "trading" ]; then
yarn nx export trading $flags || (yarn install && yarn nx export trading $flags)
DIST_LOCATION=dist/apps/trading/exported
else
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
tree dist-result
- name: Build and export to local Docker
id: docker_build
if: ${{ github.event_name == 'pull_request' || ( env.DOCKERFILE == 'docker/ipfs.Dockerfile' && github.event_name == 'push' ) }}
uses: docker/build-push-action@v3
with:
context: .
file: ${{ env.DOCKERFILE }}
load: true
build-args: |
APP=${{ matrix.app }}
NODE_VERSION=${{ steps.tags.outputs.nodeVersion }}
ENV_NAME=${{ steps.tags.outputs.envName || '' }}
NODE_VERSION=${{ env.NODE_VERSION }}
ENV_NAME=${{ env.ENV_NAME }}
tags: |
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local
- name: Image digest
if: ${{ github.event_name == 'pull_request' || ( env.DOCKERFILE == 'docker/ipfs.Dockerfile' && github.event_name == 'push' ) }}
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Sanity check docker image
if: ${{ github.event_name == 'pull_request' || ( env.DOCKERFILE == 'docker/ipfs.Dockerfile' && github.event_name == 'push' ) }}
run: |
echo "Check ipfs-hash"
docker run --rm ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local cat ipfs-hash
if [[ "${{ env.DOCKERFILE }}" = "docker/ipfs.Dockerfile" ]]; then
docker run --rm ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local cat /ipfs-hash
fi
echo "List html directory"
docker run --rm ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local ls -lah
docker run --rm ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local sh -c 'apk add --update tree; tree .'
echo "Copy dist to local filesystem"
- name: Copy dist to local filesystem
if: ${{ env.DOCKERFILE == 'docker/ipfs.Dockerfile' && github.event_name == 'push' }}
run: |
docker create --name=dist ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local
docker cp dist:/usr/share/nginx/html dist
echo "Check local dist"
ls -al dist
echo "check local dist files"
tree dist/html
mv dist/html dist-result
- name: Publish dist as docker image
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'pull_request' }}
with:
context: .
file: ${{ env.DOCKERFILE }}
push: true
build-args: |
APP=${{ matrix.app }}
NODE_VERSION=${{ steps.tags.outputs.nodeVersion }}
NODE_VERSION=${{ env.NODE_VERSION }}
ENV_NAME=${{ env.ENV_NAME }}
tags: |
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:${{ github.event.pull_request.head.sha || github.sha }}
# - uses: shallwefootball/s3-upload-action@master
# if: ${{ github.event_name == 'push' }}
# name: Upload dist S3
# with:
# aws_key_id: ${{ secrets.AWS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
# aws_bucket: ${{ steps.tags.outputs.bucketName }}
# source_dir: 'dist'
# bucket creation in github.com/vegaprotocol/terraform//frontend
- name: Publish dist to s3
uses: jakejarvis/s3-sync-action@master
if: ${{ github.event_name == 'push' }}
with:
args: --acl private --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ env.BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-west-1'
SOURCE_DIR: 'dist-result'
- name: Add preview label
uses: actions-ecosystem/action-add-labels@v1
@@ -103,6 +169,3 @@ jobs:
with:
labels: ${{ matrix.app }}-preview
number: ${{ github.event.number }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
-2
View File
@@ -4,8 +4,6 @@
/dist
/tmp
/out-tsc
/tools/executors/**/*.js
/tools/utils/*.js
# dependencies
/node_modules
+1
View File
@@ -1,4 +1,5 @@
{
"name": "explorer-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/explorer-e2e/src",
"projectType": "application",
+1 -2
View File
@@ -1,10 +1,10 @@
{
"name": "explorer",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/explorer/src",
"projectType": "application",
"targets": {
"build": {
"executor": "./tools/executors/webpack:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@@ -38,7 +38,6 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"options": {
"port": 3000,
"buildTarget": "explorer:build:development",
@@ -10,7 +10,7 @@ export const Footer = () => {
const [nodeSwitcherOpen, setNodeSwitcherOpen] = useState(false);
const { screenSize } = useScreenDimensions();
const showFullFeedbackLabel = useMemo(
() => ['lg', 'xl', 'xxl', 'xxxl'].includes(screenSize),
() => ['md', 'lg', 'xl', 'xxl', 'xxxl'].includes(screenSize),
[screenSize]
);
+1
View File
@@ -1,4 +1,5 @@
{
"name": "governance-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/governance-e2e/src",
"projectType": "application",
@@ -44,7 +44,8 @@ describe(
function () {
before('connect wallets and set approval limit', function () {
cy.visit('/');
vegaWalletSetSpecifiedApprovalAmount('1000');
ethereumWalletConnect();
cy.associateTokensToVegaWallet('1');
});
beforeEach('visit proposals tab', function () {
@@ -213,6 +214,7 @@ describe(
// 3001-VOTE-042, 3001-VOTE-057, 3001-VOTE-058, 3001-VOTE-059, 3001-VOTE-060
it('Newly created proposal details - ability to increase associated tokens - by voting again after association', function () {
vegaWalletSetSpecifiedApprovalAmount('1000');
createRawProposal();
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
getSubmittedProposalFromProposalList(rawProposal.rationale.title)
@@ -13,7 +13,6 @@ import {
createUpdateNetworkProposalTxBody,
createFreeFormProposalTxBody,
} from '../../support/proposal.functions';
import { ensureSpecifiedUnstakedTokensAreAssociated } from '../../support/staking.functions';
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
import { vegaWalletSetSpecifiedApprovalAmount } from '../../support/wallet-teardown.functions';
@@ -33,10 +32,6 @@ context(
before('Connect wallets and set approval', function () {
cy.visit('/');
vegaWalletSetSpecifiedApprovalAmount('1000');
cy.connectVegaWallet();
ethereumWalletConnect();
ensureSpecifiedUnstakedTokensAreAssociated('1');
cy.clearLocalStorage();
});
beforeEach('visit proposals', function () {
@@ -114,7 +109,7 @@ context(
navigateTo(navigation.proposals);
cy.reload();
waitForSpinner();
cy.get(openProposals).within(() => {
cy.get(openProposals, { timeout: 6000 }).within(() => {
cy.contains(proposalTitle)
.parentsUntil('[data-testid="proposals-list-item"]')
.within(() => cy.get(viewProposalButton).click());
@@ -232,7 +232,7 @@ context(
it('Unable to create a freeform proposal - when json parent section contains unexpected field', function () {
const errorMsg =
'Invalid params: the transaction does not use a valid Vega command: unknown field unexpected" in vega.commands.v1.ProposalSubmission';
'Invalid params: the transaction does not use a valid Vega command: unknown field "unexpected" in vega.commands.v1.ProposalSubmission';
// 3001-VOTE-038 3002-PROP-013 3002-PROP-014
goToMakeNewProposal(governanceProposalType.RAW);
@@ -313,7 +313,7 @@ context(
it('Unable to vote on a proposal - when vega wallet disconnected - option to connect from within', function () {
createRawProposal();
cy.get('[data-testid="manage-vega-wallet"]').click();
cy.get('[data-testid="manage-vega-wallet"]:visible').click();
cy.get('[data-testid="disconnect"]').click();
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
getSubmittedProposalFromProposalList(
@@ -218,7 +218,7 @@ context(
it('Unable to submit new market proposal with missing/invalid fields', function () {
const errorMsg =
'Invalid params: the transaction is not a valid Vega command: unknown field "filters" in vega.DataSourceDefinition';
'Invalid params: the transaction does not use a valid Vega command: unknown field "invalid" in vega.NewMarket';
goToMakeNewProposal(governanceProposalType.NEW_MARKET);
cy.get(newProposalSubmitButton).should('be.visible').click();
@@ -436,7 +436,7 @@ context(
});
});
it.only('Able to submit update asset proposal using max deadline', function () {
it('Able to submit update asset proposal using max deadline', function () {
goToMakeNewProposal(governanceProposalType.UPDATE_ASSET);
enterUpdateAssetProposalDetails();
cy.get(maxVoteDeadline).click();
@@ -25,11 +25,11 @@ const vegaWalletUnstakedBalance =
'[data-testid="vega-wallet-balance-unstaked"]';
const txTimeout = Cypress.env('txTimeout');
const vegaWalletPublicKeyShort = Cypress.env('vegaWalletPublicKeyShort');
const ethWalletAssociateButton = '[data-testid="associate-btn"]';
const ethWalletAssociateButton = '[data-testid="associate-btn"]:visible';
const associateWalletRadioButton = '[data-testid="associate-radio-wallet"]';
const tokenAmountInputBox = '[data-testid="token-amount-input"]';
const tokenSubmitButton = '[data-testid="token-input-submit-button"]';
const ethWalletDissociateButton = '[href="/token/disassociate"]';
const ethWalletDissociateButton = '[href="/token/disassociate"]:visible';
const vestingContractSection = '[data-testid="vega-in-vesting-contract"]';
const vegaInWalletSection = '[data-testid="vega-in-wallet"]';
const connectedVegaKey = '[data-testid="connected-vega-key"]';
@@ -78,12 +78,12 @@ context(
cy.getByTestId('currency-title', txTimeout).should(
'have.length.above',
3
6
);
validateWalletCurrency('Associated', '0.00');
validateWalletCurrency('Pending association', '2.00');
validateWalletCurrency('Total associated after pending', '2.00');
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
// 0005-ETXN-002
verifyEthWalletAssociatedBalance('2.0');
@@ -111,12 +111,12 @@ context(
stakingPageDisassociateTokens('2');
cy.getByTestId('currency-title', txTimeout).should(
'have.length.above',
3
6
);
validateWalletCurrency('Associated', '2.00');
validateWalletCurrency('Pending association', '2.00');
validateWalletCurrency('Total associated after pending', '0.00');
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
cy.getByTestId('eth-wallet-associated-balances', txTimeout).should(
'not.exist'
);
@@ -192,12 +192,12 @@ context(
cy.getByTestId('currency-title', txTimeout).should(
'have.length.above',
3
6
);
validateWalletCurrency('Associated', '0.00');
validateWalletCurrency('Pending association', '2.00');
validateWalletCurrency('Total associated after pending', '2.00');
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
verifyEthWalletAssociatedBalance('2.0');
verifyEthWalletTotalAssociatedBalance('2.0');
cy.get(vegaWallet).within(() => {
@@ -210,12 +210,12 @@ context(
});
cy.getByTestId('currency-title', txTimeout).should(
'have.length.above',
3
6
);
validateWalletCurrency('Associated', '2.00');
validateWalletCurrency('Pending association', '1.00');
validateWalletCurrency('Total associated after pending', '1.00');
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
verifyEthWalletAssociatedBalance('1.0');
verifyEthWalletTotalAssociatedBalance('1.0');
});
@@ -266,7 +266,7 @@ context(
// 1004-ASSO-008
// 1004-ASSO-010
// No warning visible as described in AC, but the button is disabled
cy.get(ethWalletAssociateButton).first().click();
cy.get(ethWalletAssociateButton).click();
cy.get(associateWalletRadioButton, { timeout: 30000 }).click();
cy.get(tokenSubmitButton, txTimeout).should('be.disabled'); // button disabled with no input
cy.get(tokenAmountInputBox, { timeout: 10000 }).type('6500000');
@@ -278,12 +278,12 @@ context(
vegaWalletAssociate('2');
cy.getByTestId('currency-title', txTimeout).should(
'have.length.above',
3
6
);
validateWalletCurrency('Associated', '0.00');
validateWalletCurrency('Pending association', '2.00');
validateWalletCurrency('Total associated after pending', '2.00');
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
validateWalletCurrency('Associated', '2.00');
});
@@ -294,24 +294,24 @@ context(
});
cy.getByTestId('currency-title', txTimeout).should(
'have.length.above',
3
6
);
validateWalletCurrency('Associated', '2.00');
validateWalletCurrency('Pending association', '2.00');
validateWalletCurrency('Total associated after pending', '0.00');
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
validateWalletCurrency('Associated', '0.00');
});
it('Able to associate tokens to different public key of connected vega wallet', function () {
cy.get(ethWalletAssociateButton).first().click();
cy.get(ethWalletAssociateButton).click();
cy.get(associateWalletRadioButton).click();
cy.get(connectedVegaKey).should(
'have.text',
Cypress.env('vegaWalletPublicKey')
);
cy.get('[data-testid="manage-vega-wallet"]').click();
cy.get('[data-testid="manage-vega-wallet"]:visible').click();
cy.get('[data-testid="select-keypair-button"]').eq(0).click();
cy.get(connectedVegaKey).should(
'have.text',
@@ -166,6 +166,7 @@ export function goToMakeNewProposal(proposalType: string) {
navigateTo(navigation.proposals);
cy.get(newProposalButton).should('be.visible').click();
cy.url().should('include', '/proposals/propose');
cy.get(navigation.pageSpinner, { timeout: 20000 }).should('not.exist');
cy.get('li').should('contain.text', proposalType).and('be.visible');
cy.get('li').contains(proposalType).click();
}
@@ -8,6 +8,7 @@ import {
} from '@vegaprotocol/smart-contracts';
import { ethers, Wallet } from 'ethers';
const associatedAmountInWallet = '[data-testid="associated-amount"]:visible';
const vegaWalletContainer = 'aside [data-testid="vega-wallet"]';
const vegaWalletMnemonic = Cypress.env('vegaWalletMnemonic');
const vegaWalletPubKey = Cypress.env('vegaWalletPublicKey');
@@ -59,7 +60,7 @@ export async function faucetAsset(assetEthAddress: string) {
}
export async function vegaWalletTeardown() {
cy.get('[data-testid="associated-amount"]')
cy.get(associatedAmountInWallet)
.should('be.visible')
.invoke('text')
.then((associatedAmount) => {
@@ -68,12 +69,12 @@ export async function vegaWalletTeardown() {
$body.find('[data-testid="eth-wallet-associated-balances"]').length ||
associatedAmount != '0.00'
) {
vegaWalletTeardownVesting(vestingContract);
vegaWalletTeardownStaking(stakingBridgeContract);
vegaWalletTeardownVesting(vestingContract);
}
});
cy.get(vegaWalletContainer).within(() => {
cy.getByTestId('associated-amount', {
cy.get(associatedAmountInWallet, {
timeout: transactionTimeout,
}).contains('0.00', {
timeout: transactionTimeout,
@@ -90,7 +91,7 @@ export async function vegaWalletSetSpecifiedApprovalAmount(
await promiseWithTimeout(
token.approve(
ethStakingBridgeContractAddress,
resetAmount.concat('000000000000000000')
resetAmount + '0'.repeat(18)
),
10 * 60 * 1000,
'set approval amount'
@@ -104,12 +105,23 @@ async function vegaWalletTeardownStaking(stakingBridgeContract: StakingBridge) {
{ timeout: transactionTimeout, log: false }
).then((stakeBalance) => {
if (Number(stakeBalance) != 0) {
cy.wrap(
stakingBridgeContract.remove_stake(
String(stakeBalance),
vegaWalletPubKey
),
{ timeout: transactionTimeout, log: false }
cy.get('[data-testid="vega-wallet-balance-unstaked"]:visible').within(
() => {
cy.get(associatedAmountInWallet)
.invoke('text')
.then(($walletAmount) => {
cy.wrap(
stakingBridgeContract.remove_stake(
String(stakeBalance),
vegaWalletPubKey
),
{ timeout: transactionTimeout, log: false }
);
cy.get(associatedAmountInWallet, {
timeout: transactionTimeout,
}).should('not.have.text', $walletAmount);
});
}
);
}
});
@@ -124,7 +136,6 @@ async function vegaWalletTeardownVesting(vestingContract: TokenVesting) {
if (Number(vestingAmount) != 0) {
// Wait needed to allow time for ganache to process tx for stakingBridgeContract.remove_stake
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000);
cy.wrap(
vestingContract.remove_stake(String(vestingAmount), vegaWalletPubKey),
{ timeout: transactionTimeout, log: false }
+1 -2
View File
@@ -1,10 +1,10 @@
{
"name": "governance",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/governance/src",
"projectType": "application",
"targets": {
"build": {
"executor": "./tools/executors/webpack:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@@ -41,7 +41,6 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"options": {
"port": 4210,
"buildTarget": "governance:build:development",
@@ -443,8 +443,8 @@
"rewardType": "Reward type",
"rewardsAndFeesReceived": "Rewards and fees received",
"ThisDoesNotIncludeFeesReceivedForMakersOrLiquidityProviders": "This does not include fees received for makers or liquidity providers",
"totalDistributed": "TOTAL DISTRIBUTED",
"earnedByMe": "EARNED BY ME",
"totalDistributed": "Total distributed",
"earnedByMe": "Earned by me",
"noRewardsHaveBeenDistributedYet": "NO REWARDS HAVE BEEN DISTRIBUTED YET",
"rewardsColAssetHeader": "ASSET",
"rewardsColStakingHeader": "STAKING",
@@ -114,7 +114,7 @@ export const RewardsPage = () => {
</p>
</div>
<div className="w-[440px]">
<div className="w-[360px]">
<Toggle
name="epoch-reward-view-toggle"
toggles={[
@@ -155,16 +155,16 @@ export const ValidatorTables = ({
return (
<section data-testid="validator-tables">
<div className="grid w-full justify-end">
<div className="w-[400px]">
<div className="w-[340px]">
<Toggle
name="validators-view-toggle"
toggles={[
{
label: t('ALL VALIDATORS'),
label: t('All validators'),
value: 'all',
},
{
label: t('STAKED BY ME'),
label: t('Staked by me'),
value: 'myStake',
},
]}
@@ -1,4 +1,5 @@
{
"name": "liquidity-provision-dashboard",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/liquidity-provision-dashboard/src",
"projectType": "application",
@@ -47,7 +48,6 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"options": {
"buildTarget": "liquidity-provision-dashboard:build",
"hmr": true,
+1 -2
View File
@@ -1,10 +1,10 @@
{
"name": "multisig-signer",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/multisig-signer/src",
"projectType": "application",
"targets": {
"build": {
"executor": "./tools/executors/webpack:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@@ -38,7 +38,6 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"options": {
"port": 3000,
"buildTarget": "multisig-signer:build:development",
+1 -2
View File
@@ -1,11 +1,11 @@
{
"name": "static",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/static/src",
"tags": [],
"targets": {
"build": {
"executor": "./tools/executors/webpack:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@@ -36,7 +36,6 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"options": {
"buildTarget": "static:build"
},
+565 -65
View File
@@ -3,9 +3,9 @@
"tranche_id": 56,
"tranche_start": "2023-04-20T00:00:00.000Z",
"tranche_end": "2023-05-20T00:00:00.000Z",
"total_added": "13843",
"total_added": "15711.125",
"total_removed": "0",
"locked_amount": "13843",
"locked_amount": "15711.125",
"deposits": [
{
"amount": "241.5",
@@ -67,6 +67,26 @@
"user": "0xdC483901425B2EA6494EaE01ADB6565936E25124",
"tx": "0x14ca69443a14b0f35538856a4fdda6a2b287d7ac6e7c4e600fb797c4c6d44098"
},
{
"amount": "1542.125",
"user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
"tx": "0x34cc25a41e2bf106663fa4cf9880227b0823cf53e1e6069d4b7c526a1b6c6d21"
},
{
"amount": "84.5",
"user": "0x6A228Fffda4D1B3C773b9ce38DA43592581b36FC",
"tx": "0x687fa99f98028fc31d979c3cc72dec17f95d1e6afa305dec9d89632699a24e77"
},
{
"amount": "138",
"user": "0x268070d5EEd5b24E34a5F4C17B5482178b18089D",
"tx": "0x7543f201673298844d68e4dd15222ab85bdd2796b5b95c739d1a1d5c198806e8"
},
{
"amount": "103.5",
"user": "0x697cEF6741F519621fE14c72041e4B8B1f7e2c8A",
"tx": "0xc7483de16af39896b3ae052dd8a6e01fb3dc3794ceb9d2a76d81436992af320e"
},
{
"amount": "50",
"user": "0x15024E62134A8BFFCce11f5ce58CeCDe853038D7",
@@ -296,6 +316,66 @@
"withdrawn_tokens": "0",
"remaining_tokens": "94.875"
},
{
"address": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
"deposits": [
{
"amount": "1542.125",
"user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
"tranche_id": 56,
"tx": "0x34cc25a41e2bf106663fa4cf9880227b0823cf53e1e6069d4b7c526a1b6c6d21"
}
],
"withdrawals": [],
"total_tokens": "1542.125",
"withdrawn_tokens": "0",
"remaining_tokens": "1542.125"
},
{
"address": "0x6A228Fffda4D1B3C773b9ce38DA43592581b36FC",
"deposits": [
{
"amount": "84.5",
"user": "0x6A228Fffda4D1B3C773b9ce38DA43592581b36FC",
"tranche_id": 56,
"tx": "0x687fa99f98028fc31d979c3cc72dec17f95d1e6afa305dec9d89632699a24e77"
}
],
"withdrawals": [],
"total_tokens": "84.5",
"withdrawn_tokens": "0",
"remaining_tokens": "84.5"
},
{
"address": "0x268070d5EEd5b24E34a5F4C17B5482178b18089D",
"deposits": [
{
"amount": "138",
"user": "0x268070d5EEd5b24E34a5F4C17B5482178b18089D",
"tranche_id": 56,
"tx": "0x7543f201673298844d68e4dd15222ab85bdd2796b5b95c739d1a1d5c198806e8"
}
],
"withdrawals": [],
"total_tokens": "138",
"withdrawn_tokens": "0",
"remaining_tokens": "138"
},
{
"address": "0x697cEF6741F519621fE14c72041e4B8B1f7e2c8A",
"deposits": [
{
"amount": "103.5",
"user": "0x697cEF6741F519621fE14c72041e4B8B1f7e2c8A",
"tranche_id": 56,
"tx": "0xc7483de16af39896b3ae052dd8a6e01fb3dc3794ceb9d2a76d81436992af320e"
}
],
"withdrawals": [],
"total_tokens": "103.5",
"withdrawn_tokens": "0",
"remaining_tokens": "103.5"
},
{
"address": "0x15024E62134A8BFFCce11f5ce58CeCDe853038D7",
"deposits": [
@@ -520,9 +600,9 @@
"tranche_id": 54,
"tranche_start": "2023-04-06T00:00:00.000Z",
"tranche_end": "2023-05-06T00:00:00.000Z",
"total_added": "8727",
"total_removed": "57.68717013147",
"locked_amount": "7125.3564502314809751",
"total_added": "8865",
"total_removed": "362.31015740205",
"locked_amount": "5243.2918055555557635",
"deposits": [
{
"amount": "33",
@@ -534,6 +614,16 @@
"user": "0xB0Dbf35C0918536B62a2FbcCC852bCffDB41d6aF",
"tx": "0x60989e406ce3e35e39f93176a45ff46f7c0a293d538a27a685efa7bd350ad92e"
},
{
"amount": "24",
"user": "0xa8bdC133265C7Aab74eA1D00527925e47275D9Ad",
"tx": "0x8e2990dd83380f38f32cd3964e720e86b53a7a5d5f45adc4e0c012f5c0022101"
},
{
"amount": "114",
"user": "0xfD181C18D0442cBbad1207110D09b5fCa8CC8218",
"tx": "0xaa9cfb8f54f0d9066fe0ffaa6742acfb9626485a0497750e61e3d5dc925dfb37"
},
{
"amount": "33",
"user": "0xb5e340788922791727C240c33D27060157845291",
@@ -656,6 +746,21 @@
"user": "0x92A1e98C6f09970e45645Cbe57c6DcaF4547c8FE",
"tx": "0xb9b9b6b0882ad6e197e540e034c39e785f8b77372ac03f93d2f8960e8cde658b"
},
{
"amount": "155.03186111556",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
"tx": "0x7da34162df1b167ed5a3de6d98759af7100bcd51ec4e4c55abce2d145c98ba15"
},
{
"amount": "60.16845949026",
"user": "0x15024E62134A8BFFCce11f5ce58CeCDe853038D7",
"tx": "0x5f8e8e83b18d0bc718c83a9afb0594e95a7b8ea2eea3d83cfbb770be317cfd70"
},
{
"amount": "89.42266666476",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
"tx": "0x05d086879e23724f1397d41adcbe2f3316dd4039c240edbc3cbbcacf1ca1d00e"
},
{
"amount": "52.2185023074",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
@@ -693,6 +798,36 @@
"withdrawn_tokens": "0",
"remaining_tokens": "33"
},
{
"address": "0xa8bdC133265C7Aab74eA1D00527925e47275D9Ad",
"deposits": [
{
"amount": "24",
"user": "0xa8bdC133265C7Aab74eA1D00527925e47275D9Ad",
"tranche_id": 54,
"tx": "0x8e2990dd83380f38f32cd3964e720e86b53a7a5d5f45adc4e0c012f5c0022101"
}
],
"withdrawals": [],
"total_tokens": "24",
"withdrawn_tokens": "0",
"remaining_tokens": "24"
},
{
"address": "0xfD181C18D0442cBbad1207110D09b5fCa8CC8218",
"deposits": [
{
"amount": "114",
"user": "0xfD181C18D0442cBbad1207110D09b5fCa8CC8218",
"tranche_id": 54,
"tx": "0xaa9cfb8f54f0d9066fe0ffaa6742acfb9626485a0497750e61e3d5dc925dfb37"
}
],
"withdrawals": [],
"total_tokens": "114",
"withdrawn_tokens": "0",
"remaining_tokens": "114"
},
{
"address": "0xb5e340788922791727C240c33D27060157845291",
"deposits": [
@@ -839,6 +974,18 @@
}
],
"withdrawals": [
{
"amount": "155.03186111556",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
"tranche_id": 54,
"tx": "0x7da34162df1b167ed5a3de6d98759af7100bcd51ec4e4c55abce2d145c98ba15"
},
{
"amount": "89.42266666476",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
"tranche_id": 54,
"tx": "0x05d086879e23724f1397d41adcbe2f3316dd4039c240edbc3cbbcacf1ca1d00e"
},
{
"amount": "52.2185023074",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
@@ -847,8 +994,8 @@
}
],
"total_tokens": "858",
"withdrawn_tokens": "52.2185023074",
"remaining_tokens": "805.7814976926"
"withdrawn_tokens": "296.67303008772",
"remaining_tokens": "561.32696991228"
},
{
"address": "0x0bBf7580e036eA5D69ABe679CC90117EeC2e3dc1",
@@ -875,10 +1022,17 @@
"tx": "0x67855754e5b66b548c11d1c5377c8b7786d107d6064902318ba11dd6eb33b8d0"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "60.16845949026",
"user": "0x15024E62134A8BFFCce11f5ce58CeCDe853038D7",
"tranche_id": 54,
"tx": "0x5f8e8e83b18d0bc718c83a9afb0594e95a7b8ea2eea3d83cfbb770be317cfd70"
}
],
"total_tokens": "177",
"withdrawn_tokens": "0",
"remaining_tokens": "177"
"withdrawn_tokens": "60.16845949026",
"remaining_tokens": "116.83154050974"
},
{
"address": "0xAc1c2783d64c29CDB79608f5B66a37Fd1ea35dD6",
@@ -1158,7 +1312,7 @@
"tranche_start": "2023-03-06T00:00:00.000Z",
"tranche_end": "2023-04-06T00:00:00.000Z",
"total_added": "14099",
"total_removed": "2337.49002352036",
"total_removed": "3112.49002352036",
"locked_amount": "0",
"deposits": [
{
@@ -1958,6 +2112,16 @@
"user": "0x4081455DB9Ec3B9b66f370Fa12161E6763c40779",
"tx": "0xaf39ced29169a9e88e845cb6c069496920a0ad473b5bc4a0896df4154f51de10"
},
{
"amount": "745",
"user": "0x981D29D939cAa4ADC04A5e44224dBB45539E8730",
"tx": "0x2db650d52bf11faa6981f557d876bf65b9a3f28861eec847f5d3aa6ee0089843"
},
{
"amount": "30",
"user": "0xd5BF378669d8ff4A3f65f577DDB55f2d7bb6f706",
"tx": "0xcb0e4d8bc79d0a6dc08926fdf0fbc791cf78c93e6cfed2fdd7e6e27ffdb8e772"
},
{
"amount": "19.9634296593",
"user": "0x47e6217C1667e2B1fD177Ab8fD89037bCEC7dc6C",
@@ -2664,10 +2828,17 @@
"tx": "0x46d80a145d2f49ef3152cbfaa6d2bb054deabe21396ab43553a3f076e2db62e1"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "745",
"user": "0x981D29D939cAa4ADC04A5e44224dBB45539E8730",
"tranche_id": 53,
"tx": "0x2db650d52bf11faa6981f557d876bf65b9a3f28861eec847f5d3aa6ee0089843"
}
],
"total_tokens": "745",
"withdrawn_tokens": "0",
"remaining_tokens": "745"
"withdrawn_tokens": "745",
"remaining_tokens": "0"
},
{
"address": "0xF3C6c37B9EBB4D21e8bf119841C0e0e296e3EA04",
@@ -3865,10 +4036,17 @@
"tx": "0x819f57b15fef080ab898405133d798a683e5fd805682901e160f5c0187c5fb16"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "30",
"user": "0xd5BF378669d8ff4A3f65f577DDB55f2d7bb6f706",
"tranche_id": 53,
"tx": "0xcb0e4d8bc79d0a6dc08926fdf0fbc791cf78c93e6cfed2fdd7e6e27ffdb8e772"
}
],
"total_tokens": "30",
"withdrawn_tokens": "0",
"remaining_tokens": "30"
"withdrawn_tokens": "30",
"remaining_tokens": "0"
},
{
"address": "0xa7B28013389C4E74718Ca9d90fC2644aAf754A0e",
@@ -4145,7 +4323,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "86666.297",
"total_removed": "0",
"locked_amount": "56391.0711977615670123758",
"locked_amount": "54788.2476184172999611065",
"deposits": [
{
"amount": "86666.297",
@@ -4211,7 +4389,7 @@
"tranche_end": "2023-06-01T00:00:00.000Z",
"total_added": "2500",
"total_removed": "0",
"locked_amount": "693.601349460724325",
"locked_amount": "600.8763227513228",
"deposits": [
{
"amount": "2500",
@@ -4332,7 +4510,7 @@
"tranche_end": "2023-09-01T00:00:00.000Z",
"total_added": "17500",
"total_removed": "0",
"locked_amount": "13552.43543050523525",
"locked_amount": "12910.415408615137",
"deposits": [
{
"amount": "12500",
@@ -4598,8 +4776,8 @@
"tranche_start": "2023-02-01T00:00:00.000Z",
"tranche_end": "2023-08-01T00:00:00.000Z",
"total_added": "37500",
"total_removed": "12043.9778043",
"locked_amount": "23099.62256368938",
"total_removed": "12294.731717775",
"locked_amount": "21701.062768569675",
"deposits": [
{
"amount": "7500",
@@ -4618,6 +4796,16 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xe12a6d600113d4db203454713340e902cb62aa16534dec0b8d42772868e9cfe7"
},
{
"amount": "107.320442025",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x07414226f479239baa4081a211d749f54d8fe507067b1d3b122eb47bc69ff569"
},
{
"amount": "143.43347145",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x2c8a0681fe27258861489cd7a891cf213c7ab930d86b1bf08cd54f2f3739a8b5"
},
{
"amount": "158.943370125",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -4762,6 +4950,18 @@
"tranche_id": 34,
"tx": "0xe12a6d600113d4db203454713340e902cb62aa16534dec0b8d42772868e9cfe7"
},
{
"amount": "107.320442025",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 34,
"tx": "0x07414226f479239baa4081a211d749f54d8fe507067b1d3b122eb47bc69ff569"
},
{
"amount": "143.43347145",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 34,
"tx": "0x2c8a0681fe27258861489cd7a891cf213c7ab930d86b1bf08cd54f2f3739a8b5"
},
{
"amount": "158.943370125",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -4902,8 +5102,8 @@
}
],
"total_tokens": "7500",
"withdrawn_tokens": "2808.5285259",
"remaining_tokens": "4691.4714741"
"withdrawn_tokens": "3059.282439375",
"remaining_tokens": "4440.717560625"
},
{
"address": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
@@ -4941,7 +5141,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "129999.45",
"total_removed": "0",
"locked_amount": "56339.6214406902552879735",
"locked_amount": "54738.260236187147286555",
"deposits": [
{
"amount": "129999.45",
@@ -4974,7 +5174,7 @@
"tranche_end": "2024-04-01T00:00:00.000Z",
"total_added": "54144.7663",
"total_removed": "0",
"locked_amount": "52590.57158976900059334338",
"locked_amount": "51591.9435766059257577711",
"deposits": [
{
"amount": "54144.7663",
@@ -5007,7 +5207,7 @@
"tranche_end": "2023-09-03T00:00:00.000Z",
"total_added": "62600",
"total_removed": "0",
"locked_amount": "24781.74125443937238",
"locked_amount": "23624.00451547437818",
"deposits": [
{
"amount": "10000",
@@ -5200,7 +5400,7 @@
"tranche_end": "2023-09-17T00:00:00.000Z",
"total_added": "5000",
"total_removed": "0",
"locked_amount": "2171.1531265854895",
"locked_amount": "2078.6821410451545",
"deposits": [
{
"amount": "5000",
@@ -5740,8 +5940,8 @@
"tranche_start": "2022-11-01T00:00:00.000Z",
"tranche_end": "2023-05-01T00:00:00.000Z",
"total_added": "22500",
"total_removed": "6620.677467",
"locked_amount": "2423.309449815838125",
"total_removed": "6871.43713545",
"locked_amount": "1584.173572744015575",
"deposits": [
{
"amount": "7500",
@@ -5760,6 +5960,16 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x86d038a897c455e098af47a53ffd861a150c68058e75d84b9224d08061075cb2"
},
{
"amount": "107.3146869",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xea8772c7ce65ecfdf87e34cf61b2614212c07d195a9e4d6962fcf758ba08c442"
},
{
"amount": "143.44498155",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x15840e283faffb39a5d0e3389137ec92cec3deee7df535a534908ccd7d6b0873"
},
{
"amount": "158.9433702",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -5959,6 +6169,18 @@
"tranche_id": 33,
"tx": "0x86d038a897c455e098af47a53ffd861a150c68058e75d84b9224d08061075cb2"
},
{
"amount": "107.3146869",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 33,
"tx": "0xea8772c7ce65ecfdf87e34cf61b2614212c07d195a9e4d6962fcf758ba08c442"
},
{
"amount": "143.44498155",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 33,
"tx": "0x15840e283faffb39a5d0e3389137ec92cec3deee7df535a534908ccd7d6b0873"
},
{
"amount": "158.9433702",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -6177,8 +6399,8 @@
}
],
"total_tokens": "7500",
"withdrawn_tokens": "6620.677467",
"remaining_tokens": "879.322533"
"withdrawn_tokens": "6871.43713545",
"remaining_tokens": "628.56286455"
},
{
"address": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
@@ -6203,7 +6425,7 @@
"tranche_end": "2023-06-02T00:00:00.000Z",
"total_added": "1939928.38",
"total_removed": "928642.9598472029154",
"locked_amount": "273684.9802027161627711476",
"locked_amount": "237807.5623674632953210932",
"deposits": [
{
"amount": "1852091.69",
@@ -40019,7 +40241,7 @@
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "3732368.4671",
"total_removed": "715655.108029600523393",
"locked_amount": "445059.852311308028722099718",
"locked_amount": "389928.657761997798045454489",
"deposits": [
{
"amount": "1998.95815",
@@ -41411,8 +41633,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "15870102.715470999700000001",
"total_removed": "831412.54318386417590352",
"locked_amount": "6877841.24636301597211672882901606793565823",
"total_removed": "834257.00587199386490352",
"locked_amount": "6682349.57025217979014250580920627858799674",
"deposits": [
{
"amount": "16249.93",
@@ -41936,6 +42158,36 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x7ca532bd40420cc601c90df506cc041676efc231f9e5822594d611c53de115d1"
},
{
"amount": "673.3243709362775",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x6c9a470f50be5317670260a9d3842614e4dc7f32e9c483582f3d1a8d992864d4"
},
{
"amount": "564.068956625387125",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xb27dbf718e77796051638b35d898c62ffe6bbe0c2aed4e5adaf7cacbcfd1b17a"
},
{
"amount": "404.86444883989775",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x07d1c74ebc4f402882d688c06da30455c4890f66792149aa34dd5c5c7f4a5114"
},
{
"amount": "673.58795260844725",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x1283a5378ec8e25b00c1260eae937285858c4f9ba689ac7c133e1a96602be122"
},
{
"amount": "278.739682710677375",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0xd23bde9b41f3e73644f3e3bf69c25739dc721014516803de4e76724b9ccb6b76"
},
{
"amount": "249.877276409002",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x94df9afacf00f3d2a01e8856c83050a2737cd31f7736ae472bfbb3f19e66f5e4"
},
{
"amount": "998.454771147362375",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -43992,6 +44244,42 @@
"tranche_id": 2,
"tx": "0x7ca532bd40420cc601c90df506cc041676efc231f9e5822594d611c53de115d1"
},
{
"amount": "673.3243709362775",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0x6c9a470f50be5317670260a9d3842614e4dc7f32e9c483582f3d1a8d992864d4"
},
{
"amount": "564.068956625387125",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0xb27dbf718e77796051638b35d898c62ffe6bbe0c2aed4e5adaf7cacbcfd1b17a"
},
{
"amount": "404.86444883989775",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0x07d1c74ebc4f402882d688c06da30455c4890f66792149aa34dd5c5c7f4a5114"
},
{
"amount": "673.58795260844725",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0x1283a5378ec8e25b00c1260eae937285858c4f9ba689ac7c133e1a96602be122"
},
{
"amount": "278.739682710677375",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0xd23bde9b41f3e73644f3e3bf69c25739dc721014516803de4e76724b9ccb6b76"
},
{
"amount": "249.877276409002",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tranche_id": 2,
"tx": "0x94df9afacf00f3d2a01e8856c83050a2737cd31f7736ae472bfbb3f19e66f5e4"
},
{
"amount": "998.454771147362375",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -45428,8 +45716,8 @@
}
],
"total_tokens": "259998.8875",
"withdrawn_tokens": "147055.736929033255125",
"remaining_tokens": "112943.150570966744875"
"withdrawn_tokens": "149900.199617162944125",
"remaining_tokens": "110098.687882837055875"
},
{
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
@@ -47780,8 +48068,8 @@
"tranche_start": "2021-11-05T00:00:00.000Z",
"tranche_end": "2023-05-05T00:00:00.000Z",
"total_added": "14597706.0446472999",
"total_removed": "5824494.904776281619295136",
"locked_amount": "628133.8969210297717459520010294846",
"total_removed": "5844057.348231362114420626",
"locked_amount": "447657.2297616420148104652270758603",
"deposits": [
{
"amount": "129284.449",
@@ -48010,6 +48298,51 @@
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0xeb3074f26ba5b01f54b2e34889b4832542b0269fa47fd5874d7f266a435da128"
},
{
"amount": "934.07546498576643775",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x98bfad2d34e3a47b0487e1219456287f109dfb14658df5848c2f801247039314"
},
{
"amount": "771.74274329335158625",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0xca63b7531ec4b383cd6a69ed94313e68cac27f5af75b2ba1e6d5607f0f25810a"
},
{
"amount": "570.76807052329924925",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x2825f014fc3902bc2e8f41823cee18aefa209a0763f9a5bafe6b6b5b956bf45a"
},
{
"amount": "14990.57490287555017806",
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
"tx": "0x0d970fd46e511e419ec9c040ac873302023b1f14ba66cda4efc9b76439569cba"
},
{
"amount": "155.90688399188605818",
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
"tx": "0x2830acf9d15cbaeaec3ad60506f4c6542a63ffbedeab7408f30adb495e8ec7cb"
},
{
"amount": "933.80141068366436375",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x07fdd83f04929f7f0adba54f0af9c1cb4e266e430ed0188ca1f02b7b528f73be"
},
{
"amount": "386.69353993983405875",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x3f8387f07e77c7734dc9fde19c9b0882c9192685f97be72c15f681e4be3f39ca"
},
{
"amount": "346.2245518019684565",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x467e16d3f10ba66de4ab7452682f50266a731200be9e036c9b35692e0d447572"
},
{
"amount": "472.655886985174737",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0xca4c0571969c50f47990b214485913df8e2b7d1d92cdd6ac4c8bcc6ce760ce0b"
},
{
"amount": "37462.74710421168752574",
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
@@ -51243,6 +51576,48 @@
"tranche_id": 3,
"tx": "0xeb3074f26ba5b01f54b2e34889b4832542b0269fa47fd5874d7f266a435da128"
},
{
"amount": "934.07546498576643775",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x98bfad2d34e3a47b0487e1219456287f109dfb14658df5848c2f801247039314"
},
{
"amount": "771.74274329335158625",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0xca63b7531ec4b383cd6a69ed94313e68cac27f5af75b2ba1e6d5607f0f25810a"
},
{
"amount": "570.76807052329924925",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x2825f014fc3902bc2e8f41823cee18aefa209a0763f9a5bafe6b6b5b956bf45a"
},
{
"amount": "933.80141068366436375",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x07fdd83f04929f7f0adba54f0af9c1cb4e266e430ed0188ca1f02b7b528f73be"
},
{
"amount": "386.69353993983405875",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x3f8387f07e77c7734dc9fde19c9b0882c9192685f97be72c15f681e4be3f39ca"
},
{
"amount": "346.2245518019684565",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0x467e16d3f10ba66de4ab7452682f50266a731200be9e036c9b35692e0d447572"
},
{
"amount": "472.655886985174737",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tranche_id": 3,
"tx": "0xca4c0571969c50f47990b214485913df8e2b7d1d92cdd6ac4c8bcc6ce760ce0b"
},
{
"amount": "1383.345213676043696",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -53981,8 +54356,8 @@
}
],
"total_tokens": "359123.469575",
"withdrawn_tokens": "343304.56277369828704375",
"remaining_tokens": "15818.90680130171295625"
"withdrawn_tokens": "347720.524441911345933",
"remaining_tokens": "11402.945133088654067"
},
{
"address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB",
@@ -54218,6 +54593,18 @@
"tranche_id": 3,
"tx": "0xa22abf6f3db05a14a0c55fc053a05218f412ad15be9a022580b2ca99ed805bf7"
},
{
"amount": "14990.57490287555017806",
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
"tranche_id": 3,
"tx": "0x0d970fd46e511e419ec9c040ac873302023b1f14ba66cda4efc9b76439569cba"
},
{
"amount": "155.90688399188605818",
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
"tranche_id": 3,
"tx": "0x2830acf9d15cbaeaec3ad60506f4c6542a63ffbedeab7408f30adb495e8ec7cb"
},
{
"amount": "37462.74710421168752574",
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
@@ -54592,8 +54979,8 @@
}
],
"total_tokens": "1266324.603486",
"withdrawn_tokens": "1205672.9366923092797574",
"remaining_tokens": "60651.6667936907202426"
"withdrawn_tokens": "1220819.41847917671599364",
"remaining_tokens": "45505.18500682328400636"
},
{
"address": "0xC5d9221EB9c28A69859264c0A2Fe0d3272228296",
@@ -55421,7 +55808,7 @@
"tranche_start": "2021-10-05T00:00:00.000Z",
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "5778205.3912159303",
"total_removed": "3421590.665302980803025769",
"total_removed": "3421810.610823310514313769",
"locked_amount": "0",
"deposits": [
{
@@ -55566,6 +55953,11 @@
}
],
"withdrawals": [
{
"amount": "219.945520329711288",
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
"tx": "0x4680e076a50f1fde4339e9edacd3bd4cb8fe3ce5a3b0a7cb7917f7ace67b537a"
},
{
"amount": "10509.407528939748325",
"user": "0xBc934494675a6ceB639B9EfEe5b9C0f017D35a75",
@@ -57224,6 +57616,12 @@
}
],
"withdrawals": [
{
"amount": "219.945520329711288",
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
"tranche_id": 4,
"tx": "0x4680e076a50f1fde4339e9edacd3bd4cb8fe3ce5a3b0a7cb7917f7ace67b537a"
},
{
"amount": "13312.213609122936225",
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
@@ -57490,8 +57888,8 @@
}
],
"total_tokens": "331498.5873",
"withdrawn_tokens": "331278.641779670288712",
"remaining_tokens": "219.945520329711288"
"withdrawn_tokens": "331498.5873",
"remaining_tokens": "0"
},
{
"address": "0x16da609341ed67750A8BCC5AAa2005471006Cd77",
@@ -57593,8 +57991,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "472355.6199999996",
"total_removed": "42362.8219648421949",
"locked_amount": "70522.262691004502909998496803656",
"total_removed": "43120.0853616251849",
"locked_amount": "61786.424749621320244693540030452",
"deposits": [
{
"amount": "3000",
@@ -64223,6 +64621,31 @@
"user": "0xa9a677b0a3Be231C0654CabB0Eaa0A72E91B3E8d",
"tx": "0xc0db5f216679203b937bf90415f24231997ea35bc1d418af30913aa313be498d"
},
{
"amount": "45.503272452",
"user": "0x9347177014d3fEA775b5B29fFC96bF6B911686F9",
"tx": "0xd1d4724eae5566e3162c1b210a19d73f5a2e4b9b3d52d9d1e77c4b9cb9bdc2e1"
},
{
"amount": "26.662404872",
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
"tx": "0x7c02dcf328b3538b3c8cd11d19cb0d21859ebfdda209b30546358092870deb23"
},
{
"amount": "343.420230844",
"user": "0x981D29D939cAa4ADC04A5e44224dBB45539E8730",
"tx": "0x53b7d1e71a9bc909cd594c4d62380ba31cd0d8687a5894ad62bfa48733e73174"
},
{
"amount": "257.36242012299",
"user": "0x07d1a589447395fe78bca3627Cb82F7C3310f598",
"tx": "0x71bd2cf2152fd2175e3a63a2ba70ffc4db0d8d47c8feb493ae9de59c9164ffcf"
},
{
"amount": "84.315068492",
"user": "0x40447e8eDee2F8D0088844E35Ff7aD2Bb5fCabfb",
"tx": "0x2aa7bdc96b05e86a7c689062112e932630e7e14b7f05534af1a5d140fc2a88c4"
},
{
"amount": "19.918569252",
"user": "0xcB555C5602cC0b2434A27d277e14Cb5C7bF4Ead1",
@@ -72969,10 +73392,17 @@
"tx": "0x057f65938b1360b6d2c4ebf5e789c67897cf60cb6a13f947004def03891afbd8"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "257.36242012299",
"user": "0x07d1a589447395fe78bca3627Cb82F7C3310f598",
"tranche_id": 5,
"tx": "0x71bd2cf2152fd2175e3a63a2ba70ffc4db0d8d47c8feb493ae9de59c9164ffcf"
}
],
"total_tokens": "299",
"withdrawn_tokens": "0",
"remaining_tokens": "299"
"withdrawn_tokens": "257.36242012299",
"remaining_tokens": "41.63757987701"
},
{
"address": "0xA257E4Fcf635a1ba1BA32C6f063a3037f1741453",
@@ -75813,6 +76243,12 @@
}
],
"withdrawals": [
{
"amount": "84.315068492",
"user": "0x40447e8eDee2F8D0088844E35Ff7aD2Bb5fCabfb",
"tranche_id": 5,
"tx": "0x2aa7bdc96b05e86a7c689062112e932630e7e14b7f05534af1a5d140fc2a88c4"
},
{
"amount": "89.067954084",
"user": "0x40447e8eDee2F8D0088844E35Ff7aD2Bb5fCabfb",
@@ -75821,8 +76257,8 @@
}
],
"total_tokens": "200",
"withdrawn_tokens": "89.067954084",
"remaining_tokens": "110.932045916"
"withdrawn_tokens": "173.383022576",
"remaining_tokens": "26.616977424"
},
{
"address": "0x1bAc2912394A42Cec87767327FC039f2EfBB95Dd",
@@ -78183,6 +78619,12 @@
}
],
"withdrawals": [
{
"amount": "26.662404872",
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
"tranche_id": 5,
"tx": "0x7c02dcf328b3538b3c8cd11d19cb0d21859ebfdda209b30546358092870deb23"
},
{
"amount": "15.02267884",
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
@@ -78281,8 +78723,8 @@
}
],
"total_tokens": "400",
"withdrawn_tokens": "316.228754436",
"remaining_tokens": "83.771245564"
"withdrawn_tokens": "342.891159308",
"remaining_tokens": "57.108840692"
},
{
"address": "0x5c90765F50629570738fEe7b7FA82ae118f81Ed1",
@@ -79438,10 +79880,17 @@
"tx": "0x9f916cf09e8a3c4ade0ffce5190db464d0a2b1dadba78e1ee7ba5d6e751d6148"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "343.420230844",
"user": "0x981D29D939cAa4ADC04A5e44224dBB45539E8730",
"tranche_id": 5,
"tx": "0x53b7d1e71a9bc909cd594c4d62380ba31cd0d8687a5894ad62bfa48733e73174"
}
],
"total_tokens": "400",
"withdrawn_tokens": "0",
"remaining_tokens": "400"
"withdrawn_tokens": "343.420230844",
"remaining_tokens": "56.579769156"
},
{
"address": "0x5f59907Ef66f016aE218Db5CE06917Ed6a87F02D",
@@ -81339,6 +81788,12 @@
}
],
"withdrawals": [
{
"amount": "45.503272452",
"user": "0x9347177014d3fEA775b5B29fFC96bF6B911686F9",
"tranche_id": 5,
"tx": "0xd1d4724eae5566e3162c1b210a19d73f5a2e4b9b3d52d9d1e77c4b9cb9bdc2e1"
},
{
"amount": "47.970776254",
"user": "0x9347177014d3fEA775b5B29fFC96bF6B911686F9",
@@ -81353,8 +81808,8 @@
}
],
"total_tokens": "200",
"withdrawn_tokens": "125.533250886",
"remaining_tokens": "74.466749114"
"withdrawn_tokens": "171.036523338",
"remaining_tokens": "28.963476662"
},
{
"address": "0x1a268a88b586B475FF4bD86882bF2f9D79875964",
@@ -87223,7 +87678,7 @@
"tranche_start": "2021-12-05T00:00:00.000Z",
"tranche_end": "2022-06-05T00:00:00.000Z",
"total_added": "171288.42",
"total_removed": "69140.5995794947989",
"total_removed": "69390.5995794947989",
"locked_amount": "0",
"deposits": [
{
@@ -91458,6 +91913,11 @@
"user": "0xC1991C8BDA29507991EEB230FF2063C2eA74a34C",
"tx": "0x71a163020ce928ca230a50c099b8baaf60af6191d6cbc46edc004239d3ff9901"
},
{
"amount": "250",
"user": "0x0715B8bA27dB75F7601A9D8E22c15dcA1487FB70",
"tx": "0x11c685c41ff0c2d5f1d7fe3b08dc84a7ddb9160764a45bc61b8f39df94729634"
},
{
"amount": "1250",
"user": "0x9405F540EcC1204801De5C4444D06386BD6693F0",
@@ -100279,10 +100739,17 @@
"tx": "0x057f65938b1360b6d2c4ebf5e789c67897cf60cb6a13f947004def03891afbd8"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "250",
"user": "0x0715B8bA27dB75F7601A9D8E22c15dcA1487FB70",
"tranche_id": 6,
"tx": "0x11c685c41ff0c2d5f1d7fe3b08dc84a7ddb9160764a45bc61b8f39df94729634"
}
],
"total_tokens": "250",
"withdrawn_tokens": "0",
"remaining_tokens": "250"
"withdrawn_tokens": "250",
"remaining_tokens": "0"
},
{
"address": "0x027306C886Da27fa29Ce9B4DB489C6E44d2ECc55",
@@ -142717,6 +143184,21 @@
}
],
"withdrawals": [
{
"amount": "0",
"user": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
"tx": "0x882126a437003e60226611d623415bf2e00befa69d76aba57fd4cf1c5b403d1f"
},
{
"amount": "0",
"user": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
"tx": "0xf4cdc0b0f6c24cb52dd0126bc6bff9c75ec715502809f9c80d675327beb4889d"
},
{
"amount": "0",
"user": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
"tx": "0x11aafa8a2fb510a50d52e5d1e149c5c2027ad2c3dc2d9ef67c18d391c0331c49"
},
{
"amount": "0",
"user": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
@@ -142987,6 +143469,24 @@
}
],
"withdrawals": [
{
"amount": "0",
"user": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
"tranche_id": 9,
"tx": "0x882126a437003e60226611d623415bf2e00befa69d76aba57fd4cf1c5b403d1f"
},
{
"amount": "0",
"user": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
"tranche_id": 9,
"tx": "0xf4cdc0b0f6c24cb52dd0126bc6bff9c75ec715502809f9c80d675327beb4889d"
},
{
"amount": "0",
"user": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
"tranche_id": 9,
"tx": "0x11aafa8a2fb510a50d52e5d1e149c5c2027ad2c3dc2d9ef67c18d391c0331c49"
},
{
"amount": "0",
"user": "0x759C9ABABA492500c4c730bEB568B5b851Dec2c7",
+1
View File
@@ -0,0 +1 @@
apps/trading-e2e/.env.capsule
+1
View File
@@ -0,0 +1 @@
apps/trading-e2e/.env.stagnet3
+4 -1
View File
@@ -1,4 +1,5 @@
{
"name": "trading-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/trading-e2e/src",
"projectType": "application",
@@ -15,7 +16,9 @@
},
"live": {
"devServerTarget": ""
}
},
"capsule": {},
"stagnet3": {}
}
},
"lint": {
@@ -41,6 +41,12 @@ describe('accounts', { tags: '@smoke' }, () => {
.should('have.text', '100,001.01');
});
it('asset detail should be properly rendered', () => {
cy.getByTestId('Collateral').click();
cy.getByTestId('asset').contains('tEURO').click();
cy.get('[data-testid$="_label"]').should('have.length', 16);
});
describe('sorting by ag-grid columns should work well', () => {
it('sorting by asset', () => {
cy.getByTestId('Collateral').click();
-11
View File
@@ -1,17 +1,6 @@
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_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
NX_VEGA_CONFIG_URL=''
NX_VEGA_ENV=CUSTOM
NX_VEGA_EXPLORER_URL=https://stagnet3.explorer.vega.xyz
NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"https://stagnet1.console.vega.xyz\",\"STAGNET3\":\"https://stagnet3.console.vega.xyz\"}
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
NX_VEGA_URL=http://localhost:3028/query
NX_VEGA_WALLET_URL=http://localhost:1789
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
NX_ETH_LOCAL_PROVIDER_URL=http://localhost:8545/
NX_ETH_WALLET_MNEMONIC="ozone access unlock valid olympic save include omit supply green clown session"
-10
View File
@@ -1,14 +1,4 @@
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_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/devnet1/vegawallet-devnet1.toml
NX_VEGA_ENV=DEVNET
NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz
NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"https://stagnet1.console.vega.xyz\",\"STAGNET3\":\"https://stagnet3.console.vega.xyz\"}
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
NX_VEGA_WALLET_URL=http://localhost:1789
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega-dev-releases/releases
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
NX_VEGA_INCIDENT_URL=https://blog.vega.xyz/tagged/vega-incident-reports
+1
View File
@@ -0,0 +1 @@
.env.capsule
+1
View File
@@ -0,0 +1 @@
.env.devnet
+1
View File
@@ -0,0 +1 @@
.env.mainnet
+1
View File
@@ -0,0 +1 @@
.env.stagnet1
+1
View File
@@ -0,0 +1 @@
.env.stagnet3
+1
View File
@@ -0,0 +1 @@
.env.testnet
+1
View File
@@ -0,0 +1 @@
.env.validator-testnet
-5
View File
@@ -1,13 +1,8 @@
NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
NX_ETHERSCAN_URL=https://etherscan.io
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/mainnet1/mainnet1.toml
NX_VEGA_ENV=MAINNET
NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz
NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\",\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"https://stagnet1.console.vega.xyz\",\"STAGNET3\":\"https://stagnet3.console.vega.xyz\"}
NX_VEGA_TOKEN_URL=https://token.vega.xyz
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
+1
View File
@@ -0,0 +1 @@
.env.capsule
+1
View File
@@ -0,0 +1 @@
.env.devnet
+1
View File
@@ -0,0 +1 @@
.env.mainnet
+1
View File
@@ -0,0 +1 @@
.env.stagnet1
+1
View File
@@ -0,0 +1 @@
.env.stagnet3
+1
View File
@@ -0,0 +1 @@
.env.testnet
+1
View File
@@ -0,0 +1 @@
.env.validator-testnet
-10
View File
@@ -1,14 +1,4 @@
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_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet1/vegawallet-stagnet1.toml
NX_VEGA_ENV=STAGNET1
NX_VEGA_EXPLORER_URL=https://stagnet1.explorer.vega.xyz
NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"https://stagnet1.console.vega.xyz\",\"STAGNET3\":\"https://stagnet3.console.vega.xyz\"}
NX_VEGA_TOKEN_URL=https://stagnet1.token.vega.xyz
NX_VEGA_WALLET_URL=http://localhost:1789
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
NX_VEGA_INCIDENT_URL=https://blog.vega.xyz/tagged/vega-incident-reports
-10
View File
@@ -1,14 +1,4 @@
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_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet3/vegawallet-stagnet3.toml
NX_VEGA_ENV=STAGNET3
NX_VEGA_EXPLORER_URL=https://stagnet3.explorer.vega.xyz
NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"https://stagnet1.console.vega.xyz\",\"STAGNET3\":\"https://stagnet3.console.vega.xyz\"}
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
NX_VEGA_WALLET_URL=http://localhost:1789
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega-dev-releases/releases
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
NX_VEGA_INCIDENT_URL=https://blog.vega.xyz/tagged/vega-incident-reports
-11
View File
@@ -1,14 +1,3 @@
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_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml
NX_VEGA_ENV=TESTNET
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
NX_VEGA_NETWORKS={\"TESTNET\":\"https://console.fairground.wtf\",\"STAGNET1\":\"https://stagnet1.console.vega.xyz\",\"STAGNET3\":\"https://stagnet3.console.vega.xyz\"}
NX_VEGA_TOKEN_URL=https://token.fairground.wtf
NX_VEGA_WALLET_URL=http://localhost:1789
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
NX_VEGA_INCIDENT_URL=https://blog.vega.xyz/tagged/vega-incident-reports
-10
View File
@@ -1,14 +1,4 @@
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_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/testnet2/testnet2.toml
NX_VEGA_ENV=VALIDATOR_TESTNET
NX_VEGA_EXPLORER_URL=https://validator-testnet.explorer.vega.xyz
NX_VEGA_NETWORKS={\"STAGNET3\":\"https://stagnet3.console.vega.xyz\",\"STAGNET1\":\"https://stagnet1.console.vega.xyz\",\"TESTNET\":\"https://console.fairground.wtf\"}
NX_VEGA_TOKEN_URL=https://validator-testnet.governance.fairground.wtf
NX_VEGA_WALLET_URL=http://localhost:1789
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega/releases
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
NX_VEGA_INCIDENT_URL=https://blog.vega.xyz/tagged/vega-incident-reports
@@ -7,7 +7,11 @@ import {
} from '@vegaprotocol/types';
import type { VegaStoredTxState } from '@vegaprotocol/wallet';
import { VegaTxStatus } from '@vegaprotocol/wallet';
import { VegaTransactionDetails } from './use-vega-transaction-toasts';
import {
VegaTransactionDetails,
getVegaTransactionContentIntent,
} from './use-vega-transaction-toasts';
import { Intent } from '@vegaprotocol/ui-toolkit';
jest.mock('@vegaprotocol/assets', () => {
const A1 = {
@@ -278,3 +282,27 @@ describe('VegaTransactionDetails', () => {
expect(queryByTestId('toast-panel')?.textContent).toEqual(details);
});
});
describe('getVegaTransactionContentIntent', () => {
it('returns the correct intent for a transaction', () => {
expect(getVegaTransactionContentIntent(withdraw).intent).toBe(
Intent.Primary
);
expect(getVegaTransactionContentIntent(submitOrder).intent).toBe(
Intent.Success
);
expect(getVegaTransactionContentIntent(editOrder).intent).toBe(
Intent.Primary
);
expect(getVegaTransactionContentIntent(cancelOrder).intent).toBe(
Intent.Primary
);
expect(getVegaTransactionContentIntent(cancelAll).intent).toBe(
Intent.Primary
);
expect(getVegaTransactionContentIntent(closePosition).intent).toBe(
Intent.Primary
);
expect(getVegaTransactionContentIntent(batch).intent).toBe(Intent.Primary);
});
});
@@ -547,7 +547,11 @@ const VegaTxCompleteToastsContent = ({ tx }: VegaTxToastContentProps) => {
return (
<>
<ToastHeading>{t('Confirmed')}</ToastHeading>
<ToastHeading>
{tx.order?.status
? getOrderToastTitle(tx.order.status)
: t('Confirmed')}
</ToastHeading>
<p>{t('Your transaction has been confirmed ')}</p>
{tx.txHash && (
<p className="break-all">
@@ -634,25 +638,8 @@ export const useVegaTransactionToasts = () => {
);
const fromVegaTransaction = (tx: VegaStoredTxState): Toast => {
let content: ToastContent;
const closeAfter = isFinal(tx) ? CLOSE_AFTER : undefined;
if (tx.status === VegaTxStatus.Requested) {
content = <VegaTxRequestedToastContent tx={tx} />;
}
if (tx.status === VegaTxStatus.Pending) {
content = <VegaTxPendingToastContentProps tx={tx} />;
}
if (tx.status === VegaTxStatus.Complete) {
content = <VegaTxCompleteToastsContent tx={tx} />;
}
if (tx.status === VegaTxStatus.Error) {
content = <VegaTxErrorToastContent tx={tx} />;
}
// Transaction can be successful but the order can be rejected by the network
const intent =
(tx.order && getOrderToastIntent(tx.order.status)) ||
intentMap[tx.status];
const { intent, content } = getVegaTransactionContentIntent(tx);
return {
id: `vega-${tx.id}`,
@@ -676,3 +663,27 @@ export const useVegaTransactionToasts = () => {
}
);
};
export const getVegaTransactionContentIntent = (tx: VegaStoredTxState) => {
let content: ToastContent;
if (tx.status === VegaTxStatus.Requested) {
content = <VegaTxRequestedToastContent tx={tx} />;
}
if (tx.status === VegaTxStatus.Pending) {
content = <VegaTxPendingToastContentProps tx={tx} />;
}
if (tx.status === VegaTxStatus.Complete) {
content = <VegaTxCompleteToastsContent tx={tx} />;
}
if (tx.status === VegaTxStatus.Error) {
content = <VegaTxErrorToastContent tx={tx} />;
}
// Transaction can be successful but the order can be rejected by the network
const intent =
(tx.order &&
!isOrderAmendmentTransaction(tx.body) &&
getOrderToastIntent(tx.order.status)) ||
intentMap[tx.status];
return { intent, content };
};
+15
View File
@@ -33,6 +33,8 @@ import { ViewingBanner } from '../components/viewing-banner';
import { Banner } from '../components/banner';
import { AppLoader, DynamicLoader } from '../components/app-loader';
import { Navbar } from '../components/navbar';
import { useDataProvider } from '@vegaprotocol/react-helpers';
import { activeOrdersProvider } from '@vegaprotocol/orders';
const DEFAULT_TITLE = t('Welcome to Vega trading!');
@@ -95,6 +97,7 @@ function AppBody({ Component }: AppProps) {
<ToastsManager />
<InitializeHandlers />
<MaybeConnectEagerly />
<PartyData />
</div>
);
}
@@ -127,6 +130,18 @@ function VegaTradingApp(props: AppProps) {
export default VegaTradingApp;
const PartyData = () => {
const { pubKey } = useVegaWallet();
const variables = { partyId: pubKey || '' };
const skip = !pubKey;
useDataProvider({
dataProvider: activeOrdersProvider,
variables,
skip,
});
return null;
};
const MaybeConnectEagerly = () => {
useVegaEagerConnect(Connectors);
useEthereumEagerConnect();
+29 -5
View File
@@ -1,10 +1,11 @@
{
"name": "trading",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/trading",
"projectType": "application",
"targets": {
"build": {
"executor": "./tools/executors/next:build",
"executor": "@nrwl/next:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@@ -15,11 +16,18 @@
"production": {
"optimization": true,
"sourceMap": true
}
},
"capsule": {},
"devnet": {},
"mainnet": {},
"stagnet1": {},
"stagnet3": {},
"testnet": {},
"validator-testnet": {}
}
},
"serve": {
"executor": "./tools/executors/next:serve",
"executor": "@nrwl/next:server",
"options": {
"buildTarget": "trading:build",
"dev": true
@@ -28,13 +36,29 @@
"production": {
"buildTarget": "trading:build:production",
"dev": false
}
},
"capsule": {},
"devnet": {},
"mainnet": {},
"stagnet1": {},
"stagnet3": {},
"testnet": {},
"validator-testnet": {}
}
},
"export": {
"executor": "./tools/executors/next:export",
"executor": "@nrwl/next:export",
"options": {
"buildTarget": "trading:build:production"
},
"configurations": {
"capsule": {},
"devnet": {},
"mainnet": {},
"stagnet1": {},
"stagnet3": {},
"testnet": {},
"validator-testnet": {}
}
},
"test": {
+6
View File
@@ -0,0 +1,6 @@
FROM --platform=amd64 nginx:1.23-alpine@sha256:6318314189b40e73145a48060bff4783a116c34cc7241532d0d94198fb2c9629
EXPOSE 80
WORKDIR /usr/share/nginx/html
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
RUN rm -rf /usr/share/nginx/html/*
COPY ./dist-result/ /usr/share/nginx/html/
+3 -5
View File
@@ -5,7 +5,9 @@ export PATH="/app/node_modules/.bin:$PATH"
flags="--network-timeout 100000 --pure-lockfile"
if [[ ! -z "${ENV_NAME}" ]]; then
flags="--env=${ENV_NAME} $flags"
if [[ "${ENV_NAME}" != "ops-vega" ]]; then
flags="--env=${ENV_NAME} $flags"
fi
fi
if [ "${APP}" = "trading" ]; then
@@ -16,7 +18,3 @@ if [ "${APP}" = "trading" ]; then
else
yarn nx build ${APP} $flags
fi
env_vars_file="/app/dist/apps/${APP}/.env"
# make sure there are no exposed .env files
rm $env_vars_file || echo "No env vars file"
+5 -4
View File
@@ -13,7 +13,7 @@ RUN apk add --update --no-cache \
COPY . ./
RUN yarn --network-timeout 100000 --pure-lockfile
# work around for different build process in trading
RUN sh ./docker-build.sh
RUN sh docker/docker-build.sh
# Server environment
# if this fails you need to docker pull nginx:1.23-alpine and pin new SHA
@@ -23,6 +23,7 @@ FROM --platform=amd64 nginx:1.23-alpine@sha256:6318314189b40e73145a48060bff4783a
EXPOSE 80
# Copy dist
WORKDIR /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist/apps/${APP} /usr/share/nginx/html
RUN apk add --no-cache go-ipfs; ipfs init && echo "$(ipfs add -rQ .)" > ipfs-hash; apk del go-ipfs
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build /app/dist/apps/${APP}/* /usr/share/nginx/html
RUN apk add --no-cache go-ipfs; ipfs init && echo "$(ipfs add -rQ .)" > /ipfs-hash; apk del go-ipfs
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "accounts",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/accounts/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/accounts",
@@ -1,123 +0,0 @@
import type { Story, Meta } from '@storybook/react';
import { AccountType } from '@vegaprotocol/types';
import { getAccountData } from './accounts-data-provider';
import { AccountTable } from './accounts-table';
export default {
component: AccountTable,
title: 'AccountsTable',
} as Meta;
const Template: Story = (args) => (
<AccountTable data={args.data} onClickAsset={() => null} />
);
export const Primary = Template.bind({});
Primary.args = {
data: getAccountData([
{
__typename: 'AccountBalance',
type: AccountType.ACCOUNT_TYPE_MARGIN,
balance: '2781397',
market: {
__typename: 'Market',
id: 'd90fd7c746286625504d7a3f5f420a280875acd3cd611676d9e70acc675f4540',
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
__typename: 'Instrument',
name: 'Tesla Quarterly (30 Jun 2022)',
},
},
},
asset: {
__typename: 'Asset',
id: '8b52d4a3a4b0ffe733cddbc2b67be273816cfeb6ca4c8b339bac03ffba08e4e4',
symbol: 'tEURO',
decimals: 5,
},
},
{
__typename: 'AccountBalance',
type: AccountType.ACCOUNT_TYPE_MARGIN,
balance: '406922',
market: {
__typename: 'Market',
id: '9c1ee71959e566c484fcea796513137f8a02219cca2e973b7ae72dc29d099581',
tradableInstrument: {
__typename: 'TradableInstrument',
instrument: {
__typename: 'Instrument',
name: 'AAVEDAI Monthly (30 Jun 2022)',
},
},
},
asset: {
__typename: 'Asset',
id: '6d9d35f657589e40ddfb448b7ad4a7463b66efb307527fedd2aa7df1bbd5ea61',
symbol: 'tDAI',
decimals: 5,
},
},
{
__typename: 'AccountBalance',
type: AccountType.ACCOUNT_TYPE_GENERAL,
balance: '10001000000',
market: null,
asset: {
__typename: 'Asset',
id: 'XYZalpha',
symbol: 'XYZalpha',
decimals: 5,
},
},
{
__typename: 'AccountBalance',
type: AccountType.ACCOUNT_TYPE_GENERAL,
balance: '1990351587',
market: null,
asset: {
__typename: 'Asset',
id: '993ed98f4f770d91a796faab1738551193ba45c62341d20597df70fea6704ede',
symbol: 'tUSDC',
decimals: 5,
},
},
{
__typename: 'AccountBalance',
type: AccountType.ACCOUNT_TYPE_GENERAL,
balance: '2996218603',
market: null,
asset: {
__typename: 'Asset',
id: '8b52d4a3a4b0ffe733cddbc2b67be273816cfeb6ca4c8b339bac03ffba08e4e4',
symbol: 'tEURO',
decimals: 5,
},
},
{
__typename: 'AccountBalance',
type: AccountType.ACCOUNT_TYPE_GENERAL,
balance: '5000593078',
market: null,
asset: {
__typename: 'Asset',
id: '6d9d35f657589e40ddfb448b7ad4a7463b66efb307527fedd2aa7df1bbd5ea61',
symbol: 'tDAI',
decimals: 5,
},
},
{
__typename: 'AccountBalance',
type: AccountType.ACCOUNT_TYPE_GENERAL,
balance: '4000000000000001006031',
market: null,
asset: {
__typename: 'Asset',
id: '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c',
symbol: 'tBTC',
decimals: 5,
},
},
]),
};
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "announcements",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/announcements/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/accounts",
+2 -1
View File
@@ -1,10 +1,11 @@
{
"name": "apollo-client",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/apollo-client/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/apollo-client",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "assets",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/assets/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/assets",
+18 -1
View File
@@ -1,8 +1,25 @@
fragment AssetListFields on Asset {
id
name
symbol
decimals
quantum
source {
__typename
... on ERC20 {
contractAddress
lifetimeLimit
withdrawThreshold
}
}
status
}
query Assets {
assetsConnection {
edges {
node {
...AssetFields
...AssetListFields
}
}
}
+23 -5
View File
@@ -1,26 +1,44 @@
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import { AssetFieldsFragmentDoc } from './Asset';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type AssetListFieldsFragment = { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, status: Types.AssetStatus, source: { __typename: 'BuiltinAsset' } | { __typename: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string } };
export type AssetsQueryVariables = Types.Exact<{ [key: string]: never; }>;
export type AssetsQuery = { __typename?: 'Query', assetsConnection?: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, status: Types.AssetStatus, source: { __typename: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string }, infrastructureFeeAccount?: { __typename?: 'AccountBalance', balance: string } | null, globalRewardPoolAccount?: { __typename?: 'AccountBalance', balance: string } | null, takerFeeRewardAccount?: { __typename?: 'AccountBalance', balance: string } | null, makerFeeRewardAccount?: { __typename?: 'AccountBalance', balance: string } | null, lpFeeRewardAccount?: { __typename?: 'AccountBalance', balance: string } | null, marketProposerRewardAccount?: { __typename?: 'AccountBalance', balance: string } | null } } | null> | null } | null };
export type AssetsQuery = { __typename?: 'Query', assetsConnection?: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, status: Types.AssetStatus, source: { __typename: 'BuiltinAsset' } | { __typename: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string } } } | null> | null } | null };
export const AssetListFieldsFragmentDoc = gql`
fragment AssetListFields on Asset {
id
name
symbol
decimals
quantum
source {
__typename
... on ERC20 {
contractAddress
lifetimeLimit
withdrawThreshold
}
}
status
}
`;
export const AssetsDocument = gql`
query Assets {
assetsConnection {
edges {
node {
...AssetFields
...AssetListFields
}
}
}
}
${AssetFieldsFragmentDoc}`;
${AssetListFieldsFragmentDoc}`;
/**
* __useAssetsQuery__
@@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react';
import * as Schema from '@vegaprotocol/types';
import { AssetDetailsDialog } from './asset-details-dialog';
import { AssetDetail, testId } from './asset-details-table';
import { AssetsDocument } from './__generated__/Assets';
import { AssetDocument } from './__generated__/Asset';
import { generateBuiltinAsset, generateERC20Asset } from './test-helpers';
const mockedData = {
@@ -39,15 +39,17 @@ const mockedData = {
},
};
const mocks = [
{
request: {
query: AssetsDocument,
variables: {},
},
result: mockedData,
const mocks = mockedData.data.assetsConnection.edges.map((mock) => ({
request: {
query: AssetDocument,
variables: { assetId: mock.node.id },
},
];
result: {
data: {
assetsConnection: { edges: [mock] },
},
},
}));
const WrappedAssetDetailsDialog = ({ assetId }: { assetId: string }) => (
<MockedProvider mocks={mocks}>
+2 -3
View File
@@ -1,5 +1,4 @@
import { t } from '@vegaprotocol/i18n';
import { useAssetsDataProvider } from './assets-data-provider';
import {
Button,
Dialog,
@@ -10,6 +9,7 @@ import {
import { create } from 'zustand';
import { AssetDetailsTable } from './asset-details-table';
import { AssetProposalNotification } from '@vegaprotocol/proposals';
import { useAssetDataProvider } from './asset-data-provider';
export type AssetDetailsDialogStore = {
isOpen: boolean;
@@ -55,9 +55,8 @@ export const AssetDetailsDialog = ({
onChange,
asJson = false,
}: AssetDetailsDialogProps) => {
const { data } = useAssetsDataProvider();
const { data: asset } = useAssetDataProvider(assetId);
const asset = data?.find((a) => a.id === assetId);
const assetSymbol = asset?.symbol || '';
const content = asset ? (
+2 -3
View File
@@ -11,6 +11,7 @@ import {
} from '@vegaprotocol/ui-toolkit';
import type { ReactNode } from 'react';
import type { Asset } from './asset-data-provider';
import { WITHDRAW_THRESHOLD_TOOLTIP_TEXT } from './constants';
type Rows = {
key: AssetDetail;
@@ -121,9 +122,7 @@ export const rows: Rows = [
{
key: AssetDetail.WITHDRAWAL_THRESHOLD,
label: t('Withdrawal threshold'),
tooltip: t(
'The maximum you can withdraw instantly. Theres no limit on the size of a withdrawal, but all withdrawals over the threshold will have a delay time added to them'
),
tooltip: WITHDRAW_THRESHOLD_TOOLTIP_TEXT,
value: (asset) =>
num(asset, (asset.source as Schema.ERC20).withdrawThreshold),
},
+5 -119
View File
@@ -1,8 +1,10 @@
import merge from 'lodash/merge';
import type { AssetsQuery } from './__generated__/Assets';
import type {
AssetsQuery,
AssetListFieldsFragment,
} from './__generated__/Assets';
import * as Types from '@vegaprotocol/types';
import type { PartialDeep } from 'type-fest';
import type { AssetFieldsFragment } from './__generated__/Asset';
export const assetsQuery = (
override?: PartialDeep<AssetsQuery>
@@ -18,7 +20,7 @@ export const assetsQuery = (
return merge(defaultAssets, override);
};
const assetFields: AssetFieldsFragment[] = [
const assetFields: AssetListFieldsFragment[] = [
{
__typename: 'Asset',
id: 'asset-id',
@@ -33,30 +35,6 @@ const assetFields: AssetFieldsFragment[] = [
},
quantum: '1',
status: Types.AssetStatus.STATUS_ENABLED,
infrastructureFeeAccount: {
balance: '1',
__typename: 'AccountBalance',
},
globalRewardPoolAccount: {
balance: '2',
__typename: 'AccountBalance',
},
takerFeeRewardAccount: {
balance: '3',
__typename: 'AccountBalance',
},
makerFeeRewardAccount: {
balance: '4',
__typename: 'AccountBalance',
},
lpFeeRewardAccount: {
balance: '5',
__typename: 'AccountBalance',
},
marketProposerRewardAccount: {
balance: '6',
__typename: 'AccountBalance',
},
},
{
__typename: 'Asset',
@@ -72,30 +50,6 @@ const assetFields: AssetFieldsFragment[] = [
},
quantum: '1',
status: Types.AssetStatus.STATUS_ENABLED,
infrastructureFeeAccount: {
balance: '1',
__typename: 'AccountBalance',
},
globalRewardPoolAccount: {
balance: '2',
__typename: 'AccountBalance',
},
takerFeeRewardAccount: {
balance: '3',
__typename: 'AccountBalance',
},
makerFeeRewardAccount: {
balance: '4',
__typename: 'AccountBalance',
},
lpFeeRewardAccount: {
balance: '5',
__typename: 'AccountBalance',
},
marketProposerRewardAccount: {
balance: '6',
__typename: 'AccountBalance',
},
},
{
__typename: 'Asset',
@@ -104,20 +58,10 @@ const assetFields: AssetFieldsFragment[] = [
decimals: 5,
name: 'Asto',
source: {
maxFaucetAmountMint: '5000000000',
__typename: 'BuiltinAsset',
},
quantum: '1',
status: Types.AssetStatus.STATUS_ENABLED,
infrastructureFeeAccount: {
balance: '0',
__typename: 'AccountBalance',
},
globalRewardPoolAccount: null,
takerFeeRewardAccount: null,
makerFeeRewardAccount: null,
lpFeeRewardAccount: null,
marketProposerRewardAccount: null,
},
{
__typename: 'Asset',
@@ -126,20 +70,10 @@ const assetFields: AssetFieldsFragment[] = [
decimals: 5,
name: 'tBTC TEST',
source: {
maxFaucetAmountMint: '5000000000',
__typename: 'BuiltinAsset',
},
quantum: '1',
status: Types.AssetStatus.STATUS_ENABLED,
infrastructureFeeAccount: {
balance: '0',
__typename: 'AccountBalance',
},
globalRewardPoolAccount: null,
takerFeeRewardAccount: null,
makerFeeRewardAccount: null,
lpFeeRewardAccount: null,
marketProposerRewardAccount: null,
},
// NOTE: These assets ids and contract addresses are real assets on Sepolia, this is needed
// because we don't currently mock our seplia infura provider. If we change network these will
@@ -158,30 +92,6 @@ const assetFields: AssetFieldsFragment[] = [
__typename: 'ERC20',
},
quantum: '1',
infrastructureFeeAccount: {
balance: '1',
__typename: 'AccountBalance',
},
globalRewardPoolAccount: {
balance: '2',
__typename: 'AccountBalance',
},
takerFeeRewardAccount: {
balance: '3',
__typename: 'AccountBalance',
},
makerFeeRewardAccount: {
balance: '4',
__typename: 'AccountBalance',
},
lpFeeRewardAccount: {
balance: '5',
__typename: 'AccountBalance',
},
marketProposerRewardAccount: {
balance: '6',
__typename: 'AccountBalance',
},
},
{
__typename: 'Asset',
@@ -197,29 +107,5 @@ const assetFields: AssetFieldsFragment[] = [
__typename: 'ERC20',
},
quantum: '1',
infrastructureFeeAccount: {
balance: '1',
__typename: 'AccountBalance',
},
globalRewardPoolAccount: {
balance: '2',
__typename: 'AccountBalance',
},
takerFeeRewardAccount: {
balance: '3',
__typename: 'AccountBalance',
},
makerFeeRewardAccount: {
balance: '4',
__typename: 'AccountBalance',
},
lpFeeRewardAccount: {
balance: '5',
__typename: 'AccountBalance',
},
marketProposerRewardAccount: {
balance: '6',
__typename: 'AccountBalance',
},
},
];
+4
View File
@@ -0,0 +1,4 @@
import { t } from '@vegaprotocol/i18n';
export const WITHDRAW_THRESHOLD_TOOLTIP_TEXT = t(
"The maximum you can withdraw instantly. There's no limit on the size of a withdrawal, but all withdrawals over the threshold will have a delay time added to them"
);
+1
View File
@@ -5,3 +5,4 @@ export * from './assets-data-provider';
export * from './asset-details-dialog';
export * from './asset-details-table';
export * from './asset-option';
export * from './constants';
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "candles-chart",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/candles-chart/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/candles-chart",
+1
View File
@@ -1,4 +1,5 @@
{
"name": "cypress",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress/src",
"projectType": "library",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "datagrid",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/datagrid/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/datagrid",
@@ -8,7 +8,7 @@ const commonProps = {
describe('DateRangeFilter', () => {
it('should be properly rendered', async () => {
const defaultRangeFilter = {
const defaultValue = {
start: '2023-02-14T13:53:01+01:00',
end: '2023-02-21T13:53:01+01:00',
};
@@ -17,7 +17,7 @@ describe('DateRangeFilter', () => {
render(
<DateRangeFilter
{...(commonProps as unknown as DateRangeFilterProps)}
defaultRangeFilter={defaultRangeFilter}
defaultValue={defaultValue}
/>
);
@@ -1,5 +1,5 @@
import type { ChangeEvent } from 'react';
import { useEffect, useMemo } from 'react';
import { useEffect, useMemo, useRef } from 'react';
import type * as Schema from '@vegaprotocol/types';
import { forwardRef, useImperativeHandle, useState } from 'react';
import type { IDoesFilterPassParams, IFilterParams } from 'ag-grid-community';
@@ -17,9 +17,9 @@ import { formatForInput } from '@vegaprotocol/utils';
import { t } from '@vegaprotocol/i18n';
import { InputError } from '@vegaprotocol/ui-toolkit';
const defaultFilterValue: Schema.DateRange = {};
const defaultValue: Schema.DateRange = {};
export interface DateRangeFilterProps extends IFilterParams {
defaultRangeFilter?: Schema.DateRange;
defaultValue?: Schema.DateRange;
maxSubDays?: number;
maxNextDays?: number;
maxDaysRange?: number;
@@ -27,8 +27,9 @@ export interface DateRangeFilterProps extends IFilterParams {
export const DateRangeFilter = forwardRef(
(props: DateRangeFilterProps, ref) => {
const defaultDates = props?.defaultRangeFilter || defaultFilterValue;
const defaultDates = props?.defaultValue || defaultValue;
const [value, setValue] = useState<Schema.DateRange>(defaultDates);
const valueRef = useRef<Schema.DateRange>(value);
const [error, setError] = useState<string>('');
const [minStartDate, maxStartDate, minEndDate, maxEndDate] = useMemo(() => {
const minStartDate =
@@ -93,7 +94,7 @@ export const DateRangeFilter = forwardRef(
},
isFilterActive() {
return value.start || value.end;
return valueRef.current.start || valueRef.current.end;
},
getModel() {
@@ -101,13 +102,13 @@ export const DateRangeFilter = forwardRef(
return null;
}
return { value };
return { value: valueRef.current };
},
setModel(model?: { value: Schema.DateRange } | null) {
setValue(
model?.value || props?.defaultRangeFilter || defaultFilterValue
);
valueRef.current =
model?.value || props?.defaultValue || defaultValue;
setValue(valueRef.current);
},
};
});
@@ -185,10 +186,8 @@ export const DateRangeFilter = forwardRef(
update = { ...update, end: checkForEndDate(endDate, startDate) };
if (validate(name, date, update)) {
setValue((curr) => ({
...curr,
...update,
}));
valueRef.current = { ...valueRef.current, ...update };
setValue(valueRef.current);
}
};
useEffect(() => {
@@ -241,7 +240,8 @@ export const DateRangeFilter = forwardRef(
className="ag-standard-button ag-filter-apply-panel-button"
onClick={() => {
setError('');
setValue(defaultDates);
valueRef.current = defaultDates;
setValue(valueRef.current);
}}
>
{t('Reset')}
+17 -11
View File
@@ -1,10 +1,17 @@
import type { ChangeEvent } from 'react';
import { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
import {
forwardRef,
useEffect,
useImperativeHandle,
useState,
useRef,
} from 'react';
import type { IDoesFilterPassParams, IFilterParams } from 'ag-grid-community';
import { t } from '@vegaprotocol/i18n';
export const SetFilter = forwardRef((props: IFilterParams, ref) => {
const [value, setValue] = useState<string[]>([]);
const valueRef = useRef(value);
// expose AG Grid Filter Lifecycle callbacks
useImperativeHandle(ref, () => {
@@ -28,29 +35,28 @@ export const SetFilter = forwardRef((props: IFilterParams, ref) => {
},
isFilterActive() {
return value.length !== 0;
return valueRef.current.length !== 0;
},
getModel() {
if (!this.isFilterActive()) {
return null;
}
return { value };
return { value: valueRef.current };
},
setModel(model?: { value: string[] } | null) {
setValue(!model ? [] : model.value);
valueRef.current = !model ? [] : model.value;
setValue(valueRef.current);
},
};
});
const onChange = (event: ChangeEvent<HTMLInputElement>) => {
setValue(
event.target.checked
? [...value, event.target.value]
: value.filter((v) => v !== event.target.value)
);
valueRef.current = event.target.checked
? [...value, event.target.value]
: value.filter((v) => v !== event.target.value);
setValue(valueRef.current);
};
useEffect(() => {
@@ -77,7 +83,7 @@ export const SetFilter = forwardRef((props: IFilterParams, ref) => {
<button
type="button"
className="ag-standard-button ag-filter-apply-panel-button"
onClick={() => setValue([])}
onClick={() => setValue((valueRef.current = []))}
>
{t('Reset')}
</button>
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "deal-ticket",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/deal-ticket/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/deal-ticket",
@@ -15,8 +15,8 @@ export const useInitialMargin = (
marketId: OrderSubmissionBody['orderSubmission']['marketId'],
order?: OrderSubmissionBody['orderSubmission']
) => {
const { pubKey: partyId } = useVegaWallet();
const commonVariables = { marketId, partyId: partyId || '' };
const { pubKey } = useVegaWallet();
const commonVariables = { marketId, partyId: pubKey || '' };
const { data: marketData } = useDataProvider({
dataProvider: marketDataProvider,
variables: { marketId },
@@ -24,7 +24,7 @@ export const useInitialMargin = (
const { data: activeVolumeAndMargin } = useDataProvider({
dataProvider: volumeAndMarginProvider,
variables: commonVariables,
skip: !partyId,
skip: !pubKey,
});
const { data: marketInfo } = useDataProvider({
dataProvider: marketInfoProvider,
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "deposits",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/deposits/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/deposits",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "environment",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/environment/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/environment",
@@ -37,6 +37,7 @@ export const getMockStatisticsResult = (
__typename: 'Statistics',
chainId: `${env.toLowerCase()}-0123`,
blockHeight: '11',
vegaTime: '',
},
});
@@ -45,6 +46,7 @@ export const getMockQueryResult = (env: Networks): StatisticsQuery => ({
__typename: 'Statistics',
chainId: `${env.toLowerCase()}-0123`,
blockHeight: '11',
vegaTime: '',
},
});
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "fills",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/fills/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/fills",
+1
View File
@@ -1,4 +1,5 @@
{
"name": "i18n",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/i18n/src",
"projectType": "library",
+2 -1
View File
@@ -1,10 +1,11 @@
{
"name": "ledger",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/ledger/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/ledger",
+2 -2
View File
@@ -38,10 +38,10 @@ export const TransferTooltipCellComponent = ({
);
};
const defaultRangeFilter = { start: formatRFC3339(subDays(Date.now(), 7)) };
const defaultValue = { start: formatRFC3339(subDays(Date.now(), 7)) };
const dateRangeFilterParams = {
maxNextDays: 0,
defaultRangeFilter,
defaultValue,
};
type LedgerEntryProps = TypedDataAgGrid<LedgerEntry>;
+3 -1
View File
@@ -1,10 +1,12 @@
{
"name": "liquidity",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/liquidity/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/liquidity",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "market-depth",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/market-depth/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/market-depth",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "market-info",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/market-info/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/market-info",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "market-list",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/market-list/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/market-list",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "network-info",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/network-info/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/network-info",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "network-stats",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/network-stats/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/network-stats",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "oracles",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/oracles/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/oracles",
+2 -1
View File
@@ -1,11 +1,12 @@
{
"name": "orders",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/orders/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/orders",
@@ -150,7 +150,7 @@ export const update = (
});
};
export const ordersProvider = makeDataProvider<
const ordersProvider = makeDataProvider<
OrdersQuery,
ReturnType<typeof getData>,
OrdersUpdateSubscription,
@@ -165,11 +165,36 @@ export const ordersProvider = makeDataProvider<
pagination: {
getPageInfo,
append,
first: 100,
first: 1000,
},
additionalContext: { isEnlargedTimeout: true },
});
export const activeOrdersProvider = makeDerivedDataProvider<
ReturnType<typeof getData>,
never,
{ partyId: string; marketId?: string }
>(
[
(callback, client, variables) =>
ordersProvider(callback, client, {
partyId: variables.partyId,
filter: {
status: [OrderStatus.STATUS_ACTIVE, OrderStatus.STATUS_PARKED],
},
}),
],
(partsData, variables, prevData, parts, subscriptions) => {
if (!parts[0].isUpdate && subscriptions && subscriptions[0].load) {
subscriptions[0].load();
}
const orders = partsData[0] as ReturnType<typeof getData>;
return variables.marketId
? orders.filter((edge) => variables.marketId === edge.node.market.id)
: orders;
}
);
export const ordersWithMarketProvider = makeDerivedDataProvider<
(OrderEdge | null)[],
Order[],
@@ -193,63 +218,20 @@ export const ordersWithMarketProvider = makeDerivedDataProvider<
combineInsertionData<Order>
);
const hasActiveOrderProviderInternal = makeDataProvider<
OrdersQuery,
boolean,
OrdersUpdateSubscription,
ReturnType<typeof getDelta>,
OrdersQueryVariables
>({
query: OrdersDocument,
subscriptionQuery: OrdersUpdateDocument,
update: (
data: boolean | null,
delta: ReturnType<typeof getDelta>,
reload: () => void
) => {
const orders = delta?.filter(
(order) => !(order.peggedOrder || order.liquidityProvisionId)
);
if (!orders?.length) {
return data;
}
const hasActiveOrders = orders.some(
(order) => order.status === OrderStatus.STATUS_ACTIVE
);
if (hasActiveOrders) {
return true;
} else if (data && !hasActiveOrders) {
reload();
}
return data;
},
getData: (responseData: OrdersQuery | null) => {
const hasActiveOrder = !!responseData?.party?.ordersConnection?.edges?.some(
(order) => !(order.node.peggedOrder || order.node.liquidityProvision)
);
return hasActiveOrder;
},
getDelta,
});
export const hasActiveOrderProvider = makeDerivedDataProvider<
boolean,
never,
{ partyId: string; marketId?: string }
>(
[
(callback, client, { partyId, marketId }) =>
hasActiveOrderProviderInternal(callback, client, {
marketIds: marketId ? [marketId] : undefined,
filter: {
status: [OrderStatus.STATUS_ACTIVE],
excludeLiquidity: true,
},
pagination: {
first: 1,
},
partyId,
} as OrdersQueryVariables),
],
(parts) => parts[0]
);
>([activeOrdersProvider], (parts) => !!parts[0].length);
export const hasAmendableOrderProvider = makeDerivedDataProvider<
boolean,
never,
{ partyId: string; marketId?: string }
>([activeOrdersProvider], (parts) => {
const activeOrders = parts[0] as ReturnType<typeof getData>;
const hasAmendableOrder = activeOrders.some(
(edge) => !(edge.node.liquidityProvision || edge.node.peggedOrder)
);
return hasAmendableOrder;
});
@@ -8,7 +8,7 @@ import type { GridReadyEvent } from 'ag-grid-community';
import { OrderListTable } from '../order-list/order-list';
import { useOrderListData } from './use-order-list-data';
import { useHasActiveOrder } from '../../order-hooks/use-has-active-order';
import { useHasAmendableOrder } from '../../order-hooks/use-has-amendable-order';
import type { Filter, Sort } from './use-order-list-data';
import { useBottomPlaceholder } from '@vegaprotocol/react-helpers';
import { OrderStatus } from '@vegaprotocol/types';
@@ -16,6 +16,7 @@ import {
normalizeOrderAmendment,
useVegaTransactionStore,
} from '@vegaprotocol/wallet';
import isEqual from 'lodash/isEqual';
import type { OrderTxUpdateFieldsFragment } from '@vegaprotocol/wallet';
import { OrderEditDialog } from '../order-list/order-edit-dialog';
import type { Order, OrderEdge } from '../order-data-provider';
@@ -28,27 +29,18 @@ export interface OrderListManagerProps {
enforceBottomPlaceholder?: boolean;
}
const CancelAllOrdersButton = ({
onClick,
marketId,
}: {
onClick: (marketId?: string) => void;
marketId?: string;
}) => {
const hasActiveOrder = useHasActiveOrder(marketId);
return hasActiveOrder ? (
<div className="dark:bg-black/75 bg-white/75 h-auto flex justify-end px-[11px] py-2 absolute bottom-0 right-3 rounded">
<Button
variant="primary"
size="sm"
onClick={() => onClick(marketId)}
data-testid="cancelAll"
>
{t('Cancel all')}
</Button>
</div>
) : null;
};
const CancelAllOrdersButton = ({ onClick }: { onClick: () => void }) => (
<div className="dark:bg-black/75 bg-white/75 h-auto flex justify-end px-[11px] py-2 absolute bottom-0 right-3 rounded">
<Button
variant="primary"
size="sm"
onClick={onClick}
data-testid="cancelAll"
>
{t('Cancel all')}
</Button>
</div>
);
const initialFilter: Filter = {
status: {
@@ -68,9 +60,10 @@ export const OrderListManager = ({
const scrolledToTop = useRef(false);
const [sort, setSort] = useState<Sort[] | undefined>();
const [filter, setFilter] = useState<Filter | undefined>(initialFilter);
const filterRef = useRef(initialFilter);
const [editOrder, setEditOrder] = useState<Order | null>(null);
const create = useVegaTransactionStore((state) => state.create);
const hasActiveOrder = useHasActiveOrder(marketId);
const hasAmendableOrder = useHasAmendableOrder(marketId);
const { data, error, loading, reload } = useOrderListData({
partyId,
@@ -86,12 +79,16 @@ export const OrderListManager = ({
...bottomPlaceholderProps
} = useBottomPlaceholder<Order>({
gridRef,
disabled: !enforceBottomPlaceholder && !isReadOnly && !hasActiveOrder,
disabled: !enforceBottomPlaceholder && !isReadOnly && !hasAmendableOrder,
});
const onFilterChanged = useCallback(
(event: FilterChangedEvent) => {
const updatedFilter = event.api.getFilterModel();
if (isEqual(updatedFilter, filterRef.current)) {
return;
}
filterRef.current = updatedFilter;
if (Object.keys(updatedFilter).length) {
setFilter(updatedFilter);
} else {
@@ -142,16 +139,13 @@ export const OrderListManager = ({
setDataCount(gridRef.current?.api?.getModel().getRowCount() ?? 0);
}, [data]);
const cancelAll = useCallback(
(marketId?: string) => {
create({
orderCancellation: {
marketId,
},
});
},
[create]
);
const cancelAll = useCallback(() => {
create({
orderCancellation: {
marketId,
},
});
}, [create, marketId]);
const extractedData =
data && !loading
? data
@@ -188,8 +182,8 @@ export const OrderListManager = ({
/>
</div>
</div>
{!isReadOnly && (
<CancelAllOrdersButton onClick={cancelAll} marketId={marketId} />
{!isReadOnly && hasAmendableOrder && (
<CancelAllOrdersButton onClick={cancelAll} />
)}
{editOrder && (
<OrderEditDialog
@@ -71,17 +71,27 @@ export const useOrderListData = ({
// define variable as const to get type safety, using generic with useMemo resulted in lost type safety
const allVars: OrdersQueryVariables & OrdersUpdateSubscriptionVariables = {
partyId,
filter: {
dateRange: filter?.updatedAt?.value,
status: filter?.status?.value,
timeInForce: filter?.timeInForce?.value,
types: filter?.type?.value,
},
pagination: {
first: 1000,
},
};
if (
filter?.updatedAt?.value ||
filter?.status?.value.length ||
filter?.timeInForce?.value.length ||
filter?.type?.value.length
) {
allVars.filter = {};
if (filter?.updatedAt?.value) {
allVars.filter.dateRange = filter?.updatedAt?.value;
}
if (filter?.status?.value.length) {
allVars.filter.status = filter?.status?.value;
}
if (filter?.timeInForce?.value.length) {
allVars.filter.timeInForce = filter?.timeInForce?.value;
}
if (filter?.type?.value.length) {
allVars.filter.types = filter?.type?.value;
}
}
return allVars;
}, [partyId, filter]);
+1 -2
View File
@@ -1,5 +1,4 @@
export * from './__generated__/OrdersSubscription';
export * from './use-has-active-order';
export * from './use-has-amendable-order';
export * from './use-order-update';
export * from './use-pending-orders-volume';
export * from './use-order-store';
@@ -1,17 +1,17 @@
import { useCallback, useState } from 'react';
import { hasActiveOrderProvider } from '../components/order-data-provider/';
import { hasAmendableOrderProvider } from '../components/order-data-provider';
import { useVegaWallet } from '@vegaprotocol/wallet';
import { useDataProvider } from '@vegaprotocol/react-helpers';
export const useHasActiveOrder = (marketId?: string) => {
export const useHasAmendableOrder = (marketId?: string) => {
const { pubKey } = useVegaWallet();
const [hasActiveOrder, setHasActiveOrder] = useState(false);
const [hasAmendableOrder, setHasAmendableOrder] = useState(false);
const update = useCallback(({ data }: { data: boolean | null }) => {
setHasActiveOrder(Boolean(data));
setHasAmendableOrder(Boolean(data));
return true;
}, []);
useDataProvider({
dataProvider: hasActiveOrderProvider,
dataProvider: hasAmendableOrderProvider,
update,
variables: {
partyId: pubKey || '',
@@ -20,5 +20,5 @@ export const useHasActiveOrder = (marketId?: string) => {
skip: !pubKey,
});
return hasActiveOrder;
return hasAmendableOrder;
};
@@ -1,74 +0,0 @@
import { useState, useCallback } from 'react';
import { OrderStatus, Side } from '@vegaprotocol/types';
import { ordersProvider } from '../components/order-data-provider/order-data-provider';
import type { OrderFieldsFragment } from '../components/order-data-provider/__generated__/Orders';
import type { Edge } from '@vegaprotocol/utils';
import { useDataProvider } from '@vegaprotocol/react-helpers';
const sumVolume = (orders: (Edge<OrderFieldsFragment> | null)[], side: Side) =>
orders
.reduce(
(sum, order) =>
order?.node.side === side
? sum +
BigInt(
order?.node.status === OrderStatus.STATUS_PARTIALLY_FILLED
? order?.node.remaining
: order?.node.size
)
: sum,
BigInt(0)
)
.toString();
export const useActiveOrdersVolumeAndMargin = (
partyId: string | null | undefined,
marketId: string
) => {
const [buyVolume, setBuyVolume] = useState<string | undefined>();
const [sellVolume, setSellVolume] = useState<string | undefined>();
const [buyInitialMargin, setBuyInitialMargin] = useState<
string | undefined
>();
const [sellInitialMargin, setSellInitialMargin] = useState<
string | undefined
>();
const update = useCallback(
({ data }: { data: (Edge<OrderFieldsFragment> | null)[] | null }) => {
if (!data) {
setBuyVolume(undefined);
setSellVolume(undefined);
setBuyInitialMargin(undefined);
setSellInitialMargin(undefined);
} else {
setBuyVolume(sumVolume(data, Side.SIDE_BUY));
setSellVolume(sumVolume(data, Side.SIDE_SELL));
}
return true;
},
[]
);
useDataProvider({
dataProvider: ordersProvider,
update,
variables: {
partyId: partyId || '',
marketIds: [marketId],
filter: {
status: [
OrderStatus.STATUS_ACTIVE,
OrderStatus.STATUS_PARTIALLY_FILLED,
],
},
},
skip: !partyId,
});
return buyVolume || sellVolume
? {
buyVolume,
sellVolume,
buyInitialMargin,
sellInitialMargin,
}
: undefined;
};
+129
View File
@@ -0,0 +1,129 @@
import { Intent } from '@vegaprotocol/ui-toolkit';
import {
getOrderToastIntent,
getOrderToastTitle,
getRejectionReason,
timeInForceLabel,
} from './utils';
import * as Types from '@vegaprotocol/types';
describe('getOrderToastTitle', () => {
it('should return the correct title', () => {
expect(getOrderToastTitle(Types.OrderStatus.STATUS_ACTIVE)).toBe(
'Order submitted'
);
expect(getOrderToastTitle(Types.OrderStatus.STATUS_FILLED)).toBe(
'Order filled'
);
expect(getOrderToastTitle(Types.OrderStatus.STATUS_PARTIALLY_FILLED)).toBe(
'Order partially filled'
);
expect(getOrderToastTitle(Types.OrderStatus.STATUS_PARKED)).toBe(
'Order parked'
);
expect(getOrderToastTitle(Types.OrderStatus.STATUS_STOPPED)).toBe(
'Order stopped'
);
expect(getOrderToastTitle(Types.OrderStatus.STATUS_CANCELLED)).toBe(
'Order cancelled'
);
expect(getOrderToastTitle(Types.OrderStatus.STATUS_EXPIRED)).toBe(
'Order expired'
);
expect(getOrderToastTitle(Types.OrderStatus.STATUS_REJECTED)).toBe(
'Order rejected'
);
expect(getOrderToastTitle(undefined)).toBe(undefined);
});
});
describe('getOrderToastIntent', () => {
it('should return the correct intent', () => {
expect(getOrderToastIntent(Types.OrderStatus.STATUS_PARKED)).toBe(
Intent.Warning
);
expect(getOrderToastIntent(Types.OrderStatus.STATUS_EXPIRED)).toBe(
Intent.Warning
);
expect(getOrderToastIntent(Types.OrderStatus.STATUS_PARTIALLY_FILLED)).toBe(
Intent.Warning
);
expect(getOrderToastIntent(Types.OrderStatus.STATUS_REJECTED)).toBe(
Intent.Danger
);
expect(getOrderToastIntent(Types.OrderStatus.STATUS_STOPPED)).toBe(
Intent.Danger
);
expect(getOrderToastIntent(Types.OrderStatus.STATUS_FILLED)).toBe(
Intent.Success
);
expect(getOrderToastIntent(Types.OrderStatus.STATUS_ACTIVE)).toBe(
Intent.Success
);
expect(getOrderToastIntent(Types.OrderStatus.STATUS_CANCELLED)).toBe(
Intent.Success
);
expect(getOrderToastIntent(undefined)).toBe(undefined);
});
});
describe('getRejectionReason', () => {
it('should return the correct rejection reason for insufficient asset balance', () => {
expect(
getRejectionReason({
rejectionReason:
Types.OrderRejectionReason.ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE,
status: Types.OrderStatus.STATUS_REJECTED,
id: '',
createdAt: undefined,
size: '',
price: '',
timeInForce: Types.OrderTimeInForce.TIME_IN_FORCE_FOK,
side: Types.Side.SIDE_BUY,
marketId: '',
})
).toBe('Insufficient asset balance');
});
it('should return the correct rejection reason when order is stopped', () => {
expect(
getRejectionReason({
rejectionReason: null,
status: Types.OrderStatus.STATUS_STOPPED,
id: '',
createdAt: undefined,
size: '',
price: '',
timeInForce: Types.OrderTimeInForce.TIME_IN_FORCE_FOK,
side: Types.Side.SIDE_BUY,
marketId: '',
})
).toBe(
'Your Fill or Kill (FOK) order was not filled and it has been stopped'
);
});
});
describe('timeInForceLabel', () => {
it('should return the correct label for time in force', () => {
expect(timeInForceLabel(Types.OrderTimeInForce.TIME_IN_FORCE_FOK)).toBe(
`Fill or Kill (FOK)`
);
expect(timeInForceLabel(Types.OrderTimeInForce.TIME_IN_FORCE_GTC)).toBe(
`Good 'til Cancelled (GTC)`
);
expect(timeInForceLabel(Types.OrderTimeInForce.TIME_IN_FORCE_IOC)).toBe(
`Immediate or Cancel (IOC)`
);
expect(timeInForceLabel(Types.OrderTimeInForce.TIME_IN_FORCE_GTT)).toBe(
`Good 'til Time (GTT)`
);
expect(timeInForceLabel(Types.OrderTimeInForce.TIME_IN_FORCE_GFA)).toBe(
`Good for Auction (GFA)`
);
expect(timeInForceLabel(Types.OrderTimeInForce.TIME_IN_FORCE_GFN)).toBe(
`Good for Normal (GFN)`
);
expect(timeInForceLabel('')).toBe('');
});
});
+1 -1
View File
@@ -82,10 +82,10 @@ export const getOrderToastIntent = (
return Intent.Warning;
case Schema.OrderStatus.STATUS_REJECTED:
case Schema.OrderStatus.STATUS_STOPPED:
case Schema.OrderStatus.STATUS_CANCELLED:
return Intent.Danger;
case Schema.OrderStatus.STATUS_FILLED:
case Schema.OrderStatus.STATUS_ACTIVE:
case Schema.OrderStatus.STATUS_CANCELLED:
return Intent.Success;
default:
return;

Some files were not shown because too many files have changed in this diff Show More