File tree Expand file tree Collapse file tree 15 files changed +227
-168
lines changed Expand file tree Collapse file tree 15 files changed +227
-168
lines changed Original file line number Diff line number Diff line change 22
22
"devDependencies" : {
23
23
"@rollup/plugin-commonjs" : " ^21.0.1" ,
24
24
"@rollup/plugin-node-resolve" : " ^13.0.6" ,
25
+ "@rollup/plugin-replace" : " ^6.0.2" ,
25
26
"ethers" : " ^5.5.1" ,
26
27
"rollup" : " ^2.58.0" ,
27
28
"rollup-plugin-copy" : " ^3.4.0" ,
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import css from 'rollup-plugin-css-only';
7
7
import copy from 'rollup-plugin-copy' ;
8
8
import gzipPlugin from 'rollup-plugin-gzip' ;
9
9
import { brotliCompressSync } from 'zlib' ;
10
+ import replace from '@rollup/plugin-replace' ;
10
11
11
12
const production = ! process . env . ROLLUP_WATCH ;
12
13
const hash = String ( require ( 'child_process' ) . execSync ( 'git rev-parse --short HEAD' ) ) . trim ( ) ; // append short git commit to bundles
@@ -48,6 +49,12 @@ export default {
48
49
}
49
50
} ) ,
50
51
52
+ replace ( {
53
+ preventAssignment : true ,
54
+ 'process.env.DEFAULT_CHAIN_ID' : process . env . DEFAULT_CHAIN_ID || 31338 ,
55
+ 'process.env.DEFAULT_RPC_URL' : JSON . stringify ( process . env . DEFAULT_RPC_URL || 'http://localhost:8555' ) ,
56
+ } ) ,
57
+
51
58
production && gzipPlugin ( ) ,
52
59
production && gzipPlugin ( {
53
60
customCompression : content =>
Original file line number Diff line number Diff line change 116
116
117
117
</style >
118
118
119
- <div class =' notice' >PLEASE DO NOT USE THIS WEBSITE. A new version of CAP is now available. Check it out <a href =' https://cap.io' >here</a >.</div >
120
-
121
119
<Modals />
122
120
<Toasts />
123
121
Original file line number Diff line number Diff line change 287
287
288
288
</div >
289
289
290
- {#if ! $address }
291
- <div class ='note' >CAP is an open protocol to trade crypto perpetuals with low fees. <a data-intercept ="true" on:click ={() => {showModal (' Connect' )}}>Connect your wallet</a > on Arbitrum to get started.</div >
292
- {:else if $address && balance * 1 == 0 }
293
- <div class =' note' ><a href =' https://docs.cap.finance/setting-up-your-wallet' target =' _blank' >Bridge funds</a > to Arbitrum to start trading.</div >
294
- {/if }
295
-
296
-
297
290
</div >
Original file line number Diff line number Diff line change 11
11
12
12
import { shortAddress , showModal } from ' ../lib/utils'
13
13
14
+ import {CHAINDATA } from ' ../lib/constants'
15
+
14
16
onMount (async () => {
15
17
await checkMetamaskSession ();
16
18
});
17
19
20
+ // TODO (autonom): Find another solution when we support multiple L2 chains
21
+ const DEFAULT_CHAIN_ID = Number (process .env .DEFAULT_CHAIN_ID );
22
+ const CHAIN_NAME = CHAINDATA [DEFAULT_CHAIN_ID ]? .name ;
23
+
18
24
< / script>
19
25
20
26
< style>
56
62
< div class = ' wallet' >
57
63
58
64
{#if $address && $wrongNetwork}
59
- <div class ='wrong-network' on:click ={() => {switchChains ()}}>Switch to Arbitrum </div >
65
+ < div class = ' wrong-network' on: click= {() => {switchChains ()}}> Switch to { CHAIN_NAME } < / div>
60
66
{/ if }
61
67
62
68
{#if $address}
Original file line number Diff line number Diff line change 83
83
<div class ='inner' class:home ={! $currentPage || $currentPage == ' home' }>
84
84
85
85
<div class =' left' >
86
- <a class ='logo' class:active ={! $currentPage || $currentPage == ' home' } href =' /' >
87
- <img src =' /logos/CAP.svg' title =' CAP Home' alt =' CAP Home' />
88
- </a >
86
+ <!-- TODO (autonom): add Autonom logo here -->
89
87
<a class ='link' class:active ={$currentPage == ' trade' } href =' #/trade' >Trade</a >
90
88
<a class ='link' class:active ={$currentPage == ' pool' } href =' #/pool' >Pool</a >
91
- <a class =' link' href =' https://docs.cap.finance' target =' _blank' >Docs</a >
92
89
</div >
93
90
94
91
<div class =' right' >
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import Modal from ' ../modals/Modal.svelte'
3
- import { connectMetamask , connectWalletConnect } from ' ../../lib/wallet'
3
+ import { connectMetamask } from ' ../../lib/wallet'
4
4
5
5
</script >
6
6
50
50
<div >MetaMask</div >
51
51
</div >
52
52
53
- <div class ='row' on:click ={() => {connectWalletConnect ()}} data-intercept =" true" >
54
- <img src =' https://raw.githubusercontent.com/WalletConnect/walletconnect-assets/master/Icon/Blue%20(Default)/Icon.svg' >
55
- <div >WalletConnect</div >
56
- </div >
57
-
58
53
</Modal >
Original file line number Diff line number Diff line change 3
3
import Button from ' ../layout/Button.svelte'
4
4
5
5
import { switchChains } from ' ../../lib/wallet'
6
+
7
+ import {CHAINDATA } from ' ../../lib/constants'
8
+
9
+ // TODO (autonom): Find another solution when we support multiple L2 chains
10
+ const DEFAULT_CHAIN_ID = Number (process .env .DEFAULT_CHAIN_ID );
11
+ const CHAIN_NAME = CHAINDATA [DEFAULT_CHAIN_ID ]? .name ;
6
12
< / script>
7
13
8
14
< style>
17
23
< Modal title= ' Invalid Network' showHeader= {true } showCancel= {true }>
18
24
19
25
< div class = ' note' >
20
- Select Arbitrum as your wallet's network to trade or pool on CAP.
26
+ Select { CHAIN_NAME } as your wallet' s network to trade or pool on CAP.
21
27
</div>
22
28
23
- <Button wrap ={true } onClick ={() => {switchChains ()}} label ={` Switch to Arbitrum ` } />
29
+ <Button wrap={true} onClick={() => {switchChains()}} label={`Switch to ${CHAIN_NAME} `} />
24
30
25
31
</Modal>
Original file line number Diff line number Diff line change 26
26
grid-template-rows : calc (var (--ticker-height ) + var (--chart-resolution-height ) + var (--chart-height ) + 3 * var (--grid-gap )) auto ;
27
27
background-color : var (--rich-black-fogra );
28
28
position : absolute ;
29
- top : calc (var (--header-height ) + var (--grid-gap ) + 44 px );
29
+ top : calc (var (--header-height ) + var (--grid-gap ));
30
30
bottom : 0 ;
31
31
left : 0 ;
32
32
right : 0 ;
You can’t perform that action at this time.
0 commit comments