Skip to content

Commit

Permalink
📦 VERSION: 3.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
AricRedemption committed Sep 9, 2024
1 parent 9b62c19 commit c5a25bb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
12 changes: 1 addition & 11 deletions src/pages/wallet/Asset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,7 @@ const toReceive = () => {
<div>{{ currentMVCWallet?.getAddressType() }}</div>
<div class="flex items-center justify-between text-gray-primary gap-4">
<div class="break-all">{{ currentMVCWallet?.getAddress() }}</div>
<Copy
:text="address"
class="w-[22px]"
@click="
toast({
title: `${currentMVCWallet?.getAddressType()} Address Copied`,
toastType: 'success',
description: address,
})
"
/>
<Copy :text="address" class="w-[22px]" />
</div>
</div>

Expand Down
28 changes: 20 additions & 8 deletions src/queries/utxos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,27 @@ export type MvcUtxo = {

const fetchMVCUtxos = async (address: string, useUnconfirmed = true): Promise<MvcUtxo[]> => {
const net = getNet()
let { list = [] } = await metaletApiV4<{ list: MvcUtxo[] }>('/mvc/address/utxo-list').get({
address,
net,
})
list = list.filter((utxo) => utxo.value >= 600)
if (!useUnconfirmed) {
list = list.filter((utxo) => utxo.height > 0)
let allUtxos: MvcUtxo[] = []
let page = 1
let hasMore = true

while (hasMore) {
const { list = [] } = await metaletApiV4<{ list: MvcUtxo[] }>('/mvc/address/utxo-list').get({
address,
net,
page,
})
let filteredList = list.filter((utxo) => utxo.value >= 600)
if (!useUnconfirmed) {
filteredList = filteredList.filter((utxo) => utxo.height > 0)
}

allUtxos = [...allUtxos, ...filteredList]
hasMore = list.length > 0
page += 1
}
return list

return allUtxos
}

export type Utxo = {
Expand Down

0 comments on commit c5a25bb

Please sign in to comment.