-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6beead
commit 658cb21
Showing
41 changed files
with
1,965 additions
and
1,265 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { computed } from 'vue' | ||
import { useRouteParams } from '@vueuse/router' | ||
|
||
export default function useBTCPool() { | ||
const pairStr = useRouteParams<string>('pair') | ||
if (!pairStr.value) { | ||
pairStr.value = `BTC-WBTC` | ||
} | ||
|
||
const token1 = computed(() => pairStr.value.split('-')[0]) | ||
const token2 = computed(() => pairStr.value.split('-')[1]) | ||
|
||
return { | ||
pairStr, | ||
token1, | ||
token2, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { ref } from 'vue' | ||
import useBTCPool from './useBTCPool' | ||
import { useRouter } from 'vue-router' | ||
import { toast } from '@/components/ui/toast' | ||
import { useRouteParams } from '@vueuse/router' | ||
|
||
const router = useRouter() | ||
|
||
export default function useBridgePool() { | ||
const protocol = useRouteParams<string>('protocol') | ||
console.log('protocol', protocol.value) | ||
|
||
if (!protocol.value) { | ||
protocol.value = 'BTC' | ||
} | ||
|
||
if (protocol.value === 'BTC') { | ||
return { ...useBTCPool(), protocol } | ||
} else { | ||
toast({ toastType: 'warning', title: 'Unsupported protocol type.' }) | ||
// FIXME: go undefined | ||
router.go(-1) | ||
} | ||
|
||
return { token1: ref(''), token2: ref(''), protocol } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.