Skip to content
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

Mainnet #26

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
VITE_TEZOS_NETWORK_NAME = 'ghostnet'
VITE_SMART_ROLLUP_ADDRESS = 'sr18wx6ezkeRjt1SZSeZ2UQzQN3Uc3YLMLqg'
VITE_SMART_ROLLUP_NODE_URL = 'http://34.65.5.184:8932'
VITE_ETHERLINK_RPC = 'https://node.ghostnet.etherlink.com'
VITE_ETHERLINK_CHAIN_ID = 128123
VITE_ETHERLINK_EXPLORER = 'https://testnet.explorer.etherlink.com'
VITE_SDK_URL = 'https://etherlink-bridge-ghostnet.dipdup.net'
VITE_SDK_WSS = 'wss://etherlink-bridge-ghostnet.dipdup.net'
VITE_TEZOS_NETWORK_NAME = 'mainnet'
VITE_SMART_ROLLUP_ADDRESS = 'sr1Ghq66tYK9y3r8CC1Tf8i8m5nxh8nTvZEf'
VITE_ETHERLINK_RPC = 'https://node.mainnet.etherlink.com'
VITE_ETHERLINK_CHAIN_ID = 42793
VITE_ETHERLINK_EXPLORER = 'https://explorer.etherlink.com'
VITE_SDK_URL = 'https://bridge.indexer.etherlink.com'
VITE_SDK_WSS = 'wss://bridge.indexer.etherlink.com'
VITE_WALLET_CONNECT_PROJECT_ID = 734c08921b9f4f202d6b63a45fb0d800
36 changes: 26 additions & 10 deletions src/components/TokenSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import { computed, watchEffect } from "vue"
import { storeToRefs } from "pinia"

/** Components */
import { amountToString } from "../services/utils/index.js"
import { Dropdown, DropdownItem } from "@/components/ui/Dropdown"

/** Services */
import TokenBridgeService from "@/services/tokenBridge"
const { tokenBridge } = TokenBridgeService.instances
Expand All @@ -17,11 +21,6 @@ const {
etherlinkTokens,
} = storeToRefs(tokensStore)

/** Components */
import { Dropdown, DropdownItem } from "@/components/ui/Dropdown"
import { amountToString } from "../services/utils/index.js"


const props = defineProps({
chain: {
type: String,
Expand Down Expand Up @@ -56,16 +55,22 @@ watchEffect(() => {
})

const dropdownItems = computed(() => {
let items = []
switch (props.chain) {
case 'tezos':
return tezosTokens.value.filter(token => token?.ticker !== selectedToken.value?.ticker)
items = tezosTokens.value.filter(token => token?.ticker !== selectedToken.value?.ticker)
case 'etherlink':
return etherlinkTokens.value.filter(token => token?.ticker !== selectedToken.value?.ticker)
items = etherlinkTokens.value.filter(token => token?.ticker !== selectedToken.value?.ticker)
default:
break;
}
})

if (!items.length) {
items.push("Additional tokens are being bridged soon..")
}

return items
})
</script>

<template>
Expand All @@ -86,8 +91,8 @@ const dropdownItems = computed(() => {
</Flex>
</template>
<template #popup>
<DropdownItem v-for="item in dropdownItems" @click="selectedToken = item">
<Flex align="center" gap="6" wide>
<DropdownItem v-for="item in dropdownItems" @click="selectedToken = item" :class="!dropdownItems[0].ticker && $style.plug">
<Flex v-if="item.ticker" align="center" gap="6" wide>
<img width="20" height="20" :src="loadImage(item.icon)" :class="$style.img" alt="" />
<Flex align="center" justify="between" gap="24" wide>
<Flex direction="column" gap="2">
Expand All @@ -100,6 +105,9 @@ const dropdownItems = computed(() => {
</Text>
</Flex>
</Flex>
<Flex v-else>
<Text size="13" color="tertiary" :style="{textAlign: 'center', lineHeight: '1.4'}"> {{ item }} </Text>
</Flex>
</DropdownItem>
</template>
</Dropdown>
Expand Down Expand Up @@ -128,6 +136,14 @@ const dropdownItems = computed(() => {
}
}

.plug {
width: 150px;
white-space: wrap;

cursor: default;
pointer-events: none;
}

.img {
border-radius: 50%;
}
Expand Down
4 changes: 2 additions & 2 deletions src/services/cfg/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export const config = {
},
etherlink: {
network: {
name: "Etherlink Testnet",
displayName: "Etherlink Testnet",
name: "Etherlink",
displayName: "Etherlink",
chainId: Number(import.meta.env.VITE_ETHERLINK_CHAIN_ID),
nativeCurrency: {
name: "XTZ",
Expand Down
84 changes: 1 addition & 83 deletions src/services/cfg/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const tokenPairs = [
ticker: "XTZ",
decimals: 6,
icon: "xtz",
ticketHelperContractAddress: "KT1VEjeQfDBSfpDH5WeBM5LukHPGM2htYEh3",
ticketHelperContractAddress: "KT1Wj8SUGmnEPFqyahHAcjcNQwe6YGhEXJb5",
},
etherlink: {
type: "native",
Expand All @@ -17,88 +17,6 @@ export const tokenPairs = [
decimals: 18,
icon: "xtz",
},
},
{
tezos: {
type: "fa1.2",
name: "tzBTC",
ticker: "tzBTC",
address: "KT1HmyazXfKDbo8XjwtWPXcoyHcmNPDCvZyb",
decimals: 8,
icon: "tzbtc",
ticketerContractAddress: "KT1H7if3gSZE1pZSK48W3NzGpKmbWyBxWDHe",
ticketHelperContractAddress: "KT1KUAaaRMeMS5TJJyGTQJANcpSR4egvHBUk",
},
etherlink: {
type: "erc20",
name: "tzBTC",
ticker: "tzBTC",
address: "0x8e73aE3CF688Fbd8368c99520d26F9eF1B4d3BCa",
decimals: 8,
icon: "tzbtc",
},
},
{
tezos: {
type: "fa1.2",
name: "Sirius",
ticker: "SIRS",
address: "KT1TCTpXXbpnWBZ8whqExokbKfUrUW3nAXDJ",
decimals: 0,
icon: "sirs",
ticketerContractAddress: "KT1Cw8WZLp4XUPLrDWUjwwpShzCRqzRByyVh",
ticketHelperContractAddress: "KT1DSy9C2dBRDYPCHuBVaYYDQPjhprcSA9eL",
},
etherlink: {
type: "erc20",
name: "Sirius",
ticker: "SIRS",
address: "0xbaA233e2f62f45e9D91Dacd3D6C6A57Bc2CBc575",
decimals: 0,
icon: "sirs",
},
},
{
tezos: {
type: "fa2",
name: "Tether USD",
ticker: "USDt",
address: "KT1V2ak1MfNd3w4oyKD64ehYU7K4CrpUcDGR",
tokenId: "0",
decimals: 6,
icon: "usdt",
ticketerContractAddress: "KT1S6Nf9MnafAgSUWLKcsySPNFLUxxqSkQCw",
ticketHelperContractAddress: "KT1JLZe4qTa76y6Us2aDoRNUgZyssSDUr6F5",
},
etherlink: {
type: "erc20",
name: "Tether USD",
ticker: "USDt",
address: "0xf68997eCC03751cb99B5B36712B213f11342452b",
decimals: 6,
icon: "usdt",
},
},
{
tezos: {
type: "fa2",
name: "youves YOU Governance",
ticker: "YOU",
address: "KT1VyYTej9iHeAfpCKBEdpqiKaHAk4hUN7h8",
tokenId: "0",
decimals: 12,
icon: "you",
ticketerContractAddress: "KT1DjH84P98gKFptqiAevj1qoKqxrTaG1T7i",
ticketHelperContractAddress: "KT1HV4o5WnnJ6QEPWqck9Lk3vQakcUD89qc8",
},
etherlink: {
type: "erc20",
name: "YOU",
ticker: "YOU",
address: "0x59118D19848bAca5C3Dd1603acfC99C4cbcCC3db",
decimals: 12,
icon: "you",
},
}
]

Expand Down