diff --git a/.dockerignore b/.dockerignore index d493a5c..bd9cc2b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -60,3 +60,5 @@ docker-compose*.yml tsconfig.tsbuildinfo + + diff --git a/src/components/pages/wallet/governance/drep/updateDrep.tsx b/src/components/pages/wallet/governance/drep/updateDrep.tsx index a5cee34..b9365e8 100644 --- a/src/components/pages/wallet/governance/drep/updateDrep.tsx +++ b/src/components/pages/wallet/governance/drep/updateDrep.tsx @@ -82,9 +82,7 @@ export default function UpdateDRep({ onClose }: UpdateDRepProps = {}) { if (!appWallet) { throw new Error("Wallet not connected"); } - if (!multisigWallet) { - throw new Error("Multisig wallet not connected"); - } + // Note: multisigWallet can be undefined for legacy wallets, which is handled in updateDrep() // Get metadata with both compacted (for upload) and normalized (for hashing) forms const metadataResult = await getDRepMetadata( formState, @@ -113,8 +111,13 @@ export default function UpdateDRep({ onClose }: UpdateDRepProps = {}) { } async function updateProxyDrep(): Promise { - if (!connected || !userAddress || !multisigWallet || !appWallet) { - throw new Error("Multisig wallet not connected"); + if (!connected || !userAddress || !appWallet) { + throw new Error("Wallet not connected"); + } + // Proxy mode requires multisigWallet (SDK wallets only) + if (!multisigWallet) { + // Fall back to standard update for legacy wallets + return updateDrep(); } if (!hasValidProxy) { // Fall back to standard update if no valid proxy @@ -175,25 +178,47 @@ export default function UpdateDRep({ onClose }: UpdateDRepProps = {}) { } async function updateDrep(): Promise { - if (!connected || !userAddress || !multisigWallet || !appWallet) - throw new Error("Multisig wallet not connected"); + if (!connected || !userAddress || !appWallet) + throw new Error("Wallet not connected"); setLoading(true); const txBuilder = getTxBuilder(network); - const drepData = multisigWallet?.getDRep(appWallet); - if (!drepData) { - throw new Error("DRep not found"); - } - const { dRepId, drepCbor } = drepData; + // For legacy wallets (no multisigWallet), use appWallet values directly (preserves input order) + // For SDK wallets, use multisigWallet to compute DRep ID and script + let dRepId: string; + let drepCbor: string; + let scriptCbor: string; + let changeAddress: string; - const scriptCbor = multisigWallet?.getKeysByRole(3) ? multisigWallet?.getScript().scriptCbor : appWallet.scriptCbor; - if (!scriptCbor) { - throw new Error("Script not found"); + if (multisigWallet) { + const drepData = multisigWallet.getDRep(appWallet); + if (!drepData) { + throw new Error("DRep not found"); + } + dRepId = drepData.dRepId; + drepCbor = drepData.drepCbor; + const multisigScript = multisigWallet.getScript(); + const multisigScriptCbor = multisigScript.scriptCbor; + const appScriptCbor = appWallet.scriptCbor; + if (!multisigScriptCbor && !appScriptCbor) { + throw new Error("Script CBOR not found"); + } + scriptCbor = multisigWallet.getKeysByRole(3) ? (multisigScriptCbor || appScriptCbor!) : (appScriptCbor || multisigScriptCbor!); + changeAddress = multisigScript.address; + } else { + // Legacy wallet: use appWallet values (computed with input order preserved) + if (!appWallet.dRepId || !appWallet.scriptCbor) { + throw new Error("DRep ID or script not found for legacy wallet"); + } + dRepId = appWallet.dRepId; + drepCbor = appWallet.scriptCbor; // Use payment script CBOR for legacy wallets + scriptCbor = appWallet.scriptCbor; + changeAddress = appWallet.address; } - const changeAddress = multisigWallet?.getKeysByRole(3) ? multisigWallet?.getScript().address : appWallet.address; - if (!changeAddress) { - throw new Error("Change address not found"); + + if (!scriptCbor || !changeAddress) { + throw new Error("Script or change address not found"); } try { const { anchorUrl, anchorHash } = await createAnchor(); diff --git a/src/components/pages/wallet/new-transaction/index.tsx b/src/components/pages/wallet/new-transaction/index.tsx index bfd7720..4d20abe 100644 --- a/src/components/pages/wallet/new-transaction/index.tsx +++ b/src/components/pages/wallet/new-transaction/index.tsx @@ -530,16 +530,21 @@ export default function PageNewTransaction({ onSuccess }: { onSuccess?: () => vo return null; } + // Check if component is used in a modal (has onSuccess prop) + const isInModal = !!onSuccess; + return ( -
+
{/* Hide title/description when used in modal (they're in DialogHeader) */} -
- New Transaction -

- Create a new multisig transaction by specifying recipients, amounts, - and transaction details. -

-
+ {!isInModal && ( +
+ New Transaction +

+ Create a new multisig transaction by specifying recipients, amounts, + and transaction details. +

+
+ )}
diff --git a/src/components/pages/wallet/transactions/new-transaction-dialog.tsx b/src/components/pages/wallet/transactions/new-transaction-dialog.tsx index 318fc55..e4530b4 100644 --- a/src/components/pages/wallet/transactions/new-transaction-dialog.tsx +++ b/src/components/pages/wallet/transactions/new-transaction-dialog.tsx @@ -30,10 +30,10 @@ export default function NewTransactionDialog({ return ( - +
{/* Sticky Header */} - + New Transaction Create a new multisig transaction by specifying recipients, amounts, @@ -42,7 +42,7 @@ export default function NewTransactionDialog({ {/* Scrollable Content */} -
+
diff --git a/src/components/pages/wallet/transactions/transaction-card.tsx b/src/components/pages/wallet/transactions/transaction-card.tsx index bfa1bc4..e37524f 100644 --- a/src/components/pages/wallet/transactions/transaction-card.tsx +++ b/src/components/pages/wallet/transactions/transaction-card.tsx @@ -379,8 +379,8 @@ export default function TransactionCard({ ); })}
-
- +
+ to {output.address.length > 20 ? `${output.address.slice(0, 10)}...${output.address.slice(-10)}` : output.address} @@ -388,17 +388,24 @@ export default function TransactionCard({ {(() => { const addressLabel = getAddressLabel(output.address); if (addressLabel.label) { + // Use shorter label on mobile for "Self (Multisig)" + const displayLabel = addressLabel.type === "self" && addressLabel.label === "Self (Multisig)" + ? "Self" + : addressLabel.label; + return ( - {addressLabel.label} + {addressLabel.label} + {displayLabel} ); } @@ -931,12 +938,12 @@ export default function TransactionCard({ {userAddress && !transaction.signedAddresses.includes(userAddress) && !transaction.rejectedAddresses.includes(userAddress) && ( - + )}