mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
migrate to eslint 9 and its flat config
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
node_modules
|
||||
node_modules_linux
|
||||
|
||||
playwright/envs.js
|
||||
deploy/tools/envs-validator/index.js
|
||||
deploy/tools/favicon-generator/index.js
|
||||
deploy/tools/feature-reporter/build/**
|
||||
deploy/tools/feature-reporter/index.js
|
||||
public/**
|
||||
-341
@@ -1,341 +0,0 @@
|
||||
const RESTRICTED_MODULES = {
|
||||
paths: [
|
||||
{ name: 'dayjs', message: 'Please use lib/date/dayjs.ts instead of directly importing dayjs' },
|
||||
{ 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' },
|
||||
{
|
||||
name: '@chakra-ui/react',
|
||||
importNames: [ 'Popover', 'Menu', 'PinInput', 'useToast' ],
|
||||
message: 'Please use corresponding component or hook from ui/shared/chakra component instead',
|
||||
},
|
||||
{
|
||||
name: 'lodash',
|
||||
message: 'Please use `import [package] from \'lodash/[package]\'` instead.',
|
||||
},
|
||||
],
|
||||
patterns: [
|
||||
'icons/*',
|
||||
'!lodash/*',
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
'extends': [
|
||||
'next/core-web-vitals',
|
||||
'eslint:recommended',
|
||||
'plugin:react/recommended',
|
||||
'plugin:regexp/recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:jest/recommended',
|
||||
'plugin:playwright/playwright-test',
|
||||
'plugin:@tanstack/eslint-plugin-query/recommended',
|
||||
],
|
||||
plugins: [
|
||||
'es5',
|
||||
'react',
|
||||
'regexp',
|
||||
'@typescript-eslint',
|
||||
'react-hooks',
|
||||
'jsx-a11y',
|
||||
'eslint-plugin-import-helpers',
|
||||
'jest',
|
||||
'eslint-plugin-no-cyrillic-string',
|
||||
'@tanstack/query',
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
pragma: 'React',
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/array-type': [ 'error', {
|
||||
'default': 'generic',
|
||||
readonly: 'generic',
|
||||
} ],
|
||||
'@typescript-eslint/brace-style': [ 'error', '1tbs' ],
|
||||
'@typescript-eslint/consistent-type-imports': [ 'error' ],
|
||||
'@typescript-eslint/indent': [ 'error', 2 ],
|
||||
'@typescript-eslint/member-delimiter-style': [ 'error' ],
|
||||
'@typescript-eslint/naming-convention': [ 'error',
|
||||
{
|
||||
selector: 'default',
|
||||
format: [ 'camelCase' ],
|
||||
leadingUnderscore: 'allow',
|
||||
trailingUnderscore: 'forbid',
|
||||
},
|
||||
{
|
||||
selector: 'class',
|
||||
format: [ 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'enum',
|
||||
format: [ 'PascalCase', 'UPPER_CASE' ],
|
||||
},
|
||||
{
|
||||
selector: 'enumMember',
|
||||
format: [ 'camelCase', 'PascalCase', 'UPPER_CASE' ],
|
||||
},
|
||||
{
|
||||
selector: 'function',
|
||||
format: [ 'camelCase', 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'interface',
|
||||
format: [ 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'method',
|
||||
format: [ 'camelCase', 'snake_case', 'UPPER_CASE' ],
|
||||
leadingUnderscore: 'allow',
|
||||
},
|
||||
{
|
||||
selector: 'parameter',
|
||||
format: [ 'camelCase', 'PascalCase' ],
|
||||
leadingUnderscore: 'allow',
|
||||
},
|
||||
{
|
||||
selector: 'property',
|
||||
format: null,
|
||||
},
|
||||
{
|
||||
selector: 'typeAlias',
|
||||
format: [ 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'typeParameter',
|
||||
format: [ 'PascalCase', 'UPPER_CASE' ],
|
||||
},
|
||||
{
|
||||
selector: 'variable',
|
||||
format: [ 'camelCase', 'PascalCase', 'UPPER_CASE' ],
|
||||
leadingUnderscore: 'allow',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-duplicate-imports': [ 'error' ],
|
||||
'@typescript-eslint/no-empty-function': [ 'off' ],
|
||||
'@typescript-eslint/no-unused-vars': [ 'error', { ignoreRestSiblings: true } ],
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
'@typescript-eslint/no-useless-constructor': [ 'error' ],
|
||||
'@typescript-eslint/type-annotation-spacing': 'error',
|
||||
'@typescript-eslint/no-explicit-any': [ 'error', { ignoreRestArgs: true } ],
|
||||
|
||||
// disabled in favor of @typescript-eslint
|
||||
'brace-style': 'off',
|
||||
camelcase: 'off',
|
||||
indent: 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'no-use-before-define': 'off',
|
||||
'no-useless-constructor': 'off',
|
||||
|
||||
'array-bracket-spacing': [ 'error', 'always' ],
|
||||
'arrow-spacing': [ 'error', { before: true, after: true } ],
|
||||
'comma-dangle': [ 'error', 'always-multiline' ],
|
||||
'comma-spacing': [ 'error' ],
|
||||
'comma-style': [ 'error', 'last' ],
|
||||
curly: [ 'error', 'all' ],
|
||||
'eol-last': 'error',
|
||||
eqeqeq: [ 'error', 'allow-null' ],
|
||||
'id-match': [ 'error', '^[\\w$]+$' ],
|
||||
'jsx-quotes': [ 'error', 'prefer-double' ],
|
||||
'key-spacing': [ 'error', {
|
||||
beforeColon: false,
|
||||
afterColon: true,
|
||||
} ],
|
||||
'keyword-spacing': 'error',
|
||||
'linebreak-style': [ 'error', 'unix' ],
|
||||
'lines-around-comment': [ 'error', {
|
||||
beforeBlockComment: true,
|
||||
allowBlockStart: true,
|
||||
} ],
|
||||
'max-len': [ 'error', 160, 4 ],
|
||||
'no-console': 'error',
|
||||
'no-empty': [ 'error', { allowEmptyCatch: true } ],
|
||||
'no-implicit-coercion': [ 'error', {
|
||||
number: true,
|
||||
'boolean': true,
|
||||
string: true,
|
||||
} ],
|
||||
'no-mixed-operators': [ 'error', {
|
||||
groups: [
|
||||
[ '&&', '||' ],
|
||||
],
|
||||
} ],
|
||||
'no-mixed-spaces-and-tabs': 'error',
|
||||
'no-multiple-empty-lines': [ 'error', {
|
||||
max: 1,
|
||||
maxEOF: 0,
|
||||
maxBOF: 0,
|
||||
} ],
|
||||
'no-multi-spaces': 'error',
|
||||
'no-multi-str': 'error',
|
||||
'no-nested-ternary': 'error',
|
||||
'no-trailing-spaces': 'error',
|
||||
'no-spaced-func': 'error',
|
||||
'no-with': 'error',
|
||||
'object-curly-spacing': [ 'error', 'always' ],
|
||||
'object-shorthand': 'off',
|
||||
'one-var': [ 'error', 'never' ],
|
||||
'operator-linebreak': [ 'error', 'after' ],
|
||||
'prefer-const': 'error',
|
||||
'quote-props': [ 'error', 'as-needed', {
|
||||
keywords: true,
|
||||
numbers: true,
|
||||
} ],
|
||||
quotes: [ 'error', 'single', {
|
||||
allowTemplateLiterals: true,
|
||||
} ],
|
||||
'space-before-function-paren': [ 'error', 'never' ],
|
||||
'space-before-blocks': [ 'error', 'always' ],
|
||||
'space-in-parens': [ 'error', 'never' ],
|
||||
'space-infix-ops': 'error',
|
||||
'space-unary-ops': 'off',
|
||||
'template-curly-spacing': [ 'error', 'always' ],
|
||||
'wrap-iife': [ 'error', 'inside' ],
|
||||
semi: [ 'error', 'always' ],
|
||||
|
||||
'import-helpers/order-imports': [
|
||||
'error',
|
||||
{
|
||||
newlinesBetween: 'always',
|
||||
groups: [
|
||||
'module',
|
||||
'/types/',
|
||||
[
|
||||
'/^nextjs/',
|
||||
],
|
||||
[
|
||||
'/^configs/',
|
||||
'/^data/',
|
||||
'/^deploy/',
|
||||
'/^icons/',
|
||||
'/^jest/',
|
||||
'/^lib/',
|
||||
'/^mocks/',
|
||||
'/^pages/',
|
||||
'/^playwright/',
|
||||
'/^stubs/',
|
||||
'/^theme/',
|
||||
'/^ui/',
|
||||
],
|
||||
[ 'parent', 'sibling', 'index' ],
|
||||
],
|
||||
alphabetize: { order: 'asc', ignoreCase: true },
|
||||
},
|
||||
],
|
||||
|
||||
'no-restricted-imports': [ 'error', RESTRICTED_MODULES ],
|
||||
'no-restricted-properties': [ 2, {
|
||||
object: 'process',
|
||||
property: 'env',
|
||||
// FIXME: restrict the rule only NEXT_PUBLIC variables
|
||||
message: 'Please use configs/app/index.ts to import any NEXT_PUBLIC environment variables. For other properties please disable this rule for a while.',
|
||||
} ],
|
||||
|
||||
'react/jsx-key': 'error',
|
||||
'react/jsx-no-bind': [ 'error', {
|
||||
ignoreRefs: true,
|
||||
} ],
|
||||
'react/jsx-curly-brace-presence': [ 'error', {
|
||||
props: 'never',
|
||||
children: 'never',
|
||||
} ],
|
||||
'react/jsx-curly-spacing': [ 'error', {
|
||||
when: 'always',
|
||||
children: true,
|
||||
spacing: {
|
||||
objectLiterals: 'never',
|
||||
},
|
||||
} ],
|
||||
'react/jsx-equals-spacing': [ 'error', 'never' ],
|
||||
'react/jsx-fragments': [ 'error', 'syntax' ],
|
||||
'react/jsx-no-duplicate-props': 'error',
|
||||
'react/jsx-no-target-blank': 'off',
|
||||
'react/jsx-no-useless-fragment': 'error',
|
||||
'react/jsx-tag-spacing': [ 'error', {
|
||||
afterOpening: 'never',
|
||||
beforeSelfClosing: 'never',
|
||||
closingSlash: 'never',
|
||||
} ],
|
||||
'react/jsx-wrap-multilines': [ 'error', {
|
||||
declaration: 'parens-new-line',
|
||||
assignment: 'parens-new-line',
|
||||
'return': 'parens-new-line',
|
||||
arrow: 'parens-new-line',
|
||||
condition: 'parens-new-line',
|
||||
logical: 'parens-new-line',
|
||||
prop: 'parens-new-line',
|
||||
} ],
|
||||
'react/no-access-state-in-setstate': 'error',
|
||||
'react/no-deprecated': 'error',
|
||||
'react/no-direct-mutation-state': 'error',
|
||||
'react/no-find-dom-node': 'off',
|
||||
'react/no-redundant-should-component-update': 'error',
|
||||
'react/no-render-return-value': 'error',
|
||||
'react/no-string-refs': 'off',
|
||||
'react/no-unknown-property': 'error',
|
||||
'react/no-unused-state': 'error',
|
||||
'react/require-optimization': [ 'error' ],
|
||||
'react/void-dom-elements-no-children': 'error',
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'error',
|
||||
|
||||
'regexp/confusing-quantifier': 'error',
|
||||
'regexp/control-character-escape': 'error',
|
||||
'regexp/negation': 'error',
|
||||
'regexp/no-dupe-disjunctions': 'error',
|
||||
'regexp/no-empty-alternative': 'error',
|
||||
'regexp/no-empty-capturing-group': 'error',
|
||||
'regexp/no-lazy-ends': 'error',
|
||||
'regexp/no-obscure-range': [ 'error', {
|
||||
allowed: [ 'alphanumeric' ],
|
||||
} ],
|
||||
'regexp/no-optional-assertion': 'error',
|
||||
'regexp/no-unused-capturing-group': [ 'error', {
|
||||
fixable: true,
|
||||
} ],
|
||||
'regexp/no-useless-character-class': 'error',
|
||||
'regexp/no-useless-dollar-replacements': 'error',
|
||||
|
||||
'no-cyrillic-string/no-cyrillic-string': 'error',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: [ '*.js', '*.jsx' ],
|
||||
rules: {
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'*.config.ts',
|
||||
'*.config.js',
|
||||
'playwright/**',
|
||||
'deploy/tools/**',
|
||||
'middleware.ts',
|
||||
'nextjs/**',
|
||||
'instrumentation*.ts',
|
||||
],
|
||||
rules: {
|
||||
// for configs allow to consume env variables from process.env directly
|
||||
'no-restricted-properties': [ 0 ],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -34,7 +34,7 @@ type AdsBannerFeaturePayload = {
|
||||
mobile: AdButlerConfig;
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const config: Feature<AdsBannerFeaturePayload> = (() => {
|
||||
if (provider === 'adbutler') {
|
||||
|
||||
@@ -4,7 +4,7 @@ import services from '../services';
|
||||
|
||||
const title = 'Export data to CSV file';
|
||||
|
||||
const config: Feature<{ reCaptcha: { siteKey: string }}> = (() => {
|
||||
const config: Feature<{ reCaptcha: { siteKey: string } }> = (() => {
|
||||
if (services.reCaptchaV3.siteKey) {
|
||||
return Object.freeze({
|
||||
title,
|
||||
|
||||
@@ -21,7 +21,7 @@ const wallets = ((): Array<WalletType> | undefined => {
|
||||
|
||||
const title = 'Web3 wallet integration (add token or network to the wallet)';
|
||||
|
||||
const config: Feature<{ wallets: Array<WalletType>; addToken: { isDisabled: boolean }}> = (() => {
|
||||
const config: Feature<{ wallets: Array<WalletType>; addToken: { isDisabled: boolean } }> = (() => {
|
||||
if (wallets && wallets.length > 0) {
|
||||
return Object.freeze({
|
||||
title,
|
||||
|
||||
@@ -0,0 +1,445 @@
|
||||
import { includeIgnoreFile } from '@eslint/compat';
|
||||
import jsPlugin from '@eslint/js';
|
||||
import nextJsPlugin from '@next/eslint-plugin-next';
|
||||
import stylisticPlugin from '@stylistic/eslint-plugin';
|
||||
import reactQueryPlugin from '@tanstack/eslint-plugin-query';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import importHelpersPlugin from 'eslint-plugin-import-helpers';
|
||||
import jestPlugin from 'eslint-plugin-jest';
|
||||
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
|
||||
import noCyrillicStringPlugin from 'eslint-plugin-no-cyrillic-string';
|
||||
import playwrightPlugin from 'eslint-plugin-playwright';
|
||||
import reactPlugin from 'eslint-plugin-react';
|
||||
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
||||
import * as regexpPlugin from 'eslint-plugin-regexp';
|
||||
import globals from 'globals';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
const RESTRICTED_MODULES = {
|
||||
paths: [
|
||||
{ name: 'dayjs', message: 'Please use lib/date/dayjs.ts instead of directly importing dayjs' },
|
||||
{ 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' },
|
||||
{
|
||||
name: '@chakra-ui/react',
|
||||
importNames: [ 'Popover', 'Menu', 'PinInput', 'useToast' ],
|
||||
message: 'Please use corresponding component or hook from ui/shared/chakra component instead',
|
||||
},
|
||||
{
|
||||
name: 'lodash',
|
||||
message: 'Please use `import [package] from \'lodash/[package]\'` instead.',
|
||||
},
|
||||
],
|
||||
patterns: [
|
||||
'icons/*',
|
||||
'!lodash/*',
|
||||
],
|
||||
};
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const gitignorePath = path.resolve(__dirname, '.gitignore');
|
||||
|
||||
/** @type {import('eslint').Linter.Config[]} */
|
||||
export default tseslint.config(
|
||||
includeIgnoreFile(gitignorePath),
|
||||
|
||||
{ files: [ '**/*.{js,mjs,cjs,ts,jsx,tsx}', '**/*.pw.tsx' ] },
|
||||
|
||||
{ ignores: [
|
||||
'deploy/tools/',
|
||||
'public/',
|
||||
'theme/dist/',
|
||||
'.git/',
|
||||
'theme/webpack.config.js',
|
||||
'next.config.js',
|
||||
] },
|
||||
|
||||
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
|
||||
|
||||
{ settings: { react: { version: 'detect' } } },
|
||||
|
||||
jsPlugin.configs.recommended,
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'@typescript-eslint': tseslint.plugin,
|
||||
jest: jestPlugin,
|
||||
},
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
},
|
||||
globals: jestPlugin.environments.globals.globals,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/array-type': [ 'error', {
|
||||
'default': 'generic',
|
||||
readonly: 'generic',
|
||||
} ],
|
||||
'@typescript-eslint/consistent-type-imports': [ 'error' ],
|
||||
'@typescript-eslint/naming-convention': [ 'error',
|
||||
{
|
||||
selector: 'default',
|
||||
format: [ 'camelCase' ],
|
||||
leadingUnderscore: 'allow',
|
||||
trailingUnderscore: 'forbid',
|
||||
},
|
||||
{
|
||||
selector: 'import',
|
||||
leadingUnderscore: 'allow',
|
||||
format: [ 'camelCase', 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'class',
|
||||
format: [ 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'enum',
|
||||
format: [ 'PascalCase', 'UPPER_CASE' ],
|
||||
},
|
||||
{
|
||||
selector: 'enumMember',
|
||||
format: [ 'camelCase', 'PascalCase', 'UPPER_CASE' ],
|
||||
},
|
||||
{
|
||||
selector: 'function',
|
||||
format: [ 'camelCase', 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'interface',
|
||||
format: [ 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'method',
|
||||
format: [ 'camelCase', 'snake_case', 'UPPER_CASE' ],
|
||||
leadingUnderscore: 'allow',
|
||||
},
|
||||
{
|
||||
selector: 'parameter',
|
||||
format: [ 'camelCase', 'PascalCase' ],
|
||||
leadingUnderscore: 'allow',
|
||||
},
|
||||
{
|
||||
selector: 'property',
|
||||
format: null,
|
||||
},
|
||||
{
|
||||
selector: 'typeAlias',
|
||||
format: [ 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'typeLike',
|
||||
format: [ 'PascalCase' ],
|
||||
},
|
||||
{
|
||||
selector: 'typeParameter',
|
||||
format: [ 'PascalCase', 'UPPER_CASE' ],
|
||||
},
|
||||
{
|
||||
selector: 'variable',
|
||||
format: [ 'camelCase', 'PascalCase', 'UPPER_CASE' ],
|
||||
leadingUnderscore: 'allow',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-empty-function': [ 'off' ],
|
||||
'@typescript-eslint/no-unused-vars': [ 'error', { caughtErrors: 'none', ignoreRestSiblings: true } ],
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
'@typescript-eslint/no-useless-constructor': [ 'error' ],
|
||||
'@typescript-eslint/no-explicit-any': [ 'error', { ignoreRestArgs: true } ],
|
||||
'@typescript-eslint/no-unused-expressions': [ 'error', {
|
||||
allowShortCircuit: true,
|
||||
allowTernary: true,
|
||||
} ],
|
||||
},
|
||||
},
|
||||
{
|
||||
// disable type-aware linting on JS files
|
||||
files: [ '**/*.{js,mjs}' ],
|
||||
...tseslint.configs.disableTypeChecked,
|
||||
},
|
||||
|
||||
{
|
||||
plugins: {
|
||||
react: reactPlugin,
|
||||
},
|
||||
rules: {
|
||||
'react/jsx-key': 'error',
|
||||
'react/jsx-no-bind': [ 'error', {
|
||||
ignoreRefs: true,
|
||||
} ],
|
||||
'react/jsx-curly-brace-presence': [ 'error', {
|
||||
props: 'never',
|
||||
children: 'never',
|
||||
} ],
|
||||
'react/jsx-curly-spacing': [ 'error', {
|
||||
when: 'always',
|
||||
children: true,
|
||||
spacing: {
|
||||
objectLiterals: 'never',
|
||||
},
|
||||
} ],
|
||||
'react/jsx-equals-spacing': [ 'error', 'never' ],
|
||||
'react/jsx-fragments': [ 'error', 'syntax' ],
|
||||
'react/jsx-no-duplicate-props': 'error',
|
||||
'react/jsx-no-target-blank': 'off',
|
||||
'react/jsx-no-useless-fragment': 'error',
|
||||
'react/jsx-tag-spacing': [ 'error', {
|
||||
afterOpening: 'never',
|
||||
beforeSelfClosing: 'never',
|
||||
closingSlash: 'never',
|
||||
} ],
|
||||
'react/jsx-wrap-multilines': [ 'error', {
|
||||
declaration: 'parens-new-line',
|
||||
assignment: 'parens-new-line',
|
||||
'return': 'parens-new-line',
|
||||
arrow: 'parens-new-line',
|
||||
condition: 'parens-new-line',
|
||||
logical: 'parens-new-line',
|
||||
prop: 'parens-new-line',
|
||||
} ],
|
||||
'react/no-access-state-in-setstate': 'error',
|
||||
'react/no-deprecated': 'error',
|
||||
'react/no-direct-mutation-state': 'error',
|
||||
'react/no-find-dom-node': 'off',
|
||||
'react/no-redundant-should-component-update': 'error',
|
||||
'react/no-render-return-value': 'error',
|
||||
'react/no-string-refs': 'off',
|
||||
'react/no-unknown-property': 'error',
|
||||
'react/no-unused-state': 'error',
|
||||
'react/require-optimization': [ 'error' ],
|
||||
'react/void-dom-elements-no-children': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'@next/next': nextJsPlugin,
|
||||
},
|
||||
rules: {
|
||||
...nextJsPlugin.configs.recommended.rules,
|
||||
...nextJsPlugin.configs['core-web-vitals'].rules,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
plugins: { '@tanstack/query': reactQueryPlugin },
|
||||
rules: {
|
||||
'@tanstack/query/no-unstable-deps': 'off', // TODO @tom2drum turn on this rule
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
plugins: { playwright: playwrightPlugin },
|
||||
files: [ '**/*.pw.tsx' ],
|
||||
rules: {
|
||||
'playwright/valid-title': 'warn', // TODO @tom2drum turn on this rule
|
||||
'playwright/no-standalone-expect': 'off', // this rules does not work correctly with extended test functions
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
plugins: { 'react-hooks': reactHooksPlugin },
|
||||
ignores: [ '**/*.pw.tsx', 'playwright/**' ],
|
||||
rules: {
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
files: [ '**/*.test.{ts,js,jsx,tsx}' ],
|
||||
plugins: { jest: jestPlugin },
|
||||
languageOptions: {
|
||||
globals: jestPlugin.environments.globals.globals,
|
||||
},
|
||||
},
|
||||
|
||||
regexpPlugin.configs['flat/recommended'],
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'import': importPlugin,
|
||||
},
|
||||
rules: {
|
||||
'import/no-duplicates': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'import-helpers': importHelpersPlugin,
|
||||
},
|
||||
rules: {
|
||||
'import-helpers/order-imports': [
|
||||
'error',
|
||||
{
|
||||
newlinesBetween: 'always',
|
||||
groups: [
|
||||
'module',
|
||||
'/types/',
|
||||
[ '/^nextjs/' ],
|
||||
[
|
||||
'/^configs/',
|
||||
'/^data/',
|
||||
'/^deploy/',
|
||||
'/^icons/',
|
||||
'/^jest/',
|
||||
'/^lib/',
|
||||
'/^mocks/',
|
||||
'/^pages/',
|
||||
'/^playwright/',
|
||||
'/^stubs/',
|
||||
'/^theme/',
|
||||
'/^ui/',
|
||||
],
|
||||
[ 'parent', 'sibling', 'index' ],
|
||||
],
|
||||
alphabetize: { order: 'asc', ignoreCase: true },
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'no-cyrillic-string': noCyrillicStringPlugin,
|
||||
},
|
||||
rules: {
|
||||
'no-cyrillic-string/no-cyrillic-string': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'jsx-a11y': jsxA11yPlugin,
|
||||
},
|
||||
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
|
||||
},
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'@stylistic': stylisticPlugin,
|
||||
},
|
||||
rules: {
|
||||
// replacement for @typescript-eslint
|
||||
'@stylistic/indent': [ 'error', 2 ],
|
||||
'@stylistic/brace-style': [ 'error', '1tbs' ],
|
||||
'@stylistic/member-delimiter-style': [ 'error' ],
|
||||
'@stylistic/type-annotation-spacing': 'error',
|
||||
|
||||
// replacement for eslint
|
||||
'@stylistic/array-bracket-spacing': [ 'error', 'always' ],
|
||||
'@stylistic/arrow-spacing': [ 'error', { before: true, after: true } ],
|
||||
'@stylistic/comma-dangle': [ 'error', 'always-multiline' ],
|
||||
'@stylistic/comma-spacing': [ 'error' ],
|
||||
'@stylistic/comma-style': [ 'error', 'last' ],
|
||||
'@stylistic/curly-newline': [ 'error', { multiline: true, minElements: 1 } ],
|
||||
'@stylistic/eol-last': 'error',
|
||||
'@stylistic/jsx-quotes': [ 'error', 'prefer-double' ],
|
||||
'@stylistic/key-spacing': [ 'error', {
|
||||
beforeColon: false,
|
||||
afterColon: true,
|
||||
} ],
|
||||
'@stylistic/keyword-spacing': 'error',
|
||||
'@stylistic/linebreak-style': [ 'error', 'unix' ],
|
||||
'@stylistic/lines-around-comment': [ 'error', {
|
||||
beforeBlockComment: true,
|
||||
allowBlockStart: true,
|
||||
} ],
|
||||
'@stylistic/no-mixed-operators': [ 'error', {
|
||||
groups: [
|
||||
[ '&&', '||' ],
|
||||
],
|
||||
} ],
|
||||
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
||||
'@stylistic/no-multiple-empty-lines': [ 'error', {
|
||||
max: 1,
|
||||
maxEOF: 0,
|
||||
maxBOF: 0,
|
||||
} ],
|
||||
'@stylistic/no-multi-spaces': 'error',
|
||||
'@stylistic/no-trailing-spaces': 'error',
|
||||
'@stylistic/object-curly-spacing': [ 'error', 'always' ],
|
||||
'@stylistic/operator-linebreak': [ 'error', 'after' ],
|
||||
'@stylistic/quote-props': [ 'error', 'as-needed', {
|
||||
keywords: true,
|
||||
numbers: true,
|
||||
} ],
|
||||
'@stylistic/quotes': [ 'error', 'single', {
|
||||
allowTemplateLiterals: true,
|
||||
} ],
|
||||
'@stylistic/semi': [ 'error', 'always' ],
|
||||
'@stylistic/space-before-function-paren': [ 'error', 'never' ],
|
||||
'@stylistic/space-before-blocks': [ 'error', 'always' ],
|
||||
'@stylistic/space-in-parens': [ 'error', 'never' ],
|
||||
'@stylistic/space-infix-ops': 'error',
|
||||
'@stylistic/space-unary-ops': 'off',
|
||||
'@stylistic/template-curly-spacing': [ 'error', 'always' ],
|
||||
'@stylistic/wrap-iife': [ 'error', 'inside' ],
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
rules: {
|
||||
// disabled in favor of @typescript-eslint and @stylistic
|
||||
'no-use-before-define': 'off',
|
||||
'no-useless-constructor': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'no-empty': [ 'error', { allowEmptyCatch: true } ],
|
||||
'no-unused-expressions': 'off',
|
||||
|
||||
// this is checked by typescript compiler
|
||||
'no-redeclare': 'off',
|
||||
|
||||
// rules customizations
|
||||
eqeqeq: [ 'error', 'allow-null' ],
|
||||
'id-match': [ 'error', '^[\\w$]+$' ],
|
||||
'max-len': [ 'error', 160, 4 ],
|
||||
'no-console': 'error',
|
||||
'no-implicit-coercion': [ 'error', {
|
||||
number: true,
|
||||
'boolean': true,
|
||||
string: true,
|
||||
} ],
|
||||
'no-nested-ternary': 'error',
|
||||
'no-multi-str': 'error',
|
||||
'no-spaced-func': 'error',
|
||||
'no-with': 'error',
|
||||
'object-shorthand': 'off',
|
||||
'one-var': [ 'error', 'never' ],
|
||||
'prefer-const': 'error',
|
||||
|
||||
// restricted imports and properties
|
||||
'no-restricted-imports': [ 'error', RESTRICTED_MODULES ],
|
||||
'no-restricted-properties': [ 2, {
|
||||
object: 'process',
|
||||
property: 'env',
|
||||
// FIXME: restrict the rule only NEXT_PUBLIC variables
|
||||
message: 'Please use configs/app/index.ts to import any NEXT_PUBLIC environment variables. For other properties please disable this rule for a while.',
|
||||
} ],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'pages/**',
|
||||
'nextjs/**',
|
||||
'playwright/**',
|
||||
'deploy/tools/**',
|
||||
'middleware.ts',
|
||||
'instrumentation*.ts',
|
||||
'*.config.ts',
|
||||
'*.config.js',
|
||||
],
|
||||
rules: {
|
||||
// for configs allow to consume env variables from process.env directly
|
||||
'no-restricted-properties': 'off',
|
||||
},
|
||||
},
|
||||
);
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@ type CPreferences = {
|
||||
zone: string;
|
||||
width: string;
|
||||
height: string;
|
||||
}
|
||||
};
|
||||
|
||||
declare global {
|
||||
export interface Window {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable max-len */
|
||||
import type { JestConfigWithTsJest } from 'ts-jest';
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ const PAGE_PROPS = {
|
||||
apiData: null,
|
||||
};
|
||||
|
||||
const TestApp = ({ children }: {children: React.ReactNode}) => {
|
||||
const TestApp = ({ children }: { children: React.ReactNode }) => {
|
||||
const [ queryClient ] = React.useState(() => new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
|
||||
+15
-15
@@ -1081,10 +1081,10 @@ export type ResourceName = keyof typeof RESOURCES;
|
||||
|
||||
type ResourcePathMap = {
|
||||
[K in ResourceName]: typeof RESOURCES[K]['path']
|
||||
}
|
||||
export type ResourcePath = ResourcePathMap[keyof ResourcePathMap]
|
||||
};
|
||||
export type ResourcePath = ResourcePathMap[keyof ResourcePathMap];
|
||||
|
||||
export type ResourceFiltersKey<R extends ResourceName> = typeof RESOURCES[R] extends {filterFields: Array<unknown>} ?
|
||||
export type ResourceFiltersKey<R extends ResourceName> = typeof RESOURCES[R] extends { filterFields: Array<unknown> } ?
|
||||
ArrayElement<typeof RESOURCES[R]['filterFields']> :
|
||||
never;
|
||||
|
||||
@@ -1105,7 +1105,7 @@ export interface ResourceError<T = unknown> {
|
||||
statusText: Response['statusText'];
|
||||
}
|
||||
|
||||
export type ResourceErrorAccount<T> = ResourceError<{ errors: T }>
|
||||
export type ResourceErrorAccount<T> = ResourceError<{ errors: T }>;
|
||||
|
||||
export type PaginatedResources = 'blocks' | 'block_txs' | 'block_election_rewards' |
|
||||
'txs_validated' | 'txs_pending' | 'txs_with_blobs' | 'txs_watchlist' | 'txs_execution_node' |
|
||||
@@ -1119,7 +1119,7 @@ export type PaginatedResources = 'blocks' | 'block_txs' | 'block_election_reward
|
||||
'verified_contracts' |
|
||||
'optimistic_l2_output_roots' | 'optimistic_l2_withdrawals' | 'optimistic_l2_txn_batches' | 'optimistic_l2_deposits' |
|
||||
'optimistic_l2_dispute_games' | 'optimistic_l2_txn_batch_txs' | 'optimistic_l2_txn_batch_blocks' |
|
||||
'mud_worlds'| 'address_mud_tables' | 'address_mud_records' |
|
||||
'mud_worlds' | 'address_mud_tables' | 'address_mud_records' |
|
||||
'shibarium_deposits' | 'shibarium_withdrawals' |
|
||||
'arbitrum_l2_messages' | 'arbitrum_l2_txn_batches' | 'arbitrum_l2_txn_batch_txs' | 'arbitrum_l2_txn_batch_blocks' |
|
||||
'zkevm_l2_deposits' | 'zkevm_l2_withdrawals' | 'zkevm_l2_txn_batches' | 'zkevm_l2_txn_batch_txs' |
|
||||
@@ -1131,7 +1131,7 @@ export type PaginatedResources = 'blocks' | 'block_txs' | 'block_election_reward
|
||||
|
||||
export type PaginatedResponse<Q extends PaginatedResources> = ResourcePayload<Q>;
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @stylistic/indent */
|
||||
// !!! IMPORTANT !!!
|
||||
// Don't add any new types here because TypeScript cannot handle it properly
|
||||
// use ResourcePayloadB instead
|
||||
@@ -1155,7 +1155,7 @@ Q extends 'homepage_txs_watchlist' ? Array<Transaction> :
|
||||
Q extends 'homepage_optimistic_deposits' ? Array<OptimisticL2DepositsItem> :
|
||||
Q extends 'homepage_arbitrum_deposits' ? ArbitrumLatestDepositsResponse :
|
||||
Q extends 'homepage_zkevm_l2_batches' ? { items: Array<ZkEvmL2TxnBatchesItem> } :
|
||||
Q extends 'homepage_arbitrum_l2_batches' ? { items: Array<ArbitrumL2TxnBatchesItem>} :
|
||||
Q extends 'homepage_arbitrum_l2_batches' ? { items: Array<ArbitrumL2TxnBatchesItem> } :
|
||||
Q extends 'homepage_indexing_status' ? IndexingStatus :
|
||||
Q extends 'homepage_zkevm_latest_batch' ? number :
|
||||
Q extends 'homepage_zksync_latest_batch' ? number :
|
||||
@@ -1237,9 +1237,9 @@ Q extends 'optimistic_l2_dispute_games_count' ? number :
|
||||
never;
|
||||
// !!! IMPORTANT !!!
|
||||
// See comment above
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
/* eslint-enable @stylistic/indent */
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @stylistic/indent */
|
||||
export type ResourcePayloadB<Q extends ResourceName> =
|
||||
Q extends 'config_backend_version' ? BackendVersionConfig :
|
||||
Q extends 'config_csv_export' ? CsvExportConfig :
|
||||
@@ -1285,7 +1285,7 @@ Q extends 'domain_protocols' ? bens.GetProtocolsResponse :
|
||||
Q extends 'user_ops' ? UserOpsResponse :
|
||||
Q extends 'user_op' ? UserOp :
|
||||
Q extends 'user_ops_account' ? UserOpsAccount :
|
||||
Q extends 'user_op_interpretation'? TxInterpretationResponse :
|
||||
Q extends 'user_op_interpretation' ? TxInterpretationResponse :
|
||||
Q extends 'noves_transaction' ? NovesResponseData :
|
||||
Q extends 'noves_address_history' ? NovesAccountHistoryResponse :
|
||||
Q extends 'noves_describe_txs' ? NovesDescribeTxsResponse :
|
||||
@@ -1311,7 +1311,7 @@ Q extends 'rewards_user_referrals' ? RewardsUserReferralsResponse :
|
||||
Q extends 'token_transfers_all' ? TokenTransferResponse :
|
||||
Q extends 'address_xstar_score' ? AddressXStarResponse :
|
||||
never;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
/* eslint-enable @stylistic/indent */
|
||||
|
||||
export type ResourcePayload<Q extends ResourceName> = ResourcePayloadA<Q> | ResourcePayloadB<Q>;
|
||||
export type PaginatedResponseItems<Q extends ResourceName> = Q extends PaginatedResources ? ResourcePayloadA<Q>['items'] | ResourcePayloadB<Q>['items'] : never;
|
||||
@@ -1319,7 +1319,7 @@ export type PaginatedResponseNextPageParams<Q extends ResourceName> = Q extends
|
||||
ResourcePayloadA<Q>['next_page_params'] | ResourcePayloadB<Q>['next_page_params'] :
|
||||
never;
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @stylistic/indent */
|
||||
export type PaginationFilters<Q extends PaginatedResources> =
|
||||
Q extends 'blocks' ? BlockFilters :
|
||||
Q extends 'block_txs' ? TTxsWithBlobsFilters :
|
||||
@@ -1346,9 +1346,9 @@ Q extends 'address_mud_tables' ? AddressMudTablesFilter :
|
||||
Q extends 'address_mud_records' ? AddressMudRecordsFilter :
|
||||
Q extends 'token_transfers_all' ? TokenTransferFilters :
|
||||
never;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
/* eslint-enable @stylistic/indent */
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @stylistic/indent */
|
||||
export type PaginationSorting<Q extends PaginatedResources> =
|
||||
Q extends 'tokens' ? TokensSorting :
|
||||
Q extends 'tokens_bridged' ? TokensSorting :
|
||||
@@ -1360,4 +1360,4 @@ Q extends 'validators_stability' ? ValidatorsStabilitySorting :
|
||||
Q extends 'validators_blackfort' ? ValidatorsBlackfortSorting :
|
||||
Q extends 'address_mud_records' ? AddressMudRecordsSorting :
|
||||
never;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
/* eslint-enable @stylistic/indent */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { InfiniteData, QueryKey, UseInfiniteQueryResult } from '@tanstack/react-query';
|
||||
import { useInfiniteQuery, type UseInfiniteQueryOptions } from '@tanstack/react-query';
|
||||
import type { InfiniteData, QueryKey, UseInfiniteQueryResult, UseInfiniteQueryOptions } from '@tanstack/react-query';
|
||||
import { useInfiniteQuery } from '@tanstack/react-query';
|
||||
|
||||
import type { PaginatedResources, ResourceError, ResourcePayload } from 'lib/api/resources';
|
||||
import useApiFetch from 'lib/api/useApiFetch';
|
||||
@@ -28,7 +28,6 @@ export default function useApiInfiniteQuery<R extends PaginatedResources>({
|
||||
const apiFetch = useApiFetch();
|
||||
|
||||
return useInfiniteQuery<TQueryData<R>, TError, InfiniteData<TQueryData<R>>, QueryKey, TPageParam<R>>({
|
||||
// eslint-disable-next-line @tanstack/query/exhaustive-deps
|
||||
queryKey: getResourceKey(resourceName, { pathParams }),
|
||||
queryFn: (context) => {
|
||||
const queryParams = 'pageParam' in context ? (context.pageParam || undefined) : undefined;
|
||||
|
||||
@@ -28,7 +28,6 @@ export default function useApiQuery<R extends ResourceName, E = unknown, D = Res
|
||||
const apiFetch = useApiFetch();
|
||||
|
||||
return useQuery<ResourcePayload<R>, ResourceError<E>, D>({
|
||||
// eslint-disable-next-line @tanstack/query/exhaustive-deps
|
||||
queryKey: queryOptions?.queryKey || getResourceKey(resource, { pathParams, queryParams }),
|
||||
queryFn: async({ signal }) => {
|
||||
// all errors and error typing is handled by react-query
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Props as PageProps } from 'nextjs/getServerSideProps';
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
pageProps: PageProps;
|
||||
}
|
||||
};
|
||||
|
||||
const AppContext = createContext<PageProps>({
|
||||
cookies: '',
|
||||
|
||||
@@ -3,12 +3,12 @@ import React, { createContext, useContext, useEffect, useState, useMemo } from '
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
};
|
||||
|
||||
type TMarketplaceContext = {
|
||||
isAutoConnectDisabled: boolean;
|
||||
setIsAutoConnectDisabled: (isAutoConnectDisabled: boolean) => void;
|
||||
}
|
||||
};
|
||||
|
||||
export const MarketplaceContext = createContext<TMarketplaceContext>({
|
||||
isAutoConnectDisabled: false,
|
||||
|
||||
@@ -46,7 +46,7 @@ type TRewardsContext = {
|
||||
closeLoginModal: () => void;
|
||||
login: (refCode: string) => Promise<{ isNewUser?: boolean; invalidRefCodeError?: boolean }>;
|
||||
claim: () => Promise<void>;
|
||||
}
|
||||
};
|
||||
|
||||
const defaultQueryResult = {
|
||||
data: undefined,
|
||||
@@ -108,7 +108,7 @@ function getRegisteredAddress(token: string) {
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
};
|
||||
|
||||
export function RewardsContextProvider({ children }: Props) {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -22,7 +22,7 @@ export function SettingsContextProvider({ children }: SettingsProviderProps) {
|
||||
const initialAddressFormat = cookies.get(cookies.NAMES.ADDRESS_FORMAT, appCookies);
|
||||
|
||||
const [ addressFormat, setAddressFormat ] = React.useState<AddressFormat>(
|
||||
initialAddressFormat && ADDRESS_FORMATS.includes(initialAddressFormat) ? initialAddressFormat as AddressFormat : 'base16',
|
||||
initialAddressFormat && ADDRESS_FORMATS.includes(initialAddressFormat as AddressFormat) ? initialAddressFormat as AddressFormat : 'base16',
|
||||
);
|
||||
|
||||
const toggleAddressFormat = React.useCallback(() => {
|
||||
|
||||
+14
-14
@@ -3,20 +3,20 @@ import Cookies from 'js-cookie';
|
||||
import isBrowser from './isBrowser';
|
||||
|
||||
export enum NAMES {
|
||||
NAV_BAR_COLLAPSED='nav_bar_collapsed',
|
||||
API_TOKEN='_explorer_key',
|
||||
REWARDS_API_TOKEN='rewards_api_token',
|
||||
REWARDS_REFERRAL_CODE='rewards_ref_code',
|
||||
TXS_SORT='txs_sort',
|
||||
COLOR_MODE='chakra-ui-color-mode',
|
||||
COLOR_MODE_HEX='chakra-ui-color-mode-hex',
|
||||
ADDRESS_IDENTICON_TYPE='address_identicon_type',
|
||||
ADDRESS_FORMAT='address_format',
|
||||
INDEXING_ALERT='indexing_alert',
|
||||
ADBLOCK_DETECTED='adblock_detected',
|
||||
MIXPANEL_DEBUG='_mixpanel_debug',
|
||||
ADDRESS_NFT_DISPLAY_TYPE='address_nft_display_type',
|
||||
UUID='uuid',
|
||||
NAV_BAR_COLLAPSED = 'nav_bar_collapsed',
|
||||
API_TOKEN = '_explorer_key',
|
||||
REWARDS_API_TOKEN = 'rewards_api_token',
|
||||
REWARDS_REFERRAL_CODE = 'rewards_ref_code',
|
||||
TXS_SORT = 'txs_sort',
|
||||
COLOR_MODE = 'chakra-ui-color-mode',
|
||||
COLOR_MODE_HEX = 'chakra-ui-color-mode-hex',
|
||||
ADDRESS_IDENTICON_TYPE = 'address_identicon_type',
|
||||
ADDRESS_FORMAT = 'address_format',
|
||||
INDEXING_ALERT = 'indexing_alert',
|
||||
ADBLOCK_DETECTED = 'adblock_detected',
|
||||
MIXPANEL_DEBUG = '_mixpanel_debug',
|
||||
ADDRESS_NFT_DISPLAY_TYPE = 'address_nft_display_type',
|
||||
UUID = 'uuid',
|
||||
}
|
||||
|
||||
export function get(name?: NAMES | undefined | null, serverCookie?: string) {
|
||||
|
||||
@@ -8,7 +8,7 @@ type Params = ({
|
||||
error: null;
|
||||
}) & {
|
||||
resource?: ResourceName;
|
||||
}
|
||||
};
|
||||
|
||||
export const RESOURCE_LOAD_ERROR_MESSAGE = 'Resource load error';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ type Args = {
|
||||
status: ArbitrumBatchStatus;
|
||||
commitment_transaction: ArbitrumL2TxData;
|
||||
confirmation_transaction: ArbitrumL2TxData;
|
||||
}
|
||||
};
|
||||
|
||||
export default function getArbitrumVerificationStepStatus({
|
||||
status,
|
||||
|
||||
@@ -9,7 +9,7 @@ const feature = config.features.marketplace;
|
||||
export default function useGraphLinks() {
|
||||
const fetch = useFetch();
|
||||
|
||||
return useQuery<unknown, ResourceError<unknown>, Record<string, Array<{text: string; url: string}>>>({
|
||||
return useQuery<unknown, ResourceError<unknown>, Record<string, Array<{ text: string; url: string }>>>({
|
||||
queryKey: [ 'graph-links' ],
|
||||
queryFn: async() => fetch((feature.isEnabled && feature.graphLinksUrl) ? feature.graphLinksUrl : '', undefined, { resource: 'graph-links' }),
|
||||
enabled: feature.isEnabled && Boolean(feature.graphLinksUrl),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type React from 'react';
|
||||
|
||||
export default function isMetaKey(event: React.KeyboardEvent) {
|
||||
return event.metaKey || event.getModifierState('Meta');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import type { Route } from 'nextjs-routes';
|
||||
|
||||
// equal og:description
|
||||
// eslint-disable-next-line max-len
|
||||
const DEFAULT_TEMPLATE = 'Blockscout is the #1 open-source blockchain explorer available today. 100+ chains and counting rely on Blockscout data availability, APIs, and ecosystem tools to support their networks.';
|
||||
|
||||
// FIXME all page descriptions will be updated later
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { TokenInfo } from 'types/api/token';
|
||||
|
||||
import type { Route } from 'nextjs-routes';
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @stylistic/indent */
|
||||
export type ApiData<Pathname extends Route['pathname']> =
|
||||
(
|
||||
Pathname extends '/address/[hash]' ? { domain_name: string } :
|
||||
|
||||
+59
-59
@@ -26,13 +26,13 @@ export enum EventTypes {
|
||||
APP_FEEDBACK = 'App feedback',
|
||||
}
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/* eslint-disable @stylistic/indent */
|
||||
export type EventPayload<Type extends EventTypes> =
|
||||
Type extends EventTypes.PAGE_VIEW ?
|
||||
{
|
||||
'Page type': string;
|
||||
'Tab': string;
|
||||
'Page'?: string;
|
||||
Tab: string;
|
||||
Page?: string;
|
||||
'Color mode': 'light' | 'dark';
|
||||
'Color theme': ColorThemeId | undefined;
|
||||
} :
|
||||
@@ -43,70 +43,70 @@ Type extends EventTypes.SEARCH_QUERY ? {
|
||||
} :
|
||||
Type extends EventTypes.LOCAL_SEARCH ? {
|
||||
'Search query': string;
|
||||
'Source': 'Marketplace';
|
||||
Source: 'Marketplace';
|
||||
} :
|
||||
Type extends EventTypes.ADD_TO_WALLET ? (
|
||||
{
|
||||
'Wallet': WalletType;
|
||||
'Target': 'network';
|
||||
Wallet: WalletType;
|
||||
Target: 'network';
|
||||
} | {
|
||||
'Wallet': WalletType;
|
||||
'Target': 'token';
|
||||
'Token': string;
|
||||
Wallet: WalletType;
|
||||
Target: 'token';
|
||||
Token: string;
|
||||
}
|
||||
) :
|
||||
Type extends EventTypes.ACCOUNT_ACCESS ? {
|
||||
'Action': 'Dropdown open' | 'Logged out';
|
||||
Action: 'Dropdown open' | 'Logged out';
|
||||
} :
|
||||
Type extends EventTypes.LOGIN ? (
|
||||
{
|
||||
'Action': 'Started';
|
||||
'Source': string;
|
||||
Action: 'Started';
|
||||
Source: string;
|
||||
} | {
|
||||
'Action': 'Wallet' | 'Email';
|
||||
'Source': 'Options selector';
|
||||
Action: 'Wallet' | 'Email';
|
||||
Source: 'Options selector';
|
||||
} | {
|
||||
'Action': 'OTP sent';
|
||||
'Source': 'Email';
|
||||
Action: 'OTP sent';
|
||||
Source: 'Email';
|
||||
} | {
|
||||
'Action': 'Success';
|
||||
'Source': 'Email' | 'Wallet';
|
||||
Action: 'Success';
|
||||
Source: 'Email' | 'Wallet';
|
||||
}
|
||||
) :
|
||||
Type extends EventTypes.ACCOUNT_LINK_INFO ? {
|
||||
'Source': 'Profile' | 'Login modal' | 'Profile dropdown' | 'Merits';
|
||||
'Status': 'Started' | 'OTP sent' | 'Finished';
|
||||
'Type': 'Email' | 'Wallet';
|
||||
Source: 'Profile' | 'Login modal' | 'Profile dropdown' | 'Merits';
|
||||
Status: 'Started' | 'OTP sent' | 'Finished';
|
||||
Type: 'Email' | 'Wallet';
|
||||
} :
|
||||
Type extends EventTypes.PRIVATE_TAG ? {
|
||||
'Action': 'Form opened' | 'Submit';
|
||||
Action: 'Form opened' | 'Submit';
|
||||
'Page type': string;
|
||||
'Tag type': 'Address' | 'Tx';
|
||||
} :
|
||||
Type extends EventTypes.VERIFY_ADDRESS ? (
|
||||
{
|
||||
'Action': 'Form opened' | 'Address entered';
|
||||
Action: 'Form opened' | 'Address entered';
|
||||
'Page type': string;
|
||||
} | {
|
||||
'Action': 'Sign ownership';
|
||||
Action: 'Sign ownership';
|
||||
'Page type': string;
|
||||
'Sign method': 'wallet' | 'manual';
|
||||
}
|
||||
) :
|
||||
Type extends EventTypes.VERIFY_TOKEN ? {
|
||||
'Action': 'Form opened' | 'Submit';
|
||||
Action: 'Form opened' | 'Submit';
|
||||
} :
|
||||
Type extends EventTypes.WALLET_CONNECT ? {
|
||||
'Source': 'Header' | 'Login' | 'Profile' | 'Profile dropdown' | 'Smart contracts' | 'Swap button' | 'Merits';
|
||||
'Status': 'Started' | 'Connected';
|
||||
Source: 'Header' | 'Login' | 'Profile' | 'Profile dropdown' | 'Smart contracts' | 'Swap button' | 'Merits';
|
||||
Status: 'Started' | 'Connected';
|
||||
} :
|
||||
Type extends EventTypes.WALLET_ACTION ? (
|
||||
{
|
||||
'Action': 'Open' | 'Address click';
|
||||
Action: 'Open' | 'Address click';
|
||||
} | {
|
||||
'Action': 'Send Transaction' | 'Sign Message' | 'Sign Typed Data';
|
||||
'Address': string | undefined;
|
||||
'AppId': string;
|
||||
Action: 'Send Transaction' | 'Sign Message' | 'Sign Typed Data';
|
||||
Address: string | undefined;
|
||||
AppId: string;
|
||||
}
|
||||
) :
|
||||
Type extends EventTypes.CONTRACT_INTERACTION ? {
|
||||
@@ -114,60 +114,60 @@ Type extends EventTypes.CONTRACT_INTERACTION ? {
|
||||
'Method name': string;
|
||||
} :
|
||||
Type extends EventTypes.CONTRACT_VERIFICATION ? {
|
||||
'Method': string;
|
||||
'Status': 'Method selected' | 'Finished';
|
||||
Method: string;
|
||||
Status: 'Method selected' | 'Finished';
|
||||
} :
|
||||
Type extends EventTypes.QR_CODE ? {
|
||||
'Page type': string;
|
||||
} :
|
||||
Type extends EventTypes.PAGE_WIDGET ? (
|
||||
{
|
||||
'Type': 'Tokens dropdown' | 'Tokens show all (icon)' | 'Add to watchlist' | 'Address actions (more button)';
|
||||
Type: 'Tokens dropdown' | 'Tokens show all (icon)' | 'Add to watchlist' | 'Address actions (more button)';
|
||||
} | {
|
||||
'Type': 'Favorite app' | 'More button' | 'Security score' | 'Total contracts' | 'Verified contracts' | 'Analyzed contracts';
|
||||
'Info': string;
|
||||
'Source': 'Discovery view' | 'Security view' | 'App modal' | 'App page' | 'Security score popup' | 'Banner';
|
||||
Type: 'Favorite app' | 'More button' | 'Security score' | 'Total contracts' | 'Verified contracts' | 'Analyzed contracts';
|
||||
Info: string;
|
||||
Source: 'Discovery view' | 'Security view' | 'App modal' | 'App page' | 'Security score popup' | 'Banner';
|
||||
} | {
|
||||
'Type': 'Security score';
|
||||
'Source': 'Analyzed contracts popup';
|
||||
Type: 'Security score';
|
||||
Source: 'Analyzed contracts popup';
|
||||
} | {
|
||||
'Type': 'Action button';
|
||||
'Info': string;
|
||||
'Source': 'Txn' | 'NFT collection' | 'NFT item';
|
||||
Type: 'Action button';
|
||||
Info: string;
|
||||
Source: 'Txn' | 'NFT collection' | 'NFT item';
|
||||
} | {
|
||||
'Type': 'Address tag';
|
||||
'Info': string;
|
||||
'URL': string;
|
||||
Type: 'Address tag';
|
||||
Info: string;
|
||||
URL: string;
|
||||
} | {
|
||||
'Type': 'Share chart';
|
||||
'Info': string;
|
||||
Type: 'Share chart';
|
||||
Info: string;
|
||||
}
|
||||
) :
|
||||
Type extends EventTypes.TX_INTERPRETATION_INTERACTION ? {
|
||||
'Type': 'Address click' | 'Token click' | 'Domain click';
|
||||
Type: 'Address click' | 'Token click' | 'Domain click';
|
||||
} :
|
||||
Type extends EventTypes.EXPERIMENT_STARTED ? {
|
||||
'Experiment name': string;
|
||||
'Variant name': string;
|
||||
'Source': 'growthbook';
|
||||
Source: 'growthbook';
|
||||
} :
|
||||
Type extends EventTypes.FILTERS ? {
|
||||
'Source': 'Marketplace';
|
||||
Source: 'Marketplace';
|
||||
'Filter name': string;
|
||||
} :
|
||||
Type extends EventTypes.BUTTON_CLICK ? {
|
||||
'Content': string;
|
||||
'Source': string;
|
||||
Content: string;
|
||||
Source: string;
|
||||
} :
|
||||
Type extends EventTypes.PROMO_BANNER ? {
|
||||
'Source': 'Marketplace';
|
||||
'Link': string;
|
||||
Source: 'Marketplace';
|
||||
Link: string;
|
||||
} :
|
||||
Type extends EventTypes.APP_FEEDBACK ? {
|
||||
'Action': 'Rating';
|
||||
'Source': 'Discovery' | 'App modal' | 'App page';
|
||||
'AppId': string;
|
||||
'Score': number;
|
||||
Action: 'Rating';
|
||||
Source: 'Discovery' | 'App modal' | 'App page';
|
||||
AppId: string;
|
||||
Score: number;
|
||||
} :
|
||||
undefined;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
/* eslint-enable @stylistic/indent */
|
||||
|
||||
+4
-5
@@ -47,11 +47,10 @@ interface SocketMessageParamsGeneric<Event extends string | undefined, Payload e
|
||||
handler: (payload: Payload) => void;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
export namespace SocketMessage {
|
||||
export type NewBlock = SocketMessageParamsGeneric<'new_block', NewBlockSocketResponse>;
|
||||
export type BlocksIndexStatus = SocketMessageParamsGeneric<'block_index_status', {finished: boolean; ratio: string}>;
|
||||
export type InternalTxsIndexStatus = SocketMessageParamsGeneric<'internal_txs_index_status', {finished: boolean; ratio: string}>;
|
||||
export type BlocksIndexStatus = SocketMessageParamsGeneric<'block_index_status', { finished: boolean; ratio: string }>;
|
||||
export type InternalTxsIndexStatus = SocketMessageParamsGeneric<'internal_txs_index_status', { finished: boolean; ratio: string }>;
|
||||
export type TxStatusUpdate = SocketMessageParamsGeneric<'collated', NewBlockSocketResponse>;
|
||||
export type TxRawTrace = SocketMessageParamsGeneric<'raw_trace', RawTracesResponse>;
|
||||
export type NewTx = SocketMessageParamsGeneric<'transaction', { transaction: number }>;
|
||||
@@ -73,8 +72,8 @@ export namespace SocketMessage {
|
||||
export type AddressChangedBytecode = SocketMessageParamsGeneric<'changed_bytecode', Record<string, never>>;
|
||||
export type AddressFetchedBytecode = SocketMessageParamsGeneric<'fetched_bytecode', { fetched_bytecode: string }>;
|
||||
export type SmartContractWasVerified = SocketMessageParamsGeneric<'smart_contract_was_verified', Record<string, never>>;
|
||||
export type TokenTransfers = SocketMessageParamsGeneric<'token_transfer', {token_transfer: number }>;
|
||||
export type TokenTotalSupply = SocketMessageParamsGeneric<'total_supply', {total_supply: number }>;
|
||||
export type TokenTransfers = SocketMessageParamsGeneric<'token_transfer', { token_transfer: number }>;
|
||||
export type TokenTotalSupply = SocketMessageParamsGeneric<'total_supply', { total_supply: number }>;
|
||||
export type TokenInstanceMetadataFetched = SocketMessageParamsGeneric<'fetched_token_instance_metadata', TokenInstanceMetadataSocketMessage>;
|
||||
export type ContractVerification = SocketMessageParamsGeneric<'verification_result', SmartContractVerificationResponse>;
|
||||
export type NewZkEvmL2Batch = SocketMessageParamsGeneric<'new_zkevm_confirmed_batch', NewZkEvmBatchSocketResponse>;
|
||||
|
||||
@@ -41,7 +41,6 @@ export default function useAddOrSwitchChain() {
|
||||
blockExplorerUrls: [ config.app.baseUrl ],
|
||||
} ] as never;
|
||||
// in wagmi types for wallet_addEthereumChain method is not provided
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
return await provider.request({
|
||||
method: 'wallet_addEthereumChain',
|
||||
|
||||
@@ -41,7 +41,7 @@ export const userOpData: UserOp = {
|
||||
},
|
||||
sponsor_type: 'paymaster_sponsor',
|
||||
raw: {
|
||||
// eslint-disable-next-line max-len
|
||||
|
||||
call_data: '0xb61d27f600000000000000000000000059f6aa952df7f048fd076e33e0ea8bb552d5ffd8000000000000000000000000000000000000000000000000003f3d017500800000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
|
||||
call_gas_limit: '26624',
|
||||
init_code: '0x',
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import type { NextPage } from 'next';
|
||||
import type React from 'react';
|
||||
|
||||
import type { Route } from 'nextjs-routes';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {
|
||||
getLayout?: (page: React.ReactElement) => React.ReactNode;
|
||||
}
|
||||
};
|
||||
|
||||
export interface RouteParams<Pathname extends Route['pathname']> {
|
||||
pathname: Pathname;
|
||||
|
||||
@@ -9,7 +9,7 @@ type ReturnType = {
|
||||
} | {
|
||||
type: 'search_engine';
|
||||
bot: SearchEngineBot;
|
||||
} | undefined
|
||||
} | undefined;
|
||||
|
||||
export default function detectBotRequest(req: IncomingMessage): ReturnType {
|
||||
const userAgent = req.headers['user-agent'];
|
||||
|
||||
@@ -19,7 +19,7 @@ type Params<R extends ResourceName> = (
|
||||
}
|
||||
) & {
|
||||
timeout?: number;
|
||||
}
|
||||
};
|
||||
|
||||
export default async function fetchApi<R extends ResourceName = never, S = ResourcePayload<R>>(params: Params<R>): Promise<S | undefined> {
|
||||
const controller = new AbortController();
|
||||
|
||||
+16
-7
@@ -117,10 +117,14 @@
|
||||
"xss": "^1.0.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "1.2.2",
|
||||
"@eslint/js": "9.14.0",
|
||||
"@next/eslint-plugin-next": "15.0.3",
|
||||
"@playwright/experimental-ct-react": "1.47.2",
|
||||
"@playwright/test": "1.47.2",
|
||||
"@stylistic/eslint-plugin": "2.10.1",
|
||||
"@svgr/webpack": "^6.5.1",
|
||||
"@tanstack/eslint-plugin-query": "^5.0.5",
|
||||
"@tanstack/eslint-plugin-query": "5.60.1",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"@total-typescript/ts-reset": "^0.4.0",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
@@ -142,14 +146,18 @@
|
||||
"@vitejs/plugin-react": "^4.0.0",
|
||||
"css-loader": "^6.7.3",
|
||||
"dotenv-cli": "^6.0.0",
|
||||
"eslint": "^8.32.0",
|
||||
"eslint": "9.14.0",
|
||||
"eslint-config-next": "15.0.3",
|
||||
"eslint-plugin-es5": "^1.5.0",
|
||||
"eslint-plugin-import-helpers": "^1.2.1",
|
||||
"eslint-plugin-jest": "^27.1.6",
|
||||
"eslint-plugin-import": "2.31.0",
|
||||
"eslint-plugin-import-helpers": "2.0.1",
|
||||
"eslint-plugin-jest": "28.9.0",
|
||||
"eslint-plugin-jsx-a11y": "6.10.2",
|
||||
"eslint-plugin-no-cyrillic-string": "^1.0.5",
|
||||
"eslint-plugin-playwright": "^0.11.2",
|
||||
"eslint-plugin-regexp": "^1.7.0",
|
||||
"eslint-plugin-playwright": "2.0.1",
|
||||
"eslint-plugin-react": "7.37.2",
|
||||
"eslint-plugin-react-hooks": "5.0.0",
|
||||
"eslint-plugin-regexp": "2.6.0",
|
||||
"globals": "15.12.0",
|
||||
"husky": "^8.0.0",
|
||||
"jest": "^29.2.1",
|
||||
"jest-environment-jsdom": "^29.2.1",
|
||||
@@ -162,6 +170,7 @@
|
||||
"ts-jest": "^29.0.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "5.4.2",
|
||||
"typescript-eslint": "8.14.0",
|
||||
"vite-plugin-svgr": "^2.2.2",
|
||||
"vite-tsconfig-paths": "4.3.2",
|
||||
"ws": "^8.17.1"
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import 'lib/setLocale';
|
||||
|
||||
type AppPropsWithLayout = AppProps & {
|
||||
Component: NextPageWithLayout;
|
||||
}
|
||||
};
|
||||
|
||||
const ERROR_SCREEN_STYLES: ChakraProps = {
|
||||
h: '100vh',
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import * as cookies from 'lib/cookies';
|
||||
|
||||
type Props = ServerSidePropsCommon & {
|
||||
statusCode: number;
|
||||
}
|
||||
};
|
||||
|
||||
const CustomErrorComponent = (props: Props) => {
|
||||
const colorModeCookie = cookies.getFromCookieString(props.cookies || '', cookies.NAMES.COLOR_MODE);
|
||||
|
||||
@@ -16,7 +16,7 @@ const pathname: Route['pathname'] = '/address/[hash]';
|
||||
|
||||
const Page: NextPage<Props<typeof pathname>> = (props: Props<typeof pathname>) => {
|
||||
return (
|
||||
<PageNextJs pathname="/address/[hash]" query={ props.query } apiData={ props.apiData }>
|
||||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }>
|
||||
<Address/>
|
||||
</PageNextJs>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||
|
||||
export default async function configHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
const publicEnvs = Object.entries(process.env)
|
||||
.filter(([ key ]) => key.startsWith('NEXT_PUBLIC_'))
|
||||
.sort(([ keyA ], [ keyB ]) => keyA.localeCompare(keyB))
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||
import * as promClient from 'prom-client';
|
||||
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
const isEnabled = process.env.PROMETHEUS_METRICS_ENABLED === 'true';
|
||||
|
||||
isEnabled && promClient.collectDefaultMetrics({ prefix: 'frontend_' });
|
||||
|
||||
@@ -12,8 +12,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
try {
|
||||
const payload = JSON.parse(req.body);
|
||||
metrics?.invalidApiSchema.inc(v.parse(PayloadSchema, payload));
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {}
|
||||
res.status(200).json({ status: 'ok' });
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ const feature = config.features.marketplace;
|
||||
|
||||
const Page: NextPageWithLayout<Props<typeof pathname>> = (props: Props<typeof pathname>) => {
|
||||
return (
|
||||
<PageNextJs pathname="/apps/[id]" query={ props.query } apiData={ props.apiData }>
|
||||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }>
|
||||
<MarketplaceApp/>
|
||||
</PageNextJs>
|
||||
);
|
||||
|
||||
@@ -19,7 +19,7 @@ const pathname: Route['pathname'] = '/stats/[id]';
|
||||
|
||||
const Page: NextPage<Props<typeof pathname>> = (props: Props<typeof pathname>) => {
|
||||
return (
|
||||
<PageNextJs pathname="/stats/[id]" query={ props.query } apiData={ props.apiData }>
|
||||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }>
|
||||
<Chart/>
|
||||
</PageNextJs>
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@ const pathname: Route['pathname'] = '/token/[hash]';
|
||||
|
||||
const Page: NextPage<Props<typeof pathname>> = (props: Props<typeof pathname>) => {
|
||||
return (
|
||||
<PageNextJs pathname="/token/[hash]" query={ props.query } apiData={ props.apiData }>
|
||||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }>
|
||||
<Token/>
|
||||
</PageNextJs>
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ export type Props = {
|
||||
isAutoConnectDisabled: boolean;
|
||||
setIsAutoConnectDisabled: (isAutoConnectDisabled: boolean) => void;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const defaultAppContext = {
|
||||
pageProps: {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable max-len */
|
||||
import type { TestFixture, Page } from '@playwright/test';
|
||||
|
||||
export type MockFeaturesFixture = (features: Array<[string, unknown]>) => Promise<void>;
|
||||
|
||||
@@ -9,16 +9,20 @@ import TestApp from 'playwright/TestApp';
|
||||
|
||||
interface MountResult extends Locator {
|
||||
unmount(): Promise<void>;
|
||||
update(component: JSX.Element): Promise<void>;
|
||||
update(component: React.JSX.Element): Promise<void>;
|
||||
}
|
||||
|
||||
interface AppHooksConfig {
|
||||
router: Partial<Pick<typeof router, 'query' | 'isReady' | 'asPath' | 'pathname'>>;
|
||||
}
|
||||
|
||||
type Mount = <HooksConfig extends AppHooksConfig>(component: JSX.Element, options?: MountOptions<HooksConfig>) => Promise<MountResult>
|
||||
type Mount = <HooksConfig extends AppHooksConfig>(component: React.JSX.Element, options?: MountOptions<HooksConfig>) => Promise<MountResult>;
|
||||
|
||||
export type RenderFixture = (component: JSX.Element, options?: MountOptions<AppHooksConfig>, props?: Omit<TestAppProps, 'children'>) => Promise<MountResult>
|
||||
export type RenderFixture = (
|
||||
component: React.JSX.Element,
|
||||
options?: MountOptions<AppHooksConfig>,
|
||||
props?: Omit<TestAppProps, 'children'>
|
||||
) => Promise<MountResult>;
|
||||
|
||||
const fixture: TestFixture<RenderFixture, { mount: Mount }> = async({ mount }, use) => {
|
||||
await use((component, options, props) => {
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface SocketServerFixture {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export const createSocket: TestFixture<CreateSocketFixture, { page: Page}> = async({ page }, use) => {
|
||||
export const createSocket: TestFixture<CreateSocketFixture, { page: Page }> = async({ page }, use) => {
|
||||
const socketServer = new WebSocketServer({ port: socketPort });
|
||||
|
||||
const connectionPromise = new Promise<WebSocket>((resolve) => {
|
||||
@@ -70,7 +70,7 @@ export function sendMessage(socket: WebSocket, channel: Channel, msg: 'pending_t
|
||||
export function sendMessage(socket: WebSocket, channel: Channel, msg: 'pending_transaction', payload: { pending_transactions: Array<Transaction> }): void;
|
||||
export function sendMessage(socket: WebSocket, channel: Channel, msg: 'new_block', payload: NewBlockSocketResponse): void;
|
||||
export function sendMessage(socket: WebSocket, channel: Channel, msg: 'verification_result', payload: SmartContractVerificationResponse): void;
|
||||
export function sendMessage(socket: WebSocket, channel: Channel, msg: 'total_supply', payload: { total_supply: number}): void;
|
||||
export function sendMessage(socket: WebSocket, channel: Channel, msg: 'total_supply', payload: { total_supply: number }): void;
|
||||
export function sendMessage(socket: WebSocket, channel: Channel, msg: 'changed_bytecode', payload: Record<string, never>): void;
|
||||
export function sendMessage(socket: WebSocket, channel: Channel, msg: 'fetched_bytecode', payload: { fetched_bytecode: string }): void;
|
||||
export function sendMessage(socket: WebSocket, channel: Channel, msg: 'smart_contract_was_verified', payload: Record<string, never>): void;
|
||||
|
||||
+2
-1
@@ -14,8 +14,9 @@ const NEXT_ROUTER_MOCK = {
|
||||
|
||||
beforeMount(async({ hooksConfig }) => {
|
||||
// Before mount, redefine useRouter to return mock value from test.
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
|
||||
// @ts-ignore: I really want to redefine this property :)
|
||||
// eslint-disable-next-line no-import-assign
|
||||
router.useRouter = () => _defaultsDeep(hooksConfig?.router, NEXT_ROUTER_MOCK);
|
||||
|
||||
// set current date
|
||||
|
||||
@@ -33,7 +33,7 @@ TEST_CASES.forEach((props) => {
|
||||
<Alert { ...props }>
|
||||
<AlertIcon/>
|
||||
<AlertTitle>
|
||||
This is alert text
|
||||
This is alert text
|
||||
</AlertTitle>
|
||||
</Alert>,
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@ function getFloatingVariantStylesForSize(size: 'md' | 'lg', props: StyleFunction
|
||||
const activeLabelStyles = {
|
||||
...FormLabel.variants?.floating?.(props)._focusWithin,
|
||||
...FormLabel.sizes?.[size](props)._focusWithin,
|
||||
} || {};
|
||||
};
|
||||
|
||||
const activeInputStyles = (() => {
|
||||
switch (size) {
|
||||
|
||||
@@ -7,7 +7,7 @@ test('base view +@dark-mode', async({ render, page }) => {
|
||||
const component = await render(
|
||||
<Box m={ 10 }>
|
||||
<Tooltip label="Tooltip content">
|
||||
trigger
|
||||
trigger
|
||||
</Tooltip>
|
||||
</Box>,
|
||||
);
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@
|
||||
"../types/**/*.ts",
|
||||
"../configs/app/**/*.ts",
|
||||
"../global.d.ts",
|
||||
"./theme.ts"
|
||||
"**/*.ts",
|
||||
"**/*.pw.tsx"
|
||||
],
|
||||
"tsc-alias": {
|
||||
"verbose": true,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default function getDefaultTransitionProps(props?: {transitionProperty: string}) {
|
||||
export default function getDefaultTransitionProps(props?: { transitionProperty: string }) {
|
||||
return {
|
||||
transitionProperty: `background-color, color, border-color${ props?.transitionProperty ? ', ' + props.transitionProperty : '' }`,
|
||||
transitionDuration: 'normal',
|
||||
|
||||
+1
-1
@@ -16,6 +16,6 @@
|
||||
"incremental": true,
|
||||
"baseUrl": ".",
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.node.ts", "**/*.tsx", "decs.d.ts", "global.d.ts"],
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.node.ts", "**/*.tsx", "**/*.pw.tsx", "decs.d.ts", "global.d.ts"],
|
||||
"exclude": ["node_modules", "node_modules_linux", "./deploy/tools/envs-validator", "./deploy/tools/favicon-generator"],
|
||||
}
|
||||
|
||||
+13
-13
@@ -8,7 +8,7 @@ export interface AddressTag {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export type AddressTags = Array<AddressTag>
|
||||
export type AddressTags = Array<AddressTag>;
|
||||
|
||||
export type AddressTagsResponse = {
|
||||
items: AddressTags;
|
||||
@@ -16,14 +16,14 @@ export type AddressTagsResponse = {
|
||||
id: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export interface ApiKey {
|
||||
api_key: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type ApiKeys = Array<ApiKey>
|
||||
export type ApiKeys = Array<ApiKey>;
|
||||
|
||||
export interface ModelError {
|
||||
message: string;
|
||||
@@ -57,7 +57,7 @@ export interface TransactionTag {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export type TransactionTags = Array<TransactionTag>
|
||||
export type TransactionTags = Array<TransactionTag>;
|
||||
|
||||
export type TransactionTagsResponse = {
|
||||
items: TransactionTags;
|
||||
@@ -65,9 +65,9 @@ export type TransactionTagsResponse = {
|
||||
id: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type Transactions = Array<Transaction>
|
||||
export type Transactions = Array<Transaction>;
|
||||
|
||||
export interface UserInfo {
|
||||
name?: string;
|
||||
@@ -96,7 +96,7 @@ export interface WatchlistAddressNew {
|
||||
notificationSettings: NotificationSettings;
|
||||
}
|
||||
|
||||
export type WatchlistAddresses = Array<WatchlistAddress>
|
||||
export type WatchlistAddresses = Array<WatchlistAddress>;
|
||||
|
||||
export type WatchlistResponse = {
|
||||
items: WatchlistAddresses;
|
||||
@@ -104,9 +104,9 @@ export type WatchlistResponse = {
|
||||
id: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type CustomAbis = Array<CustomAbi>
|
||||
export type CustomAbis = Array<CustomAbi>;
|
||||
|
||||
export interface CustomAbi {
|
||||
name: string;
|
||||
@@ -120,14 +120,14 @@ export type WatchlistErrors = {
|
||||
address_hash?: Array<string>;
|
||||
name?: Array<string>;
|
||||
watchlist_id?: Array<string>;
|
||||
}
|
||||
};
|
||||
|
||||
export type CustomAbiErrors = {
|
||||
address_hash?: Array<string>;
|
||||
name?: Array<string>;
|
||||
abi?: Array<string>;
|
||||
identity_id?: Array<string>;
|
||||
}
|
||||
};
|
||||
|
||||
export type ApiKeyErrors = {
|
||||
name?: Array<string>;
|
||||
@@ -138,13 +138,13 @@ export type AddressTagErrors = {
|
||||
address_hash: Array<string>;
|
||||
name: Array<string>;
|
||||
identity_id?: Array<string>;
|
||||
}
|
||||
};
|
||||
|
||||
export type TransactionTagErrors = {
|
||||
transaction_hash: Array<string>;
|
||||
name: Array<string>;
|
||||
identity_id?: Array<string>;
|
||||
}
|
||||
};
|
||||
|
||||
export interface VerifiedAddress {
|
||||
userId: string;
|
||||
|
||||
+20
-20
@@ -50,13 +50,13 @@ export type AddressNFT = TokenInstance & {
|
||||
token: TokenInfo;
|
||||
token_type: Omit<TokenType, 'ERC-20'>;
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressCollection = {
|
||||
token: TokenInfo;
|
||||
amount: string;
|
||||
token_instances: Array<Omit<AddressNFT, 'token'>>;
|
||||
}
|
||||
};
|
||||
|
||||
export interface AddressTokensResponse {
|
||||
items: Array<AddressTokenBalance>;
|
||||
@@ -107,7 +107,7 @@ export type AddressFromToFilter = typeof AddressFromToFilterValues[number] | und
|
||||
|
||||
export type AddressTxsFilters = {
|
||||
filter: AddressFromToFilter;
|
||||
}
|
||||
};
|
||||
|
||||
export interface AddressTokenTransferResponse {
|
||||
items: Array<TokenTransfer>;
|
||||
@@ -118,15 +118,15 @@ export type AddressTokenTransferFilters = {
|
||||
filter?: AddressFromToFilter;
|
||||
type?: Array<TokenType>;
|
||||
token?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressTokensFilter = {
|
||||
type: TokenType;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressNFTTokensFilter = {
|
||||
type: Array<NFTTokenType> | undefined;
|
||||
}
|
||||
};
|
||||
|
||||
export interface AddressCoinBalanceHistoryItem {
|
||||
block_number: number;
|
||||
@@ -175,7 +175,7 @@ export type AddressWithdrawalsResponse = {
|
||||
index: number;
|
||||
items_count: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressWithdrawalsItem = {
|
||||
amount: string;
|
||||
@@ -183,7 +183,7 @@ export type AddressWithdrawalsItem = {
|
||||
index: number;
|
||||
timestamp: string;
|
||||
validator_index: number;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressTabsCounters = {
|
||||
internal_txs_count: number | null;
|
||||
@@ -194,13 +194,13 @@ export type AddressTabsCounters = {
|
||||
validations_count: number | null;
|
||||
withdrawals_count: number | null;
|
||||
celo_election_rewards_count?: number | null;
|
||||
}
|
||||
};
|
||||
|
||||
// MUD framework
|
||||
export type AddressMudTableItem = {
|
||||
schema: MudWorldSchema;
|
||||
table: MudWorldTable;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressMudTables = {
|
||||
items: Array<AddressMudTableItem>;
|
||||
@@ -208,11 +208,11 @@ export type AddressMudTables = {
|
||||
items_count: number;
|
||||
table_id: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressMudTablesFilter = {
|
||||
q?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressMudRecords = {
|
||||
items: Array<AddressMudRecordsItem>;
|
||||
@@ -224,30 +224,30 @@ export type AddressMudRecords = {
|
||||
key1: string;
|
||||
key_bytes: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressMudRecordsItem = {
|
||||
decoded: Record<string, string | Array<string>>;
|
||||
id: string;
|
||||
is_deleted: boolean;
|
||||
timestamp: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressMudRecordsFilter = {
|
||||
filter_key0?: string;
|
||||
filter_key1?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressMudRecordsSorting = {
|
||||
sort: 'key0' | 'key1';
|
||||
order: 'asc' | 'desc' | undefined;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressMudRecord = {
|
||||
record: AddressMudRecordsItem;
|
||||
schema: MudWorldSchema;
|
||||
table: MudWorldTable;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressEpochRewardsResponse = {
|
||||
items: Array<AddressEpochRewardsItem>;
|
||||
@@ -258,7 +258,7 @@ export type AddressEpochRewardsResponse = {
|
||||
items_count: number;
|
||||
type: EpochRewardsType;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressEpochRewardsItem = {
|
||||
type: EpochRewardsType;
|
||||
@@ -270,8 +270,8 @@ export type AddressEpochRewardsItem = {
|
||||
account: AddressParam;
|
||||
epoch_number: number;
|
||||
associated_account: AddressParam;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressXStarResponse = {
|
||||
data: string | null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ export type AddressFilecoinParams = {
|
||||
actor_type?: FilecoinActorType;
|
||||
id?: string | null;
|
||||
robust?: string | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type FilecoinActorType =
|
||||
'account' |
|
||||
@@ -59,6 +59,6 @@ export type AddressParamBasic = {
|
||||
tags: Array<AddressMetadataTagApi>;
|
||||
} | null;
|
||||
filecoin?: AddressFilecoinParams;
|
||||
}
|
||||
};
|
||||
|
||||
export type AddressParam = UserTags & AddressParamBasic;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { AddressParam } from './addressParams';
|
||||
|
||||
export type AddressesItem = AddressParam & { transaction_count: string; coin_balance: string | null }
|
||||
export type AddressesItem = AddressParam & { transaction_count: string; coin_balance: string | null };
|
||||
|
||||
export type AddressesResponse = {
|
||||
items: Array<AddressesItem>;
|
||||
@@ -10,7 +10,7 @@ export type AddressesResponse = {
|
||||
items_count: number;
|
||||
} | null;
|
||||
total_supply: string;
|
||||
}
|
||||
};
|
||||
|
||||
export interface AddressesMetadataSearchResult {
|
||||
items: Array<AddressesItem>;
|
||||
|
||||
+12
-12
@@ -20,7 +20,7 @@ export type ArbitrumL2MessagesItem = {
|
||||
origination_transaction_block_number: number | null;
|
||||
origination_transaction_hash: string;
|
||||
status: 'initiated' | 'sent' | 'confirmed' | 'relayed';
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumL2MessagesResponse = {
|
||||
items: Array<ArbitrumL2MessagesItem>;
|
||||
@@ -29,20 +29,20 @@ export type ArbitrumL2MessagesResponse = {
|
||||
id: number;
|
||||
items_count: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumL2TxData = {
|
||||
hash: string | null;
|
||||
status: string | null;
|
||||
timestamp: string | null;
|
||||
}
|
||||
};
|
||||
|
||||
type ArbitrumL2BatchCommitmentTx = {
|
||||
block_number: number;
|
||||
hash: string;
|
||||
status: string;
|
||||
timestamp: string;
|
||||
}
|
||||
};
|
||||
|
||||
type BatchDataContainer = 'in_blob4844' | 'in_calldata' | 'in_anytrust' | 'in_celestia' | null;
|
||||
|
||||
@@ -52,7 +52,7 @@ export type ArbitrumL2TxnBatchesItem = {
|
||||
number: number;
|
||||
transactions_count: number;
|
||||
batch_data_container: BatchDataContainer;
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumL2TxnBatchesResponse = {
|
||||
items: Array<ArbitrumL2TxnBatchesItem>;
|
||||
@@ -60,7 +60,7 @@ export type ArbitrumL2TxnBatchesResponse = {
|
||||
number: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumL2TxnBatchDAAnytrust = {
|
||||
batch_data_container: 'in_anytrust';
|
||||
@@ -72,11 +72,11 @@ export type ArbitrumL2TxnBatchDAAnytrust = {
|
||||
trusted: boolean;
|
||||
proof?: string;
|
||||
}>;
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumL2TxnBatchDataAvailability = ArbitrumL2TxnBatchDAAnytrust | {
|
||||
batch_data_container: Exclude<BatchDataContainer, 'in_anytrust'>;
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumL2TxnBatch = {
|
||||
after_acc: string;
|
||||
@@ -87,7 +87,7 @@ export type ArbitrumL2TxnBatch = {
|
||||
number: number;
|
||||
transactions_count: number;
|
||||
data_availability: ArbitrumL2TxnBatchDataAvailability;
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumL2BatchTxs = {
|
||||
items: Array<Transaction>;
|
||||
@@ -97,7 +97,7 @@ export type ArbitrumL2BatchTxs = {
|
||||
index: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumL2BatchBlocks = {
|
||||
items: Array<Block>;
|
||||
@@ -106,7 +106,7 @@ export type ArbitrumL2BatchBlocks = {
|
||||
block_number: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export const ARBITRUM_L2_TX_BATCH_STATUSES = [
|
||||
'Processed on rollup' as const,
|
||||
@@ -116,4 +116,4 @@ export const ARBITRUM_L2_TX_BATCH_STATUSES = [
|
||||
|
||||
export type ArbitrumBatchStatus = typeof ARBITRUM_L2_TX_BATCH_STATUSES[number];
|
||||
|
||||
export type NewArbitrumBatchSocketResponse = { batch: ArbitrumL2TxnBatchesItem }
|
||||
export type NewArbitrumBatchSocketResponse = { batch: ArbitrumL2TxnBatchesItem };
|
||||
|
||||
+12
-12
@@ -57,7 +57,7 @@ export interface Block {
|
||||
blob_tx_count?: number;
|
||||
// ZKSYNC FIELDS
|
||||
zksync?: Omit<ZkSyncBatchesItem, 'number' | 'transaction_count' | 'timestamp'> & {
|
||||
'batch_number': number | null;
|
||||
batch_number: number | null;
|
||||
};
|
||||
arbitrum?: ArbitrumBlockData;
|
||||
optimism?: OptimismBlockData;
|
||||
@@ -70,15 +70,15 @@ export interface Block {
|
||||
}
|
||||
|
||||
type ArbitrumBlockData = {
|
||||
'batch_number': number;
|
||||
'commitment_transaction': ArbitrumL2TxData;
|
||||
'confirmation_transaction': ArbitrumL2TxData;
|
||||
'delayed_messages': number;
|
||||
'l1_block_height': number;
|
||||
'send_count': number;
|
||||
'send_root': string;
|
||||
'status': ArbitrumBatchStatus;
|
||||
}
|
||||
batch_number: number;
|
||||
commitment_transaction: ArbitrumL2TxData;
|
||||
confirmation_transaction: ArbitrumL2TxData;
|
||||
delayed_messages: number;
|
||||
l1_block_height: number;
|
||||
send_count: number;
|
||||
send_root: string;
|
||||
status: ArbitrumBatchStatus;
|
||||
};
|
||||
|
||||
export interface OptimismBlockData {
|
||||
batch_data_container: OptimisticL2BatchDataContainer;
|
||||
@@ -120,14 +120,14 @@ export type BlockWithdrawalsResponse = {
|
||||
index: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type BlockWithdrawalsItem = {
|
||||
amount: string;
|
||||
index: number;
|
||||
receiver: AddressParam;
|
||||
validator_index: number;
|
||||
}
|
||||
};
|
||||
|
||||
export interface BlockCountdownResponse {
|
||||
result: {
|
||||
|
||||
+16
-16
@@ -81,8 +81,8 @@ export type SmartContractDecodedConstructorArg = [
|
||||
internalType: SmartContractMethodArgType;
|
||||
name: string;
|
||||
type: SmartContractMethodArgType;
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
export interface SmartContractExternalLibrary {
|
||||
address_hash: string;
|
||||
@@ -111,7 +111,7 @@ export type SmartContractVerificationResponse = {
|
||||
errors: SmartContractVerificationError;
|
||||
} | {
|
||||
status: 'success';
|
||||
}
|
||||
};
|
||||
|
||||
export interface SmartContractVerificationError {
|
||||
contract_source_code?: Array<string>;
|
||||
@@ -126,24 +126,24 @@ type SmartContractSecurityAudit = {
|
||||
audit_company_name: string;
|
||||
audit_publish_date: string;
|
||||
audit_report_url: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type SmartContractSecurityAudits = {
|
||||
items: Array<SmartContractSecurityAudit>;
|
||||
}
|
||||
};
|
||||
|
||||
export type SmartContractSecurityAuditSubmission = {
|
||||
'address_hash': string;
|
||||
'submitter_name': string;
|
||||
'submitter_email': string;
|
||||
'is_project_owner': boolean;
|
||||
'project_name': string;
|
||||
'project_url': string;
|
||||
'audit_company_name': string;
|
||||
'audit_report_url': string;
|
||||
'audit_publish_date': string;
|
||||
'comment'?: string;
|
||||
}
|
||||
address_hash: string;
|
||||
submitter_name: string;
|
||||
submitter_email: string;
|
||||
is_project_owner: boolean;
|
||||
project_name: string;
|
||||
project_url: string;
|
||||
audit_company_name: string;
|
||||
audit_report_url: string;
|
||||
audit_publish_date: string;
|
||||
comment?: string;
|
||||
};
|
||||
|
||||
// MUD SYSTEM
|
||||
|
||||
|
||||
@@ -34,4 +34,4 @@ export type VerifiedContractsCounters = {
|
||||
new_verified_smart_contracts_24h: string;
|
||||
smart_contracts: string;
|
||||
verified_smart_contracts: string;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,4 +3,4 @@ export type IndexingStatus = {
|
||||
finished_indexing_blocks: boolean;
|
||||
indexed_blocks_ratio: string;
|
||||
indexed_internal_transactions_ratio: string;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { AddressParam } from './addressParams';
|
||||
|
||||
export type TxInternalsType = 'call' | 'delegatecall' | 'staticcall' | 'create' | 'create2' | 'selfdestruct' | 'reward'
|
||||
export type TxInternalsType = 'call' | 'delegatecall' | 'staticcall' | 'create' | 'create2' | 'selfdestruct' | 'reward';
|
||||
|
||||
export type InternalTransaction = (
|
||||
{
|
||||
@@ -22,7 +22,7 @@ export type InternalTransaction = (
|
||||
block: number;
|
||||
timestamp: string;
|
||||
gas_limit: string;
|
||||
}
|
||||
};
|
||||
|
||||
export interface InternalTransactionsResponse {
|
||||
items: Array<InternalTransaction>;
|
||||
|
||||
@@ -6,13 +6,13 @@ export type MudWorldsResponse = {
|
||||
items_count: number;
|
||||
world: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type MudWorldItem = {
|
||||
address: AddressParam;
|
||||
coin_balance: string;
|
||||
transaction_count: number | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type MudWorldSchema = {
|
||||
key_names: Array<string>;
|
||||
@@ -27,4 +27,4 @@ export type MudWorldTable = {
|
||||
table_name: string;
|
||||
table_namespace: string;
|
||||
table_type: string;
|
||||
}
|
||||
};
|
||||
|
||||
+2
-2
@@ -113,11 +113,11 @@ export interface NovesDescribeResponse {
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface NovesDescribeTxsResponse {
|
||||
export type NovesDescribeTxsResponse = {
|
||||
txHash: string;
|
||||
type: string;
|
||||
description: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
export interface NovesTxTranslation {
|
||||
data?: NovesDescribeTxsResponse;
|
||||
|
||||
+26
-26
@@ -9,7 +9,7 @@ export type OptimisticL2DepositsItem = {
|
||||
l1_transaction_origin: string;
|
||||
l2_transaction_gas_limit: string;
|
||||
l2_transaction_hash: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimisticL2DepositsResponse = {
|
||||
items: Array<OptimisticL2DepositsItem>;
|
||||
@@ -18,7 +18,7 @@ export type OptimisticL2DepositsResponse = {
|
||||
l1_block_number: number;
|
||||
transaction_hash: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimisticL2OutputRootsItem = {
|
||||
l1_block_number: number;
|
||||
@@ -27,7 +27,7 @@ export type OptimisticL2OutputRootsItem = {
|
||||
l2_block_number: number;
|
||||
l2_output_index: number;
|
||||
output_root: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimisticL2OutputRootsResponse = {
|
||||
items: Array<OptimisticL2OutputRootsItem>;
|
||||
@@ -35,7 +35,7 @@ export type OptimisticL2OutputRootsResponse = {
|
||||
index: number;
|
||||
items_count: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimisticL2BatchDataContainer = 'in_blob4844' | 'in_celestia' | 'in_calldata';
|
||||
|
||||
@@ -47,7 +47,7 @@ export type OptimisticL2TxnBatchesItem = {
|
||||
l2_block_start: number;
|
||||
l2_block_end: number;
|
||||
transaction_count: number;
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimisticL2TxnBatchesResponse = {
|
||||
items: Array<OptimisticL2TxnBatchesItem>;
|
||||
@@ -55,7 +55,7 @@ export type OptimisticL2TxnBatchesResponse = {
|
||||
id: number;
|
||||
items_count: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export interface OptimisticL2BlobTypeEip4844 {
|
||||
hash: string;
|
||||
@@ -103,7 +103,7 @@ export type OptimismL2BatchTxs = {
|
||||
index: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimismL2BatchBlocks = {
|
||||
items: Array<Block>;
|
||||
@@ -111,18 +111,18 @@ export type OptimismL2BatchBlocks = {
|
||||
batch_number: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimisticL2WithdrawalsItem = {
|
||||
'challenge_period_end': string | null;
|
||||
'from': AddressParam | null;
|
||||
'l1_transaction_hash': string | null;
|
||||
'l2_timestamp': string | null;
|
||||
'l2_transaction_hash': string;
|
||||
'msg_nonce': number;
|
||||
'msg_nonce_version': number;
|
||||
'status': string;
|
||||
}
|
||||
challenge_period_end: string | null;
|
||||
from: AddressParam | null;
|
||||
l1_transaction_hash: string | null;
|
||||
l2_timestamp: string | null;
|
||||
l2_transaction_hash: string;
|
||||
msg_nonce: number;
|
||||
msg_nonce_version: number;
|
||||
status: string;
|
||||
};
|
||||
|
||||
export type OptimisticL2WithdrawalStatus =
|
||||
'Waiting for state root' |
|
||||
@@ -136,19 +136,19 @@ export type OptimisticL2WithdrawalStatus =
|
||||
|
||||
export type OptimisticL2WithdrawalsResponse = {
|
||||
items: Array<OptimisticL2WithdrawalsItem>;
|
||||
'next_page_params': {
|
||||
'items_count': number;
|
||||
'nonce': string;
|
||||
next_page_params: {
|
||||
items_count: number;
|
||||
nonce: string;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimisticL2DisputeGamesResponse = {
|
||||
items: Array<OptimisticL2DisputeGamesItem>;
|
||||
'next_page_params': {
|
||||
'items_count': number;
|
||||
'index': number;
|
||||
next_page_params: {
|
||||
items_count: number;
|
||||
index: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type OptimisticL2DisputeGamesItem = {
|
||||
contract_address: string;
|
||||
@@ -158,4 +158,4 @@ export type OptimisticL2DisputeGamesItem = {
|
||||
l2_block_number: number;
|
||||
resolved_at: string | null;
|
||||
status: string;
|
||||
}
|
||||
};
|
||||
|
||||
+9
-9
@@ -93,15 +93,15 @@ SearchResultBlob | SearchResultDomain;
|
||||
export interface SearchResult {
|
||||
items: Array<SearchResultItem>;
|
||||
next_page_params: {
|
||||
'address_hash': string | null;
|
||||
'block_hash': string | null;
|
||||
'holder_count': number | null;
|
||||
'inserted_at': string | null;
|
||||
'item_type': SearchResultType;
|
||||
'items_count': number;
|
||||
'name': string;
|
||||
'q': string;
|
||||
'transaction_hash': string | null;
|
||||
address_hash: string | null;
|
||||
block_hash: string | null;
|
||||
holder_count: number | null;
|
||||
inserted_at: string | null;
|
||||
item_type: SearchResultType;
|
||||
items_count: number;
|
||||
name: string;
|
||||
q: string;
|
||||
transaction_hash: string | null;
|
||||
} | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export type ShibariumDepositsItem = {
|
||||
l2_transaction_hash: string;
|
||||
timestamp: string;
|
||||
user: AddressParam | string;
|
||||
}
|
||||
};
|
||||
|
||||
export type ShibariumDepositsResponse = {
|
||||
items: Array<ShibariumDepositsItem>;
|
||||
@@ -14,7 +14,7 @@ export type ShibariumDepositsResponse = {
|
||||
items_count: number;
|
||||
block_number: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type ShibariumWithdrawalsItem = {
|
||||
l1_transaction_hash: string;
|
||||
@@ -22,7 +22,7 @@ export type ShibariumWithdrawalsItem = {
|
||||
l2_transaction_hash: string;
|
||||
timestamp: string;
|
||||
user: AddressParam | string;
|
||||
}
|
||||
};
|
||||
|
||||
export type ShibariumWithdrawalsResponse = {
|
||||
items: Array<ShibariumWithdrawalsItem>;
|
||||
@@ -30,4 +30,4 @@ export type ShibariumWithdrawalsResponse = {
|
||||
items_count: number;
|
||||
block_number: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
+2
-2
@@ -23,13 +23,13 @@ export type HomeStats = {
|
||||
celo?: {
|
||||
epoch_number: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type GasPrices = {
|
||||
average: GasPriceInfo | null;
|
||||
fast: GasPriceInfo | null;
|
||||
slow: GasPriceInfo | null;
|
||||
}
|
||||
};
|
||||
|
||||
export interface GasPriceInfo {
|
||||
fiat_price: string | null;
|
||||
|
||||
+6
-6
@@ -38,18 +38,18 @@ export type TokenHolder = TokenHolderERC20ERC721 | TokenHolderERC1155;
|
||||
export type TokenHolderBase = {
|
||||
address: AddressParam;
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type TokenHolderERC20ERC721 = TokenHolderBase
|
||||
export type TokenHolderERC20ERC721 = TokenHolderBase;
|
||||
|
||||
export type TokenHolderERC1155 = TokenHolderBase & {
|
||||
token_id: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type TokenHoldersPagination = {
|
||||
items_count: number;
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export interface TokenInstance {
|
||||
is_unique: boolean;
|
||||
@@ -78,10 +78,10 @@ export interface TokenInventoryResponse {
|
||||
|
||||
export type TokenInventoryPagination = {
|
||||
unique_token: number;
|
||||
}
|
||||
};
|
||||
|
||||
export type TokenVerifiedInfo = Omit<TokenInfoApplication, 'id' | 'status'>;
|
||||
|
||||
export type TokenInventoryFilters = {
|
||||
holder_address_hash?: string;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,17 +4,17 @@ import type { TokenInfo, TokenType } from './token';
|
||||
export type Erc20TotalPayload = {
|
||||
decimals: string | null;
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type Erc721TotalPayload = {
|
||||
token_id: string | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type Erc1155TotalPayload = {
|
||||
decimals: string | null;
|
||||
value: string;
|
||||
token_id: string | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type Erc404TotalPayload = {
|
||||
decimals: string;
|
||||
@@ -41,7 +41,7 @@ export type TokenTransfer = (
|
||||
token: TokenInfo<'ERC-404'>;
|
||||
total: Erc404TotalPayload | null;
|
||||
}
|
||||
) & TokenTransferBase
|
||||
) & TokenTransferBase;
|
||||
|
||||
export type TokenTotal = Erc20TotalPayload | Erc721TotalPayload | Erc1155TotalPayload;
|
||||
|
||||
@@ -61,7 +61,7 @@ export type TokenTransferPagination = {
|
||||
block_number: number;
|
||||
index: number;
|
||||
items_count: number;
|
||||
}
|
||||
};
|
||||
|
||||
export interface TokenTransferResponse {
|
||||
items: Array<TokenTransfer>;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ export type TokensResponse = {
|
||||
name: string;
|
||||
market_cap: string | null;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type TokensFilters = { q: string; type: Array<TokenType> | undefined };
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ export type Transaction = {
|
||||
zkevm_sequence_hash?: string;
|
||||
// zkSync FIELDS
|
||||
zksync?: Omit<ZkSyncBatchesItem, 'number' | 'transaction_count' | 'timestamp'> & {
|
||||
'batch_number': number | null;
|
||||
batch_number: number | null;
|
||||
};
|
||||
// blob tx fields
|
||||
blob_versioned_hashes?: Array<string>;
|
||||
@@ -99,7 +99,7 @@ export type Transaction = {
|
||||
// Noves-fi
|
||||
translation?: NovesTxTranslation;
|
||||
arbitrum?: ArbitrumTransactionData;
|
||||
}
|
||||
};
|
||||
|
||||
type ArbitrumTransactionData = {
|
||||
batch_number: number;
|
||||
@@ -115,7 +115,7 @@ type ArbitrumTransactionData = {
|
||||
associated_l1_transaction: string | null;
|
||||
message_status: ArbitrumMessageStatus;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type ArbitrumMessageStatus = 'Relayed' | 'Syncing with base layer' | 'Waiting for confirmation' | 'Ready for relay' | 'Settlement pending';
|
||||
|
||||
@@ -174,7 +174,7 @@ export type TransactionType = 'rootstock_remasc' |
|
||||
'contract_call' |
|
||||
'token_creation' |
|
||||
'coin_transfer' |
|
||||
'blob_transaction'
|
||||
'blob_transaction';
|
||||
|
||||
export type TxsResponse = TransactionsResponseValidated | TransactionsResponsePending | BlockTransactionsResponse;
|
||||
|
||||
|
||||
@@ -23,4 +23,4 @@ export interface TxActionNft {
|
||||
|
||||
export type TxAction = {
|
||||
protocol: 'uniswap_v3';
|
||||
} & (TxActionGeneral | TxActionNft)
|
||||
} & (TxActionGeneral | TxActionNft);
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface TxInterpretationResponse {
|
||||
export type TxInterpretationSummary = {
|
||||
summary_template: string;
|
||||
summary_template_variables: Record<string, TxInterpretationVariable>;
|
||||
}
|
||||
};
|
||||
|
||||
export type TxInterpretationVariable =
|
||||
TxInterpretationVariableString |
|
||||
@@ -26,34 +26,34 @@ export type TxInterpretationVariableType = 'string' | 'currency' | 'timestamp' |
|
||||
export type TxInterpretationVariableString = {
|
||||
type: 'string';
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type TxInterpretationVariableCurrency = {
|
||||
type: 'currency';
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type TxInterpretationVariableTimestamp = {
|
||||
type: 'timestamp';
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type TxInterpretationVariableToken = {
|
||||
type: 'token';
|
||||
value: TokenInfo;
|
||||
}
|
||||
};
|
||||
|
||||
export type TxInterpretationVariableAddress = {
|
||||
type: 'address';
|
||||
value: AddressParam;
|
||||
}
|
||||
};
|
||||
|
||||
export type TxInterpretationVariableDomain = {
|
||||
type: 'domain';
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type TxInterpretationVariableMethod = {
|
||||
type: 'method';
|
||||
value: string;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@ export type TxStateChange = (TxStateChangeCoin | TxStateChangeToken) & {
|
||||
is_miner: boolean;
|
||||
balance_before: string | null;
|
||||
balance_after: string | null;
|
||||
}
|
||||
};
|
||||
|
||||
export interface TxStateChangeCoin {
|
||||
type: 'coin';
|
||||
|
||||
@@ -2,11 +2,11 @@ export type TTxsFilters = {
|
||||
filter: 'pending' | 'validated';
|
||||
type?: Array<TypeFilter>;
|
||||
method?: Array<MethodFilter>;
|
||||
}
|
||||
};
|
||||
|
||||
export type TTxsWithBlobsFilters = {
|
||||
type: 'blob_transaction';
|
||||
}
|
||||
};
|
||||
|
||||
export type TypeFilter = 'token_transfer' | 'contract_creation' | 'contract_call' | 'coin_transfer' | 'token_creation' | 'blob_transaction';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ export type UserOpsItem = {
|
||||
timestamp: string;
|
||||
status: boolean;
|
||||
fee: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type UserOpsResponse = {
|
||||
items: Array<UserOpsItem>;
|
||||
@@ -17,7 +17,7 @@ export type UserOpsResponse = {
|
||||
page_token: string;
|
||||
page_size: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type UserOpSponsorType = 'paymaster_hybrid' | 'paymaster_sponsor' | 'wallet_balance' | 'wallet_deposit';
|
||||
|
||||
@@ -69,13 +69,13 @@ export type UserOp = {
|
||||
};
|
||||
gas_price: string;
|
||||
gas_used: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type UserOpsFilters = {
|
||||
transaction_hash?: string;
|
||||
sender?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type UserOpsAccount = {
|
||||
total_ops: number;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,10 +9,10 @@ export interface ValidatorStability {
|
||||
export interface ValidatorsStabilityResponse {
|
||||
items: Array<ValidatorStability>;
|
||||
next_page_params: {
|
||||
'address_hash': string;
|
||||
'blocks_validated': string;
|
||||
'items_count': string;
|
||||
'state': ValidatorStability['state'];
|
||||
address_hash: string;
|
||||
blocks_validated: string;
|
||||
items_count: string;
|
||||
state: ValidatorStability['state'];
|
||||
} | null;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export interface ValidatorBlackfort {
|
||||
export interface ValidatorsBlackfortResponse {
|
||||
items: Array<ValidatorBlackfort>;
|
||||
next_page_params: {
|
||||
'address_hash': string;
|
||||
address_hash: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export type WithdrawalsResponse = {
|
||||
index: number;
|
||||
items_count: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type WithdrawalsItem = {
|
||||
amount: string;
|
||||
@@ -15,9 +15,9 @@ export type WithdrawalsItem = {
|
||||
receiver: AddressParam;
|
||||
timestamp: string;
|
||||
validator_index: number;
|
||||
}
|
||||
};
|
||||
|
||||
export type WithdrawalsCounters = {
|
||||
withdrawal_count: string;
|
||||
withdrawal_sum: string;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ export type ZkEvmL2DepositsItem = {
|
||||
timestamp: string;
|
||||
value: string;
|
||||
symbol: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type ZkEvmL2DepositsResponse = {
|
||||
items: Array<ZkEvmL2DepositsItem>;
|
||||
@@ -16,7 +16,7 @@ export type ZkEvmL2DepositsResponse = {
|
||||
items_count: number;
|
||||
index: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type ZkEvmL2WithdrawalsItem = {
|
||||
block_number: number;
|
||||
@@ -26,7 +26,7 @@ export type ZkEvmL2WithdrawalsItem = {
|
||||
timestamp: string;
|
||||
value: string;
|
||||
symbol: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type ZkEvmL2WithdrawalsResponse = {
|
||||
items: Array<ZkEvmL2WithdrawalsItem>;
|
||||
@@ -34,7 +34,7 @@ export type ZkEvmL2WithdrawalsResponse = {
|
||||
items_count: number;
|
||||
index: number;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export type ZkEvmL2TxnBatchesItem = {
|
||||
number: number;
|
||||
@@ -43,7 +43,7 @@ export type ZkEvmL2TxnBatchesItem = {
|
||||
status: string;
|
||||
timestamp: string | null;
|
||||
transaction_count: number;
|
||||
}
|
||||
};
|
||||
|
||||
export type ZkEvmL2TxnBatchesResponse = {
|
||||
items: Array<ZkEvmL2TxnBatchesItem>;
|
||||
@@ -51,7 +51,7 @@ export type ZkEvmL2TxnBatchesResponse = {
|
||||
number: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export const ZKEVM_L2_TX_BATCH_STATUSES = [ 'Unfinalized', 'L1 Sequence Confirmed', 'Finalized' ];
|
||||
|
||||
@@ -65,12 +65,12 @@ export type ZkEvmL2TxnBatch = {
|
||||
timestamp: string | null;
|
||||
transactions: Array<string>;
|
||||
verify_transaction_hash: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type ZkEvmL2TxnBatchTxs = {
|
||||
items: Array<Transaction>;
|
||||
// API responce doesn't have next_page_params option, but we need to add it to the type for consistency
|
||||
next_page_params: null;
|
||||
}
|
||||
};
|
||||
|
||||
export type NewZkEvmBatchSocketResponse = { batch: ZkEvmL2TxnBatchesItem };
|
||||
|
||||
@@ -29,7 +29,7 @@ export type ZkSyncBatchesResponse = {
|
||||
number: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export interface ZkSyncBatch extends Omit<ZkSyncBatchesItem, 'transaction_count'> {
|
||||
start_block: number;
|
||||
@@ -49,4 +49,4 @@ export type ZkSyncBatchTxs = {
|
||||
index: number;
|
||||
items_count: number;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,4 +2,4 @@ export type AdButlerConfig = {
|
||||
id: string;
|
||||
width: string;
|
||||
height: string;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,4 +12,4 @@ export type CsvExportParams = {
|
||||
type: 'holders';
|
||||
filterType?: undefined;
|
||||
filterValue?: undefined;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,31 +11,31 @@ export type MarketplaceAppPreview = {
|
||||
url: string;
|
||||
internalWallet?: boolean;
|
||||
priority?: number;
|
||||
}
|
||||
};
|
||||
|
||||
export type MarketplaceAppSocialInfo = {
|
||||
twitter?: string;
|
||||
telegram?: string;
|
||||
github?: string | Array<string>;
|
||||
discord?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type MarketplaceAppOverview = MarketplaceAppPreview & MarketplaceAppSocialInfo & {
|
||||
author: string;
|
||||
description: string;
|
||||
site?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type AppRating = {
|
||||
recordId: string;
|
||||
value: number | undefined;
|
||||
count?: number;
|
||||
}
|
||||
};
|
||||
|
||||
export type MarketplaceAppWithSecurityReport = MarketplaceAppOverview & {
|
||||
securityReport?: MarketplaceAppSecurityReport;
|
||||
rating?: AppRating;
|
||||
}
|
||||
};
|
||||
|
||||
export enum MarketplaceCategory {
|
||||
ALL = 'All',
|
||||
@@ -62,11 +62,11 @@ export type MarketplaceAppSecurityReport = {
|
||||
isVerified: boolean;
|
||||
solidityScanReport?: SolidityScanReport['scan_report'] | null;
|
||||
}>;
|
||||
}
|
||||
};
|
||||
|
||||
export type MarketplaceAppSecurityReportRaw = {
|
||||
appName: string;
|
||||
chainsData: {
|
||||
[chainId: string]: MarketplaceAppSecurityReport;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,19 +17,19 @@ type NavItemCommon = {
|
||||
export type NavItemInternal = NavItemCommon & {
|
||||
nextRoute: Route;
|
||||
isActive?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
export type NavItemExternal = {
|
||||
text: string;
|
||||
url: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type NavItem = NavItemInternal | NavItemExternal
|
||||
export type NavItem = NavItemInternal | NavItemExternal;
|
||||
|
||||
export type NavGroupItem = NavItemCommon & {
|
||||
isActive?: boolean;
|
||||
subItems: Array<NavItem> | Array<Array<NavItem>>;
|
||||
}
|
||||
};
|
||||
|
||||
import type { ArrayElement } from '../utils';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export type StatsInterval = { id: StatsIntervalIds; title: string }
|
||||
export type StatsInterval = { id: StatsIntervalIds; title: string };
|
||||
export type StatsIntervalIds = keyof typeof StatsIntervalId;
|
||||
export enum StatsIntervalId {
|
||||
'all',
|
||||
'oneMonth',
|
||||
'threeMonths',
|
||||
'sixMonths',
|
||||
'oneYear',
|
||||
all,
|
||||
oneMonth,
|
||||
threeMonths,
|
||||
sixMonths,
|
||||
oneYear,
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export type CustomLink = {
|
||||
text: string;
|
||||
url: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type CustomLinksGroup = {
|
||||
title: string;
|
||||
links: Array<CustomLink>;
|
||||
}
|
||||
};
|
||||
|
||||
+4
-4
@@ -10,13 +10,13 @@ export type KeysOfObjectOrNull<T> = keyof ExcludeNull<T>;
|
||||
|
||||
/** Combines members of an intersection into a readable type. */
|
||||
// https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
||||
export type Evaluate<Type> = { [key in keyof Type]: Type[key] } & unknown
|
||||
export type Evaluate<Type> = { [key in keyof Type]: Type[key] } & unknown;
|
||||
|
||||
// Keeps in the object type only those properties that have the provided type (e.g only numbers)
|
||||
export type PickByType<T, X> = Record<
|
||||
{[K in keyof T]: T[K] extends X ? K : never}[keyof T],
|
||||
X
|
||||
{ [K in keyof T]: T[K] extends X ? K : never }[keyof T],
|
||||
X
|
||||
>;
|
||||
|
||||
// Make some properties of an object optional
|
||||
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
|
||||
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ type WalletProviderFlags =
|
||||
| 'isTrust'
|
||||
| 'isTrustWallet'
|
||||
| 'isXDEFI'
|
||||
| 'isZerion'
|
||||
| 'isZerion';
|
||||
|
||||
export type WalletProvider = Evaluate<
|
||||
EIP1193Provider & {
|
||||
@@ -62,4 +62,4 @@ EIP1193Provider & {
|
||||
}
|
||||
| undefined;
|
||||
}
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -28,7 +28,7 @@ type Props = {
|
||||
scrollRef?: React.RefObject<HTMLDivElement>;
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressAccountHistory = ({ scrollRef, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
@@ -91,13 +91,13 @@ const AddressAccountHistory = ({ scrollRef, shouldRender = true, isQueryEnabled
|
||||
<TheadSticky top={ 75 }>
|
||||
<Tr>
|
||||
<Th width="120px">
|
||||
Age
|
||||
Age
|
||||
</Th>
|
||||
<Th>
|
||||
Action
|
||||
Action
|
||||
</Th>
|
||||
<Th width="320px">
|
||||
From/To
|
||||
From/To
|
||||
</Th>
|
||||
</Tr>
|
||||
</TheadSticky>
|
||||
|
||||
@@ -21,7 +21,7 @@ import AddressCoinBalanceHistory from './coinBalance/AddressCoinBalanceHistory';
|
||||
type Props = {
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressCoinBalance = ({ shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const [ socketAlert, setSocketAlert ] = React.useState(false);
|
||||
|
||||
@@ -18,7 +18,7 @@ type Props = {
|
||||
scrollRef?: React.RefObject<HTMLDivElement>;
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressEpochRewards = ({ scrollRef, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -27,7 +27,7 @@ type Props = {
|
||||
scrollRef?: React.RefObject<HTMLDivElement>;
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
const AddressInternalTxs = ({ scrollRef, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
const isMounted = useIsMounted();
|
||||
|
||||
@@ -13,11 +13,11 @@ import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
|
||||
|
||||
import AddressCsvExportLink from './AddressCsvExportLink';
|
||||
|
||||
type Props ={
|
||||
type Props = {
|
||||
scrollRef?: React.RefObject<HTMLDivElement>;
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressLogs = ({ scrollRef, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -7,11 +7,11 @@ import AddressMudRecord from './mud/AddressMudRecord';
|
||||
import AddressMudTable from './mud/AddressMudTable';
|
||||
import AddressMudTables from './mud/AddressMudTables';
|
||||
|
||||
type Props ={
|
||||
type Props = {
|
||||
scrollRef?: React.RefObject<HTMLDivElement>;
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressMud = ({ scrollRef, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const isMounted = useIsMounted();
|
||||
|
||||
@@ -37,7 +37,7 @@ import AddressCsvExportLink from './AddressCsvExportLink';
|
||||
type Filters = {
|
||||
type: Array<TokenType>;
|
||||
filter: AddressFromToFilter | undefined;
|
||||
}
|
||||
};
|
||||
|
||||
const getTokenFilterValue = (getFilterValuesFromQuery<TokenType>).bind(null, TOKEN_TYPE_IDS);
|
||||
const getAddressFilterValue = (getFilterValueFromQuery<AddressFromToFilter>).bind(null, AddressFromToFilterValues);
|
||||
@@ -68,7 +68,7 @@ type Props = {
|
||||
isQueryEnabled?: boolean;
|
||||
// for tests only
|
||||
overloadCount?: number;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressTokenTransfers = ({ scrollRef, overloadCount = OVERLOAD_COUNT, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -46,7 +46,7 @@ const getTokenFilterValue = (getFilterValuesFromQuery<NFTTokenType>).bind(null,
|
||||
type Props = {
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressTokens = ({ shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -52,7 +52,7 @@ type Props = {
|
||||
isQueryEnabled?: boolean;
|
||||
// for tests only
|
||||
overloadCount?: number;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressTxs = ({ scrollRef, overloadCount = OVERLOAD_COUNT, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -12,7 +12,7 @@ type Props = {
|
||||
scrollRef?: React.RefObject<HTMLDivElement>;
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const AddressUserOps = ({ scrollRef, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -17,7 +17,7 @@ type Props = {
|
||||
scrollRef?: React.RefObject<HTMLDivElement>;
|
||||
shouldRender?: boolean;
|
||||
isQueryEnabled?: boolean;
|
||||
}
|
||||
};
|
||||
const AddressWithdrawals = ({ scrollRef, shouldRender = true, isQueryEnabled = true }: Props) => {
|
||||
const router = useRouter();
|
||||
const isMounted = useIsMounted();
|
||||
|
||||
@@ -37,7 +37,7 @@ const AddressAccountHistoryListItem = (props: Props) => {
|
||||
/>
|
||||
|
||||
<Text fontSize="sm" fontWeight={ 500 }>
|
||||
Action
|
||||
Action
|
||||
</Text>
|
||||
</Flex>
|
||||
<TimeAgoWithTooltip
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user