change from for of iterator to javascript map
This commit is contained in:
parent
94640c4492
commit
189d4e0f33
@ -62,28 +62,29 @@ const getLockStatus = async (id: [BigNumber]): Promise<number> => {
|
|||||||
const filterLockStatus = async (
|
const filterLockStatus = async (
|
||||||
transactions: Event[]
|
transactions: Event[]
|
||||||
): Promise<WalletTransaction[]> => {
|
): Promise<WalletTransaction[]> => {
|
||||||
const txs = [];
|
const txs = await Promise.all(
|
||||||
|
transactions.map(async (transaction) => {
|
||||||
for (const transaction of transactions) {
|
const tx: WalletTransaction = {
|
||||||
const tx: WalletTransaction = {
|
token: transaction.args?.token ? transaction.args?.token : "",
|
||||||
token: transaction.args?.token ? transaction.args?.token : "",
|
blockNumber: transaction.blockNumber ? transaction.blockNumber : -1,
|
||||||
blockNumber: transaction.blockNumber ? transaction.blockNumber : -1,
|
amount: transaction.args?.amount
|
||||||
amount: transaction.args?.amount
|
? Number(formatEther(transaction.args?.amount))
|
||||||
? Number(formatEther(transaction.args?.amount))
|
|
||||||
: -1,
|
|
||||||
seller: transaction.args?.seller ? transaction.args?.seller : "",
|
|
||||||
buyer: transaction.args?.buyer ? transaction.args?.buyer : "",
|
|
||||||
event: transaction.event ? transaction.event : "",
|
|
||||||
lockStatus:
|
|
||||||
transaction.event == "LockAdded"
|
|
||||||
? await getLockStatus(transaction.args?.lockID)
|
|
||||||
: -1,
|
: -1,
|
||||||
transactionHash: transaction.transactionHash
|
seller: transaction.args?.seller ? transaction.args?.seller : "",
|
||||||
? transaction.transactionHash
|
buyer: transaction.args?.buyer ? transaction.args?.buyer : "",
|
||||||
: "",
|
event: transaction.event ? transaction.event : "",
|
||||||
};
|
lockStatus:
|
||||||
txs.push(tx);
|
transaction.event == "LockAdded"
|
||||||
}
|
? await getLockStatus(transaction.args?.lockID)
|
||||||
|
: -1,
|
||||||
|
transactionHash: transaction.transactionHash
|
||||||
|
? transaction.transactionHash
|
||||||
|
: "",
|
||||||
|
};
|
||||||
|
|
||||||
|
return tx;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
return txs;
|
return txs;
|
||||||
};
|
};
|
||||||
|
@ -118,7 +118,9 @@ onClickOutside(infoMenuRef, () => {
|
|||||||
:to="'/faq'"
|
:to="'/faq'"
|
||||||
class="menu-button gap-2 px-4 rounded-md cursor-pointer"
|
class="menu-button gap-2 px-4 rounded-md cursor-pointer"
|
||||||
>
|
>
|
||||||
<span class="text-gray-900 py-4 text-end font-semibold text-sm whitespace-nowrap">
|
<span
|
||||||
|
class="text-gray-900 py-4 text-end font-semibold text-sm whitespace-nowrap"
|
||||||
|
>
|
||||||
Perguntas frequentes
|
Perguntas frequentes
|
||||||
</span>
|
</span>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user