-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(bridge): wagmi init * feat(bridge): implement design * feat(bridge): add processing fee mock * fix(bridge): review fixes * feat(bridge): add default case and test * fix(bridge): update test * feat(bridge): single field bridge form * fix(bridge): processing fee * feat(bridge-ui): Transactions (#372) * feat(bridge-ui): ERC20 Bridge + approval (#353) * erc20 bridge + approve + requires allowance * bridge form checks allowance, disables button * if allowance is required, show approve button instead * set allowance required to false after successful approval * requiresallowance should take approveopts, not bridgeopts * show Approve text appropriatley * Update packages/bridge-ui/src/components/form/BridgeForm.svelte Co-authored-by: David <[email protected]> * Update packages/bridge-ui/src/eth/bridge.ts Co-authored-by: David <[email protected]> * Update packages/bridge-ui/src/components/form/BridgeForm.svelte Co-authored-by: David <[email protected]> * Update packages/bridge-ui/src/components/form/BridgeForm.svelte Co-authored-by: David <[email protected]> * inverse approve logic Co-authored-by: David <[email protected]> * . * lottie player * update lockfile Co-authored-by: David <[email protected]> * feat: add chain selector * make ETH/TKO use ts * ignore components folder * inline block avatar * switch ethereum chain, chain navbar selection, default store values, label changing, modal * test coverage for switchEthereumChain * list * readapt bridge form to work * text * feat(bridge): switch chain modal styles * fix(bridge): chain dropdown styles * tests * rpc urls + reactive balanes * import type * cli test Co-authored-by: jeff <[email protected]> Co-authored-by: David <[email protected]> Co-authored-by: Jeffery Walsh <[email protected]>
- Loading branch information
1 parent
a546ee9
commit 04702db
Showing
48 changed files
with
1,234 additions
and
2,192 deletions.
There are no files selected for viewing
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,46 @@ | ||
.btn.btn-wide { | ||
width: 194px; | ||
height: 56px; | ||
} | ||
|
||
.btn.btn-token-select { | ||
width: 140px; | ||
height: 60px; | ||
} | ||
|
||
.btn.btn-square { | ||
border-radius: 4px; | ||
} | ||
|
||
/* Invert accent button colors */ | ||
.btn.btn-accent { | ||
background-color: hsla(var(--af) / var(--tw-bg-opacity, 1)); | ||
border-color: hsla(var(--af) / var(--tw-bg-opacity, 1)); | ||
height: 60px; | ||
} | ||
|
||
.btn.btn-accent:hover { | ||
background-color: hsla(var(--a) / var(--tw-bg-opacity, 1)); | ||
border-color: hsla(var(--a) / var(--tw-bg-opacity, 1)); | ||
} | ||
|
||
.dropdown .dropdown-content { | ||
border-radius: 0 0 var(--rounded-box) var(--rounded-box); | ||
} | ||
|
||
.input-group .input.input-primary { | ||
border-radius: 0.5rem; | ||
} | ||
|
||
.form-control .input-group :first-child { | ||
border-radius: 0.5rem; | ||
} | ||
|
||
.form-control .input-group :last-child { | ||
border-radius: 0.5rem; | ||
} | ||
|
||
.taiko-banner { | ||
background-image: url('assets/taiko-banner.svg'); | ||
background-repeat: no-repeat; | ||
} |
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 @@ | ||
{"nm":"Comp 1","mn":"","layers":[{"ty":4,"nm":"Shape Layer 2","mn":"","sr":1,"st":0,"op":300,"ip":0,"hd":false,"cl":"","ln":"","ddd":0,"bm":0,"tt":0,"hasMask":false,"td":0,"ao":0,"ks":{"a":{"a":0,"k":[-22.637,19.301,0],"ix":1},"s":{"a":0,"k":[33.33333333333334,33.33333333333334,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100.02066666666668,100.00000000000003,0],"ix":2},"sa":{"a":0,"k":0},"o":{"a":0,"k":80,"ix":11},"r":{"a":1,"k":[{"o":{"x":0.472,"y":0.326},"i":{"x":0.526,"y":0.673},"s":[0],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[183],"t":60}],"ix":10}},"ef":[],"shapes":[{"ty":"gr","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[368.602,368.602],"ix":2}},{"ty":"st","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":49,"ix":5},"d":[],"c":{"a":0,"k":[0.9882,0.0588,0.7529],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[-22.699,19.301],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tm","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Filter - Trim","nm":"Trim Paths 1","ix":2,"e":{"a":1,"k":[{"o":{"x":0.559,"y":0},"i":{"x":0.504,"y":1},"s":[1],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[50],"t":30}],"ix":2},"o":{"a":0,"k":0,"ix":3},"s":{"a":1,"k":[{"o":{"x":0.579,"y":0},"i":{"x":0.438,"y":1},"s":[0],"t":30},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[49],"t":60}],"ix":1},"m":1}],"ind":0},{"ty":4,"nm":"Shape Layer 1","mn":"","sr":1,"st":0,"op":300,"ip":0,"hd":false,"cl":"","ln":"","ddd":0,"bm":0,"tt":0,"hasMask":false,"td":0,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[33.33333333333334,33.33333333333334,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[107.56633333333339,93.56633333333338,0],"ix":2},"sa":{"a":0,"k":0},"o":{"a":0,"k":10,"ix":11},"r":{"a":0,"k":0,"ix":10}},"ef":[],"shapes":[{"ty":"gr","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[368.602,368.602],"ix":2}},{"ty":"st","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":49,"ix":5},"d":[],"c":{"a":0,"k":[0.698,0.0588,0.5373],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[-22.699,19.301],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1}],"ddd":0,"h":200,"w":200,"meta":{"a":"","k":"","d":"","g":"@lottiefiles/toolkit-js 0.17.3","tc":"#ffffff"},"v":"5.5.0","fr":30,"op":60,"ip":0,"assets":[]} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<script lang="ts"> | ||
import { _ } from "svelte-i18n"; | ||
import ChevDown from "./icons/ChevDown.svelte"; | ||
import { fromChain } from "../store/chain"; | ||
import MetaMask from "./icons/MetaMask.svelte"; | ||
import { switchEthereumChain } from "../utils/switchEthereumChain"; | ||
import { ethereum } from "../store/ethereum"; | ||
import { CHAIN_MAINNET, CHAIN_TKO } from "../domain/chain"; | ||
import type { Chain } from "../domain/chain"; | ||
import { ethers } from "ethers"; | ||
import { signer } from "../store/signer"; | ||
const changeChain = async (chain: Chain) => { | ||
await switchEthereumChain($ethereum, chain); | ||
const provider = new ethers.providers.Web3Provider(window.ethereum); | ||
await provider.send("eth_requestAccounts", []); | ||
signer.set(provider.getSigner()); | ||
}; | ||
</script> | ||
|
||
<div class="dropdown dropdown-bottom mr-4"> | ||
<button tabindex="0" class="btn btn-wide justify-around"> | ||
<span class="font-normal flex-1 text-left"> | ||
{#if $fromChain} | ||
<svelte:component this={$fromChain.icon} /> | ||
<span class="ml-2">{$fromChain.name}</span> | ||
{:else} | ||
<span class="ml-2">Invalid Chain</span> | ||
{/if} | ||
</span> | ||
|
||
<ChevDown /> | ||
</button> | ||
<ul | ||
tabindex="0" | ||
class="dropdown-content flex menu p-2 shadow bg-dark-3 rounded-box w-[194px]" | ||
> | ||
<li> | ||
<button | ||
class="flex items-center px-2 py-4 hover:bg-dark-5 rounded-xl justify-around" | ||
on:click={async () => { | ||
await changeChain(CHAIN_MAINNET); | ||
}} | ||
> | ||
<svelte:component this={CHAIN_MAINNET.icon} height={24} /> | ||
<span class="pl-1.5 text-left flex-1">{CHAIN_MAINNET.name}</span> | ||
<MetaMask /> | ||
</button> | ||
</li> | ||
<li> | ||
<button | ||
class="flex items-center px-2 py-4 hover:bg-dark-5 rounded-xl justify-around" | ||
on:click={async () => { | ||
await changeChain(CHAIN_TKO); | ||
}} | ||
> | ||
<svelte:component this={CHAIN_TKO.icon} height={24} /> | ||
<span class="pl-1.5 text-left flex-1">{CHAIN_TKO.name}</span> | ||
<MetaMask /> | ||
</button> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<style> | ||
.menu li > span { | ||
padding-left: 0px; | ||
} | ||
</style> |
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 |
---|---|---|
@@ -1,19 +1,41 @@ | ||
<script> | ||
<script lang="ts"> | ||
import Connect from "./buttons/Connect.svelte"; | ||
import Logo from "./icons/Logo.svelte"; | ||
import { signer } from "../store/signer"; | ||
import AddressDropdown from "./AddressDropdown.svelte"; | ||
import type { | ||
BridgeTransaction, | ||
Transactioner, | ||
} from "../domain/transactions"; | ||
import type { Signer } from "ethers"; | ||
import { fromChain } from "../store/chain"; | ||
import ChainDropdown from "./ChainDropdown.svelte"; | ||
import type { Chain } from "../domain/chain"; | ||
export let transactioner: Transactioner; | ||
let transactions: BridgeTransaction[]; | ||
$: getTransactions($signer, $fromChain); | ||
async function getTransactions(signer: Signer, chain: Chain) { | ||
if (!signer || !chain) return; | ||
transactions = await transactioner.GetAllByAddress( | ||
await signer.getAddress(), | ||
chain.id | ||
); | ||
} | ||
</script> | ||
|
||
<div class="navbar bg-base-100"> | ||
<div class="flex-1"> | ||
<nav class="navbar h-[125px] py-8 px-32"> | ||
<div class="navbar-end justify-start"> | ||
<Logo /> | ||
</div> | ||
<div class="flex-none"> | ||
<div class="navbar-end"> | ||
{#if $signer} | ||
<AddressDropdown /> | ||
<ChainDropdown /> | ||
<AddressDropdown {transactions} /> | ||
{:else} | ||
<Connect /> | ||
{/if} | ||
</div> | ||
</div> | ||
</nav> |
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,11 @@ | ||
<script> | ||
import { _ } from "svelte-i18n"; | ||
import SelectChain from "./form/SelectChain.svelte"; | ||
</script> | ||
|
||
<div class="taiko-banner bg-cover bg-center bg-no-repeat w-full h-36 rounded-lg py-4 flex flex-col items-center justify-center"> | ||
<h1 class="text-2xl font-bold"> | ||
{$_("home.title")} | ||
</h1> | ||
<SelectChain /> | ||
</div> |
Oops, something went wrong.