Skip to content

Commit

Permalink
unit format
Browse files Browse the repository at this point in the history
  • Loading branch information
BeroBurny committed May 22, 2024
1 parent 1725b1f commit 2be2690
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 19 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"@floating-ui/dom": "1.6.5",
"@metamask/sdk": "^0.20.3",
"highlight.js": "11.9.0",
"react": "^18.3.1"
"web3-utils": "^4.2.3"
}
}
3 changes: 2 additions & 1 deletion web/src/lib/components/TokenList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import TokenModal from '$lib/components/TokenModal.svelte';
import RequestSendModal from '$lib/components/RequestSendModal.svelte';
import ResponseSendModal from '$lib/components/ResponseSendModal.svelte';
import { fromWei } from 'web3-utils';
const modalStore = getModalStore();
Expand Down Expand Up @@ -70,7 +71,7 @@
<td><img class="size-8" src={token.logoURI} alt={`${token.logoURI}-LOGO`} /></td>
<td>{token.name}</td>
<td />
<td>{token.total}</td>
<td>{fromWei(token.total, 'ether')}</td>
</tr>
{/each}
</tbody>
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/TokenModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { SvelteComponent } from 'svelte';
import { getModalStore } from '@skeletonlabs/skeleton';
import { hacks_getChainIcon } from '$lib/hacks';
import { fromWei } from 'web3-utils';
// Props
/** Exposes parent props to this component. */
Expand Down Expand Up @@ -40,7 +41,7 @@
<tr>
<td><img class="size-7" src={hacks_getChainIcon(balance.chainId)} alt="" /></td>
<td>{$modalStore[0].value.networks.get(balance.chainId).name}</td>
<td>{balance.balance}</td>
<td>{fromWei(balance.balance, 'mwei')}</td>
</tr>
{/each}
</tbody>
Expand Down
2 changes: 0 additions & 2 deletions web/src/lib/components/Web3Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script lang="ts">
import { connect } from '$lib/stores/wallet';
connect;
</script>

<button class="btn variant-filled" on:click={() => connect()}> Connect Wallet </button>
2 changes: 1 addition & 1 deletion web/src/lib/stores/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readable, writable } from 'svelte/store';
import { writable } from 'svelte/store';

import { MetaMaskSDK } from '@metamask/sdk';

Expand Down
66 changes: 53 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3340,6 +3340,13 @@ __metadata:
languageName: node
linkType: hard

"eventemitter3@npm:^5.0.1":
version: 5.0.1
resolution: "eventemitter3@npm:5.0.1"
checksum: 4ba5c00c506e6c786b4d6262cfbce90ddc14c10d4667e5c83ae993c9de88aa856033994dd2b35b83e8dc1170e224e66a319fa80adc4c32adcd2379bbc75da814
languageName: node
linkType: hard

"events@npm:^3.3.0":
version: 3.3.0
resolution: "events@npm:3.3.0"
Expand Down Expand Up @@ -4538,7 +4545,7 @@ __metadata:
languageName: node
linkType: hard

"loose-envify@npm:^1.0.0, loose-envify@npm:^1.1.0":
"loose-envify@npm:^1.0.0":
version: 1.4.0
resolution: "loose-envify@npm:1.4.0"
dependencies:
Expand Down Expand Up @@ -5679,15 +5686,6 @@ __metadata:
languageName: node
linkType: hard

"react@npm:^18.3.1":
version: 18.3.1
resolution: "react@npm:18.3.1"
dependencies:
loose-envify: ^1.1.0
checksum: 283e8c5efcf37802c9d1ce767f302dd569dd97a70d9bb8c7be79a789b9902451e0d16334b05d73299b20f048cbc3c7d288bbbde10b701fa194e2089c237dbea3
languageName: node
linkType: hard

"read-cache@npm:^1.0.0":
version: 1.0.0
resolution: "read-cache@npm:1.0.0"
Expand Down Expand Up @@ -6963,7 +6961,7 @@ __metadata:
languageName: node
linkType: hard

"util@npm:^0.12.4":
"util@npm:^0.12.4, util@npm:^0.12.5":
version: 0.12.5
resolution: "util@npm:0.12.5"
dependencies:
Expand Down Expand Up @@ -7127,6 +7125,48 @@ __metadata:
languageName: node
linkType: hard

"web3-errors@npm:^1.1.4":
version: 1.1.4
resolution: "web3-errors@npm:1.1.4"
dependencies:
web3-types: ^1.3.1
checksum: a87d2846cfa8dd007fe3b3b474e1e83eaa0609b973413b9bd64f993a34ad6ce527606d4d09bcdcacb352a0b50a084e55ff50100b55d237a2500e22eb84e83e7d
languageName: node
linkType: hard

"web3-types@npm:^1.3.1, web3-types@npm:^1.5.0, web3-types@npm:^1.6.0":
version: 1.6.0
resolution: "web3-types@npm:1.6.0"
checksum: 346f40be29617190888e9fabcc7a205910cee32f3d761e6cf1a59c25214431ddb81f5c008d49229fee04813ac505419c7b12c81ccfd8b38f50612e6b0e16b3be
languageName: node
linkType: hard

"web3-utils@npm:^4.2.3":
version: 4.2.3
resolution: "web3-utils@npm:4.2.3"
dependencies:
ethereum-cryptography: ^2.0.0
eventemitter3: ^5.0.1
web3-errors: ^1.1.4
web3-types: ^1.6.0
web3-validator: ^2.0.5
checksum: 6f76b81586896c5159c7ae3456e066799b64efb69a8d38bfc6fa35933e931711e79a7d55534bfeed4352a77e556c6ad9bcfcc36855e0f7d41b57eabb4221f402
languageName: node
linkType: hard

"web3-validator@npm:^2.0.5":
version: 2.0.5
resolution: "web3-validator@npm:2.0.5"
dependencies:
ethereum-cryptography: ^2.0.0
util: ^0.12.5
web3-errors: ^1.1.4
web3-types: ^1.5.0
zod: ^3.21.4
checksum: 456f4d36e61416f402c4b71abb2ccfb4a8ad442f01ac36bd70d75a53f5d2f8bf59009373de438ec16ec32d544c50a03013e9fd2d1778c43eaab67cab94f1eb98
languageName: node
linkType: hard

"web@workspace:web":
version: 0.0.0-use.local
resolution: "web@workspace:web"
Expand All @@ -7152,7 +7192,6 @@ __metadata:
postcss: 8.4.38
prettier: ^3.1.1
prettier-plugin-svelte: ^3.1.2
react: ^18.3.1
svelte: ^4.2.7
svelte-check: ^3.6.0
tailwindcss: 3.4.3
Expand All @@ -7161,6 +7200,7 @@ __metadata:
vite: ^5.0.3
vite-plugin-tailwind-purgecss: 0.3.3
vitest: ^1.2.0
web3-utils: ^4.2.3
wrangler: ^3.57.0
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -7504,7 +7544,7 @@ __metadata:
languageName: node
linkType: hard

"zod@npm:^3.20.6":
"zod@npm:^3.20.6, zod@npm:^3.21.4":
version: 3.23.8
resolution: "zod@npm:3.23.8"
checksum: 8f14c87d6b1b53c944c25ce7a28616896319d95bc46a9660fe441adc0ed0a81253b02b5abdaeffedbeb23bdd25a0bf1c29d2c12dd919aef6447652dd295e3e69
Expand Down

0 comments on commit 2be2690

Please sign in to comment.