-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
367 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import { AssetModel } from '@/features/assets/models' | ||
import { cn } from '../utils' | ||
import Decimal from 'decimal.js' | ||
|
||
type Props = { | ||
amount: number | bigint | ||
asset: AssetModel | ||
className?: string | ||
} | ||
|
||
export const DisplayAssetAmount = ({ amount, asset }: Props) => { | ||
export const DisplayAssetAmount = ({ amount, asset, className }: Props) => { | ||
// asset decimals value must be from 0 to 19 so it is safe to use .toString() here | ||
const decimals = asset.decimals.toString() | ||
// the amount is uint64, should be safe to be .toString() | ||
const amountAsString = amount.toString() | ||
const amountToDisplay = new Decimal(amount.toString()).div(new Decimal(10).pow(asset.decimals.toString())).toString() | ||
|
||
return ( | ||
<div> | ||
{new Decimal(amountAsString).div(new Decimal(10).pow(decimals)).toString()} {asset.unitName ?? ''} | ||
<div className={cn(className)}> | ||
{amountToDisplay} {asset.unitName ?? ''} | ||
</div> | ||
) | ||
} |
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 @@ | ||
export const ZERO_ADDRESS = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ' |
121 changes: 121 additions & 0 deletions
121
...ts__/asset-transfer-view-visual.563MNGEL2OF4IBA7CFLIJNMBETT5QNKZURSLIONJBTJFALGYOAUA.html
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,121 @@ | ||
<div> | ||
<div | ||
class="relative grid" | ||
style="grid-template-columns: minmax(128px, 128px) repeat(2, 128px); grid-template-rows: repeat(2, 40px);" | ||
> | ||
<div /> | ||
<div | ||
class="p-2 flex justify-center" | ||
> | ||
<h1 | ||
class="text-l font-semibold" | ||
> | ||
SMO6...ALKU | ||
</h1> | ||
</div> | ||
<div /> | ||
<div | ||
class="absolute right-0 -z-10" | ||
style="top: 40px;" | ||
> | ||
<div> | ||
<div | ||
class="p-0" | ||
/> | ||
<div | ||
class="p-0" | ||
style="height: 40px; width: 128px;" | ||
> | ||
<div | ||
class="grid h-full" | ||
style="grid-template-columns: repeat(1, minmax(0, 1fr)); height: 40px;" | ||
> | ||
<div | ||
class="flex justify-center" | ||
> | ||
<div | ||
class="border-muted h-full border-dashed" | ||
style="border-left-width: 2px;" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div | ||
class="p-0 relative pr-8" | ||
> | ||
<div | ||
class="relative h-full p-0 flex items-center px-0" | ||
style="margin-left: 0px;" | ||
> | ||
<div | ||
class="inline" | ||
style="margin-left: 16px;" | ||
> | ||
563MNGE... | ||
</div> | ||
</div> | ||
</div> | ||
<div | ||
class="flex items-center justify-center relative" | ||
data-state="closed" | ||
style="grid-column-start: 2; grid-column-end: 4; color: rgb(126 200 191);" | ||
> | ||
<svg | ||
height="20" | ||
viewBox="0 0 21 21" | ||
width="20" | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
> | ||
<g | ||
transform="matrix(1 0 0 1 -153 -143 )" | ||
> | ||
<path | ||
d="M 163.5 143 C 169.38 143 174 147.62 174 153.5 C 174 159.38 169.38 164 163.5 164 C 157.62 164 153 159.38 153 153.5 C 153 147.62 157.62 143 163.5 143 Z " | ||
fill="currentColor" | ||
fill-rule="nonzero" | ||
stroke="none" | ||
/> | ||
</g> | ||
</svg> | ||
<div | ||
style="width: calc(50% - 10px); height: 20px;" | ||
> | ||
<svg | ||
class="relative" | ||
height="19px" | ||
preserveAspectRatio="xMinYMid meet" | ||
style="" | ||
viewBox="159 229 7 10" | ||
width="11px" | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
> | ||
<path | ||
d="M 165.8 228.1 L 159.1 234.1 L 165.8 240.1 L 163.5 234.1 L 165.8 228.1 Z" | ||
fill="currentColor" | ||
fill-rule="nonzero" | ||
stroke="none" | ||
/> | ||
</svg> | ||
</div> | ||
<div | ||
class="absolute size-1/2" | ||
style="border-width: 2px; border-radius: 4px; bottom: 1px; right: calc(25% - 4px);" | ||
/> | ||
<div | ||
class="absolute text-foreground right-1/4 w-[40%] flex justify-center" | ||
> | ||
<div | ||
class="w-min pl-1 pr-1 bg-card" | ||
> | ||
0 | ||
|
||
USDt | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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
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.