-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Svelte kit #7
base: main
Are you sure you want to change the base?
Svelte kit #7
Changes from 2 commits
ceff822
5699b46
d351f71
d9d07e5
d03f583
e2072b5
e977bc8
c88f871
9bdef40
42461e5
962a453
d93615a
257c58e
40adce8
0463352
1e56b21
f3d64e1
4efebce
48a623b
04385a0
b32578c
2fd15b4
2d90d67
12a71dc
68e2fd3
34909b1
fa60d50
6c0bf43
af98ce2
3fdcb0e
ac34993
d00f886
0664fda
4e03eb8
8de489c
9a06c0f
17a4bab
8cb4534
70ef0a2
e106237
3185cdd
02f1c9f
7baa4cf
23b5160
dc47301
b7c81fb
a7bcbae
56f75f9
54bdffb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
VITE_CHAIN_ID=42 | ||
VITE_JSON_RPC_PROVIDER_URL=http://127.0.0.1:8545 | ||
VITE_REN_POOL=0xbF115A5538290D234fA31e917241a58A20a847Bc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
VITE_CHAIN_ID=1 | ||
VITE_JSON_RPC_PROVIDER_URL=https://eth-mainnet.alchemyapi.io/v2/4qQo8naBUQPUU4UWex6jJupYRxlfIdxl | ||
VITE_REN_POOL=0xf1e98770ab8ed1364371B8c7DBdA56633F7cB6a9 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
VITE_CHAIN_ID=1 | ||
VITE_JSON_RPC_PROVIDER_URL=http://localhost:8545 | ||
VITE_REN_POOL=0xf1e98770ab8ed1364371B8c7DBdA56633F7cB6a9 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<script context="module" lang="ts"> | ||
export const config = { renToken: "", renPool: "" }; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import { NETWORK } from "./config"; | ||
import EtherscanLink from "./EtherscanLink.svelte"; | ||
|
||
/** | ||
|
@@ -33,13 +36,12 @@ | |
<tr> | ||
<td class="key">RenToken</td> | ||
<td class="value" | ||
><EtherscanLink address={NETWORK.contracts.REN_TOKEN} /></td | ||
><EtherscanLink address={config.renToken} /></td | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in order to avoid repeating this
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeap, we can do this as well. |
||
> | ||
</tr> | ||
<tr> | ||
<td class="key">RenPool</td> | ||
<td class="value" | ||
><EtherscanLink address={NETWORK.contracts.REN_POOL} /></td | ||
<td class="value"><EtherscanLink address={config.renPool} /></td | ||
> | ||
</tr> | ||
<tr> | ||
|
@@ -52,7 +54,6 @@ | |
</tr> | ||
</tbody> | ||
</table> | ||
|
||
</section> | ||
|
||
<style lang="postcss"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<script lang="ts"> | ||
import { NETWORK } from "./config"; | ||
<script context="module" lang="ts"> | ||
export const config: { | ||
etherscan: string | null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, I think this component should not depend on the context. Probably the only component that should depend on the context is the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not here. The I wouldn't use |
||
} = { etherscan: null }; | ||
</script> | ||
|
||
<script lang="ts"> | ||
export let address: string; | ||
</script> | ||
|
||
<a href="{NETWORK.etherscan}{address}" target="_blank" rel="noreferrer"> | ||
<a href="{config.etherscan}{address}" target="_blank" rel="noreferrer"> | ||
{address} | ||
</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this component should depend on the context, maybe we could just remove the context and expose a prop called
addresses
:Then, from the parent component you'd pass:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, we can do that.