Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create claimDelegationRewardsPopup #8235

Merged
merged 38 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ff44d76
feat: implement logic to allow tx or not based on mana cost for the X…
cpl121 Mar 6, 2024
46aa693
fixes and clean up
marc2332 Mar 7, 2024
357cedd
Merge branch 'develop-iota2.0' into feat/add-buffer-to-show-mana-cost
cpl121 Mar 8, 2024
0c25980
Merge branch 'develop-iota2.0' into feat/add-buffer-to-show-mana-cost
cpl121 Mar 8, 2024
24899df
Merge branch 'develop-iota2.0' into feat/add-buffer-to-show-mana-cost
marc2332 Mar 11, 2024
37dfe97
Merge branch 'develop-iota2.0' into feat/add-buffer-to-show-mana-cost
cpl121 Mar 12, 2024
f327b18
Merge branch 'develop-iota2.0' into feat/add-buffer-to-show-mana-cost
cpl121 Mar 12, 2024
9f959e7
Merge branch 'develop-iota2.0' into feat/add-buffer-to-show-mana-cost
cpl121 Mar 12, 2024
5b3ce04
Merge branches 'feat/add-buffer-to-show-mana-cost' and 'develop-iota2…
cpl121 Mar 12, 2024
719d742
feat: add mana cost to mint, burn, send and implicitTransition
cpl121 Mar 13, 2024
ba4c3dd
feat: improvements in mana box component
cpl121 Mar 14, 2024
c106747
feat: add mana cost to claim activity
cpl121 Mar 14, 2024
331bddd
feat: add mana cost to create delegation
cpl121 Mar 14, 2024
e46319b
feat: add mana cost to claim shimmer
cpl121 Mar 14, 2024
39bd5f9
Merge branch 'develop-iota2.0' into feat/add-buffer-to-show-mana-cost
cpl121 Mar 14, 2024
efb799c
Merge branch 'feat/add-buffer-to-show-mana-cost' into feat/add-mana-c…
cpl121 Mar 14, 2024
f8e1472
fixes
cpl121 Mar 18, 2024
b40de0c
Merge branches 'feat/add-mana-cost-everywhere' and 'feat/add-buffer-t…
cpl121 Mar 18, 2024
9a428ba
Merge branches 'feat/add-mana-cost-everywhere' and 'develop-iota2.0' …
cpl121 Mar 19, 2024
d837904
fix: add conditional chaining
cpl121 Mar 19, 2024
1e7af29
Merge branches 'feat/add-mana-cost-everywhere' and 'develop-iota2.0' …
cpl121 Mar 20, 2024
4afb2ce
feat: create claimDelegationRewardPopup
evavirseda Mar 20, 2024
0f34d7c
Merge branch 'develop-iota2.0' into feat/add-mana-cost-everywhere
begonaalvarezd Mar 21, 2024
2a73f31
feat: update logic
evavirseda Mar 21, 2024
8113246
Merge branch 'feat/add-mana-cost-everywhere' into feat/create-claim-d…
evavirseda Mar 21, 2024
d3281f7
Merge branch 'develop-iota2.0' into feat/create-claim-delegation.rewa…
evavirseda Mar 21, 2024
4260d6c
Merge branch 'develop-iota2.0' into feat/create-claim-delegation.rewa…
evavirseda Mar 21, 2024
f9881b7
fix: delegation reactivity errors
cpl121 Mar 21, 2024
0ad8893
feat: remove unnecessary code
evavirseda Mar 22, 2024
2287128
fix: closePopup
evavirseda Mar 22, 2024
1ef1f3c
Merge branch 'develop-iota2.0' into feat/create-claim-delegation.rewa…
cpl121 Mar 25, 2024
179fef4
feat: improvements
evavirseda Mar 25, 2024
423ba2a
minor fix
evavirseda Mar 25, 2024
5330661
Merge branch 'develop-iota2.0' into feat/create-claim-delegation.rewa…
begonaalvarezd Mar 25, 2024
33db4be
Merge branch 'develop-iota2.0' into feat/create-claim-delegation.rewa…
evavirseda Mar 27, 2024
c915e1a
Merge branch 'develop-iota2.0' into feat/create-claim-delegation.rewa…
begonaalvarezd Apr 3, 2024
d51045e
Merge branch 'develop-iota2.0' into feat/create-claim-delegation.rewa…
begonaalvarezd Apr 3, 2024
42448d3
chore: minor improvements
begonaalvarezd Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export async function buildWalletState(
hasConsolidatingOutputsTransactionInProgress: false,
hasImplicitAccountCreationTransactionInProgress: false,
hasDelegationTransactionInProgress: false,
hasDelegationRewardClaimTransactionInProgress: false,
isTransferring: false,
votingPower,
walletOutputs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ActivityType,
WalletApiEventHandler,
allWalletActivities,
isDelegationOutput,
syncBalance,
updateAsyncDataByTransactionId,
validateWalletApiEvent,
Expand All @@ -13,6 +14,7 @@ import { SpentOutputWalletEvent, WalletEvent, WalletEventType } from '@iota/sdk/
import { nodeInfoProtocolParameters } from '@core/network'
import { getUnixTimestampFromNodeInfoAndSlotIndex } from '@core/network/helpers/getSlotInfoFromNodeProtocolParameters'
import { get } from 'svelte/store'
import { closePopup } from 'shared/lib/auxiliary/popup'

export function handleSpentOutputEvent(walletId: string): WalletApiEventHandler {
return async (error: Error, rawEvent: WalletEvent) => {
Expand All @@ -26,6 +28,8 @@ export function handleSpentOutputEvent(walletId: string): WalletApiEventHandler
export async function handleSpentOutputEventInternal(walletId: string, payload: SpentOutputWalletEvent): Promise<void> {
const wallet = get(activeWallets)?.find((wallet) => wallet.id === walletId)
const output = payload.output
const _isDelegationOutput = isDelegationOutput(output)

await syncBalance(walletId, true)
if (wallet) {
const walletOutputs = await wallet.outputs()
Expand Down Expand Up @@ -61,4 +65,14 @@ export async function handleSpentOutputEventInternal(walletId: string, payload:
updateNftInAllWalletNfts(walletId, activity.nftId, { isSpendable: false })
}
}

if (_isDelegationOutput) {
if (wallet?.hasDelegationRewardClaimTransactionInProgress) {
cpl121 marked this conversation as resolved.
Show resolved Hide resolved
updateActiveWallet(walletId, {
hasDelegationRewardClaimTransactionInProgress: false,
isTransferring: false,
})
closePopup() // close claimDelegationRewardsPopup when the account output is burned
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface IWalletState extends IWallet, IPersistedWalletData {
hasConsolidatingOutputsTransactionInProgress: boolean
hasImplicitAccountCreationTransactionInProgress: boolean
hasDelegationTransactionInProgress: boolean
hasDelegationRewardClaimTransactionInProgress: boolean
votingPower: string
walletOutputs: OutputData[]
walletUnspentOutputs: OutputData[]
Expand Down
Loading