Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync main with upstream #26

Open
wants to merge 192 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
c75cac0
create action button
maxaleks Apr 24, 2024
6354b5d
pass custom app url to iframe
maxaleks Apr 24, 2024
2cc7535
Merge branch 'main' into action-button
maxaleks Apr 30, 2024
55c46fa
improve action button, add real data
maxaleks May 2, 2024
dd9bc0c
add action button to tx page
maxaleks May 2, 2024
b794a05
add action button to NFT pages
maxaleks May 2, 2024
f0377c0
add A/B-experiment and mixpanel event
maxaleks May 3, 2024
c93a965
fix padding
maxaleks May 3, 2024
21ac24d
add metadata service to .env.eth
maxaleks May 6, 2024
e6975fa
show action button if tx interpretation exists
maxaleks May 6, 2024
11bb195
[skip ci] add ignored paths to deploy from main workflow
tom2drum May 6, 2024
f5c890f
merge main
maxaleks May 6, 2024
3acc861
[skip ci] fix mock
tom2drum May 7, 2024
7bfbb3a
remove old public tags page
tom2drum May 7, 2024
324af2c
rename vars
maxaleks May 7, 2024
349813a
memoize array of addresses
maxaleks May 7, 2024
3d60059
Add ENV variable allowing to choose default color schema (#1882)
tom2drum May 7, 2024
1cea43f
rename meta props
maxaleks May 7, 2024
7d9b502
placeholder for the new page
tom2drum May 7, 2024
f15f909
change icon color
maxaleks May 7, 2024
4cc4e43
remove video autoplay from lists
isstuev May 7, 2024
cdfd9cf
add more checks!
maxaleks May 7, 2024
8cc2010
name and email fields
tom2drum May 7, 2024
c3a3216
add tests for action button
maxaleks May 7, 2024
77766fa
refactor TokenInstanceDetails test
maxaleks May 7, 2024
adee51e
add more tests
maxaleks May 7, 2024
4d0d415
addresses field
tom2drum May 7, 2024
bb6af2d
description field
tom2drum May 7, 2024
76380a6
add tests for AppActionButton
maxaleks May 7, 2024
7f6373d
change bg color and update screenshots
maxaleks May 7, 2024
b9ea29b
refactor addresses
tom2drum May 8, 2024
de1427a
fix internal txs sorting
isstuev May 8, 2024
cc97093
Merge pull request #1895 from blockscout/fe-1872
isstuev May 8, 2024
efbff6e
tag name, url and description
tom2drum May 8, 2024
a4ba2e3
add isEnabled param for useAppActionData
maxaleks May 8, 2024
42845ae
Merge pull request #1897 from blockscout/fe-1890
isstuev May 8, 2024
a226314
tag type, bg and text color fields
tom2drum May 8, 2024
26ef668
color preview
tom2drum May 8, 2024
a33a8d5
tag preview
tom2drum May 8, 2024
36b4be0
add icon to tag type control
tom2drum May 9, 2024
fcb82bc
fix removing ad banners
isstuev May 9, 2024
cd32831
change color previews only if hex is correct
tom2drum May 9, 2024
6ff33e9
company name and website fields
tom2drum May 9, 2024
e620070
Merge pull request #1883 from blockscout/action-button
maxaleks May 9, 2024
4b906f0
Merge pull request #1902 from blockscout/no-ad-fix-2
tom2drum May 9, 2024
5909d48
reCaptcha and disabled state bg color fix
tom2drum May 9, 2024
ff311e5
refactor reCaptcha field
tom2drum May 9, 2024
f8d8e68
result screen: company and requester info
tom2drum May 9, 2024
e3ec6ff
add lightning label
maxaleks May 9, 2024
d44c84a
full success result screen
tom2drum May 9, 2024
0499c29
group submit result data
tom2drum May 10, 2024
f051029
fix typo
maxaleks May 10, 2024
11b723f
[skip ci] workflow for copying labels to pr
tom2drum May 10, 2024
0c77814
[skip ci] fix copy labels workflow
tom2drum May 10, 2024
4da9af0
[skip ci] add workflow for release notes
tom2drum May 10, 2024
7f74276
[skip ci] disable upload source map workflow
tom2drum May 10, 2024
8f8a54b
display mixed submit result
tom2drum May 13, 2024
a0b0cd7
add link to start over button
tom2drum May 13, 2024
ec07e2c
fix styles and add tests
maxaleks May 13, 2024
6720dbf
add env to goerli config
maxaleks May 13, 2024
c9b891a
pass form data to API and display result
tom2drum May 13, 2024
1f0d8b8
add "start over" button for all form result
tom2drum May 13, 2024
7ac64c7
fix link to form from address page
tom2drum May 13, 2024
a5b0110
pre-fill form with user data
tom2drum May 13, 2024
a1d394c
tests
tom2drum May 13, 2024
8b9a819
add env to eth sepolia
maxaleks May 14, 2024
ef8a244
Update .env.eth_sepolia
maxaleks May 14, 2024
0b60ada
add CSP for metadata service
tom2drum May 15, 2024
4925c11
design updates
tom2drum May 15, 2024
b9508d7
fix converter
tom2drum May 15, 2024
1ee7260
[skp ci] fix copy issues workflow
tom2drum May 15, 2024
bcbde75
Bump undici from 5.26.3 to 5.28.4
dependabot[bot] May 15, 2024
7a349a2
Merge pull request #1916 from blockscout/dependabot/npm_and_yarn/undi…
tom2drum May 15, 2024
a9c9032
Bump follow-redirects from 1.15.2 to 1.15.6
dependabot[bot] May 15, 2024
c218caa
Merge pull request #1917 from blockscout/dependabot/npm_and_yarn/foll…
tom2drum May 15, 2024
8796abb
Merge pull request #1915 from blockscout/release/v1_30_0
tom2drum May 15, 2024
5b9b78c
create DeFi dropdown
maxaleks May 15, 2024
abf8a44
Update styles of form inputs (#1914)
tom2drum May 15, 2024
15539cc
Merge branch 'main' of github.com:blockscout/frontend into tom2drum/i…
tom2drum May 15, 2024
51c99be
remove unnecessary styles
tom2drum May 15, 2024
163ee43
add frame-ancestors rule to csp
maxaleks May 16, 2024
0eca4f3
fix image size
maxaleks May 16, 2024
85c9417
update styles
maxaleks May 16, 2024
ccb1d22
design fixes
tom2drum May 16, 2024
14de292
keep hash when updating query
maxaleks May 16, 2024
5815251
pass custom params and hash to iframe
maxaleks May 16, 2024
814b833
add # before tag hex
tom2drum May 16, 2024
5610292
change description
tom2drum May 16, 2024
bd7efd2
update tests
tom2drum May 16, 2024
3d486eb
Merge pull request #1922 from blockscout/hf-content-security-policy
tom2drum May 16, 2024
67771c3
add tests
maxaleks May 16, 2024
c1de671
update envs schema
maxaleks May 16, 2024
52b25e6
update screenshots
tom2drum May 16, 2024
79da6ab
[skip ci] fix dev script
tom2drum May 16, 2024
26b2a8d
bump version of web3modal to v4.2.1
tom2drum May 17, 2024
ddb2a4a
Merge pull request #1936 from blockscout/tom2drum/up-web3modal
tom2drum May 17, 2024
1a26889
rebuild dropdown
maxaleks May 17, 2024
601dca6
Element paddings updates (#1929)
tom2drum May 20, 2024
6cdaafc
Move generated assets into separate folder inside the public folder (…
tom2drum May 20, 2024
a1670d0
remove unsupported features from search results
isstuev May 21, 2024
c77b692
rework defi dropdown env value
maxaleks May 21, 2024
e3ec83b
update tests
maxaleks May 21, 2024
e3b40c1
add custom path param and rework logic
maxaleks May 21, 2024
ce7eb0c
update icons, add get gas button
maxaleks May 22, 2024
7748b12
update screenshots
maxaleks May 22, 2024
9f6bd93
Merge branch 'main' into defi-dropdown
maxaleks May 22, 2024
971175e
update screenshots
maxaleks May 22, 2024
da335f6
change variable names
maxaleks May 22, 2024
36cf355
export class name as const
maxaleks May 22, 2024
38154f8
replace hook with function
maxaleks May 22, 2024
f390458
fix different heights of components with a chart
maxaleks May 22, 2024
7a9bb10
update screenshots
maxaleks May 22, 2024
c75db4b
More custom elements for public tags (#1939)
tom2drum May 23, 2024
e131784
Gas tracker improvements (#1941)
tom2drum May 23, 2024
a9af448
Loader state for SolidityScan button (#1945)
tom2drum May 23, 2024
5b8ad31
Merge pull request #1944 from blockscout/fe-1900
isstuev May 23, 2024
fd8317c
add native token image
ArminaAiren Mar 15, 2024
aff6f7c
unpade screenshots
isstuev May 17, 2024
e2705c7
[skip ci] improve typing of useApiQuery hook
tom2drum May 24, 2024
e3ff494
native token icon separate
isstuev May 23, 2024
6ec9887
Merge pull request #1947 from blockscout/fix-chart-height
tom2drum May 24, 2024
2a18290
Merge pull request #1932 from blockscout/fe-1381-main
tom2drum May 24, 2024
34ea426
token balance design update
isstuev May 17, 2024
7437d53
update screenshots
isstuev May 25, 2024
ee968da
Merge pull request #1934 from blockscout/fe-1933
isstuev May 25, 2024
1b977de
Playwright tests refactoring, pt.5 (#1952)
tom2drum May 25, 2024
a684812
add certified conract label
isstuev May 20, 2024
9c194a1
add certified icon to search
isstuev May 21, 2024
70ddce7
Multi chain balance button
isstuev May 14, 2024
eb61e49
fix schema validation for NEXT_PUBLIC_MULTICHAIN_PROVIDER_CONFIG
isstuev May 15, 2024
76ed554
change portfolio url logics
isstuev May 17, 2024
8a46825
change NEXT_PUBLIC_MULTICHAIN_PROVIDER_CONFIG
isstuev May 17, 2024
8f9971e
Merge pull request #1940 from blockscout/fe-1860
isstuev May 26, 2024
ae4c59a
review fixes
isstuev May 26, 2024
c0d92d8
review fixes
tom2drum May 27, 2024
bd5cb3a
more fixes
tom2drum May 27, 2024
4e2f5b7
User Operations: add switcher to call data (#1950)
tom2drum May 27, 2024
04f051f
Merge pull request #1912 from blockscout/fe-1802
isstuev May 27, 2024
365de50
Sidebar, latest txs and verified contracts improvements (#1951)
tom2drum May 27, 2024
fbc8fe0
Merge branch 'main' into menu-lightning-label
maxaleks May 27, 2024
b1b3ba0
Merge branch 'main' of github.com:blockscout/frontend into tom2drum/i…
tom2drum May 27, 2024
a746623
fix renaming
maxaleks May 27, 2024
ca3c93b
change text
maxaleks May 27, 2024
72e34cc
fix ts
tom2drum May 27, 2024
b33249f
reuse existing icon
maxaleks May 27, 2024
77cccb3
update screenshots
maxaleks May 27, 2024
eb1a0db
fix screenshot
tom2drum May 27, 2024
d49e8e5
change export order
maxaleks May 27, 2024
4f01b17
change type
maxaleks May 27, 2024
fbf6944
Merge pull request #1910 from blockscout/menu-lightning-label
tom2drum May 27, 2024
69d7149
Merge branch 'main' of github.com:blockscout/frontend into tom2drum/i…
tom2drum May 27, 2024
86e33ca
Merge pull request #1919 from blockscout/tom2drum/issue-1826
tom2drum May 27, 2024
6dd5af6
fix text flickering
maxaleks May 27, 2024
46171bf
remove redundant code
maxaleks May 27, 2024
b49e2dc
dropdown item refactoring
maxaleks May 27, 2024
ce259c4
update screenshots
maxaleks May 27, 2024
555748c
OP Fault Proofs support
isstuev May 27, 2024
b5757e4
Details page: fix line height for rows (#1949)
tom2drum May 28, 2024
7ea03ef
move app url logic to separate file
maxaleks May 28, 2024
44eabda
add tests
maxaleks May 28, 2024
f8621e3
Merge branch 'main' into defi-dropdown
maxaleks May 28, 2024
65b91b4
fix after-merge issues
maxaleks May 28, 2024
3d40a9d
upd
isstuev May 28, 2024
9aac89f
update style
maxaleks May 28, 2024
a000b3d
rework tests
maxaleks May 28, 2024
76e90dd
Add possibility to change ERC to something else
isstuev May 28, 2024
6c2eaac
change export holders text
isstuev May 28, 2024
d8378ed
Merge pull request #1958 from blockscout/fe-1839
isstuev May 28, 2024
3230bc9
Merge pull request #1962 from blockscout/fe-1954
isstuev May 28, 2024
b127f76
remove custom active style
maxaleks May 29, 2024
988f700
Merge branch 'main' into defi-dropdown
maxaleks May 29, 2024
89be9fd
Merge pull request #1925 from blockscout/defi-dropdown
maxaleks May 29, 2024
8634bc5
Merge pull request #1961 from blockscout/fe-1955
isstuev May 29, 2024
ae20ab5
Add support for Diamond proxy standard (#1963)
tom2drum May 29, 2024
e45a58c
Token Instance Page: move critical requests to the page root (#1959)
tom2drum May 29, 2024
2e9728e
SEO: add canonicals and change meta titles (#1960)
tom2drum May 29, 2024
e4ef145
error color, token balance border radius and gas tooltop fixes
tom2drum May 30, 2024
af0c538
fix padding for page tabs
tom2drum May 30, 2024
a4f03b3
update screenshots
tom2drum May 30, 2024
12f0d9c
Merge pull request #1976 from blockscout/release/v1_31_0-fixes
isstuev May 31, 2024
0b59390
Adblock detect improvement
isstuev May 31, 2024
694b7c9
fix padding
isstuev May 31, 2024
7c60021
token balance fix
isstuev May 31, 2024
5c43ff2
Merge pull request #1983 from blockscout/token-balance-fix
isstuev May 31, 2024
5ea7590
Merge pull request #1984 from blockscout/fe-1982
isstuev May 31, 2024
4f89933
fix homepage chart margin
isstuev May 31, 2024
4ea465e
fix optimization runs condition
isstuev Jun 2, 2024
87ad018
Merge pull request #1981 from blockscout/fe-1980
isstuev Jun 2, 2024
6b762e9
Merge pull request #1985 from blockscout/fe-1973
isstuev Jun 2, 2024
981f97f
Merge pull request #1986 from blockscout/optimization-runs-fix
isstuev Jun 2, 2024
3061166
fix padding, switch executed and inner call data and fix scroll overlay
tom2drum Jun 3, 2024
a128107
Merge remote-tracking branch 'upstream/main'
marc-aurele-besner Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const RESTRICTED_MODULES = {
{ name: '@chakra-ui/icons', message: 'Using @chakra-ui/icons is prohibited. Please use regular svg-icon instead (see examples in "icons/" folder)' },
{ name: '@metamask/providers', message: 'Please lazy-load @metamask/providers or use useProvider hook instead' },
{ name: '@metamask/post-message-stream', message: 'Please lazy-load @metamask/post-message-stream or use useProvider hook instead' },
{ name: 'playwright/TestApp', message: 'Please use render() fixture from test() function of playwright/lib module' },
],
patterns: [
'icons/*',
Expand Down
21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
changelog:
categories:
- title: 🚀 New Features
labels:
- client feature
- feature
- title: 🐛 Bug Fixes
labels:
- bug
- title: ⚡ Performance Improvements
labels:
- performance
- title: 📦 Dependencies Updates
labels:
- dependencies
- title: 🚨 Changes in ENV variables
labels:
- ENVs
- title: ✨ Other Changes
labels:
- "*"
116 changes: 116 additions & 0 deletions .github/workflows/copy-issues-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Copy issues labels to pull request

on:
workflow_dispatch:
inputs:
pr_number:
description: Pull request number
required: true
type: string
issues:
description: JSON encoded list of issue ids
required: true
type: string
workflow_call:
inputs:
pr_number:
description: Pull request number
required: true
type: string
issues:
description: JSON encoded list of issue ids
required: true
type: string

jobs:
run:
name: Run
runs-on: ubuntu-latest
steps:
- name: Find unique labels
id: find_unique_labels
uses: actions/github-script@v7
env:
ISSUES: ${{ inputs.issues }}
with:
script: |
const issues = JSON.parse(process.env.ISSUES);

const WHITE_LISTED_LABELS = [
'client feature',
'feature',

'bug',

'dependencies',
'performance',

'chore',
'enhancement',
'refactoring',
'tech',
'ENVs',
]

const labels = await Promise.all(issues.map(getIssueLabels));
const uniqueLabels = uniqueStringArray(labels.flat().filter((label) => WHITE_LISTED_LABELS.includes(label)));

if (uniqueLabels.length === 0) {
core.info('No labels found.\n');
return [];
}

core.info(`Found following labels: ${ uniqueLabels.join(', ') }.\n`);
return uniqueLabels;

async function getIssueLabels(issue) {
core.info(`Obtaining labels list for the issue #${ issue }...`);

try {
const response = await github.request('GET /repos/{owner}/{repo}/issues/{issue_number}/labels', {
owner: 'blockscout',
repo: 'frontend',
issue_number: issue,
});
return response.data.map(({ name }) => name);
} catch (error) {
core.error(`Failed to obtain labels for the issue #${ issue }: ${ error.message }`);
return [];
}
}

function uniqueStringArray(array) {
return Array.from(new Set(array));
}

- name: Update pull request labels
id: update_pr_labels
uses: actions/github-script@v7
env:
LABELS: ${{ steps.find_unique_labels.outputs.result }}
PR_NUMBER: ${{ inputs.pr_number }}
with:
script: |
const labels = JSON.parse(process.env.LABELS);
const prNumber = Number(process.env.PR_NUMBER);

if (labels.length === 0) {
core.info('Nothing to update.\n');
return;
}

for (const label of labels) {
await addLabelToPr(prNumber, label);
}
core.info('Done.\n');

async function addLabelToPr(prNumber, label) {
console.log(`Adding label to the pull request #${ prNumber }...`);

return await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/labels', {
owner: 'blockscout',
repo: 'frontend',
issue_number: prNumber,
labels: [ label ],
});
}
10 changes: 10 additions & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ on:
push:
branches:
- main
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '.husky/**'
- '.vscode/**'
- 'docs/**'
- 'jest/**'
- 'mocks/**'
- 'playwright/**'
- 'stubs/**'
- 'tools/**'
workflow_dispatch:

concurrency:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ jobs:
label_description: Tasks in pre-release right now
secrets: inherit

# Temporary disable this step because it is broken
# There is an issue with building web3modal deps
upload_source_maps:
name: Upload source maps to Sentry
if: false
uses: './.github/workflows/upload-source-maps.yml'
secrets: inherit
20 changes: 15 additions & 5 deletions .github/workflows/project-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
issues: "[${{ github.event.issue.number }}]"
secrets: inherit

review_requested_issues:
pr_linked_issues:
name: Get issues linked to PR
runs-on: ubuntu-latest
if: ${{ github.event.pull_request && github.event.action == 'review_requested' }}
Expand Down Expand Up @@ -76,14 +76,24 @@ jobs:

return issues;

review_requested_tasks:
issues_in_review:
name: Update status for issues in review
needs: [ review_requested_issues ]
if: ${{ needs.review_requested_issues.outputs.issues }}
needs: [ pr_linked_issues ]
if: ${{ needs.pr_linked_issues.outputs.issues }}
uses: './.github/workflows/update-project-cards.yml'
secrets: inherit
with:
project_name: ${{ vars.PROJECT_NAME }}
field_name: Status
field_value: Review
issues: ${{ needs.review_requested_issues.outputs.issues }}
issues: ${{ needs.pr_linked_issues.outputs.issues }}

copy_labels:
name: Copy issues labels to pull request
needs: [ pr_linked_issues ]
if: ${{ needs.pr_linked_issues.outputs.issues }}
uses: './.github/workflows/copy-issues-labels.yml'
secrets: inherit
with:
pr_number: ${{ github.event.pull_request.number }}
issues: ${{ needs.pr_linked_issues.outputs.issues }}
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ jobs:
with:
platforms: linux/amd64,linux/arm64/v8

# Temporary disable this step because it is broken
# There is an issue with building web3modal deps
upload_source_maps:
name: Upload source maps to Sentry
if: false
needs: publish_image
uses: './.github/workflows/upload-source-maps.yml'
secrets: inherit
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# next.js
/.next/
/out/
/public/assets/
/public/envs.js
/public/assets/envs.js
/public/assets/configs
/public/icons/sprite.svg
/public/icons/README.md
/analyze
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ RUN yarn --frozen-lockfile
FROM node:20.11.0-alpine AS builder
RUN apk add --no-cache --upgrade libc6-compat bash

# pass commit sha and git tag to the app image
# pass build args to env variables
ARG GIT_COMMIT_SHA
ENV NEXT_PUBLIC_GIT_COMMIT_SHA=$GIT_COMMIT_SHA
ARG GIT_TAG
ENV NEXT_PUBLIC_GIT_TAG=$GIT_TAG
ARG NEXT_OPEN_TELEMETRY_ENABLED
ENV NEXT_OPEN_TELEMETRY_ENABLED=$NEXT_OPEN_TELEMETRY_ENABLED

ENV NODE_ENV production

Expand All @@ -58,8 +60,8 @@ RUN ./collect_envs.sh ./docs/ENVS.md
# ENV NEXT_TELEMETRY_DISABLED 1

# Build app for production
RUN yarn build
RUN yarn svg:build-sprite
RUN yarn build


### FEATURE REPORTER
Expand Down
1 change: 1 addition & 0 deletions configs/app/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const chain = Object.freeze({
secondaryCoin: {
symbol: getEnvValue('NEXT_PUBLIC_NETWORK_SECONDARY_COIN_SYMBOL'),
},
tokenStandard: getEnvValue('NEXT_PUBLIC_NETWORK_TOKEN_STANDARD_NAME') || 'ERC',
rpcUrl: getEnvValue('NEXT_PUBLIC_NETWORK_RPC_URL'),
isTestnet: getEnvValue('NEXT_PUBLIC_IS_TESTNET') === 'true',
verificationType: getEnvValue('NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE') || 'mining',
Expand Down
21 changes: 21 additions & 0 deletions configs/app/features/deFiDropdown.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Feature } from './types';
import type { DeFiDropdownItem } from 'types/client/deFiDropdown';

import { getEnvValue, parseEnvJson } from '../utils';

const items = parseEnvJson<Array<DeFiDropdownItem>>(getEnvValue('NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS')) || [];

const title = 'DeFi dropdown';

const config: Feature<{ items: Array<DeFiDropdownItem> }> = items.length > 0 ?
Object.freeze({
title,
isEnabled: true,
items,
}) :
Object.freeze({
title,
isEnabled: false,
});

export default config;
22 changes: 22 additions & 0 deletions configs/app/features/faultProofSystem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Feature } from './types';

import { getEnvValue } from '../utils';
import rollup from './rollup';

const title = 'Fault proof system';

const config: Feature<{ isEnabled: true }> = (() => {
if (rollup.isEnabled && rollup.type === 'optimistic' && getEnvValue('NEXT_PUBLIC_FAULT_PROOF_ENABLED') === 'true') {
return Object.freeze({
title,
isEnabled: true,
});
}

return Object.freeze({
title,
isEnabled: false,
});
})();

export default config;
5 changes: 4 additions & 1 deletion configs/app/features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ export { default as bridgedTokens } from './bridgedTokens';
export { default as blockchainInteraction } from './blockchainInteraction';
export { default as csvExport } from './csvExport';
export { default as dataAvailability } from './dataAvailability';
export { default as deFiDropdown } from './deFiDropdown';
export { default as faultProofSystem } from './faultProofSystem';
export { default as gasTracker } from './gasTracker';
export { default as googleAnalytics } from './googleAnalytics';
export { default as graphqlApiDocs } from './graphqlApiDocs';
export { default as growthBook } from './growthBook';
export { default as marketplace } from './marketplace';
export { default as metasuites } from './metasuites';
export { default as mixpanel } from './mixpanel';
export { default as multichainButton } from './multichainButton';
export { default as nameService } from './nameService';
export { default as publicTagsSubmission } from './publicTagsSubmission';
export { default as restApiDocs } from './restApiDocs';
export { default as rollup } from './rollup';
export { default as safe } from './safe';
export { default as sentry } from './sentry';
export { default as sol2uml } from './sol2uml';
export { default as stats } from './stats';
export { default as suave } from './suave';
export { default as swapButton } from './swapButton';
export { default as txInterpretation } from './txInterpretation';
export { default as userOps } from './userOps';
export { default as validators } from './validators';
Expand Down
29 changes: 29 additions & 0 deletions configs/app/features/multichainButton.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Feature } from './types';
import type { MultichainProviderConfig } from 'types/client/multichainProviderConfig';

import { getEnvValue, parseEnvJson } from '../utils';
import marketplace from './marketplace';

const value = parseEnvJson<MultichainProviderConfig>(getEnvValue('NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG'));

const title = 'Multichain balance';

const config: Feature<{name: string; logoUrl?: string; urlTemplate: string; dappId?: string }> = (() => {
if (value) {
return Object.freeze({
title,
isEnabled: true,
name: value.name,
logoUrl: value.logo,
urlTemplate: value.url_template,
dappId: marketplace.isEnabled ? value.dapp_id : undefined,
});
}

return Object.freeze({
title,
isEnabled: false,
});
})();

export default config;
Loading
Loading