Skip to content

Commit e573a9f

Browse files
committed
Connect to web3 wallet
Resolves #3820
1 parent da2fb44 commit e573a9f

File tree

10 files changed

+49
-7
lines changed

10 files changed

+49
-7
lines changed

web-wallet/src/lib/components/ApproveMigration/ApproveMigration.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import { createEventDispatcher } from "svelte";
88
import { Button, Icon } from "$lib/dusk/components";
99
import { Banner } from "$lib/components";
10-
import { account, wagmiConfig } from "$lib/migration/walletConnection";
11-
import { allowance, approve } from "$lib/migration/migration";
10+
import { account, wagmiConfig } from "$lib/web3/walletConnection";
11+
import { allowance, approve } from "$lib/web3/migration";
1212
import { createDataStore } from "$lib/dusk/svelte-stores";
1313
1414
/** @type {bigint} */

web-wallet/src/lib/components/ExecuteMigration/ExecuteMigration.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import { isHex } from "viem";
1111
import { AppAnchor, Banner } from "$lib/components";
1212
import { Button, Icon } from "$lib/dusk/components";
13-
import { account, wagmiConfig } from "$lib/migration/walletConnection";
14-
import { migrate } from "$lib/migration/migration";
13+
import { account, wagmiConfig } from "$lib/web3/walletConnection";
14+
import { migrate } from "$lib/web3/migration";
1515
import { createDataStore } from "$lib/dusk/svelte-stores";
1616
import { createEventDispatcher } from "svelte";
1717
import { walletStore } from "$lib/stores";

web-wallet/src/lib/containers/BridgeContract/BridgeContract.svelte

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<script>
44
import { mdiHistory } from "@mdi/js";
55
6-
import { Icon } from "$lib/dusk/components";
6+
import { account, modal } from "$lib/web3/walletConnection";
7+
import { Button, Icon } from "$lib/dusk/components";
8+
9+
$: ({ isConnected } = $account);
710
</script>
811

912
<article class="bridge">
@@ -13,6 +16,12 @@
1316
<Icon path={mdiHistory} />
1417
</div>
1518
</header>
19+
20+
{#if !isConnected}
21+
<Button text="CONNECT WALLET" on:click={() => modal.open()} />
22+
{:else}
23+
<Button text="BRIDGE FUNDS" on:click={() => {}} />
24+
{/if}
1625
</article>
1726

1827
<style lang="postcss">
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { bsc, mainnet, sepolia } from "viem/chains";
2+
3+
/** @type {Tokens} */
4+
export const tokens = {
5+
mainnet: {
6+
"BEP-20": {
7+
chainId: bsc.id,
8+
migrationContract: "0x32979f040feb67a5223acb0716fe4c7a5956488c",
9+
name: "BEP-20",
10+
tokenContract: "0xb2bd0749dbe21f623d9baba856d3b0f0e1bfec9c",
11+
},
12+
"ERC-20": {
13+
chainId: mainnet.id,
14+
migrationContract: "0x36b8e0b938c0172c20e14cc32e7f0e51dcf1084f",
15+
name: "ERC-20",
16+
tokenContract: "0x940a2db1b7008b6c776d4faaca729d6d4a4aa551",
17+
},
18+
},
19+
testnet: {
20+
"BEP-20": {
21+
chainId: sepolia.id,
22+
migrationContract: "0x1Bb81fbd735854Ed901aD7Aa1f5F72F64E5841Fc",
23+
name: "BEP-20",
24+
tokenContract: "0xC416f5d2AE6BAec2a23f412Df11166afC35CAba2",
25+
},
26+
"ERC-20": {
27+
chainId: sepolia.id,
28+
migrationContract: "0x81F15Ed1D87A6C840E410D7740D581e36c661640",
29+
name: "ERC-20",
30+
tokenContract: "0x92DA9BE2039E818bB78223A6BA7C85CC2b17D8D5",
31+
},
32+
},
33+
};

web-wallet/src/lib/containers/MigrateContract/MigrateContract.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
modal,
3939
wagmiConfig,
4040
walletDisconnect,
41-
} from "$lib/migration/walletConnection";
42-
import { getBalanceOfCoin } from "$lib/migration/migration";
41+
} from "$lib/web3/walletConnection";
42+
import { getBalanceOfCoin } from "$lib/web3/migration";
4343
4444
/** @type {string} */
4545
export let migrationNetwork;

0 commit comments

Comments
 (0)