Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
a078553c
Commit
a078553c
authored
Jan 04, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] better types for tx interpretation
parent
4afed289
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
txInterpretation.ts
configs/app/features/txInterpretation.ts
+12
-2
schema.ts
deploy/tools/envs-validator/schema.ts
+2
-1
txInterpretation.ts
types/client/txInterpretation.ts
+8
-0
No files found.
configs/app/features/txInterpretation.ts
View file @
a078553c
import
type
{
Feature
}
from
'
./types
'
;
import
type
{
Provider
}
from
'
types/client/txInterpretation
'
;
import
{
PROVIDERS
}
from
'
types/client/txInterpretation
'
;
import
{
getEnvValue
}
from
'
../utils
'
;
const
title
=
'
Transaction interpretation
'
;
const
provider
=
getEnvValue
(
'
NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER
'
)
||
'
none
'
;
const
provider
:
Provider
=
(()
=>
{
const
value
=
getEnvValue
(
'
NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER
'
);
const
config
:
Feature
<
{
provider
:
string
}
>
=
(()
=>
{
if
(
value
&&
PROVIDERS
.
includes
(
value
as
Provider
))
{
return
value
as
Provider
;
}
return
'
none
'
;
})();
const
config
:
Feature
<
{
provider
:
Provider
}
>
=
(()
=>
{
if
(
provider
!==
'
none
'
)
{
return
Object
.
freeze
({
title
,
...
...
deploy/tools/envs-validator/schema.ts
View file @
a078553c
...
...
@@ -15,6 +15,7 @@ import type { MarketplaceAppOverview } from '../../../types/client/marketplace';
import
{
NAVIGATION_LINK_IDS
}
from
'
../../../types/client/navigation-items
'
;
import
type
{
NavItemExternal
,
NavigationLinkId
}
from
'
../../../types/client/navigation-items
'
;
import
type
{
BridgedTokenChain
,
TokenBridge
}
from
'
../../../types/client/token
'
;
import
{
PROVIDERS
as
TX_INTERPRETATION_PROVIDERS
}
from
'
../../../types/client/txInterpretation
'
;
import
type
{
WalletType
}
from
'
../../../types/client/wallets
'
;
import
{
SUPPORTED_WALLETS
}
from
'
../../../types/client/wallets
'
;
import
type
{
CustomLink
,
CustomLinksGroup
}
from
'
../../../types/footerLinks
'
;
...
...
@@ -438,7 +439,7 @@ const schema = yup
return
isNoneSchema
.
isValidSync
(
data
)
||
isArrayOfWalletsSchema
.
isValidSync
(
data
);
}),
NEXT_PUBLIC_WEB3_DISABLE_ADD_TOKEN_TO_WALLET
:
yup
.
boolean
(),
NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER
:
yup
.
string
().
oneOf
(
[
'
blockscout
'
,
'
none
'
]
),
NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER
:
yup
.
string
().
oneOf
(
TX_INTERPRETATION_PROVIDERS
),
NEXT_PUBLIC_AD_TEXT_PROVIDER
:
yup
.
string
<
AdTextProviders
>
().
oneOf
(
SUPPORTED_AD_TEXT_PROVIDERS
),
NEXT_PUBLIC_PROMOTE_BLOCKSCOUT_IN_TITLE
:
yup
.
boolean
(),
NEXT_PUBLIC_OG_DESCRIPTION
:
yup
.
string
(),
...
...
types/client/txInterpretation.ts
0 → 100644
View file @
a078553c
import
type
{
ArrayElement
}
from
'
types/utils
'
;
export
const
PROVIDERS
=
[
'
blockscout
'
,
'
none
'
,
]
as
const
;
export
type
Provider
=
ArrayElement
<
typeof
PROVIDERS
>
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment