Skip to content

Commit

Permalink
chore: update UI
Browse files Browse the repository at this point in the history
1. add mint rune amount
2. fix send rune step
  • Loading branch information
AricRedemption committed May 13, 2024
1 parent 76fa2e8 commit e6346b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/data/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface FTAsset extends Asset {
export interface RuneAsset extends Asset {
runeId: string
mintable: boolean
termsAmount: string
remainingMint: string
}

Expand Down
14 changes: 4 additions & 10 deletions src/pages/wallet/MintRune.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import Decimal from 'decimal.js'
import { ref, computed } from 'vue'
import { Psbt } from 'bitcoinjs-lib'
import { sleep } from '@/lib/helpers'
import { useRoute, useRouter } from 'vue-router'
import { useIconsStore } from '@/stores/IconsStore'
import { useRuneDetailQuery } from '@/queries/runes'
Expand All @@ -16,10 +16,8 @@ import { ScriptType, SignType } from '@metalet/utxo-wallet-service'
import TransactionResultModal from './components/TransactionResultModal.vue'
import { AssetLogo, Divider, FlexBox, FeeRateSelector, Button, LoadingText } from '@/components'
import { Drawer, DrawerClose, DrawerContent, DrawerFooter, DrawerHeader } from '@/components/ui/drawer'
import { sleep } from '@/lib/helpers'
const route = useRoute()
const error = ref<Error>()
const router = useRouter()
const totalFee = ref<number>()
const baseRawTx = ref<string>()
Expand Down Expand Up @@ -221,8 +219,8 @@ async function send() {
</FlexBox>
<input
min="0"
type="number"
step="1"
type="number"
v-model="amount"
:max="asset.remainingMint"
class="mt-2 w-full rounded-lg p-3 text-xs border border-gray-soft focus:border-blue-primary focus:outline-none"
Expand Down Expand Up @@ -257,12 +255,8 @@ async function send() {
<Divider class="mt-2" />
<div class="p-4 space-y-4 text-ss">
<FlexBox ai="center" jc="between">
<div class="text-gray-primary">From</div>
<div class="break-all w-[228px]">{{ address }}</div>
</FlexBox>
<FlexBox ai="center" jc="between">
<div class="text-gray-primary">To</div>
<div class="break-all w-[228px]">{{ address }}</div>
<div class="text-gray-primary">Amount</div>
<div class="break-all">{{ (amount || 0) * (Number(asset.termsAmount) || 0) }}</div>
</FlexBox>
<FlexBox ai="center" jc="between">
<div class="text-gray-primary">Repeat Mint</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallet/SendRune.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ async function send() {
type="number"
:max="balance"
v-model="amount"
:step="new Decimal(1).div(10 * asset.decimal).toString()"
:step="new Decimal(1).div(10 ** asset.decimal).toNumber()"
class="mt-2 w-full rounded-lg p-3 text-xs border border-gray-soft focus:border-blue-primary focus:outline-none"
/>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/queries/runes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface RuneBalance {
symbol: string
divisibility: number
mintable: boolean
termsAmount: string
remainingMint: string
}

Expand Down Expand Up @@ -131,6 +132,7 @@ export async function fetchRuneDetail(address: string, runeId: string) {
},
runeId,
mintable: runeDetail.mintable,
termsAmount: runeDetail.termsAmount,
remainingMint: runeDetail.remainingMint,
} as RuneAsset
}
Expand Down

0 comments on commit e6346b4

Please sign in to comment.