kremalicious/blog

View on GitHub
src/features/Web3/stores/send.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { atom } from 'nanostores'
import { normalizeAmount } from '../lib/normalizeAmount'

export const $isInitSend = atom<boolean>(false)
export const $amount = atom<string>('')
export const $txHash = atom<string | undefined>()

export const $setAmount = (amount: string) => {
  const normalizedAmount = normalizeAmount(amount)
  return $amount.set(normalizedAmount)
}