diff --git a/apps/walletd/components/Wallet/WalletActionsMenu.tsx b/apps/walletd/components/Wallet/WalletActionsMenu.tsx
index af07edcb5..990e4becc 100644
--- a/apps/walletd/components/Wallet/WalletActionsMenu.tsx
+++ b/apps/walletd/components/Wallet/WalletActionsMenu.tsx
@@ -36,11 +36,11 @@ export function WalletActionsMenu() {
variant="accent"
onClick={() => {
if (wallet?.type === 'seed') {
- openDialog('walletSendSiacoinSeed', {
+ openDialog('walletSendSeed', {
walletId,
})
} else if (wallet?.type === 'ledger') {
- openDialog('walletSendSiacoinLedger', {
+ openDialog('walletSendLedger', {
walletId,
})
}
diff --git a/apps/walletd/contexts/dialog.tsx b/apps/walletd/contexts/dialog.tsx
index ad58e2149..fb0f60d18 100644
--- a/apps/walletd/contexts/dialog.tsx
+++ b/apps/walletd/contexts/dialog.tsx
@@ -51,13 +51,13 @@ import {
AddressRemoveDialogParams,
} from '../dialogs/AddressRemoveDialog'
import {
- WalletSendSiacoinSeedDialog,
- WalletSendSiacoinSeedDialogParams,
+ WalletSendSeedDialog,
+ WalletSendSeedDialogParams,
} from '../dialogs/WalletSendSiacoinSeedDialog'
import {
- WalletSendSiacoinLedgerDialog,
- WalletSendSiacoinLedgerDialogParams,
-} from '../dialogs/WalletSendSiacoinLedgerDialog'
+ WalletSendLedgerDialog,
+ WalletSendLedgerDialogParams,
+} from '../dialogs/WalletSendLedgerDialog'
import {
WalletUnlockDialog,
WalletUnlockDialogParams,
@@ -75,8 +75,8 @@ import {
type DialogParams = {
cmdk?: void
settings?: WalletdSettingsDialogParams
- walletSendSiacoinSeed?: WalletSendSiacoinSeedDialogParams
- walletSendSiacoinLedger?: WalletSendSiacoinLedgerDialogParams
+ walletSendSeed?: WalletSendSeedDialogParams
+ walletSendLedger?: WalletSendLedgerDialogParams
transactionDetails?: void
addressUpdate?: AddressUpdateDialogParams
addressRemove?: AddressRemoveDialogParams
@@ -255,22 +255,18 @@ export function Dialogs() {
}
onOpenChange={(val) => (val ? openDialog(dialog) : closeDialog())}
/>
-
- val
- ? openDialog(dialog, params['walletSendSiacoinSeed'])
- : closeDialog()
+ val ? openDialog(dialog, params['walletSendSeed']) : closeDialog()
}
/>
-
- val
- ? openDialog(dialog, params['walletSendSiacoinLedger'])
- : closeDialog()
+ val ? openDialog(dialog, params['walletSendLedger']) : closeDialog()
}
/>
{
+ if (!transactionId) {
+ return null
+ }
+ return (
+
+ )
+ },
+ },
{
id: 'type',
label: 'type',
@@ -68,21 +81,6 @@ export const columns: EventsTableColumn[] = [
)
},
},
- {
- id: 'maturityHeight',
- label: 'maturity height',
- category: 'general',
- render: ({ data: { maturityHeight } }) => {
- if (!maturityHeight) {
- return null
- }
- return (
-
- {maturityHeight.toLocaleString()}
-
- )
- },
- },
{
id: 'timestamp',
label: 'timestamp',
@@ -133,19 +131,6 @@ export const columns: EventsTableColumn[] = [
return
},
},
- {
- id: 'transactionId',
- label: 'transaction ID',
- category: 'general',
- render: ({ data: { transactionId } }) => {
- if (!transactionId) {
- return null
- }
- return (
-
- )
- },
- },
{
id: 'contractId',
label: 'contract ID',
@@ -157,37 +142,4 @@ export const columns: EventsTableColumn[] = [
return
},
},
- {
- id: 'outputId',
- label: 'output ID',
- category: 'general',
- render: ({ data: { outputId } }) => {
- if (!outputId) {
- return null
- }
- return
- },
- },
- {
- id: 'netAddress',
- label: 'net address',
- category: 'general',
- render: ({ data: { netAddress } }) => {
- if (!netAddress) {
- return null
- }
- return
- },
- },
- {
- id: 'publicKey',
- label: 'public key',
- category: 'general',
- render: ({ data: { publicKey } }) => {
- if (!publicKey) {
- return null
- }
- return
- },
- },
]
diff --git a/apps/walletd/contexts/events/index.tsx b/apps/walletd/contexts/events/index.tsx
index 1b368bec9..84f3a611a 100644
--- a/apps/walletd/contexts/events/index.tsx
+++ b/apps/walletd/contexts/events/index.tsx
@@ -4,8 +4,6 @@ import {
useServerFilters,
} from '@siafoundation/design-system'
import {
- WalletEventMinerPayout,
- WalletEventTransaction,
useWalletEvents,
useWalletSubscribe,
useWalletTxPool,
@@ -76,7 +74,8 @@ export function useEventsMain() {
return null
}
const dataTxPool: EventData[] = responseTxPool.data.map((e) => ({
- id: e.ID,
+ id: e.id,
+ transactionId: e.id,
timestamp: 0,
pending: true,
type: e.type,
@@ -87,27 +86,35 @@ export function useEventsMain() {
let amountSf = 0
if (e.type === 'transaction') {
const inputsScTotal =
- e.val?.siacoinInputs?.reduce(
- (acc, o) => acc.plus(o.siacoinOutput.value),
- new BigNumber(0)
- ) || new BigNumber(0)
+ e.val?.siacoinInputs?.reduce((acc, o) => {
+ if (e.relevant.includes(o.siacoinOutput.address)) {
+ return acc.plus(o.siacoinOutput.value)
+ }
+ return acc
+ }, new BigNumber(0)) || new BigNumber(0)
const outputsScTotal =
- e.val?.siacoinOutputs?.reduce(
- (acc, o) => acc.plus(o.siacoinOutput.value),
- new BigNumber(0)
- ) || new BigNumber(0)
+ e.val?.siacoinOutputs?.reduce((acc, o) => {
+ if (e.relevant.includes(o.siacoinOutput.address)) {
+ return acc.plus(o.siacoinOutput.value)
+ }
+ return acc
+ }, new BigNumber(0)) || new BigNumber(0)
amountSc = outputsScTotal.minus(inputsScTotal)
const inputsSfTotal =
- e.val?.siafundInputs?.reduce(
- (acc, o) => acc + o.siafundElement.siafundOutput.value,
- 0
- ) || 0
+ e.val?.siafundInputs?.reduce((acc, o) => {
+ if (e.relevant.includes(o.siafundElement.siafundOutput.address)) {
+ return acc + o.siafundElement.siafundOutput.value
+ }
+ return acc
+ }, 0) || 0
const outputsSfTotal =
- e.val?.siafundOutputs?.reduce(
- (acc, o) => acc + o.siafundOutput.value,
- 0
- ) || 0
+ e.val?.siafundOutputs?.reduce((acc, o) => {
+ if (e.relevant.includes(o.siafundOutput.address)) {
+ return acc + o.siafundOutput.value
+ }
+ return acc
+ }, 0) || 0
amountSf = outputsSfTotal - inputsSfTotal
}
@@ -131,9 +138,9 @@ export function useEventsMain() {
if ('fileContract' in e.val) {
res.contractId = e.val.fileContract.id
}
- if ('transactionID' in e.val) {
- res.id += e.val.transactionID
- res.transactionId = e.val.transactionID
+ if ('id' in e.val) {
+ res.id += e.val.id
+ res.transactionId = e.val.id
}
return res
})
diff --git a/apps/walletd/contexts/events/types.ts b/apps/walletd/contexts/events/types.ts
index fee041eba..9038cb5dd 100644
--- a/apps/walletd/contexts/events/types.ts
+++ b/apps/walletd/contexts/events/types.ts
@@ -2,6 +2,7 @@ import BigNumber from 'bignumber.js'
export type EventData = {
id: string
+ transactionId?: string
timestamp: number
height?: number
pending: boolean
@@ -9,13 +10,13 @@ export type EventData = {
fee?: BigNumber
amountSc?: BigNumber
amountSf?: number
- transactionId?: string
contractId?: string
}
export type TableColumnId =
// | 'actions'
// | 'id'
+ | 'transactionId'
| 'type'
| 'height'
| 'timestamp'
@@ -27,6 +28,7 @@ export type TableColumnId =
export const columnsDefaultVisible: TableColumnId[] = [
// 'actions',
// 'id',
+ 'transactionId',
'type',
'height',
'timestamp',
diff --git a/apps/walletd/dialogs/WalletAddressesGenerateLedgerDialog/index.tsx b/apps/walletd/dialogs/WalletAddressesGenerateLedgerDialog/index.tsx
index b04ea1332..c79cdeda7 100644
--- a/apps/walletd/dialogs/WalletAddressesGenerateLedgerDialog/index.tsx
+++ b/apps/walletd/dialogs/WalletAddressesGenerateLedgerDialog/index.tsx
@@ -224,14 +224,6 @@ export function WalletAddressesGenerateLedgerDialog({
return indiciesWithAddresses
}, [existingAddresses, indices])
- const newIncompleteAddresses = useMemo(
- () =>
- Object.entries(indiciesWithAddresses)
- .filter(([index, item]) => item.isNew && !item.address)
- .map(([index, item]) => item),
- [indiciesWithAddresses]
- )
-
const newGeneratedAddresses = useMemo(
() =>
Object.entries(indiciesWithAddresses)
@@ -287,7 +279,7 @@ export function WalletAddressesGenerateLedgerDialog({
})
const onSubmit = useCallback(async () => {
- if (newIncompleteAddresses.length === 0) {
+ if (newGeneratedAddresses.length === 0) {
triggerErrorToast(
'Add and generate addresses with your Ledger device to continue.'
)
@@ -295,7 +287,7 @@ export function WalletAddressesGenerateLedgerDialog({
}
await saveAddresses()
closeAndReset()
- }, [newIncompleteAddresses, saveAddresses, closeAndReset])
+ }, [newGeneratedAddresses, saveAddresses, closeAndReset])
return (