From 2740df48a34a2748e44daca1a4cad2273f4e3c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20M=C5=82odzikowski?= Date: Wed, 26 Apr 2023 12:45:02 +0200 Subject: [PATCH 01/10] fix(ci): urls in comments (#3539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mikołaj Młodzikowski --- .github/workflows/ci-cd-trigger.yml | 53 ++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-cd-trigger.yml b/.github/workflows/ci-cd-trigger.yml index 23450bda5..fd11dc4de 100644 --- a/.github/workflows/ci-cd-trigger.yml +++ b/.github/workflows/ci-cd-trigger.yml @@ -105,19 +105,44 @@ jobs: affected="$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects)" echo -n "Affected projects: $affected" + branch_slug="$(echo ${{ github.head_ref || github.ref_name }} | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g )" projects_e2e="" - if [[ $affected == *"governance"* ]]; then projects_e2e+='"governance-e2e" '; fi - if [[ $affected == *"trading"* ]]; then projects_e2e+='"trading-e2e" '; fi - if [[ $affected == *"explorer"* ]]; then projects_e2e+='"explorer-e2e" '; fi - if [[ -z "$projects_e2e" ]]; then projects_e2e+='"governance-e2e" "trading-e2e" "explorer-e2e" '; fi + preview_governance="not deployed" + preview_trading="not deployed" + preview_explorer="not deployed" + if [[ -z "$projects_e2e" ]]; then + projects_e2e+='"governance-e2e" "trading-e2e" "explorer-e2e" ' + preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug") + preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug") + preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug") + else + if [[ $affected == *"governance"* ]]; then + projects_e2e+='"governance-e2e" ' + preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug") + fi + if [[ $affected == *"trading"* ]]; then + projects_e2e+='"trading-e2e" ' + preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug") + fi + if [[ $affected == *"explorer"* ]]; then + projects_e2e+='"explorer-e2e" ' + preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug") + fi + fi projects_e2e=${projects_e2e%?} projects_e2e=[${projects_e2e// /,}] echo PROJECTS_E2E=$projects_e2e >> $GITHUB_ENV echo PROJECTS=$(echo $projects_e2e | sed 's|-e2e||g') >> $GITHUB_ENV + echo PREVIEW_GOVERNANCE=$preview_governance >> $GITHUB_ENV + echo PREVIEW_TRADING=$preview_trading >> $GITHUB_ENV + echo PREVIEW_EXPLORER=$preview_explorer >> $GITHUB_ENV outputs: projects: ${{ env.PROJECTS }} projects-e2e: ${{ env.PROJECTS_E2E }} + preview_governance: ${{ env.PREVIEW_GOVERNANCE }} + preview_trading: ${{ env.PREVIEW_TRADING }} + preview_explorer: ${{ env.PREVIEW_EXPLORER }} cypress: needs: lint-test-build @@ -140,7 +165,9 @@ jobs: dist-check: runs-on: ubuntu-latest - needs: publish-dist + needs: + - publish-dist + - lint-test-build if: ${{ github.event_name == 'pull_request' }} name: '(CD) comment preview links' steps: @@ -151,22 +178,16 @@ jobs: 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 + if: ${{ steps.fc.outputs.comment-id == 0 }} 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 + Previews: + * governance: ${{ needs.lint-test-build.outputs.preview_governance }} + * explorer: ${{ needs.lint-test-build.outputs.preview_explorer }} + * trading: ${{ needs.lint-test-build.outputs.preview_trading }} cypress-check: name: '(CI) cypress - check' From d1f465e2afcc4fbe5012c8c54077ec12fefb3a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20M=C5=82odzikowski?= Date: Wed, 26 Apr 2023 12:54:34 +0200 Subject: [PATCH 02/10] Update Jenkinsfile --- Jenkinsfile | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f1aebe8fd..c3b9be865 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,20 +1,2 @@ @Library('vega-shared-library') _ - -def commitHash = 'UNKNOWN' - -pipeline { - agent any - options { - skipDefaultCheckout true - parallelsAlwaysFailFast() - } - stages { - stage('approbation') { - steps { - sh 'printenv' - checkout scm - runApprobation ignoreFailure: false, frontendBranch: env.BRANCH_NAME, type: 'frontend' - } - } - } -} +runApprobation ignoreFailure: false, frontendBranch: env.BRANCH_NAME, type: 'frontend' From ef5fa7cba61dfd2862e3a7dce2f68c867cd8da49 Mon Sep 17 00:00:00 2001 From: Sam Keen Date: Wed, 26 Apr 2023 12:10:40 +0100 Subject: [PATCH 03/10] feat(governance): ensure the data node urls in the monorepo are valid (#3549) --- README.md | 2 +- apps/explorer-e2e/.env.testnet | 2 +- apps/governance-e2e/.env.testnet | 2 +- apps/governance/.env.testnet | 2 +- apps/liquidity-provision-dashboard/.env | 2 +- apps/liquidity-provision-dashboard/.env.testnet | 2 +- apps/multisig-signer/.env.testnet | 2 +- apps/static/src/assets/testnet-network.json | 8 ++------ 8 files changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 93abf6294..7704343ad 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Run `nx serve my-app` for a dev server. Navigate to the port specified in `app/< In order to generate the schemas for your GraphQL queries, you can run `GRAPHQL_SCHEMA_PATH=[YOUR SCHEMA FILE / API URL HERE] nx run types:generate`. ```bash -export GRAPHQL_SCHEMA_PATH=https://api.n11.testnet.vega.xyz/graphql +export GRAPHQL_SCHEMA_PATH=https://api.n07.testnet.vega.xyz/graphql yarn nx run types:generate ``` diff --git a/apps/explorer-e2e/.env.testnet b/apps/explorer-e2e/.env.testnet index 67801ebd5..c4bc9adf3 100644 --- a/apps/explorer-e2e/.env.testnet +++ b/apps/explorer-e2e/.env.testnet @@ -2,7 +2,7 @@ NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api NX_TENDERMINT_URL=https://tm.n07.testnet.vega.xyz/tm NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket -NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql +NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql NX_VEGA_ENV=TESTNET NX_BLOCK_EXPLORER=https://be.testnet.vega.xyz/rest diff --git a/apps/governance-e2e/.env.testnet b/apps/governance-e2e/.env.testnet index 631ab9296..218bc4e94 100644 --- a/apps/governance-e2e/.env.testnet +++ b/apps/governance-e2e/.env.testnet @@ -1,5 +1,5 @@ # App configuration variables NX_VEGA_ENV=TESTNET -NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql +NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io diff --git a/apps/governance/.env.testnet b/apps/governance/.env.testnet index d3215abfd..4e7d865c5 100644 --- a/apps/governance/.env.testnet +++ b/apps/governance/.env.testnet @@ -1,7 +1,7 @@ # App configuration variables NX_VEGA_ENV=TESTNET NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml -NX_VEGA_URL=https://api.n08.testnet.vega.xyz/graphql +NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io diff --git a/apps/liquidity-provision-dashboard/.env b/apps/liquidity-provision-dashboard/.env index 6573e8bbc..fa7e64896 100644 --- a/apps/liquidity-provision-dashboard/.env +++ b/apps/liquidity-provision-dashboard/.env @@ -19,7 +19,7 @@ NX_DEPLOY_URL=$DEPLOY_URL NX_DEPLOY_PRIME_URL=$DEPLOY_PRIME_URL NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml NX_VEGA_ENV = 'TESTNET' -NX_VEGA_URL="https://api.n11.testnet.vega.xyz/graphql" +NX_VEGA_URL="https://api.n07.testnet.vega.xyz/graphql" NX_VEGA_WALLET_URL=http://localhost:1789 NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io diff --git a/apps/liquidity-provision-dashboard/.env.testnet b/apps/liquidity-provision-dashboard/.env.testnet index fded68ffa..49e8eec13 100644 --- a/apps/liquidity-provision-dashboard/.env.testnet +++ b/apps/liquidity-provision-dashboard/.env.testnet @@ -1,6 +1,6 @@ # App configuration variables NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml -NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql +NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql NX_VEGA_ENV=TESTNET NX_VEGA_NETWORKS={\"MAINNET\":\"https://alpha.console.vega.xyz\",\"TESTNET\":\"https://console.fairground.wtf\"} NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 diff --git a/apps/multisig-signer/.env.testnet b/apps/multisig-signer/.env.testnet index de6b3a29f..34b22daf8 100644 --- a/apps/multisig-signer/.env.testnet +++ b/apps/multisig-signer/.env.testnet @@ -1,5 +1,5 @@ # App configuration variables NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml -NX_VEGA_URL=https://api.n09.testnet.vega.xyz/graphql +NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql NX_VEGA_NETWORKS='{"TESTNET":"https://multisig-signer.fairground.wtf","MAINNET":"https://multisig-signer.vega.xyz"}' NX_VEGA_ENV=TESTNET diff --git a/apps/static/src/assets/testnet-network.json b/apps/static/src/assets/testnet-network.json index 7017b9acd..ab52271c7 100644 --- a/apps/static/src/assets/testnet-network.json +++ b/apps/static/src/assets/testnet-network.json @@ -1,11 +1,7 @@ { "hosts": [ + "https://api-n00.testnet.vega.rocks/graphql", "https://api-n06.testnet.vega.rocks/graphql", - "https://api-n07.testnet.vega.rocks/graphql", - "https://api-n08.testnet.vega.rocks/graphql", - "https://api-n09.testnet.vega.rocks/graphql", - "https://api-n10.testnet.vega.rocks/graphql", - "https://api-n11.testnet.vega.rocks/graphql", - "https://api-n12.testnet.vega.rocks/graphql" + "https://api-n07.testnet.vega.rocks/graphql" ] } From 21e545d941ebd133793f17da66fe2dcdbd133849 Mon Sep 17 00:00:00 2001 From: dexturr Date: Wed, 26 Apr 2023 12:09:35 +0000 Subject: [PATCH 04/10] chore: update tranches Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- apps/static/src/assets/mainnet-tranches.json | 84 ++++++++++++++------ 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index 17e08348e..7730e0e1a 100644 --- a/apps/static/src/assets/mainnet-tranches.json +++ b/apps/static/src/assets/mainnet-tranches.json @@ -37,8 +37,8 @@ "tranche_start": "2023-04-20T00:00:00.000Z", "tranche_end": "2023-05-20T00:00:00.000Z", "total_added": "19242.125", - "total_removed": "202.093666077975", - "locked_amount": "15230.0528535879635331", + "total_removed": "397.984073768865", + "locked_amount": "15068.736736207562060975", "deposits": [ { "amount": "188", @@ -216,6 +216,11 @@ "amount": "202.093666077975", "user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756", "tx": "0x300c18b4220d3bc357f054792cb65f05d4005912bf8e5d9580b5b830cc3c0845" + }, + { + "amount": "195.89040769089", + "user": "0xDd7a98557586ce21f770662319C2047C5a3bD605", + "tx": "0x338ca1f2a725add8aa5328efa43ac7cb1e91c35bf01a2312431c0dbb57137387" } ], "users": [ @@ -296,10 +301,17 @@ "tx": "0xa4b11dd967e1726d3f10d1a8330d3cac2338a93b3f8ea5db2f58a6c653ff8a1f" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "195.89040769089", + "user": "0xDd7a98557586ce21f770662319C2047C5a3bD605", + "tranche_id": 56, + "tx": "0x338ca1f2a725add8aa5328efa43ac7cb1e91c35bf01a2312431c0dbb57137387" + } + ], "total_tokens": "914.25", - "withdrawn_tokens": "0", - "remaining_tokens": "914.25" + "withdrawn_tokens": "195.89040769089", + "remaining_tokens": "718.35959230911" }, { "address": "0x9573BDF7FfC5519912d293e4D1f750eab2E471E7", @@ -799,7 +811,7 @@ "tranche_end": "2023-05-06T00:00:00.000Z", "total_added": "8976", "total_removed": "596.64743517951", - "locked_amount": "2915.66244444444494976", + "locked_amount": "2840.4122592592591152", "deposits": [ { "amount": "111", @@ -4582,7 +4594,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "86666.297", "total_removed": "0", - "locked_amount": "52888.9651733679574317733", + "locked_amount": "52829.2474338382140338349", "deposits": [ { "amount": "86666.297", @@ -4648,7 +4660,7 @@ "tranche_end": "2023-06-01T00:00:00.000Z", "total_added": "2500", "total_removed": "0", - "locked_amount": "491.00083943833945", + "locked_amount": "487.54610551485555", "deposits": [ { "amount": "2500", @@ -4769,7 +4781,7 @@ "tranche_end": "2023-09-01T00:00:00.000Z", "total_added": "17500", "total_removed": "0", - "locked_amount": "12149.6471165458935", + "locked_amount": "12125.7268392713355", "deposits": [ { "amount": "12500", @@ -5036,7 +5048,7 @@ "tranche_end": "2023-08-01T00:00:00.000Z", "total_added": "37500", "total_removed": "12704.026146825", - "locked_amount": "20043.824815837935", + "locked_amount": "19991.71750306936875", "deposits": [ { "amount": "7500", @@ -5422,7 +5434,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "129999.45", "total_removed": "0", - "locked_amount": "52840.7106473920320782625", + "locked_amount": "52781.047392785629516053", "deposits": [ { "amount": "129999.45", @@ -5455,7 +5467,7 @@ "tranche_end": "2024-04-01T00:00:00.000Z", "total_added": "54144.7663", "total_removed": "0", - "locked_amount": "50408.60894204117078453109", + "locked_amount": "50371.40222238362540059014", "deposits": [ { "amount": "54144.7663", @@ -5488,7 +5500,7 @@ "tranche_end": "2023-09-03T00:00:00.000Z", "total_added": "62600", "total_removed": "0", - "locked_amount": "22252.132343987824124", + "locked_amount": "22208.997577371892778", "deposits": [ { "amount": "10000", @@ -5681,7 +5693,7 @@ "tranche_end": "2023-09-17T00:00:00.000Z", "total_added": "5000", "total_removed": "0", - "locked_amount": "1969.1076864535767", + "locked_amount": "1965.6624175545405", "deposits": [ { "amount": "5000", @@ -6222,7 +6234,7 @@ "tranche_end": "2023-05-01T00:00:00.000Z", "total_added": "22500", "total_removed": "7280.725809525", - "locked_amount": "589.830801104973555", + "locked_amount": "558.56641344383115", "deposits": [ { "amount": "7500", @@ -6728,7 +6740,7 @@ "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", "total_removed": "928642.9598472029154", - "locked_amount": "195294.2435304184652893786", + "locked_amount": "193957.5285476244010738806", "deposits": [ { "amount": "1852091.69", @@ -40544,7 +40556,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "715655.108029600523393", - "locked_amount": "324600.582801707094573269852", + "locked_amount": "322546.517267879190806982098", "deposits": [ { "amount": "1998.95815", @@ -41936,8 +41948,8 @@ "tranche_start": "2022-06-05T00:00:00.000Z", "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15870102.715470999700000001", - "total_removed": "861351.90789501781835852", - "locked_amount": "6450700.41090630502526979382962504965531225", + "total_removed": "863956.20182679498584852", + "locked_amount": "6443416.82640696362856446483297671260124354", "deposits": [ { "amount": "16249.93", @@ -42456,6 +42468,16 @@ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", "tx": "0x715201656de8957c81817e491e18394abf8bc419d96c86c5106ef3f30d7625e9" }, + { + "amount": "1784.722222", + "user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37", + "tx": "0x0b45b329eb6c3793425d9169b07ed6a7db7db303e4930ffaed75e3a1772a6a9c" + }, + { + "amount": "819.57170977716749", + "user": "0xe3eB4CF43C072658401996b71D43eE26E573562D", + "tx": "0x9d12dadb940c59a796a405a4971e73f24d7ad284528ec7ce676ae361a4ac1f51" + }, { "amount": "981.387731774910625", "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", @@ -46318,6 +46340,12 @@ "tranche_id": 2, "tx": "0x2ee57ee8a712525955ad807f4d45eeaa5f6388bf0b4fceabc7de6871899f736e" }, + { + "amount": "819.57170977716749", + "user": "0xe3eB4CF43C072658401996b71D43eE26E573562D", + "tranche_id": 2, + "tx": "0x9d12dadb940c59a796a405a4971e73f24d7ad284528ec7ce676ae361a4ac1f51" + }, { "amount": "2873.74755113623213", "user": "0xe3eB4CF43C072658401996b71D43eE26E573562D", @@ -46590,8 +46618,8 @@ } ], "total_tokens": "150551.801", - "withdrawn_tokens": "88566.24522601405589", - "remaining_tokens": "61985.55577398594411" + "withdrawn_tokens": "89385.81693579122338", + "remaining_tokens": "61165.98406420877662" }, { "address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148", @@ -46811,6 +46839,12 @@ } ], "withdrawals": [ + { + "amount": "1784.722222", + "user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37", + "tranche_id": 2, + "tx": "0x0b45b329eb6c3793425d9169b07ed6a7db7db303e4930ffaed75e3a1772a6a9c" + }, { "amount": "12786.192214", "user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37", @@ -47065,8 +47099,8 @@ } ], "total_tokens": "200000", - "withdrawn_tokens": "116957.518078", - "remaining_tokens": "83042.481922" + "withdrawn_tokens": "118742.2403", + "remaining_tokens": "81257.7597" }, { "address": "0x1b956E6c00E238194B331eddEFF72Cb5f28A8d01", @@ -48449,7 +48483,7 @@ "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", "total_removed": "5849351.477870348891944626", - "locked_amount": "233800.2049473767333067685110206868", + "locked_amount": "227076.0462437110259876403850980756", "deposits": [ { "amount": "129284.449", @@ -58449,7 +58483,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", "total_removed": "43542.8634352159416", - "locked_amount": "51434.817840966482989342423439868", + "locked_amount": "51109.339415592305104943735362752", "deposits": [ { "amount": "3000", From d6ecdf80fa042b2028b6dae42da4ec18e58bd0a5 Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Wed, 26 Apr 2023 09:34:56 -0400 Subject: [PATCH 05/10] fix(fills): handle side_unspecified added for the aggresor (#3550) --- libs/fills/src/lib/fills-table.spec.tsx | 38 ++- libs/fills/src/lib/fills-table.tsx | 87 ++++--- libs/types/src/__generated__/types.ts | 323 ++++++++++++++++++++---- libs/types/src/global-types-mappings.ts | 9 +- 4 files changed, 363 insertions(+), 94 deletions(-) diff --git a/libs/fills/src/lib/fills-table.spec.tsx b/libs/fills/src/lib/fills-table.spec.tsx index f1ee45630..797dc2391 100644 --- a/libs/fills/src/lib/fills-table.spec.tsx +++ b/libs/fills/src/lib/fills-table.spec.tsx @@ -120,6 +120,40 @@ describe('FillsTable', () => { expect(amountCell).toHaveClass('text-vega-pink'); }); + it('should format cells correctly for side unspecified', async () => { + const partyId = 'party-id'; + const buyerFill = generateFill({ + ...defaultFill, + seller: { + id: partyId, + }, + aggressor: Schema.Side.SIDE_UNSPECIFIED, + sellerFee: { + makerFee: '1', + infrastructureFee: '1', + liquidityFee: '1', + }, + }); + render(); + + const cells = screen.getAllByRole('gridcell'); + const expectedValues = [ + buyerFill.market?.tradableInstrument.instrument.name || '', + '-3.00', + '1.00 BTC', + '3.00 BTC', + '-', + '0.03 BTC', + getDateTimeFormat().format(new Date(buyerFill.createdAt)), + ]; + cells.forEach((cell, i) => { + expect(cell).toHaveTextContent(expectedValues[i]); + }); + + const amountCell = cells.find((c) => c.getAttribute('col-id') === 'size'); + expect(amountCell).toHaveClass('text-vega-pink'); + }); + it('should render correct maker or taker role', async () => { const partyId = 'party-id'; const takerFill = generateFill({ @@ -190,7 +224,7 @@ describe('FillsTable', () => { makerFee: '1000', totalFee: '6000', }; - expect(getFeesBreakdown('TAKER', fees)).toEqual(expectedBreakdown); + expect(getFeesBreakdown('Taker', fees)).toEqual(expectedBreakdown); }); it('should return correct fees breakdown for a maker', () => { @@ -205,7 +239,7 @@ describe('FillsTable', () => { makerFee: '-1000', totalFee: '4000', }; - expect(getFeesBreakdown('MAKER', fees)).toEqual(expectedBreakdown); + expect(getFeesBreakdown('Maker', fees)).toEqual(expectedBreakdown); }); }); }); diff --git a/libs/fills/src/lib/fills-table.tsx b/libs/fills/src/lib/fills-table.tsx index eb3090225..9f0e7167b 100644 --- a/libs/fills/src/lib/fills-table.tsx +++ b/libs/fills/src/lib/fills-table.tsx @@ -26,8 +26,10 @@ import BigNumber from 'bignumber.js'; import type { Trade } from './fills-data-provider'; import type { FillFieldsFragment } from './__generated__/Fills'; -const TAKER = 'TAKER'; -const MAKER = 'MAKER'; +const TAKER = 'Taker'; +const MAKER = 'Maker'; + +export type Role = typeof TAKER | typeof MAKER | '-'; export type Props = (AgGridReactProps | AgReactUiProps) & { partyId: string; @@ -180,24 +182,10 @@ const formatTotal = ({ }; const formatRole = (partyId: string) => { - return ({ value, data }: VegaValueFormatterParams) => { - const taker = t('Taker'); - const maker = t('Maker'); - if (data?.buyer.id === partyId) { - if (value === Schema.Side.SIDE_BUY) { - return taker; - } else { - return maker; - } - } else if (data?.seller.id === partyId) { - if (value === Schema.Side.SIDE_SELL) { - return taker; - } else { - return maker; - } - } else { - return '-'; - } + return ({ data }: VegaValueFormatterParams) => { + if (!data) return '-'; + const { role } = getRoleAndFees({ data, partyId }); + return role; }; }; @@ -222,6 +210,15 @@ const formatFee = (partyId: string) => { }; }; +export const isEmptyFeeObj = (feeObj: Schema.TradeFee) => { + if (!feeObj) return true; + return ( + feeObj.liquidityFee === '0' && + feeObj.makerFee === '0' && + feeObj.infrastructureFee === '0' + ); +}; + export const getRoleAndFees = ({ data, partyId, @@ -232,14 +229,30 @@ export const getRoleAndFees = ({ >; partyId?: string; }) => { - let role; + let role: Role; let feesObj; if (data?.buyer.id === partyId) { - role = data.aggressor === Schema.Side.SIDE_BUY ? TAKER : MAKER; - feesObj = role === TAKER ? data?.buyerFee : data.sellerFee; + if (data.aggressor === Schema.Side.SIDE_BUY) { + role = TAKER; + feesObj = data?.buyerFee; + } else if (data.aggressor === Schema.Side.SIDE_SELL) { + role = MAKER; + feesObj = data?.sellerFee; + } else { + role = '-'; + feesObj = !isEmptyFeeObj(data?.buyerFee) ? data.buyerFee : data.sellerFee; + } } else if (data?.seller.id === partyId) { - role = data.aggressor === Schema.Side.SIDE_SELL ? TAKER : MAKER; - feesObj = role === TAKER ? data?.sellerFee : data.buyerFee; + if (data.aggressor === Schema.Side.SIDE_SELL) { + role = TAKER; + feesObj = data?.sellerFee; + } else if (data.aggressor === Schema.Side.SIDE_BUY) { + role = MAKER; + feesObj = data?.buyerFee; + } else { + role = '-'; + feesObj = !isEmptyFeeObj(data.sellerFee) ? data.sellerFee : data.buyerFee; + } } else { return { role: '-', feesObj: '-' }; } @@ -270,11 +283,6 @@ const FeesBreakdownTooltip = ({ {role === MAKER && ( <>

{t('The maker will receive the maker fee.')}

-

- {t( - 'If the market is in monitoring auction the maker will pay half of the infrastructure and liquidity fees.' - )} -

{t( 'If the market is active the maker will pay zero infrastructure and liquidity fees.' @@ -283,14 +291,14 @@ const FeesBreakdownTooltip = ({ )} {role === TAKER && ( - <> -

{t('Fees to be paid by the taker.')}

-

- {t( - 'If the market is in monitoring auction the taker will pay half of the infrastructure and liquidity fees.' - )} -

- +

{t('Fees to be paid by the taker.')}

+ )} + {role === '-' && ( +

+ {t( + 'If the market is in monitoring auction, half of the infrastructure and liquidity fees will be paid.' + )} +

)}
{t('Infrastructure fee')}
@@ -316,7 +324,7 @@ const FeesBreakdownTooltip = ({ }; export const getFeesBreakdown = ( - role: string, + role: Role, feesObj: { __typename?: 'TradeFee' | undefined; makerFee: string; @@ -328,6 +336,7 @@ export const getFeesBreakdown = ( role === MAKER ? new BigNumber(feesObj.makerFee).times(-1).toString() : feesObj.makerFee; + const infrastructureFee = feesObj.infrastructureFee; const liquidityFee = feesObj.liquidityFee; diff --git a/libs/types/src/__generated__/types.ts b/libs/types/src/__generated__/types.ts index aa926b374..cc785d575 100644 --- a/libs/types/src/__generated__/types.ts +++ b/libs/types/src/__generated__/types.ts @@ -796,6 +796,67 @@ export type ETHAddress = { address?: Maybe; }; +/** List of all entities created by transaction hash */ +export type Entities = { + __typename?: 'Entities'; + /** List of accounts created by the transaction hash */ + accounts?: Maybe>>; + /** List of assets created by the transaction hash */ + assets?: Maybe>>; + /** List of balance changes created by the transaction hash */ + balanceChanges?: Maybe>>; + /** List of delegations created by the transaction hash */ + delegations?: Maybe>>; + /** List of deposits created by the transaction hash */ + deposits?: Maybe>>; + /** List of ERC-20 multisig signer added bundles created by the transaction hash */ + erc20MultiSigSignerAddedBundles?: Maybe>>; + /** List of ERC-20 multisig signer removed bundles created by the transaction hash */ + erc20MultiSigSignerRemovedBundles?: Maybe>>; + /** List of ethereum key rotations created by the transaction hash */ + ethereumKeyRotations?: Maybe>>; + /** List of key rotations created by the transaction hash */ + keyRotations?: Maybe>>; + /** List of ledger entries created by the transaction hash */ + ledgerEntries?: Maybe>>; + /** List of liquidity provisions created by the transaction hash */ + liquidityProvisions?: Maybe>>; + /** List of margin levels created by the transaction hash */ + marginLevels?: Maybe>>; + /** List of markets created by the transaction hash */ + markets?: Maybe>>; + /** List of network parameters created by the transaction hash */ + networkParameters?: Maybe>>; + /** List of node signatures created by the transaction hash */ + nodeSignatures?: Maybe>>; + /** List of nodes created by the transaction hash */ + nodes?: Maybe>>; + /** List of oracle data created by the transaction hash */ + oracleData?: Maybe>>; + /** List of oracle specs created by the transaction hash */ + oracleSpecs?: Maybe>>; + /** List of orders created by the transaction hash */ + orders?: Maybe>>; + /** List of parties created by the transaction hash */ + parties?: Maybe>>; + /** List of positions created by the transaction hash */ + positions?: Maybe>>; + /** List of proposals created by the transaction hash */ + proposals?: Maybe>>; + /** List of protocol upgrade proposals created by the transaction hash */ + protocolUpgradeProposals?: Maybe>>; + /** List of rewards created by the transaction hash */ + rewards?: Maybe>>; + /** List of trades created by the transaction hash */ + trades?: Maybe>>; + /** List of transfers created by the transaction hash */ + transfers?: Maybe>>; + /** List of votes created by the transaction hash */ + votes?: Maybe>>; + /** List of withdrawals created by the transaction hash */ + withdrawals?: Maybe>>; +}; + /** Epoch describes a specific period of time in the Vega network */ export type Epoch = { __typename?: 'Epoch'; @@ -988,6 +1049,15 @@ export type ExternalDataSourceSpec = { spec: DataSourceSpec; }; +/** An estimate of the fee to be paid for the order */ +export type FeeEstimate = { + __typename?: 'FeeEstimate'; + /** The estimated fees if the order was to trade */ + fees: TradeFee; + /** The total estimated amount of fees if the order was to trade */ + totalFeeAmount: Scalars['String']; +}; + /** The factors applied to calculate the fees */ export type FeeFactors = { __typename?: 'FeeFactors'; @@ -1178,6 +1248,26 @@ export type LedgerEntryFilter = { TransferTypes?: InputMaybe>>; }; +/** Liquidation estimate for both worst and best case possible */ +export type LiquidationEstimate = { + __typename?: 'LiquidationEstimate'; + /** Liquidation price estimate assuming no slippage */ + bestCase: LiquidationPrice; + /** Liquidation price estimate assuming slippage cap is applied */ + worstCase: LiquidationPrice; +}; + +/** Liquidation price estimate for either only the current open volume and position given some or all buy orders get filled, or position given some or all sell orders get filled */ +export type LiquidationPrice = { + __typename?: 'LiquidationPrice'; + /** Liquidation price assuming buy orders start getting filled */ + including_buy_orders: Scalars['String']; + /** Liquidation price assuming sell orders start getting filled */ + including_sell_orders: Scalars['String']; + /** Liquidation price for current open volume ignoring any active orders */ + open_volume_only: Scalars['String']; +}; + /** Configuration of a market liquidity monitoring parameters */ export type LiquidityMonitoringParameters = { __typename?: 'LiquidityMonitoringParameters'; @@ -1367,6 +1457,15 @@ export type MarginEdge = { node: MarginLevels; }; +/** Margin level estimate for both worst and best case possible */ +export type MarginEstimate = { + __typename?: 'MarginEstimate'; + /** Margin level estimate assuming no slippage */ + bestCase: MarginLevels; + /** Margin level estimate assuming slippage cap is applied */ + worstCase: MarginLevels; +}; + /** Margins for a given a party */ export type MarginLevels = { __typename?: 'MarginLevels'; @@ -1377,7 +1476,7 @@ export type MarginLevels = { * the general account of the party for the given asset. */ collateralReleaseLevel: Scalars['String']; - /** This is the minimum margin required for a party to place a new order on the network (unsigned integer) */ + /** This is the minimum margin required for a party to place a new order on the network, expressed as unsigned integer */ initialLevel: Scalars['String']; /** Minimal margin for the position to be maintained in the network (unsigned integer) */ maintenanceLevel: Scalars['String']; @@ -1385,7 +1484,7 @@ export type MarginLevels = { market: Market; /** The party for this margin */ party: Party; - /** If the margin is between maintenance and search, the network will initiate a collateral search (unsigned integer) */ + /** If the margin is between maintenance and search, the network will initiate a collateral search, expressed as unsigned integer */ searchLevel: Scalars['String']; /** RFC3339Nano time from at which this margin level was relevant */ timestamp: Scalars['Timestamp']; @@ -1483,6 +1582,7 @@ export type Market = { state: MarketState; /** An instance of, or reference to, a tradable instrument. */ tradableInstrument: TradableInstrument; + /** @deprecated Simplify and consolidate trades query and remove nesting. Use trades query instead */ tradesConnection?: Maybe; /** Current mode of execution of the market */ tradingMode: MarketTradingMode; @@ -1894,6 +1994,28 @@ export type NodedelegationsConnectionArgs = { partyId?: InputMaybe; }; +export type NodeBasic = { + __typename?: 'NodeBasic'; + /** The URL of an avatar */ + avatarUrl?: Maybe; + /** Ethereum public key of the node */ + ethereumAddress: Scalars['String']; + /** The node URL, for example n01.vega.xyz */ + id: Scalars['ID']; + /** URL that provides more information about the node */ + infoUrl: Scalars['String']; + /** Country code for the location of the node */ + location: Scalars['String']; + /** The name of the node operator */ + name: Scalars['String']; + /** Public key of the node operator */ + pubkey: Scalars['String']; + /** Validator status of the node */ + status: NodeStatus; + /** Tendermint public key of the node */ + tmPubkey: Scalars['String']; +}; + /** Summary of data across all nodes */ export type NodeData = { __typename?: 'NodeData'; @@ -2107,18 +2229,6 @@ export type ObservableMarketDepthUpdate = { sequenceNumber: Scalars['String']; }; -export type OffsetPagination = { - /** - * Descending reverses the order of the records returned - * default is true, if false the results will be returned in ascending order - */ - descending: Scalars['Boolean']; - /** Limit the number of returned records to the value specified, default is 50 */ - limit: Scalars['Int']; - /** Skip the number of records specified, default is 0 */ - skip: Scalars['Int']; -}; - /** The specific details for a one-off transfer */ export type OneOffTransfer = { __typename?: 'OneOffTransfer'; @@ -2213,7 +2323,10 @@ export type Order = { status: OrderStatus; /** The timeInForce of order (determines how and if it executes, and whether it persists on the book) */ timeInForce: OrderTimeInForce; - /** Trades relating to this order */ + /** + * Trades relating to this order + * @deprecated Simplify and consolidate trades query and remove nesting. Use trades query instead + */ tradesConnection?: Maybe; /** The order type */ type?: Maybe; @@ -2279,11 +2392,28 @@ export type OrderFilter = { /** Date range to retrieve orders from/to. Start and end time should be expressed as an integer value of nano-seconds past the Unix epoch */ dateRange?: InputMaybe; excludeLiquidity?: InputMaybe; + /** + * If true, only orders that are live will be returned. Orders are live if they have STATUS_ACTIVE or STATUS_PARKED + * as per https://github.com/vegaprotocol/specs-internal/blob/master/protocol/0024-OSTA-order_status.md + */ + liveOnly?: InputMaybe; status?: InputMaybe>; timeInForce?: InputMaybe>; types?: InputMaybe>; }; +/** Basic description of an order */ +export type OrderInfo = { + /** Boolean indicating a market order */ + isMarketOrder: Scalars['Boolean']; + /** Price for the order */ + price: Scalars['String']; + /** Number of units remaining of the total that have not yet been bought or sold (uint64) */ + remaining: Scalars['String']; + /** Whether the order is to buy or sell */ + side: Side; +}; + /** Why the order was rejected by the core node */ export enum OrderRejectionReason { /** Amending the order failed */ @@ -2304,6 +2434,8 @@ export enum OrderRejectionReason { ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT = 'ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT', /** Cannot send FOK orders during an auction */ ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION = 'ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION', + /** Good for Auction order received during continuous trading */ + ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING = 'ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING', /** Good for Normal order received during an auction */ ORDER_ERROR_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION = 'ORDER_ERROR_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION', /** Cannot send IOC orders during an auction */ @@ -2312,8 +2444,8 @@ export enum OrderRejectionReason { ORDER_ERROR_EDIT_NOT_ALLOWED = 'ORDER_ERROR_EDIT_NOT_ALLOWED', /** Attempt to amend expiry time to a value before time order was created */ ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT = 'ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT', - /** Good for Auction order received during continuous trading */ - ORDER_ERROR_GFA_CANNOT_SEND_ORDER_DURING_CONTINUOUS_TRADING = 'ORDER_ERROR_GFA_CANNOT_SEND_ORDER_DURING_CONTINUOUS_TRADING', + /** Order was submitted with an incorrect or invalid market type */ + ORDER_ERROR_INCORRECT_MARKET_TYPE = 'ORDER_ERROR_INCORRECT_MARKET_TYPE', /** Insufficient balance to submit the order (no deposit made) */ ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE = 'ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE', /** Insufficient funds to pay fees */ @@ -2360,6 +2492,10 @@ export enum OrderRejectionReason { ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO = 'ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO', /** Order is out of sequence */ ORDER_ERROR_OUT_OF_SEQUENCE = 'ORDER_ERROR_OUT_OF_SEQUENCE', + /** A post-only order would produce an aggressive trade and thus it has been rejected */ + ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE = 'ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE', + /** A reduce-ony order would not reduce the party's position and thus it has been rejected */ + ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE = 'ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE', /** Unable to remove the order */ ORDER_ERROR_REMOVAL_FAILURE = 'ORDER_ERROR_REMOVAL_FAILURE', /** Order cannot be filled because it would require self trading */ @@ -2368,6 +2504,8 @@ export enum OrderRejectionReason { ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE = 'ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE', /** Time has failed us */ ORDER_ERROR_TIME_FAILURE = 'ORDER_ERROR_TIME_FAILURE', + /** Unable to submit pegged order, temporarily too many pegged orders across all markets */ + ORDER_ERROR_TOO_MANY_PEGGED_ORDERS = 'ORDER_ERROR_TOO_MANY_PEGGED_ORDERS', /** Unable to amend pegged order price */ ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER = 'ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER', /** Unable to reprice a pegged order */ @@ -2526,6 +2664,7 @@ export type Party = { rewardsConnection?: Maybe; /** The staking information for this Party */ stakingSummary: StakingSummary; + /** @deprecated Simplify and consolidate trades query and remove nesting. Use trades query instead */ tradesConnection?: Maybe; /** All transfers for a public key */ transfersConnection?: Maybe; @@ -2754,6 +2893,15 @@ export type PositionEdge = { node: Position; }; +/** Response for the estimate of the margin level and, if available, collateral was provided in the request, liqudation price for the specified position */ +export type PositionEstimate = { + __typename?: 'PositionEstimate'; + /** Liquidation price range estimate for the specified position. Only populated if available collateral was specified in the request */ + liquidation?: Maybe; + /** Margin level range estimate for the specified position */ + margin: MarginEstimate; +}; + export type PositionResolution = { __typename?: 'PositionResolution'; /** Number of parties closed out */ @@ -2770,6 +2918,8 @@ export type PositionResolution = { export enum PositionStatus { /** The position was distressed, and had to be closed out entirely - orders were removed from the book, and the open volume was closed out by the network */ POSITION_STATUS_CLOSED_OUT = 'POSITION_STATUS_CLOSED_OUT', + /** The position was distressed, but could not be closed out - orders were removed from the book, and the open volume will be closed out once there is sufficient volume on the book */ + POSITION_STATUS_DISTRESSED = 'POSITION_STATUS_DISTRESSED', /** The position was distressed, but removing open orders from the book brought the margin level back to a point where the open position could be maintained */ POSITION_STATUS_ORDERS_CLOSED = 'POSITION_STATUS_ORDERS_CLOSED', /** The position is either healthy, or if closed out, was closed out normally */ @@ -2923,9 +3073,9 @@ export type Proposal = { reference: Scalars['String']; /** Why the proposal was rejected by the core */ rejectionReason?: Maybe; - /** Required liquidity provider equity like share majority for this proposal to succeed */ + /** Equity-like share required for a market amendment proposal to be enacted (if not met, the proposal will not be enacted), represented as a fraction that can be converted to a percentage */ requiredLpMajority?: Maybe; - /** Required liquidity provider equity like share participation for this proposal to succeed */ + /** The market share of LPs' equity-like share that must take part in the market amendment vote for the proposal to pass. This means the votes of LPs that have submitted more liquidity to that market, or have been LPs from the start carry more weight. If it requires 50% of a market's equity-like share for a majority, and the proposal receives only YES votes but only LPs with 49% of the equity-like share voted, the proposal will not pass */ requiredLpParticipation?: Maybe; /** Required majority for this proposal to succeed */ requiredMajority: Scalars['String']; @@ -2941,6 +3091,36 @@ export type Proposal = { export type ProposalChange = NewAsset | NewFreeform | NewMarket | UpdateAsset | UpdateMarket | UpdateNetworkParameter; +export type ProposalDetail = { + __typename?: 'ProposalDetail'; + /** RFC3339Nano time and date when the proposal reached the Vega network */ + datetime: Scalars['Timestamp']; + /** Error details of the rejectionReason */ + errorDetails?: Maybe; + /** Proposal ID that is provided by Vega once proposal reaches the network */ + id?: Maybe; + /** Party that prepared the proposal */ + party: Party; + /** Rationale behind the proposal */ + rationale: ProposalRationale; + /** A UUID reference to aid tracking proposals on Vega */ + reference: Scalars['String']; + /** Why the proposal was rejected by the core */ + rejectionReason?: Maybe; + /** Equity-like share required for a market amendment proposal to be enacted (if not met, the proposal will not be enacted), represented as a fraction that can be converted to a percentage */ + requiredLpMajority?: Maybe; + /** The market share of LPs' equity-like share that must take part in the market amendment vote for the proposal to pass. This means the votes of LPs that have submitted more liquidity to that market, or have been LPs from the start carry more weight. If it requires 50% of a market's equity-like share for a majority, and the proposal receives only YES votes but only LPs with 49% of the equity-like share voted, the proposal will not pass */ + requiredLpParticipation?: Maybe; + /** Required majority for this proposal to succeed */ + requiredMajority: Scalars['String']; + /** Required participation for this proposal to succeed */ + requiredParticipation: Scalars['String']; + /** State of the proposal */ + state: ProposalState; + /** Terms of the proposal */ + terms: ProposalTerms; +}; + /** Edge type containing the proposals and cursor information returned by a ProposalsConnection */ export type ProposalEdge = { __typename?: 'ProposalEdge'; @@ -3234,6 +3414,8 @@ export type Query = { deposit?: Maybe; /** Fetch all deposits */ deposits?: Maybe; + /** Fetch all entities for a given transaction hash */ + entities: Entities; /** Get data for a specific epoch, if ID omitted it gets the current epoch. If the string is 'next', fetch the next epoch */ epoch: Epoch; /** List reward summary per epoch by asset, market, reward type */ @@ -3249,15 +3431,17 @@ export type Query = { /** Find an erc20 withdrawal approval using its withdrawal ID */ erc20WithdrawalApproval?: Maybe; /** Return an estimation of the potential cost for a new order */ + estimateFees: FeeEstimate; + /** + * Return an estimation of the potential cost for a new order + * @deprecated Use estimateFees and estimatePosition instead + */ estimateOrder: OrderEstimate; + /** Return a margin range for the specified position and liquidation price range if available collateral is supplied */ + estimatePosition?: Maybe; /** Query for historic ethereum key rotations */ ethereumKeyRotations: EthereumKeyRotationsConnection; - /** - * Get market data history for a specific market. If no dates are given, the latest snapshot will be returned. If only the start date is provided, all history from the given date will be provided, and if only the end date is provided, all history from the start up to and including the end date will be provided. - * @deprecated Use getMarketDataHistoryConnectionByID instead - */ - getMarketDataHistoryByID?: Maybe>>; - /** Get market data history for a specific market. If no dates are given, the latest snapshot will be returned. If only the start date is provided all history from the given date will be provided, and if only the end date is provided, all history from the start up to and including the end date will be provided. Pagination is provided using a cursor based pagination model */ + /** Get market data history for a specific market. If no dates are given, the latest snapshot will be returned. If only the start date is provided all history from the given date will be provided, and if only the end date is provided, all history from the start up to and including the end date will be provided. */ getMarketDataHistoryConnectionByID?: Maybe; /** Query for historic key rotations */ keyRotationsConnection: KeyRotationConnection; @@ -3315,6 +3499,8 @@ export type Query = { protocolUpgradeStatus?: Maybe; /** Get statistics about the Vega node */ statistics: Statistics; + /** Get a list of all trades and apply any given filters to the results */ + trades?: Maybe; /** Get a list of all transfers for a public key */ transfersConnection?: Maybe; /** Find a withdrawal using its ID */ @@ -3364,6 +3550,12 @@ export type QuerydepositsArgs = { }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QueryentitiesArgs = { + txHash: Scalars['String']; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QueryepochArgs = { id?: InputMaybe; @@ -3413,6 +3605,19 @@ export type Queryerc20WithdrawalApprovalArgs = { }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QueryestimateFeesArgs = { + expiration?: InputMaybe; + marketId: Scalars['ID']; + partyId: Scalars['ID']; + price?: InputMaybe; + side: Side; + size: Scalars['String']; + timeInForce: OrderTimeInForce; + type: OrderType; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QueryestimateOrderArgs = { expiration?: InputMaybe; @@ -3427,19 +3632,17 @@ export type QueryestimateOrderArgs = { /** Queries allow a caller to read data and filter data via GraphQL. */ -export type QueryethereumKeyRotationsArgs = { - nodeId?: InputMaybe; +export type QueryestimatePositionArgs = { + collateralAvailable?: InputMaybe; + marketId: Scalars['ID']; + openVolume: Scalars['String']; + orders?: InputMaybe>; }; /** Queries allow a caller to read data and filter data via GraphQL. */ -export type QuerygetMarketDataHistoryByIDArgs = { - end?: InputMaybe; - first?: InputMaybe; - id: Scalars['ID']; - last?: InputMaybe; - skip?: InputMaybe; - start?: InputMaybe; +export type QueryethereumKeyRotationsArgs = { + nodeId?: InputMaybe; }; @@ -3600,6 +3803,14 @@ export type QueryprotocolUpgradeProposalsArgs = { }; +/** Queries allow a caller to read data and filter data via GraphQL. */ +export type QuerytradesArgs = { + dateRange?: InputMaybe; + filter?: InputMaybe; + pagination?: InputMaybe; +}; + + /** Queries allow a caller to read data and filter data via GraphQL. */ export type QuerytransfersConnectionArgs = { direction?: InputMaybe; @@ -3798,7 +4009,9 @@ export enum Side { /** The placer of the order is aiming to buy */ SIDE_BUY = 'SIDE_BUY', /** The placer of the order is aiming to sell */ - SIDE_SELL = 'SIDE_SELL' + SIDE_SELL = 'SIDE_SELL', + /** Unspecified is only used for trades at the end of an auction, where neither party acts as the aggressor. */ + SIDE_UNSPECIFIED = 'SIDE_UNSPECIFIED' } /** Signer is the authorized signature used for the data. */ @@ -3978,8 +4191,6 @@ export type Subscription = { busEvents?: Maybe>; /** Subscribe to the candles updates */ candles: Candle; - /** Subscribe to delegation data */ - delegations: Delegation; /** Subscribe to liquidity provisioning data */ liquidityProvisions?: Maybe>; /** Subscribe to the margin changes */ @@ -3996,10 +4207,13 @@ export type Subscription = { positions: Array; /** Subscribe to proposals. Leave out all arguments to receive all proposals */ proposals: Proposal; - /** Subscribe to reward details data */ - rewards: Reward; - /** Subscribe to the trades updates */ + /** + * Subscribe to the trades updates + * @deprecated Use tradesStream instead as it allows for filtering multiple markets and/or parties at once + */ trades?: Maybe>; + /** Subscribe to the trades updates */ + tradesStream?: Maybe>; /** Subscribe to votes, either by proposal ID or party ID */ votes: ProposalVote; }; @@ -4030,13 +4244,6 @@ export type SubscriptioncandlesArgs = { }; -/** Subscriptions allow a caller to receive new information as it is available from the Vega network. */ -export type SubscriptiondelegationsArgs = { - nodeId?: InputMaybe; - partyId?: InputMaybe; -}; - - /** Subscriptions allow a caller to receive new information as it is available from the Vega network. */ export type SubscriptionliquidityProvisionsArgs = { marketId?: InputMaybe; @@ -4089,16 +4296,15 @@ export type SubscriptionproposalsArgs = { /** Subscriptions allow a caller to receive new information as it is available from the Vega network. */ -export type SubscriptionrewardsArgs = { - assetId?: InputMaybe; +export type SubscriptiontradesArgs = { + marketId?: InputMaybe; partyId?: InputMaybe; }; /** Subscriptions allow a caller to receive new information as it is available from the Vega network. */ -export type SubscriptiontradesArgs = { - marketId?: InputMaybe; - partyId?: InputMaybe; +export type SubscriptiontradesStreamArgs = { + filter: TradesSubscriptionFilter; }; @@ -4251,6 +4457,19 @@ export type TradeUpdate = { type: TradeType; }; +/** Filter to apply to the trade connection query */ +export type TradesFilter = { + marketIds?: InputMaybe>; + orderIds?: InputMaybe>; + partyIds?: InputMaybe>; +}; + +/** Filter to apply to the trade subscription request */ +export type TradesSubscriptionFilter = { + marketIds?: InputMaybe>; + partyIds?: InputMaybe>; +}; + /** The result from processing a transaction */ export type TransactionResult = { __typename?: 'TransactionResult'; diff --git a/libs/types/src/global-types-mappings.ts b/libs/types/src/global-types-mappings.ts index eaf84b1e0..9eb11448e 100644 --- a/libs/types/src/global-types-mappings.ts +++ b/libs/types/src/global-types-mappings.ts @@ -172,7 +172,7 @@ export const OrderRejectionReasonMapping: { 'Cannot send IOC order during auction', ORDER_ERROR_EDIT_NOT_ALLOWED: 'Edit not allowed', ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT: 'Expiry time before creation time', - ORDER_ERROR_GFA_CANNOT_SEND_ORDER_DURING_CONTINUOUS_TRADING: + ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING: 'Cannot send GFA order during continuous trading', ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE: 'Insufficient asset balance', ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES: 'Insufficient funds to pay fees', @@ -209,6 +209,11 @@ export const OrderRejectionReasonMapping: { 'Unable to amend price on pegged order', ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER: 'Unable to reprice pegged order', ORDER_ERROR_WITHOUT_REFERENCE_PRICE: 'Without reference price', + ORDER_ERROR_INCORRECT_MARKET_TYPE: 'Incorrect market type', + ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE: 'Post only order would trade', + ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE: + 'Reduce only order would not reduce', + ORDER_ERROR_TOO_MANY_PEGGED_ORDERS: 'Too many pegged orders', }; /** @@ -345,6 +350,7 @@ export const SideMapping: { } = { SIDE_BUY: 'Long', SIDE_SELL: 'Short', + SIDE_UNSPECIFIED: 'Unspecified', }; /** @@ -458,6 +464,7 @@ export const PositionStatusMapping: { POSITION_STATUS_CLOSED_OUT: 'Closed by network', POSITION_STATUS_ORDERS_CLOSED: 'Maintained by network', POSITION_STATUS_UNSPECIFIED: 'Normal', + POSITION_STATUS_DISTRESSED: 'Distressed', }; export const ConditionOperatorMapping: { [C in ConditionOperator]: string } = { From b7a440132d834519c2ea63eb9e2b599cb0571154 Mon Sep 17 00:00:00 2001 From: Maciek Date: Wed, 26 Apr 2023 17:17:23 +0200 Subject: [PATCH 06/10] feat(trading): make Sentry only after opt in (#3448) --- apps/trading-e2e/src/integration/navbar.cy.ts | 4 +- .../src/integration/settings.cy.ts | 45 +++++++++++++++++ apps/trading/.env.testnet | 2 +- apps/trading/client-pages/settings/index.ts | 2 + .../client-pages/settings/settings-button.tsx | 16 +++++++ .../client-pages/settings/settings.tsx | 45 +++++++++++++++++ apps/trading/components/navbar/navbar.tsx | 10 ++-- .../risk-notice-dialog.spec.tsx | 20 +++----- .../welcome-dialog/risk-notice-dialog.tsx | 4 ++ .../telemetry-approval.spec.tsx | 19 ++++++++ .../welcome-dialog/telemetry-approval.tsx | 32 +++++++++++++ .../welcome-dialog/welcome-dialog.tsx | 28 +++++------ .../lib/hooks/use-telemetry-approval.spec.ts | 48 +++++++++++++++++++ .../lib/hooks/use-telemetry-approval.ts | 24 ++++++++++ apps/trading/pages/_app.page.tsx | 6 ++- apps/trading/pages/client-router.tsx | 12 ++++- apps/trading/sentry.client.config.js | 17 +++---- libs/react-helpers/src/hooks/use-logger.ts | 16 ++----- .../components/divider/divider.stories.tsx | 41 ++++++++++++++++ .../src/components/divider/divider.tsx | 19 ++++++++ .../src/components/divider/index.ts | 1 + libs/ui-toolkit/src/components/index.ts | 2 + .../ui-toolkit/src/components/switch/index.ts | 1 + .../src/components/switch/switch.stories.tsx | 31 ++++++++++++ .../src/components/switch/switch.tsx | 38 +++++++++++++++ .../theme-switcher/theme-switcher.tsx | 1 + libs/utils/src/index.ts | 1 + libs/utils/src/lib/sentry-utils.spec.ts | 26 ++++++++++ libs/utils/src/lib/sentry-utils.ts | 15 ++++++ libs/web3/src/lib/use-eager-connect.ts | 5 +- package.json | 6 ++- yarn.lock | 42 +++++++++++++--- 32 files changed, 511 insertions(+), 68 deletions(-) create mode 100644 apps/trading-e2e/src/integration/settings.cy.ts create mode 100644 apps/trading/client-pages/settings/index.ts create mode 100644 apps/trading/client-pages/settings/settings-button.tsx create mode 100644 apps/trading/client-pages/settings/settings.tsx create mode 100644 apps/trading/components/welcome-dialog/telemetry-approval.spec.tsx create mode 100644 apps/trading/components/welcome-dialog/telemetry-approval.tsx create mode 100644 apps/trading/lib/hooks/use-telemetry-approval.spec.ts create mode 100644 apps/trading/lib/hooks/use-telemetry-approval.ts create mode 100644 libs/ui-toolkit/src/components/divider/divider.stories.tsx create mode 100644 libs/ui-toolkit/src/components/divider/divider.tsx create mode 100644 libs/ui-toolkit/src/components/divider/index.ts create mode 100644 libs/ui-toolkit/src/components/switch/index.ts create mode 100644 libs/ui-toolkit/src/components/switch/switch.stories.tsx create mode 100644 libs/ui-toolkit/src/components/switch/switch.tsx create mode 100644 libs/utils/src/lib/sentry-utils.spec.ts create mode 100644 libs/utils/src/lib/sentry-utils.ts diff --git a/apps/trading-e2e/src/integration/navbar.cy.ts b/apps/trading-e2e/src/integration/navbar.cy.ts index 6b04eecac..205c77f3a 100644 --- a/apps/trading-e2e/src/integration/navbar.cy.ts +++ b/apps/trading-e2e/src/integration/navbar.cy.ts @@ -32,7 +32,7 @@ describe('Navbar', { tags: '@smoke' }, () => { }); it('Resources dropdown should be correctly rendered', () => { - const resourceSelector = 'ul li:last-child'; + const resourceSelector = 'ul li:contains(Resources)'; ['Docs', 'Give Feedback'].forEach((text, index) => { cy.get('nav').find(resourceSelector).contains('Resources').click(); cy.get('nav') @@ -91,7 +91,7 @@ describe('Navbar', { tags: '@smoke' }, () => { cy.getByTestId('button-menu-drawer').click(); cy.getByTestId('menu-drawer').should('be.visible'); cy.getByTestId('menu-drawer') - .find('[data-testid="theme-switcher"]') + .find('[data-testid="Settings"]') .should('be.visible'); cy.getByTestId('button-menu-drawer').click(); cy.getByTestId('menu-drawer').should('not.be.visible'); diff --git a/apps/trading-e2e/src/integration/settings.cy.ts b/apps/trading-e2e/src/integration/settings.cy.ts new file mode 100644 index 000000000..8074fee0c --- /dev/null +++ b/apps/trading-e2e/src/integration/settings.cy.ts @@ -0,0 +1,45 @@ +describe('Settings page', { tags: '@smoke' }, () => { + beforeEach(() => { + cy.clearLocalStorage().then(() => { + cy.mockTradingPage(); + cy.mockSubscription(); + cy.visit('/'); + cy.get('[role=dialog]').within(() => { + cy.getByTestId('dialog-close').click(); + }); + cy.get('[aria-label="cog icon"]').click(); + }); + }); + it('telemetry checkbox should work well', () => { + cy.location('hash').should('equal', '#/settings'); + cy.getByTestId('telemetry-approval').should( + 'have.attr', + 'data-state', + 'unchecked' + ); + cy.get('[for="telemetry-approval"]').click(); + cy.getByTestId('telemetry-approval').should( + 'have.attr', + 'data-state', + 'checked' + ); + cy.reload(); + cy.getByTestId('telemetry-approval').should( + 'have.attr', + 'data-state', + 'checked' + ); + cy.get('[for="telemetry-approval"]').click(); + cy.getByTestId('telemetry-approval').should( + 'have.attr', + 'data-state', + 'unchecked' + ); + cy.reload(); + cy.getByTestId('telemetry-approval').should( + 'have.attr', + 'data-state', + 'unchecked' + ); + }); +}); diff --git a/apps/trading/.env.testnet b/apps/trading/.env.testnet index 64e584a9c..c4f8bc481 100644 --- a/apps/trading/.env.testnet +++ b/apps/trading/.env.testnet @@ -11,4 +11,4 @@ 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 \ No newline at end of file +NX_VEGA_INCIDENT_URL=https://blog.vega.xyz/tagged/vega-incident-reports diff --git a/apps/trading/client-pages/settings/index.ts b/apps/trading/client-pages/settings/index.ts new file mode 100644 index 000000000..9b97e60b3 --- /dev/null +++ b/apps/trading/client-pages/settings/index.ts @@ -0,0 +1,2 @@ +export { Settings as default } from './settings'; +export { SettingsButton } from './settings-button'; diff --git a/apps/trading/client-pages/settings/settings-button.tsx b/apps/trading/client-pages/settings/settings-button.tsx new file mode 100644 index 000000000..4f17c2601 --- /dev/null +++ b/apps/trading/client-pages/settings/settings-button.tsx @@ -0,0 +1,16 @@ +import { Icon, NavigationLink } from '@vegaprotocol/ui-toolkit'; +import { t } from '@vegaprotocol/i18n'; +import { Links, Routes } from '../../pages/client-router'; +import { COG } from '@blueprintjs/icons/src/generated/iconNames'; + +export const SettingsButton = ({ withMobile }: { withMobile?: boolean }) => { + return ( + + {withMobile ? ( + t('Settings') + ) : ( + + )} + + ); +}; diff --git a/apps/trading/client-pages/settings/settings.tsx b/apps/trading/client-pages/settings/settings.tsx new file mode 100644 index 000000000..cb14ffde2 --- /dev/null +++ b/apps/trading/client-pages/settings/settings.tsx @@ -0,0 +1,45 @@ +import { t } from '@vegaprotocol/i18n'; +import { TelemetryApproval } from '../../components/welcome-dialog/telemetry-approval'; +import { + Divider, + RoundedWrapper, + Switch, + ThemeSwitcher, +} from '@vegaprotocol/ui-toolkit'; +import { useThemeSwitcher } from '@vegaprotocol/react-helpers'; + +export const Settings = () => { + const { theme, setTheme } = useThemeSwitcher(); + const text = t(theme === 'dark' ? 'Light mode' : 'Dark mode'); + return ( +
+
+

+ {t('Settings')} +

+
+ {t('Changes are applied automatically.')} +
+
+ +
+
+ + +
+ setTheme()} + checked={theme === 'dark'} + /> +
+ + +
+
+
+
+ ); +}; diff --git a/apps/trading/components/navbar/navbar.tsx b/apps/trading/components/navbar/navbar.tsx index f4a36e2af..ccbd32b91 100644 --- a/apps/trading/components/navbar/navbar.tsx +++ b/apps/trading/components/navbar/navbar.tsx @@ -10,7 +10,6 @@ import { t } from '@vegaprotocol/i18n'; import { useGlobalStore } from '../../stores'; import { VegaWalletConnectButton } from '../vega-wallet-connect-button'; import { - ThemeSwitcher, Navigation, NavigationList, NavigationItem, @@ -24,6 +23,7 @@ import { import { Links, Routes } from '../../pages/client-router'; import { createDocsLinks } from '@vegaprotocol/utils'; +import { SettingsButton } from '../../client-pages/settings'; export const Navbar = ({ theme = 'system', @@ -45,7 +45,7 @@ export const Navbar = ({ theme={theme} actions={ <> - + } @@ -108,15 +108,15 @@ export const Navbar = ({ )} - - + + diff --git a/apps/trading/components/welcome-dialog/risk-notice-dialog.spec.tsx b/apps/trading/components/welcome-dialog/risk-notice-dialog.spec.tsx index bf29c411a..9b476130b 100644 --- a/apps/trading/components/welcome-dialog/risk-notice-dialog.spec.tsx +++ b/apps/trading/components/welcome-dialog/risk-notice-dialog.spec.tsx @@ -21,12 +21,12 @@ describe('Risk notice dialog', () => { }); it.each` - assertion | network - ${'displays'} | ${Networks.MAINNET} - ${'does not display'} | ${Networks.CUSTOM} - ${'does not display'} | ${Networks.DEVNET} - ${'does not display'} | ${Networks.STAGNET3} - ${'does not display'} | ${Networks.TESTNET} + assertion | network + ${'displays'} | ${Networks.MAINNET} + ${'displays'} | ${Networks.CUSTOM} + ${'displays'} | ${Networks.DEVNET} + ${'displays'} | ${Networks.STAGNET3} + ${'displays'} | ${Networks.TESTNET} `( '$assertion the risk notice on $network', async ({ assertion, network }) => { @@ -43,13 +43,7 @@ describe('Risk notice dialog', () => { { wrapper: BrowserRouter } ); - if (assertion === 'displays') { - // eslint-disable-next-line jest/no-conditional-expect - expect(screen.queryByText(introText)).toBeInTheDocument(); - } else { - // eslint-disable-next-line jest/no-conditional-expect - expect(screen.queryByText(introText)).not.toBeInTheDocument(); - } + expect(screen.queryByText(introText)).toBeInTheDocument(); } ); diff --git a/apps/trading/components/welcome-dialog/risk-notice-dialog.tsx b/apps/trading/components/welcome-dialog/risk-notice-dialog.tsx index 650d59da7..6c5531b2b 100644 --- a/apps/trading/components/welcome-dialog/risk-notice-dialog.tsx +++ b/apps/trading/components/welcome-dialog/risk-notice-dialog.tsx @@ -3,6 +3,7 @@ import { t } from '@vegaprotocol/i18n'; import { Button } from '@vegaprotocol/ui-toolkit'; import { LocalStorage } from '@vegaprotocol/utils'; import { RISK_ACCEPTED_KEY } from '../constants'; +import { TelemetryApproval } from './telemetry-approval'; interface Props { onClose: () => void; @@ -32,6 +33,9 @@ export const RiskNoticeDialog = ({ onClose }: Props) => { )}

+
+ +
); }; diff --git a/apps/trading/components/welcome-dialog/telemetry-approval.spec.tsx b/apps/trading/components/welcome-dialog/telemetry-approval.spec.tsx new file mode 100644 index 000000000..dc5ff93a9 --- /dev/null +++ b/apps/trading/components/welcome-dialog/telemetry-approval.spec.tsx @@ -0,0 +1,19 @@ +import { render, screen, act } from '@testing-library/react'; +import { TelemetryApproval } from './telemetry-approval'; + +describe('TelemetryApproval', () => { + it('click on checkbox should be properly handled', () => { + render(); + expect(screen.getByRole('checkbox')).toHaveAttribute( + 'data-state', + 'unchecked' + ); + act(() => { + screen.getByRole('checkbox').click(); + }); + expect(screen.getByRole('checkbox')).toHaveAttribute( + 'data-state', + 'checked' + ); + }); +}); diff --git a/apps/trading/components/welcome-dialog/telemetry-approval.tsx b/apps/trading/components/welcome-dialog/telemetry-approval.tsx new file mode 100644 index 000000000..bdc648d4b --- /dev/null +++ b/apps/trading/components/welcome-dialog/telemetry-approval.tsx @@ -0,0 +1,32 @@ +import { Checkbox } from '@vegaprotocol/ui-toolkit'; +import { t } from '@vegaprotocol/i18n'; +import { useTelemetryApproval } from '../../lib/hooks/use-telemetry-approval'; + +export const TelemetryApproval = ({ + isSettingsPage, +}: { + isSettingsPage?: boolean; +}) => { + const [isApproved, setIsApproved] = useTelemetryApproval(); + return ( +
+
+ {t('Share usage data')}} + checked={isApproved} + name="telemetry-approval" + onCheckedChange={() => setIsApproved(!isApproved)} + /> +
+
+ + {t( + 'Help identify bugs and improve the service by sharing anonymous usage data.' + )} + {!isSettingsPage && + ' ' + t('You can change this in your settings at any time.')} + +
+
+ ); +}; diff --git a/apps/trading/components/welcome-dialog/welcome-dialog.tsx b/apps/trading/components/welcome-dialog/welcome-dialog.tsx index c3faf3dc6..722f02c1a 100644 --- a/apps/trading/components/welcome-dialog/welcome-dialog.tsx +++ b/apps/trading/components/welcome-dialog/welcome-dialog.tsx @@ -4,7 +4,6 @@ import { Dialog } from '@vegaprotocol/ui-toolkit'; import { t } from '@vegaprotocol/i18n'; import { useDataProvider, useLocalStorage } from '@vegaprotocol/react-helpers'; import { activeMarketsProvider } from '@vegaprotocol/market-list'; -import { useEnvironment, Networks } from '@vegaprotocol/environment'; import * as constants from '../constants'; import { RiskNoticeDialog } from './risk-notice-dialog'; import { WelcomeNoticeDialog } from './welcome-notice-dialog'; @@ -13,37 +12,38 @@ import { useGlobalStore } from '../../stores'; export const WelcomeDialog = () => { const { pathname } = useLocation(); - const { VEGA_ENV } = useEnvironment(); - let dialogContent: React.ReactNode = null; + let dialogContent: React.ReactNode; let title = ''; let size: 'small' | 'medium' = 'small'; + let onClose: ((open: boolean) => void) | undefined = undefined; const [riskAccepted] = useLocalStorage(constants.RISK_ACCEPTED_KEY); const { data } = useDataProvider({ dataProvider: activeMarketsProvider, variables: undefined, }); - const { update, shouldDisplayWelcomeDialog } = useGlobalStore((store) => ({ - update: store.update, - shouldDisplayWelcomeDialog: store.shouldDisplayWelcomeDialog, - })); - const isRiskDialogNeeded = - riskAccepted !== 'true' && VEGA_ENV === Networks.MAINNET; + const update = useGlobalStore((store) => store.update); + const shouldDisplayWelcomeDialog = useGlobalStore( + (store) => store.shouldDisplayWelcomeDialog + ); + const isRiskDialogNeeded = riskAccepted !== 'true' && !('Cypress' in window); const isWelcomeDialogNeeded = pathname === '/' || shouldDisplayWelcomeDialog; - const onClose = useCallback(() => { + const onCloseDialog = useCallback(() => { update({ shouldDisplayWelcomeDialog: isRiskDialogNeeded }); - // eslint-disable-next-line react-hooks/exhaustive-deps - dialogContent = null; }, [update, isRiskDialogNeeded]); if (isRiskDialogNeeded) { - dialogContent = ; + dialogContent = ; title = t('WARNING'); size = 'medium'; } else if (isWelcomeDialogNeeded && data?.length === 0) { dialogContent = ; + onClose = onCloseDialog; } else if (isWelcomeDialogNeeded && (data?.length || 0) > 0) { - dialogContent = ; + dialogContent = ; + onClose = onCloseDialog; + } else { + dialogContent = null as React.ReactNode; } return ( diff --git a/apps/trading/lib/hooks/use-telemetry-approval.spec.ts b/apps/trading/lib/hooks/use-telemetry-approval.spec.ts new file mode 100644 index 000000000..6a4c9f00d --- /dev/null +++ b/apps/trading/lib/hooks/use-telemetry-approval.spec.ts @@ -0,0 +1,48 @@ +import { renderHook, act, waitFor } from '@testing-library/react'; +import { useLocalStorage } from '@vegaprotocol/react-helpers'; +import { SentryInit, SentryClose } from '@vegaprotocol/utils'; +import { STORAGE_KEY, useTelemetryApproval } from './use-telemetry-approval'; + +const mockSetValue = jest.fn(); +const mockRemoveValue = jest.fn(); +jest.mock('@vegaprotocol/utils'); +jest.mock('@vegaprotocol/react-helpers', () => ({ + ...jest.requireActual('@vegaprotocol/react-helpers'), + useLocalStorage: jest + .fn() + .mockImplementation(() => [false, mockSetValue, mockRemoveValue]), +})); + +describe('useTelemetryApproval', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + it('hook should return proper array', () => { + const res = renderHook(() => useTelemetryApproval()); + expect(res.result.current[0]).toEqual(false); + expect(res.result.current[1]).toEqual(expect.any(Function)); + expect(useLocalStorage).toHaveBeenCalledWith(STORAGE_KEY); + }); + + it('hook should init stuff properly', async () => { + const res = renderHook(() => useTelemetryApproval()); + await act(() => { + res.result.current[1](true); + }); + await waitFor(() => { + expect(SentryInit).toHaveBeenCalled(); + expect(mockSetValue).toHaveBeenCalledWith('1'); + }); + }); + + it('hook should close stuff properly', async () => { + const res = renderHook(() => useTelemetryApproval()); + await act(() => { + res.result.current[1](false); + }); + await waitFor(() => { + expect(SentryClose).toHaveBeenCalled(); + expect(mockRemoveValue).toHaveBeenCalledWith(); + }); + }); +}); diff --git a/apps/trading/lib/hooks/use-telemetry-approval.ts b/apps/trading/lib/hooks/use-telemetry-approval.ts new file mode 100644 index 000000000..21e6a2469 --- /dev/null +++ b/apps/trading/lib/hooks/use-telemetry-approval.ts @@ -0,0 +1,24 @@ +import { useLocalStorage } from '@vegaprotocol/react-helpers'; +import { useCallback } from 'react'; +import { SentryInit, SentryClose } from '@vegaprotocol/utils'; +import { ENV } from '../config'; +export const STORAGE_KEY = 'vega_telemetry_approval'; + +export const useTelemetryApproval = (): [ + value: boolean, + setValue: (value: boolean) => void +] => { + const [value, setValue, removeValue] = useLocalStorage(STORAGE_KEY); + const setApprove = useCallback( + (value: boolean) => { + if (value) { + SentryInit(ENV.dsn, ENV.envName); + return setValue('1'); + } + SentryClose(); + removeValue(); + }, + [setValue, removeValue] + ); + return [Boolean(value), setApprove]; +}; diff --git a/apps/trading/pages/_app.page.tsx b/apps/trading/pages/_app.page.tsx index cfd815d31..3996631d3 100644 --- a/apps/trading/pages/_app.page.tsx +++ b/apps/trading/pages/_app.page.tsx @@ -36,6 +36,7 @@ import { Navbar } from '../components/navbar'; import { ENV } from '../lib/config'; import { useDataProvider } from '@vegaprotocol/react-helpers'; import { activeOrdersProvider } from '@vegaprotocol/orders'; +import { useTelemetryApproval } from '../lib/hooks/use-telemetry-approval'; const DEFAULT_TITLE = t('Welcome to Vega trading!'); @@ -145,7 +146,10 @@ const PartyData = () => { const MaybeConnectEagerly = () => { useVegaEagerConnect(Connectors); - useEthereumEagerConnect(ENV.dsn); + const [isTelemetryApproved] = useTelemetryApproval(); + useEthereumEagerConnect( + isTelemetryApproved ? { dsn: ENV.dsn, env: ENV.envName } : {} + ); const { pubKey, connect } = useVegaWallet(); const [searchParams] = useSearchParams(); diff --git a/apps/trading/pages/client-router.tsx b/apps/trading/pages/client-router.tsx index e5a4659b6..4180df127 100644 --- a/apps/trading/pages/client-router.tsx +++ b/apps/trading/pages/client-router.tsx @@ -26,12 +26,17 @@ const LazyPortfolio = dynamic(() => import('../client-pages/portfolio'), { ssr: false, }); +const LazySettings = dynamic(() => import('../client-pages/settings'), { + ssr: false, +}); + export enum Routes { HOME = '/', MARKET = '/markets', MARKETS = '/markets/all', PORTFOLIO = '/portfolio', - LIQUIDITY = '/liquidity', + LIQUIDITY = 'liquidity/:marketId', + SETTINGS = 'settings', } type ConsoleLinks = { [r in Routes]: (...args: string[]) => string }; @@ -45,6 +50,7 @@ export const Links: ConsoleLinks = { marketId ? trimEnd(`${Routes.LIQUIDITY}/${marketId}`, '/') : Routes.LIQUIDITY, + [Routes.SETTINGS]: () => Routes.SETTINGS, }; const routerConfig: RouteObject[] = [ @@ -87,6 +93,10 @@ const routerConfig: RouteObject[] = [ path: Routes.PORTFOLIO, element: , }, + { + path: Routes.SETTINGS, + element: , + }, { path: '*', element: ( diff --git a/apps/trading/sentry.client.config.js b/apps/trading/sentry.client.config.js index 6724c2dd4..7b5a79bb5 100644 --- a/apps/trading/sentry.client.config.js +++ b/apps/trading/sentry.client.config.js @@ -1,14 +1,9 @@ -import * as Sentry from '@sentry/nextjs'; -import { BrowserTracing } from '@sentry/tracing'; import { ENV } from './lib/config/env'; +import { LocalStorage, SentryInit } from '@vegaprotocol/utils'; +import { STORAGE_KEY } from './lib/hooks/use-telemetry-approval'; -const { dsn } = ENV; - -if (dsn) { - Sentry.init({ - dsn, - integrations: [new BrowserTracing()], - tracesSampleRate: 1, - environment: ENV.envName, - }); +const { dsn, envName } = ENV; +const isTelemetryApproved = !!LocalStorage.getItem(STORAGE_KEY); +if (dsn && isTelemetryApproved) { + SentryInit(dsn, envName); } diff --git a/libs/react-helpers/src/hooks/use-logger.ts b/libs/react-helpers/src/hooks/use-logger.ts index cf62cf218..759d3f3b8 100644 --- a/libs/react-helpers/src/hooks/use-logger.ts +++ b/libs/react-helpers/src/hooks/use-logger.ts @@ -1,24 +1,18 @@ import { useRef } from 'react'; -import { BrowserTracing } from '@sentry/tracing'; -import * as Sentry from '@sentry/browser'; import type { LocalLogger, LoggerConf } from '@vegaprotocol/utils'; -import { localLoggerFactory } from '@vegaprotocol/utils'; +import { localLoggerFactory, SentryInit } from '@vegaprotocol/utils'; -interface Props extends LoggerConf { +export interface LoggerProps extends LoggerConf { dsn?: string; + env?: string; } -export const useLogger = ({ dsn, ...props }: Props) => { +export const useLogger = ({ dsn, env, ...props }: LoggerProps) => { const logger = useRef(null); if (!logger.current) { logger.current = localLoggerFactory(props); if (dsn) { - Sentry.init({ - dsn, - integrations: [new BrowserTracing()], - tracesSampleRate: 1, - defaultIntegrations: false, - }); + SentryInit(dsn, env); } } return logger.current; diff --git a/libs/ui-toolkit/src/components/divider/divider.stories.tsx b/libs/ui-toolkit/src/components/divider/divider.stories.tsx new file mode 100644 index 000000000..069272530 --- /dev/null +++ b/libs/ui-toolkit/src/components/divider/divider.stories.tsx @@ -0,0 +1,41 @@ +import type { ComponentStory, ComponentMeta } from '@storybook/react'; +import className from 'classnames'; +import { Divider } from './divider'; + +export default { + title: 'Divider', + component: Divider, +} as ComponentMeta; + +const Template: ComponentStory = (args) => { + return ( +
+
+ +
+
+ ); +}; + +export const Default = Template.bind({}); +Default.args = {}; + +export const Vertical = Template.bind({}); +Vertical.args = { + orientation: 'vertical', +}; diff --git a/libs/ui-toolkit/src/components/divider/divider.tsx b/libs/ui-toolkit/src/components/divider/divider.tsx new file mode 100644 index 000000000..136cc3d46 --- /dev/null +++ b/libs/ui-toolkit/src/components/divider/divider.tsx @@ -0,0 +1,19 @@ +import { forwardRef } from 'react'; +import * as Separator from '@radix-ui/react-separator'; + +interface DividerProps { + orientation?: 'horizontal' | 'vertical'; + decorative?: boolean; +} + +export const Divider = forwardRef( + ({ orientation = 'horizontal', decorative }, ref) => { + return ( + + ); + } +); diff --git a/libs/ui-toolkit/src/components/divider/index.ts b/libs/ui-toolkit/src/components/divider/index.ts new file mode 100644 index 000000000..0dd50b568 --- /dev/null +++ b/libs/ui-toolkit/src/components/divider/index.ts @@ -0,0 +1 @@ +export { Divider } from './divider'; diff --git a/libs/ui-toolkit/src/components/index.ts b/libs/ui-toolkit/src/components/index.ts index c2ef46544..2e2fb84fc 100644 --- a/libs/ui-toolkit/src/components/index.ts +++ b/libs/ui-toolkit/src/components/index.ts @@ -9,6 +9,7 @@ export * from './callout'; export * from './checkbox'; export * from './copy-with-tooltip'; export * from './dialog'; +export * from './divider'; export * from './drawer'; export * from './dropdown-menu'; export * from './form-group'; @@ -37,6 +38,7 @@ export * from './simple-grid'; export * from './slider'; export * from './sparkline'; export * from './splash'; +export * from './switch'; export * from './syntax-highlighter'; export * from './tabs'; export * from './text-area'; diff --git a/libs/ui-toolkit/src/components/switch/index.ts b/libs/ui-toolkit/src/components/switch/index.ts new file mode 100644 index 000000000..675ddba51 --- /dev/null +++ b/libs/ui-toolkit/src/components/switch/index.ts @@ -0,0 +1 @@ +export { Switch } from './switch'; diff --git a/libs/ui-toolkit/src/components/switch/switch.stories.tsx b/libs/ui-toolkit/src/components/switch/switch.stories.tsx new file mode 100644 index 000000000..f3c0f8289 --- /dev/null +++ b/libs/ui-toolkit/src/components/switch/switch.stories.tsx @@ -0,0 +1,31 @@ +import type { Story, ComponentMeta } from '@storybook/react'; +import type { SwitchProps } from './switch'; +import { Switch } from './switch'; +import { useState } from 'react'; + +export default { + component: Switch, + title: 'Switch', +} as ComponentMeta; + +const Template: Story = (args) => { + const [checked, setChecked] = useState(args.checked || false); + return ( + setChecked(checked)} + /> + ); +}; + +export const Default = Template.bind({}); +Default.args = { + name: 'switch', +}; + +export const WithTextLabel = Template.bind({}); +WithTextLabel.args = { + name: 'switch', + labelText: 'Light mode', +}; diff --git a/libs/ui-toolkit/src/components/switch/switch.tsx b/libs/ui-toolkit/src/components/switch/switch.tsx new file mode 100644 index 000000000..f20a0daf6 --- /dev/null +++ b/libs/ui-toolkit/src/components/switch/switch.tsx @@ -0,0 +1,38 @@ +import type { ReactNode } from 'react'; +import { forwardRef } from 'react'; +import * as RootSwitch from '@radix-ui/react-switch'; + +export interface SwitchProps { + name?: string; + onCheckedChange?: (checked: boolean) => void; + checked?: boolean; + disabled?: boolean; + labelText?: ReactNode | string; +} + +export const Switch = forwardRef( + ( + { name = 'switch', labelText, onCheckedChange, checked = false, disabled }, + ref + ) => { + return ( +
+ + + + {labelText && ( + + )} +
+ ); + } +); diff --git a/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.tsx b/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.tsx index 6ca96ecc6..1b065f75e 100644 --- a/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.tsx +++ b/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.tsx @@ -17,6 +17,7 @@ export const ThemeSwitcher = ({ onClick={() => setTheme()} className={className} data-testid="theme-switcher" + id="theme-switcher" > {theme === 'dark' && } {theme === 'light' && } diff --git a/libs/utils/src/index.ts b/libs/utils/src/index.ts index f099ed873..15f600113 100644 --- a/libs/utils/src/index.ts +++ b/libs/utils/src/index.ts @@ -17,3 +17,4 @@ export * from './lib/remove-0x'; export * from './lib/remove-pagination-wrapper'; export * from './lib/time'; export * from './lib/validate'; +export * from './lib/sentry-utils'; diff --git a/libs/utils/src/lib/sentry-utils.spec.ts b/libs/utils/src/lib/sentry-utils.spec.ts new file mode 100644 index 000000000..731405620 --- /dev/null +++ b/libs/utils/src/lib/sentry-utils.spec.ts @@ -0,0 +1,26 @@ +import * as Sentry from '@sentry/nextjs'; +import { SentryInit, SentryClose } from './sentry-utils'; + +jest.mock('@sentry/nextjs'); + +describe('Sentry utlis', () => { + describe('SentryInit', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should initialize', () => { + SentryInit('sentry.dsn'); + expect(Sentry.init).toHaveBeenCalled(); + }); + it('should do nothing', () => { + SentryInit(''); + expect(Sentry.init).not.toHaveBeenCalled(); + }); + + it('should close', () => { + SentryClose(); + expect(Sentry.close).toHaveBeenCalled(); + }); + }); +}); diff --git a/libs/utils/src/lib/sentry-utils.ts b/libs/utils/src/lib/sentry-utils.ts new file mode 100644 index 000000000..a308bebb0 --- /dev/null +++ b/libs/utils/src/lib/sentry-utils.ts @@ -0,0 +1,15 @@ +import * as Sentry from '@sentry/nextjs'; +import { BrowserTracing } from '@sentry/tracing'; + +export const SentryInit = (dsn: string, env?: string) => { + if (dsn) { + Sentry.init({ + dsn, + integrations: [new BrowserTracing()], + tracesSampleRate: 1, + environment: env || '', + }); + } +}; + +export const SentryClose = () => Sentry.close(); diff --git a/libs/web3/src/lib/use-eager-connect.ts b/libs/web3/src/lib/use-eager-connect.ts index dd1c741ca..647d19e2e 100644 --- a/libs/web3/src/lib/use-eager-connect.ts +++ b/libs/web3/src/lib/use-eager-connect.ts @@ -1,3 +1,4 @@ +import type { LoggerProps } from '@vegaprotocol/react-helpers'; import { useLocalStorage, useLogger } from '@vegaprotocol/react-helpers'; import type { Web3ReactHooks } from '@web3-react/core'; import { MetaMask } from '@web3-react/metamask'; @@ -8,12 +9,12 @@ import { useWeb3ConnectStore } from './web3-connect-store'; export const ETHEREUM_EAGER_CONNECT = 'ethereum-eager-connect'; -export const useEagerConnect = (sentryDsn?: string) => { +export const useEagerConnect = (loggerConf: LoggerProps) => { const connectors = useWeb3ConnectStore((store) => store.connectors); const [eagerConnector] = useLocalStorage(ETHEREUM_EAGER_CONNECT); const attemptedRef = useRef(false); - const logger = useLogger({ dsn: sentryDsn }); + const logger = useLogger(loggerConf); useEffect(() => { if (attemptedRef.current || 'Cypress' in window) return; diff --git a/package.json b/package.json index 4dcb3db01..35ba287e7 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,9 @@ "@radix-ui/react-popover": "^1.0.3", "@radix-ui/react-radio-group": "^1.1.1", "@radix-ui/react-select": "^1.2.0", + "@radix-ui/react-separator": "^1.0.2", "@radix-ui/react-slider": "^1.1.0", + "@radix-ui/react-switch": "^1.0.2", "@radix-ui/react-tabs": "^1.0.2", "@radix-ui/react-tooltip": "^1.0.3", "@sentry/nextjs": "^6.19.3", @@ -202,6 +204,8 @@ "*.{ts,tsx,js,jsx}": "yarn eslint --fix" }, "resolutions": { - "graphql": "15.8.0" + "graphql": "15.8.0", + "//": "workaround storybook issue: https://github.com/storybookjs/storybook/issues/21642", + "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.cd77847.0" } } diff --git a/yarn.lock b/yarn.lock index 3f70c1cf0..0bfb9d0d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4609,6 +4609,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-slot" "1.0.1" +"@radix-ui/react-primitive@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.2.tgz#54e22f49ca59ba88d8143090276d50b93f8a7053" + integrity sha512-zY6G5Qq4R8diFPNwtyoLRZBxzu1Z+SXMlfYpChN7Dv8gvmx9X3qhDqiLWvKseKVJMuedFeU/Sa0Sy/Ia+t06Dw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-slot" "1.0.1" + "@radix-ui/react-radio-group@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@radix-ui/react-radio-group/-/react-radio-group-1.1.1.tgz#564549b3e0a5905367dfe9adfe7b0e245cbdb640" @@ -4670,6 +4678,14 @@ aria-hidden "^1.1.1" react-remove-scroll "2.5.5" +"@radix-ui/react-separator@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-separator/-/react-separator-1.0.2.tgz#52417c8bfae1e4ef87356b2f7bffbc3dbbeddf23" + integrity sha512-lZoAG/rS2jzb/OSvyBrpN3dmikw20ewmWx1GkM1VldbDyD0DACCbH9LIXSrqyS/2mE1VYKOHmyq5W90Dx4ryqA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.2" + "@radix-ui/react-slider@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-slider/-/react-slider-1.1.0.tgz#b3fdaca27619150e9e6067ad9f979a4535f68d5e" @@ -4696,6 +4712,20 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-compose-refs" "1.0.0" +"@radix-ui/react-switch@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-switch/-/react-switch-1.0.2.tgz#e3d1b9fe18b6b1173aadc8b8e6efdc96a28a70f8" + integrity sha512-BcG/LKehxt36NXG0wPnoCitIfSMtU9Xo7BmythYA1PAMLtsMvW7kALfBzmduQoHTWcKr0AVcFyh0gChBUp9TiQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.0" + "@radix-ui/react-compose-refs" "1.0.0" + "@radix-ui/react-context" "1.0.0" + "@radix-ui/react-primitive" "1.0.2" + "@radix-ui/react-use-controllable-state" "1.0.0" + "@radix-ui/react-use-previous" "1.0.0" + "@radix-ui/react-use-size" "1.0.0" + "@radix-ui/react-tabs@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-tabs/-/react-tabs-1.0.2.tgz#8f5ec73ca41b151a413bdd6e00553408ff34ce07" @@ -6266,17 +6296,17 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" -"@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": - version "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0" - resolved "https://registry.yarnpkg.com/@storybook/react-docgen-typescript-plugin/-/react-docgen-typescript-plugin-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0.tgz#3103532ff494fb7dc3cf835f10740ecf6a26c0f9" - integrity sha512-eVg3BxlOm2P+chijHBTByr90IZVUtgRW56qEOLX7xlww2NBuKrcavBlcmn+HH7GIUktquWkMPtvy6e0W0NgA5w== +"@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0", "@storybook/react-docgen-typescript-plugin@1.0.6--canary.9.cd77847.0": + version "1.0.6--canary.9.cd77847.0" + resolved "https://registry.yarnpkg.com/@storybook/react-docgen-typescript-plugin/-/react-docgen-typescript-plugin-1.0.6--canary.9.cd77847.0.tgz#35beed1bd0813569fc8852b372c92069fe74a448" + integrity sha512-I4oBYmnUCX5IsrZhg+ST72dubSIV4wdwY+SfqJiJ3NHvDpdb240ZjdHAmjIy/yJh5rh42Fl4jbG8Tr4SzwV53Q== dependencies: debug "^4.1.1" endent "^2.0.1" find-cache-dir "^3.3.1" flat-cache "^3.0.4" micromatch "^4.0.2" - react-docgen-typescript "^2.1.1" + react-docgen-typescript "^2.2.2" tslib "^2.0.0" "@storybook/react@6.5.10": @@ -20701,7 +20731,7 @@ react-copy-to-clipboard@^5.0.4: copy-to-clipboard "^3.3.1" prop-types "^15.8.1" -react-docgen-typescript@^2.1.1: +react-docgen-typescript@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/react-docgen-typescript/-/react-docgen-typescript-2.2.2.tgz#4611055e569edc071204aadb20e1c93e1ab1659c" integrity sha512-tvg2ZtOpOi6QDwsb3GZhOjDkkX0h8Z2gipvTg6OVMUyoYoURhEiRNePT8NZItTVCDh39JJHnLdfCOkzoLbFnTg== From 32f5eaade5e5eb014cf055b19d1d362bc4ab99a9 Mon Sep 17 00:00:00 2001 From: dexturr Date: Wed, 26 Apr 2023 18:07:54 +0000 Subject: [PATCH 07/10] chore: update tranches Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- apps/static/src/assets/mainnet-tranches.json | 83 ++++++++++++++------ 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index 7730e0e1a..3ef8f86c6 100644 --- a/apps/static/src/assets/mainnet-tranches.json +++ b/apps/static/src/assets/mainnet-tranches.json @@ -38,7 +38,7 @@ "tranche_end": "2023-05-20T00:00:00.000Z", "total_added": "19242.125", "total_removed": "397.984073768865", - "locked_amount": "15068.736736207562060975", + "locked_amount": "14909.13548413387412195", "deposits": [ { "amount": "188", @@ -811,7 +811,7 @@ "tranche_end": "2023-05-06T00:00:00.000Z", "total_added": "8976", "total_removed": "596.64743517951", - "locked_amount": "2840.4122592592591152", + "locked_amount": "2765.9620185185185296", "deposits": [ { "amount": "111", @@ -4594,7 +4594,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "86666.297", "total_removed": "0", - "locked_amount": "52829.2474338382140338349", + "locked_amount": "52770.1645216361957023416", "deposits": [ { "amount": "86666.297", @@ -4660,7 +4660,7 @@ "tranche_end": "2023-06-01T00:00:00.000Z", "total_added": "2500", "total_removed": "0", - "locked_amount": "487.54610551485555", + "locked_amount": "484.128097018722", "deposits": [ { "amount": "2500", @@ -4781,7 +4781,7 @@ "tranche_end": "2023-09-01T00:00:00.000Z", "total_added": "17500", "total_removed": "0", - "locked_amount": "12125.7268392713355", + "locked_amount": "12102.06084566224025", "deposits": [ { "amount": "12500", @@ -5048,7 +5048,7 @@ "tranche_end": "2023-08-01T00:00:00.000Z", "total_added": "37500", "total_removed": "12704.026146825", - "locked_amount": "19991.71750306936875", + "locked_amount": "19940.164115254755", "deposits": [ { "amount": "7500", @@ -5434,7 +5434,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "129999.45", "total_removed": "0", - "locked_amount": "52781.047392785629516053", + "locked_amount": "52722.018386306905237875", "deposits": [ { "amount": "129999.45", @@ -5467,7 +5467,7 @@ "tranche_end": "2024-04-01T00:00:00.000Z", "total_added": "54144.7663", "total_removed": "0", - "locked_amount": "50371.40222238362540059014", + "locked_amount": "50334.5910274495280292426", "deposits": [ { "amount": "54144.7663", @@ -5500,7 +5500,7 @@ "tranche_end": "2023-09-03T00:00:00.000Z", "total_added": "62600", "total_removed": "0", - "locked_amount": "22208.997577371892778", + "locked_amount": "22166.321353373919378", "deposits": [ { "amount": "10000", @@ -5693,7 +5693,7 @@ "tranche_end": "2023-09-17T00:00:00.000Z", "total_added": "5000", "total_removed": "0", - "locked_amount": "1965.6624175545405", + "locked_amount": "1962.2537734652462", "deposits": [ { "amount": "5000", @@ -6234,7 +6234,7 @@ "tranche_end": "2023-05-01T00:00:00.000Z", "total_added": "22500", "total_removed": "7280.725809525", - "locked_amount": "558.56641344383115", + "locked_amount": "527.6343807550645875", "deposits": [ { "amount": "7500", @@ -6739,8 +6739,8 @@ "tranche_start": "2022-06-02T00:00:00.000Z", "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", - "total_removed": "928642.9598472029154", - "locked_amount": "193957.5285476244010738806", + "total_removed": "1709370.7872515768348", + "locked_amount": "192635.0234663958955347444", "deposits": [ { "amount": "1852091.69", @@ -6754,6 +6754,11 @@ } ], "withdrawals": [ + { + "amount": "780727.8274043739194", + "user": "0xEbaeCD22304445A471630600708A197A311daB7F", + "tx": "0x10c3995baad1a053d37e0b84a56df717948b38bc10000676c296f22d1528754c" + }, { "amount": "15557.429251822391", "user": "0xEbaeCD22304445A471630600708A197A311daB7F", @@ -6832,6 +6837,12 @@ } ], "withdrawals": [ + { + "amount": "780727.8274043739194", + "user": "0xEbaeCD22304445A471630600708A197A311daB7F", + "tranche_id": 15, + "tx": "0x10c3995baad1a053d37e0b84a56df717948b38bc10000676c296f22d1528754c" + }, { "amount": "15557.429251822391", "user": "0xEbaeCD22304445A471630600708A197A311daB7F", @@ -6888,8 +6899,8 @@ } ], "total_tokens": "1852091.69", - "withdrawn_tokens": "886846.7025967940149", - "remaining_tokens": "965244.9874032059851" + "withdrawn_tokens": "1667574.5300011679343", + "remaining_tokens": "184517.1599988320657" }, { "address": "0x3469bbE61Ef6d5F31FE75a3f93C8835Aa2A62359", @@ -40556,7 +40567,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "715655.108029600523393", - "locked_amount": "322546.517267879190806982098", + "locked_amount": "320514.28740539621126901005", "deposits": [ { "amount": "1998.95815", @@ -41948,8 +41959,8 @@ "tranche_start": "2022-06-05T00:00:00.000Z", "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15870102.715470999700000001", - "total_removed": "863956.20182679498584852", - "locked_amount": "6443416.82640696362856446483297671260124354", + "total_removed": "864400.93329864929559852", + "locked_amount": "6436210.6697962275262102481781854533995675", "deposits": [ { "amount": "16249.93", @@ -42478,6 +42489,11 @@ "user": "0xe3eB4CF43C072658401996b71D43eE26E573562D", "tx": "0x9d12dadb940c59a796a405a4971e73f24d7ad284528ec7ce676ae361a4ac1f51" }, + { + "amount": "444.73147185430975", + "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", + "tx": "0x28d2b3f088965906ac3da878c491309729680c302fb98e2a435d07f88d6b962a" + }, { "amount": "981.387731774910625", "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", @@ -44598,6 +44614,12 @@ "tranche_id": 2, "tx": "0x715201656de8957c81817e491e18394abf8bc419d96c86c5106ef3f30d7625e9" }, + { + "amount": "444.73147185430975", + "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", + "tranche_id": 2, + "tx": "0x28d2b3f088965906ac3da878c491309729680c302fb98e2a435d07f88d6b962a" + }, { "amount": "981.387731774910625", "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", @@ -46106,8 +46128,8 @@ } ], "total_tokens": "259998.8875", - "withdrawn_tokens": "154058.03361015483075", - "remaining_tokens": "105940.85388984516925" + "withdrawn_tokens": "154502.7650820091405", + "remaining_tokens": "105496.1224179908595" }, { "address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c", @@ -48482,8 +48504,8 @@ "tranche_start": "2021-11-05T00:00:00.000Z", "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", - "total_removed": "5849351.477870348891944626", - "locked_amount": "227076.0462437110259876403850980756", + "total_removed": "5849965.272793104574125126", + "locked_amount": "220423.368472422944835201646093986", "deposits": [ { "amount": "129284.449", @@ -48702,6 +48724,11 @@ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", "tx": "0x4aef9b3e2f51d9ed88eb15f4553ae6f8388122b113571035da8ccb9f25ba68aa" }, + { + "amount": "613.7949227556821805", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0xc37374c867eb2543ba3de47bf14990096f3371a93609cfd557a1eeaa3fb3e774" + }, { "amount": "1360.32447632896938825", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -52014,6 +52041,12 @@ "tranche_id": 3, "tx": "0x4aef9b3e2f51d9ed88eb15f4553ae6f8388122b113571035da8ccb9f25ba68aa" }, + { + "amount": "613.7949227556821805", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0xc37374c867eb2543ba3de47bf14990096f3371a93609cfd557a1eeaa3fb3e774" + }, { "amount": "1360.32447632896938825", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -54836,8 +54869,8 @@ } ], "total_tokens": "359123.469575", - "withdrawn_tokens": "353014.654080898123457", - "remaining_tokens": "6108.815494101876543" + "withdrawn_tokens": "353628.4490036538056375", + "remaining_tokens": "5495.0205713461943625" }, { "address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB", @@ -58483,7 +58516,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", "total_removed": "43542.8634352159416", - "locked_amount": "51109.339415592305104943735362752", + "locked_amount": "50787.320977160650360055262506352", "deposits": [ { "amount": "3000", From 5394b00349e89d2f98b7e13edae5191f96d24457 Mon Sep 17 00:00:00 2001 From: dexturr Date: Thu, 27 Apr 2023 00:16:39 +0000 Subject: [PATCH 08/10] chore: update tranches Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- apps/static/src/assets/mainnet-tranches.json | 52 ++++++++++++-------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index 3ef8f86c6..609b15d4a 100644 --- a/apps/static/src/assets/mainnet-tranches.json +++ b/apps/static/src/assets/mainnet-tranches.json @@ -38,7 +38,7 @@ "tranche_end": "2023-05-20T00:00:00.000Z", "total_added": "19242.125", "total_removed": "397.984073768865", - "locked_amount": "14909.13548413387412195", + "locked_amount": "14744.8870213155857308375", "deposits": [ { "amount": "188", @@ -811,7 +811,7 @@ "tranche_end": "2023-05-06T00:00:00.000Z", "total_added": "8976", "total_removed": "596.64743517951", - "locked_amount": "2765.9620185185185296", + "locked_amount": "2689.34396296296261168", "deposits": [ { "amount": "111", @@ -4594,7 +4594,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "86666.297", "total_removed": "0", - "locked_amount": "52770.1645216361957023416", + "locked_amount": "52709.361254857751280224", "deposits": [ { "amount": "86666.297", @@ -4660,7 +4660,7 @@ "tranche_end": "2023-06-01T00:00:00.000Z", "total_added": "2500", "total_removed": "0", - "locked_amount": "484.128097018722", + "locked_amount": "480.6105642043143", "deposits": [ { "amount": "2500", @@ -4781,7 +4781,7 @@ "tranche_end": "2023-09-01T00:00:00.000Z", "total_added": "17500", "total_removed": "0", - "locked_amount": "12102.06084566224025", + "locked_amount": "12077.70575432769775", "deposits": [ { "amount": "12500", @@ -5048,7 +5048,7 @@ "tranche_end": "2023-08-01T00:00:00.000Z", "total_added": "37500", "total_removed": "12704.026146825", - "locked_amount": "19940.164115254755", + "locked_amount": "19887.109614794355", "deposits": [ { "amount": "7500", @@ -5434,7 +5434,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "129999.45", "total_removed": "0", - "locked_amount": "52722.018386306905237875", + "locked_amount": "52661.270594858833487685", "deposits": [ { "amount": "129999.45", @@ -5467,7 +5467,7 @@ "tranche_end": "2024-04-01T00:00:00.000Z", "total_added": "54144.7663", "total_removed": "0", - "locked_amount": "50334.5910274495280292426", + "locked_amount": "50296.70797763713455867129", "deposits": [ { "amount": "54144.7663", @@ -5500,7 +5500,7 @@ "tranche_end": "2023-09-03T00:00:00.000Z", "total_added": "62600", "total_removed": "0", - "locked_amount": "22166.321353373919378", + "locked_amount": "22122.402498731605924", "deposits": [ { "amount": "10000", @@ -5693,7 +5693,7 @@ "tranche_end": "2023-09-17T00:00:00.000Z", "total_added": "5000", "total_removed": "0", - "locked_amount": "1962.2537734652462", + "locked_amount": "1958.74587772704225", "deposits": [ { "amount": "5000", @@ -6234,7 +6234,7 @@ "tranche_end": "2023-05-01T00:00:00.000Z", "total_added": "22500", "total_removed": "7280.725809525", - "locked_amount": "527.6343807550645875", + "locked_amount": "495.801680478821775", "deposits": [ { "amount": "7500", @@ -6740,7 +6740,7 @@ "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", "total_removed": "1709370.7872515768348", - "locked_amount": "192635.0234663958955347444", + "locked_amount": "191274.0101670712975688404", "deposits": [ { "amount": "1852091.69", @@ -40567,7 +40567,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "715655.108029600523393", - "locked_amount": "320514.28740539621126901005", + "locked_amount": "318422.883818836599765889836", "deposits": [ { "amount": "1998.95815", @@ -41960,7 +41960,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15870102.715470999700000001", "total_removed": "864400.93329864929559852", - "locked_amount": "6436210.6697962275262102481781854533995675", + "locked_amount": "6428794.6869592316046447890536544207191133", "deposits": [ { "amount": "16249.93", @@ -48505,7 +48505,7 @@ "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", "total_removed": "5849965.272793104574125126", - "locked_amount": "220423.368472422944835201646093986", + "locked_amount": "213576.9804688068980534777929888182", "deposits": [ { "amount": "129284.449", @@ -58515,8 +58515,8 @@ "tranche_start": "2022-06-05T00:00:00.000Z", "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", - "total_removed": "43542.8634352159416", - "locked_amount": "50787.320977160650360055262506352", + "total_removed": "43578.5678022883416", + "locked_amount": "50455.926123897713742947121562668", "deposits": [ { "amount": "3000", @@ -65150,6 +65150,11 @@ "user": "0x1ee93BF13d1D1d876330B011B28c507e392bc5E1", "tx": "0xe4864b2d0f69c08809883553089d90b5a2318c4bc3c95ab5433db46cbd797bae" }, + { + "amount": "35.7043670724", + "user": "0x5934b08F2548207149f90AC776867e4527Cf61E8", + "tx": "0x95a888c071664f817003e5e8410f8f7d9559fcfd93818961d6e656bf72b1dcde" + }, { "amount": "168.502276762", "user": "0x38A292CB98Dc602ECAFF94E8E5fADD9800e4bA13", @@ -75685,10 +75690,17 @@ "tx": "0x96a22c369645e8945b4047374a05332f4054b50a492c43092e8bb8e974a006b9" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "35.7043670724", + "user": "0x5934b08F2548207149f90AC776867e4527Cf61E8", + "tranche_id": 5, + "tx": "0x95a888c071664f817003e5e8410f8f7d9559fcfd93818961d6e656bf72b1dcde" + } + ], "total_tokens": "40", - "withdrawn_tokens": "0", - "remaining_tokens": "40" + "withdrawn_tokens": "35.7043670724", + "remaining_tokens": "4.2956329276" }, { "address": "0x2DFE1e54a1c9b6Ff874da1A4390326115e6f9eF9", From 1e5e57b978ba5fab877e9b250b5a7d0c5a954551 Mon Sep 17 00:00:00 2001 From: dexturr Date: Thu, 27 Apr 2023 06:10:10 +0000 Subject: [PATCH 09/10] chore: update tranches Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- apps/static/src/assets/mainnet-tranches.json | 69 +++++++++++++------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index 609b15d4a..9311d3f47 100644 --- a/apps/static/src/assets/mainnet-tranches.json +++ b/apps/static/src/assets/mainnet-tranches.json @@ -38,7 +38,7 @@ "tranche_end": "2023-05-20T00:00:00.000Z", "total_added": "19242.125", "total_removed": "397.984073768865", - "locked_amount": "14744.8870213155857308375", + "locked_amount": "14587.4163594714507360625", "deposits": [ { "amount": "188", @@ -811,7 +811,7 @@ "tranche_end": "2023-05-06T00:00:00.000Z", "total_added": "8976", "total_removed": "596.64743517951", - "locked_amount": "2689.34396296296261168", + "locked_amount": "2615.8875925925923488", "deposits": [ { "amount": "111", @@ -4594,7 +4594,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "86666.297", "total_removed": "0", - "locked_amount": "52709.361254857751280224", + "locked_amount": "52651.0670675174430414228", "deposits": [ { "amount": "86666.297", @@ -4660,7 +4660,7 @@ "tranche_end": "2023-06-01T00:00:00.000Z", "total_added": "2500", "total_removed": "0", - "locked_amount": "480.6105642043143", + "locked_amount": "477.23818426943425", "deposits": [ { "amount": "2500", @@ -4781,7 +4781,7 @@ "tranche_end": "2023-09-01T00:00:00.000Z", "total_added": "17500", "total_removed": "0", - "locked_amount": "12077.70575432769775", + "locked_amount": "12054.35568890901775", "deposits": [ { "amount": "12500", @@ -5048,7 +5048,7 @@ "tranche_end": "2023-08-01T00:00:00.000Z", "total_added": "37500", "total_removed": "12704.026146825", - "locked_amount": "19887.109614794355", + "locked_amount": "19836.24443677102875", "deposits": [ { "amount": "7500", @@ -5434,7 +5434,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "129999.45", "total_removed": "0", - "locked_amount": "52661.270594858833487685", + "locked_amount": "52603.029593629619941305", "deposits": [ { "amount": "129999.45", @@ -5467,7 +5467,7 @@ "tranche_end": "2024-04-01T00:00:00.000Z", "total_added": "54144.7663", "total_removed": "0", - "locked_amount": "50296.70797763713455867129", + "locked_amount": "50260.38819220796159812442", "deposits": [ { "amount": "54144.7663", @@ -5500,7 +5500,7 @@ "tranche_end": "2023-09-03T00:00:00.000Z", "total_added": "62600", "total_removed": "0", - "locked_amount": "22122.402498731605924", + "locked_amount": "22080.29597919837872", "deposits": [ { "amount": "10000", @@ -5693,7 +5693,7 @@ "tranche_end": "2023-09-17T00:00:00.000Z", "total_added": "5000", "total_removed": "0", - "locked_amount": "1958.74587772704225", + "locked_amount": "1955.382737189244", "deposits": [ { "amount": "5000", @@ -6234,7 +6234,7 @@ "tranche_end": "2023-05-01T00:00:00.000Z", "total_added": "22500", "total_removed": "7280.725809525", - "locked_amount": "495.801680478821775", + "locked_amount": "465.2825736648258", "deposits": [ { "amount": "7500", @@ -6740,7 +6740,7 @@ "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", "total_removed": "1709370.7872515768348", - "locked_amount": "191274.0101670712975688404", + "locked_amount": "189969.1598120306593902572", "deposits": [ { "amount": "1852091.69", @@ -40567,7 +40567,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "715655.108029600523393", - "locked_amount": "318422.883818836599765889836", + "locked_amount": "316417.783123780845942826482", "deposits": [ { "amount": "1998.95815", @@ -41960,7 +41960,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15870102.715470999700000001", "total_removed": "864400.93329864929559852", - "locked_amount": "6428794.6869592316046447890536544207191133", + "locked_amount": "6421684.7286343349090524101959629311219249", "deposits": [ { "amount": "16249.93", @@ -48504,8 +48504,8 @@ "tranche_start": "2021-11-05T00:00:00.000Z", "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", - "total_removed": "5849965.272793104574125126", - "locked_amount": "213576.9804688068980534777929888182", + "total_removed": "6129688.581848831721813882", + "locked_amount": "207013.1123407730577557502438032262", "deposits": [ { "amount": "129284.449", @@ -48729,6 +48729,11 @@ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", "tx": "0xc37374c867eb2543ba3de47bf14990096f3371a93609cfd557a1eeaa3fb3e774" }, + { + "amount": "279723.309055727147688756", + "user": "0xDdc5F6484349B242A9B23382Aa21f49B5Dc9a089", + "tx": "0xba1fdde929e0e2d4fe79de4dbac92cb5d20bb8b1dd7e5ff9bab961b728e7dae2" + }, { "amount": "1360.32447632896938825", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -55550,6 +55555,12 @@ } ], "withdrawals": [ + { + "amount": "279723.309055727147688756", + "user": "0xDdc5F6484349B242A9B23382Aa21f49B5Dc9a089", + "tranche_id": 3, + "tx": "0xba1fdde929e0e2d4fe79de4dbac92cb5d20bb8b1dd7e5ff9bab961b728e7dae2" + }, { "amount": "204596.435472093839665575", "user": "0xDdc5F6484349B242A9B23382Aa21f49B5Dc9a089", @@ -55576,8 +55587,8 @@ } ], "total_tokens": "805741.847535494", - "withdrawn_tokens": "514496.445771975315053377", - "remaining_tokens": "291245.401763518684946623" + "withdrawn_tokens": "794219.754827702462742133", + "remaining_tokens": "11522.092707791537257867" }, { "address": "0x47FbE34Fd93416c63d35544dEE6c6f442Db8513d", @@ -58515,8 +58526,8 @@ "tranche_start": "2022-06-05T00:00:00.000Z", "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", - "total_removed": "43578.5678022883416", - "locked_amount": "50455.926123897713742947121562668", + "total_removed": "43935.8732690563416", + "locked_amount": "50138.206457121953572821564586524", "deposits": [ { "amount": "3000", @@ -65155,6 +65166,11 @@ "user": "0x5934b08F2548207149f90AC776867e4527Cf61E8", "tx": "0x95a888c071664f817003e5e8410f8f7d9559fcfd93818961d6e656bf72b1dcde" }, + { + "amount": "357.305466768", + "user": "0x0a6A5e1da768709A2bF17b2E58B2B73120051D03", + "tx": "0x097e43cb4f64f1cb502f321eceb8b91e6378cac0b3b6fe558fc1d543aec597e2" + }, { "amount": "168.502276762", "user": "0x38A292CB98Dc602ECAFF94E8E5fADD9800e4bA13", @@ -78959,10 +78975,17 @@ "tx": "0x716a7be06da5a7a3d8038907974887a31805ea8eeab5d130cba528e4d2094d9f" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "357.305466768", + "user": "0x0a6A5e1da768709A2bF17b2E58B2B73120051D03", + "tranche_id": 5, + "tx": "0x097e43cb4f64f1cb502f321eceb8b91e6378cac0b3b6fe558fc1d543aec597e2" + } + ], "total_tokens": "400", - "withdrawn_tokens": "0", - "remaining_tokens": "400" + "withdrawn_tokens": "357.305466768", + "remaining_tokens": "42.694533232" }, { "address": "0x7Bca13F09dA191AAc54cb76C815c8055C02a4D59", From 6593bbf37ba208f74a4d43fcb785a248ea193961 Mon Sep 17 00:00:00 2001 From: Maciek Date: Thu, 27 Apr 2023 09:38:57 +0200 Subject: [PATCH 10/10] feat(trading): settings page quick adjust a css (#3558) --- apps/trading/components/welcome-dialog/telemetry-approval.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/trading/components/welcome-dialog/telemetry-approval.tsx b/apps/trading/components/welcome-dialog/telemetry-approval.tsx index bdc648d4b..e4464418e 100644 --- a/apps/trading/components/welcome-dialog/telemetry-approval.tsx +++ b/apps/trading/components/welcome-dialog/telemetry-approval.tsx @@ -18,7 +18,7 @@ export const TelemetryApproval = ({ onCheckedChange={() => setIsApproved(!isApproved)} />
-
+
{t( 'Help identify bugs and improve the service by sharing anonymous usage data.'