+
+
Fused Amount
+
{{ formatQsrAmount(fusion.qsrAmount.toString()) }} QSR
diff --git a/src/components/ImportWalletForm.vue b/src/components/ImportWalletForm.vue
index dbeab75..e2c432f 100644
--- a/src/components/ImportWalletForm.vue
+++ b/src/components/ImportWalletForm.vue
@@ -13,8 +13,8 @@ import {
InputGroupButton,
InputGroupInput,
Textarea,
- useToast
-} from '@nom/ui'
+ useToast,
+} from 'nom-ui'
import {EyeIcon, EyeOffIcon} from 'lucide-vue-next'
import PasswordStrengthMeter from './PasswordStrengthMeter.vue'
@@ -34,7 +34,9 @@ const showPassword = ref(false)
const isImporting = ref(false)
const mnemonicWords = computed(() => mnemonic.value.trim().split(/\s+/).filter(Boolean))
-const mnemonicValid = computed(() => mnemonicWords.value.length === 12 || mnemonicWords.value.length === 24)
+const mnemonicValid = computed(
+ () => mnemonicWords.value.length === 12 || mnemonicWords.value.length === 24
+)
const passwordsMatch = computed(() => password.value === confirmPassword.value)
const strength = usePasswordStrength(password)
const passwordStrong = computed(() => strength.value.meetsFloor)
@@ -79,8 +81,10 @@ async function handleImport() {
-
Import Wallet
-
Enter your recovery phrase to restore your wallet
+
Import Wallet
+
+ Enter your recovery phrase to restore your wallet
+
@@ -119,9 +123,21 @@ async function handleImport() {
spellcheck="false"
/>
-
-
-
+
+
+
diff --git a/src/components/MnemonicDisplay.vue b/src/components/MnemonicDisplay.vue
index b0cbbff..1767cad 100644
--- a/src/components/MnemonicDisplay.vue
+++ b/src/components/MnemonicDisplay.vue
@@ -11,8 +11,8 @@ import {
Item,
ItemContent,
ItemDescription,
- ItemTitle
-} from '@nom/ui'
+ ItemTitle,
+} from 'nom-ui'
import {CheckIcon, CopyIcon, EyeIcon, TriangleAlertIcon} from 'lucide-vue-next'
interface Props {
@@ -61,7 +61,8 @@ function handleConfirm() {
Important: Save Your Recovery Phrase
- Write down these {{ mnemonic.split(' ').length }} words in order and store them safely. This is the ONLY way to recover your wallet if you lose access.
+ Write down these {{ mnemonic.split(' ').length }} words in order and store them safely. This
+ is the ONLY way to recover your wallet if you lose access.
@@ -70,7 +71,7 @@ function handleConfirm() {
Your Address
-
+
{{ address }}
@@ -82,35 +83,38 @@ function handleConfirm() {
-
+
Reveal Recovery Phrase
-
-
+
+
- {{ index + 1 }}. {{ word }}
+ {{ index + 1 }}. {{ word }}
-
+
{{ mnemonicCopied ? 'Copied!' : 'Copy Recovery Phrase' }}
@@ -119,7 +123,11 @@ function handleConfirm() {
-
+
I have saved my recovery phrase in a safe place
diff --git a/src/components/NetworkIndicator.vue b/src/components/NetworkIndicator.vue
index 5e5373e..381226e 100644
--- a/src/components/NetworkIndicator.vue
+++ b/src/components/NetworkIndicator.vue
@@ -10,15 +10,15 @@ defineProps()
diff --git a/src/components/NetworkSelector.vue b/src/components/NetworkSelector.vue
index d99ee03..0ccb94a 100644
--- a/src/components/NetworkSelector.vue
+++ b/src/components/NetworkSelector.vue
@@ -13,7 +13,7 @@ import {
ItemDescription,
ItemTitle,
useToast,
-} from '@nom/ui'
+} from 'nom-ui'
import {CheckIcon, TrashIcon} from 'lucide-vue-next'
import {useNetwork, useStorage} from '@/core'
import {DEFAULT_NODES} from '@/config'
@@ -165,8 +165,8 @@ onMounted(async () => {
-
-
Node Management
+
+
Node Management
- {
:key="node.url"
:class="[
'transition-colors',
- selectedNode === node.url ? 'bg-primary/10 border-primary/50' : '',
+ selectedNode === node.url ? 'border-primary/50 bg-primary/10' : '',
]"
variant="hover"
size="sm"
@click="handleSelect(node.url)"
>
-
+
{{ node.isCustom ? 'Custom Node' : `Default Node` }}
{{ node.url }}
@@ -221,7 +221,7 @@ onMounted(async () => {
- Network Configuration
+ Network Configuration
diff --git a/src/components/PasswordStrengthMeter.vue b/src/components/PasswordStrengthMeter.vue
index 157551b..bb5c910 100644
--- a/src/components/PasswordStrengthMeter.vue
+++ b/src/components/PasswordStrengthMeter.vue
@@ -2,7 +2,7 @@
import {computed} from 'vue'
import type {PasswordStrength} from '@/core'
-const props = defineProps<{strength: PasswordStrength}>()
+const props = defineProps<{ strength: PasswordStrength }>()
const barClass = computed(() => {
const s = props.strength.score
@@ -17,10 +17,10 @@ const barClass = computed(() => {
diff --git a/src/components/PillarList.vue b/src/components/PillarList.vue
index 9d880c0..e1792bd 100644
--- a/src/components/PillarList.vue
+++ b/src/components/PillarList.vue
@@ -1,7 +1,7 @@
-
+
No pillars found matching "{{ searchQuery }}"
No pillars available
-
-
+
-
+
Rank #{{ pillarInfo.rank + 1 }}
@@ -70,14 +68,14 @@ function formatWeight(weight: string): string {
-
Est. APR
-
+
Est. APR
+
{{ formatApr(pillarInfo.delegateApr) }}
-
Weight
-
+
Weight
+
{{ formatWeight(pillarInfo.weight.toString()) }} ZNN
@@ -85,15 +83,11 @@ function formatWeight(weight: string): string {
Delegating...
Delegated
@@ -102,12 +96,10 @@ function formatWeight(weight: string): string {
-
+
-
- Rank #{{ pillarInfo.rank + 1 }}
-
+
Rank #{{ pillarInfo.rank + 1 }}
{{ pillarInfo.name }}
@@ -115,20 +107,20 @@ function formatWeight(weight: string): string {
-
+
Est. APR
-
+
{{ formatApr(pillarInfo.delegateApr) }}
-
+
Weight
-
+
{{ formatWeight(pillarInfo.weight.toString()) }} ZNN
@@ -136,14 +128,10 @@ function formatWeight(weight: string): string {
Delegating...
Delegated
diff --git a/src/components/PillarTab.vue b/src/components/PillarTab.vue
index 23779dc..118a1ff 100644
--- a/src/components/PillarTab.vue
+++ b/src/components/PillarTab.vue
@@ -1,7 +1,7 @@
@@ -121,7 +124,7 @@ defineExpose({
-
+
@@ -131,57 +134,56 @@ defineExpose({
-
-
- Wallet
-
-
- Network
-
+
+ Wallet
+ Network
emit('lock', address)"
- @delete="(address) => emit('delete-wallet', address)"
- @rename="(address, newName) => emit('rename-wallet', address, newName)"
- @export-mnemonic="handleExportMnemonicRequest"
- @derive-account="(walletAddress) => emit('derive-account', walletAddress)"
- @select-account="(address) => emit('select-account', address)"
- @rename-account="(walletAddress, accountAddress, newLabel) => emit('rename-account', walletAddress, accountAddress, newLabel)"
- @toggle-hidden="(walletAddress, accountAddress, hidden) => emit('toggle-account-hidden', walletAddress, accountAddress, hidden)"
- @wallet-added="(address) => emit('wallet-added', address)"
+ :wallets="wallets"
+ :unlocked-wallets="unlockedWallets"
+ :active-account-address="activeAccountAddress"
+ @unlock="handleUnlockRequest"
+ @lock="(address) => emit('lock', address)"
+ @delete="(address) => emit('delete-wallet', address)"
+ @rename="(address, newName) => emit('rename-wallet', address, newName)"
+ @export-mnemonic="handleExportMnemonicRequest"
+ @derive-account="(walletAddress) => emit('derive-account', walletAddress)"
+ @select-account="(address) => emit('select-account', address)"
+ @rename-account="
+ (walletAddress, accountAddress, newLabel) =>
+ emit('rename-account', walletAddress, accountAddress, newLabel)
+ "
+ @toggle-hidden="
+ (walletAddress, accountAddress, hidden) =>
+ emit('toggle-account-hidden', walletAddress, accountAddress, hidden)
+ "
+ @wallet-added="(address) => emit('wallet-added', address)"
/>
emit('select-network', nodeUrl)"
- @update-network-config="(chainId, networkId) => emit('update-network-config', chainId, networkId)"
+ :current-node="currentNode"
+ @select="(nodeUrl) => emit('select-network', nodeUrl)"
+ @update-network-config="
+ (chainId, networkId) => emit('update-network-config', chainId, networkId)
+ "
/>
Theme
-
-
-
+
+
+
{{ theme === 'dark' ? 'Light Mode' : 'Dark Mode' }}
-
@@ -196,13 +198,17 @@ defineExpose({
:wallet-name="walletToUnlock.name"
:unlock-error="unlockError"
@unlock="handleUnlock"
- @update:open="(value) => {
- unlockDialogVisible = value
- }"
- @cancel="() => {
- unlockDialogVisible = false
- unlockError = null
- }"
+ @update:open="
+ (value) => {
+ unlockDialogVisible = value
+ }
+ "
+ @cancel="
+ () => {
+ unlockDialogVisible = false
+ unlockError = null
+ }
+ "
/>
diff --git a/src/components/StakeList.vue b/src/components/StakeList.vue
index b125b0e..7c540f4 100644
--- a/src/components/StakeList.vue
+++ b/src/components/StakeList.vue
@@ -1,14 +1,8 @@
-
+
@@ -112,16 +106,14 @@ const stakesWithStatus = computed(() => {
{{ cancelingStakeId === stake.id.toString() ? 'Canceling...' : 'Cancel' }}
-
-
- Duration: {{ stake.duration }}
-
+
+ Duration: {{ stake.duration }}
{{ stake.timeRemaining }}
-
-
Staked Amount
-
+
+
Staked Amount
+
{{ formatZnnAmount(stake.amount.toString()) }} ZNN
diff --git a/src/components/StakeTab.vue b/src/components/StakeTab.vue
index b729d30..3557c6f 100644
--- a/src/components/StakeTab.vue
+++ b/src/components/StakeTab.vue
@@ -14,7 +14,7 @@ import {
SelectItem,
SelectTrigger,
SelectValue,
-} from '@nom/ui'
+} from 'nom-ui'
interface StakeTabProps {
activeAccountAddress: string | null
@@ -24,7 +24,7 @@ interface StakeTabProps {
const props = withDefaults(defineProps
(), {
isActive: false,
- isWalletLocked: false
+ isWalletLocked: false,
})
const emit = defineEmits<{
@@ -58,18 +58,24 @@ onMounted(async () => {
})
// Watch for when the tab becomes active
-watch(() => props.isActive, async (isActive) => {
- if (isActive && props.activeAccountAddress) {
- await loadData()
+watch(
+ () => props.isActive,
+ async (isActive) => {
+ if (isActive && props.activeAccountAddress) {
+ await loadData()
+ }
}
-})
+)
// Watch for account changes
-watch(() => props.activeAccountAddress, async (newAddress) => {
- if (newAddress && props.isActive) {
- await loadData()
+watch(
+ () => props.activeAccountAddress,
+ async (newAddress) => {
+ if (newAddress && props.isActive) {
+ await loadData()
+ }
}
-})
+)
async function loadData() {
if (!props.activeAccountAddress) {
@@ -77,10 +83,7 @@ async function loadData() {
return
}
- await Promise.all([
- stake.loadStakeEntries(props.activeAccountAddress),
- account.loadBalances()
- ])
+ await Promise.all([stake.loadStakeEntries(props.activeAccountAddress), account.loadBalances()])
}
async function handleStake() {
@@ -177,7 +180,10 @@ async function handleCancel(stakeId: string) {
-
+
Loading stake data...
@@ -187,13 +193,13 @@ async function handleCancel(stakeId: string) {
Amount (ZNN)
Available: {{ znnBalance }} ZNN | Minimum: {{ minStakeAmount }} ZNN
@@ -203,18 +209,15 @@ async function handleCancel(stakeId: string) {
Stake Duration
-
+
{{ option.label }}
@@ -232,9 +235,9 @@ async function handleCancel(stakeId: string) {
{{ stake.isStaking.value ? 'Staking...' : 'Stake ZNN' }}
@@ -242,7 +245,7 @@ async function handleCancel(stakeId: string) {
-
Active Stakes
+
Active Stakes
-import { ref, computed } from 'vue'
-import { addNumberDecimals } from 'znn-typescript-sdk'
-import { ZNN_ZTS, QSR_ZTS } from 'znn-typescript-sdk'
-import type { BalanceInfo } from '@/types'
-import { Input, Item, ItemContent, ItemTitle, ItemDescription, ItemActions } from '@nom/ui'
+import {computed, ref} from 'vue'
+import {addNumberDecimals, QSR_ZTS, ZNN_ZTS} from 'znn-typescript-sdk'
+import type {BalanceInfo} from '@/types'
+import {Input, Item, ItemActions, ItemContent, ItemDescription, ItemTitle} from 'nom-ui'
export interface TokenListProps {
tokens: BalanceInfo[]
@@ -76,15 +75,10 @@ function handleItemClick(token: BalanceInfo) {
-
+
-
+
No tokens found matching "{{ searchQuery }}"
No tokens available
@@ -101,8 +95,11 @@ function handleItemClick(token: BalanceInfo) {
{{ token.symbol || 'Unknown' }}
Core
diff --git a/src/components/TokensTab.vue b/src/components/TokensTab.vue
index 55ba4e1..6101c93 100644
--- a/src/components/TokensTab.vue
+++ b/src/components/TokensTab.vue
@@ -1,9 +1,9 @@
-
+
Welcome to NoM Wallet
Get started by creating or importing a wallet
-
- Create New Wallet
-
+ Create New Wallet
Import Existing Wallet
diff --git a/src/components/WalletStats.vue b/src/components/WalletStats.vue
index 1f1167d..3ea7fd4 100644
--- a/src/components/WalletStats.vue
+++ b/src/components/WalletStats.vue
@@ -2,7 +2,7 @@
import {computed, ref} from 'vue'
import type {PlasmaLevel} from '@/core'
import {ZapIcon} from 'lucide-vue-next'
-import {useScrollFade} from '@nom/ui'
+import {useScrollFade} from 'nom-ui'
export interface WalletStatsProps {
tokenCount: number
@@ -35,11 +35,11 @@ const getPlasmaColor = () => {
-
+
@@ -57,7 +57,7 @@ const getPlasmaColor = () => {
Plasma:
-
+
{{ plasmaLevel }}
@@ -70,8 +70,8 @@ const getPlasmaColor = () => {
- Pending Rewards
-
+ Pending Rewards
+
diff --git a/src/config.ts b/src/config.ts
index 04b8900..e4d0525 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -70,13 +70,7 @@ export const MIN_PASSWORD_LENGTH = 12
export const MIN_PASSWORD_SCORE = 2
/** Human labels for the 0–4 password-strength score. */
-export const PASSWORD_STRENGTH_LABELS = [
- 'Very weak',
- 'Weak',
- 'Fair',
- 'Good',
- 'Strong'
-] as const
+export const PASSWORD_STRENGTH_LABELS = ['Very weak', 'Weak', 'Fair', 'Good', 'Strong'] as const
/**
* Strong Argon2id KDF params for new and upgraded wallets. Passed to the SDK's
@@ -90,5 +84,5 @@ export const KDF_CONFIG = {
timeCost: 3,
memoryCost: 64 * 1024,
hashLength: 32,
- parallelism: 4
+ parallelism: 4,
} as const
diff --git a/src/core/account-service.ts b/src/core/account-service.ts
index d3500bc..fb12c00 100644
--- a/src/core/account-service.ts
+++ b/src/core/account-service.ts
@@ -26,7 +26,7 @@ export class AccountService {
}
// Get account balance information
- async getAccountInfo(address: string): Promise
{
+ async getAccountInfo(address: string): Promise {
await this.ensureInitialized()
const addr = Address.parse(address)
return await this.zenon.ledger.getAccountInfoByAddress(addr)
diff --git a/src/core/composables/useAccount.ts b/src/core/composables/useAccount.ts
index f02de1c..5afeb70 100644
--- a/src/core/composables/useAccount.ts
+++ b/src/core/composables/useAccount.ts
@@ -1,5 +1,5 @@
import {computed, ref, watch} from 'vue'
-import type {PlasmaLevel} from "../account-service";
+import type {PlasmaLevel} from '../account-service'
import {AccountService} from '../account-service'
import {RewardsService} from '../rewards-service'
import type {BalanceInfo} from '@/types'
@@ -198,7 +198,7 @@ export function useAccount(accountAddress: string | null | (() => string | null)
loadPlasmaInfo(),
loadUnreceivedCount(),
loadDelegationInfo(),
- loadRewardsInfo()
+ loadRewardsInfo(),
])
} catch (err) {
error.value = err instanceof Error ? err.message : 'Failed to load account data'
diff --git a/src/core/composables/useActivity.ts b/src/core/composables/useActivity.ts
index 14a7c71..0a77cc7 100644
--- a/src/core/composables/useActivity.ts
+++ b/src/core/composables/useActivity.ts
@@ -24,7 +24,7 @@ export async function runActivity(
let step = initialStep
const render = () => {
- toast.loading(isGeneratingPow.value ? `${step} — generating plasma...` : step, {id})
+ toast.loading(isGeneratingPow.value ? `${step} — generating plasma...` : step, { id })
}
// Re-render the toast whenever PoW starts/stops mid-operation.
diff --git a/src/core/composables/usePasswordStrength.ts b/src/core/composables/usePasswordStrength.ts
index 3becaa1..5fdf071 100644
--- a/src/core/composables/usePasswordStrength.ts
+++ b/src/core/composables/usePasswordStrength.ts
@@ -1,9 +1,5 @@
-import {ref, watch, type Ref} from 'vue'
-import {
- EMPTY_PASSWORD_STRENGTH,
- estimatePasswordStrength,
- type PasswordStrength
-} from '../password-strength'
+import {ref, type Ref, watch} from 'vue'
+import {EMPTY_PASSWORD_STRENGTH, estimatePasswordStrength, type PasswordStrength,} from '../password-strength'
/**
* Reactive password strength. Wraps the async (lazy-loaded zxcvbn) scorer.
@@ -29,7 +25,7 @@ export function usePasswordStrength(password: Ref): Ref ({ ...p, delegateApr: 0 } as PillarWithApr))
+ return pillarList.map((p) => ({ ...p, delegateApr: 0 }) as PillarWithApr)
}
// Calculate momentum distribution
@@ -51,18 +54,22 @@ export function usePillar() {
const halfDayMomentums = MOMENTUMS_PER_DAY * 0.5
// Total expected daily momentums for each group
- const totalExpectedDailyMomentumsTop30 = halfDayMomentums + (halfDayMomentums * 15 / secondaryGroupSize)
- const totalExpectedDailyMomentumsNotTop30 = halfDayMomentums * (secondaryGroupSize - 15) / secondaryGroupSize
+ const totalExpectedDailyMomentumsTop30 =
+ halfDayMomentums + (halfDayMomentums * 15) / secondaryGroupSize
+ const totalExpectedDailyMomentumsNotTop30 =
+ (halfDayMomentums * (secondaryGroupSize - 15)) / secondaryGroupSize
// Yearly reward pools
const yearlyDelegateRewardPool = YEARLY_ZNN_REWARDS * DELEGATE_REWARD_SHARE // 373,248 ZNN
const yearlyMomentumRewardPool = YEARLY_ZNN_REWARDS * MOMENTUM_REWARD_SHARE // 777,600 ZNN
// Yearly momentum rewards for top 30 vs not top 30
- const yearlyMomentumRewardsTop30 = yearlyMomentumRewardPool * (totalExpectedDailyMomentumsTop30 / MOMENTUMS_PER_DAY)
- const yearlyMomentumRewardsNotTop30 = yearlyMomentumRewardPool * (totalExpectedDailyMomentumsNotTop30 / MOMENTUMS_PER_DAY)
+ const yearlyMomentumRewardsTop30 =
+ yearlyMomentumRewardPool * (totalExpectedDailyMomentumsTop30 / MOMENTUMS_PER_DAY)
+ const yearlyMomentumRewardsNotTop30 =
+ yearlyMomentumRewardPool * (totalExpectedDailyMomentumsNotTop30 / MOMENTUMS_PER_DAY)
- return pillarList.map(pillar => {
+ return pillarList.map((pillar) => {
const weight = BigInt(pillar.weight.toString())
if (weight === BigInt(0)) {
@@ -73,18 +80,23 @@ export function usePillar() {
const { producedMomentums, expectedMomentums } = pillar.currentStats
// Calculate reward multiplier based on momentum performance
- const rewardMultiplier = (expectedMomentums - producedMomentums > 2 && expectedMomentums > 0)
- ? producedMomentums / expectedMomentums
- : 1
+ const rewardMultiplier =
+ expectedMomentums - producedMomentums > 2 && expectedMomentums > 0
+ ? producedMomentums / expectedMomentums
+ : 1
// Calculate momentum rewards for this pillar
let yearlyMomentumRewards = 0
if (isTop30 && top30Count > 0) {
const dailyExpectedPerPillar = totalExpectedDailyMomentumsTop30 / top30Count
- yearlyMomentumRewards = yearlyMomentumRewardsTop30 * (dailyExpectedPerPillar * rewardMultiplier) / totalExpectedDailyMomentumsTop30
+ yearlyMomentumRewards =
+ (yearlyMomentumRewardsTop30 * (dailyExpectedPerPillar * rewardMultiplier)) /
+ totalExpectedDailyMomentumsTop30
} else if (!isTop30 && notTop30Count > 0) {
const dailyExpectedPerPillar = totalExpectedDailyMomentumsNotTop30 / notTop30Count
- yearlyMomentumRewards = yearlyMomentumRewardsNotTop30 * (dailyExpectedPerPillar * rewardMultiplier) / totalExpectedDailyMomentumsNotTop30
+ yearlyMomentumRewards =
+ (yearlyMomentumRewardsNotTop30 * (dailyExpectedPerPillar * rewardMultiplier)) /
+ totalExpectedDailyMomentumsNotTop30
}
// Calculate delegate rewards based on weight across entire network
@@ -92,16 +104,19 @@ export function usePillar() {
const yearlyDelegateRewards = yearlyDelegateRewardPool * pillarWeightShare * rewardMultiplier
// Apply pillar's reward share percentages (what delegates receive)
- const momentumRewardsForDelegators = yearlyMomentumRewards * (pillar.giveMomentumRewardPercentage / 100)
- const delegateRewardsForDelegators = yearlyDelegateRewards * (pillar.giveDelegateRewardPercentage / 100)
+ const momentumRewardsForDelegators =
+ yearlyMomentumRewards * (pillar.giveMomentumRewardPercentage / 100)
+ const delegateRewardsForDelegators =
+ yearlyDelegateRewards * (pillar.giveDelegateRewardPercentage / 100)
// Calculate APR: (total rewards in smallest unit / weight) * 100
- const totalRewardsInSmallestUnit = (momentumRewardsForDelegators + delegateRewardsForDelegators) * DECIMALS
+ const totalRewardsInSmallestUnit =
+ (momentumRewardsForDelegators + delegateRewardsForDelegators) * DECIMALS
const delegateApr = (totalRewardsInSmallestUnit / Number(weight)) * 100
return {
...pillar,
- delegateApr: isNaN(delegateApr) ? 0 : delegateApr
+ delegateApr: isNaN(delegateApr) ? 0 : delegateApr,
} as PillarWithApr
})
}
@@ -155,7 +170,7 @@ export function usePillar() {
? 'Step 1/2: Removing current delegation'
: `Delegating to ${pillarName}`
- await runActivity(initialStep, async ({setStep}) => {
+ await runActivity(initialStep, async ({ setStep }) => {
// First undelegate if needed
if (shouldUndelegate) {
const undelegateBlock = pillarService.createUndelegateBlock()
diff --git a/src/core/composables/usePlasmaBot.ts b/src/core/composables/usePlasmaBot.ts
index 75b65f2..34192dc 100644
--- a/src/core/composables/usePlasmaBot.ts
+++ b/src/core/composables/usePlasmaBot.ts
@@ -1,10 +1,10 @@
-import { ref } from 'vue'
+import {ref} from 'vue'
import {
- PlasmaBotService,
- PlasmaBotError,
- type PlasmaBotTierKey,
- type PlasmaBotFuseSuccess,
- type PlasmaBotStats
+ PlasmaBotError,
+ type PlasmaBotFuseSuccess,
+ PlasmaBotService,
+ type PlasmaBotStats,
+ type PlasmaBotTierKey,
} from '../plasma-bot-service'
// Module-level reactive state — shared across every usePlasmaBot() caller
@@ -30,7 +30,9 @@ export function usePlasmaBot() {
return result
} catch (err) {
const e =
- err instanceof PlasmaBotError ? err : new PlasmaBotError('NETWORK_ERROR', 'Unexpected error')
+ err instanceof PlasmaBotError
+ ? err
+ : new PlasmaBotError('NETWORK_ERROR', 'Unexpected error')
error.value = e
throw e
} finally {
@@ -61,6 +63,6 @@ export function usePlasmaBot() {
fuse,
stats,
statsStatus,
- loadStats
+ loadStats,
}
}
diff --git a/src/core/composables/useTransaction.ts b/src/core/composables/useTransaction.ts
index 9856344..a9cbc5c 100644
--- a/src/core/composables/useTransaction.ts
+++ b/src/core/composables/useTransaction.ts
@@ -1,6 +1,6 @@
import {ref} from 'vue'
-import {TransactionService} from "../transaction-service";
-import {sessionManager} from "../session-manager";
+import {TransactionService} from '../transaction-service'
+import {sessionManager} from '../session-manager'
import {runActivity} from './useActivity'
import type {Wallet} from '@/types'
diff --git a/src/core/composables/useWallet.ts b/src/core/composables/useWallet.ts
index f6d4b32..899a0f1 100644
--- a/src/core/composables/useWallet.ts
+++ b/src/core/composables/useWallet.ts
@@ -16,9 +16,7 @@ let loadPromise: Promise | null = null
// Computed
const isActiveWalletUnlocked = computed(() => {
- return activeWallet.value
- ? unlockedWallets.value.includes(activeWallet.value.baseAddress)
- : false
+ return activeWallet.value ? unlockedWallets.value.includes(activeWallet.value.baseAddress) : false
})
const hasWallets = computed(() => wallets.value.length > 0)
@@ -74,11 +72,7 @@ export function useWallet() {
}
// Import wallet from mnemonic
- async function importWallet(
- mnemonic: string,
- password: string,
- name?: string
- ): Promise {
+ async function importWallet(mnemonic: string, password: string, name?: string): Promise {
isLoading.value = true
error.value = null
diff --git a/src/core/composables/utils/formatters.ts b/src/core/composables/utils/formatters.ts
index 33e43db..5757f68 100644
--- a/src/core/composables/utils/formatters.ts
+++ b/src/core/composables/utils/formatters.ts
@@ -131,11 +131,7 @@ export function formatTokenDisplay(value: string, maxDecimals: number = 4): stri
* @param decimals - Number of decimal places to show (default: 2)
* @returns Formatted balance with symbol
*/
-export function formatBalance(
- balance: string,
- symbol: string,
- decimals: number = 2
-): string {
+export function formatBalance(balance: string, symbol: string, decimals: number = 2): string {
const num = parseFloat(balance)
if (isNaN(num)) return `0 ${symbol}`
diff --git a/src/core/index.ts b/src/core/index.ts
index db16f31..1442b98 100644
--- a/src/core/index.ts
+++ b/src/core/index.ts
@@ -9,4 +9,4 @@ export { isGeneratingPow } from './pow-status'
export { estimatePasswordStrength } from './password-strength'
export type { PasswordStrength } from './password-strength'
export * from './composables'
-export * from './composables/utils/formatters'
\ No newline at end of file
+export * from './composables/utils/formatters'
diff --git a/src/core/password-strength.ts b/src/core/password-strength.ts
index 625a31a..c73c940 100644
--- a/src/core/password-strength.ts
+++ b/src/core/password-strength.ts
@@ -14,7 +14,7 @@ export const EMPTY_PASSWORD_STRENGTH: PasswordStrength = {
score: 0,
label: PASSWORD_STRENGTH_LABELS[0],
meetsFloor: false,
- suggestions: []
+ suggestions: [],
}
// zxcvbn-ts (core + dictionaries) is dynamically imported so it lands in its own
@@ -23,7 +23,7 @@ export const EMPTY_PASSWORD_STRENGTH: PasswordStrength = {
type ScoreFn = (password: string) => {
score: number
guessesLog10: number
- feedback: {warning: string | null; suggestions: string[]}
+ feedback: { warning: string | null; suggestions: string[] }
}
let enginePromise: Promise | null = null
@@ -33,12 +33,12 @@ function loadEngine(): Promise {
const [core, common, en] = await Promise.all([
import('@zxcvbn-ts/core'),
import('@zxcvbn-ts/language-common'),
- import('@zxcvbn-ts/language-en')
+ import('@zxcvbn-ts/language-en'),
])
core.zxcvbnOptions.setOptions({
- dictionary: {...common.dictionary, ...en.dictionary},
+ dictionary: { ...common.dictionary, ...en.dictionary },
graphs: common.adjacencyGraphs,
- translations: en.translations
+ translations: en.translations,
})
return (password: string) => core.zxcvbn(password)
})()
@@ -68,5 +68,5 @@ export async function estimatePasswordStrength(password: string): Promise {
+ async sendEmbeddedContractBlock(
+ block: AccountBlockTemplate,
+ keyPair: KeyPair
+ ): Promise {
await this.ensureInitialized()
return await this.zenon.send(block, keyPair)
}
diff --git a/src/main.ts b/src/main.ts
index 4160cd4..f9ee49e 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,6 +1,6 @@
import {Buffer} from 'buffer'
import {createApp} from 'vue'
-import {useToast} from '@nom/ui'
+import {useToast} from 'nom-ui'
import App from './App.vue'
import {router} from './router'
import './style.css'
diff --git a/src/pages/Home.vue b/src/pages/Home.vue
index 805018c..f5ba6fd 100644
--- a/src/pages/Home.vue
+++ b/src/pages/Home.vue
@@ -2,7 +2,7 @@
import {computed, inject, onMounted, onUnmounted, ref} from 'vue'
import {useRouter} from 'vue-router'
import {formatNumber, useAccount, useWallet} from '@/core'
-import {Button, Card, CardContent, Tabs, TabsContent, TabsList, TabsTrigger, useToast,} from '@nom/ui'
+import {Button, Card, CardContent, Tabs, TabsContent, TabsList, TabsTrigger, useToast,} from 'nom-ui'
import TokensTab from '@/components/TokensTab.vue'
import RewardsTab from '@/components/RewardsTab.vue'
import PlasmaTab from '@/components/PlasmaTab.vue'
@@ -90,35 +90,34 @@ const formattedQsrBalance = computed(() =>
-
+
-
+
No active account. Please create or select a wallet first.
-
-
+
-
-
ZNN
+
+
ZNN
{{ formattedZnnBalance }}
-
-
QSR
+
+
QSR
{{ formattedQsrBalance }}
@@ -131,22 +130,22 @@ const formattedQsrBalance = computed(() =>
- Send
+ Send
-
- Receive
+
+ Receive
{{ account.unreceivedCount.value > 9 ? '9+' : account.unreceivedCount.value }}
@@ -175,7 +174,6 @@ const formattedQsrBalance = computed(() =>
Staking
-
-
+
-
-
-
+
+
+
Receive
@@ -134,10 +130,10 @@ function goBack() {
-
+
-
+
No active account. Please create or select a wallet first.
@@ -150,14 +146,14 @@ function goBack() {
Your Address
-
+
{{ wallet.activeAccountAddress.value }}
-
+
Copy Address
-
+
Share this address to receive tokens
@@ -169,12 +165,15 @@ function goBack() {
Pending Transactions
-
+
Loading transactions...
-
-
+
+
No pending transactions
@@ -189,25 +188,35 @@ function goBack() {
v-for="block in unreceivedBlocks"
:key="block.hash.toString()"
variant="muted"
- class="border-border flex-col items-stretch sm:flex-row sm:items-center"
+ class="flex-col items-stretch border-border sm:flex-row sm:items-center"
>
-
+
- {{ block.token ? addNumberDecimals(block.amount, block.token.decimals) : block.amount.toString() }}
+ {{
+ block.token
+ ? addNumberDecimals(block.amount, block.token.decimals)
+ : block.amount.toString()
+ }}
{{ block.token?.symbol || 'Unknown' }}
-
+
From
-
{{ block.address.toString() }}
+
+ {{ block.address.toString() }}
+
ZTS
-
{{ block.tokenStandard.toString() }}
+
+ {{ block.tokenStandard.toString() }}
+
Time
-
{{ formatDate(block.confirmationDetail?.momentumTimestamp || 0) }}
+
+ {{ formatDate(block.confirmationDetail?.momentumTimestamp || 0) }}
+
@@ -218,14 +227,16 @@ function goBack() {
size="sm"
class="w-full sm:w-auto"
>
- Receiving...
+ Receiving...
Receive
-
+
{
})
// Watch for balances to load and check for pre-selected token
-watch(() => account.balances.value, (balances) => {
- if (balances.length > 0 && !selectedToken.value) {
- const tokenStandard = route.query.token as string | undefined
- if (tokenStandard) {
- const token = balances.find(b => b.tokenStandard === tokenStandard)
- if (token) {
- selectedToken.value = token
- currentStep.value = 2
+watch(
+ () => account.balances.value,
+ (balances) => {
+ if (balances.length > 0 && !selectedToken.value) {
+ const tokenStandard = route.query.token as string | undefined
+ if (tokenStandard) {
+ const token = balances.find((b) => b.tokenStandard === tokenStandard)
+ if (token) {
+ selectedToken.value = token
+ currentStep.value = 2
+ }
}
}
- }
-}, { immediate: true })
+ },
+ { immediate: true }
+)
function handleTokenSelect(token: BalanceInfo) {
selectedToken.value = token
@@ -99,7 +103,12 @@ function setMaxAmount() {
}
async function handleSend() {
- if (!recipient.value || !amount.value || !selectedToken.value || !wallet.activeAccountAddress.value) {
+ if (
+ !recipient.value ||
+ !amount.value ||
+ !selectedToken.value ||
+ !wallet.activeAccountAddress.value
+ ) {
sendError.value = 'Please fill in all fields'
return
}
@@ -156,15 +165,11 @@ async function handleSend() {
-
+
-
-
-
+
+
+
@@ -174,10 +179,10 @@ async function handleSend() {
-
+
-
+
No active account. Please create or select a wallet first.
@@ -197,7 +202,7 @@ async function handleSend() {
@select="handleTokenSelect"
/>
-
+
No tokens available to send
@@ -288,14 +293,22 @@ async function handleSend() {
-
-
+
+
Send
-import { ref } from 'vue'
-import { useRouter } from 'vue-router'
+import {ref} from 'vue'
+import {useRouter} from 'vue-router'
import WalletSetup from '@/components/WalletSetup.vue'
import CreateWalletForm from '@/components/CreateWalletForm.vue'
import ImportWalletForm from '@/components/ImportWalletForm.vue'
-import { Card, CardContent } from '@nom/ui'
+import {Card, CardContent} from 'nom-ui'
const router = useRouter()
@@ -19,24 +19,18 @@ function handleSuccess() {
-
+
-
+
-
+
-
+
diff --git a/src/pages/TokenDetails.vue b/src/pages/TokenDetails.vue
index bf41525..1998831 100644
--- a/src/pages/TokenDetails.vue
+++ b/src/pages/TokenDetails.vue
@@ -2,7 +2,7 @@
import {computed, inject, onMounted, ref} from 'vue'
import {useRoute, useRouter} from 'vue-router'
import {formatNumber, formatTokenDisplay, useAccount, useToken, useWallet} from '@/core'
-import {Button, Card, CardContent, CardHeader, Item, ItemContent, ItemGroup, ItemSeparator,} from '@nom/ui'
+import {Button, Card, CardContent, CardHeader, Item, ItemContent, ItemGroup, ItemSeparator,} from 'nom-ui'
import {ArrowDownCircleIcon, ArrowLeftIcon, ArrowUpCircleIcon} from 'lucide-vue-next'
import {addNumberDecimals} from 'znn-typescript-sdk'
@@ -49,10 +49,7 @@ onMounted(async () => {
await wallet.loadWalletData()
if (wallet.activeAccountAddress.value) {
- await Promise.all([
- account.loadAccountData(),
- token.loadTokenInfo(tokenStandard.value)
- ])
+ await Promise.all([account.loadAccountData(), token.loadTokenInfo(tokenStandard.value)])
}
})
@@ -77,15 +74,11 @@ function handleNavigateToSendReceive(path: string) {
-
+
-
-
-
+
+
+
@@ -95,28 +88,26 @@ function handleNavigateToSendReceive(path: string) {
-
+
-
+
No active account. Please create or select a wallet first.
-
+
Loading token information...
-
+
Failed to load token information
-
- Go Back
-
+ Go Back
@@ -125,23 +116,20 @@ function handleNavigateToSendReceive(path: string) {
- Your Balance
-
+
Your Balance
+
{{ formattedBalanceCompact }}
-
+
{{ tokenBalance?.symbol || 'Unknown' }}
-
+
Send
@@ -150,7 +138,7 @@ function handleNavigateToSendReceive(path: string) {
Receive
@@ -167,15 +155,21 @@ function handleNavigateToSendReceive(path: string) {
-
-
- Name
- {{ token.tokenInfo.value.name || 'N/A' }}
+
+ Name
+ {{
+ token.tokenInfo.value.name || 'N/A'
+ }}
-
-
+
Symbol
{{ token.tokenInfo.value.symbol || 'N/A' }}
@@ -183,15 +177,19 @@ function handleNavigateToSendReceive(path: string) {
-
-
- Token Standard
+
+ Token Standard
{{ tokenStandard }}
-
-
+
Decimals
{{ token.tokenInfo.value.decimals }}
@@ -199,34 +197,64 @@ function handleNavigateToSendReceive(path: string) {
-
-
- Total Supply
+
+ Total Supply
- {{ formatTokenDisplay(addNumberDecimals(token.tokenInfo.value.totalSupply.toString(), token.tokenInfo.value.decimals)) }}
+ {{
+ formatTokenDisplay(
+ addNumberDecimals(
+ token.tokenInfo.value.totalSupply.toString(),
+ token.tokenInfo.value.decimals
+ )
+ )
+ }}
-
-
- Max Supply
+
+ Max Supply
- {{ formatTokenDisplay(addNumberDecimals(token.tokenInfo.value.maxSupply.toString(), token.tokenInfo.value.decimals)) }}
+ {{
+ formatTokenDisplay(
+ addNumberDecimals(
+ token.tokenInfo.value.maxSupply.toString(),
+ token.tokenInfo.value.decimals
+ )
+ )
+ }}
-
-
- Owner
+
+ Owner
{{ token.tokenInfo.value.owner.toString() }}
@@ -236,7 +264,9 @@ function handleNavigateToSendReceive(path: string) {
-
-
+
Domain
{{ token.tokenInfo.value.domain }}
@@ -245,25 +275,37 @@ function handleNavigateToSendReceive(path: string) {
-
-
+
Mintable
- {{ token.tokenInfo.value.isMintable ? 'Yes' : 'No' }}
+ {{
+ token.tokenInfo.value.isMintable ? 'Yes' : 'No'
+ }}
-
-
+
Burnable
- {{ token.tokenInfo.value.isBurnable ? 'Yes' : 'No' }}
+ {{
+ token.tokenInfo.value.isBurnable ? 'Yes' : 'No'
+ }}
-
-
+
Utility
- {{ token.tokenInfo.value.isUtility ? 'Yes' : 'No' }}
+ {{
+ token.tokenInfo.value.isUtility ? 'Yes' : 'No'
+ }}
diff --git a/src/router.ts b/src/router.ts
index 1da184c..e002553 100644
--- a/src/router.ts
+++ b/src/router.ts
@@ -20,7 +20,11 @@ export const router = createRouter({
component: () => import('@/pages/Send.vue'),
meta: { requiresWallet: true, requiresUnlock: true },
},
- { path: '/receive', component: () => import('@/pages/Receive.vue'), meta: { requiresWallet: true } },
+ {
+ path: '/receive',
+ component: () => import('@/pages/Receive.vue'),
+ meta: { requiresWallet: true },
+ },
{
path: '/token/:tokenStandard',
component: () => import('@/pages/TokenDetails.vue'),
diff --git a/src/style.css b/src/style.css
index b416911..74ecc85 100644
--- a/src/style.css
+++ b/src/style.css
@@ -1 +1,3 @@
-@import "@nom/ui/style.css";
+@import "tailwindcss";
+@import "nom-ui/style.css";
+@source "../node_modules/nom-ui/src";
diff --git a/tsconfig.json b/tsconfig.json
index 5987c48..20caf7e 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -18,9 +18,7 @@
"noEmit": true,
"baseUrl": ".",
"paths": {
- "@/*": ["./src/*"],
- "@nom/ui": ["./packages/ui/src"],
- "@nom/ui/*": ["./packages/ui/src/*"]
+ "@/*": ["./src/*"]
}
}
}
diff --git a/vite.config.extension.ts b/vite.config.extension.ts
index 36faf48..e1da802 100644
--- a/vite.config.extension.ts
+++ b/vite.config.extension.ts
@@ -1,16 +1,14 @@
-import { defineConfig } from 'vite'
+import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
-import { crx } from '@crxjs/vite-plugin'
+import {crx} from '@crxjs/vite-plugin'
import manifest from './manifest.json'
-import { resolve } from 'path'
+import {resolve} from 'path'
export default defineConfig({
plugins: [vue(), tailwindcss(), crx({ manifest })],
resolve: {
alias: {
- '@nom/ui/style.css': resolve(__dirname, './packages/ui/src/style.css'),
- '@nom/ui': resolve(__dirname, './packages/ui/src'),
'@': resolve(__dirname, './src'),
},
},
diff --git a/vite.config.web.ts b/vite.config.web.ts
index 09bd7dd..cff9ced 100644
--- a/vite.config.web.ts
+++ b/vite.config.web.ts
@@ -18,7 +18,10 @@ function copyPowFiles(): Plugin {
server.middlewares.use((req, res, next) => {
const name = req.url?.slice(1)
if (name && (POW_FILES as readonly string[]).includes(name)) {
- res.setHeader('Content-Type', name.endsWith('.wasm') ? 'application/wasm' : 'application/javascript')
+ res.setHeader(
+ 'Content-Type',
+ name.endsWith('.wasm') ? 'application/wasm' : 'application/javascript'
+ )
createReadStream(resolve(powSrcDir, name)).pipe(res)
return
}
@@ -51,7 +54,6 @@ export default defineConfig({
resolve: {
alias: {
'@': resolve(__dirname, './src'),
- '@nom/ui': resolve(__dirname, './packages/ui/src'),
},
},
optimizeDeps: {
@@ -60,7 +62,7 @@ export default defineConfig({
global: 'globalThis',
},
},
- exclude: ['znn-typescript-sdk'],
+ exclude: ['znn-typescript-sdk', 'nom-ui'],
},
worker: {
format: 'es',