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
0363113c
Commit
0363113c
authored
Jan 11, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proper config of WalletConnect
parent
9674f49e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
13 deletions
+25
-13
Dockerfile
Dockerfile
+1
-0
getCspPolicy.ts
lib/csp/getCspPolicy.ts
+3
-0
AddressContract.tsx
ui/address/AddressContract.tsx
+21
-13
No files found.
Dockerfile
View file @
0363113c
...
...
@@ -6,6 +6,7 @@ WORKDIR /app
# Install dependencies based on the preferred package manager
COPY
package.json yarn.lock ./
RUN
apk add git
RUN
yarn
--frozen-lockfile
# Rebuild the source code only when needed
...
...
lib/csp/getCspPolicy.ts
View file @
0363113c
...
...
@@ -68,6 +68,9 @@ function makePolicyMap() {
appConfig
.
api
.
socket
,
appConfig
.
statsApi
.
endpoint
,
// chain RPC server
appConfig
.
network
.
rpcUrl
,
// ad
'
request-global.czilladx.com
'
,
...
...
ui/address/AddressContract.tsx
View file @
0363113c
import
{
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
useColorModeValue
,
useToken
}
from
'
@chakra-ui/react
'
;
import
{
EthereumClient
,
modalConnectors
,
...
...
@@ -11,6 +11,7 @@ import { configureChains, createClient, WagmiConfig } from 'wagmi';
import
type
{
RoutedSubTab
}
from
'
ui/shared/RoutedTabs/types
'
;
import
appConfig
from
'
configs/app/config
'
;
import
{
ContractContextProvider
}
from
'
ui/address/contract/context
'
;
import
RoutedTabs
from
'
ui/shared/RoutedTabs/RoutedTabs
'
;
...
...
@@ -22,27 +23,32 @@ const TAB_LIST_PROPS = {
columnGap
:
3
,
};
export
const
poa
:
Chain
=
{
id
:
99
,
name
:
'
POA
'
,
network
:
'
poa
'
,
export
const
currentChain
:
Chain
=
{
id
:
Number
(
appConfig
.
network
.
id
)
,
name
:
appConfig
.
network
.
name
||
'
'
,
network
:
appConfig
.
network
.
name
||
'
'
,
nativeCurrency
:
{
decimals
:
18
,
name
:
'
POA
'
,
symbol
:
'
POA
'
,
decimals
:
appConfig
.
network
.
currency
.
decimals
,
name
:
appConfig
.
network
.
currency
.
name
||
'
'
,
symbol
:
appConfig
.
network
.
currency
.
symbol
||
'
'
,
},
rpcUrls
:
{
'
default
'
:
{
http
:
[
'
https://core.poa.network
'
]
},
'
default
'
:
{
http
:
[
appConfig
.
network
.
rpcUrl
||
''
],
},
},
blockExplorers
:
{
'
default
'
:
{
name
:
'
Blockscout
'
,
url
:
'
https://blockscout.com/poa/core
'
},
'
default
'
:
{
name
:
'
Blockscout
'
,
url
:
appConfig
.
baseUrl
,
},
},
};
const
chains
=
[
poa
];
const
chains
=
[
currentChain
];
const
PROJECT_ID
=
'
b4ed81be141093911032944632465175
'
;
// Wagmi client
const
{
provider
}
=
configureChains
(
chains
,
[
walletConnectProvider
({
projectId
:
PROJECT_ID
}),
]);
...
...
@@ -56,6 +62,8 @@ const wagmiClient = createClient({
const
ethereumClient
=
new
EthereumClient
(
wagmiClient
,
chains
);
const
AddressContract
=
({
tabs
}:
Props
)
=>
{
const
modalZIndex
=
useToken
<
string
>
(
'
zIndices
'
,
'
modal
'
);
return
(
<
WagmiConfig
client=
{
wagmiClient
}
>
<
ContractContextProvider
>
...
...
@@ -64,7 +72,7 @@ const AddressContract = ({ tabs }: Props) => {
<
Web3Modal
projectId=
{
PROJECT_ID
}
ethereumClient=
{
ethereumClient
}
themeZIndex=
{
1200
}
themeZIndex=
{
Number
(
modalZIndex
)
}
themeMode=
{
useColorModeValue
(
'
light
'
,
'
dark
'
)
}
themeBackground=
"themeColor"
/>
...
...
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