Skip to content

Commit 6e4e8f4

Browse files
author
Nguyen Anh Tu
committed
WIP
1 parent ef3f40c commit 6e4e8f4

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

demo/vue-app-new/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/vue-app-new/src/components/AppDashboard.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,16 @@ const onGetBalance = async () => {
190190
const onSwitchChain = async () => {
191191
log.info("switching chain");
192192
try {
193-
await switchChain({ chainId: "0x89" });
193+
// await switchChain({ chainId: "0x89" });
194+
await addAndSwitchChain({
195+
chainId: "0xaa36a7",
196+
chainNamespace: CHAIN_NAMESPACES.EIP155,
197+
rpcTarget: "https://1rpc.io/sepolia ",
198+
blockExplorerUrl: "https://sepolia.etherscan.io",
199+
displayName: "Sepolia",
200+
ticker: "ETH",
201+
tickerName: "Ethereum",
202+
});
194203
printToConsole("switchedChain");
195204
} catch (error) {
196205
printToConsole("switchedChain error", error);
@@ -315,6 +324,7 @@ const onSignPersonalMsg = async () => {
315324
{{ t("app.buttons.btnSignTransaction") }}
316325
</Button>
317326
<Button block size="xs" pill class="mb-2" @click="onSignEthMessage">{{ t("app.buttons.btnSignEthMessage") }}</Button>
327+
<Button block size="xs" pill class="mb-2" @click="onSwitchChain">{{ t("app.buttons.btnSwitchChain") }}</Button>
318328
<Button block size="xs" pill class="mb-2" @click="getConnectedChainId">
319329
{{ t("app.buttons.btnGetConnectedChainId") }}
320330
</Button>

0 commit comments

Comments
 (0)